@opencraw/studio 0.0.29 → 0.0.30
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,38 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return D(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function te(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function ne(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function re(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,re(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+te(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),re(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+te(a,u),c+=re(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+te(a,u++),c+=re(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return re(ne(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function j(e,t,n){if(e==null)return e;var r=[],i=0;return re(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ie(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ae=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function oe(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ae)}catch(e){ae(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function se(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else oe(se.bind(null,e))}var M={map:j,forEach:function(e,t,n){j(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return j(e,function(){t++}),t},toArray:function(e){return j(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=M,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=se,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ie}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=oe,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,ee());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ee():S=!1}}}var ee;if(typeof y==`function`)ee=function(){y(D)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,k=O.port2;O.port1.onmessage=D,ee=function(){k.postMessage(null)}}else ee=function(){_(D,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,ee()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),m=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,ee=Symbol.for(`react.element`),O=Symbol.for(`react.transitional.element`),k=Symbol.for(`react.portal`),A=Symbol.for(`react.fragment`),te=Symbol.for(`react.strict_mode`),ne=Symbol.for(`react.profiler`),re=Symbol.for(`react.consumer`),j=Symbol.for(`react.context`),ie=Symbol.for(`react.forward_ref`),ae=Symbol.for(`react.suspense`),oe=Symbol.for(`react.suspense_list`),se=Symbol.for(`react.memo`),M=Symbol.for(`react.lazy`),ce=Symbol.for(`react.activity`),le=Symbol.for(`react.legacy_hidden`),ue=Symbol.for(`react.memo_cache_sentinel`),de=Symbol.for(`react.view_transition`),fe=Symbol.for(`react.recoverable`),pe=Symbol.iterator;function me(e){return typeof e!=`object`||!e?null:(e=pe&&e[pe]||e[`@@iterator`],typeof e==`function`?e:null)}var he=Symbol.for(`react.client.reference`);function ge(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===he?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case A:return`Fragment`;case ne:return`Profiler`;case te:return`StrictMode`;case ae:return`Suspense`;case oe:return`SuspenseList`;case ce:return`Activity`;case de:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case k:return`Portal`;case j:return e.displayName||`Context`;case re:return(e._context.displayName||`Context`)+`.Consumer`;case ie:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case se:return t=e.displayName||null,t===null?ge(e.type)||`Memo`:t;case M:t=e._payload,e=e._init;try{return ge(e(t))}catch{}}return null}var _e=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve={pending:!1,data:null,method:null,action:null},ye=[],be=-1;function xe(e){return{current:e}}function Se(e){0>be||(e.current=ye[be],ye[be]=null,be--)}function Ce(e,t){be++,ye[be]=e.current,e.current=t}var we=xe(null),Te=xe(null),Ee=xe(null),De=xe(null);function Oe(e,t){switch(Ce(Ee,t),Ce(Te,e),Ce(we,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?xp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=xp(t),e=Sp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Se(we),Ce(we,e)}function ke(){Se(we),Se(Te),Se(Ee)}function Ae(e){var t=e.memoizedState;t!==null&&(_h._currentValue=t.memoizedState,Ce(De,e)),t=we.current;var n=Sp(t,e.type);t!==n&&(Ce(Te,e),Ce(we,n))}function je(e){Te.current===e&&(Se(we),Se(Te)),De.current===e&&(Se(De),_h._currentValue=ve)}var Me,Ne;function Pe(e){if(Me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Me=t&&t[1]||``,Ne=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+Me+e+Ne}var Fe=!1;function Ie(e,t){if(!e||Fe)return``;Fe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
+
`),l=s.split(`
|
|
5
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Fe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Pe(n):``}function Le(e,t){switch(e.tag){case 26:case 27:case 5:return Pe(e.type);case 16:return Pe(`Lazy`);case 13:return e.child!==t&&t!==null?Pe(`Suspense Fallback`):Pe(`Suspense`);case 19:return Pe(`SuspenseList`);case 0:case 15:return Ie(e.type,!1);case 11:return Ie(e.type.render,!1);case 1:return Ie(e.type,!0);case 31:return Pe(`Activity`);case 30:return Pe(`ViewTransition`);default:return``}}function Re(e){try{var t=``,n=null;do t+=Le(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var ze=Object.prototype.hasOwnProperty,Be=t.unstable_scheduleCallback,Ve=t.unstable_cancelCallback,He=t.unstable_shouldYield,Ue=t.unstable_requestPaint,We=t.unstable_now,Ge=t.unstable_getCurrentPriorityLevel,Ke=t.unstable_ImmediatePriority,qe=t.unstable_UserBlockingPriority,Je=t.unstable_NormalPriority,Ye=t.unstable_LowPriority,Xe=t.unstable_IdlePriority,Ze=t.log,Qe=t.unstable_setDisableYieldValue,$e=null,F=null;function et(e){if(typeof Ze==`function`&&Qe(e),F&&typeof F.setStrictMode==`function`)try{F.setStrictMode($e,e)}catch{}}var tt=Math.clz32?Math.clz32:rt,I=Math.log,nt=Math.LN2;function rt(e){return e>>>=0,e===0?32:31-(I(e)/nt|0)|0}var it=256,at=262144,ot=4194304;function st(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ct(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=st(n))):i=st(o):i=st(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=st(n))):i=st(o)):i=st(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function lt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ut(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-tt(n),i=1<<r;t|=e[r],n&=~i}return t}function dt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ft(){var e=ot;return ot<<=1,!(ot&62914560)&&(ot=4194304),e}function pt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function mt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ht(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-tt(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&>(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function gt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-tt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function _t(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-tt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function vt(e,t){var n=t&-t;return n=n&42?1:yt(n),(n&(e.suspendedLanes|t))===0?n:0}function yt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function bt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function xt(){var e=P.p;return e===0?(e=window.event,e===void 0?32:Nh(e.type)):e}function St(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var Ct=Math.random().toString(36).slice(2),wt=`__reactFiber$`+Ct,Tt=`__reactProps$`+Ct,Et=`__reactContainer$`+Ct,Dt=`__reactEvents$`+Ct,Ot=`__reactListeners$`+Ct,kt=`__reactHandles$`+Ct,At=`__reactResources$`+Ct,jt=`__reactMarker$`+Ct,Mt=`__reactLoad$`+Ct;function Nt(e){delete e[wt],delete e[Tt],delete e[Ot],delete e[kt]}function Pt(e){var t;if(t=e[wt])return t;for(var n=e.parentNode;n;){if(t=n[Et]||n[wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Sm(e);e!==null;){if(n=e[wt])return n;e=Sm(e)}return t}e=n,n=e.parentNode}return null}function Ft(e){if(e=e[wt]||e[Et]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function It(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Lt(e){var t=e[At];return t||=e[At]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Rt(e){e[jt]=!0}function zt(e){e[Mt]=void 0}var Bt=new Set,Vt={};function Ht(e,t){Ut(e,t),Ut(e+`Capture`,t)}function Ut(e,t){for(Vt[e]=t,e=0;e<t.length;e++)Bt.add(t[e])}var Wt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Gt={},Kt={};function qt(e){return ze.call(Kt,e)?!0:ze.call(Gt,e)?!1:Wt.test(e)?Kt[e]=!0:(Gt[e]=!0,!1)}var Jt=!1;function Yt(){var e=Jt;return Jt=!1,e}function Xt(e,t,n){if(qt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Zt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Qt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function $t(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function en(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function tn(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function nn(e){if(!e._valueTracker){var t=en(e)?`checked`:`value`;e._valueTracker=tn(e,t,``+e[t])}}function rn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=en(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var an=/[\n"\\]/g;function on(e){return e.replace(an,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function sn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+$t(t)):e.value!==``+$t(t)&&(e.value=``+$t(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):ln(e,$t(n)):o===`number`&&e.value==t?ln(e,$t(e.value)):ln(e,$t(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+$t(s):e.removeAttribute(`name`)}function cn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){nn(e);return}n=n==null?``:``+$t(n),t=t==null?n:``+$t(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),nn(e)}function ln(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function un(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+$t(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function dn(e,t,n){if(t!=null&&(t=``+$t(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+$t(n)}function fn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(_e(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=$t(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),nn(e)}function pn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var mn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function hn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||mn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function gn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Jt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(hn(e,a,r),Jt=!0)}else for(var o in t)t.hasOwnProperty(o)&&hn(e,o,t[o])}function _n(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var vn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),yn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function L(e){return yn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function bn(){}var xn=null;function Sn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cn=null,wn=null;function Tn(e){var t=Ft(e);if(t&&(e=t.stateNode)){var n=e[Tt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(sn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+on(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Tt]||null;if(!a)throw Error(i(90));sn(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&rn(r)}break a;case`textarea`:dn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&un(e,!!n.multiple,t,!1)}}}var En=!1;function Dn(e,t,n){if(En)return e(t,n);En=!0;try{return e(t)}finally{if(En=!1,(Cn!==null||wn!==null)&&(qd(),Cn&&(t=Cn,e=wn,wn=Cn=null,Tn(t),e)))for(t=0;t<e.length;t++)Tn(e[t])}}function On(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Tt]||null;if(r===null)return null;n=r[t];a:switch(t){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)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var kn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,An=!1;if(kn)try{var jn={};Object.defineProperty(jn,"passive",{get:function(){An=!0}}),window.addEventListener(`test`,jn,jn),window.removeEventListener(`test`,jn,jn)}catch{An=!1}var Mn=null,Nn=null,Pn=null;function Fn(){if(Pn)return Pn;var e,t=Nn,n=t.length,r,i=`value`in Mn?Mn.value:Mn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Pn=i.slice(e,1<r?1-r:void 0)}function In(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ln(){return!0}function Rn(){return!1}function zn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Ln:Rn,this.isPropagationStopped=Rn,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Ln)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Ln)},persist:function(){},isPersistent:Ln}),t}var Bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vn=zn(Bn),Hn=D({},Bn,{view:0,detail:0}),Un=zn(Hn),Wn,Gn,Kn,qn=D({},Hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ir,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Kn&&(Kn&&e.type===`mousemove`?(Wn=e.screenX-Kn.screenX,Gn=e.screenY-Kn.screenY):Gn=Wn=0,Kn=e),Wn)},movementY:function(e){return`movementY`in e?e.movementY:Gn}}),Jn=zn(qn),Yn=zn(D({},qn,{dataTransfer:0})),Xn=zn(D({},Hn,{relatedTarget:0})),Zn=zn(D({},Bn,{animationName:0,elapsedTime:0,pseudoElement:0})),Qn=zn(D({},Bn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),$n=zn(D({},Bn,{data:0})),er={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},tr={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`},nr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function rr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=nr[e])?!!t[e]:!1}function ir(){return rr}var ar=zn(D({},Hn,{key:function(e){if(e.key){var t=er[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=In(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?tr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ir,charCode:function(e){return e.type===`keypress`?In(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?In(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),or=zn(D({},qn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),sr=zn(D({},Bn,{submitter:0})),cr=zn(D({},Hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ir})),lr=zn(D({},Bn,{propertyName:0,elapsedTime:0,pseudoElement:0})),ur=zn(D({},qn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),dr=zn(D({},Bn,{newState:0,oldState:0,source:0})),fr=[9,13,27,32],pr=kn&&`CompositionEvent`in window,mr=null;kn&&`documentMode`in document&&(mr=document.documentMode);var hr=kn&&`TextEvent`in window&&!mr,gr=kn&&(!pr||mr&&8<mr&&11>=mr),_r=` `,vr=!1;function yr(e,t){switch(e){case`keyup`:return fr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function br(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var xr=!1;function Sr(e,t){switch(e){case`compositionend`:return br(t);case`keypress`:return t.which===32?(vr=!0,_r):null;case`textInput`:return e=t.data,e===_r&&vr?null:e;default:return null}}function Cr(e,t){if(xr)return e===`compositionend`||!pr&&yr(e,t)?(e=Fn(),Pn=Nn=Mn=null,xr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return gr&&t.locale!==`ko`?null:t.data;default:return null}}var wr={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 Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!wr[e.type]:t===`textarea`}function Er(e,t,n,r){Cn?wn?wn.push(r):wn=[r]:Cn=r,t=ip(t,`onChange`),0<t.length&&(n=new Vn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Dr=null,Or=null;function kr(e){Xf(e,0)}function Ar(e){if(rn(It(e)))return e}function jr(e,t){if(e===`change`)return t}var Mr=!1;if(kn){var Nr;if(kn){var Pr=`oninput`in document;if(!Pr){var Fr=document.createElement(`div`);Fr.setAttribute(`oninput`,`return;`),Pr=typeof Fr.oninput==`function`}Nr=Pr}else Nr=!1;Mr=Nr&&(!document.documentMode||9<document.documentMode)}function Ir(){Dr&&(Dr.detachEvent(`onpropertychange`,Lr),Or=Dr=null)}function Lr(e){if(e.propertyName===`value`&&Ar(Or)){var t=[];Er(t,Or,e,Sn(e)),Dn(kr,t)}}function Rr(e,t,n){e===`focusin`?(Ir(),Dr=t,Or=n,Dr.attachEvent(`onpropertychange`,Lr)):e===`focusout`&&Ir()}function zr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Ar(Or)}function Br(e,t){if(e===`click`)return Ar(t)}function R(e,t){if(e===`input`||e===`change`)return Ar(t)}function Vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Hr=typeof Object.is==`function`?Object.is:Vr;function Ur(e,t){if(Hr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ze.call(t,i)||!Hr(e[i],t[i]))return!1}return!0}function Wr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Gr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kr(e,t){var n=Gr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Gr(n)}}function qr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Wr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Wr(e.document)}return t}function Yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Xr=kn&&`documentMode`in document&&11>=document.documentMode,Zr=null,Qr=null,$r=null,ei=!1;function ti(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ei||Zr==null||Zr!==Wr(r)||(r=Zr,`selectionStart`in r&&Yr(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}),$r&&Ur($r,r)||($r=r,r=ip(Qr,`onSelect`),0<r.length&&(t=new Vn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Zr)))}function ni(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ri={animationend:ni(`Animation`,`AnimationEnd`),animationiteration:ni(`Animation`,`AnimationIteration`),animationstart:ni(`Animation`,`AnimationStart`),transitionrun:ni(`Transition`,`TransitionRun`),transitionstart:ni(`Transition`,`TransitionStart`),transitioncancel:ni(`Transition`,`TransitionCancel`),transitionend:ni(`Transition`,`TransitionEnd`)},ii={},ai={};kn&&(ai=document.createElement(`div`).style,`AnimationEvent`in window||(delete ri.animationend.animation,delete ri.animationiteration.animation,delete ri.animationstart.animation),`TransitionEvent`in window||delete ri.transitionend.transition);function oi(e){if(ii[e])return ii[e];if(!ri[e])return e;var t=ri[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ai)return ii[e]=t[n];return e}var si=oi(`animationend`),ci=oi(`animationiteration`),li=oi(`animationstart`),ui=oi(`transitionrun`),di=oi(`transitionstart`),fi=oi(`transitioncancel`),pi=oi(`transitionend`),mi=new Map,hi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);hi.push(`scrollEnd`);function gi(e,t){mi.set(e,t),Ht(t,[e])}var _i=0;function vi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Od.identifierPrefix;var n=_i++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function yi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Id;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function bi(e,t){return e=yi(e),t=yi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var z=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},xi=[],Si=0,Ci=0;function wi(){for(var e=Si,t=Ci=Si=0;t<e;){var n=xi[t];xi[t++]=null;var r=xi[t];xi[t++]=null;var i=xi[t];xi[t++]=null;var a=xi[t];if(xi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Oi(n,i,a)}}function Ti(e,t,n,r){xi[Si++]=e,xi[Si++]=t,xi[Si++]=n,xi[Si++]=r,Ci|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ei(e,t,n,r){return Ti(e,t,n,r),ki(e)}function Di(e,t){return Ti(e,null,null,t),ki(e)}function Oi(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-tt(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ki(e){if(50<Ld)throw Ld=0,Rd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ai={};function ji(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mi(e,t,n,r){return new ji(e,t,n,r)}function Ni(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Pi(e,t){var n=e.alternate;return n===null?(n=Mi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Fi(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ii(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Ni(r)&&(s=1);else if(typeof r==`string`)s=rh(e,n,we.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ce:return e=Mi(31,n,t,a),e.elementType=ce,e.lanes=o,e;case A:return Li(n.children,a,o,t);case te:s=8,a|=24;break;case ne:return e=Mi(12,n,t,a|2),e.elementType=ne,e.lanes=o,e;case ae:return e=Mi(13,n,t,a),e.elementType=ae,e.lanes=o,e;case oe:return e=Mi(19,n,t,a),e.elementType=oe,e.lanes=o,e;case le:case de:return e=a|32,e=Mi(30,n,t,e),e.elementType=de,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case j:s=10;break a;case re:s=9;break a;case ie:s=11;break a;case se:s=14;break a;case M:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Mi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Li(e,t,n,r){return e=Mi(7,e,r,t),e.lanes=n,e}function Ri(e,t,n){return e=Mi(6,e,null,t),e.lanes=n,e}function zi(e){var t=Mi(18,null,null,0);return t.stateNode=e,t}function Bi(e,t,n){return t=Mi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Vi=new WeakMap;function Hi(e,t){if(typeof e==`object`&&e){var n=Vi.get(e);return n===void 0?(t={value:e,source:t,stack:Re(t)},Vi.set(e,t),t):n}return{value:e,source:t,stack:Re(t)}}var Ui=[],Wi=0,Gi=null,Ki=0,qi=[],Ji=0,Yi=null,Xi=1,Zi=``;function Qi(e,t){Ui[Wi++]=Ki,Ui[Wi++]=Gi,Gi=e,Ki=t}function $i(e,t,n){qi[Ji++]=Xi,qi[Ji++]=Zi,qi[Ji++]=Yi,Yi=e;var r=Xi;e=Zi;var i=32-tt(r)-1;r&=~(1<<i),n+=1;var a=32-tt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Xi=1<<32-tt(t)+i|n<<i|r,Zi=a+e}else Xi=1<<a|n<<i|r,Zi=e}function ea(e){e.return!==null&&(Qi(e,1),$i(e,1,0))}function ta(e){for(;e===Gi;)Gi=Ui[--Wi],Ui[Wi]=null,Ki=Ui[--Wi],Ui[Wi]=null;for(;e===Yi;)Yi=qi[--Ji],qi[Ji]=null,Zi=qi[--Ji],qi[Ji]=null,Xi=qi[--Ji],qi[Ji]=null}function na(e,t){qi[Ji++]=Xi,qi[Ji++]=Zi,qi[Ji++]=Yi,Xi=t.id,Zi=t.overflow,Yi=e}var ra=null,ia=null,aa=!1,oa=null,sa=!1,ca=Error(i(519));function la(e){throw ha(Hi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ca}function ua(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[wt]=e,t[Tt]=r,n){case`dialog`:Zf(`cancel`,t),Zf(`close`,t);break;case`iframe`:case`object`:case`embed`:Zf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Jf.length;n++)Zf(Jf[n],t);break;case`source`:Zf(`error`,t);break;case`img`:case`image`:case`link`:Zf(`error`,t),Zf(`load`,t);break;case`details`:Zf(`toggle`,t);break;case`input`:Zf(`invalid`,t),cn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Zf(`invalid`,t);break;case`textarea`:Zf(`invalid`,t),fn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||up(t.textContent,n)?(r.popover!=null&&(Zf(`beforetoggle`,t),Zf(`toggle`,t)),r.onScroll!=null&&Zf(`scroll`,t),r.onScrollEnd!=null&&Zf(`scrollend`,t),r.onClick!=null&&(t.onclick=bn),t=!0):t=!1,t||la(e,!0)}function da(e){for(ra=e.return;ra;)switch(ra.tag){case 5:case 31:case 13:sa=!1;return;case 27:case 3:sa=!0;return;default:ra=ra.return}}function fa(e){if(e!==ra)return!1;if(!aa)return da(e),aa=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||wp(e.type,e.memoizedProps)),n=!n),n&&ia&&la(e),da(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ia=xm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ia=xm(e)}else t===27?(t=ia,Mp(e.type)?(e=bm,bm=null,ia=e):ia=t):ia=ra?ym(e.stateNode.nextSibling):null;return!0}function pa(){ia=ra=null,aa=!1}function ma(){var e=oa;return e!==null&&(bd===null?bd=e:bd.push.apply(bd,e),oa=null),e}function ha(e){oa===null?oa=[e]:oa.push(e)}var ga=xe(null),_a=null,va=null;function ya(e,t,n){Ce(ga,t._currentValue),t._currentValue=n}function ba(e){e._currentValue=ga.current,Se(ga)}function xa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Sa(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),xa(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),xa(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),xa(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ca(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Hr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===De.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[_h]:e.push(_h))}a=a.return}return e!==null&&Sa(t,e,n,r),t.flags|=262144,e!==null}function wa(e){for(e=e.firstContext;e!==null;){if(!Hr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ta(e){_a=e,va=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ea(e){return Oa(_a,e)}function Da(e,t){return _a===null&&Ta(e),Oa(e,t)}function Oa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},va===null){if(e===null)throw Error(i(308));va=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else va=va.next=t;return n}var ka=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Aa=t.unstable_scheduleCallback,ja=t.unstable_NormalPriority,Ma={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Na(){return{controller:new ka,data:new Map,refCount:0}}function Pa(e){e.refCount--,e.refCount===0&&Aa(ja,function(){e.controller.abort()})}function Fa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ia=null;function La(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ra=null,za=0,Ba=0,Va=null;function Ha(e,t){if(Ra===null){var n=Ra=[];za=0,Ba=Uf(),Va={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return za++,t.then(Ua,Ua),t}function Ua(){if(--za===0&&(Ia=null,Ra!==null)){Va!==null&&(Va.status=`fulfilled`);var e=Ra;Ra=null,Ba=0,Va=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ga=N.S;N.S=function(e,t){if(Cd=We(),typeof t==`object`&&t&&typeof t.then==`function`&&Ha(e,t),Ia!==null)for(var n=kf;n!==null;)Fa(n,Ia),n=n.next;if(n=e.types,n!==null){for(var r=kf;r!==null;)Fa(r,n),r=r.next;if(Ba!==0){r=Ia,r===null&&(r=Ia=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ga!==null&&Ga(e,t)};var Ka=xe(null);function qa(){var e=Ka.current;return e===null?id.pooledCache:e}function Ja(e,t){t===null?Ce(Ka,Ka.current):Ce(Ka,t.pool)}function Ya(){var e=qa();return e===null?null:{parent:Ma._currentValue,pool:e}}var Xa=Error(i(460)),Za=Error(i(474)),Qa=Error(i(542)),$a={then:function(){}};function eo(e){return e=e.status,e===`fulfilled`||e===`rejected`}function to(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(bn,bn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ao(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(bn,bn);else{if(e=id,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ao(e),e}throw ro=t,Xa}}function no(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ro=e,Xa):e}}var ro=null;function io(){if(ro===null)throw Error(i(459));var e=ro;return ro=null,e}function ao(e){if(e===Xa||e===Qa)throw Error(i(483))}var oo=null,so=0;function co(e){var t=so;return so+=1,oo===null&&(oo=[]),to(oo,e,t)}function lo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function uo(e,t){throw t.$$typeof===ee?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function fo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Pi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ri(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===A?(e=d(e,t,n.props.children,r,n.key),lo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===M&&no(i)===t.type)?(t=a(t,n.props),lo(t,n),t.return=e,t):(t=Ii(n.type,n.key,n.props,null,e.mode,r),lo(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Bi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Li(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ri(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case O:return n=Ii(t.type,t.key,t.props,null,e.mode,n),lo(n,t),n.return=e,n;case k:return t=Bi(t,e.mode,n),t.return=e,t;case M:return t=no(t),f(e,t,n)}if(_e(t)||me(t))return t=Li(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,co(t),n);if(t.$$typeof===j)return f(e,Da(e,t),n);uo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case O:return n.key===i?l(e,t,n,r):null;case k:return n.key===i?u(e,t,n,r):null;case M:return n=no(n),p(e,t,n,r)}if(_e(n)||me(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,co(n),r);if(n.$$typeof===j)return p(e,t,Da(e,n),r);uo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case O:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case k:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case M:return r=no(r),m(e,t,n,r,i)}if(_e(r)||me(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,co(r),i);if(r.$$typeof===j)return m(e,t,n,Da(t,r),i);uo(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),aa&&Qi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return aa&&Qi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),aa&&Qi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),aa&&Qi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return aa&&Qi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),aa&&Qi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===A&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case O:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===A){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),lo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===M&&no(l)===r.type){n(e,r.sibling),c=a(r,o.props),lo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===A?(c=Li(o.props.children,e.mode,c,o.key),lo(c,o),c.return=e,e=c):(c=Ii(o.type,o.key,o.props,null,e.mode,c),lo(c,o),c.return=e,e=c)}return s(e);case k:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Bi(o,e.mode,c),c.return=e,e=c}return s(e);case M:return o=no(o),_(e,r,o,c)}if(_e(o))return h(e,r,o,c);if(me(o)){if(l=me(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,co(o),c);if(o.$$typeof===j)return _(e,r,Da(e,o),c);uo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Ri(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{so=0;var i=_(e,t,n,r);return oo=null,i}catch(t){if(t===Xa||t===Qa)throw t;var a=Mi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var po=fo(!0),mo=fo(!1),ho=!1;function go(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _o(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function vo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function yo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,rd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ki(e),Oi(e,null,n),t}return Ti(e,r,t,n),ki(e)}function bo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_t(e,n)}}function xo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var So=!1;function Co(){if(So){var e=Va;if(e!==null)throw e}}function wo(e,t,n,r){So=!1;var i=e.updateQueue;ho=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(od&f)===f:(r&f)===f){f!==0&&f===Ba&&(So=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:ho=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),md|=o,e.lanes=o,e.memoizedState=d}}function To(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Eo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)To(n[e],t)}var Do=xe(null),Oo=xe(0);function ko(e,t){e=fd,Ce(Oo,e),Ce(Do,t),fd=e|t.baseLanes}function Ao(){Ce(Oo,fd),Ce(Do,Do.current)}function jo(){fd=Oo.current,Se(Do),Se(Oo)}var Mo=xe(null),No=null;function Po(e){var t=e.alternate;Ce(zo,zo.current&1),Ce(Mo,e),No===null&&(t===null||Do.current!==null||t.memoizedState!==null)&&(No=e)}function Fo(e){Ce(zo,zo.current),Ce(Mo,e),No===null&&(No=e)}function Io(e){e.tag===22?(Ce(zo,zo.current),Ce(Mo,e),No===null&&(No=e)):Lo()}function Lo(){Ce(zo,zo.current),Ce(Mo,Mo.current)}function Ro(e){Se(Mo),No===e&&(No=null),Se(zo)}var zo=xe(0);function Bo(e,t){Ce(Mo,Mo.current),Ce(zo,t)}function Vo(e){Se(zo),Se(Mo),No===e&&(No=null)}function Ho(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||gm(n)||_m(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Uo=0,Wo=null,Go=null,Ko=null,qo=!1,Jo=!1,Yo=!1,Xo=0,Zo=0,Qo=null,$o=0;function es(){throw Error(i(321))}function ts(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Hr(e[n],t[n]))return!1;return!0}function ns(e,t,n,r,i,a){return Uo=a,Wo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?_c:vc,Yo=!1,a=n(r,i),Yo=!1,Jo&&(a=is(t,n,r,i)),rs(e),a}function rs(e){N.H=gc;var t=Go!==null&&Go.next!==null;if(Uo=0,Ko=Go=Wo=null,qo=!1,Zo=0,Qo=null,t)throw Error(i(300));e===null||Fc||(e=e.dependencies,e!==null&&wa(e)&&(Fc=!0))}function is(e,t,n,r){Wo=e;var a=0;do{if(Jo&&(Qo=null),Zo=0,Jo=!1,25<=a)throw Error(i(301));if(a+=1,Ko=Go=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=yc,o=t(n,r)}while(Jo);return o}function as(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?fs(t):t,e=e.useState()[0],(Go===null?null:Go.memoizedState)!==e&&(Wo.flags|=1024),t}function os(){var e=Xo!==0;return Xo=0,e}function ss(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function cs(e){if(qo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}qo=!1}Uo=0,Ko=Go=Wo=null,Jo=!1,Zo=Xo=0,Qo=null}function ls(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ko===null?Wo.memoizedState=Ko=e:Ko=Ko.next=e,Ko}function us(){if(Go===null){var e=Wo.alternate;e=e===null?null:e.memoizedState}else e=Go.next;var t=Ko===null?Wo.memoizedState:Ko.next;if(t!==null)Ko=t,Go=e;else{if(e===null)throw Wo.alternate===null?Error(i(467)):Error(i(310));Go=e,e={memoizedState:Go.memoizedState,baseState:Go.baseState,baseQueue:Go.baseQueue,queue:Go.queue,next:null},Ko===null?Wo.memoizedState=Ko=e:Ko=Ko.next=e}return Ko}function ds(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fs(e){var t=Zo;return Zo+=1,Qo===null&&(Qo=[]),e=to(Qo,e,t),t=Wo,(Ko===null?t.memoizedState:Ko.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?_c:vc),e}function ps(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return fs(e);if(e.$$typeof===fe)return;if(e.$$typeof===j)return Ea(e)}throw Error(i(438,String(e)))}function ms(e){var t=null,n=Wo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Wo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ds(),Wo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ue;return t.index++,n}function hs(e,t){return typeof t==`function`?t(e):t}function gs(e){return _s(us(),Go,e)}function _s(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Uo&f)===f:(od&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ba&&(d=!0);else if((Uo&p)===p){u=u.next,p===Ba&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,Wo.lanes|=p,md|=p;f=u.action,Yo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,Wo.lanes|=f,md|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Hr(o,e.memoizedState)&&(Fc=!0,d&&(n=Va,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function B(e){var t=us(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Hr(o,t.memoizedState)||(Fc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function vs(e,t,n){var r=Wo,a=us(),o=aa;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Hr((Go||a).memoizedState,n);if(s&&(a.memoizedState=n,Fc=!0),a=a.queue,Us(xs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Ko!==null&&!!(Ko.memoizedState.tag&1),Rs(e?9:8,{destroy:void 0},bs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,id===null)throw Error(i(349));o||Uo&127||ys(r,t,n)}return n}function ys(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Wo.updateQueue,t===null?(t=ds(),Wo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function bs(e,t,n,r){t.value=n,t.getSnapshot=r,Ss(t)&&Cs(e)}function xs(e,t,n){return n(function(){Ss(t)&&Cs(e)})}function Ss(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Hr(e,n)}catch{return!0}}function Cs(e){var t=Di(e,2);t!==null&&Hd(t,e,2)}function ws(e){var t=ls();if(typeof e==`function`){var n=e;if(e=n(),Yo){et(!0);try{n()}finally{et(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hs,lastRenderedState:e},t}function Ts(e,t,n,r){return e.baseState=n,_s(e,Go,typeof r==`function`?r:hs)}function Es(e,t,n,r,a){if(pc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ds(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ds(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};o.types=a===null?null:a.types,N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),Os(e,t,s)}catch(n){As(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),Os(e,t,a)}catch(n){As(e,t,n)}}function Os(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ks(e,t,n)},function(n){return As(e,t,n)}):ks(e,t,n)}function ks(e,t,n){t.status=`fulfilled`,t.value=n,js(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ds(e,n)))}function As(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,js(t),t=t.next;while(t!==r)}e.action=null}function js(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ms(e,t){return t}function Ns(e,t){if(aa){var n=id.formState;if(n!==null){a:{var r=Wo;if(aa){if(ia){b:{for(var i=ia,a=sa;i.nodeType!==8;){if(!a){i=null;break b}if(i=ym(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ia=ym(i.nextSibling),r=i.data===`F!`;break a}}la(r)}r=!1}r&&(t=n[0])}}return n=ls(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ms,lastRenderedState:t},n.queue=r,n=uc.bind(null,Wo,r),r.dispatch=n,r=ws(!1),a=fc.bind(null,Wo,!1,r.queue),r=ls(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Es.bind(null,Wo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ps(e){return Fs(us(),Go,e)}function Fs(e,t,n){if(t=_s(e,t,Ms)[0],e=gs(hs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=fs(t)}catch(e){throw e===Xa?Qa:e}else r=t;t=us();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Wo.flags|=2048,Rs(9,{destroy:void 0},Is.bind(null,i,n),null)),[r,a,e]}function Is(e,t){e.action=t}function Ls(e){var t=us(),n=Go;if(n!==null)return Fs(t,n,e);us(),t=t.memoizedState,n=us();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Wo.updateQueue,t===null&&(t=ds(),Wo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function zs(){return us().memoizedState}function Bs(e,t,n,r){var i=ls();Wo.flags|=e,i.memoizedState=Rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Vs(e,t,n,r){var i=us();r=r===void 0?null:r;var a=i.memoizedState.inst;Go!==null&&r!==null&&ts(r,Go.memoizedState.deps)?i.memoizedState=Rs(t,a,n,r):(Wo.flags|=e,i.memoizedState=Rs(1|t,a,n,r))}function Hs(e,t){Bs(8390656,8,e,t)}function Us(e,t){Vs(2048,8,e,t)}function Ws(e){Wo.flags|=4;var t=Wo.updateQueue;if(t===null)t=ds(),Wo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Gs(e){var t=us().memoizedState;return Ws({ref:t,nextImpl:e}),function(){if(rd&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Ks(e,t){return Vs(4,2,e,t)}function qs(e,t){return Vs(4,4,e,t)}function V(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Js(e,t,n){n=n==null?null:n.concat([e]),Vs(4,4,V.bind(null,t,e),n)}function Ys(){}function Xs(e,t){var n=us();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ts(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Zs(e,t){var n=us();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ts(t,r[1]))return r[0];if(r=e(),Yo){et(!0);try{e()}finally{et(!1)}}return n.memoizedState=[r,t],r}function Qs(e,t,n){return n===void 0||Uo&1073741824&&!(od&261930)?e.memoizedState=t:(e.memoizedState=n,e=Bd(),Wo.lanes|=e,md|=e,n)}function $s(e,t,n,r){return Hr(n,t)?n:Do.current===null?!(Uo&106)||Uo&1073741824&&!(od&261930)?(Fc=!0,e.memoizedState=n):(e=Bd(),Wo.lanes|=e,md|=e,t):(e=Qs(e,n,r),Hr(e,t)||(Fc=!0),e)}function ec(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};s.types=o===null?null:o.types,N.T=s,fc(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?dc(e,t,Wa(c,r),zd(e)):dc(e,t,r,zd(e))}catch(n){dc(e,t,{then:function(){},status:`rejected`,reason:n},zd())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function tc(){}function nc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=rc(e).queue;ec(e,a,t,ve,n===null?tc:function(){return ic(e),n(r)})}function rc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ve,baseState:ve,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hs,lastRenderedState:ve},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ic(e){var t=rc(e);t.next===null&&(t=e.alternate.memoizedState),dc(e,t.next.queue,{},zd())}function ac(){return Ea(_h)}function oc(){return us().memoizedState}function sc(){return us().memoizedState}function cc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=zd();e=vo(n);var r=yo(t,e,n);r!==null&&(Hd(r,t,n),bo(r,t,n)),t={cache:Na()},e.payload=t;return}t=t.return}}function lc(e,t,n){var r=zd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},pc(e)?mc(t,n):(n=Ei(e,t,n,r),n!==null&&(Hd(n,e,r),hc(n,t,r)))}function uc(e,t,n){dc(e,t,n,zd())}function dc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(pc(e))mc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Hr(s,o))return Ti(e,t,i,0),id===null&&wi(),!1}catch{}if(n=Ei(e,t,i,r),n!==null)return Hd(n,e,r),hc(n,t,r),!0}return!1}function fc(e,t,n,r){if(r={lane:2,revertLane:Uf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},pc(e)){if(t)throw Error(i(479))}else t=Ei(e,n,r,2),t!==null&&Hd(t,e,2)}function pc(e){var t=e.alternate;return e===Wo||t!==null&&t===Wo}function mc(e,t){Jo=qo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_t(e,n)}}var gc={readContext:Ea,use:ps,useCallback:es,useContext:es,useEffect:es,useImperativeHandle:es,useLayoutEffect:es,useInsertionEffect:es,useMemo:es,useReducer:es,useRef:es,useState:es,useDebugValue:es,useDeferredValue:es,useTransition:es,useSyncExternalStore:es,useId:es,useHostTransitionStatus:es,useFormState:es,useActionState:es,useOptimistic:es,useMemoCache:es,useCacheRefresh:es,useEffectEvent:es},_c={readContext:Ea,use:ps,useCallback:function(e,t){return ls().memoizedState=[e,t===void 0?null:t],e},useContext:Ea,useEffect:Hs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Bs(4194308,4,V.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bs(4194308,4,e,t)},useInsertionEffect:function(e,t){Bs(4,2,e,t)},useMemo:function(e,t){var n=ls();t=t===void 0?null:t;var r=e();if(Yo){et(!0);try{e()}finally{et(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ls();if(n!==void 0){var i=n(t);if(Yo){et(!0);try{n(t)}finally{et(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=lc.bind(null,Wo,e),[r.memoizedState,e]},useRef:function(e){var t=ls();return e={current:e},t.memoizedState=e},useState:function(e){e=ws(e);var t=e.queue,n=uc.bind(null,Wo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ys,useDeferredValue:function(e,t){return Qs(ls(),e,t)},useTransition:function(){var e=ws(!1);return e=ec.bind(null,Wo,e.queue,!0,!1),ls().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Wo,a=ls();if(aa){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),id===null)throw Error(i(349));od&127||ys(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Hs(xs.bind(null,r,o,e),[e]),r.flags|=2048,Rs(9,{destroy:void 0},bs.bind(null,r,o,n,t),null),n},useId:function(){var e=ls(),t=id.identifierPrefix;if(aa){var n=Zi,r=Xi;n=(r&~(1<<32-tt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Xo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=$o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ac,useFormState:Ns,useActionState:Ns,useOptimistic:function(e){var t=ls();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=fc.bind(null,Wo,!0,n),n.dispatch=t,[e,t]},useMemoCache:ms,useCacheRefresh:function(){return ls().memoizedState=cc.bind(null,Wo)},useEffectEvent:function(e){var t=ls(),n={impl:e};return t.memoizedState=n,function(){if(rd&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},vc={readContext:Ea,use:ps,useCallback:Xs,useContext:Ea,useEffect:Us,useImperativeHandle:Js,useInsertionEffect:Ks,useLayoutEffect:qs,useMemo:Zs,useReducer:gs,useRef:zs,useState:function(){return gs(hs)},useDebugValue:Ys,useDeferredValue:function(e,t){return $s(us(),Go.memoizedState,e,t)},useTransition:function(){var e=gs(hs)[0],t=us().memoizedState;return[typeof e==`boolean`?e:fs(e),t]},useSyncExternalStore:vs,useId:oc,useHostTransitionStatus:ac,useFormState:Ps,useActionState:Ps,useOptimistic:function(e,t){return Ts(us(),Go,e,t)},useMemoCache:ms,useCacheRefresh:sc,useEffectEvent:Gs},yc={readContext:Ea,use:ps,useCallback:Xs,useContext:Ea,useEffect:Us,useImperativeHandle:Js,useInsertionEffect:Ks,useLayoutEffect:qs,useMemo:Zs,useReducer:B,useRef:zs,useState:function(){return B(hs)},useDebugValue:Ys,useDeferredValue:function(e,t){var n=us();return Go===null?Qs(n,e,t):$s(n,Go.memoizedState,e,t)},useTransition:function(){var e=B(hs)[0],t=us().memoizedState;return[typeof e==`boolean`?e:fs(e),t]},useSyncExternalStore:vs,useId:oc,useHostTransitionStatus:ac,useFormState:Ls,useActionState:Ls,useOptimistic:function(e,t){var n=us();return Go===null?(n.baseState=e,[e,n.queue.dispatch]):Ts(n,Go,e,t)},useMemoCache:ms,useCacheRefresh:sc,useEffectEvent:Gs};function bc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var xc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=zd(),i=vo(r);i.payload=t,n!=null&&(i.callback=n),t=yo(e,i,r),t!==null&&(Hd(t,e,r),bo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=zd(),i=vo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=yo(e,i,r),t!==null&&(Hd(t,e,r),bo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=zd(),r=vo(n);r.tag=2,t!=null&&(r.callback=t),t=yo(e,r,n),t!==null&&(Hd(t,e,n),bo(t,e,n))}};function Sc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Ur(n,r)||!Ur(i,a):!0}function Cc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&xc.enqueueReplaceState(t,t.state,null)}function wc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Tc(e){z(e)}function Ec(e){console.error(e)}function Dc(e){z(e)}function Oc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function kc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ac(e,t,n){return n=vo(n),n.tag=3,n.payload={element:null},n.callback=function(){Oc(e,t)},n}function jc(e){return e=vo(e),e.tag=3,e}function Mc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){kc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){kc(t,n,r),typeof i!=`function`&&(Ed===null?Ed=new Set([this]):Ed.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Nc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ca(t,n,a,!0),n=Mo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return No===null?ef():n.alternate===null&&pd===0&&(pd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===$a?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Cf(e,r,a)),!1;case 22:return n.flags|=65536,r===$a?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Cf(e,r,a)),!1}throw Error(i(435,n.tag))}return Cf(e,r,a),ef(),!1}if(aa)return t=Mo.current,t===null?(r!==ca&&(t=Error(i(423),{cause:r}),ha(Hi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Hi(r,n),a=Ac(e.stateNode,r,a),xo(e,a),pd!==4&&(pd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ca&&(e=Error(i(422),{cause:r}),ha(Hi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Hi(o,n),yd===null?yd=[o]:yd.push(o),pd!==4&&(pd=2),t===null)return!0;r=Hi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ac(n.stateNode,r,e),xo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Ed===null||!Ed.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=jc(a),Mc(a,e,n,r),xo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Pc=Error(i(461)),Fc=!1;function Ic(e,t,n,r){t.child=e===null?mo(t,null,n,r):po(t,e.child,n,r)}function Lc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ta(t),r=ns(e,t,n,o,a,i),s=os(),e!==null&&!Fc?(ss(e,t,i),ul(e,t,i)):(aa&&s&&ea(t),t.flags|=1,Ic(e,t,r,i),t.child)}function Rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ni(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,zc(e,t,a,r,i)):(e=Ii(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!dl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ur:n,n(o,r)&&e.ref===t.ref)return ul(e,t,i)}return t.flags|=1,e=Pi(a,r),e.ref=t.ref,e.return=t,t.child=e}function zc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ur(a,r)&&e.ref===t.ref){if(Fc=!1,t.pendingProps=r=a,dl(e,i))e.flags&131072&&(Fc=!0);else return t.lanes=e.lanes,ul(e,t,i)}}return H(e,t,n,r,i)}function Bc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Hc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ja(t,a===null?null:a.cachePool),a===null?Ao():ko(t,a),Io(t);else return r=t.lanes=536870912,Hc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ja(t,null),Ao(),Lo()):(Ja(t,a.cachePool),ko(t,a),Lo(),t.memoizedState=null);return Ic(e,t,i,n),t.child}function Vc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Hc(e,t,n,r,i){var a=qa();return a=a===null?null:{parent:Ma._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ja(t,null),Ao(),Io(t),e!==null&&Ca(e,t,r,!0),t.childLanes=i,null}function Uc(e,t){return t=tl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Wc(e,t,n){return po(t,e.child,null,n),e=Uc(t,t.pendingProps),e.flags|=2,Ro(t),t.memoizedState=null,e}function Gc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(aa){if(r.mode===`hidden`)return e=Uc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Vc(null,e);if(Fo(t),(e=ia)?(e=hm(e,sa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yi===null?null:{id:Xi,overflow:Zi},retryLane:536870912,hydrationErrors:null},n=zi(e),n.return=t,t.child=n,ra=t,ia=null)):e=null,e===null)throw la(t);return t.lanes=536870912,null}return Uc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Fo(t),a){if(t.flags&256)t.flags&=-257,t=Wc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Fc||Ca(e,t,n,!1),a=(n&e.childLanes)!==0,Fc||a){if(Do.current===null){if(r=id,r!==null&&(s=vt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Di(e,s),Hd(r,e,s),Pc;ef()}t=Wc(e,t,n)}else e=o.treeContext,ia=ym(s.nextSibling),ra=t,aa=!0,oa=null,sa=!1,e!==null&&na(t,e),t=Uc(t,r),t.flags|=134221824;return t}return e=Pi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Kc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function H(e,t,n,r,i){return Ta(t),n=ns(e,t,n,r,void 0,i),r=os(),e!==null&&!Fc?(ss(e,t,i),ul(e,t,i)):(aa&&r&&ea(t),t.flags|=1,Ic(e,t,n,i),t.child)}function qc(e,t,n,r,i,a){return Ta(t),t.updateQueue=null,n=is(t,r,n,i),rs(e),r=os(),e!==null&&!Fc?(ss(e,t,a),ul(e,t,a)):(aa&&r&&ea(t),t.flags|=1,Ic(e,t,n,a),t.child)}function Jc(e,t,n,r,i){if(Ta(t),t.stateNode===null){var a=Ai,o=n.contextType;typeof o==`object`&&o&&(a=Ea(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=xc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},go(t),o=n.contextType,a.context=typeof o==`object`&&o?Ea(o):Ai,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(bc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&xc.enqueueReplaceState(a,a.state,null),wo(t,r,a,i),Co(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=wc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ai,typeof u==`object`&&u&&(o=Ea(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Cc(t,a,r,o),ho=!1;var f=t.memoizedState;a.state=f,wo(t,r,a,i),Co(),l=t.memoizedState,s||f!==l||ho?(typeof d==`function`&&(bc(t,n,d,r),l=t.memoizedState),(c=ho||Sc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,_o(e,t),o=t.memoizedProps,u=wc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ai,typeof l==`object`&&l&&(c=Ea(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Cc(t,a,r,c),ho=!1,f=t.memoizedState,a.state=f,wo(t,r,a,i),Co();var p=t.memoizedState;o!==d||f!==p||ho||e!==null&&e.dependencies!==null&&wa(e.dependencies)?(typeof s==`function`&&(bc(t,n,s,r),p=t.memoizedState),(u=ho||Sc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&wa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Kc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=po(t,e.child,null,i),t.child=po(t,null,n,i)):Ic(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ul(e,t,i),e}function Yc(e,t,n,r){return pa(),t.flags|=256,Ic(e,t,n,r),t.child}var Xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zc(e){return{baseLanes:e,cachePool:Ya()}}function Qc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=_d),e}function $c(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(zo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(aa){if(i?Po(t):Lo(),(e=ia)?(e=hm(e,sa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yi===null?null:{id:Xi,overflow:Zi},retryLane:536870912,hydrationErrors:null},n=zi(e),n.return=t,t.child=n,ra=t,ia=null)):e=null,e===null)throw la(t);return t.lanes=_m(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Lo(),i=t.mode,a=tl({mode:`hidden`,children:a},i),r=Li(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Zc(n),r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Vc(null,r)):(Po(t),el(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return rl(e,t,a,o,r,c,s,n)}return i?(Lo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Pi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Li(i,a,n,null),i.flags|=2):i=Pi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Vc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Zc(n):(a=i.cachePool,a===null?a=Ya():(s=Ma._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Vc(e.child,r)):(Po(t),n=e.child,e=n.sibling,n=Pi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function el(e,t){return t=tl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function tl(e,t){return e=Mi(22,e,null,t),e.lanes=0,e}function nl(e,t,n){return po(t,e.child,null,n),e=el(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Po(t),t.flags&=-257,nl(e,t,c)):t.memoizedState===null?(Lo(),o=a.fallback,s=t.mode,a=tl({mode:`visible`,children:a.children},s),o=Li(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,po(t,e.child,null,c),a=t.child,a.memoizedState=Zc(c),a.childLanes=Qc(e,r,c),t.memoizedState=Xc,Vc(null,a)):(Lo(),t.child=e.child,t.flags|=128,null);if(Po(t),_m(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ha({value:a,source:null,stack:null})),nl(e,t,c)}if(Fc||Ca(e,t,c,!1),r=(c&e.childLanes)!==0,Fc||r){if(Do.current!==null)return nl(e,t,c);if(r=id,r!==null&&(a=vt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Di(e,a),Hd(r,e,a),Pc;return gm(o)||ef(),nl(e,t,c)}return gm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ia=ym(o.nextSibling),ra=t,aa=!0,oa=null,sa=!1,e!==null&&na(t,e),t=el(t,a.children),t.flags|=134221824,t)}function il(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),xa(e.return,t,n)}function al(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Ho(n)===null&&(t=e),e=e.sibling}return t}function ol(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function sl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function cl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=zo.current;if(t.flags&128)return Bo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Bo(t,o),i===`backwards`&&e!==null?(sl(e),Ic(e,t,r,n),sl(e)):Ic(e,t,r,n),r=aa?Ki:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&il(e,n,t);else if(e.tag===19)il(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,sl(t)),ol(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ho(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ol(t,!0,n,null,a,r);break;case`together`:ol(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ol(t,!1,i,n,a,r)}return t.child}function ll(e,t,n){var r=t.pendingProps;return ya(t,t.type,r.value),Ic(e,t,r.children,n),t.child}function ul(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),md|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ca(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Pi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Pi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function dl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&wa(e)))}function fl(e,t,n){switch(t.tag){case 3:Oe(t,t.stateNode.containerInfo),ya(t,Ma,e.memoizedState.cache),pa();break;case 27:case 5:Ae(t);break;case 4:Oe(t,t.stateNode.containerInfo);break;case 10:ya(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Fo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Po(t),t.flags|=128,null;r=Ca(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?$c(e,t,n):(Po(t),e=ul(e,t,n),e===null?null:e.sibling)}Po(t);break;case 19:if(t.flags&128)return cl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Ca(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return cl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Bo(t,zo.current),r)break;return null;case 22:return t.lanes=0,Bc(e,t,n,t.pendingProps);case 24:ya(t,Ma,e.memoizedState.cache)}return ul(e,t,n)}function pl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Fc=!0;else{if(!dl(e,n)&&!(t.flags&128))return Fc=!1,fl(e,t,n);Fc=!!(e.flags&131072)}}else Fc=!1,aa&&t.flags&1048576&&$i(t,Ki,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=no(t.elementType),t.type=e,typeof e==`function`)Ni(e)?(r=wc(e,r),t.tag=1,t=Jc(null,t,e,r,n)):(t.tag=0,t=H(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ie){t.tag=11,t=Lc(null,t,e,r,n);break a}if(a===se){t.tag=14,t=Rc(null,t,e,r,n);break a}if(a===j){t.tag=10,t.type=e,t=ll(null,t,n);break a}}throw t=ge(e)||e,Error(i(306,t,``))}}return t;case 0:return H(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=wc(r,t.pendingProps),Jc(e,t,r,a,n);case 3:a:{if(Oe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,_o(e,t),wo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ya(t,Ma,r),r!==o.cache&&Sa(t,[Ma],n,!0),Co(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Yc(e,t,r,n);break a}if(r!==a){a=Hi(Error(i(424)),t),ha(a),t=Yc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ia=ym(e.firstChild),ra=t,aa=!0,oa=null,sa=!0,n=mo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(pa(),r===a){t=ul(e,t,n);break a}Ic(e,t,r,n)}t=t.child}return t;case 26:return Kc(e,t),e===null?(n=Um(t.type,null,t.pendingProps,null))?t.memoizedState=n:aa||(t.stateNode=Cp(t.type,t.pendingProps,Ee.current,t)):t.memoizedState=Um(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ae(t),e===null&&aa&&(r=t.stateNode=Tm(t.type,t.pendingProps,Ee.current),ra=t,sa=!0,a=ia,Mp(t.type)?(bm=a,ia=ym(r.firstChild)):ia=a),Ic(e,t,t.pendingProps.children,n),Kc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&aa&&((a=r=ia)&&(r=pm(r,t.type,t.pendingProps,sa),r===null?a=!1:(t.stateNode=r,ra=t,ia=ym(r.firstChild),sa=!1,a=!0)),a||la(t)),Ae(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,wp(a,o)?r=null:s!==null&&wp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=ns(e,t,as,null,null,n),_h._currentValue=a),Kc(e,t),Ic(e,t,r,n),t.child;case 6:return e===null&&aa&&((e=n=ia)&&(n=mm(n,t.pendingProps,sa),n===null?e=!1:(t.stateNode=n,ra=t,ia=null,e=!0)),e||la(t)),null;case 13:return $c(e,t,n);case 4:return Oe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=po(t,null,r,n):Ic(e,t,r,n),t.child;case 11:return Lc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Kc(e,t),Ic(e,t,r,n),t.child;case 8:return Ic(e,t,t.pendingProps.children,n),t.child;case 12:return Ic(e,t,t.pendingProps.children,n),t.child;case 10:return ll(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Ta(t),a=Ea(a),r=r(a),t.flags|=1,Ic(e,t,r,n),t.child;case 14:return Rc(e,t,t.type,t.pendingProps,n);case 15:return zc(e,t,t.type,t.pendingProps,n);case 19:return cl(e,t,n);case 31:return Gc(e,t,n);case 22:return Bc(e,t,n,t.pendingProps);case 24:return Ta(t),r=Ea(Ma),e===null?(a=qa(),a===null&&(a=id,o=Na(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},go(t),ya(t,Ma,a)):((e.lanes&n)!==0&&(_o(e,t),wo(t,null,null,n),Co()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ya(t,Ma,r),r!==a.cache&&Sa(t,[Ma],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ya(t,Ma,r))),Ic(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:aa&&ea(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Kc(e,t),Ic(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ml(e){e.flags|=4}function hl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?ih(t,r):ih(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Zd())e.flags|=8192;else throw ro=$a,Za}}else e.flags&=-16777217}function gl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!ah(t)){if(Zd())e.flags|=8192;else throw ro=$a,Za}}function _l(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ft(),e.lanes|=t,vd|=t)}function vl(e,t){if(!aa)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function yl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function bl(e,t,n){var r=t.pendingProps;switch(ta(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yl(t),null;case 1:return yl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ba(Ma),ke(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(fa(t)?ml(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ma())),yl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ml(t),o===null?(yl(t),hl(t,a,null,r,n)):(yl(t),gl(t,o))):o?o===e.memoizedState?(yl(t),t.flags&=-16777217):(ml(t),yl(t),gl(t,o)):(e=e.memoizedProps,e!==r&&ml(t),yl(t),hl(t,a,e,r,n)),null;case 27:if(je(t),n=Ee.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return yl(t),t.subtreeFlags&=-33554433,null}e=we.current,fa(t)?ua(t,e):(e=Tm(a,r,n),t.stateNode=e,ml(t))}return yl(t),t.subtreeFlags&=-33554433,null;case 5:if(je(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return yl(t),t.subtreeFlags&=-33554433,null}if(o=we.current,fa(t))ua(t,o);else{var s=bp(Ee.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[wt]=t,o[Tt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(pp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&ml(t)}}return yl(t),t.subtreeFlags&=-33554433,hl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Ee.current,fa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ra,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[wt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||up(e.nodeValue,n)),e||la(t,!0)}else e=bp(e).createTextNode(r),e[wt]=t,t.stateNode=e}return yl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=fa(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[wt]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),e=!1}else n=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ro(t),t):(Ro(t),null);if(t.flags&128)throw Error(i(558))}return yl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=fa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[wt]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),a=!1}else a=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Ro(t),t):(Ro(t),null)}return Ro(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),_l(t,t.updateQueue),yl(t),null);case 4:return ke(),e===null&&ep(t.stateNode.containerInfo),t.flags|=67108864,yl(t),null;case 10:return ba(t.type),yl(t),null;case 19:if(Vo(t),r=t.memoizedState,r===null)return yl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)vl(r,!1);else{if(pd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ho(e),o!==null){for(t.flags|=128,vl(r,!1),e=o.updateQueue,t.updateQueue=e,_l(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Fi(n,e),n=n.sibling;return Bo(t,zo.current&1|2),aa&&Qi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&We()>wd&&(t.flags|=128,a=!0,vl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Ho(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,_l(t,e),vl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!aa)return yl(t),null}else 2*We()-r.renderingStartTime>wd&&n!==536870912&&(t.flags|=128,a=!0,vl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=We(),e.sibling=null,o=zo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||aa?Bo(t,o):(n=o,Ce(Mo,t),Ce(zo,n),No===null&&(No=t)),aa&&Qi(t,r.treeForkCount),e}return yl(t),null;case 22:case 23:return Ro(t),jo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(yl(t),t.subtreeFlags&6&&(t.flags|=8192)):yl(t),n=t.updateQueue,n!==null&&_l(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Se(Ka),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ba(Ma),yl(t),null;case 25:return null;case 30:return t.flags|=33554432,yl(t),null}throw Error(i(156,t.tag))}function xl(e,t){switch(ta(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ba(Ma),ke(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return je(t),null;case 31:if(t.memoizedState!==null){if(Ro(t),t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Vo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return ke(),null;case 10:return ba(t.type),null;case 22:case 23:return Ro(t),jo(),e!==null&&Se(Ka),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ba(Ma),null;case 25:return null;default:return null}}function Sl(e,t){switch(ta(t),t.tag){case 3:ba(Ma),ke();break;case 26:case 27:case 5:je(t);break;case 4:ke();break;case 31:t.memoizedState!==null&&Ro(t);break;case 13:Ro(t);break;case 19:Vo(t);break;case 10:ba(t.type);break;case 22:case 23:Ro(t),jo(),e!==null&&Se(Ka);break;case 24:ba(Ma)}}function Cl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Sf(t,t.return,e)}}function wl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Sf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Sf(t,t.return,e)}}function Tl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Eo(t,n)}catch(t){Sf(e,e.return,t)}}}function El(e,t,n){n.props=wc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Sf(e,t,n)}}function Dl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=vi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Wp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Gp(e);h(e.child,!1,cm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Sf(e,t,n)}}function Ol(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Sf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Sf(e,t,n)}else n.current=null}}function kl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)um(e.stateNode,t[n])}function Al(e){for(var t=e.return;t!==null&&(Nl(t)&&um(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function jl(e){for(var t=e.return;t!==null&&(Nl(t)&&dm(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function Ml(e){return e.tag===5||e.tag===3||e.tag===27}function Nl(e){return e&&e.tag===7&&e.stateNode!==null}function Pl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Sf(e,e.return,t)}}function Fl(e,t,n){try{var r=e.stateNode;hp(r,e.type,n,t),r[Tt]=t}catch(t){Sf(e,e.return,t)}}function Il(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Mp(e.type)||e.tag===4}function Ll(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Il(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Mp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=bn)),kl(e,r),Jt=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Mp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),kl(e,r),Jt=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Mp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(zl(e,t,n,r),e=e.sibling;e!==null;)zl(e,t,n,r),e=e.sibling}function Bl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);pp(t,r,n),t[wt]=e,t[Tt]=n}catch(t){Sf(e,e.return,t)}}var Vl=!1,Hl=null;function Ul(e){(e.tag===30||e.subtreeFlags&33554432)&&(Vl=!0)}var Wl=null;function Gl(){var e=Wl;return Wl=null,e}var Kl=0;function ql(e,t,n,r,i){return Kl=0,Jl(e.child,t,n,r,i)}function Jl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Rp(o);r.push(s),s.view&&(a=!0)}else a||Rp(o).view&&(a=!0);Vl=!0,Fp(o,Kl===0?t:t+`_`+Kl,n),Kl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Jl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Yl(e,t){for(;e!==null;)e.tag===5?Ip(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Yl(e.child,t)),e=e.sibling}function Xl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Xl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=bi(t.default,t.share),t!==`none`&&(ql(e,n,t,null,!1)||Yl(e.child,!1))}e=e.sibling}}function Zl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=vi(r,n),a=bi(r.default,n.paired?r.share:r.enter);a===`none`?Xl(e):ql(e,i,a,null,!1)?(Xl(e),n.paired||t||Vd(e,r.onEnter)):Yl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e,t),e=e.sibling;else Xl(e)}function Ql(e){if(Hl!==null&&Hl.size!==0){var t=Hl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=bi(n.default,n.share);if(a!==`none`&&(ql(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Vd(e,n.onShare)):Yl(e.child,!1)),t.delete(r),t.size===0)break}}}Ql(e)}e=e.sibling}}}function $l(e){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode),r=Hl===null?void 0:Hl.get(n),i=bi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(ql(e,n,i,null,!1)?r===void 0?Vd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Hl.delete(n),Vd(e,t.onShare)):Yl(e.child,!1)),Hl!==null&&Ql(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)$l(e),e=e.sibling;else Hl!==null&&Ql(e)}function eu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode);t=bi(t.default,t.update),e.flags&=-5,t!==`none`&&ql(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&eu(e);e=e.sibling}}function tu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Yl(e.child,!1))}tu(e)}e=e.sibling}}function nu(e){if(e.tag===30)e.stateNode.paired=null,Yl(e.child,!1),tu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)nu(e),e=e.sibling;else tu(e)}function ru(e){for(e=e.child;e!==null;)e.tag===30?Yl(e.child,!1):e.subtreeFlags&33554432&&ru(e),e=e.sibling}function iu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Kl<a.length){var l=a[Kl],u=Rp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Fp(c,Kl===0?n:n+`_`+Kl,i),s&&e.flags&4||(Wl===null&&(Wl=[]),Wl.push(c,Kl===0?r:r+`_`+Kl,t.memoizedProps)),Kl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:iu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function au(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=vi(n,r),a=bi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(zp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Kl=0,i=iu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Vd(e,n.onUpdate))}else e.subtreeFlags&33554432&&au(e,t);e=e.sibling}}var ou=!1,su=!1,cu=!1,lu=!1,uu=typeof WeakSet==`function`?WeakSet:Set,du=null,fu=!1,pu=!1,mu=!1,hu=!1;function gu(e,t,n){if(e=e.containerInfo,vp=Eh,e=Jr(e),Yr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(yp={focusedElem:e,selectionRange:r},Eh=!1,n=(n&335544064)===n,du=t,t=n?9270:1024;du!==null;){if(e=du,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&$l(r[a]);if(e.alternate===null&&e.flags&2)n&&Ul(e),_u(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&$l(r),_u(n);continue}if(r!==null&&r.memoizedState!==null){n&&Ul(e),_u(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,du=r):(n&&eu(e),_u(n))}}Hl=null}function _u(e){for(;du!==null;){var t=du,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=wc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Sf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)fm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:fm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=vi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=bi(a.default,a.update),a!==`none`&&ql(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,du=r;break}du=t.return}}function vu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Ru(e,n),r&4&&Cl(5,n);break;case 1:if(Ru(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Sf(n,n.return,e)}else{var i=wc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Sf(n,n.return,e)}}}r&64&&Tl(n),r&512&&Dl(n,n.return);break;case 3:if(Ru(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Eo(e,t)}catch(e){Sf(n,n.return,e)}}break;case 27:t===null&&r&4&&Bl(n);case 26:case 5:Ru(e,n),t===null&&r&4&&Pl(n),r&512&&Dl(n,n.return);break;case 12:Ru(e,n);break;case 31:Ru(e,n),r&4&&Du(e,n);break;case 13:Ru(e,n),r&4&&Ou(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ef.bind(null,n),vm(e,n))));break;case 22:if(r=n.memoizedState!==null||ou,!r){var a=t!==null&&t.memoizedState!==null||su;t=ou,i=su,ou=r,(su=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Bu(e,n,r)):Ru(e,n),ou=t,su=i}break;case 30:Ru(e,n),r&512&&Dl(n,n.return);break;case 7:r&512&&Dl(n,n.return);default:Ru(e,n)}}function yu(e,t){for(e=e.child;e!==null;)bu(e,t),e=e.sibling}function bu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){Sf(e,e.return,t)}xu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Jt=!0}catch(t){Sf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Pp(s,!0):Pp(e.stateNode,!1)}catch(t){Sf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&yu(e,t);break;default:yu(e,t)}}function xu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:bu(n,r);break a;case 22:n.memoizedState===null&&xu(n,r);break a;default:xu(n,r)}}e=e.sibling}}function Su(e){var t=e.alternate;t!==null&&(e.alternate=null,Su(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Nt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Cu=null,wu=!1;function Tu(e,t,n){for(n=n.child;n!==null;)Eu(e,t,n),n=n.sibling}function Eu(e,t,n){if(F&&typeof F.onCommitFiberUnmount==`function`)try{F.onCommitFiberUnmount($e,n)}catch{}switch(n.tag){case 26:su||Ol(n,t),Tu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!su&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:su||Ol(n,t),jl(n);var r=Cu,i=wu;Mp(n.type)&&(Cu=n.stateNode,wu=!1),Tu(e,t,n),Em(n.stateNode,n.type,n.memoizedProps),Cu=r,wu=i;break;case 5:su||Ol(n,t),jl(n);case 6:if(n.tag===6&&jl(n),r=Cu,i=wu,Cu=null,Tu(e,t,n),Cu=r,wu=i,Cu!==null){if(wu)try{(Cu.nodeType===9?Cu.body:Cu.nodeName===`HTML`?Cu.ownerDocument.body:Cu).removeChild(n.stateNode),Jt=!0}catch(e){Sf(n,t,e)}else try{Cu.removeChild(n.stateNode),Jt=!0}catch(e){Sf(n,t,e)}}break;case 18:Cu!==null&&(wu?(e=Cu,Np(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Qh(e)):Np(Cu,n.stateNode));break;case 4:r=Cu,i=wu,Cu=n.stateNode.containerInfo,wu=!0,Tu(e,t,n),Cu=r,wu=i;break;case 0:case 11:case 14:case 15:wl(2,n,t),su||wl(4,n,t),Tu(e,t,n);break;case 1:su||(Ol(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&El(n,t,r)),Tu(e,t,n);break;case 21:Tu(e,t,n);break;case 22:su=(r=su)||n.memoizedState!==null,Tu(e,t,n),su=r;break;case 30:Ol(n,t),Tu(e,t,n);break;case 7:su||Ol(n,t),Tu(e,t,n);break;default:Tu(e,t,n)}}function Du(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Qh(e)}catch(e){Sf(t,t.return,e)}}}function Ou(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Qh(e)}catch(e){Sf(t,t.return,e)}}function ku(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new uu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new uu),t;default:throw Error(i(435,e.tag))}}function Au(e,t){var n=ku(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Df.bind(null,e,t);t.then(r,r)}})}function ju(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Mp(l.type)){Cu=l.stateNode,wu=!1;break a}break;case 5:Cu=l.stateNode,wu=!1;break a;case 3:case 4:Cu=l.stateNode.containerInfo,wu=!0;break a}l=l.return}if(Cu===null)throw Error(i(160));Eu(s,c,o),Cu=null,wu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Nu(t,e,n),t=t.sibling}var Mu=null;function Nu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}ju(t,e,n),Pu(e),a&4&&(wl(3,e,e.return),Cl(3,e),wl(5,e,e.return));break;case 1:ju(t,e,n),Pu(e),a&512&&(su||r===null||Ol(r,r.return)),a&64&&ou&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Mu,ju(t,e,n),Pu(e),a&512&&(su||r===null||Ol(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(ou)e.stateNode=Cp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[jt]||r[wt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),pp(r,t,n),r[wt]=e,Rt(r),t=r;break a;case`link`:if(o=th(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),pp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=th(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),pp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[wt]=e,Rt(r),t=r}e.stateNode=t}}else ou||nh(o,e.type,e.stateNode)}else e.stateNode=Xm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Fl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||su||t.parentNode.removeChild(t)):a.count--,n===null?ou||nh(o,e.type,e.stateNode):Xm(o,n,e.memoizedProps))}break;case 27:ju(t,e,n),Pu(e),a&512&&(su||r===null||Ol(r,r.return)),r!==null&&a&4&&Fl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=cu,cu=!1,ju(t,e,n),cu=o,Pu(e),a&512&&(su||r===null||Ol(r,r.return)),e.flags&32){t=e.stateNode;try{pn(t,``),Jt=!0}catch(t){Sf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Fl(e,t,r===null?t:r.memoizedProps)),a&1024&&(lu=!0);break;case 6:if(ju(t,e,n),Pu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Jt=!0}catch(t){Sf(e,e.return,t)}}break;case 3:if(Jt=!1,eh=null,o=Mu,Mu=Am(t.containerInfo),ju(t,e,n),Mu=o,Pu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Qh(t.containerInfo)}catch(t){Sf(e,e.return,t)}lu&&(lu=!1,Fu(e)),Jt=!1;break;case 4:a=cu,cu=ou,r=Yt(),o=Mu,Mu=Am(e.stateNode.containerInfo),ju(t,e,n),Pu(e),Mu=o,Jt&&pu&&(mu=!0),Jt=r,cu=a;break;case 12:ju(t,e,n),Pu(e);break;case 31:ju(t,e,n),Pu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Au(e,t)));break;case 13:ju(t,e,n),Pu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Sd=We()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Au(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=ou,l=su,u=cu;ou=c||o,cu=u||o,su=l||s,ju(t,e,n),su=l,cu=u,ou=c,Pu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||ou||su||(t=s||su,n=ou,r=su,ou=o||ou,su=t,zu(e,2),ou=n,su=r),!o&&cu||yu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Au(e,n))));break;case 19:ju(t,e,n),Pu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Au(e,t)));break;case 30:a&512&&(su||r===null||Ol(r,r.return)),a=Yt(),o=pu,s=(n&335544064)===n,c=e.memoizedProps,pu=s&&bi(c.default,c.update)!==`none`,ju(t,e,n),Pu(e),s&&r!==null&&Jt&&(e.flags|=4),pu=o,Jt=a;break;case 21:break;case 7:a&512&&(su||r===null||Ol(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:ju(t,e,n),Pu(e)}}function Pu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Il(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Nl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Ml(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;zl(e,Ll(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(pn(l,``),n.flags&=-33),zl(e,Ll(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Rl(e,Ll(e),u,s);break;default:throw Error(i(161))}}catch(t){Sf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Fu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Eh=!0,t.reset(),Eh=!1),e=e.sibling}}function Iu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Lu(t,e),t=t.sibling;else au(t,!1)}function Lu(e,t){var n=e.alternate;if(n===null)Zl(e,!1);else switch(e.tag){case 3:if(hu=fu=!1,Gl(),Iu(t,e),!fu&&!mu){if(e=Wl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ip(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),hu=!0}Wl=null;break;case 5:Iu(t,e);break;case 4:r=fu,fu=!1,Iu(t,e),fu&&(mu=!0),fu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Iu(t,e):Zl(e,!1));break;case 30:r=fu,i=Gl(),fu=!1,Iu(t,e),fu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=vi(a,o),o=vi(n.memoizedProps,o);var s=bi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Kl=0,t=iu(e,n,t,o,s,a,!0),Kl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Vd(e,e.memoizedProps.onUpdate),Wl=i):i!==null&&(i.push.apply(i,Wl),Wl=i),fu=e.flags&32?!0:r;break;default:Iu(t,e)}}function Ru(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)vu(e,t.alternate,t),t=t.sibling}function zu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:wl(4,n,n.return),zu(n,r);break;case 1:Ol(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&El(n,n.return,i),zu(n,r);break;case 27:r&2&&Em(n.stateNode,n.type,n.memoizedProps);case 5:Ol(n,n.return),n.tag!==5&&n.tag!==27||jl(n),zu(n,r);break;case 6:jl(n);break;case 26:Ol(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||su||i.parentNode.removeChild(i),zu(n,r);break;case 22:n.memoizedState===null&&zu(n,r);break;case 30:Ol(n,n.return),zu(n,r);break;case 7:Ol(n,n.return);default:zu(n,r)}e=e.sibling}}function Bu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Bu(i,a,n),Cl(4,a);break;case 1:if(Bu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Sf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)To(l[i],c)}catch(e){Sf(r,r.return,e)}}s&&o&64&&Tl(a),Dl(a,a.return);break;case 27:n&2&&Bl(a);case 5:a.tag!==5&&a.tag!==27||Al(a),Bu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 6:Al(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||ou||nh(Am(c.ownerDocument),a.type,c),Bu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 12:Bu(i,a,n);break;case 31:Bu(i,a,n),s&&o&4&&Du(i,a);break;case 13:Bu(i,a,n),s&&o&4&&Ou(i,a);break;case 22:a.memoizedState===null&&Bu(i,a,n),Dl(a,a.return);break;case 30:Bu(i,a,n),Dl(a,a.return);break;case 7:Dl(a,a.return);default:Bu(i,a,n)}t=t.sibling}}function Vu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Pa(n))}function Hu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Pa(e))}function Uu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Wu(e,t,n,r),t=t.sibling;else i&&ru(t)}function Wu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&nu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Uu(e,t,n,r),a&2048&&Cl(9,t);break;case 1:Uu(e,t,n,r);break;case 3:Uu(e,t,n,r),i&&hu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Pa(a)));break;case 12:if(a&2048){Uu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){Sf(t,t.return,e)}}else Uu(e,t,n,r);break;case 31:Uu(e,t,n,r);break;case 13:Uu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&nu(t),o._visibility&2?Uu(e,t,n,r):(o._visibility|=2,Gu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&nu(s),o._visibility&2?Uu(e,t,n,r):Ku(e,t)),a&2048&&Vu(s,t);break;case 24:Uu(e,t,n,r),a&2048&&Hu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Yl(a.child,!0),Yl(t.child,!0))),Uu(e,t,n,r);break;default:Uu(e,t,n,r)}}function Gu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Gu(a,o,s,c,i),Cl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Gu(a,o,s,c,i)):u._visibility&2?Gu(a,o,s,c,i):Ku(a,o),i&&l&2048&&Vu(o.alternate,o);break;case 24:Gu(a,o,s,c,i),i&&l&2048&&Hu(o.alternate,o);break;default:Gu(a,o,s,c,i)}t=t.sibling}}function Ku(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ku(n,r),i&2048&&Vu(r.alternate,r);break;case 24:Ku(n,r),i&2048&&Hu(r.alternate,r);break;default:Ku(n,r)}t=t.sibling}}var qu=8192;function Ju(e,t,n){if(e.subtreeFlags&qu)for(e=e.child;e!==null;)Yu(e,t,n),e=e.sibling}function Yu(e,t,n){switch(e.tag){case 26:Ju(e,t,n),e.flags&qu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&sh(n,e)):ch(n,Mu,e.memoizedState,e.memoizedProps));break;case 5:Ju(e,t,n),e.flags&qu&&(e=e.stateNode,(t&335544128)===t&&sh(n,e));break;case 3:case 4:var r=Mu;Mu=Am(e.stateNode.containerInfo),Ju(e,t,n),Mu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=qu,qu=16777216,Ju(e,t,n),qu=r):Ju(e,t,n));break;case 30:if((e.flags&qu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Hl===null&&(Hl=new Map),Hl.set(r,i)}Ju(e,t,n);break;default:Ju(e,t,n)}}function Xu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Zu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];du=r,ed(r,e)}Xu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Qu(e),e=e.sibling}function Qu(e){switch(e.tag){case 0:case 11:case 15:Zu(e),e.flags&2048&&wl(9,e,e.return);break;case 3:Zu(e);break;case 12:Zu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,$u(e)):Zu(e);break;default:Zu(e)}}function $u(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];du=r,ed(r,e)}Xu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:wl(8,t,t.return),$u(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,$u(t));break;default:$u(t)}e=e.sibling}}function ed(e,t){for(;du!==null;){var n=du;switch(n.tag){case 0:case 11:case 15:wl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Pa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,du=r;else a:for(n=e;du!==null;){r=du;var i=r.sibling,a=r.return;if(Su(r),r===n){du=null;break a}if(i!==null){i.return=a,du=i;break a}du=a}}}var td={getCacheForType:function(e){var t=Ea(Ma),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ea(Ma).controller.signal}},nd=typeof WeakMap==`function`?WeakMap:Map,rd=0,id=null,ad=null,od=0,sd=0,cd=null,ld=!1,ud=!1,dd=!1,fd=0,pd=0,md=0,hd=0,gd=0,_d=0,vd=0,yd=null,bd=null,xd=!1,Sd=0,Cd=0,wd=1/0,Td=null,Ed=null,Dd=0,Od=null,kd=null,Ad=0,jd=0,Md=null,Nd=null,Pd=null,Fd=null,Id=null,Ld=0,Rd=null;function zd(){return rd&2&&od!==0?od&-od:N.T===null?xt():Uf()}function Bd(){if(_d===0){if(!(od&536870912)||aa){var e=at;at<<=1,!(at&3932160)&&(at=262144),_d=e}else _d=536870912}return e=Mo.current,e!==null&&(e.flags|=32),_d}function Vd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Wp(vi(e.memoizedProps,n))),Fd===null&&(Fd=[]),Fd.push(t.bind(null,r))}}function Hd(e,t,n){(e===id&&(sd===2||sd===9)||e.cancelPendingCommit!==null)&&(Yd(e,0),Kd(e,od,_d,!1)),mt(e,n),(!(rd&2)||e!==id)&&(e===id&&(!(rd&2)&&(hd|=n),pd===4&&Kd(e,od,_d,!1)),Ff(e))}function Ud(e,t,n){if(rd&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||lt(e,t),a=r?rf(e,t):tf(e,t,!0),o=r;do{if(a===0){ud&&!r&&Kd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Gd(n)){a=tf(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=yd;var l=c.current.memoizedState.isDehydrated;if(l&&(Yd(c,s).flags|=256),s=tf(c,s,!1),s!==2&&s!==6){if(dd&&!l){c.errorRecoveryDisabledLanes|=o,hd|=o,a=4;break a}o=bd,bd=a,o!==null&&(bd===null?bd=o:bd.push.apply(bd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Yd(e,0),Kd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Kd(r,t,_d,!ld);break a;case 2:bd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Sd+300-We(),10<a)){if(Kd(r,t,_d,!ld),ct(r,0,!0)!==0)break a;Ad=t,r.timeoutHandle=Ep(Wd.bind(null,r,n,bd,Td,xd,t,_d,hd,vd,ld,o,`Throttled`,-0,0),a);break a}Wd(r,n,bd,Td,xd,t,_d,hd,vd,ld,o,null,-0,0)}break}while(1);Ff(e)}function Wd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:bn},Hl=null,Yu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=fh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?Sd-We():(a&4194048)===a?Cd-We():0,m=uh(d,m),m!==null)){Ad=a,e.cancelPendingCommit=m(df.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Kd(e,a,o,!l);return}df(e,t,a,n,r,i,o,s,c,l,u,d)}function Gd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Hr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Kd(e,t,n,r){t=ut(e,t),t&=~gd,t&=~hd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-tt(i),o=1<<a;r[a]=-1,i&=~o}n!==0&>(e,n,t)}function qd(){return rd&6?!0:(If(0,!1),!1)}function Jd(){if(ad!==null){if(sd===0)var e=ad.return;else e=ad,va=_a=null,cs(e),oo=null,so=0,e=ad;for(;e!==null;)Sl(e.alternate,e),e=e.return;ad=null}}function Yd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Dp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ad=0,Jd(),id=e,ad=n=Pi(e.current,null),od=t,sd=0,cd=null,ld=!1,ud=lt(e,t),dd=!1,vd=_d=gd=hd=md=pd=0,bd=yd=null,xd=!1,fd=ut(e,t),wi(),n}function Xd(e,t){Wo=null,N.H=gc,t===Xa||t===Qa?(t=io(),sd=3):t===Za?(t=io(),sd=4):sd=t===Pc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,cd=t,ad===null&&(pd=1,Oc(e,Hi(t,e.current)))}function Zd(){var e=Mo.current;return e===null?!0:(od&4194048)===od?No===null:(od&62914560)===od||od&536870912?e===No:!1}function Qd(){var e=N.H;return N.H=gc,e===null?gc:e}function $d(){var e=N.A;return N.A=td,e}function ef(){pd=4,ld||(od&4194048)!==od&&Mo.current!==null||(ud=!0),!(md&134217727)&&!(hd&134217727)||id===null||Kd(id,od,_d,!1)}function tf(e,t,n){var r=rd;rd|=2;var i=Qd(),a=$d();(id!==e||od!==t)&&(Td=null,Yd(e,t)),t=!1;var o=pd;a:do try{if(sd!==0&&ad!==null){var s=ad,c=cd;switch(sd){case 8:Jd(),o=6;break a;case 3:case 2:case 9:case 6:Mo.current===null&&(t=!0);var l=sd;if(sd=0,cd=null,cf(e,s,c,l),n&&ud){o=0;break a}break;default:l=sd,sd=0,cd=null,cf(e,s,c,l)}}nf(),o=pd;break}catch(t){Xd(e,t)}while(1);return t&&e.shellSuspendCounter++,va=_a=null,rd=r,N.H=i,N.A=a,ad===null&&(id=null,od=0,wi()),o}function nf(){for(;ad!==null;)of(ad)}function rf(e,t){var n=rd;rd|=2;var r=Qd(),a=$d();id!==e||od!==t?(Td=null,wd=We()+500,Yd(e,t)):ud=lt(e,t);a:do try{if(sd!==0&&ad!==null){t=ad;var o=cd;b:switch(sd){case 1:sd=0,cd=null,cf(e,t,o,1);break;case 2:case 9:if(eo(o)){sd=0,cd=null,sf(t);break}t=function(){sd!==2&&sd!==9||id!==e||(sd=7),Ff(e)},o.then(t,t);break a;case 3:sd=7;break a;case 4:sd=5;break a;case 7:eo(o)?(sd=0,cd=null,sf(t)):(sd=0,cd=null,cf(e,t,o,7));break;case 5:var s=null;switch(ad.tag){case 26:s=ad.memoizedState;case 5:case 27:var c=ad;if(s?ah(s):c.stateNode.complete){sd=0,cd=null;var l=c.sibling;if(l!==null)ad=l;else{var u=c.return;u===null?ad=null:(ad=u,lf(u))}break b}}sd=0,cd=null,cf(e,t,o,5);break;case 6:sd=0,cd=null,cf(e,t,o,6);break;case 8:Jd(),pd=6;break a;default:throw Error(i(462))}}af();break}catch(t){Xd(e,t)}while(1);return va=_a=null,N.H=r,N.A=a,rd=n,ad===null?(id=null,od=0,wi(),pd):0}function af(){for(;ad!==null&&!He();)of(ad)}function of(e){var t=pl(e.alternate,e,fd);e.memoizedProps=e.pendingProps,t===null?lf(e):ad=t}function sf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=qc(n,t,t.pendingProps,t.type,void 0,od);break;case 11:t=qc(n,t,t.pendingProps,t.type.render,t.ref,od);break;case 5:cs(t);var r=t;r===ra&&(aa?(da(r),r.tag===5&&r.stateNode!=null&&(ia=r.stateNode)):(da(r),aa=!0));default:Sl(n,t),t=ad=Fi(t,fd),t=pl(n,t,fd)}e.memoizedProps=e.pendingProps,t===null?lf(e):ad=t}function cf(e,t,n,r){va=_a=null,cs(t),oo=null,so=0;var i=t.return;try{if(Nc(e,i,t,n,od)){pd=1,Oc(e,Hi(n,e.current)),ad=null;return}}catch(t){if(i!==null)throw ad=i,t;pd=1,Oc(e,Hi(n,e.current)),ad=null;return}t.flags&32768?(aa||r===1?e=!0:ud||od&536870912?e=!1:(ld=e=!0,(r===2||r===9||r===3||r===6)&&(r=Mo.current,r!==null&&r.tag===13&&(r.flags|=16384))),uf(t,e)):lf(t)}function lf(e){var t=e;do{if(t.flags&32768){uf(t,ld);return}e=t.return;var n=bl(t.alternate,t,fd);if(n!==null){ad=n;return}if(t=t.sibling,t!==null){ad=t;return}ad=t=e}while(t!==null);pd===0&&(pd=5)}function uf(e,t){do{var n=xl(e.alternate,e);if(n!==null){n.flags&=32767,ad=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ad=e;return}ad=e=n}while(e!==null);pd=6,ad=null}function df(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do yf();while(Dd!==0);if(rd&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===id&&(ad=id=null,od=0),kd=t,Od=e,Ad=n,Md=a,Nd=r,ff(e,t,n,s,c,l,f)}}function ff(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(jd=s,s|=Ci,ht(e,n,s,r,i,a),Fd=null,(n&335544064)===n?(Id=La(e),r=10262):(Id=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Of(Je,function(){return bf(),null})):(e.callbackNode=null,e.callbackPriority=0),Vl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=N.T,N.T=null,i=P.p,P.p=2,a=rd,rd|=4;try{gu(e,t,n)}finally{rd=a,P.p=i,N.T=r}}Dd=1,Vl?Pd=Hp(o,e.containerInfo,Id,hf,gf,mf,_f,bf,pf,null,null):(hf(),gf(),_f())}function pf(e){if(Dd!==0){var t=Od.onRecoverableError;t(e,{componentStack:null})}}function mf(){Dd===3&&(Dd=0,Lu(kd,Od),Dd=4)}function hf(){if(Dd===1){Dd=0;var e=Od,t=kd,n=Ad,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=N.T,N.T=null;var i=P.p;P.p=2;var a=rd;rd|=4;try{pu=mu=!1,Nu(t,e,n),n=yp;var o=Jr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&qr(s.ownerDocument.documentElement,s)){if(c!==null&&Yr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Kr(s,h),v=Kr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Eh=!!vp,yp=vp=null}finally{rd=a,P.p=i,N.T=r}}e.current=t,Dd=2}}function gf(){if(Dd===2){Dd=0;var e=Od,t=kd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=rd;rd|=4;try{vu(e,t.alternate,t)}finally{rd=i,P.p=r,N.T=n}}Dd=3}}function _f(){if(Dd===4||Dd===3){Dd=0;var e=Pd;Pd=null,Ue();var t=Od,n=kd,r=Ad,i=Nd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Dd=5:(Dd=0,kd=Od=null,vf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Ed=null),bt(r),n=n.stateNode,F&&typeof F.onCommitFiberRoot==`function`)try{F.onCommitFiberRoot($e,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=N.T,a=P.p,P.p=2,N.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{N.T=n,P.p=a}}if(i=Fd,o=Id,Id=null,i!==null&&(Fd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Ad&3&&yf(),Ff(t),a=t.pendingLanes,r&261930&&a&42?t===Rd?Ld++:(Ld=0,Rd=t):(Ld=0,Rd=null),If(0,!1)}}function vf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Pa(t)))}function yf(){return Pd!==null&&(Pd.skipTransition(),Pd=null),hf(),gf(),_f(),bf()}function bf(){if(Dd!==5)return!1;var e=Od,t=jd;jd=0;var n=bt(Ad),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=Md,Md=null;var o=Od,s=Ad;if(Dd=0,kd=Od=null,Ad=0,rd&6)throw Error(i(331));var c=rd;if(rd|=4,Qu(o.current),Wu(o,o.current,s,n),rd=c,If(0,!1),F&&typeof F.onPostCommitFiberRoot==`function`)try{F.onPostCommitFiberRoot($e,o)}catch{}return!0}finally{P.p=a,N.T=r,vf(e,t)}}function xf(e,t,n){t=Hi(n,t),t=Ac(e.stateNode,t,2),e=yo(e,t,2),e!==null&&(mt(e,2),Ff(e))}function Sf(e,t,n){if(e.tag===3)xf(e,e,n);else for(;t!==null;){if(t.tag===3){xf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Ed===null||!Ed.has(r))){e=Hi(n,e),n=jc(2),r=yo(t,n,2),r!==null&&(Mc(n,r,t,e),mt(r,2),Ff(r));break}}t=t.return}}function Cf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new nd;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(dd=!0,i.add(n),e=wf.bind(null,e,t,n),t.then(e,e))}function wf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,id===e&&(od&n)===n&&(pd===4||pd===3&&(od&62914560)===od&&300>We()-Sd?rd&2?gd|=n:Yd(e,0):gd|=n,vd===od&&(vd=0)),Ff(e)}function Tf(e,t){t===0&&(t=ft()),e=Di(e,t),e!==null&&(mt(e,t),Ff(e))}function Ef(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Tf(e,n)}function Df(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Tf(e,n)}function Of(e,t){return Be(e,t)}var kf=null,Af=null,jf=!1,Mf=!1,Nf=!1,Pf=0;function Ff(e){e!==Af&&e.next===null&&(Af===null?kf=Af=e:Af=Af.next=e),Mf=!0,jf||(jf=!0,Hf())}function If(e,t){if(!Nf&&Mf){Nf=!0;do for(var n=!1,r=kf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-tt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Vf(r,a))}else a=od,a=ct(r,r===id?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||lt(r,a)||(n=!0,Vf(r,a))}r=r.next}while(n);Nf=!1}}function Lf(){Rf()}function Rf(){Mf=jf=!1;var e=0;Pf!==0&&U()&&(e=Pf);for(var t=We(),n=null,r=kf;r!==null;){var i=r.next,a=zf(r,t);a===0?(r.next=null,n===null?kf=i:n.next=i,i===null&&(Af=n)):(n=r,(e!==0||a&3)&&(Mf=!0)),r=i}Dd!==0&&Dd!==5||If(e,!1),Pf!==0&&(Pf=0)}function zf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-tt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=dt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=id,n=od,n=ct(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(sd===2||sd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ve(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||lt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ve(r),bt(n)){case 2:case 8:n=qe;break;case 32:n=Je;break;case 268435456:n=Xe;break;default:n=Je}return r=Bf.bind(null,e),n=Be(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ve(r),e.callbackPriority=2,e.callbackNode=null,2}function Bf(e,t){if(Dd!==0&&Dd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(yf()&&e.callbackNode!==n)return null;var r=od;return r=ct(e,e===id?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Ud(e,r,t),zf(e,We()),e.callbackNode!=null&&e.callbackNode===n?Bf.bind(null,e):null)}function Vf(e,t){if(yf())return null;Ud(e,t,!0)}function Hf(){Ap(function(){rd&6?Be(Ke,Lf):Rf()})}function Uf(){if(Pf===0){var e=Ba;e===0&&(e=it,it<<=1,!(it&261888)&&(it=256)),Pf=e}return Pf}function Wf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:L(e)}function Gf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Wf((i[Tt]||null).action),o=r.submitter;o&&(t=(t=o[Tt]||null)?Wf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Vn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Pf!==0){var e=new FormData(i,o);nc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),nc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Kf=0;Kf<hi.length;Kf++){var qf=hi[Kf];gi(qf.toLowerCase(),`on`+(qf[0].toUpperCase()+qf.slice(1)))}gi(si,`onAnimationEnd`),gi(ci,`onAnimationIteration`),gi(li,`onAnimationStart`),gi(`dblclick`,`onDoubleClick`),gi(`focusin`,`onFocus`),gi(`focusout`,`onBlur`),gi(ui,`onTransitionRun`),gi(di,`onTransitionStart`),gi(fi,`onTransitionCancel`),gi(pi,`onTransitionEnd`),Ut(`onMouseEnter`,[`mouseout`,`mouseover`]),Ut(`onMouseLeave`,[`mouseout`,`mouseover`]),Ut(`onPointerEnter`,[`pointerout`,`pointerover`]),Ut(`onPointerLeave`,[`pointerout`,`pointerover`]),Ht(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ht(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ht(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ht(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Jf=`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(` `),Yf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Jf));function Xf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){z(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){z(e)}i.currentTarget=null,a=c}}}}function Zf(e,t){var n=t[Dt];n===void 0&&(n=t[Dt]=new Set);var r=e+`__bubble`;n.has(r)||(tp(t,e,2,!1),n.add(r))}function Qf(e,t,n){var r=0;t&&(r|=4),tp(n,e,r,t)}var $f=`_reactListening`+Math.random().toString(36).slice(2);function ep(e){if(!e[$f]){e[$f]=!0,Bt.forEach(function(t){t!==`selectionchange`&&(Yf.has(t)||Qf(t,!1,e),Qf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$f]||(t[$f]=!0,Qf(`selectionchange`,!1,t))}}function tp(e,t,n,r){switch(Nh(t)){case 2:var i=Dh;break;case 8:i=Oh;break;default:i=kh}n=i.bind(null,t,n,e),i=void 0,!An||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function np(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Pt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}Dn(function(){var r=a,i=Sn(n),s=[];a:{var c=mi.get(e);if(c!==void 0){var l=Vn,u=e;switch(e){case`keypress`:if(In(n)===0)break a;case`keydown`:case`keyup`:l=ar;break;case`focusin`:u=`focus`,l=Xn;break;case`focusout`:u=`blur`,l=Xn;break;case`beforeblur`:case`afterblur`:l=Xn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Jn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Yn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=cr;break;case si:case ci:case li:l=Zn;break;case pi:l=lr;break;case`scroll`:case`scrollend`:l=Un;break;case`wheel`:l=ur;break;case`copy`:case`cut`:case`paste`:l=Qn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=or;break;case`submit`:l=sr;break;case`toggle`:case`beforetoggle`:l=dr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=On(m,p),g!=null&&d.push(rp(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==xn&&(u=n.relatedTarget||n.fromElement)&&(Pt(u)||u[Et]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Pt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Jn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=or,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:It(c),h=l==null?u:It(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Pt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,ap):null,c!==null&&op(s,u,c,d,!1),l!==null&&f!==null&&op(s,f,l,d,!0)))}a:{if(c=r?It(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=jr;else if(Tr(c)){if(Mr)_=R;else{_=zr;var v=Rr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&_n(r.elementType)&&(_=jr):_=Br;if(_&&=_(e,r)){Er(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?It(r):window,e){case`focusin`:(Tr(v)||v.contentEditable===`true`)&&(Zr=v,Qr=r,$r=null);break;case`focusout`:$r=Qr=Zr=null;break;case`mousedown`:ei=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ei=!1,ti(s,n,i);break;case`selectionchange`:if(Xr)break;case`keydown`:case`keyup`:ti(s,n,i)}var y;if(pr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else xr?yr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(gr&&n.locale!==`ko`&&(xr||b!==`onCompositionStart`?b===`onCompositionEnd`&&xr&&(y=Fn()):(Mn=i,Nn=`value`in Mn?Mn.value:Mn.textContent,xr=!0)),v=ip(r,b),0<v.length&&(b=new $n(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=br(n),y!==null&&(b.data=y)))),(y=hr?Sr(e,n):Cr(e,n))&&(b=ip(r,`onBeforeInput`),0<b.length&&(v=new $n(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Gf(s,e,r,n,i)}Xf(s,t)})}function rp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ip(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=On(e,n),i!=null&&r.unshift(rp(e,i,a)),i=On(e,t),i!=null&&r.push(rp(e,i,a))),e.tag===3)return r;e=e.return}return[]}function ap(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function op(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=On(n,a),l!=null&&o.unshift(rp(n,l,c))):i||(l=On(n,a),l!=null&&o.push(rp(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var sp=/\r\n?/g,cp=/\u0000|\uFFFD/g;function lp(e){return(typeof e==`string`?e:``+e).replace(sp,`
|
|
9
|
+
`).replace(cp,``)}function up(e,t){return t=lp(t),lp(e)===t}function dp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&pn(e,``+r);else return;break;case`className`:Zt(e,`class`,r);break;case`tabIndex`:Zt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Zt(e,n,r);break;case`style`:gn(e,r,o);return;case`data`:if(t!==`object`){Zt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=L(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&dp(e,t,`name`,a.name,a,null),dp(e,t,`formEncType`,a.formEncType,a,null),dp(e,t,`formMethod`,a.formMethod,a,null),dp(e,t,`formTarget`,a.formTarget,a,null)):(dp(e,t,`encType`,a.encType,a,null),dp(e,t,`method`,a.method,a,null),dp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=L(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=bn);return;case`onScroll`:r!=null&&Zf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Zf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=L(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Zf(`beforetoggle`,e),Zf(`toggle`,e),Xt(e,`popover`,r);break;case`xlinkActuate`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Xt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=vn.get(n)||n,Xt(e,n,r);else return}Jt=!0}function fp(e,t,n,r,a,o){switch(n){case`style`:gn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)pn(e,``+r);else return;break;case`onScroll`:r!=null&&Zf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Zf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=bn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Vt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Tt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Jt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Xt(e,n,r)}return}Jt=!0}function pp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Zf(`error`,e),Zf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:dp(e,t,o,s,n,null)}}a&&dp(e,t,`srcSet`,n.srcSet,n,null),r&&dp(e,t,`src`,n.src,n,null);return;case`input`:Zf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:dp(e,t,r,d,n,null)}}cn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Zf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:dp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&un(e,!!r,n,!0):un(e,!!r,t,!1);return;case`textarea`:for(s in Zf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:dp(e,t,s,c,n,null)}fn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:dp(e,t,l,r,n,null)}return;case`dialog`:Zf(`beforetoggle`,e),Zf(`toggle`,e),Zf(`cancel`,e),Zf(`close`,e);break;case`iframe`:case`object`:Zf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Jf.length;r++)Zf(Jf[r],e);break;case`image`:Zf(`error`,e),Zf(`load`,e);break;case`details`:Zf(`toggle`,e);break;case`embed`:case`source`:case`link`:Zf(`error`,e),Zf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:dp(e,t,u,r,n,null)}return;default:if(_n(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&fp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&dp(e,t,c,r,n,null))}var mp={};function hp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||dp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Jt=!0),o=m;break;case`name`:m!==f&&(Jt=!0),a=m;break;case`checked`:m!==f&&(Jt=!0),u=m;break;case`defaultChecked`:m!==f&&(Jt=!0),d=m;break;case`value`:m!==f&&(Jt=!0),s=m;break;case`defaultValue`:m!==f&&(Jt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&dp(e,t,p,m,r,f)}}sn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||dp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Jt=!0),p=o;break;case`defaultValue`:o!==l&&(Jt=!0),c=o;break;case`multiple`:o!==l&&(Jt=!0),s=o;default:o!==l&&dp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?un(e,!!n,n?[]:``,!1):un(e,!!n,t,!0)):un(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:dp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Jt=!0),p=a;break;case`defaultValue`:a!==o&&(Jt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&dp(e,t,s,a,r,o)}dn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:dp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Jt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:dp(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&dp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:dp(e,t,u,p,r,m)}return;default:if(_n(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&fp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||fp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&dp(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||dp(e,t,f,p,r,m)}function gp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function _p(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&gp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&gp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var vp=null,yp=null;function bp(e){return e.nodeType===9?e:e.ownerDocument}function xp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Sp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Cp(e,t,n,r){return n=bp(n).createElement(e),n[wt]=r,n[Tt]=t,pp(n,e,t),Rt(n),n}function wp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Tp=null;function U(){var e=window.event;return e&&e.type===`popstate`?e!==Tp&&(Tp=e,!0):(Tp=null,!1)}var Ep=typeof setTimeout==`function`?setTimeout:void 0,Dp=typeof clearTimeout==`function`?clearTimeout:void 0,Op=typeof Promise==`function`?Promise:void 0,kp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Ep,Ap=typeof queueMicrotask==`function`?queueMicrotask:Op===void 0?Ep:function(e){return Op.resolve(null).then(e).catch(jp)};function jp(e){setTimeout(function(){throw e})}function Mp(e){return e===`head`}function Np(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Qh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Dm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Dm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[jt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Dm(e.ownerDocument.body)}n=i}while(n);Qh(t)}function Pp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Fp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ip(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Lp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Rp(e){return Lp(e.getBoundingClientRect(),getComputedStyle(e),e)}function zp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Lp(t,n,e)}function Bp(e){return e.documentElement.clientHeight}function Vp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Hp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Bp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=oh(f),u>lh){s.length=o;break}f=new Promise(Vp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Up(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Up.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Up.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Up.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Wp(e){return{name:e,group:new Up(`group`,e),imagePair:new Up(`image-pair`,e),old:new Up(`old`,e),new:new Up(`new`,e)}}function Gp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Gp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Xp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Jp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Kp,e,s,r)}this._eventListeners=a}};function Kp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Gp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Xp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Jp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,qp,e,n,i),r.splice(t,1),a!==null&&a()}};function qp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Jp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Yp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Xp(e,t,n,r){if(e.length===0)return-1;r=Yp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Yp(a.optionsOrUseCapture)===r)return i}return-1}Gp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Jp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Jp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Gp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Zp,e,void 0,void 0)};function Zp(e,t){return e.tag!==6&&(e=b(e),Cm(e,t))}Gp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Qp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Zp(t[n],e);n--);};function Qp(e,t){return t.push(e),!1}Gp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=bp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,$p,e,void 0,void 0))};function $p(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Gp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,em,e,void 0,void 0)};function em(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}Gp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,tm,e,void 0,void 0);for(var n=t=0;n<nm.length;n++){var r=nm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):nm[t++]=r}nm.length=t}};function tm(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var nm=[],rm=!1;function im(e,t,n){nm.push({fragmentInstance:e,observer:t,instance:n}),rm||(rm=!0,wm(function(){rm=!1;var e=nm;nm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Gp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,am,e,void 0,void 0),e};function am(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Gp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Gp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Qp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||om(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function om(e,t,n,r,i){var a=Pt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function sm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Gp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,Qp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),sm(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),sm(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function cm(e,t){return e=b(e),lm(e,t),!1}function lm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function um(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Jp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<nm.length;i++){var a=nm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(nm[r++]=a)}nm.length=r,n.observe(e)}),lm(e,t))}function dm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Jp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?im(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function fm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:fm(n),Nt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function pm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[jt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=ym(e.nextSibling),e===null)break}return null}function mm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=ym(e.nextSibling),e===null))return null;return e}function hm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=ym(e.nextSibling),e===null))return null;return e}function gm(e){return e.data===`$?`||e.data===`$~`}function _m(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function vm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function ym(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var bm=null;function xm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return ym(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Sm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function Cm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function wm(e){kp(function(){kp(function(t){return e(t)})})}function Tm(e,t,n){switch(t=bp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Em(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&dp(e,t,r,null,mp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===bn&&(e.onclick=null),Nt(e)}function Dm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Nt(e)}var Om=new Map,km=new Set;function Am(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var jm=P.d;P.d={f:Mm,r:Nm,D:Im,C:Lm,L:Rm,m:zm,X:Vm,S:Bm,M:Hm};function Mm(){var e=jm.f(),t=qd();return e||t}function Nm(e){var t=Ft(e);t!==null&&t.tag===5&&t.type===`form`?ic(t):jm.r(e)}var Pm=typeof document>`u`?null:document;function Fm(e,t,n){var r=Pm;if(r&&typeof t==`string`&&t){var i=on(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),km.has(i)||(km.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),pp(t,`link`,e),Rt(t),r.head.appendChild(t)))}}function Im(e){jm.D(e),Fm(`dns-prefetch`,e,null)}function Lm(e,t){jm.C(e,t),Fm(`preconnect`,e,t)}function Rm(e,t,n){jm.L(e,t,n);var r=Pm;if(r&&e&&t){var i=`link[rel="preload"][as="`+on(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+on(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+on(n.imageSizes)+`"]`)):i+=`[href="`+on(e)+`"]`;var a=i;switch(t){case`style`:a=Wm(e);break;case`script`:a=Jm(e)}if(!(Om.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Om.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Gm(a))||t===`script`&&r.querySelector(Ym(a))))){var o=r.createElement(`link`);pp(o,`link`,e),t===`style`&&(o[Mt]=!0,o.onload=o.onerror=function(){zt(o)}),Rt(o),r.head.appendChild(o)}}}function zm(e,t){jm.m(e,t);var n=Pm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+on(r)+`"][href="`+on(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Jm(e)}if(!Om.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Om.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ym(a)))return}r=n.createElement(`link`),pp(r,`link`,e),Rt(r),n.head.appendChild(r)}}}function Bm(e,t,n){jm.S(e,t,n);var r=Pm;if(r&&e){var i=Lt(r).hoistableStyles,a=Wm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Gm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Om.get(a))&&Qm(e,n);var c=o=r.createElement(`link`);Rt(c),pp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Zm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Vm(e,t){jm.X(e,t);var n=Pm;if(n&&e){var r=Lt(n).hoistableScripts,i=Jm(e),a=r.get(i);a||(a=n.querySelector(Ym(i)),a||(e=D({src:e,async:!0},t),(t=Om.get(i))&&$m(e,t),a=n.createElement(`script`),Rt(a),pp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Hm(e,t){jm.M(e,t);var n=Pm;if(n&&e){var r=Lt(n).hoistableScripts,i=Jm(e),a=r.get(i);a||(a=n.querySelector(Ym(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Om.get(i))&&$m(e,t),a=n.createElement(`script`),Rt(a),pp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Um(e,t,n,r){var a=(a=Ee.current)?Am(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Wm(n.href),t=Lt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Wm(n.href);var o=Lt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Gm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Om.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Om.set(e,o)),qm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Jm(n),t=Lt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Wm(e){return`href="`+on(e)+`"`}function Gm(e){return`link[rel="stylesheet"][`+e+`]`}function Km(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function qm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Mt]){r.loading=1;return}}else t=e.createElement(`link`),t[Mt]=!0,t.onload=t.onerror=zt.bind(null,t),pp(t,`link`,n),Rt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Jm(e){return`[src="`+on(e)+`"]`}function Ym(e){return`script[async]`+e}function Xm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+on(n.href)+`"]`);if(r)return t.instance=r,Rt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Rt(r),pp(r,`style`,a),Zm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Wm(n.href);var o=e.querySelector(Gm(a));if(o)return t.state.loading|=4,t.instance=o,Rt(o),o;r=Km(n),(a=Om.get(a))&&Qm(r,a),o=(e.ownerDocument||e).createElement(`link`),Rt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),pp(o,`link`,r),t.state.loading|=4,Zm(o,n.precedence,e),t.instance=o;case`script`:return o=Jm(n.src),(a=e.querySelector(Ym(o)))?(t.instance=a,Rt(a),a):(r=n,(a=Om.get(o))&&(r=D({},n),$m(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Rt(a),pp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Zm(r,n.precedence,e));return t.instance}function Zm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Qm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function $m(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var eh=null;function th(e,t,n){if(eh===null){var r=new Map,i=eh=new Map;i.set(n,r)}else i=eh,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[jt]||a[wt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function nh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function rh(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function ih(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function ah(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function oh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function sh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=oh(t),e.suspenseyImages.push(t)),e=ph.bind(e),t.decode().then(e,e))}function ch(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Wm(r.href),a=t.querySelector(Gm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=fh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Rt(a);return}a=t.ownerDocument||t,r=Km(r),(i=Om.get(i))&&Qm(r,i),a=a.createElement(`link`),Rt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),pp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=fh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var lh=0;function uh(e,t){return e.stylesheets&&e.count===0&&hh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&hh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&lh===0&&(lh=62500*_p());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&hh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>lh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function dh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)hh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function fh(){this.count--,dh(this)}function ph(){this.imgCount--,dh(this)}var mh=null;function hh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,mh=new Map,t.forEach(gh,e),mh=null,fh.call(e))}function gh(e,t){if(!(t.state.loading&4)){var n=mh.get(e);if(n)var r=n.get(null);else{n=new Map,mh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=fh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var _h={$$typeof:j,Provider:null,Consumer:null,_currentValue:ve,_currentValue2:ve,_threadCount:0};function vh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=pt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pt(0),this.hiddenUpdates=pt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function yh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new vh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Mi(3,null,null,t),e.current=a,a.stateNode=e,t=Na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},go(a),e}function bh(e){return e?(e=Ai,e):Ai}function xh(e,t,n,r,i,a){i=bh(i),r.context===null?r.context=i:r.pendingContext=i,r=vo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=yo(e,r,t),n!==null&&(Hd(n,e,t),bo(n,e,t))}function Sh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ch(e,t){Sh(e,t),(e=e.alternate)&&Sh(e,t)}function wh(e){if(e.tag===13||e.tag===31){var t=Di(e,67108864);t!==null&&Hd(t,e,67108864),Ch(e,67108864)}}function Th(e){if(e.tag===13||e.tag===31){var t=zd();t=yt(t);var n=Di(e,t);n!==null&&Hd(n,e,t),Ch(e,t)}}var Eh=!0;function Dh(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,kh(e,t,n,r)}finally{P.p=a,N.T=i}}function Oh(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,kh(e,t,n,r)}finally{P.p=a,N.T=i}}function kh(e,t,n,r){if(Eh){var i=Ah(r);if(i===null)np(e,t,r,jh,n),Hh(e,r);else if(Wh(i,e,t,n,r))r.stopPropagation();else if(Hh(e,r),t&4&&-1<Vh.indexOf(e)){for(;i!==null;){var a=Ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=st(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-tt(o);s.entanglements[1]|=c,o&=~c}Ff(a),!(rd&6)&&(wd=We()+500,If(0,!1))}}break;case 31:case 13:s=Di(a,2),s!==null&&Hd(s,a,2),qd(),Ch(a,2)}if(a=Ah(r),a===null&&np(e,t,r,jh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else np(e,t,r,null,n)}}function Ah(e){return e=Sn(e),Mh(e)}var jh=null;function Mh(e){if(jh=null,e=Pt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return jh=e,null}function Nh(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ge()){case Ke:return 2;case qe:return 8;case Je:case Ye:return 32;case Xe:return 268435456;default:return 32}default:return 32}}var Ph=!1,Fh=null,Ih=null,Lh=null,Rh=new Map,zh=new Map,Bh=[],Vh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Hh(e,t){switch(e){case`focusin`:case`focusout`:Fh=null;break;case`dragenter`:case`dragleave`:Ih=null;break;case`mouseover`:case`mouseout`:Lh=null;break;case`pointerover`:case`pointerout`:Rh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:zh.delete(t.pointerId)}}function Uh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ft(t),t!==null&&wh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Wh(e,t,n,r,i){switch(t){case`focusin`:return Fh=Uh(Fh,e,t,n,r,i),!0;case`dragenter`:return Ih=Uh(Ih,e,t,n,r,i),!0;case`mouseover`:return Lh=Uh(Lh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Rh.set(a,Uh(Rh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,zh.set(a,Uh(zh.get(a)||null,e,t,n,r,i)),!0}return!1}function Gh(e){var t=Pt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,St(e.priority,function(){Th(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,St(e.priority,function(){Th(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Kh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ah(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);xn=r,n.target.dispatchEvent(r),xn=null}else return t=Ft(n),t!==null&&wh(t),e.blockedOn=n,!1;t.shift()}return!0}function qh(e,t,n){Kh(e)&&n.delete(t)}function Jh(){Ph=!1,Fh!==null&&Kh(Fh)&&(Fh=null),Ih!==null&&Kh(Ih)&&(Ih=null),Lh!==null&&Kh(Lh)&&(Lh=null),Rh.forEach(qh),zh.forEach(qh)}function Yh(e,n){e.blockedOn===n&&(e.blockedOn=null,Ph||(Ph=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Jh)))}var Xh=null;function Zh(e){Xh!==e&&(Xh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Xh===e&&(Xh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Mh(r||n)===null)continue;break}var a=Ft(n);a!==null&&(e.splice(t,3),t-=3,nc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Qh(e){function t(t){return Yh(t,e)}Fh!==null&&Yh(Fh,e),Ih!==null&&Yh(Ih,e),Lh!==null&&Yh(Lh,e),Rh.forEach(t),zh.forEach(t);for(var n=0;n<Bh.length;n++){var r=Bh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Bh.length&&(n=Bh[0],n.blockedOn===null);)Gh(n),n.blockedOn===null&&Bh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Tt]||null;if(typeof a==`function`)o||Zh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Tt]||null)s=o.formAction;else if(Mh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Zh(n)}}}function $h(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function eg(e){this._internalRoot=e}tg.prototype.render=eg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;xh(n,zd(),e,t,null,null)},tg.prototype.unmount=eg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xh(e.current,2,null,e,null,null),qd(),t[Et]=null}};function tg(e){this._internalRoot=e}tg.prototype.unstable_scheduleHydration=function(e){if(e){var t=xt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Bh.length&&t!==0&&t<Bh[n].priority;n++);Bh.splice(n,0,e),n===0&&Gh(e)}};var ng=n.version;if(ng!==`19.3.0`)throw Error(i(527,ng,`19.3.0`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var rg={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var ig=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ig.isDisabled&&ig.supportsFiber)try{$e=ig.inject(rg),F=ig}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Tc,s=Ec,c=Dc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=yh(e,1,!1,null,null,n,r,null,o,s,c,$h),e[Et]=t.current,ep(e),new eg(t)}})),g=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),v=o(((e,t)=>{t.exports=_()}));function y(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var b=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,x=y(function(e){return b.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91});function S(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function C(e){var t=document.createElement(`style`);return t.setAttribute(`data-emotion`,e.key),e.nonce!==void 0&&t.setAttribute(`nonce`,e.nonce),t.appendChild(document.createTextNode(``)),t.setAttribute(`data-s`,``),t}var w=function(){function e(e){var t=this;this._insertTag=function(e){var n=t.tags.length===0?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling;t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=e.speedy===void 0||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(C(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=S(t);try{n.insertRule(e,n.cssRules.length)}catch{}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){return e.parentNode?.removeChild(e)}),this.tags=[],this.ctr=0},e}(),T=`-ms-`,E=`-moz-`,D=`-webkit-`,ee=`comm`,O=`rule`,k=`decl`,A=`@import`,te=`@keyframes`,ne=`@layer`,re=Math.abs,j=String.fromCharCode,ie=Object.assign;function ae(e,t){return le(e,0)^45?(((t<<2^le(e,0))<<2^le(e,1))<<2^le(e,2))<<2^le(e,3):0}function oe(e){return e.trim()}function se(e,t){return(e=t.exec(e))?e[0]:e}function M(e,t,n){return e.replace(t,n)}function ce(e,t){return e.indexOf(t)}function le(e,t){return e.charCodeAt(t)|0}function ue(e,t,n){return e.slice(t,n)}function de(e){return e.length}function fe(e){return e.length}function pe(e,t){return t.push(e),e}function me(e,t){return e.map(t).join(``)}var he=1,ge=1,_e=0,N=0,P=0,ve=``;function ye(e,t,n,r,i,a,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:he,column:ge,length:o,return:``}}function be(e,t){return ie(ye(``,null,null,``,null,null,0),e,{length:-e.length},t)}function xe(){return P}function Se(){return P=N>0?le(ve,--N):0,ge--,P===10&&(ge=1,he--),P}function Ce(){return P=N<_e?le(ve,N++):0,ge++,P===10&&(ge=1,he++),P}function we(){return le(ve,N)}function Te(){return N}function Ee(e,t){return ue(ve,e,t)}function De(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Oe(e){return he=ge=1,_e=de(ve=e),N=0,[]}function ke(e){return ve=``,e}function Ae(e){return oe(Ee(N-1,Ne(e===91?e+2:e===40?e+1:e)))}function je(e){for(;(P=we())&&P<33;)Ce();return De(e)>2||De(P)>3?``:` `}function Me(e,t){for(;--t&&Ce()&&!(P<48||P>102||P>57&&P<65||P>70&&P<97););return Ee(e,Te()+(t<6&&we()==32&&Ce()==32))}function Ne(e){for(;Ce();)switch(P){case e:return N;case 34:case 39:e!==34&&e!==39&&Ne(P);break;case 40:e===41&&Ne(e);break;case 92:Ce()}return N}function Pe(e,t){for(;Ce()&&e+P!==57&&(e+P!==84||we()!==47););return`/*`+Ee(t,N-1)+`*`+j(e===47?e:Ce())}function Fe(e){for(;!De(we());)Ce();return Ee(e,N)}function Ie(e){return ke(Le(``,null,null,null,[``],e=Oe(e),0,[0],e))}function Le(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=``,b=i,x=a,S=r,C=y;g;)switch(m=v,v=Ce()){case 40:if(m!=108&&le(C,d-1)==58){ce(C+=M(Ae(v),`&`,`&\f`),`&\f`)!=-1&&(_=-1);break}case 34:case 39:case 91:C+=Ae(v);break;case 9:case 10:case 13:case 32:C+=je(m);break;case 92:C+=Me(Te()-1,7);continue;case 47:switch(we()){case 42:case 47:pe(ze(Pe(Ce(),Te()),t,n),c);break;default:C+=`/`}break;case 123*h:s[l++]=de(C)*_;case 125*h:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:_==-1&&(C=M(C,/\f/g,``)),p>0&&de(C)-d&&pe(p>32?Be(C+`;`,r,n,d-1):Be(M(C,` `,``)+`;`,r,n,d-2),c);break;case 59:C+=`;`;default:if(pe(S=Re(C,t,n,l,u,i,s,y,b=[],x=[],d),a),v===123){if(u===0)Le(C,t,S,S,b,a,d,s,x);else switch(f===99&&le(C,3)===110?100:f){case 100:case 108:case 109:case 115:Le(e,S,S,r&&pe(Re(e,S,S,0,0,i,s,y,i,b=[],d),x),i,x,d,s,r?b:x);break;default:Le(C,S,S,S,[``],x,0,s,x)}}}l=u=p=0,h=_=1,y=C=``,d=o;break;case 58:d=1+de(C),p=m;default:if(h<1){if(v==123)--h;else if(v==125&&h++==0&&Se()==125)continue}switch(C+=j(v),v*h){case 38:_=u>0?1:(C+=`\f`,-1);break;case 44:s[l++]=(de(C)-1)*_,_=1;break;case 64:we()===45&&(C+=Ae(Ce())),f=we(),u=d=de(y=C+=Fe(Te())),v++;break;case 45:m===45&&de(C)==2&&(h=0)}}return a}function Re(e,t,n,r,i,a,o,s,c,l,u){for(var d=i-1,f=i===0?a:[``],p=fe(f),m=0,h=0,g=0;m<r;++m)for(var _=0,v=ue(e,d+1,d=re(h=o[m])),y=e;_<p;++_)(y=oe(h>0?f[_]+` `+v:M(v,/&\f/g,f[_])))&&(c[g++]=y);return ye(e,t,n,i===0?O:s,c,l,u)}function ze(e,t,n){return ye(e,t,n,ee,j(xe()),ue(e,2,-2),0)}function Be(e,t,n,r){return ye(e,t,n,k,ue(e,0,r),ue(e,r+1,-1),r)}function Ve(e,t){for(var n=``,r=fe(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||``;return n}function He(e,t,n,r){switch(e.type){case ne:if(e.children.length)break;case A:case k:return e.return=e.return||e.value;case ee:return``;case te:return e.return=e.value+`{`+Ve(e.children,r)+`}`;case O:e.value=e.props.join(`,`)}return de(n=Ve(e.children,r))?e.return=e.value+`{`+n+`}`:``}function Ue(e){var t=fe(e);return function(n,r,i,a){for(var o=``,s=0;s<t;s++)o+=e[s](n,r,i,a)||``;return o}}function We(e){return function(t){t.root||(t=t.return)&&e(t)}}var Ge=function(e,t,n){for(var r=0,i=0;r=i,i=we(),r===38&&i===12&&(t[n]=1),!De(i);)Ce();return Ee(e,N)},Ke=function(e,t){var n=-1,r=44;do switch(De(r)){case 0:r===38&&we()===12&&(t[n]=1),e[n]+=Ge(N-1,t,n);break;case 2:e[n]+=Ae(r);break;case 4:if(r===44){e[++n]=we()===58?`&\f`:``,t[n]=e[n].length;break}default:e[n]+=j(r)}while(r=Ce());return e},qe=function(e,t){return ke(Ke(Oe(e),t))},Je=new WeakMap,Ye=function(e){if(!(e.type!==`rule`||!e.parent||e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;n.type!==`rule`;)if(n=n.parent,!n)return;if((e.props.length!==1||t.charCodeAt(0)===58||Je.get(n))&&!r){Je.set(e,!0);for(var i=[],a=qe(t,i),o=n.props,s=0,c=0;s<a.length;s++)for(var l=0;l<o.length;l++,c++)e.props[c]=i[s]?a[s].replace(/&\f/g,o[l]):o[l]+` `+a[s]}}},Xe=function(e){if(e.type===`decl`){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return=``,e.value=``)}};function Ze(e,t){switch(ae(e,t)){case 5103:return D+`print-`+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return D+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return D+e+E+e+T+e+e;case 6828:case 4268:return D+e+T+e+e;case 6165:return D+e+T+`flex-`+e+e;case 5187:return D+e+M(e,/(\w+).+(:[^]+)/,D+`box-$1$2`+T+`flex-$1$2`)+e;case 5443:return D+e+T+`flex-item-`+M(e,/flex-|-self/,``)+e;case 4675:return D+e+T+`flex-line-pack`+M(e,/align-content|flex-|-self/,``)+e;case 5548:return D+e+T+M(e,`shrink`,`negative`)+e;case 5292:return D+e+T+M(e,`basis`,`preferred-size`)+e;case 6060:return D+`box-`+M(e,`-grow`,``)+D+e+T+M(e,`grow`,`positive`)+e;case 4554:return D+M(e,/([^-])(transform)/g,`$1`+D+`$2`)+e;case 6187:return M(M(M(e,/(zoom-|grab)/,D+`$1`),/(image-set)/,D+`$1`),e,``)+e;case 5495:case 3959:return M(e,/(image-set\([^]*)/,D+"$1$`$1");case 4968:return M(M(e,/(.+:)(flex-)?(.*)/,D+`box-pack:$3`+T+`flex-pack:$3`),/s.+-b[^;]+/,`justify`)+D+e+e;case 4095:case 3583:case 4068:case 2532:return M(e,/(.+)-inline(.+)/,D+`$1$2`)+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(de(e)-1-t>6)switch(le(e,t+1)){case 109:if(le(e,t+4)!==45)break;case 102:return M(e,/(.+:)(.+)-([^]+)/,`$1`+D+`$2-$3$1`+E+(le(e,t+3)==108?`$3`:`$2-$3`))+e;case 115:return~ce(e,`stretch`)?Ze(M(e,`stretch`,`fill-available`),t)+e:e}break;case 4949:if(le(e,t+1)!==115)break;case 6444:switch(le(e,de(e)-3-(~ce(e,`!important`)&&10))){case 107:return M(e,`:`,`:`+D)+e;case 101:return M(e,/(.+:)([^;!]+)(;|!.+)?/,`$1`+D+(le(e,14)===45?`inline-`:``)+`box$3$1`+D+`$2$3$1`+T+`$2box$3`)+e}break;case 5936:switch(le(e,t+11)){case 114:return D+e+T+M(e,/[svh]\w+-[tblr]{2}/,`tb`)+e;case 108:return D+e+T+M(e,/[svh]\w+-[tblr]{2}/,`tb-rl`)+e;case 45:return D+e+T+M(e,/[svh]\w+-[tblr]{2}/,`lr`)+e}return D+e+T+e+e}return e}var Qe=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case k:e.return=Ze(e.value,e.length);break;case te:return Ve([be(e,{value:M(e.value,`@`,`@`+D)})],r);case O:if(e.length)return me(e.props,function(t){switch(se(t,/(::plac\w+|:read-\w+)/)){case`:read-only`:case`:read-write`:return Ve([be(e,{props:[M(t,/:(read-\w+)/,`:`+E+`$1`)]})],r);case`::placeholder`:return Ve([be(e,{props:[M(t,/:(plac\w+)/,`:`+D+`input-$1`)]}),be(e,{props:[M(t,/:(plac\w+)/,`:`+E+`$1`)]}),be(e,{props:[M(t,/:(plac\w+)/,T+`input-$1`)]})],r)}return``})}}],$e=function(e){var t=e.key;if(t===`css`){var n=document.querySelectorAll(`style[data-emotion]:not([data-s])`);Array.prototype.forEach.call(n,function(e){e.getAttribute(`data-emotion`).indexOf(` `)!==-1&&(document.head.appendChild(e),e.setAttribute(`data-s`,``))})}var r=e.stylisPlugins||Qe,i={},a,o=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll(`style[data-emotion^="`+t+` "]`),function(e){for(var t=e.getAttribute(`data-emotion`).split(` `),n=1;n<t.length;n++)i[t[n]]=!0;o.push(e)});var s,c=[Ye,Xe],l,u=[He,We(function(e){l.insert(e)})],d=Ue(c.concat(r,u)),f=function(e){return Ve(Ie(e),d)};s=function(e,t,n,r){l=n,f(e?e+`{`+t.styles+`}`:t.styles),r&&(p.inserted[t.name]=!0)};var p={key:t,sheet:new w({key:t,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:s};return p.sheet.hydrate(o),p},F=c(u()),et=m(),tt=c(g()),I=v();function nt(){return nt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nt.apply(null,arguments)}var rt=o((e=>{var t=typeof Symbol==`function`&&Symbol.for,n=t?Symbol.for(`react.element`):60103,r=t?Symbol.for(`react.portal`):60106,i=t?Symbol.for(`react.fragment`):60107,a=t?Symbol.for(`react.strict_mode`):60108,o=t?Symbol.for(`react.profiler`):60114,s=t?Symbol.for(`react.provider`):60109,c=t?Symbol.for(`react.context`):60110,l=t?Symbol.for(`react.async_mode`):60111,u=t?Symbol.for(`react.concurrent_mode`):60111,d=t?Symbol.for(`react.forward_ref`):60112,f=t?Symbol.for(`react.suspense`):60113,p=t?Symbol.for(`react.suspense_list`):60120,m=t?Symbol.for(`react.memo`):60115,h=t?Symbol.for(`react.lazy`):60116,g=t?Symbol.for(`react.block`):60121,_=t?Symbol.for(`react.fundamental`):60117,v=t?Symbol.for(`react.responder`):60118,y=t?Symbol.for(`react.scope`):60119;function b(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:switch(e=e.type,e){case l:case u:case i:case o:case a:case f:return e;default:switch(e&&=e.$$typeof,e){case c:case d:case h:case m:case s:return e;default:return t}}case r:return t}}}function x(e){return b(e)===u}e.AsyncMode=l,e.ConcurrentMode=u,e.ContextConsumer=c,e.ContextProvider=s,e.Element=n,e.ForwardRef=d,e.Fragment=i,e.Lazy=h,e.Memo=m,e.Portal=r,e.Profiler=o,e.StrictMode=a,e.Suspense=f,e.isAsyncMode=function(e){return x(e)||b(e)===l},e.isConcurrentMode=x,e.isContextConsumer=function(e){return b(e)===c},e.isContextProvider=function(e){return b(e)===s},e.isElement=function(e){return typeof e==`object`&&!!e&&e.$$typeof===n},e.isForwardRef=function(e){return b(e)===d},e.isFragment=function(e){return b(e)===i},e.isLazy=function(e){return b(e)===h},e.isMemo=function(e){return b(e)===m},e.isPortal=function(e){return b(e)===r},e.isProfiler=function(e){return b(e)===o},e.isStrictMode=function(e){return b(e)===a},e.isSuspense=function(e){return b(e)===f},e.isValidElementType=function(e){return typeof e==`string`||typeof e==`function`||e===i||e===u||e===o||e===a||e===f||e===p||typeof e==`object`&&!!e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===_||e.$$typeof===v||e.$$typeof===y||e.$$typeof===g)},e.typeOf=b})),it=o(((e,t)=>{t.exports=rt()})),at=o(((e,t)=>{var n=it(),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[n.ForwardRef]=a,s[n.Memo]=o;function c(e){return n.isMemo(e)?o:s[e.$$typeof]||r}var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;function h(e,t,n){if(typeof t!=`string`){if(m){var r=p(t);r&&r!==m&&h(e,r,n)}var a=u(t);d&&(a=a.concat(d(t)));for(var o=c(e),s=c(t),g=0;g<a.length;++g){var _=a[g];if(!i[_]&&!(n&&n[_])&&!(s&&s[_])&&!(o&&o[_])){var v=f(t,_);try{l(e,_,v)}catch{}}}}return e}t.exports=h}));function ot(e,t,n){var r=``;return n.split(` `).forEach(function(n){e[n]===void 0?n&&(r+=n+` `):t.push(e[n]+`;`)}),r}var st=function(e,t,n){var r=e.key+`-`+t.name;n===!1&&e.registered[r]===void 0&&(e.registered[r]=t.styles)},ct=function(e,t,n){st(e,t,n);var r=e.key+`-`+t.name;if(e.inserted[t.name]===void 0){var i=t;do e.insert(t===i?`.`+r:``,i,e.sheet,!0),i=i.next;while(i!==void 0)}};function lt(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var ut={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},dt=/[A-Z]|^ms/g,ft=/_EMO_([^_]+?)_([^]*?)_EMO_/g,pt=function(e){return e.charCodeAt(1)===45},mt=function(e){return e!=null&&typeof e!=`boolean`},ht=y(function(e){return pt(e)?e:e.replace(dt,`-$&`).toLowerCase()}),gt=function(e,t){switch(e){case`animation`:case`animationName`:if(typeof t==`string`)return t.replace(ft,function(e,t,n){return bt={name:t,styles:n,next:bt},t})}return ut[e]!==1&&!pt(e)&&typeof t==`number`&&t!==0?t+`px`:t};function _t(e,t,n){if(n==null)return``;var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case`boolean`:return``;case`object`:var i=n;if(i.anim===1)return bt={name:i.name,styles:i.styles,next:bt},i.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)bt={name:o.name,styles:o.styles,next:bt},o=o.next;return a.styles+`;`}return vt(e,t,n);case`function`:if(e!==void 0){var s=bt,c=n(e);return bt=s,_t(e,t,c)}}var l=n;if(t==null)return l;var u=t[l];return u===void 0?l:u}function vt(e,t,n){var r=``;if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=_t(e,t,n[i])+`;`;else for(var a in n){var o=n[a];if(typeof o!=`object`){var s=o;t!=null&&t[s]!==void 0?r+=a+`{`+t[s]+`}`:mt(s)&&(r+=ht(a)+`:`+gt(a,s)+`;`)}else if(Array.isArray(o)&&typeof o[0]==`string`&&(t==null||t[o[0]]===void 0))for(var c=0;c<o.length;c++)mt(o[c])&&(r+=ht(a)+`:`+gt(a,o[c])+`;`);else{var l=_t(e,t,o);switch(a){case`animation`:case`animationName`:r+=ht(a)+`:`+l+`;`;break;default:r+=a+`{`+l+`}`}}}return r}var yt=/label:\s*([^\s;{]+)\s*(;|$)/g,bt;function xt(e,t,n){if(e.length===1&&typeof e[0]==`object`&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i=``;bt=void 0;var a=e[0];a==null||a.raw===void 0?(r=!1,i+=_t(n,t,a)):i+=a[0];for(var o=1;o<e.length;o++)i+=_t(n,t,e[o]),r&&(i+=a[o]);yt.lastIndex=0;for(var s=``,c;(c=yt.exec(i))!==null;)s+=`-`+c[1];return{name:lt(i)+s,styles:i,next:bt}}var St=function(e){return e()},Ct=F.useInsertionEffect?F.useInsertionEffect:!1,wt=Ct||St,Tt=Ct||F.useLayoutEffect,Et=F.createContext(typeof HTMLElement<`u`?$e({key:`css`}):null);Et.Provider;var Dt=function(e){return(0,F.forwardRef)(function(t,n){return e(t,(0,F.useContext)(Et),n)})},Ot=F.createContext({}),kt={}.hasOwnProperty,At=`__EMOTION_TYPE_PLEASE_DO_NOT_USE__`,jt=function(e,t){var n={};for(var r in t)kt.call(t,r)&&(n[r]=t[r]);return n[At]=e,n},Mt=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return st(t,n,r),wt(function(){return ct(t,n,r)}),null},Nt=Dt(function(e,t,n){var r=e.css;typeof r==`string`&&t.registered[r]!==void 0&&(r=t.registered[r]);var i=e[At],a=[r],o=``;typeof e.className==`string`?o=ot(t.registered,a,e.className):e.className!=null&&(o=e.className+` `);var s=xt(a,void 0,F.useContext(Ot));o+=t.key+`-`+s.name;var c={};for(var l in e)kt.call(e,l)&&l!==`css`&&l!==At&&(c[l]=e[l]);return c.className=o,n&&(c.ref=n),F.createElement(F.Fragment,null,F.createElement(Mt,{cache:t,serialized:s,isStringTag:typeof i==`string`}),F.createElement(i,c))});at();var Pt=function(e,t){var n=arguments;if(t==null||!kt.call(t,`css`))return F.createElement.apply(void 0,n);var r=n.length,i=Array(r);i[0]=Nt,i[1]=jt(e,t);for(var a=2;a<r;a++)i[a]=n[a];return F.createElement.apply(null,i)};(function(e){var t;t||=e.JSX||={}})(Pt||={});var Ft=Dt(function(e,t){var n=e.styles,r=xt([n],void 0,F.useContext(Ot)),i=F.useRef();return Tt(function(){var e=t.key+`-global`,n=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),a=!1,o=document.querySelector(`style[data-emotion="`+e+` `+r.name+`"]`);return t.sheet.tags.length&&(n.before=t.sheet.tags[0]),o!==null&&(a=!0,o.setAttribute(`data-emotion`,e),n.hydrate([o])),i.current=[n,a],function(){n.flush()}},[t]),Tt(function(){var e=i.current,n=e[0];if(e[1]){e[1]=!1;return}r.next!==void 0&&ct(t,r.next,!0),n.tags.length&&(n.before=n.tags[n.tags.length-1].nextElementSibling,n.flush()),t.insert(``,r,n,!1)},[t,r.name]),null});function It(...e){return function(...t){e.forEach(e=>e?.(...t))}}var Lt=(...e)=>e.map(e=>e?.trim?.()).filter(Boolean).join(` `),Rt=/^on[A-Z]/;function zt(...e){let t={};for(let n of e){for(let e in t){if(Rt.test(e)&&typeof t[e]==`function`&&typeof n[e]==`function`){t[e]=It(t[e],n[e]);continue}if(e===`className`||e===`class`){t[e]=Lt(t[e],n[e]);continue}if(e===`style`){t[e]=Object.assign({},t[e]??{},n[e]??{});continue}t[e]=n[e]===void 0?t[e]:n[e]}for(let e in n)t[e]===void 0&&(t[e]=n[e])}return t}var Bt=parseInt(`19.3.0`.split(`.`)[0],10)>=19;function Vt(e,t){if(e!=null){if(typeof e==`function`)return e(t);try{e.current=t}catch{throw Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Ht(...e){let t=e.filter(e=>e!=null);if(Bt){let e=new Map;return n=>(t.forEach(t=>{let r=Vt(t,n);r&&e.set(t,r)}),()=>{t.forEach(t=>{let n=e.get(t);n&&typeof n==`function`?n():Vt(t,null)}),e.clear()})}return e=>{t.forEach(t=>{Vt(t,e)})}}function Ut(e){let t=Object.assign({},e);for(let e in t)t[e]===void 0&&delete t[e];return t}var Wt=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Gt=e=>typeof e==`string`,Kt=e=>typeof e==`function`,qt=(...e)=>{let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(!Gt(r))continue;let i=r.trim();i&&t.push(i)}return t.join(` `)};function Jt(e){return e.default||e}function Yt(e){let t=`19.3.0`;return!Gt(t)||t.startsWith(`18.`)?e?.ref:e?.props?.ref}var Xt=(...e)=>{let t=e.reduce((e,t)=>(t?.forEach(t=>e.add(t)),e),new Set([]));return Array.from(t)};function Zt(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Qt(e={}){let{name:t,strict:n=!0,hookName:r=`useContext`,providerName:i=`Provider`,errorMessage:a,defaultValue:o}=e,s=(0,F.createContext)(o);s.displayName=t;function c(){let e=(0,F.useContext)(s);if(!e&&n){let e=Error(a??Zt(r,i));throw e.name=`ContextError`,Error.captureStackTrace?.(e,c),e}return e}return[s.Provider,c,s]}var[$t,en]=Qt({name:`ChakraContext`,strict:!0,providerName:`<ChakraProvider />`});function tn(e){let{value:t,children:n}=e;return(0,I.jsxs)($t,{value:t,children:[!t._config.disableLayers&&(0,I.jsx)(Ft,{styles:t.layers.atRule}),(0,I.jsx)(Ft,{styles:t._global}),n]})}var nn=(e,t)=>{let n={},r={},i=Object.keys(e);for(let a of i)t(a)?r[a]=e[a]:n[a]=e[a];return[r,n]},rn=(e,t)=>nn(e,Kt(t)?t:e=>t.includes(e)),an=new Set([`htmlWidth`,`htmlHeight`,`htmlSize`,`htmlTranslate`]);function on(e){return typeof e==`string`&&an.has(e)}function sn(e,t,n){let{css:r,isValidProperty:i}=en(),{children:a,...o}=e,s=(0,F.useMemo)(()=>{let[e,r]=rn(o,e=>n(e,t.variantKeys)),[a,s]=rn(r,t.variantKeys),[c,l]=rn(s,i);return{forwardedProps:e,variantProps:a,styleProps:c,elementProps:l}},[t.variantKeys,n,o,i]),{css:c,...l}=s.styleProps,u=(0,F.useMemo)(()=>{let e={...s.variantProps},n=t.variantKeys.includes(`colorPalette`),r=t.variantKeys.includes(`orientation`);return n||(e.colorPalette=o.colorPalette),r||(e.orientation=o.orientation),t(e)},[t,s.variantProps,o.colorPalette,o.orientation]);return{styles:(0,F.useMemo)(()=>r(u,...cn(c),l),[r,u,c,l]),props:{...s.forwardedProps,...s.elementProps,children:a}}}var cn=e=>(Array.isArray(e)?e:[e]).filter(Boolean).flat(),ln=Jt(x),un=e=>e!==`theme`,dn=(e,t,n)=>{let r;if(t){let n=t.shouldForwardProp;r=e.__emotion_forwardProp&&n?t=>e.__emotion_forwardProp(t)&&n(t):n}return typeof r!=`function`&&n&&(r=e.__emotion_forwardProp),r},fn=typeof document<`u`,pn=({cache:e,serialized:t,isStringTag:n})=>{st(e,t,n);let r=wt(()=>ct(e,t,n));if(!fn&&r!==void 0){let n=t.name,i=t.next;for(;i!==void 0;)n=qt(n,i.name),i=i.next;return(0,I.jsx)(`style`,{"data-emotion":qt(e.key,n),dangerouslySetInnerHTML:{__html:r},nonce:e.sheet.nonce})}return null},mn={path:[`d`],text:[`x`,`y`],circle:[`cx`,`cy`,`r`],rect:[`width`,`height`,`x`,`y`,`rx`,`ry`],ellipse:[`cx`,`cy`,`rx`,`ry`],g:[`transform`],stop:[`offset`,`stopOpacity`]},hn=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),gn=((e,t={},n={})=>{if(hn(mn,e)){n.forwardProps||=[];let t=mn[e];n.forwardProps=Xt([...n.forwardProps,...t])}let r=e.__emotion_real===e,i=r&&e.__emotion_base||e,a,o;n!==void 0&&(a=n.label,o=n.target);let s=[],c=Dt((a,c,l)=>{let{cva:u,isValidProperty:d}=en(),f=t.__cva__?t:u(t),p=yn(e.__emotion_cva&&!e.__emotion_cva.__cva__?u(e.__emotion_cva):e.__emotion_cva,f);!n.shouldForwardProp&&n.forwardProps&&(n.shouldForwardProp=(e=>(t,n)=>e.includes(t)?!0:!n?.includes(t)&&!d(t))(n.forwardProps));let m=dn(e,n,r)||((t,n)=>{let r=typeof e==`string`&&e.charCodeAt(0)>96?ln:un,i=!n?.includes(t)&&!d(t);return r(t)&&i}),{props:h,styles:g}=sn(F.useMemo(()=>Object.assign({},n.defaultProps,Ut(a)),[a]),p,m),_=``,v=[g],y=h;if(h.theme==null){y={};for(let e in h)y[e]=h[e];y.theme=F.useContext(Ot)}typeof h.className==`string`?_=ot(c.registered,v,h.className):h.className!=null&&(_=qt(_,h.className));let b=xt(s.concat(v),c.registered,y);b.styles&&(_=qt(_,`${c.key}-${b.name}`)),o!==void 0&&(_=qt(_,o));let x=!m(`as`),S=x&&h.as||i,C={};for(let e in h)if(!(x&&e===`as`)){if(on(e)){let t=e.replace(`html`,``).toLowerCase();C[t]=h[e];continue}m(e)&&(C[e]=h[e])}let w=_.trim();w?C.className=w:Reflect.deleteProperty(C,`className`),C.ref=l;let T=n.forwardAsChild||n.forwardProps?.includes(`asChild`);if(h.asChild&&!T){let e=F.isValidElement(h.children)?F.Children.only(h.children):F.Children.toArray(h.children).find(F.isValidElement);if(!e)throw Error(`[chakra-ui > factory] No valid child found`);S=e.type,C.children=null,Reflect.deleteProperty(C,`asChild`),C=zt(C,e.props),C.ref=Ht(l,Yt(e))}return C.as&&T?(C.as=void 0,(0,I.jsxs)(F.Fragment,{children:[(0,I.jsx)(pn,{cache:c,serialized:b,isStringTag:typeof S==`string`}),(0,I.jsx)(S,{asChild:!0,...C,children:(0,I.jsx)(h.as,{children:C.children})})]})):(0,I.jsxs)(F.Fragment,{children:[(0,I.jsx)(pn,{cache:c,serialized:b,isStringTag:typeof S==`string`}),(0,I.jsx)(S,{...C})]})});return c.displayName=a===void 0?`chakra(${typeof i==`string`?i:i.displayName||i.name||`Component`})`:a,c.__emotion_real=c,c.__emotion_base=i,c.__emotion_forwardProp=n.shouldForwardProp,c.__emotion_cva=t,Object.defineProperty(c,"toString",{value(){return`.${o}`}}),c}).bind(),_n=new Map,vn=new Proxy(gn,{apply(e,t,n){return gn(...n)},get(e,t){return _n.has(t)||_n.set(t,gn(t)),_n.get(t)}}),yn=(e,t)=>e&&!t?e:!e&&t?t:e.merge(t),L=vn(`div`);L.displayName=`Box`;function bn(e){if(typeof e!=`string`)return e.displayName||e.name}function xn(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Sn(e,t){return e+xn(t)}function Cn(e,t){if(t)return e+xn(t)}var wn=Object.freeze({}),Tn=Object.freeze({});function En(e){let{key:t,recipe:n}=e,r=en();return(0,F.useMemo)(()=>n?r.cva(n):t==null?r.cva({}):r.getRecipeFn(t),[t,n,r])}function Dn(e){let{key:t,recipe:n}=e,r=xn(t||n.className||`Component`),[i,a]=Qt({strict:!1,name:`${r}PropsContext`,providerName:`${r}PropsContext`});function o(e){let{unstyled:r,...i}=e,a=En({key:t,recipe:i.recipe||n}),[o,s]=(0,F.useMemo)(()=>a.splitVariantProps(i),[a,i]);return{styles:r?wn:a(o),className:a.className,props:s}}let s=(e,t)=>{let{displayName:n,...i}=t??{},s=vn(e,{},i),c=(0,F.forwardRef)((e,t)=>{let n=a(),r=(0,F.useMemo)(()=>zt(n,e),[e,n]),{styles:i,className:c,props:l}=o(r);return(0,I.jsx)(s,{...l,ref:t,css:[i,r.css],className:qt(c,r.className)})});return c.displayName=n??r??bn(e),c};function c(){return i}return{withContext:s,PropsProvider:i,withPropsProvider:c,usePropsContext:a,useRecipeResult:o}}var On=Object.defineProperty,kn=e=>{throw TypeError(e)},An=(e,t,n)=>t in e?On(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jn=(e,t,n)=>An(e,typeof t==`symbol`?t:t+``,n),Mn=(e,t,n)=>t.has(e)||kn(`Cannot `+n),Nn=(e,t,n)=>(Mn(e,t,`read from private field`),n?n.call(e):t.get(e)),Pn=(e,t,n)=>t.has(e)?kn(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n);function Fn(e){return e==null?[]:Array.isArray(e)?e:[e]}var In=e=>e[0],Ln=e=>e[e.length-1],Rn=(e,t)=>e.indexOf(t)!==-1,zn=(e,...t)=>e.concat(t),Bn=(e,...t)=>e.filter(e=>!t.includes(e)),Vn=(e,t)=>Rn(e,t)?Bn(e,t):zn(e,t);function Hn(e,t,n={}){let{step:r=1,loop:i=!0}=n,a=t+r,o=e.length,s=o-1;return t===-1?r>0?0:s:a<0?i?s:0:a>=o?i?0:t>o?o:t:a}function Un(e,t,n={}){return e[Hn(e,t,n)]}function Wn(e,t,n={}){let{step:r=1,loop:i=!0}=n;return Hn(e,t,{step:-r,loop:i})}function Gn(e,t,n={}){return e[Wn(e,t,n)]}var Kn=e=>e?.constructor.name===`Array`,qn=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Jn(e[n],t[n]))return!1;return!0},Jn=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual==`function`&&typeof t?.isEqual==`function`)return e.isEqual(t);if(typeof e==`function`&&typeof t==`function`)return e.toString()===t.toString();if(Kn(e)&&Kn(t))return qn(Array.from(e),Array.from(t));if(typeof e!=`object`||typeof t!=`object`)return!1;let n=Object.keys(t??Object.create(null)),r=n.length;for(let t=0;t<r;t++)if(!Reflect.has(e,n[t]))return!1;for(let i=0;i<r;i++){let r=n[i];if(!Jn(e[r],t[r]))return!1}return!0},Yn=e=>Array.isArray(e),Xn=e=>typeof e==`object`&&!!e,Zn=e=>Xn(e)&&!Yn(e),Qn=e=>typeof e==`string`,$n=e=>typeof e==`function`,er=e=>e==null,tr=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),nr=e=>Object.prototype.toString.call(e),rr=Function.prototype.toString,ir=rr.call(Object),ar=e=>{if(!Xn(e)||nr(e)!=`[object Object]`||cr(e))return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let n=tr(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&rr.call(n)==ir},or=e=>typeof e==`object`&&!!e&&`$$typeof`in e&&`props`in e,sr=e=>typeof e==`object`&&!!e&&`__v_isVNode`in e,cr=e=>or(e)||sr(e),lr=e=>e(),ur=()=>{},dr=(...e)=>(...t)=>{e.forEach(function(e){e?.(...t)})},{floor:fr,abs:pr,round:mr,min:hr,max:gr,pow:_r,sign:vr}=Math,yr=e=>typeof e==`number`?`${e}px`:e;function br(e){if(!ar(e)||e===void 0)return e;let t=Reflect.ownKeys(e).filter(e=>typeof e==`string`),n={};for(let r of t){let t=e[r];t!==void 0&&(n[r]=br(t))}return n}function xr(e,t){if(!t)return e;let n={...e},r=t;for(let e in r){let t=r[e];t!==void 0&&(n[e]=t)}return n}var Sr=()=>performance.now(),Cr,wr=class{constructor(e){jn(this,`onTick`,e),jn(this,`frameId`,null),jn(this,`pausedAtMs`,null),jn(this,`context`),jn(this,`cancelFrame`,()=>{this.frameId!==null&&(cancelAnimationFrame(this.frameId),this.frameId=null)}),jn(this,`setStartMs`,e=>{this.context.startMs=e}),jn(this,`start`,()=>{if(this.frameId!==null)return;let e=Sr();this.pausedAtMs===null?this.context.startMs=e:(this.context.startMs+=e-this.pausedAtMs,this.pausedAtMs=null),this.frameId=requestAnimationFrame(Nn(this,Cr))}),jn(this,`pause`,()=>{this.frameId!==null&&(this.cancelFrame(),this.pausedAtMs=Sr())}),jn(this,`stop`,()=>{this.frameId!==null&&(this.cancelFrame(),this.pausedAtMs=null)}),Pn(this,Cr,e=>{if(this.context.now=e,this.context.deltaMs=e-this.context.startMs,this.onTick(this.context)===!1){this.stop();return}this.frameId=requestAnimationFrame(Nn(this,Cr))}),this.context={now:0,startMs:Sr(),deltaMs:0}}get elapsedMs(){return this.pausedAtMs===null?Sr()-this.context.startMs:this.pausedAtMs-this.context.startMs}};Cr=new WeakMap;function Tr(e,t){let n=new wr(({deltaMs:n})=>{if(n>=t)return e(),!1});return n.start(),()=>n.stop()}function Er(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function Dr(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function Or(e,t){if(e==null)throw Error(t())}function kr(e,t,n){let r=[];for(let n of t)e[n]??r.push(n);if(r.length>0)throw Error(`[zag-js${n?` > ${n}`:``}] missing required props: ${r.join(`, `)}`)}function Ar(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function jr(e={}){let{name:t,strict:n=!0,hookName:r=`useContext`,providerName:i=`Provider`,errorMessage:a,defaultValue:o}=e,s=(0,F.createContext)(o);s.displayName=t;function c(){let e=(0,F.useContext)(s);if(!e&&n){let e=Error(a??Ar(r,i));throw e.name=`ContextError`,tr(Error,`captureStackTrace`)&&$n(Error.captureStackTrace)&&Error.captureStackTrace(e,c),e}return e}return[s.Provider,c,s]}var[Mr,Nr]=jr({name:`EnvironmentContext`,hookName:`useEnvironmentContext`,providerName:`<EnvironmentProvider />`,strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}});function Pr(...e){return t=>{let n=[],r=!1;for(let i of e)if(typeof i==`function`){let e=i(t);typeof e==`function`?(r=!0,n.push(e)):n.push(()=>i(null))}else i&&(i.current=t,n.push(()=>{i.current=null}));if(r)return()=>{for(let e of n)e()}}}function Fr(...e){return(0,F.useCallback)(Pr(...e),e)}var Ir=(...e)=>e.map(e=>e?.trim?.()).filter(Boolean).join(` `),Lr=(...e)=>Array.from(new Set(Ir(...e).split(/\s+/).filter(Boolean))).join(` `),Rr=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,zr=e=>{let t={},n;for(;n=Rr.exec(e);)t[n[1]]=n[2];return t},Br=(e,t)=>{if(Qn(e)){if(Qn(t))return`${e};${t}`;e=zr(e)}else Qn(t)&&(t=zr(t));return Object.assign({},e??{},t??{})};function R(...e){let t={};for(let n of e){if(!n)continue;for(let e in t){if(e.startsWith(`on`)&&typeof t[e]==`function`&&typeof n[e]==`function`){t[e]=dr(n[e],t[e]);continue}if(e===`className`||e===`class`){t[e]=Ir(t[e],n[e]);continue}if(e===`style`){t[e]=Br(t[e],n[e]);continue}if(e===`data-ownedby`){t[e]=Lr(t[e],n[e]);continue}t[e]=n[e]===void 0?t[e]:n[e]}for(let e in n)t[e]===void 0&&(t[e]=n[e]);let e=Object.getOwnPropertySymbols(n);for(let r of e)t[r]=n[r]}return t}var Vr=`.`,Hr=`#`,Ur=new WeakMap,Wr=new WeakMap;function Gr(e){return e.join(Vr)}function Kr(e){return e.includes(Vr)}function qr(e){return e.startsWith(Hr)}function Jr(e){return e.startsWith(Vr)}function Yr(e){return qr(e)?e.slice(Hr.length):e}function Xr(e,t){return e?`${e}${Vr}${t}`:t}function Zr(e){let t=new Map,n=new Map,r=(e,i)=>{t.set(e,i);let a=i.id;a&&(n.has(a)&&Dr(`[zag-js] Duplicate state id: "${a}"`),n.set(a,e));let o=i.states;if(o){Or(i.initial,()=>`[zag-js] Compound state "${e}" has child states but no "initial" property`),i.initial in o||Dr(`[zag-js] Compound state "${e}" has initial "${String(i.initial)}" which is not a child state`);for(let[t,n]of Object.entries(o)){if(!n)continue;let i=Xr(e,t);r(i,n)}}};for(let[t,n]of Object.entries(e.states))n&&r(t,n);return{index:t,idIndex:n}}function Qr(e){let t=Ur.get(e);if(t)return t;let{index:n,idIndex:r}=Zr(e);return Ur.set(e,n),Wr.set(e,r),n}function $r(e,t){return Qr(e),Wr.get(e)?.get(t)}function ei(e){return e?String(e).split(Vr).filter(Boolean):[]}function ti(e,t){if(!t)return[];let n=Qr(e),r=ei(t),i=[],a=[];for(let e of r){a.push(e);let t=Gr(a),r=n.get(t);if(!r)break;i.push({path:t,state:r})}return i}function ni(e,t){let n=Qr(e),r=ei(t);if(!r.length)return t;let i=[];for(let e of r){i.push(e);let r=Gr(i);if(!n.has(r))return t}let a=Gr(i),o=n.get(a);for(;o?.initial;){let e=`${a}${Vr}${o.initial}`,t=n.get(e);if(!t)break;a=e,o=t}return a}function ri(e,t){return Qr(e).has(t)}function ii(e,t,n){let r=String(t);if(qr(r)){let t=Yr(r),n=$r(e,t);return Or(n,()=>`[zag-js] Unknown state id: "${t}"`),ni(e,n)}if(Jr(r)&&n)return ni(e,Xr(n,r.slice(1)));if(!Kr(r)&&n){let t=ei(n);for(let n=t.length-1;n>=1;n--){let i=Xr(t.slice(0,n).join(Vr),r);if(ri(e,i))return ni(e,i)}if(ri(e,r))return ni(e,r)}return ni(e,r)}function ai(e,t,n){let r=ti(e,t);for(let e=r.length-1;e>=0;e--){let t=r[e]?.state.on?.[n];if(t)return{transitions:t,source:r[e]?.path}}return{transitions:e.on?.[n],source:void 0}}function oi(e,t,n,r){let i=t?ti(e,t):[],a=ti(e,n),o=0;for(;o<i.length&&o<a.length&&i[o]?.path===a[o]?.path;)o+=1;let s=i.slice(o).reverse(),c=a.slice(o),l=i[i.length-1]?.path===a[a.length-1]?.path;return r&&l&&(s=i.slice().reverse(),c=a),{exiting:s,entering:c}}function si(e,t){return e?e===t||e.startsWith(`${t}${Vr}`):!1}function ci(e,t,n){return ti(e,t).some(e=>e.state.tags?.includes(n))}function li(){return{and:(...e)=>function(t){return e.every(e=>t.guard(e))},or:(...e)=>function(t){return e.some(e=>t.guard(e))},not:e=>function(t){return!t.guard(e)}}}function ui(e){return Qr(e),e}function di(){return{guards:li(),createMachine:e=>ui(e),choose:e=>function({choose:t}){return t(e)?.actions}}}var fi=(e=>(e.NotStarted=`Not Started`,e.Started=`Started`,e.Stopped=`Stopped`,e))(fi||{}),pi=`__init__`,mi=Object.defineProperty,hi=(e,t,n)=>t in e?mi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gi=(e,t,n)=>hi(e,typeof t==`symbol`?t:t+``,n),_i=(e,t)=>e.map((n,r)=>e[(Math.max(t,0)+r)%e.length]),vi=(...e)=>t=>e.reduce((e,t)=>t(e),t),yi=()=>void 0,bi=e=>typeof e==`object`&&!!e,z=e=>e?``:void 0,xi=e=>e?`true`:void 0,Si=/\\/g,Ci=/"/g,wi=e=>globalThis.CSS?.escape?.(e)??e.replace(Si,`\\\\`).replace(Ci,`\\"`),Ti=e=>`[data-ownedby~="${wi(String(e))}"]`,Ei=1,Di=9,Oi=11,ki=e=>bi(e)&&e.nodeType===Ei&&typeof e.nodeName==`string`,Ai=e=>bi(e)&&e.nodeType===Ei&&typeof e.nodeName==`string`,ji=e=>bi(e)&&e.nodeType===Di,Mi=e=>bi(e)&&e===e.window,Ni=e=>Ai(e)?e.localName||``:`#document`;function Pi(e){return[`html`,`body`,`#document`].includes(Ni(e))}var Fi=e=>bi(e)&&e.nodeType!==void 0,Ii=e=>Fi(e)&&e.nodeType===Oi&&`host`in e,Li=e=>Ai(e)&&e.localName===`input`,Ri=e=>!!e?.matches(`a[href]`),zi=e=>Ai(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function Bi(e){return e?Yi(e.getRootNode())===e:!1}var Vi=/(textarea|select)/;function Hi(e){if(e==null||!Ai(e))return!1;try{return Li(e)&&e.selectionStart!=null||Vi.test(e.localName)||e.isContentEditable||e.getAttribute(`contenteditable`)===`true`||e.getAttribute(`contenteditable`)===``}catch{return!1}}function Ui(e){let t=e.parentNode;return Ii(t)?t.host:t}function Wi(e){let t=[];for(;e;)t.push(e),e=Ui(e);return t}function Gi(e,t){if(!e||!t||!Ai(e)||!Fi(t))return!1;if(Ai(t)&&e===t||e.contains(t))return!0;let n=t.getRootNode?.();if(n&&Ii(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Ki(e){return ji(e)?e:Mi(e)?e.document:e?.ownerDocument??document}function qi(e){return Ki(e).documentElement}function Ji(e){return Ii(e)?Ji(e.host):ji(e)?e.defaultView??window:Ai(e)?e.ownerDocument?.defaultView??window:window}function Yi(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(!e||e===t)break;t=e}return t}function Xi(e){if(Ni(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ii(e)&&e.host||qi(e);return Ii(t)?t.host:t}function Zi(e){let t;try{if(t=e.getRootNode({composed:!0}),ji(t)||Ii(t))return t}catch{}return e.ownerDocument??document}var Qi=new WeakMap;function $i(e){return Qi.has(e)||Qi.set(e,Ji(e).getComputedStyle(e)),Qi.get(e)}var ea=new Set([`menu`,`listbox`,`dialog`,`grid`,`tree`,`region`,`application`]),ta=e=>ea.has(e),na=e=>e.getAttribute(`aria-controls`)?.split(` `)||[];function ra(e,t){let n=new Set,r=Zi(e),i=e=>{let a=e.querySelectorAll(`[aria-controls]`);for(let e of a){if(e.getAttribute(`aria-expanded`)!==`true`)continue;let a=na(e);for(let e of a){if(!e||n.has(e))continue;n.add(e);let a=r.getElementById(e);if(a){let e=a.getAttribute(`role`),n=a.getAttribute(`aria-modal`)===`true`;if(e&&ta(e)&&!n&&(a===t||a.contains(t)||i(a)))return!0}}}return!1};return i(e)}function ia(e,t){let n=Zi(e),r=new Set,i=e=>{let a=e.querySelectorAll(`[aria-controls]`);for(let e of a){if(e.getAttribute(`aria-expanded`)!==`true`)continue;let a=na(e);for(let e of a){if(!e||r.has(e))continue;r.add(e);let a=n.getElementById(e);if(a){let e=a.getAttribute(`role`),n=a.getAttribute(`aria-modal`)===`true`;e&&ea.has(e)&&!n&&(t(a),i(a))}}}};i(e)}function aa(e){let t=new Set;return ia(e,n=>{e.contains(n)||t.add(n)}),Array.from(t)}function oa(e){let t=e.getAttribute(`role`);return!!(t&&ea.has(t))}function sa(e){return e.hasAttribute(`aria-controls`)&&e.getAttribute(`aria-expanded`)===`true`}function ca(e){return sa(e)?!0:!!e.querySelector?.(`[aria-controls][aria-expanded="true"]`)}function la(e){if(!e.id)return!1;let t=Zi(e),n=CSS.escape(e.id),r=`[aria-controls~="${n}"][aria-expanded="true"], [aria-controls="${n}"][aria-expanded="true"]`;return!!(t.querySelector(r)&&oa(e))}var ua=()=>typeof document<`u`;function da(){return navigator.userAgentData?.platform??navigator.platform}function fa(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}var pa=e=>ua()&&e.test(da()),ma=e=>ua()&&e.test(fa()),ha=e=>ua()&&e.test(navigator.vendor),ga=/^iPhone/i,_a=/^iPad/i,va=/^Mac/i,ya=/apple/i,ba=/Firefox/i,xa=/Android/i,Sa=()=>ua()&&!!navigator.maxTouchPoints,Ca=()=>pa(ga),wa=()=>pa(_a)||Da()&&navigator.maxTouchPoints>1,Ta=()=>Ca()||wa(),Ea=()=>Da()||Ta(),Da=()=>pa(va),Oa=()=>Ea()&&ha(ya),ka=()=>ma(ba),Aa=()=>ma(xa);function ja(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function Ma(e){return ja(e)?.[0]??e.target}function Na(e){let t=e.currentTarget;if(!t||!t.matches(`a[href], button[type='submit'], input[type='submit']`))return!1;let n=e.button===1,r=Fa(e);return n||r}function Pa(e){return Ua(e).isComposing||e.keyCode===229}function Fa(e){return Da()?e.metaKey:e.ctrlKey}function Ia(e){return e.pointerType===``&&e.isTrusted?!0:Aa()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}var La=e=>e.button===0,Ra=e=>e.button===2||Da()&&e.ctrlKey&&e.button===0,za=e=>`touches`in e&&e.touches.length>0,Ba={Up:`ArrowUp`,Down:`ArrowDown`,Esc:`Escape`," ":`Space`,",":`Comma`,Left:`ArrowLeft`,Right:`ArrowRight`},Va={ArrowLeft:`ArrowRight`,ArrowRight:`ArrowLeft`};function Ha(e,t={}){let{dir:n=`ltr`,orientation:r=`horizontal`}=t,i=e.key;return i=Ba[i]??i,n===`rtl`&&r===`horizontal`&&i in Va&&(i=Va[i]),i}function Ua(e){return e.nativeEvent??e}function Wa(e,t=`client`){let n=za(e)?e.touches[0]||e.changedTouches[0]:e;return{x:n[`${t}X`],y:n[`${t}Y`]}}var Ga=(e,t,n,r)=>{let i=typeof e==`function`?e():e;return i?.addEventListener(t,n,r),()=>{i?.removeEventListener(t,n,r)}};function Ka(e,t){let{type:n=`HTMLInputElement`,property:r=`value`}=t,i=Ji(e)[n].prototype;return Object.getOwnPropertyDescriptor(i,r)??{}}function qa(e,t){e&&(Ka(e,{type:`HTMLInputElement`,property:`checked`}).set?.call(e,t),t?e.setAttribute(`checked`,``):e.removeAttribute(`checked`))}function Ja(e,t){let{checked:n,bubbles:r=!0}=t;if(!e)return;let i=Ji(e);if(!(e instanceof i.HTMLInputElement))return;qa(e,n);let a=new i.Event(`click`,{bubbles:r});e.dispatchEvent(to(a))}function Ya(e){return e.matches(`textarea, input, select, button`)}function Xa(e,t){if(!e)return;let n=Ya(e)?e.form:e.closest(`form`),r=e=>{e.defaultPrevented||t()};return n?.addEventListener(`reset`,r,{passive:!0}),()=>n?.removeEventListener(`reset`,r)}function Za(e,t){let n=e?.closest(`fieldset`);if(!n)return;t(n.disabled);let r=new(Ji(n)).MutationObserver(()=>t(n.disabled));return r.observe(n,{attributes:!0,attributeFilter:[`disabled`]}),()=>r.disconnect()}function Qa(e,t){if(!e)return;let{onFieldsetDisabledChange:n,onFormReset:r}=t,i=[Xa(e,r),Za(e,n)];return()=>i.forEach(e=>e?.())}var $a=Symbol.for(`zag.changeEvent`);function eo(e){return Object.prototype.hasOwnProperty.call(e,$a)}function to(e){return eo(e)||Object.defineProperty(e,$a,{value:!0}),e}var no=e=>Ai(e)&&e.tagName===`IFRAME`,ro=/^(audio|video|details)$/;function io(e){let t=e.getAttribute(`tabindex`);return t?parseInt(t,10):NaN}var ao=e=>!Number.isNaN(io(e)),oo=e=>io(e)<0;function so(e){return Li(e)&&e.type===`radio`}function co(e){if(!so(e)||!e.name||e.checked)return!0;let t=`input[type="radio"][name="${CSS.escape(e.name)}"]`,n=e.form??e.ownerDocument,r=Array.from(n.querySelectorAll(t)).filter(t=>t.form===e.form&&mo(t)),i=r.find(e=>e.checked);return i?i===e:r[0]===e}function lo(e,t){if(!t)return null;if(t===!0)return e.shadowRoot||null;let n=t(e);return(n===!0?e.shadowRoot:n)||null}function uo(e,t,n){let r=[...e],i=[...e],a=new Set,o=new Map;e.forEach((e,t)=>o.set(e,t));let s=0;for(;s<i.length;){let e=i[s++];if(!e||a.has(e))continue;a.add(e);let c=lo(e,t);if(c){let t=Array.from(c.querySelectorAll(fo)).filter(n),a=o.get(e);if(a!==void 0){let e=a+1;r.splice(e,0,...t),t.forEach((t,n)=>{o.set(t,e+n)});for(let n=e+t.length;n<r.length;n++)o.set(r[n],n)}else{let e=r.length;r.push(...t),t.forEach((t,n)=>{o.set(t,e+n)})}i.push(...t)}}return r}var fo=`input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type`,po=(e,t={})=>{if(!e)return[];let{includeContainer:n=!1,getShadowRoot:r}=t,i=Array.from(e.querySelectorAll(fo));(n==1||n==`if-empty`&&i.length===0)&&Ai(e)&&mo(e)&&i.unshift(e);let a=[];for(let e of i)if(mo(e)){if(no(e)&&e.contentDocument){let t=e.contentDocument.body;a.push(...po(t,{getShadowRoot:r}));continue}a.push(e)}return r?uo(a,r,mo):a};function mo(e){return!Ai(e)||e.closest(`[inert]`)?!1:e.matches(fo)&&zi(e)}function ho(e,t={}){if(!e)return[];let{includeContainer:n,getShadowRoot:r}=t,i=Array.from(e.querySelectorAll(fo));n&&go(e)&&i.unshift(e);let a=[];for(let e of i)if(go(e)){if(no(e)&&e.contentDocument){let t=e.contentDocument.body;a.push(...ho(t,{getShadowRoot:r}));continue}a.push(e)}if(r){let e=uo(a,r,go);return!e.length&&n?i:e}return!a.length&&n?i:a}function go(e){return Ai(e)&&e.tabIndex>0?!0:!mo(e)||oo(e)?!1:co(e)}function _o(e,t={}){let n=ho(e,t);return[n[0]||null,n[n.length-1]||null]}function vo(e){return e.tabIndex<0&&(ro.test(e.localName)||Hi(e))&&!ao(e)?0:e.tabIndex}function yo(e){let{root:t,getInitialEl:n,filter:r,enabled:i=!0}=e;if(!i)return;let a=typeof n==`function`?n():n;return a||=t?.querySelector(`[data-autofocus],[autofocus]`),a||=ho(t).filter(e=>!r||r(e)).find(e=>!e.hasAttribute(`data-no-autofocus`)),a||t||void 0}function bo(e){let t=e.currentTarget;if(!t)return!1;let[n,r]=_o(t);return!(Bi(n)&&e.shiftKey||Bi(r)&&!e.shiftKey||!n&&!r)}var xo=class e{constructor(){gi(this,`id`,null),gi(this,`fn_cleanup`),gi(this,`cleanup`,()=>{this.cancel()})}static create(){return new e}request(e){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=e?.()})}cancel(){this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),this.fn_cleanup?.(),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function So(e){let t=xo.create();return t.request(e),t.cleanup}function Co(e){let t=new Set;function n(e){let n=globalThis.requestAnimationFrame(e);t.add(()=>globalThis.cancelAnimationFrame(n))}return n(()=>n(e)),function(){t.forEach(e=>e())}}function wo(e,t,n){let r=So(()=>{e.removeEventListener(t,i,!0),n()}),i=()=>{r(),n()};return e.addEventListener(t,i,{once:!0,capture:!0}),r}function To(e,t){if(!e)return;let{attributes:n,callback:r}=t,i=new(e.ownerDocument.defaultView||window).MutationObserver(e=>{for(let t of e)t.type===`attributes`&&t.attributeName&&n.includes(t.attributeName)&&r(t)});return i.observe(e,{attributes:!0,attributeFilter:n}),()=>i.disconnect()}function Eo(e,t){let{defer:n}=t,r=n?So:e=>e(),i=[];return i.push(r(()=>{let n=typeof e==`function`?e():e;i.push(To(n,t))})),()=>{i.forEach(e=>e?.())}}function Do(e,t){let{callback:n}=t;if(!e)return;let r=new(e.ownerDocument.defaultView||window).MutationObserver(n);return r.observe(e,{childList:!0,subtree:!0}),()=>r.disconnect()}function Oo(e,t){let{defer:n}=t,r=n?So:e=>e(),i=[];return i.push(r(()=>{let n=typeof e==`function`?e():e;i.push(Do(n,t))})),()=>{i.forEach(e=>e?.())}}function ko(e){let t=()=>{let t=Ji(e);e.dispatchEvent(new t.MouseEvent(`click`))};ka()?wo(e,`keyup`,t):queueMicrotask(t)}function Ao(e){let t=Xi(e);return Pi(t)?Ki(t).body:Ai(t)&&No(t)?t:Ao(t)}var jo=/auto|scroll|overlay|hidden|clip/,Mo=new Set([`inline`,`contents`]);function No(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Ji(e).getComputedStyle(e);return jo.test(t+r+n)&&!Mo.has(i)}var Po=`default`,Fo=``,Io=new WeakMap;function Lo(e={}){let{target:t,doc:n}=e,r=n??document,i=r.documentElement;return Ta()?(Po==="default"&&(Fo=i.style.webkitUserSelect,i.style.webkitUserSelect=`none`),Po=`disabled`):t&&(Io.set(t,t.style.userSelect),t.style.userSelect=`none`),()=>Ro({target:t,doc:r})}function Ro(e={}){let{target:t,doc:n}=e,r=(n??document).documentElement;if(Ta()){if(Po!==`disabled`)return;Po=`restoring`,setTimeout(()=>{Co(()=>{Po===`restoring`&&(r.style.webkitUserSelect===`none`&&(r.style.webkitUserSelect=Fo||``),Fo=``,Po=`default`)})},300)}else if(t&&Io.has(t)){let e=Io.get(t);t.style.userSelect===`none`&&(t.style.userSelect=e??``),t.getAttribute(`style`)===``&&t.removeAttribute(`style`),Io.delete(t)}}function zo(e={}){let{defer:t,target:n,...r}=e,i=t?So:e=>e(),a=[];return a.push(i(()=>{let e=typeof n==`function`?n():n;a.push(Lo({...r,target:e}))})),()=>{a.forEach(e=>e?.())}}function Bo(e,t){let{onPointerMove:n,onPointerUp:r}=t,i=e=>{let t=Wa(e);if(!(Math.sqrt(t.x**2+t.y**2)<(e.pointerType===`touch`?10:5))){if(e.pointerType===`mouse`&&e.buttons===0){a(e);return}n({point:t,event:e})}},a=e=>{let t=Wa(e);r({point:t,event:e})},o=[Ga(e,`pointermove`,i,!1),Ga(e,`pointerup`,a,!1),Ga(e,`pointercancel`,a,!1),Ga(e,`contextmenu`,a,!1),zo({doc:e})];return()=>{o.forEach(e=>e())}}function Vo(e){let{pointerNode:t,keyboardNode:n=t,onPress:r,onPressStart:i,onPressEnd:a,isValidKey:o=e=>e.key===`Enter`}=e;if(!t)return yi;let s=Ji(t),c=yi,l=yi,u=yi,d=e=>({point:Wa(e),event:e});function f(e){i?.(d(e))}function p(e){a?.(d(e))}c=vi(Ga(t,`pointerdown`,e=>{l(),l=vi(Ga(s,`pointerup`,e=>{let n=Ma(e);Gi(t,n)?r?.(d(e)):a?.(d(e))},{passive:!r,once:!0}),Ga(s,`pointercancel`,p,{passive:!a,once:!0})),Bi(n)&&e.pointerType===`mouse`&&e.preventDefault(),f(e)},{passive:!i}),Ga(n,`focus`,m));function m(){u=vi(Ga(n,`keydown`,e=>{o(e)&&(l(),l=Ga(n,`keyup`,e=>{if(!o(e))return;let t=new s.PointerEvent(`pointerup`),n=d(t);r?.(n),a?.(n)}),f(new s.PointerEvent(`pointerdown`)))}),Ga(n,`blur`,()=>{p(new s.PointerEvent(`pointercancel`))}))}return()=>{c(),l(),u()}}function Ho(e,t){return Array.from(e?.querySelectorAll(t)??[])}var Uo=e=>e.id;function Wo(e,t,n=Uo){return e.find(e=>n(e)===t)}function Go(e,t,n=Uo){let r=Wo(e,t,n);return r?e.indexOf(r):-1}function Ko(e,t,n=!0){let r=Go(e,t);return r=n?(r+1)%e.length:Math.min(r+1,e.length-1),e[r]}function qo(e,t,n=!0){let r=Go(e,t);return r===-1?n?e[e.length-1]:null:(r=n?(r-1+e.length)%e.length:Math.max(0,r-1),e[r])}function Jo(e){let t=new WeakMap,n,r=new WeakMap,i=e=>n||(n=new e.ResizeObserver(e=>{for(let n of e){r.set(n.target,n);let e=t.get(n.target);if(e)for(let t of e)t(n)}}),n);return{observe:(n,r)=>{let a=t.get(n)||new Set;a.add(r),t.set(n,a);let o=Ji(n);return i(o).observe(n,e),()=>{let e=t.get(n);e&&(e.delete(r),e.size===0&&(t.delete(n),i(o).unobserve(n)))}},unobserve:e=>{t.delete(e),n?.unobserve(e)}}}var Yo=Jo({box:`border-box`});function Xo(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function Zo(e,t){let{rootEl:n,...r}=t||{};e&&n&&No(n)&&Xo(n)&&e.scrollIntoView(r)}var Qo=e=>e.split(``).map(e=>{let t=e.charCodeAt(0);return t>0&&t<128?e:t>=128&&t<=255?`/x${t.toString(16)}`.replace(`/`,`\\`):``}).join(``).trim(),$o=e=>Qo(e.dataset?.valuetext??e.textContent??``),es=(e,t)=>e.trim().toLowerCase().startsWith(t.toLowerCase());function ts(e,t,n,r=Uo){let i=n?Go(e,n,r):-1,a=n?_i(e,i):e;return t.length===1&&(a=a.filter(e=>r(e)!==n)),a.find(e=>es($o(e),t))}function ns(e,t){if(!e)return yi;let n=Object.keys(t).reduce((t,n)=>(t[n]=e.style.getPropertyValue(n),t),{});return is(n,t)?yi:(Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute(`style`)})}function rs(e,t,n){if(!e)return yi;let r=e.style.getPropertyValue(t);return r===n?yi:(e.style.setProperty(t,n),()=>{e.style.setProperty(t,r),e.style.length===0&&e.removeAttribute(`style`)})}function is(e,t){return Object.keys(e).every(n=>e[n]===t[n])}function as(e,t){let{state:n,activeId:r,key:i,timeout:a=350,itemToId:o}=t,s=n.keysSoFar+i,c=s.length>1&&Array.from(s).every(e=>e===s[0])?s[0]:s,l=ts(e.slice(),c,r,o);function u(){clearTimeout(n.timer),n.timer=-1}function d(e){n.keysSoFar=e,u(),e!==``&&(n.timer=+setTimeout(()=>{d(``),u()},a))}return d(s),l}var os=Object.assign(as,{defaultOptions:{keysSoFar:``,timer:-1},isValidEvent:ss});function ss(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var cs={border:`0`,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0`,position:`absolute`,width:`1px`,whiteSpace:`nowrap`,wordWrap:`normal`};function ls(e,t,n){let{signal:r}=t;return[new Promise((t,i)=>{let a=setTimeout(()=>{i(Error(`Timeout of ${n}ms exceeded`))},n);r.addEventListener(`abort`,()=>{clearTimeout(a),i(new DOMException(`Promise aborted`,`AbortError`))}),e.then(e=>{r.aborted||(clearTimeout(a),t(e))}).catch(e=>{r.aborted||(clearTimeout(a),i(e))})}),()=>t.abort()]}function us(e,t){let{timeout:n,rootNode:r}=t,i=Ji(r),a=Ki(r),o=new i.AbortController;return ls(new Promise(t=>{let n=e();if(n){t(n);return}let r=new i.MutationObserver(()=>{let n=e();n&&n.isConnected&&(r.disconnect(),t(n))});r.observe(a.body,{childList:!0,subtree:!0})}),o,n)}function ds(e,t,n={}){let{defer:r,onMissing:i}=n,a=()=>typeof e==`function`?e():e,o=[],s=e=>{if(!e)return i?.();o.push(t(e))},c=a();if(!r||c)s(c);else{let e=!1;o.push(()=>{e=!0}),queueMicrotask(()=>{if(e)return;let t=a();if(t){s(t);return}o.push(So(()=>{e||s(a())}))})}return()=>{o.forEach(e=>e?.())}}function fs(e){let t=()=>e.getRootNode?.()??document,n=()=>Ki(t()),r=()=>n().defaultView??window,i=()=>Yi(t()),a=e=>t().getElementById(e);return{...e,getRootNode:t,getDoc:n,getWin:r,getActiveElement:i,isActiveElement:Bi,getById:a}}function ps(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ms=Symbol.for(`react.lazy`);function hs(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===ms}function gs(e){if((0,F.isValidElement)(e))return e;if(hs(e))return F.Children.toArray(e).find(F.isValidElement)}var _s=e=>{let t=(0,F.memo)((0,F.forwardRef)((t,n)=>{let{asChild:r,children:i,...a}=t,o=r?gs(i):void 0,s=o?ps(o):void 0,c=Fr(n,s);return r?o?(0,F.cloneElement)(o,{...R(a,o.props),ref:n?c:s}):null:(0,F.createElement)(e,{...a,ref:n},i)}));return t.displayName=e.displayName||e.name,t},B=(()=>{let e=new Map;return new Proxy(_s,{apply(e,t,n){return _s(n[0])},get(t,n){let r=n;return e.has(r)||e.set(r,_s(r)),e.get(r)}})})(),[vs,ys]=jr({name:`LocaleContext`,hookName:`useLocaleContext`,providerName:`<LocaleProvider />`,strict:!1,defaultValue:{dir:`ltr`,locale:`en-US`}}),bs=Object.defineProperty,xs=(e,t)=>{let n={};for(var r in e)bs(n,r,{get:e[r],enumerable:!0});return t||bs(n,Symbol.toStringTag,{value:`Module`}),n},Ss=()=>(e,t)=>t.reduce((e,t)=>{let[n,r]=e,i=t;return r[i]!==void 0&&(n[i]=r[i]),delete r[i],[n,r]},[{},{...e}]),Cs=e=>Ss()(e,[`hideMode`,`immediate`,`lazyMount`,`onEnterComplete`,`onExitComplete`,`present`,`skipAnimationOnMount`,`unmountOnExit`]),ws=(e=>Reflect.get(e,`Activity`))(F),Ts=ws!==void 0;function Es(e,t={}){let{sync:n=!1}=t,r=Ds(e);return(0,F.useCallback)((...e)=>n?queueMicrotask(()=>r.current?.(...e)):r.current?.(...e),[n,r])}function Ds(e){let t=(0,F.useRef)(e);return t.current=e,t}var Os=globalThis.document===void 0?F.useEffect:F.useLayoutEffect;function ks(e){let t=e().value??e().defaultValue,n=e().isEqual??Object.is,[r]=(0,F.useState)(t),[i,a]=(0,F.useState)(r),o=e().value!==void 0,s=(0,F.useRef)(i);s.current=o?e().value:i;let c=(0,F.useRef)(s.current);Os(()=>{c.current=s.current},[i,e().value]);let l=t=>{let r=c.current,i=$n(t)?t(r):t;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:i,prev:r}),o||a(i),n(i,r)||e().onChange?.(i,r)};function u(){return o?e().value:i}return{initial:r,ref:s,get:u,set(t){(e().sync?et.flushSync:lr)(()=>l(t))},invoke(t,n){e().onChange?.(t,n)},hash(t){return e().hash?.(t)??String(t)}}}ks.cleanup=e=>{(0,F.useEffect)(()=>e,[])},ks.ref=e=>{let t=(0,F.useRef)(e);return{get:()=>t.current,set:e=>{t.current=e}}};function As(e){let t=(0,F.useRef)(void 0);return t.current===void 0&&(t.current=e()),t.current}function js(e){let t=(0,F.useRef)(e);return t.current=e,(0,F.useMemo)(()=>((...e)=>t.current(...e)),[])}function Ms(e){let t=(0,F.useRef)(e);return As(()=>({get(e){return t.current[e]},set(e,n){t.current[e]=n}}))}var Ns=(e,t)=>{let n=(0,F.useRef)(!1),r=(0,F.useRef)(!1);(0,F.useEffect)(()=>{if(n.current&&r.current)return t();r.current=!0},[...(e??[]).map(e=>typeof e==`function`?e():e)]),(0,F.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[])};function Ps(e,t={}){let n=(0,F.useMemo)(()=>{let{id:e,ids:n,getRootNode:r}=t;return fs({id:e,ids:n,getRootNode:r})},[t]),r=(...t)=>{e.debug&&console.log(...t)},i=Is(e.props?.({props:br(t),scope:n})??t),a=e.context?.({prop:i,bindable:ks,scope:n,flush:Ls,getContext(){return s},getComputed(){return g},getRefs(){return m},getEvent(){return f()}}),o=Fs(a),s=As(()=>({get(e){return o.current?.[e].ref.current},set(e,t){o.current?.[e].set(t)},initial(e){return o.current?.[e].initial},hash(e){let t=o.current?.[e].get();return o.current?.[e].hash(t)}})),c=(0,F.useRef)(new Map),l=(0,F.useRef)(null),u=(0,F.useRef)(null),d=(0,F.useRef)({type:``}),f=()=>({...d.current,current(){return d.current},previous(){return u.current}}),p=()=>({...S,matches(...e){return e.some(e=>si(S.ref.current,e))},hasTag(t){return ci(e,S.ref.current,t)}}),m=Ms(e.refs?.({prop:i,context:s})??{}),h=js(t=>{queueMicrotask(()=>{if(w.current!==fi.Started)return;u.current=d.current,d.current=t;let n=E(),{transitions:i,source:a}=ai(e,n,t.type),o=x(i);if(!o)return;l.current=o;let s=ii(e,o.target??n,a);r(`transition`,t.type,o.target||n,`(${o.actions})`),s===n?o.reenter?S.invoke(n,n):v(o.actions??[]):(0,et.flushSync)(()=>S.set(s))})}),g=js(t=>{Or(e.computed,()=>`[zag-js] No computed object found on machine`);let r=e.computed[t];return r({context:s,event:f(),prop:i,refs:m,scope:n,computed:g})}),_=()=>({state:p(),context:s,event:f(),prop:i,send:h,action:v,guard:y,track:Ns,refs:m,computed:g,flush:Ls,scope:n,choose:x}),v=t=>{let n=$n(t)?t(_()):t;if(!n)return;let r=n.map(t=>{let n=e.implementations?.actions?.[t];return n||Er(`[zag-js] No implementation found for action "${JSON.stringify(t)}"`),n});for(let e of r)e?.(_())},y=t=>{if($n(t))return t(_());let n=e.implementations?.guards?.[t];return n||Er(`[zag-js] No implementation found for guard "${JSON.stringify(t)}"`),n?.(_())},b=t=>{let n=$n(t)?t(_()):t;if(!n)return;let r=n.map(t=>{let n=e.implementations?.effects?.[t];return n||Er(`[zag-js] No implementation found for effect "${JSON.stringify(t)}"`),n}),i=[];for(let e of r){let t=e?.(_());t&&i.push(t)}return()=>i.forEach(e=>e?.())},x=e=>Fn(e).find(e=>{let t=!e.guard;return Qn(e.guard)?t=!!y(e.guard):$n(e.guard)&&(t=e.guard(_())),t}),S=ks(()=>({defaultValue:ii(e,e.initialState({prop:i})),onChange(t,n){let{exiting:r,entering:i}=oi(e,n,t,l.current?.reenter);if(r.forEach(e=>{c.current.get(e.path)?.(),c.current.delete(e.path)}),r.forEach(e=>{v(e.state?.exit)}),v(l.current?.actions),i.forEach(e=>{let t=b(e.state?.effects);if(t){let n=c.current.get(e.path);c.current.set(e.path,n?dr(n,t):t)}}),n===`__init__`){v(e.entry);let t=b(e.effects);if(t){let e=c.current.get(pi);c.current.set(pi,e?dr(e,t):t)}}i.forEach(e=>{v(e.state?.entry)})}})),C=(0,F.useRef)(void 0),w=(0,F.useRef)(fi.NotStarted),T=js(()=>w.current);Os(()=>{queueMicrotask(()=>{let e=w.current===fi.Started;w.current=fi.Started,r(e?`rehydrating...`:`initializing...`);let t=C.current??S.initial;S.invoke(t,e?S.get():pi)});let t=c.current;return()=>{let n=E();r(`unmounting...`),C.current=n,w.current=fi.Stopped,t.forEach(e=>e?.()),c.current=new Map,l.current=null,queueMicrotask(()=>{v(e.exit),w.current=fi.Stopped})}},[]);let E=()=>`ref`in S?S.ref.current:S.get();return e.watch?.(_()),{state:p(),send:h,context:s,prop:i,scope:n,refs:m,computed:g,event:f(),getStatus:T}}function Fs(e){let t=(0,F.useRef)(e);return t.current=e,t}function Is(e){let t=Fs(e);return js(function(e){return t.current[e]})}function Ls(e){queueMicrotask(()=>{(0,et.flushSync)(()=>e())})}function Rs(e){return new Proxy({},{get(t,n){return n===`style`?t=>e({style:t}).style:e}})}var zs=Rs(e=>e);function Bs(e,t){let{state:n,send:r,context:i}=e,a=n.matches(`mounted`,`unmountSuspended`);return{skip:!i.get(`initial`),present:a,setNode(e){e&&r({type:`NODE.SET`,node:e})},unmount(){r({type:`UNMOUNT`})}}}var Vs=ui({props({props:e}){return{...e,present:!!e.present}},initialState({prop:e}){return e(`present`)?`mounted`:`unmounted`},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:[`cleanupNode`],watch({track:e,prop:t,send:n}){e([()=>t(`present`)],()=>{n({type:`PRESENCE.CHANGED`})})},on:{"NODE.SET":{actions:[`setupNode`]},"PRESENCE.CHANGED":{actions:[`setInitial`,`syncPresence`]}},states:{mounted:{effects:[`trackEnterAnimation`],on:{UNMOUNT:{target:`unmounted`,actions:[`clearPrevAnimationName`,`invokeOnExitComplete`]},"UNMOUNT.SUSPEND":{target:`unmountSuspended`}}},unmountSuspended:{effects:[`trackExitAnimation`],on:{MOUNT:{target:`mounted`,actions:[`setPrevAnimationName`]},UNMOUNT:{target:`unmounted`,actions:[`clearPrevAnimationName`,`invokeOnExitComplete`]}}},unmounted:{on:{MOUNT:{target:`mounted`,actions:[`setPrevAnimationName`]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get(`initial`)||queueMicrotask(()=>{e.set(`initial`,!0)})},invokeOnExitComplete:({prop:e,refs:t})=>{e(`onExitComplete`)?.();let n=t.get(`node`);if(!n)return;let r=new(Ji(n)).CustomEvent(`exitcomplete`,{bubbles:!1});n.dispatchEvent(r)},setupNode:({refs:e,event:t})=>{e.get(`node`)!==t.node&&(e.set(`node`,t.node),e.set(`styles`,$i(t.node)))},cleanupNode:({refs:e})=>{e.set(`node`,null),e.set(`styles`,null)},syncPresence:({context:e,refs:t,send:n,prop:r})=>{let i=r(`present`);if(i)return n({type:`MOUNT`,src:`presence.changed`});let a=t.get(`node`);if(!i&&a?.ownerDocument.visibilityState===`hidden`)return n({type:`UNMOUNT`,src:`visibilitychange`});So(()=>{if(r(`present`))return;let i=Hs(t.get(`styles`));e.set(`unmountAnimationName`,i),i===`none`||i===e.get(`prevAnimationName`)||t.get(`styles`)?.display===`none`||t.get(`styles`)?.animationDuration===`0s`?n({type:`UNMOUNT`,src:`presence.changed`}):n({type:`UNMOUNT.SUSPEND`})})},setPrevAnimationName:({context:e,refs:t})=>{So(()=>{e.set(`prevAnimationName`,Hs(t.get(`styles`)))})},clearPrevAnimationName:({context:e})=>{e.set(`prevAnimationName`,null)}},effects:{trackEnterAnimation:({context:e,refs:t,prop:n})=>{if(!n(`onEnterComplete`)||!e.get(`initial`))return;let r,i=()=>{r=So(()=>{let e=t.get(`node`);if(!e||!e.isConnected){i();return}let r=$i(e);if(Hs(r)===`none`||r.display===`none`||r.animationDuration===`0s`){n(`onEnterComplete`)?.();return}let a=t=>{Ma(t)===e&&n(`present`)&&(e.removeEventListener(`animationend`,a),n(`onEnterComplete`)?.())};return e.addEventListener(`animationend`,a),()=>{e.removeEventListener(`animationend`,a)}})};return i(),()=>r?.()},trackExitAnimation:({context:e,refs:t,send:n,prop:r})=>{let i=t.get(`node`);if(!i)return;let a=n=>{(n.composedPath?.()?.[0]??n.target)===i&&e.set(`prevAnimationName`,Hs(t.get(`styles`)))},o=a=>{let o=Hs(t.get(`styles`));Ma(a)===i&&o===e.get(`unmountAnimationName`)&&!r(`present`)&&n({type:`UNMOUNT`,src:`animationend`})},s=e=>{Ma(e)===i&&!r(`present`)&&n({type:`UNMOUNT`,src:`animationcancel`})};i.addEventListener(`animationstart`,a),i.addEventListener(`animationcancel`,s),i.addEventListener(`animationend`,o);let c=ns(i,{animationFillMode:`forwards`});return()=>{i.removeEventListener(`animationstart`,a),i.removeEventListener(`animationcancel`,s),i.removeEventListener(`animationend`,o),Co(()=>c())}}}}});function Hs(e){return e?.animationName||`none`}var Us=(e={})=>{let{lazyMount:t,unmountOnExit:n,hideMode:r=`display-none`,present:i,skipAnimationOnMount:a=!1,...o}=e,s=(0,F.useRef)(!1),c=Bs(Ps(Vs,{...o,present:i,onEnterComplete:Es(e.onEnterComplete),onExitComplete:Es(e.onExitComplete)}),zs);c.present&&(s.current=!0);let l=!c.present&&!s.current&&t||n&&!c.present&&s.current,u=r===`activity`&&Ts?`activity`:`display-none`;return{ref:c.setNode,getPresenceProps:()=>({"data-state":c.skip&&a?void 0:i?`open`:`closed`,hidden:u!==`activity`&&!c.present}),present:c.present,unmounted:l,hideMode:u}},Ws=e=>{let{presence:t,children:n}=e;return t.unmounted?null:t.hideMode===`activity`&&ws?(0,I.jsx)(ws,{mode:t.present?`visible`:`hidden`,children:n}):n},[Gs,Ks]=jr({name:`PresenceContext`,hookName:`usePresenceContext`,providerName:`<PresenceProvider />`}),qs=vn(`span`);qs.displayName=`Span`;var V=(e,t=[])=>({parts:(...n)=>{if(Ys(t))return V(e,n);throw Error(`createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?`)},extendWith:(...n)=>V(e,[...t,...n]),omit:(...n)=>V(e,t.filter(e=>!n.includes(e))),rename:e=>V(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${Js(e)}"][data-part="${Js(n)}"]`,`& [data-scope="${Js(e)}"][data-part="${Js(n)}"]`].join(`, `),attrs:{"data-scope":Js(e),"data-part":Js(n)}}}),{})}),Js=e=>e.replace(/([A-Z])([A-Z])/g,`$1-$2`).replace(/([a-z])([A-Z])/g,`$1-$2`).replace(/[\s_]+/g,`-`).toLowerCase(),Ys=e=>e.length===0,Xs=V(`tabs`).parts(`root`,`list`,`trigger`,`content`,`indicator`).build(),Zs=e=>e.ids?.root??`tabs:${e.id}`,Qs=e=>e.ids?.list??`tabs:${e.id}:list`,$s=(e,t)=>e.ids?.content?.(t)??`tabs:${e.id}:content-${t}`,ec=(e,t)=>e.ids?.trigger?.(t)??`tabs:${e.id}:trigger-${t}`,tc=e=>e.ids?.indicator??`tabs:${e.id}:indicator`,nc=e=>e.getById(Qs(e)),rc=(e,t)=>e.getById($s(e,t)),ic=(e,t)=>t==null?null:e.getById(ec(e,t)),ac=e=>e.getById(tc(e)),oc=e=>{let t=`[role=tab]${Ti(Qs(e))}:not([disabled])`;return Ho(nc(e),t)},sc=e=>In(oc(e)),cc=e=>Ln(oc(e)),lc=(e,t)=>Ko(oc(e),ec(e,t.value),t.loopFocus),uc=(e,t)=>qo(oc(e),ec(e,t.value),t.loopFocus),dc=e=>({x:e?.offsetLeft??0,y:e?.offsetTop??0,width:e?.offsetWidth??0,height:e?.offsetHeight??0}),fc=(e,t)=>dc(Wo(oc(e),ec(e,t)));function pc(e,t){let{state:n,send:r,context:i,prop:a,scope:o}=e,s=a(`translations`),c=n.matches(`focused`),l=a(`orientation`)===`vertical`,u=a(`orientation`)===`horizontal`,d=a(`composite`);function f(e){return{selected:i.get(`value`)===e.value,focused:i.get(`focusedValue`)===e.value,disabled:!!e.disabled}}return{value:i.get(`value`),focusedValue:i.get(`focusedValue`),setValue(e){r({type:`SET_VALUE`,value:e})},clearValue(){r({type:`CLEAR_VALUE`})},setIndicatorRect(e){let t=ec(o,e);r({type:`SET_INDICATOR_RECT`,id:t})},syncTabIndex(){r({type:`SYNC_TAB_INDEX`})},selectNext(e){r({type:`TAB_FOCUS`,value:e,src:`selectNext`}),r({type:`ARROW_NEXT`,src:`selectNext`})},selectPrev(e){r({type:`TAB_FOCUS`,value:e,src:`selectPrev`}),r({type:`ARROW_PREV`,src:`selectPrev`})},focus(){let e=i.get(`value`);e&&ic(o,e)?.focus()},getRootProps(){return t.element({...Xs.root.attrs,id:Zs(o),"data-orientation":a(`orientation`),"data-focus":z(c),dir:a(`dir`)})},getListProps(){return t.element({...Xs.list.attrs,id:Qs(o),role:`tablist`,dir:a(`dir`),"data-focus":z(c),"aria-orientation":a(`orientation`),"data-orientation":a(`orientation`),"aria-label":s?.listLabel,onKeyDown(e){if(e.defaultPrevented||Pa(e)||!Gi(e.currentTarget,Ma(e)))return;let t={ArrowDown(){u||r({type:`ARROW_NEXT`,key:`ArrowDown`})},ArrowUp(){u||r({type:`ARROW_PREV`,key:`ArrowUp`})},ArrowLeft(){l||r({type:`ARROW_PREV`,key:`ArrowLeft`})},ArrowRight(){l||r({type:`ARROW_NEXT`,key:`ArrowRight`})},Home(){r({type:`HOME`})},End(){r({type:`END`})}}[Ha(e,{dir:a(`dir`),orientation:a(`orientation`)})];if(t){e.preventDefault(),t(e);return}}})},getTriggerState:f,getTriggerProps(e){let{value:n,disabled:s}=e,c=f(e);return t.button({...Xs.trigger.attrs,role:`tab`,type:`button`,disabled:s,dir:a(`dir`),"data-orientation":a(`orientation`),"data-disabled":z(s),"aria-disabled":s,"data-value":n,"aria-selected":c.selected,"data-selected":z(c.selected),"data-focus":z(c.focused),"aria-controls":c.selected?$s(o,n):void 0,"data-ownedby":Qs(o),"data-ssr":z(i.get(`ssr`)),id:ec(o,n),tabIndex:c.selected&&d?0:-1,onFocus(){r({type:`TAB_FOCUS`,value:n})},onBlur(e){e.relatedTarget?.getAttribute(`role`)!==`tab`&&r({type:`TAB_BLUR`})},onClick(e){e.defaultPrevented||Na(e)||s||(Oa()&&e.currentTarget.focus(),r({type:`TAB_CLICK`,value:n}))}})},getContentProps(e){let{value:n}=e,r=i.get(`value`)===n;return t.element({...Xs.content.attrs,dir:a(`dir`),id:$s(o,n),tabIndex:d?0:-1,"aria-labelledby":ec(o,n),role:`tabpanel`,"data-ownedby":Qs(o),"data-selected":z(r),"data-orientation":a(`orientation`),hidden:!r})},getIndicatorProps(){let e=i.get(`indicatorRect`),n=i.get(`animateIndicator`);return t.element({id:tc(o),...Xs.indicator.attrs,dir:a(`dir`),"data-orientation":a(`orientation`),hidden:mc(e),onTransitionEnd(e){Ma(e)===e.currentTarget&&r({type:`INDICATOR_TRANSITION_END`})},style:{"--transition-property":`left, right, top, bottom, width, height`,"--left":yr(e?.x),"--top":yr(e?.y),"--width":yr(e?.width),"--height":yr(e?.height),position:`absolute`,willChange:n?`var(--transition-property)`:`auto`,transitionProperty:n?`var(--transition-property)`:`none`,transitionDuration:n?`var(--transition-duration, 150ms)`:`0ms`,transitionTimingFunction:`var(--transition-timing-function)`,[u?`left`:`top`]:u?`var(--left)`:`var(--top)`}})}}}var mc=e=>e==null||e.width===0&&e.height===0&&e.x===0&&e.y===0,{createMachine:hc}=di(),gc=hc({props({props:e}){return{dir:`ltr`,orientation:`horizontal`,activationMode:`automatic`,loopFocus:!0,composite:!0,navigate(e){ko(e.node)},defaultValue:null,...e}},initialState(){return`idle`},context({prop:e,bindable:t}){return{value:t(()=>({defaultValue:e(`defaultValue`),value:e(`value`),onChange(t){e(`onValueChange`)?.({value:t})}})),focusedValue:t(()=>({defaultValue:e(`value`)||e(`defaultValue`),sync:!0,onChange(t){e(`onFocusChange`)?.({focusedValue:t})}})),ssr:t(()=>({defaultValue:!0})),indicatorRect:t(()=>({defaultValue:null})),animateIndicator:t(()=>({defaultValue:!1}))}},refs(){return{indicatorCleanup:null,prevValue:null}},watch({context:e,prop:t,track:n,action:r}){n([()=>e.get(`value`)],()=>{r([`syncIndicatorAnimation`,`syncIndicatorRect`,`syncTabIndex`,`navigateIfNeeded`])}),n([()=>t(`dir`),()=>t(`orientation`)],()=>{r([`syncIndicatorRect`])})},on:{SET_VALUE:{actions:[`setValue`]},CLEAR_VALUE:{actions:[`clearValue`]},SET_INDICATOR_RECT:{actions:[`setIndicatorRect`]},SYNC_TAB_INDEX:{actions:[`syncTabIndex`]},INDICATOR_TRANSITION_END:{actions:[`clearIndicatorAnimation`]}},entry:[`syncPrevValue`,`syncIndicatorRect`,`syncTabIndex`,`syncSsr`],exit:[`cleanupObserver`],states:{idle:{on:{TAB_FOCUS:{target:`focused`,actions:[`setFocusedValue`]},TAB_CLICK:{target:`focused`,actions:[`setFocusedValue`,`setValue`]}}},focused:{on:{TAB_CLICK:{actions:[`setFocusedValue`,`setValue`]},ARROW_PREV:[{guard:`selectOnFocus`,actions:[`focusPrevTab`,`selectFocusedTab`]},{actions:[`focusPrevTab`]}],ARROW_NEXT:[{guard:`selectOnFocus`,actions:[`focusNextTab`,`selectFocusedTab`]},{actions:[`focusNextTab`]}],HOME:[{guard:`selectOnFocus`,actions:[`focusFirstTab`,`selectFocusedTab`]},{actions:[`focusFirstTab`]}],END:[{guard:`selectOnFocus`,actions:[`focusLastTab`,`selectFocusedTab`]},{actions:[`focusLastTab`]}],TAB_FOCUS:{actions:[`setFocusedValue`]},TAB_BLUR:{target:`idle`,actions:[`clearFocusedValue`]}}}},implementations:{guards:{selectOnFocus:({prop:e})=>e(`activationMode`)===`automatic`},actions:{selectFocusedTab({context:e,prop:t}){So(()=>{let n=e.get(`focusedValue`);if(!n)return;let r=t(`deselectable`)&&e.get(`value`)===n?null:n;e.set(`value`,r)})},setFocusedValue({context:e,event:t,flush:n}){t.value!=null&&n(()=>{e.set(`focusedValue`,t.value)})},clearFocusedValue({context:e}){e.set(`focusedValue`,null)},setValue({context:e,event:t,prop:n}){let r=n(`deselectable`)&&e.get(`value`)===e.get(`focusedValue`);e.set(`value`,r?null:t.value)},clearValue({context:e}){e.set(`value`,null)},focusFirstTab({scope:e}){So(()=>{sc(e)?.focus()})},focusLastTab({scope:e}){So(()=>{cc(e)?.focus()})},focusNextTab({context:e,prop:t,scope:n,event:r}){let i=r.value??e.get(`focusedValue`);if(!i)return;let a=lc(n,{value:i,loopFocus:t(`loopFocus`)});So(()=>{t(`composite`)?a?.focus():a?.dataset.value!=null&&e.set(`focusedValue`,a.dataset.value)})},focusPrevTab({context:e,prop:t,scope:n,event:r}){let i=r.value??e.get(`focusedValue`);if(!i)return;let a=uc(n,{value:i,loopFocus:t(`loopFocus`)});So(()=>{t(`composite`)?a?.focus():a?.dataset.value!=null&&e.set(`focusedValue`,a.dataset.value)})},syncTabIndex({context:e,scope:t}){So(()=>{let n=e.get(`value`);if(!n)return;let r=rc(t,n);r&&(po(r).length>0?r.removeAttribute(`tabindex`):r.setAttribute(`tabindex`,`0`))})},cleanupObserver({refs:e}){let t=e.get(`indicatorCleanup`);t&&t()},setIndicatorRect({context:e,event:t,scope:n}){let r=t.id??e.get(`value`);ac(n)&&r&&ic(n,r)&&e.set(`indicatorRect`,fc(n,r))},syncSsr({context:e}){e.set(`ssr`,!1)},syncPrevValue({context:e,refs:t}){t.set(`prevValue`,e.get(`value`))},syncIndicatorAnimation({context:e,refs:t}){let n=t.get(`prevValue`),r=e.get(`value`),i=n!=null&&r!=null&&n!==r;e.set(`animateIndicator`,i),t.set(`prevValue`,r)},clearIndicatorAnimation({context:e}){e.set(`animateIndicator`,!1)},syncIndicatorRect({context:e,refs:t,scope:n}){let r=t.get(`indicatorCleanup`);if(r&&r(),!ac(n))return;let i=()=>{let t=ic(n,e.get(`value`));if(!t)return;let r=dc(t);e.set(`indicatorRect`,e=>Jn(e,r)?e:r)};i();let a=oc(n),o=nc(n),s=dr(...a.map(e=>Yo.observe(e,i)),...o?[Yo.observe(o,i)]:[]);t.set(`indicatorCleanup`,s)},navigateIfNeeded({context:e,prop:t,scope:n}){let r=e.get(`value`);if(!r)return;let i=ic(n,r);Ri(i)&&t(`navigate`)?.({value:r,node:i,href:i.href})}}}}),[_c,vc]=jr({name:`TabsContext`,hookName:`useTabsContext`,providerName:`<TabsProvider />`}),[yc,bc]=jr({name:`RenderStrategyContext`,hookName:`useRenderStrategyContext`,providerName:`<RenderStrategyPropsProvider />`}),xc=e=>Ss()(e,[`lazyMount`,`unmountOnExit`,`hideMode`]),Sc=Ss(),Cc=(0,F.forwardRef)((e,t)=>{let[n,r]=Sc(e,[`value`]),i=vc(),a=Us({...bc(),present:i.value===e.value,immediate:!0}),o=R(i.getContentProps(n),a.getPresenceProps(),r),s=Fr(a.ref,t);return(0,I.jsx)(Gs,{value:a,children:(0,I.jsx)(Ws,{presence:a,children:(0,I.jsx)(B.div,{...o,ref:s})})})});Cc.displayName=`TabContent`;var wc=(0,F.forwardRef)((e,t)=>{let n=R(vc().getIndicatorProps(),e);return(0,I.jsx)(B.div,{...n,ref:t})});wc.displayName=`TabIndicator`;var Tc=(0,F.forwardRef)((e,t)=>{let n=R(vc().getListProps(),e);return(0,I.jsx)(B.div,{...n,ref:t})});Tc.displayName=`TabList`;var Ec=Ss(),Dc=(0,F.forwardRef)((e,t)=>{let[n,r]=Ec(e,[`disabled`,`value`]),i=R(vc().getTriggerProps(n),r);return(0,I.jsx)(B.button,{...i,ref:t})});Dc.displayName=`TabTrigger`;var Oc=e=>e.children(vc()),kc=e=>{let t=(0,F.useId)(),{getRootNode:n}=Nr(),{dir:r}=ys();return pc(Ps(gc,{id:t,dir:r,getRootNode:n,...e}),zs)},Ac=Ss(),jc=(0,F.forwardRef)((e,t)=>{let[n,r]=xc(e),[i,a]=Ac(r,[`activationMode`,`composite`,`defaultValue`,`deselectable`,`id`,`ids`,`loopFocus`,`navigate`,`onFocusChange`,`onValueChange`,`orientation`,`translations`,`value`]),o=kc(i),s=R(o.getRootProps(),a);return(0,I.jsx)(_c,{value:o,children:(0,I.jsx)(yc,{value:n,children:(0,I.jsx)(B.div,{...s,ref:t})})})});jc.displayName=`TabsRoot`;var Mc=Ss(),Nc=(0,F.forwardRef)((e,t)=>{let[n,r]=xc(e),[{value:i},a]=Mc(r,[`value`]),o=R(i.getRootProps(),a);return(0,I.jsx)(_c,{value:i,children:(0,I.jsx)(yc,{value:n,children:(0,I.jsx)(B.div,{...o,ref:t})})})});Nc.displayName=`TabsRootProvider`;var Pc=xs({Content:()=>Cc,Context:()=>Oc,Indicator:()=>wc,List:()=>Tc,Root:()=>jc,RootProvider:()=>Nc,Trigger:()=>Dc});function Fc(e){let{key:t,recipe:n}=e,r=en();return(0,F.useMemo)(()=>n?r.sva(n):t==null?r.sva({slots:[]}):r.getSlotRecipeFn(t),[t,n,r])}var Ic=e=>{let{key:t,recipe:n}=e,r=xn(t||n.className||`Component`),[i,a]=Qt({name:`${r}StylesContext`,errorMessage:`use${r}Styles returned is 'undefined'. Seems you forgot to wrap the components in "<${r}.Root />" `}),[o,s]=Qt({name:`${r}ClassNameContext`,errorMessage:`use${r}ClassNames returned is 'undefined'. Seems you forgot to wrap the components in "<${r}.Root />" `,strict:!1}),[c,l]=Qt({strict:!1,name:`${r}PropsContext`,providerName:`${r}PropsContext`,defaultValue:{}});function u(e){let{unstyled:r,...i}=e,a=Fc({key:t,recipe:i.recipe||n}),[o,s]=(0,F.useMemo)(()=>a.splitVariantProps(i),[i,a]);return{styles:(0,F.useMemo)(()=>r?Tn:a(o),[r,o,a]),classNames:a.classNameMap,props:s}}function d(e,t={}){let{defaultProps:n,displayName:a}=t,s=bn(e),c=Cn(r,s),d=t=>{let r=l(),{styles:a,classNames:s,props:c}=u((0,F.useMemo)(()=>zt(n,r,t),[r,t]));return(0,I.jsx)(i,{value:a,children:(0,I.jsx)(o,{value:s,children:(0,I.jsx)(e,{...c})})})};return d.displayName=a??c??s,d}return{StylesProvider:i,ClassNamesProvider:o,PropsProvider:c,usePropsContext:l,useRecipeResult:u,withProvider:(e,t,n)=>{let{defaultProps:a,displayName:s,wrapElement:c,...d}=n??{},f=Sn(r,String(t)),p=vn(e,{},d),m=(0,F.forwardRef)((e,n)=>{let r=l(),s=(0,F.useMemo)(()=>zt(a??{},r,e),[r,e]),{styles:d,props:f,classNames:m}=u(s),h=m[t],g=(0,I.jsx)(i,{value:d,children:(0,I.jsx)(o,{value:m,children:(0,I.jsx)(p,{ref:n,...f,css:[d[t],s.css],className:qt(s.className,h)})})});return c?.(g,s)??g});return m.displayName=s??f??bn(e),m},withContext:(e,t,n)=>{let{displayName:i,...o}=n??{},c=t!=null&&t!==``?Sn(r,String(t)):r,l=vn(e,{},o),u=(0,F.forwardRef)((e,n)=>{let{unstyled:r,...i}=e,o=a(),c=s()?.[t];return(0,I.jsx)(l,{...i,css:[!r&&t?o[t]:void 0,e.css],ref:n,className:qt(e.className,c)})});return u.displayName=i??c??bn(e),u},withRootProvider:d,useStyles:a,useClassNames:s}},{withProvider:Lc,withContext:Rc,useStyles:zc,PropsProvider:Bc}=Ic({key:`tabs`});Lc(Pc.RootProvider,`root`,{forwardAsChild:!0});var Vc=Lc(Pc.Root,`root`,{forwardAsChild:!0}),Hc=Rc(Pc.Trigger,`trigger`,{forwardAsChild:!0}),Uc=Rc(Pc.Content,`content`,{forwardAsChild:!0});Rc(`div`,`contentGroup`);var Wc=Rc(Pc.List,`list`,{forwardAsChild:!0});Rc(Pc.Indicator,`indicator`,{forwardAsChild:!0});var{withContext:Gc,PropsProvider:Kc}=Dn({key:`text`}),H=Gc(`p`),qc=V(`accordion`).parts(`root`,`item`,`itemTrigger`,`itemContent`,`itemIndicator`);qc.build();var Jc=V(`avatar`).parts(`root`,`image`,`fallback`);Jc.build();var Yc=new WeakMap,Xc=new WeakMap,Zc={},Qc=0,$c=e=>e&&(e.host||$c(e.parentNode)),el=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=$c(t);return n&&e.contains(n)?n:(console.error(`[zag-js > ariaHidden] target`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(e=>!!e),tl=new Set([`script`,`output`,`status`,`next-route-announcer`]),nl=e=>tl.has(e.localName)||e.role===`status`||e.hasAttribute(`aria-live`)?!0:e.matches(`[data-live-announcer]`),rl=(e,t)=>{let{parentNode:n,markerName:r,controlAttribute:i,explicitBooleanValue:a,followControlledElements:o=!0}=t,s=el(n,Array.isArray(e)?e:[e]);Zc[r]||(Zc[r]=new WeakMap);let c=Zc[r],l=[],u=new Set,d=new Set(s),f=e=>{e&&!u.has(e)&&(u.add(e),f(e.parentNode))};s.forEach(e=>{f(e),o&&Ai(e)&&ia(e,e=>{f(e)})});let p=e=>{e&&!d.has(e)&&Array.prototype.forEach.call(e.children,e=>{if(u.has(e))p(e);else try{if(nl(e))return;let t=e.getAttribute(i),n=a?t===`true`:t!==null&&t!==`false`,o=(Yc.get(e)||0)+1,s=(c.get(e)||0)+1;Yc.set(e,o),c.set(e,s),l.push(e),o===1&&n&&Xc.set(e,!0),s===1&&e.setAttribute(r,``),n||e.setAttribute(i,a?`true`:``)}catch(t){console.error(`[zag-js > ariaHidden] cannot operate on `,e,t)}})};return p(n),u.clear(),Qc++,()=>{l.forEach(e=>{let t=Yc.get(e)-1,n=c.get(e)-1;Yc.set(e,t),c.set(e,n),t||(Xc.has(e)||e.removeAttribute(i),Xc.delete(e)),n||e.removeAttribute(r)}),Qc--,Qc||(Yc=new WeakMap,Yc=new WeakMap,Xc=new WeakMap,Zc={})}},il=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,al=(e,t=il(e),n=`data-aria-hidden`,r=!0)=>{if(t)return rl(e,{parentNode:t,markerName:n,controlAttribute:`aria-hidden`,explicitBooleanValue:!0,followControlledElements:r})},ol=e=>{let t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function sl(e,t={}){let{defer:n=!0}=t,r=n?ol:e=>e(),i=[];return i.push(r(()=>{let t=(typeof e==`function`?e():e).filter(Boolean);t.length!==0&&i.push(al(t))})),()=>{i.forEach(e=>e?.())}}function cl(e){let t={each(t){for(let n=0;n<e.frames?.length;n+=1){let r=e.frames[n];r&&t(r)}},addEventListener(e,n,r){return t.each(t=>{try{t.document.addEventListener(e,n,r)}catch{}}),()=>{try{t.removeEventListener(e,n,r)}catch{}}},removeEventListener(e,n,r){t.each(t=>{try{t.document.removeEventListener(e,n,r)}catch{}})}};return t}function ll(e){let t=e.frameElement==null?null:e.parent;return{addEventListener:(e,n,r)=>{try{t?.addEventListener(e,n,r)}catch{}return()=>{try{t?.removeEventListener(e,n,r)}catch{}}},removeEventListener:(e,n,r)=>{try{t?.removeEventListener(e,n,r)}catch{}}}}var ul=`pointerdown.outside`,dl=`focus.outside`;function fl(e){for(let t of e)if(Ai(t)&&mo(t))return!0;return!1}var pl=e=>`clientY`in e;function ml(e,t){if(!pl(t)||!e)return!1;let n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function hl(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function gl(e,t){if(!t||!pl(e))return!1;let n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,i=t.scrollWidth>t.clientWidth,a=i&&e.clientY>t.offsetTop+t.clientHeight;return hl({x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(i?16:0)},{x:e.clientX,y:e.clientY})?r||a:!1}function _l(e,t){let{exclude:n,onFocusOutside:r,onPointerDownOutside:i,onInteractOutside:a,defer:o,followControlledElements:s=!0}=t;if(!e)return;let c=Ki(e),l=Ji(e),u=cl(l),d=ll(l);function f(t,r){if(!Ai(r)||!r.isConnected||Gi(e,r)||ml(e,t)||s&&ra(e,r))return!1;let i=c.querySelector(`[aria-controls="${e.id}"]`);return i&&gl(t,Ao(i))||gl(t,Ao(e))?!1:!n?.(r)}let p=new Set,m=Ii(e?.getRootNode()),h=!1;function g(t){h=!0;let n=()=>{h=!1};c.addEventListener(`pointerup`,n,{once:!0}),l.addEventListener(`pointerup`,n,{once:!0});function r(n){let r=o&&!Sa()?So:e=>e(),s=n??t,c=s?.composedPath?.()??[s?.target];r(()=>{let n=m?c[0]:Ma(t);if(e&&f(t,n)){if(i||a){let t=dr(i,a);e.addEventListener(ul,t,{once:!0})}yl(e,ul,{bubbles:!1,cancelable:!0,detail:{originalEvent:s,contextmenu:Ra(s),focusable:fl(c),target:n}})}})}t.pointerType===`touch`?(p.forEach(e=>e()),p.add(Ga(c,`click`,r,{once:!0})),p.add(d.addEventListener(`click`,r,{once:!0})),p.add(u.addEventListener(`click`,r,{once:!0}))):r()}let _=new Set,v=setTimeout(()=>{_.add(Ga(c,`pointerdown`,g,!0)),_.add(d.addEventListener(`pointerdown`,g,!0)),_.add(u.addEventListener(`pointerdown`,g,!0))},0);function y(t){h||(o?So:e=>e())(()=>{let n=t?.composedPath?.()??[t?.target],i=m?n[0]:Ma(t);if(e&&f(t,i)){if(r||a){let t=dr(r,a);e.addEventListener(dl,t,{once:!0})}yl(e,dl,{bubbles:!1,cancelable:!0,detail:{originalEvent:t,contextmenu:!1,focusable:mo(i),target:i}})}})}return Sa()||(_.add(Ga(c,`focusin`,y,!0)),_.add(d.addEventListener(`focusin`,y,!0)),_.add(u.addEventListener(`focusin`,y,!0))),()=>{clearTimeout(v),p.forEach(e=>e()),_.forEach(e=>e())}}function vl(e,t){let{defer:n}=t,r=n?So:e=>e(),i=[];return i.push(r(()=>{let n=typeof e==`function`?e():e;i.push(_l(n,t))})),()=>{i.forEach(e=>e?.())}}function yl(e,t,n){let r=new(e.ownerDocument.defaultView||window).CustomEvent(t,n);return e.dispatchEvent(r)}function bl(e,t){return Ga(Ki(e),`keydown`,e=>{e.key===`Escape`&&(e.isComposing||t?.(e))},{capture:!0})}var xl=`layer:request-dismiss`,Sl={layers:[],branches:[],recentlyRemoved:new Set,count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){return this.indexOf(e)<(this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1)},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},getLayersByType(e){return this.layers.filter(t=>t.type===e)},getNestedLayersByType(e,t){let n=this.indexOf(e);return n===-1?[]:this.layers.slice(n+1).filter(e=>e.type===t)},getParentLayerOfType(e,t){let n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(e=>e.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return!!(this.getNestedLayers(e).some(e=>Gi(e.node,t))||this.recentlyRemoved.size>0)},isInBranch(e){return Array.from(this.branches).some(t=>Gi(t,e))},add(e){let t=this.indexOf(e.node);t!==-1&&this.layers.splice(t,1),this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){let t=this.indexOf(e);t<0||(this.layers[t].styleTargets?.forEach(e=>{let t=e();t&&wl(t)}),this.recentlyRemoved.add(e),Co(()=>this.recentlyRemoved.delete(e)),t<this.count()-1&&this.getNestedLayers(e).forEach(t=>Sl.dismiss(t.node,e)),this.layers.splice(t,1),this.syncLayers())},removeBranch(e){let t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},syncLayers(){this.layers.forEach((e,t)=>{Cl(e,t,e.node),e.styleTargets?.forEach(n=>{let r=n();if(!r||r===e.node)return;Cl(e,t,r);let{zIndex:i}=$i(e.node);r.style.setProperty(`--z-index`,i)})})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){let n=this.indexOf(e);if(n===-1)return;let r=this.layers[n];El(e,xl,e=>{r.requestDismiss?.(e),e.defaultPrevented||r?.dismiss()}),Tl(e,xl,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function Cl(e,t,n){n.style.setProperty(`--layer-index`,`${t}`),n.removeAttribute(`data-nested`),n.removeAttribute(`data-has-nested`),Sl.getParentLayerOfType(e.node,e.type)&&n.setAttribute(`data-nested`,e.type);let r=Sl.countNestedLayersOfType(e.node,e.type);r>0&&n.setAttribute(`data-has-nested`,e.type),n.style.setProperty(`--nested-layer-count`,`${r}`)}function wl(e){e.style.removeProperty(`--layer-index`),e.style.removeProperty(`--nested-layer-count`),e.style.removeProperty(`--z-index`),e.removeAttribute(`data-nested`),e.removeAttribute(`data-has-nested`)}function Tl(e,t,n){let r=new(e.ownerDocument.defaultView||window).CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(r)}function El(e,t,n){e.addEventListener(t,n,{once:!0})}var Dl=new WeakMap,Ol=new WeakMap;function kl(e){return Sl.isBelowPointerBlockingLayer(e)?`none`:`auto`}function Al(e){let t=kl(e);e.style.pointerEvents!==t&&(e.style.pointerEvents=t)}function jl(e){if(Ol.has(e))return;let t=Ji(e);if(t.MutationObserver===void 0)return;let n=new t.MutationObserver(()=>{Ol.has(e)&&Al(e)});n.observe(e,{attributes:!0,attributeFilter:[`style`]}),Ol.set(e,n)}function Ml(){Sl.layers.forEach(({node:e})=>{Al(e),jl(e)})}function Nl(e){let t=Ol.get(e);t&&(t.disconnect(),Ol.delete(e)),e.style.pointerEvents=``}function Pl(e,t){let n=Ki(e),r=[];return Sl.hasPointerBlockingLayer()&&!n.body.hasAttribute(`data-inert`)&&(Dl.set(n.body,n.body.style.pointerEvents),queueMicrotask(()=>{let e=n.body;e&&(e.style.pointerEvents=`none`,e.setAttribute(`data-inert`,``))})),t?.forEach(e=>{let[t,n]=us(()=>{let t=e();return Ai(t)?t:null},{timeout:1e3});t.then(e=>r.push(ns(e,{pointerEvents:`auto`}))),r.push(n)}),()=>{Sl.hasPointerBlockingLayer()||(queueMicrotask(()=>{let e=n.body;if(!e)return;let t=Dl.get(e);t!==void 0&&(e.style.pointerEvents=t,Dl.delete(e)),e.removeAttribute(`data-inert`),e.style.length===0&&e.removeAttribute(`style`)}),r.forEach(e=>e()))}}function Fl(e,t){let{onDismiss:n,onRequestDismiss:r,pointerBlocking:i,exclude:a,debug:o,type:s=`dialog`,layerStyleTargets:c}=t,l={dismiss:n,node:e,type:s,pointerBlocking:i,requestDismiss:r,styleTargets:c};Sl.add(l),Ml();function u(r){let i=Ma(r.detail.originalEvent);Sl.isBelowPointerBlockingLayer(e)||Sl.isInBranch(i)||(t.onPointerDownOutside?.(r),t.onInteractOutside?.(r),!r.defaultPrevented&&(o&&console.log(`onPointerDownOutside:`,r.detail.originalEvent),n?.()))}function d(e){let r=Ma(e.detail.originalEvent);Sl.isInBranch(r)||(t.onFocusOutside?.(e),t.onInteractOutside?.(e),!e.defaultPrevented&&(o&&console.log(`onFocusOutside:`,e.detail.originalEvent),n?.()))}function f(r){Sl.isTopMost(e)&&(t.onEscapeKeyDown?.(r),!r.defaultPrevented&&n&&(r.preventDefault(),n()))}function p(n){let r=typeof a==`function`?a():a,i=Array.isArray(r)?r:[r],o=t.persistentElements?.map(e=>e()).filter(Ai);return o&&i.push(...o),i.some(e=>Gi(e,n))||Sl.isInNestedLayer(e,n)}let m=[i?Pl(e,t.persistentElements):void 0,bl(e,f),vl(e,{exclude:p,onFocusOutside:d,onPointerDownOutside:u,defer:t.defer})];return()=>{Sl.remove(e),Ml(),Nl(e),m.forEach(e=>e?.())}}function Il(e,t){let{warnOnMissingNode:n=!0}=t;return ds(e,e=>Fl(e,t),{defer:t.defer,onMissing:n?()=>Er("[@zag-js/dismissable] node is `null` or `undefined`"):void 0})}var Ll=Object.defineProperty,Rl=(e,t,n)=>t in e?Ll(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zl=(e,t,n)=>Rl(e,typeof t==`symbol`?t:t+``,n),Bl={activateTrap(e,t){if(e.length>0){let n=e[e.length-1];n!==t&&n.pause()}let n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},Vl=[],Hl=class{constructor(e,t){zl(this,`trapStack`),zl(this,`config`),zl(this,`doc`),zl(this,`state`,{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),zl(this,`lastInteractionType`,`keyboard`),zl(this,`portalContainers`,new Set),zl(this,`listenerCleanups`,[]),zl(this,`handleFocus`,e=>{let t=Ma(e),n=this.findContainerIndex(t,e)>=0;if(n||ji(t))n&&(this.state.mostRecentlyFocusedNode=t);else{e.stopImmediatePropagation();let t,n=!0;if(this.state.mostRecentlyFocusedNode){if(vo(this.state.mostRecentlyFocusedNode)>0){let e=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:r}=this.state.containerGroups[e];if(r.length>0){let e=r.findIndex(e=>e===this.state.mostRecentlyFocusedNode);e>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?e+1<r.length&&(t=r[e+1],n=!1):e-1>=0&&(t=r[e-1],n=!1))}}else this.state.containerGroups.some(e=>e.tabbableNodes.some(e=>vo(e)>0))||(n=!1)}else n=!1;n&&(t=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),t?this.tryFocus(t):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),zl(this,`handlePointerDown`,e=>{this.lastInteractionType=`pointer`;let t=Ma(e);if(!(this.findContainerIndex(t,e)>=0)){if(ql(this.config.clickOutsideDeactivates,e)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}ql(this.config.allowOutsideClick,e)||e.preventDefault()}}),zl(this,`handleClick`,e=>{let t=Ma(e);this.findContainerIndex(t,e)>=0||ql(this.config.clickOutsideDeactivates,e)||ql(this.config.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())}),zl(this,`handleTabKey`,e=>{if(this.lastInteractionType=`keyboard`,this.config.isKeyForward(e)||this.config.isKeyBackward(e)){this.state.recentNavEvent=e;let t=this.config.isKeyBackward(e),n=this.findNextNavNode({event:e,isBackward:t});if(!n)return;Wl(e)&&e.preventDefault(),this.tryFocus(n)}}),zl(this,`handleEscapeKey`,e=>{Jl(e)&&ql(this.config.escapeDeactivates,e)!==!1&&(e.preventDefault(),this.deactivate())}),zl(this,`_mutationObserver`),zl(this,`setupMutationObserver`,()=>{let e=this.doc.defaultView||window;this._mutationObserver=new e.MutationObserver(e=>{e.some(e=>Array.from(e.removedNodes).some(e=>e===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode()),e.some(e=>e.type===`attributes`&&(e.attributeName===`aria-controls`||e.attributeName===`aria-expanded`)||e.type===`childList`&&e.addedNodes.length>0&&Array.from(e.addedNodes).some(e=>{if(e.nodeType!==Node.ELEMENT_NODE)return!1;let t=e;return ca(t)?!0:t.id&&!this.state.containers.some(e=>e.contains(t))?la(t):!1}))&&this.state.active&&!this.state.paused&&(this.updateTabbableNodes(),this.updatePortalContainers())})}),zl(this,`updateObservedNodes`,()=>{this._mutationObserver?.disconnect(),this.state.active&&!this.state.paused&&(this.state.containers.map(e=>{this._mutationObserver?.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`aria-controls`,`aria-expanded`]})}),this.portalContainers.forEach(e=>{this.observePortalContainer(e)}))}),zl(this,`getInitialFocusNode`,()=>{let e=this.getNodeForOption(`initialFocus`,{hasFallback:!0});if(e===!1)return!1;if(e===void 0||e&&!mo(e)){let t=Yi(this.doc);if(t&&this.findContainerIndex(t)>=0)e=t;else{let t=this.state.tabbableGroups[0];e=t&&t.firstTabbableNode||this.getNodeForOption(`fallbackFocus`)}}else e===null&&(e=this.getNodeForOption(`fallbackFocus`));if(!e||(e.isConnected||(e=this.getNodeForOption(`fallbackFocus`)),!e||!e.isConnected))throw Error(`Your focus-trap needs to have at least one focusable element`);return e}),zl(this,`tryFocus`,(e,t)=>{if(e!==!1&&e!==Yi(this.doc)){if(!e||!e.focus){this.tryFocus(this.getInitialFocusNode());return}e.focus({preventScroll:!!this.config.preventScroll,...t}),this.state.mostRecentlyFocusedNode=e,Xl(e)&&e.select()}}),zl(this,`deactivate`,e=>{if(!this.state.active)return this;let t={onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus,...e};clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),Bl.deactivateTrap(this.trapStack,this),this.portalContainers.clear();let n=this.getOption(t,`onDeactivate`),r=this.getOption(t,`onPostDeactivate`),i=this.getOption(t,`checkCanReturnFocus`),a=this.getOption(t,`returnFocus`,`returnFocusOnDeactivate`);n?.();let o=()=>{Yl(()=>{if(a&&this.isSafeToOverrideFocus()){let e=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation),t=this.lastInteractionType===`keyboard`?{focusVisible:!0}:void 0;this.tryFocus(e,t)}r?.()})};return a&&i?(i(this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation)).then(o,o),this):(o(),this)}),zl(this,`pause`,e=>{if(this.state.paused||!this.state.active)return this;let t=this.getOption(e,`onPause`),n=this.getOption(e,`onPostPause`);return this.state.paused=!0,t?.(),this.removeListeners(),this.updateObservedNodes(),n?.(),this}),zl(this,`unpause`,e=>{if(!this.state.paused||!this.state.active)return this;let t=this.getOption(e,`onUnpause`),n=this.getOption(e,`onPostUnpause`);this.state.paused=!1,t?.();try{this.updateTabbableNodes()}catch{}this.attachListeners();try{this.commitInitialFocus()}catch{}return this.updateObservedNodes(),n?.(),this}),zl(this,`updateContainerElements`,e=>(this.state.containers=Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),zl(this,`getReturnFocusNode`,e=>{let t=this.getNodeForOption(`setReturnFocus`,{params:[e]});return t||t!==!1&&e}),zl(this,`getOption`,(e,t,n)=>e&&e[t]!==void 0?e[t]:this.config[n||t]),zl(this,`getNodeForOption`,(e,{hasFallback:t=!1,params:n=[]}={})=>{let r=this.config[e];if(typeof r==`function`&&(r=r(...n)),r===!0&&(r=void 0),!r){if(r===void 0||r===!1)return r;throw Error(`\`${e}\` was specified but was not a node, or did not return a node`)}let i=r;if(typeof r==`string`){try{i=this.doc.querySelector(r)}catch(t){throw Error(`\`${e}\` appears to be an invalid selector; error="${t.message}"`)}if(!i&&!t)throw Error(`\`${e}\` as selector refers to no known node`)}return i}),zl(this,`findNextNavNode`,e=>{let{event:t,isBackward:n=!1}=e,r=e.target||Ma(t);this.updateTabbableNodes();let i=null;if(this.state.tabbableGroups.length>0){let e=this.findContainerIndex(r,t),a=e>=0?this.state.containerGroups[e]:void 0;if(e<0)i=n?this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:this.state.tabbableGroups[0].firstTabbableNode;else if(n){let n=this.state.tabbableGroups.findIndex(({firstTabbableNode:e})=>r===e);if(n<0&&(a?.container===r||mo(r)&&!go(r)&&!a?.nextTabbableNode(r,!1))&&(n=e),n>=0){let e=n===0?this.state.tabbableGroups.length-1:n-1,t=this.state.tabbableGroups[e];i=vo(r)>=0?t.lastTabbableNode:t.lastDomTabbableNode}else Wl(t)||(i=a?.nextTabbableNode(r,!1))}else{let n=this.state.tabbableGroups.findIndex(({lastTabbableNode:e})=>r===e);if(n<0&&(a?.container===r||mo(r)&&!go(r)&&!a?.nextTabbableNode(r))&&(n=e),n>=0){let e=n===this.state.tabbableGroups.length-1?0:n+1,t=this.state.tabbableGroups[e];i=vo(r)>=0?t.firstTabbableNode:t.firstDomTabbableNode}else Wl(t)||(i=a?.nextTabbableNode(r))}}else i=this.getNodeForOption(`fallbackFocus`);return i}),this.trapStack=t.trapStack||Vl;let n={returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,followControlledElements:!0,isKeyForward:Gl,isKeyBackward:Kl,...t};this.doc=n.document||Ki(Array.isArray(e)?e[0]:e),this.config=n,this.updateContainerElements(e),this.setupMutationObserver()}addPortalContainer(e){let t=e.parentElement;t&&!this.portalContainers.has(t)&&(this.portalContainers.add(t),this.state.active&&!this.state.paused&&this.observePortalContainer(t))}observePortalContainer(e){this._mutationObserver?.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`aria-controls`,`aria-expanded`]})}updatePortalContainers(){this.config.followControlledElements&&this.state.containers.forEach(e=>{aa(e).forEach(e=>{this.addPortalContainer(e)})})}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(e,t){let n=typeof t?.composedPath==`function`?t.composedPath():void 0;return this.state.containerGroups.findIndex(({container:r,tabbableNodes:i})=>r.contains(e)||n?.includes(r)||i.find(t=>t===e)||this.isControlledElement(r,e)||this.isPersistentElement(e,t))}isControlledElement(e,t){return this.config.followControlledElements?ra(e,t):!1}isPersistentElement(e,t){let n=this.config.persistentElements;if(!n||n.length===0)return!1;let r=typeof t?.composedPath==`function`?t.composedPath():void 0;return n.some(t=>{let n=t();return Gi(n,e)||n!=null&&r?.includes(n)})}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(e=>{let t=ho(e,{getShadowRoot:this.config.getShadowRoot}),n=po(e,{getShadowRoot:this.config.getShadowRoot}),r=t[0],i=t[t.length-1],a=r,o=i,s=!1;for(let e=0;e<t.length;e++)if(vo(t[e])>0){s=!0;break}function c(e,r=!0){let i=t.indexOf(e);if(i>=0)return t[i+(r?1:-1)];let a=n.indexOf(e);if(!(a<0)){if(r){for(let e=a+1;e<n.length;e++)if(go(n[e]))return n[e]}else for(let e=a-1;e>=0;e--)if(go(n[e]))return n[e]}}return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:s,firstTabbableNode:r,lastTabbableNode:i,firstDomTabbableNode:a,lastDomTabbableNode:o,nextTabbableNode:c}}),this.state.tabbableGroups=this.state.containerGroups.filter(e=>e.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption(`fallbackFocus`))throw Error(`Your focus-trap must have at least one container with at least one tabbable node in it at all times`);if(this.state.containerGroups.find(e=>e.posTabIndexesFound)&&this.state.containerGroups.length>1)throw Error(`At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.`)}attachListeners(){if(this.state.active)return Bl.activateTrap(this.trapStack,this),this.listenerCleanups.push(Ga(this.doc,`focusin`,this.handleFocus,!0),Ga(this.doc,`mousedown`,this.handlePointerDown,{capture:!0,passive:!1}),Ga(this.doc,`touchstart`,this.handlePointerDown,{capture:!0,passive:!1}),Ga(this.doc,`click`,this.handleClick,{capture:!0,passive:!1}),Ga(this.doc,`keydown`,this.handleTabKey,{capture:!0,passive:!1}),Ga(this.doc,`keydown`,this.handleEscapeKey)),this}commitInitialFocus(){return this.state.delayInitialFocusTimer=this.config.delayInitialFocus?Yl(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this}addListeners(){if(this.state.active)return this.attachListeners(),this.commitInitialFocus(),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(e=>e()),this.listenerCleanups=[],this}containsElement(e){return this.state.containers.some(t=>Gi(t,e))}isSafeToOverrideFocus(){let e=Yi(this.doc);return!e||e===this.doc.body||this.containsElement(e)?!0:this.trapStack.some(t=>t!==this&&t.containsElement(e))}activate(e){if(this.state.active)return this;let t=this.getOption(e,`onActivate`),n=this.getOption(e,`onPostActivate`),r=this.getOption(e,`checkCanFocusTrap`);r||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=Yi(this.doc),t?.();let i=()=>{r&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),n?.()};return r?(r(this.state.containers.concat()).then(i,i),this):(i(),this)}},Ul=e=>e?.type===`keydown`,Wl=e=>Ul(e)&&e?.key===`Tab`,Gl=e=>Ul(e)&&e.key===`Tab`&&!e?.shiftKey,Kl=e=>Ul(e)&&e.key===`Tab`&&e?.shiftKey,ql=(e,...t)=>typeof e==`function`?e(...t):e,Jl=e=>!e.isComposing&&e.key===`Escape`,Yl=e=>setTimeout(e,0),Xl=e=>e.localName===`input`&&`select`in e&&typeof e.select==`function`;function Zl(e,t={}){let n,r=So(()=>{let r=(Array.isArray(e)?e:[e]).map(e=>typeof e==`function`?e():e).filter(e=>e!=null);if(r.length===0)return;let i=r[0];n=new Hl(r,{escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:i,...t,document:Ki(i)});try{n.activate()}catch{}});return function(){n?.deactivate(),r()}}var Ql=`data-scroll-lock`,$l=new WeakMap;function eu(e){let t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?`paddingLeft`:`paddingRight`}function tu(e){let t=$i(e)?.scrollbarGutter;return t===`stable`||t?.startsWith(`stable `)===!0}function nu(e){let{documentElement:t,body:n}=e;return No(t)?t:n}function ru(e){let t=e.defaultView??window,{documentElement:n,body:r}=e,i=nu(e),a=tu(n)||tu(r),o=t.innerWidth-n.clientWidth;r.setAttribute(Ql,``);let s=()=>rs(n,`--scrollbar-width`,`${o}px`),c=eu(n),l=[s(),Ta()?(()=>{let{scrollX:e,scrollY:n,visualViewport:i}=t,s=i?.offsetLeft??0,l=i?.offsetTop??0,u={position:`fixed`,overflow:`hidden`,top:`${-(n-Math.floor(l))}px`,left:`${-(e-Math.floor(s))}px`,right:`0`};!a&&o>0&&(u[c]=`${o}px`);let d=ns(r,u);return()=>{d?.(),t.scrollTo({left:e,top:n,behavior:`instant`})}})():(()=>{let e={overflow:`hidden`};return!a&&o>0&&(e[c]=`${o}px`),ns(i,e)})()];return()=>{l.forEach(e=>e?.()),r.removeAttribute(Ql)}}function iu(e){let t=e??document,n=$l.get(t);n||(n={count:0,cleanup:ru(t)},$l.set(t,n)),n.count++;let r=n,i=!1;return()=>{i||(i=!0,r.count--,r.count===0&&(r.cleanup(),$l.delete(t)))}}var au=V(`carousel`).parts(`root`,`itemGroup`,`item`,`control`,`nextTrigger`,`prevTrigger`,`indicatorGroup`,`indicator`,`autoplayTrigger`,`progressText`);au.build();var ou=au.extendWith(`progressText`,`autoplayIndicator`),su=V(`checkbox`).parts(`root`,`label`,`control`,`indicator`),cu=su.build();function lu(e){return!(e.metaKey||!Da()&&e.altKey||e.ctrlKey||e.key===`Control`||e.key===`Shift`||e.key===`Meta`)}var uu=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]),du=[`a[href]`,`audio[controls]`,`button`,`details`,`embed`,`iframe`,`img[controls]`,`img[usemap]`,`input`,`select`,`textarea`,`video[controls]`].join(`,`);function fu(e,t,n){let r=n?Ma(n):null,i=Ki(r),a=Ji(r),o=Yi(i);return e=e||o instanceof a.HTMLInputElement&&!uu.has(o?.type)||o instanceof a.HTMLTextAreaElement||o instanceof a.HTMLElement&&o.isContentEditable,!(e&&t===`keyboard`&&n instanceof a.KeyboardEvent&&!Reflect.has(bu,n.key))}var pu=null,mu=new Set,hu=new Map,gu=!1,_u=null,vu=!1,yu=null,bu={Tab:!0,Escape:!0};function xu(e,t){for(let n of mu)n(e,t)}function Su(e){_u=null,gu=!0,lu(e)&&(pu=`keyboard`,xu(`keyboard`,e))}function Cu(e){(e.type!==`pointermove`&&e.type!==`mousemove`||yu?.x!==e.clientX||yu?.y!==e.clientY)&&(yu={x:e.clientX,y:e.clientY},pu=`pointer`,(e.type===`mousedown`||e.type===`pointerdown`)&&(_u=null,gu=!0,xu(`pointer`,e)))}function wu(e){if(Ia(e)){_u=null,gu=!0,pu=`virtual`;return}_u=null;let t=Ma(e),n=t?.closest(`label`),r=n?.control;if(!n||!r||r.matches(`:disabled`))return;let i=t?.closest(du);i&&n.contains(i)&&i!==r||r!==Yi(n.ownerDocument)&&(_u=r)}function Tu(e){let t=Ma(e),n=t===_u;t!==Ji(t)&&t!==Ki(t)&&e.isTrusted&&(!gu&&!n&&!vu&&(pu=`virtual`,xu(`virtual`,e)),gu=!1,_u=null,vu=!1)}function Eu(){gu=!1,_u=null,vu=!0}function Du(e){if(typeof window>`u`||hu.get(Ji(e)))return;let t=Ji(e),n=Ki(e),r=t.HTMLElement.prototype.focus;function i(){gu=!0,r.apply(this,arguments)}try{Object.defineProperty(t.HTMLElement.prototype,"focus",{configurable:!0,value:i})}catch{}n.addEventListener(`keydown`,Su,!0),n.addEventListener(`keyup`,Su,!0),n.addEventListener(`click`,wu,!0),t.addEventListener(`focus`,Tu,!0),t.addEventListener(`blur`,Eu,!1),t.PointerEvent===void 0?(n.addEventListener(`mousedown`,Cu,!0),n.addEventListener(`mousemove`,Cu,!0),n.addEventListener(`mouseup`,Cu,!0)):(n.addEventListener(`pointerdown`,Cu,!0),n.addEventListener(`pointermove`,Cu,!0),n.addEventListener(`pointerup`,Cu,!0)),t.addEventListener(`beforeunload`,()=>{Ou(e)},{once:!0}),hu.set(t,{focus:r})}var Ou=(e,t)=>{let n=Ji(e),r=Ki(e);t&&r.removeEventListener(`DOMContentLoaded`,t);let i=hu.get(n);if(i){try{Object.defineProperty(n.HTMLElement.prototype,"focus",{configurable:!0,value:i.focus})}catch{}r.removeEventListener(`keydown`,Su,!0),r.removeEventListener(`keyup`,Su,!0),r.removeEventListener(`click`,wu,!0),n.removeEventListener(`focus`,Tu,!0),n.removeEventListener(`blur`,Eu,!1),n.PointerEvent===void 0?(r.removeEventListener(`mousedown`,Cu,!0),r.removeEventListener(`mousemove`,Cu,!0),r.removeEventListener(`mouseup`,Cu,!0)):(r.removeEventListener(`pointerdown`,Cu,!0),r.removeEventListener(`pointermove`,Cu,!0),r.removeEventListener(`pointerup`,Cu,!0)),hu.delete(n)}};function ku(){return pu}function Au(e){pu=e,xu(e,null)}function ju(){return pu===`keyboard`||pu===`virtual`}function Mu(e={}){let{isTextInput:t,autoFocus:n,onChange:r,root:i}=e;Du(i),r?.({isFocusVisible:n||ju(),modality:pu});let a=(e,n)=>{fu(!!t,e,n)&&r?.({isFocusVisible:ju(),modality:e})};return mu.add(a),()=>{mu.delete(a)}}var Nu=e=>e.ids?.root??`checkbox:${e.id}`,Pu=e=>e.ids?.label??`checkbox:${e.id}:label`,Fu=e=>e.ids?.control??`checkbox:${e.id}:control`,Iu=e=>e.ids?.hiddenInput??`checkbox:${e.id}:input`,Lu=e=>e.getById(Nu(e)),Ru=e=>e.getById(Iu(e));function zu(e,t){let{send:n,context:r,prop:i,computed:a,scope:o}=e,s=!!i(`disabled`),c=!!i(`readOnly`),l=!!i(`required`),u=!!i(`invalid`),d=!s&&r.get(`focused`),f=!s&&r.get(`focusVisible`),p=a(`checked`),m=a(`indeterminate`),h=r.get(`checked`),g={"data-active":z(r.get(`active`)),"data-focus":z(d),"data-focus-visible":z(f),"data-readonly":z(c),"data-hover":z(r.get(`hovered`)),"data-disabled":z(s),"data-state":m?`indeterminate`:p?`checked`:`unchecked`,"data-invalid":z(u),"data-required":z(l)};return{checked:p,disabled:s,indeterminate:m,focused:d,checkedState:h,setChecked(e){n({type:`CHECKED.SET`,checked:e,isTrusted:!1})},toggleChecked(){n({type:`CHECKED.TOGGLE`,checked:p,isTrusted:!1})},getRootProps(){return t.label({...cu.root.attrs,...g,dir:i(`dir`),id:Nu(o),htmlFor:Iu(o),onPointerMove(){s||n({type:`CONTEXT.SET`,context:{hovered:!0}})},onPointerLeave(){s||n({type:`CONTEXT.SET`,context:{hovered:!1}})},onClick(e){Ma(e)===Ru(o)&&e.stopPropagation()}})},getLabelProps(){return t.element({...cu.label.attrs,...g,dir:i(`dir`),id:Pu(o)})},getControlProps(){return t.element({...cu.control.attrs,...g,dir:i(`dir`),id:Fu(o),"aria-hidden":!0})},getIndicatorProps(){return t.element({...cu.indicator.attrs,...g,dir:i(`dir`),hidden:!m&&!p})},getHiddenInputProps(){return t.input({id:Iu(o),type:`checkbox`,required:i(`required`),defaultChecked:p,disabled:s,"aria-labelledby":Pu(o),"aria-invalid":u,name:i(`name`),form:i(`form`),value:i(`value`),style:cs,onFocus(){let e=ju();n({type:`CONTEXT.SET`,context:{focused:!0,focusVisible:e}})},onBlur(){n({type:`CONTEXT.SET`,context:{focused:!1,focusVisible:!1}})},onClick(e){if(c){e.preventDefault();return}let t=e.currentTarget.checked;n({type:`CHECKED.SET`,checked:t,isTrusted:!0})}})}}}var{not:Bu}=li(),Vu=ui({props({props:e}){return{value:`on`,...e,defaultChecked:e.defaultChecked??!1}},initialState(){return`ready`},context({prop:e,bindable:t}){return{checked:t(()=>({defaultValue:e(`defaultChecked`),value:e(`checked`),onChange(t){e(`onCheckedChange`)?.({checked:t})}})),fieldsetDisabled:t(()=>({defaultValue:!1})),focusVisible:t(()=>({defaultValue:!1})),active:t(()=>({defaultValue:!1})),focused:t(()=>({defaultValue:!1})),hovered:t(()=>({defaultValue:!1}))}},watch({track:e,context:t,prop:n,action:r}){e([()=>n(`disabled`)],()=>{r([`removeFocusIfNeeded`])}),e([()=>t.get(`checked`)],()=>{r([`syncInputElement`])})},effects:[`trackFormControlState`,`trackPressEvent`,`trackFocusVisible`],on:{"CHECKED.TOGGLE":[{guard:Bu(`isTrusted`),actions:[`toggleChecked`,`dispatchChangeEvent`]},{actions:[`toggleChecked`]}],"CHECKED.SET":[{guard:Bu(`isTrusted`),actions:[`setChecked`,`dispatchChangeEvent`]},{actions:[`setChecked`]}],"CONTEXT.SET":{actions:[`setContext`]}},computed:{indeterminate:({context:e})=>Hu(e.get(`checked`)),checked:({context:e})=>Uu(e.get(`checked`)),disabled:({context:e,prop:t})=>!!t(`disabled`)||e.get(`fieldsetDisabled`)},states:{ready:{}},implementations:{guards:{isTrusted:({event:e})=>!!e.isTrusted},effects:{trackPressEvent({context:e,computed:t,scope:n}){if(!t(`disabled`))return Vo({pointerNode:Lu(n),keyboardNode:Ru(n),isValidKey:e=>e.key===` `,onPress:()=>e.set(`active`,!1),onPressStart:()=>e.set(`active`,!0),onPressEnd:()=>e.set(`active`,!1)})},trackFocusVisible({computed:e,scope:t}){if(!e(`disabled`))return Mu({root:t.getRootNode?.()})},trackFormControlState({context:e,scope:t}){return Qa(Ru(t),{onFieldsetDisabledChange(t){e.set(`fieldsetDisabled`,t)},onFormReset(){e.set(`checked`,e.initial(`checked`))}})}},actions:{setContext({context:e,event:t}){for(let n in t.context)e.set(n,t.context[n])},syncInputElement({context:e,computed:t,scope:n}){let r=Ru(n);r&&(qa(r,t(`checked`)),r.indeterminate=Hu(e.get(`checked`)))},removeFocusIfNeeded({context:e,prop:t}){t(`disabled`)&&e.get(`focused`)&&(e.set(`focused`,!1),e.set(`focusVisible`,!1))},setChecked({context:e,event:t}){e.set(`checked`,t.checked)},toggleChecked({context:e,computed:t}){let n=Hu(t(`checked`))?!0:!t(`checked`);e.set(`checked`,n)},dispatchChangeEvent({computed:e,scope:t}){queueMicrotask(()=>{Ja(Ru(t),{checked:e(`checked`)})})}}}});function Hu(e){return e===`indeterminate`}function Uu(e){return!Hu(e)&&!!e}var Wu=su.extendWith(`group`),Gu=V(`clipboard`).parts(`root`,`control`,`trigger`,`indicator`,`input`,`label`);Gu.build();var Ku=V(`collapsible`).parts(`root`,`trigger`,`content`,`indicator`);Ku.build();var qu=V(`color-picker`,[`root`,`label`,`control`,`trigger`,`positioner`,`content`,`area`,`areaThumb`,`valueText`,`areaBackground`,`channelSlider`,`channelSliderLabel`,`channelSliderTrack`,`channelSliderThumb`,`channelSliderValueText`,`channelInput`,`transparencyGrid`,`swatchGroup`,`swatchTrigger`,`swatchIndicator`,`swatch`,`eyeDropperTrigger`,`formatTrigger`,`formatSelect`]);qu.build();var Ju=[`top`,`right`,`bottom`,`left`],Yu=Math.min,Xu=Math.max,Zu=Math.round,Qu=Math.floor,$u=e=>({x:e,y:e}),ed={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function td(e,t,n){return Xu(e,Yu(t,n))}function nd(e,t){return typeof e==`function`?e(t):e}function rd(e){return e.split(`-`)[0]}function id(e){return e.split(`-`)[1]}function ad(e){return e===`x`?`y`:`x`}function od(e){return e===`y`?`height`:`width`}function sd(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function cd(e){return ad(sd(e))}function ld(e,t,n){n===void 0&&(n=!1);let r=id(e),i=cd(e),a=od(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=vd(o)),[o,vd(o)]}function ud(e){let t=vd(e);return[dd(e),t,dd(t)]}function dd(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var fd=[`left`,`right`],pd=[`right`,`left`],md=[`top`,`bottom`],hd=[`bottom`,`top`];function gd(e,t,n){switch(e){case`top`:case`bottom`:return n?t?pd:fd:t?fd:pd;case`left`:case`right`:return t?md:hd;default:return[]}}function _d(e,t,n,r){let i=id(e),a=gd(rd(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(dd)))),a}function vd(e){let t=rd(e);return ed[t]+e.slice(t.length)}function yd(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function bd(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:yd(e)}function xd(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Sd(e,t,n){let{reference:r,floating:i}=e,a=sd(t),o=cd(t),s=od(o),c=rd(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=id(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Cd(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=nd(t,e),p=bd(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=xd(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=xd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var wd=50,Td=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Cd},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Sd(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<wd&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Sd(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ed=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=nd(e,t)||{};if(l==null)return{};let d=bd(u),f={x:n,y:r},p=cd(i),m=od(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Yu(d[_],T),D=Yu(d[v],T),ee=C-h[m]-D,O=C/2-h[m]/2+w,k=td(E,O,ee),A=!c.arrow&&id(i)!=null&&O!==k&&a.reference[m]/2-(O<E?E:D)-h[m]/2<0,te=A?O<E?O-E:O-ee:0;return{[p]:f[p]+te,data:{[p]:k,centerOffset:O-k-te,...A&&{alignmentOffset:te}},reset:A}}}),Dd=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=nd(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=rd(r),_=sd(o),v=rd(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[vd(o)]:ud(o)),x=p!==`none`;!d&&x&&b.push(..._d(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ld(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===sd(t)||T.every(e=>sd(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=sd(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Od(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function kd(e){return Ju.some(t=>e[t]>=0)}var Ad=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=nd(e,t);switch(i){case`referenceHidden`:{let e=Od(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:kd(e)}}}case`escaped`:{let e=Od(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:kd(e)}}}default:return{}}}}},jd=new Set([`left`,`top`]);async function Md(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=rd(n),s=id(n),c=sd(n)===`y`,l=jd.has(o)?-1:1,u=a&&c?-1:1,d=nd(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Nd=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Md(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Pd=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=nd(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=sd(i),p=ad(f),m=u[p],h=u[f],g=(e,t)=>td(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Fd=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=nd(e,t),u={x:n,y:r},d=sd(i),f=ad(d),p=u[f],m=u[d],h=nd(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=jd.has(rd(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Id=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=nd(e,t),c=await i.detectOverflow(t,s),l=rd(n),u=id(n),d=sd(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Yu(p-c[m],g),y=Yu(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Xu(c.left,c.right):S=p-2*Xu(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Ld(){return typeof window<`u`}function Rd(e){return Vd(e)?(e.nodeName||``).toLowerCase():`#document`}function zd(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bd(e){return((Vd(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Vd(e){return Ld()?e instanceof Node||e instanceof zd(e).Node:!1}function Hd(e){return Ld()?e instanceof Element||e instanceof zd(e).Element:!1}function Ud(e){return Ld()?e instanceof HTMLElement||e instanceof zd(e).HTMLElement:!1}function Wd(e){return!Ld()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof zd(e).ShadowRoot}function Gd(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=nf(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Kd(e){return/^(table|td|th)$/.test(Rd(e))}function qd(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Jd=/transform|translate|scale|rotate|perspective|filter/,Yd=/paint|layout|strict|content/,Xd=e=>!!e&&e!==`none`,Zd;function Qd(e){let t=Hd(e)?nf(e):e;return Xd(t.transform)||Xd(t.translate)||Xd(t.scale)||Xd(t.rotate)||Xd(t.perspective)||!ef()&&(Xd(t.backdropFilter)||Xd(t.filter))||Jd.test(t.willChange||``)||Yd.test(t.contain||``)}function $d(e){let t=af(e);for(;Ud(t)&&!tf(t);){if(Qd(t))return t;if(qd(t))return null;t=af(t)}return null}function ef(){return Zd??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Zd}function tf(e){return/^(html|body|#document)$/.test(Rd(e))}function nf(e){return zd(e).getComputedStyle(e)}function rf(e){return Hd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function af(e){if(Rd(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Wd(e)&&e.host||Bd(e);return Wd(t)?t.host:t}function of(e){let t=af(e);return tf(t)?(e.ownerDocument||e).body:Ud(t)&&Gd(t)?t:of(t)}function sf(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=of(e),i=r===e.ownerDocument?.body,a=zd(r);if(i){let e=cf(a);return t.concat(a,a.visualViewport||[],Gd(r)?r:[],e&&n?sf(e):[])}return t.concat(r,sf(r,[],n))}function cf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lf(e){let t=nf(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ud(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Zu(n)!==a||Zu(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function uf(e){return Hd(e)?e:e.contextElement}function df(e){let t=uf(e);if(!Ud(t))return $u(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=lf(t),o=(a?Zu(n.width):n.width)/r,s=(a?Zu(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ff=$u(0);function pf(e){let t=zd(e);return!ef()||!t.visualViewport?ff:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function mf(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===zd(e)}function hf(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=uf(e),o=$u(1);t&&(r?Hd(r)&&(o=df(r)):o=df(e));let s=mf(a,n,r)?pf(a):$u(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=zd(a),t=Hd(r)?zd(r):r,n=e,i=cf(n);for(;i&&t!==n;){let e=df(i),t=i.getBoundingClientRect(),r=nf(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=zd(i),i=cf(n)}}return xd({width:u,height:d,x:c,y:l})}function gf(e,t){let n=rf(e).scrollLeft;return t?t.left+n:hf(Bd(e)).left+n}function _f(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-gf(e,n),y:n.top+t.scrollTop}}function vf(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Bd(r),s=t?qd(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=$u(1),u=$u(0),d=Ud(r);if((d||!a)&&((Rd(r)!==`body`||Gd(o))&&(c=rf(r)),d)){let e=hf(r);l=df(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?_f(o,c):$u(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function yf(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function bf(e){let t=rf(e),n=e.ownerDocument.body,r=Xu(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Xu(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+gf(e),o=-t.scrollTop;return nf(n).direction===`rtl`&&(a+=Xu(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var xf=25;function Sf(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=zd(e),a=Bd(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!ef()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(gf(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=xf&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Cf(e,t){let n=hf(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=df(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function wf(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Sf(e,n,t);else if(t===`document`)r=bf(Bd(e));else if(Hd(t))r=Cf(t,n);else{let n=pf(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return xd(r)}function Tf(e,t){let n=t.get(e);if(n)return n;let r=sf(e,[],!1).filter(e=>Hd(e)&&Rd(e)!==`body`),i=null,a=nf(e).position===`fixed`,o=a?af(e):e;for(;Hd(o)&&!tf(o);){let e=nf(o),t=Qd(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=af(o)}return t.set(e,r),r}function Ef(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?qd(t)?[]:Tf(t,this._c):[].concat(n),r],o=wf(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=wf(t,a[e],i);s=Xu(n.top,s),c=Yu(n.right,c),l=Yu(n.bottom,l),u=Xu(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Df(e){let{width:t,height:n}=lf(e);return{width:t,height:n}}function Of(e,t,n){let r=Ud(t),i=Bd(t),a=n===`fixed`,o=hf(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=$u(0);if((r||!a)&&((Rd(t)!==`body`||Gd(i))&&(s=rf(t)),r)){let e=hf(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=gf(i));let l=i&&!r&&!a?_f(i,s):$u(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function kf(e){return nf(e).position===`static`}function Af(e,t){if(!Ud(e)||nf(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Bd(e)===n&&(n=n.ownerDocument.body),n}function jf(e,t){let n=zd(e);if(qd(e))return n;if(!Ud(e)){let t=af(e);for(;t&&!tf(t);){if(Hd(t)&&!kf(t))return t;t=af(t)}return n}let r=Af(e,t);for(;r&&Kd(r)&&kf(r);)r=Af(r,t);return r&&tf(r)&&kf(r)&&!Qd(r)?n:r||$d(e)||n}var Mf=async function(e){let t=this.getOffsetParent||jf,n=this.getDimensions,r=await n(e.floating);return{reference:Of(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Nf(e){return nf(e).direction===`rtl`}var Pf={convertOffsetParentRelativeRectToViewportRelativeRect:vf,getDocumentElement:Bd,getClippingRect:Ef,getOffsetParent:jf,getElementRects:Mf,getClientRects:yf,getDimensions:Df,getScale:df,isElement:Hd,isRTL:Nf};function Ff(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function If(e,t,n){let r=null,i,a=Bd(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Qu(d),h=Qu(a.clientWidth-(u+f)),g=Qu(a.clientHeight-(d+p)),_=Qu(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Xu(0,Yu(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ff(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=zd(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Lf(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=uf(e),u=i||a?[...l?sf(l):[],...t?sf(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?If(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?hf(e):null;c&&g();function g(){let t=hf(e);h&&!Ff(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Rf=Nd,zf=Pd,Bf=Dd,Vf=Id,Hf=Ad,Uf=Ed,Wf=Fd,Gf=(e,t,n)=>{let r=new Map,i=n??{},a={...Pf,...i.platform,_c:r};return Td(e,t,{...i,platform:a})};function Kf(e=0,t=0,n=0,r=0){if(typeof DOMRect==`function`)return new DOMRect(e,t,n,r);let i={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...i,toJSON:()=>i}}function qf(e){if(!e)return Kf();let{x:t,y:n,width:r,height:i}=e;return Kf(t,n,r,i)}function Jf(e,t){return{contextElement:Ai(e)?e:e?.contextElement,getBoundingClientRect:()=>{let n=e,r=t?.(n);return r||!n?qf(r):n.getBoundingClientRect()}}}var Yf=e=>({variable:e,reference:`var(${e})`}),Xf={arrowSize:Yf(`--arrow-size`),arrowSizeHalf:Yf(`--arrow-size-half`),arrowBg:Yf(`--arrow-background`),transformOrigin:Yf(`--transform-origin`),arrowOffset:Yf(`--arrow-offset`)},Zf=e=>e===`top`||e===`bottom`?`y`:`x`;function Qf(e,t){return{name:`transformOrigin`,fn(n){let{elements:r,middlewareData:i,placement:a,rects:o,y:s}=n,c=a.split(`-`)[0],l=Zf(c),u=i.arrow?.x||0,d=i.arrow?.y||0,f=t?.clientWidth||0,p=t?.clientHeight||0,m=u+f/2,h=d+p/2,g=Math.abs(i.shift?.y||0),_=o.reference.height/2,v=p/2,y=e.offset?.mainAxis??e.gutter,b=typeof y==`number`?y+v:y??v,x=g>b,S={top:`${m}px calc(100% + ${b}px)`,bottom:`${m}px ${-b}px`,left:`calc(100% + ${b}px) ${h}px`,right:`${-b}px ${h}px`}[c],C=`${m}px ${o.reference.y+_-s}px`,w=!!e.overlap&&l===`y`&&x;return r.floating.style.setProperty(Xf.transformOrigin.variable,w?C:S),{data:{transformOrigin:w?C:S}}}}}var $f={name:`rects`,fn({rects:e}){return{data:e}}},ep=e=>{if(e)return{name:`shiftArrow`,fn({placement:t,middlewareData:n}){if(!n.arrow)return{};let{x:r,y:i}=n.arrow,a=t.split(`-`)[0];return Object.assign(e.style,{left:r==null?``:`${r}px`,top:i==null?``:`${i}px`,[a]:`calc(100% + ${Xf.arrowOffset.reference})`}),{}}}};function tp(e){let[t,n]=e.split(`-`);return{side:t,align:n,hasAlign:n!=null}}function np(e){return e.split(`-`)[0]}var rp={strategy:`absolute`,placement:`bottom`,listeners:!0,restoreStyles:!1,applyStyles:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function ip(e,t){let n=e.devicePixelRatio||1;return Math.round(t*n)/n}function ap(e,t){return e!=null&&Math.abs(e-t)<.5}function op(e){return typeof e==`function`?e():e===`clipping-ancestors`?`clippingAncestors`:e}function sp(e,t,n){return Uf({element:e||t.createElement(`div`),padding:n.arrowPadding})}function cp(e,t){if(!er(t.offset??t.gutter))return Rf(({placement:n})=>{let r=(e?.clientHeight||0)/2,i=t.offset?.mainAxis??t.gutter,a=typeof i==`number`?i+r:i??r,{hasAlign:o}=tp(n),s=o?void 0:t.shift;return br({crossAxis:t.offset?.crossAxis??s,mainAxis:a,alignmentAxis:t.shift})})}function lp(e){if(e.flip)return Bf(()=>{let t=op(e.boundary);return{...t?{boundary:t}:void 0,padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip}})}function up(e){if(e.slide||e.overlap)return zf(()=>{let t=op(e.boundary);return{...t?{boundary:t}:void 0,mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:Wf()}})}function dp(e){if(e.sizeMiddleware===!1&&!e.sameWidth&&!e.fitViewport)return;let t,n,r,i;return Vf(()=>{let a=op(e.boundary);return{padding:e.overflowPadding,...a?{boundary:a}:void 0,apply({elements:e,rects:a,availableHeight:o,availableWidth:s}){let c=e.floating,l=Math.round(a.reference.width),u=Math.round(a.reference.height);s=Math.floor(s),o=Math.floor(o),ap(t,l)||(c.style.setProperty(`--reference-width`,`${l}px`),t=l),ap(n,u)||(c.style.setProperty(`--reference-height`,`${u}px`),n=u),ap(r,s)||(c.style.setProperty(`--available-width`,`${s}px`),r=s),ap(i,o)||(c.style.setProperty(`--available-height`,`${o}px`),i=o)}}})}function fp(e){if(e.hideWhenDetached)return Hf(()=>({strategy:`referenceHidden`,boundary:op(e.boundary)??`clippingAncestors`}))}function pp(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}var mp=[`transform`,`visibility`,`pointer-events`,`--x`,`--y`,`--z-index`,`--reference-width`,`--reference-height`,`--available-width`,`--available-height`,`--transform-origin`],hp=[`top`,`right`,`bottom`,`left`];function gp(e,t){if(!e)return ur;let n=new Map(t.map(t=>[t,e.style.getPropertyValue(t)]));return()=>{n.forEach((t,n)=>{t?e.style.setProperty(n,t):e.style.removeProperty(n)}),e.style.length===0&&e.removeAttribute(`style`)}}function _p(e){return e==null?null:Ai(e)?e:typeof e==`object`&&e&&`contextElement`in e&&e.contextElement?e.contextElement:e}function vp(e,t,n={}){let r=()=>(typeof t==`function`?t():t)??null,i=()=>{let t=typeof e==`function`?e():e;return n.getAnchorElement?.()??t},a=()=>{let e=i();return!e&&!n.getAnchorRect?null:Jf(e,n.getAnchorRect)},o=Object.assign({},rp,n),s=[],c=null,l,u;function d(e){l?.(),u?.(),c=e,l=o.restoreStyles?gp(e,mp):void 0;let t=e.querySelector(`[data-part=arrow]`);u=o.restoreStyles?gp(t,hp):void 0,s=[cp(t,o),lp(o),up(o),sp(t,e.ownerDocument,o),ep(t),Qf({gutter:o.gutter,offset:o.offset,overlap:o.overlap},t),dp(o),fp(o),$f]}let{placement:f,strategy:p,onComplete:m,onPositioned:h}=o,g,_,v=!1,y,b,x=ur,S=pp(o.listeners);function C(){if(!o.listeners)return;let e=i(),t=a(),n=r();t&&n&&(_p(e)!==_p(y)||n!==b)&&(x(),y=e,b=n,x=Lf(t,n,T,S))}async function w(){C();let e=r();if(!e)return;e!==c&&(d(e),v=!1);let t=a();if(!t)return;let n=await Gf(t,e,{placement:f,middleware:s,strategy:p}),i=Ji(e),l=ip(i,n.x),u=ip(i,n.y);if(m?.({...n,x:l,y:u}),o.applyStyles!==!1&&(ap(g,l)||(e.style.setProperty(`--x`,`${l}px`),g=l),ap(_,u)||(e.style.setProperty(`--y`,`${u}px`),_=u),o.hideWhenDetached&&(n.middlewareData.hide?.referenceHidden?(e.style.setProperty(`visibility`,`hidden`),e.style.setProperty(`pointer-events`,`none`)):(e.style.removeProperty(`visibility`),e.style.removeProperty(`pointer-events`))),!v)){let t=e.firstElementChild;t&&(e.style.setProperty(`--z-index`,$i(t).zIndex),v=!0)}}async function T(){n.updatePosition?(await n.updatePosition({updatePosition:w,floatingElement:r()}),h?.({placed:!0})):await w()}return T(),()=>{x(),u?.(),l?.(),h?.({placed:!1})}}function yp(e,t,n={}){let{defer:r,...i}=n,a=r?So:e=>e(),o=[];return o.push(a(()=>{o.push(vp(e,t,i))})),()=>{o.forEach(e=>e?.())}}var bp={bottom:`rotate(45deg)`,left:`rotate(135deg)`,top:`rotate(225deg)`,right:`rotate(315deg)`};function xp(e={}){let{placement:t,sameWidth:n,fitViewport:r,strategy:i=`absolute`}=e;return{arrow:{position:`absolute`,width:Xf.arrowSize.reference,height:Xf.arrowSize.reference,[Xf.arrowSizeHalf.variable]:`calc(${Xf.arrowSize.reference} / 2)`,[Xf.arrowOffset.variable]:`calc(${Xf.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?bp[t.split(`-`)[0]]:void 0,background:Xf.arrowBg.reference,top:`0`,left:`0`,width:`100%`,height:`100%`,position:`absolute`,zIndex:`inherit`},floating:{position:i,isolation:`isolate`,minWidth:n?void 0:`max-content`,width:n?`var(--reference-width)`:void 0,maxWidth:r?`var(--available-width)`:void 0,maxHeight:r?`var(--available-height)`:void 0,pointerEvents:t?void 0:`none`,top:`0px`,left:`0px`,transform:t?`translate3d(var(--x), var(--y), 0)`:`translate3d(0, -100vh, 0)`,zIndex:`var(--z-index)`}}}var Sp=qu.extendWith(`view`),Cp=V(`combobox`).parts(`root`,`clearTrigger`,`content`,`control`,`input`,`item`,`itemGroup`,`itemGroupLabel`,`itemIndicator`,`itemText`,`label`,`list`,`positioner`,`trigger`);Cp.build();var wp=Object.defineProperty,Tp=(e,t,n)=>t in e?wp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U=(e,t,n)=>Tp(e,typeof t==`symbol`?t:t+``,n),Ep={itemToValue(e){return typeof e==`string`?e:Zn(e)&&tr(e,`value`)?e.value:``},itemToString(e){return typeof e==`string`?e:Zn(e)&&tr(e,`label`)?e.label:Ep.itemToValue(e)},isItemDisabled(e){return Zn(e)&&tr(e,`disabled`)?!!e.disabled:!1}},Dp=class e{constructor(t){U(this,`options`,t),U(this,`items`),U(this,`indexMap`,null),U(this,`copy`,t=>new e({...this.options,items:t??[...this.items]})),U(this,`isEqual`,e=>Jn(this.items,e.items)),U(this,`setItems`,e=>this.copy(e)),U(this,`getValues`,(e=this.items)=>{let t=[];for(let n of e){let e=this.getItemValue(n);e!=null&&t.push(e)}return t}),U(this,`find`,e=>{if(e==null)return null;let t=this.indexOf(e);return t===-1?null:this.at(t)}),U(this,`findMany`,e=>{let t=[];for(let n of e){let e=this.find(n);e!=null&&t.push(e)}return t}),U(this,`at`,e=>{if(!this.options.groupBy&&!this.options.groupSort)return this.items[e]??null;let t=0,n=this.group();for(let[,r]of n)for(let n of r){if(t===e)return n;t++}return null}),U(this,`sortFn`,(e,t)=>{let n=this.indexOf(e),r=this.indexOf(t);return(n??0)-(r??0)}),U(this,`sort`,e=>[...e].sort(this.sortFn.bind(this))),U(this,`getItemValue`,e=>e==null?null:this.options.itemToValue?.(e)??Ep.itemToValue(e)),U(this,`getItemDisabled`,e=>e==null?!1:this.options.isItemDisabled?.(e)??Ep.isItemDisabled(e)),U(this,`stringifyItem`,e=>e==null?null:this.options.itemToString?.(e)??Ep.itemToString(e)),U(this,`stringify`,e=>e==null?null:this.stringifyItem(this.find(e))),U(this,`stringifyItems`,(e,t=`, `)=>{let n=[];for(let t of e){let e=this.stringifyItem(t);e!=null&&n.push(e)}return n.join(t)}),U(this,`stringifyMany`,(e,t)=>this.stringifyItems(this.findMany(e),t)),U(this,`has`,e=>this.indexOf(e)!==-1),U(this,`hasItem`,e=>e!=null&&this.has(this.getItemValue(e))),U(this,`group`,()=>{let{groupBy:e,groupSort:t}=this.options;if(!e)return[[``,[...this.items]]];let n=new Map;this.items.forEach((t,r)=>{let i=e(t,r);n.has(i)||n.set(i,[]),n.get(i).push(t)});let r=Array.from(n.entries());return t&&r.sort(([e],[n])=>{if(typeof t==`function`)return t(e,n);if(Array.isArray(t)){let r=t.indexOf(e),i=t.indexOf(n);return r===-1?1:i===-1?-1:r-i}return t===`asc`?e.localeCompare(n):t===`desc`?n.localeCompare(e):0}),r}),U(this,`getNextValue`,(e,t=1,n=!1)=>{let r=this.indexOf(e);if(r===-1)return null;for(r=n?Math.min(r+t,this.size-1):r+t;r<=this.size&&this.getItemDisabled(this.at(r));)r++;return this.getItemValue(this.at(r))}),U(this,`getPreviousValue`,(e,t=1,n=!1)=>{let r=this.indexOf(e);if(r===-1)return null;for(r=n?Math.max(r-t,0):r-t;r>=0&&this.getItemDisabled(this.at(r));)r--;return this.getItemValue(this.at(r))}),U(this,`indexOf`,e=>{if(e==null)return-1;if(!this.options.groupBy&&!this.options.groupSort)return this.items.findIndex(t=>this.getItemValue(t)===e);if(!this.indexMap){this.indexMap=new Map;let e=0,t=this.group();for(let[,n]of t)for(let t of n){let n=this.getItemValue(t);n!=null&&this.indexMap.set(n,e),e++}}return this.indexMap.get(e)??-1}),U(this,`getByText`,(e,t)=>{let n=t==null?-1:this.indexOf(t),r=e.length===1;for(let i=0;i<this.items.length;i++){let a=this.items[(n+i+1)%this.items.length];if(!(r&&this.getItemValue(a)===t)&&!this.getItemDisabled(a)&&Op(this.stringifyItem(a),e))return a}}),U(this,`search`,(e,t)=>{let{state:n,currentValue:r,timeout:i=350}=t,a=n.keysSoFar+e,o=a.length>1&&Array.from(a).every(e=>e===a[0])?a[0]:a,s=this.getByText(o,r),c=this.getItemValue(s);function l(){clearTimeout(n.timer),n.timer=-1}function u(e){n.keysSoFar=e,l(),e!==``&&(n.timer=+setTimeout(()=>{u(``),l()},i))}return u(a),c}),U(this,`update`,(e,t)=>{let n=this.indexOf(e);return n===-1?this:this.copy([...this.items.slice(0,n),t,...this.items.slice(n+1)])}),U(this,`upsert`,(e,t,n=`append`)=>{let r=this.indexOf(e);return r===-1?(n===`append`?this.append:this.prepend)(t):this.copy([...this.items.slice(0,r),t,...this.items.slice(r+1)])}),U(this,`insert`,(e,...t)=>this.copy(kp(this.items,e,...t))),U(this,`insertBefore`,(e,...t)=>{let n=this.indexOf(e);if(n===-1){if(this.items.length===0)n=0;else return this}return this.copy(kp(this.items,n,...t))}),U(this,`insertAfter`,(e,...t)=>{let n=this.indexOf(e);if(n===-1){if(this.items.length===0)n=0;else return this}return this.copy(kp(this.items,n+1,...t))}),U(this,`prepend`,(...e)=>this.copy(kp(this.items,0,...e))),U(this,`append`,(...e)=>this.copy(kp(this.items,this.items.length,...e))),U(this,`filter`,e=>{let t=this.items.filter((t,n)=>e(this.stringifyItem(t),n,t));return this.copy(t)}),U(this,`remove`,(...e)=>{let t=e.map(e=>typeof e==`string`?e:this.getItemValue(e));return this.copy(this.items.filter(e=>{let n=this.getItemValue(e);return n!=null&&!t.includes(n)}))}),U(this,`move`,(e,t)=>{let n=this.indexOf(e);return n===-1?this:this.copy(Ap(this.items,[n],t))}),U(this,`moveBefore`,(e,...t)=>{let n=this.items.findIndex(t=>this.getItemValue(t)===e);if(n===-1)return this;let r=t.map(e=>this.items.findIndex(t=>this.getItemValue(t)===e)).sort((e,t)=>e-t);return this.copy(Ap(this.items,r,n))}),U(this,`moveAfter`,(e,...t)=>{let n=this.items.findIndex(t=>this.getItemValue(t)===e);if(n===-1)return this;let r=t.map(e=>this.items.findIndex(t=>this.getItemValue(t)===e)).sort((e,t)=>e-t);return this.copy(Ap(this.items,r,n+1))}),U(this,`reorder`,(e,t)=>this.copy(Ap(this.items,[e],t))),U(this,`compareValue`,(e,t)=>{let n=this.indexOf(e),r=this.indexOf(t);return n<r?-1:+(n>r)}),U(this,`range`,(e,t)=>{let n=[],r=e;for(;r!=null;){if(this.find(r)&&n.push(r),r===t)return n;r=this.getNextValue(r)}return[]}),U(this,`getValueRange`,(e,t)=>e&&t?this.compareValue(e,t)<=0?this.range(e,t):this.range(t,e):[]),U(this,`toString`,()=>{let e=``;for(let t of this.items){let n=[this.getItemValue(t),this.stringifyItem(t),this.getItemDisabled(t)].filter(Boolean).join(`:`);e+=n+`,`}return e}),U(this,`toJSON`,()=>({size:this.size,first:this.firstValue,last:this.lastValue})),this.items=[...t.items]}get size(){return this.items.length}get firstValue(){let e=0;for(;this.getItemDisabled(this.at(e));)e++;return this.getItemValue(this.at(e))}get lastValue(){let e=this.size-1;for(;this.getItemDisabled(this.at(e));)e--;return this.getItemValue(this.at(e))}*[Symbol.iterator](){yield*this.items}},Op=(e,t)=>!!e?.toLowerCase().startsWith(t.toLowerCase());function kp(e,t,...n){return[...e.slice(0,t),...n,...e.slice(t)]}function Ap(e,t,n){t=[...t].sort((e,t)=>e-t);let r=t.map(t=>e[t]);for(let n=t.length-1;n>=0;n--)e=[...e.slice(0,t[n]),...e.slice(t[n]+1)];return n=Math.max(0,n-t.filter(e=>e<n).length),[...e.slice(0,n),...r,...e.slice(n)]}function jp({values:e,collection:t,selectedItemMap:n}){let r=[];for(let i of e){let e=t.find(i)??n.get(i);e!=null&&r.push(e)}return r}function Mp({selectedItemMap:e,values:t,selectedItems:n,collection:r}){let i=new Map(e);for(let e of n){let t=r.getItemValue(e);t!=null&&i.set(t,e)}let a=new Set(t);for(let e of i.keys())a.has(e)||i.delete(e);return i}function Np({values:e,collection:t,selectedItemMap:n}){let r=jp({values:e,collection:t,selectedItemMap:n});return{selectedItems:r,nextSelectedItemMap:Mp({selectedItemMap:n,values:e,selectedItems:r,collection:t})}}function Pp({selectedItems:e,collection:t}){return Mp({selectedItemMap:new Map,values:e.map(e=>t.getItemValue(e)).filter(Boolean),selectedItems:e,collection:t})}var Fp=Cp.extendWith(`empty`),Ip=V(`date-input`).parts(`root`,`label`,`control`,`segmentGroup`,`segment`,`hiddenInput`);Ip.build();var Lp=V(`date-picker`).parts(`clearTrigger`,`content`,`control`,`input`,`label`,`monthSelect`,`nextTrigger`,`positioner`,`presetTrigger`,`prevTrigger`,`rangeText`,`root`,`table`,`tableBody`,`tableCell`,`tableCellTrigger`,`tableHead`,`tableHeader`,`tableRow`,`trigger`,`view`,`viewControl`,`viewTrigger`,`yearSelect`);Lp.build();var Rp=Lp.extendWith(`view`,`valueText`),zp=V(`dialog`).parts(`trigger`,`backdrop`,`positioner`,`content`,`title`,`description`,`closeTrigger`),Bp=zp.build(),Vp=e=>e.ids?.positioner??`dialog:${e.id}:positioner`,Hp=e=>e.ids?.backdrop??`dialog:${e.id}:backdrop`,Up=e=>e.ids?.content??`dialog:${e.id}:content`,Wp=(e,t)=>{let n=e.ids?.trigger;return n==null?t?`dialog:${e.id}:trigger:${t}`:`dialog:${e.id}:trigger`:$n(n)?n(t):n},Gp=e=>e.ids?.title??`dialog:${e.id}:title`,Kp=e=>e.ids?.description??`dialog:${e.id}:description`,qp=e=>e.ids?.closeTrigger??`dialog:${e.id}:close`,Jp=e=>e.getById(Up(e)),Yp=e=>e.getById(Vp(e)),Xp=e=>e.getById(Hp(e)),Zp=e=>e.getById(Wp(e)),Qp=e=>e.getById(Gp(e)),$p=e=>e.getById(Kp(e)),em=e=>e.getById(qp(e)),tm=e=>Ho(e.getRootNode(),`[data-scope="dialog"][data-part="trigger"]${Ti(e.id)}`),nm=(e,t)=>t==null?Zp(e)??tm(e)[0]:e.getById(Wp(e,t));function rm(e,t){let{state:n,send:r,context:i,prop:a,scope:o}=e,s=a(`aria-label`),c=n.matches(`open`),l=i.get(`triggerValue`);return{open:c,setOpen(e){n.matches(`open`)!==e&&r({type:e?`OPEN`:`CLOSE`})},triggerValue:l,setTriggerValue(e){r({type:`TRIGGER_VALUE.SET`,value:e})},getTriggerProps(e={}){let{value:n}=e,i=n!=null&&l===n;return t.button({...Bp.trigger.attrs,dir:a(`dir`),id:Wp(o,n),"data-ownedby":o.id,"data-value":n,"aria-haspopup":`dialog`,type:`button`,"aria-expanded":n==null?c:c&&i,"data-state":c?`open`:`closed`,"aria-controls":Up(o),"data-current":z(i),onClick(e){e.defaultPrevented||r({type:c&&n!=null&&!i?`TRIGGER_VALUE.SET`:`TOGGLE`,value:n})}})},getBackdropProps(){return t.element({...Bp.backdrop.attrs,dir:a(`dir`),hidden:!c,id:Hp(o),"data-state":c?`open`:`closed`})},getPositionerProps(){return t.element({...Bp.positioner.attrs,dir:a(`dir`),id:Vp(o),style:br({pointerEvents:!c||!a(`modal`)?`none`:void 0})})},getContentProps(){let e=i.get(`rendered`);return t.element({...Bp.content.attrs,dir:a(`dir`),role:a(`role`),hidden:!c,id:Up(o),tabIndex:-1,"data-state":c?`open`:`closed`,"aria-modal":a(`modal`),"aria-label":s||void 0,"aria-labelledby":s||!e.title?void 0:Gp(o),"aria-describedby":e.description?Kp(o):void 0,style:br({pointerEvents:a(`modal`)?void 0:`auto`})})},getTitleProps(){return t.element({...Bp.title.attrs,dir:a(`dir`),id:Gp(o)})},getDescriptionProps(){return t.element({...Bp.description.attrs,dir:a(`dir`),id:Kp(o)})},getCloseTriggerProps(){return t.button({...Bp.closeTrigger.attrs,dir:a(`dir`),id:qp(o),type:`button`,onClick(e){e.defaultPrevented||(e.stopPropagation(),r({type:`CLOSE`}))}})}}}var im=ui({props({props:e,scope:t}){let n=e.role===`alertdialog`,r=n?()=>em(t):void 0,i=typeof e.modal!=`boolean`||e.modal;return{role:`dialog`,modal:i,trapFocus:i,preventScroll:i,closeOnInteractOutside:i&&!n,closeOnEscape:!0,restoreFocus:!0,initialFocusEl:r,...e}},initialState({prop:e}){return e(`open`)||e(`defaultOpen`)?`open`:`closed`},context({bindable:e,prop:t,scope:n}){return{rendered:e(()=>({defaultValue:{title:!0,description:!0}})),triggerValue:e(()=>({defaultValue:t(`defaultTriggerValue`)??null,value:t(`triggerValue`),onChange(e){let r=t(`onTriggerValueChange`);r&&r({value:e,triggerElement:nm(n,e)})}}))}},watch({track:e,action:t,prop:n}){e([()=>n(`open`)],()=>{t([`toggleVisibility`])})},states:{open:{entry:[`checkRenderedElements`,`setInitialFocus`],effects:[`trackDismissableElement`,`trapFocus`,`preventScroll`,`hideContentBelow`],on:{"CONTROLLED.CLOSE":{target:`closed`},CLOSE:[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{target:`closed`,actions:[`invokeOnClose`]}],TOGGLE:[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{target:`closed`,actions:[`invokeOnClose`]}],"TRIGGER_VALUE.SET":{actions:[`setTriggerValue`]}}},closed:{on:{"CONTROLLED.OPEN":{target:`open`},OPEN:[{guard:`isOpenControlled`,actions:[`invokeOnOpen`,`setTriggerValue`]},{target:`open`,actions:[`invokeOnOpen`,`setTriggerValue`]}],TOGGLE:[{guard:`isOpenControlled`,actions:[`invokeOnOpen`,`setTriggerValue`]},{target:`open`,actions:[`invokeOnOpen`,`setTriggerValue`]}],"TRIGGER_VALUE.SET":{actions:[`setTriggerValue`]}}}},implementations:{guards:{isOpenControlled:({prop:e})=>e(`open`)!=null},effects:{trackDismissableElement({scope:e,send:t,prop:n}){return Il(()=>Jp(e),{type:`dialog`,defer:!0,pointerBlocking:n(`modal`),layerStyleTargets:[()=>Xp(e),()=>Yp(e)],exclude:[Zp(e),...tm(e)].filter(Boolean),onInteractOutside(e){n(`onInteractOutside`)?.(e),n(`closeOnInteractOutside`)||e.preventDefault()},persistentElements:n(`persistentElements`),onFocusOutside:n(`onFocusOutside`),onPointerDownOutside:n(`onPointerDownOutside`),onRequestDismiss:n(`onRequestDismiss`),onEscapeKeyDown(e){n(`onEscapeKeyDown`)?.(e),n(`closeOnEscape`)||e.preventDefault()},onDismiss(){t({type:`CLOSE`,src:`interact-outside`})}})},preventScroll({scope:e,prop:t}){if(t(`preventScroll`))return iu(e.getDoc())},trapFocus({scope:e,prop:t,context:n}){return t(`trapFocus`)?Zl(()=>Jp(e),{preventScroll:!0,returnFocusOnDeactivate:!!t(`restoreFocus`),initialFocus:()=>yo({root:Jp(e),getInitialEl:t(`initialFocusEl`)}),setReturnFocus:r=>{let i=t(`finalFocusEl`)?.();if(i)return i;let a=n.get(`triggerValue`);if(a){let t=nm(e,a);if(t)return t}return tm(e)[0]||r},getShadowRoot:!0}):void 0},hideContentBelow({scope:e,prop:t}){return t(`modal`)?sl(()=>[Jp(e)],{defer:!0}):void 0}},actions:{setInitialFocus({prop:e,scope:t}){e(`trapFocus`)||So(()=>{yo({root:Jp(t),getInitialEl:e(`initialFocusEl`)})?.focus({preventScroll:!0})})},checkRenderedElements({context:e,scope:t}){So(()=>{e.set(`rendered`,{title:!!Qp(t),description:!!$p(t)})})},invokeOnClose({prop:e}){e(`onOpenChange`)?.({open:!1})},invokeOnOpen({prop:e}){e(`onOpenChange`)?.({open:!0})},setTriggerValue({context:e,event:t}){t.value!==void 0&&e.set(`triggerValue`,t.value)},toggleVisibility({prop:e,send:t,event:n}){t({type:e(`open`)?`CONTROLLED.OPEN`:`CONTROLLED.CLOSE`,previousEvent:n})}}}}),am=V(`editable`).parts(`root`,`area`,`label`,`preview`,`input`,`editTrigger`,`submitTrigger`,`cancelTrigger`,`control`);am.build();var om=V(`field`).parts(`root`,`errorText`,`helperText`,`input`,`label`,`select`,`textarea`,`requiredIndicator`),sm=om.build(),cm=V(`fieldset`).parts(`root`,`errorText`,`helperText`,`legend`);cm.build();var lm=V(`file-upload`).parts(`root`,`dropzone`,`item`,`itemDeleteTrigger`,`itemGroup`,`itemName`,`itemPreview`,`itemPreviewImage`,`itemSizeText`,`label`,`trigger`,`clearTrigger`);lm.build();var um=V(`floating-panel`).parts(`trigger`,`positioner`,`content`,`header`,`body`,`title`,`resizeTrigger`,`dragTrigger`,`stageTrigger`,`closeTrigger`,`control`);um.build();var dm=V(`hoverCard`).parts(`arrow`,`arrowTip`,`trigger`,`positioner`,`content`);dm.build();var fm=V(`listbox`).parts(`label`,`input`,`item`,`itemText`,`itemIndicator`,`itemGroup`,`itemGroupLabel`,`content`,`root`,`valueText`);fm.build();var pm=fm.extendWith(`empty`),mm=V(`marquee`).parts(`root`,`viewport`,`content`,`edge`,`item`);mm.build();var hm=V(`menu`).parts(`arrow`,`arrowTip`,`content`,`contextTrigger`,`indicator`,`item`,`itemGroup`,`itemGroupLabel`,`itemIndicator`,`itemText`,`positioner`,`separator`,`trigger`,`triggerItem`);hm.build();var gm=V(`numberInput`).parts(`root`,`label`,`input`,`control`,`valueText`,`incrementTrigger`,`decrementTrigger`,`scrubber`);gm.build();var _m=V(`pinInput`).parts(`root`,`label`,`input`,`control`);_m.build();var vm=V(`popover`).parts(`arrow`,`arrowTip`,`anchor`,`trigger`,`indicator`,`positioner`,`content`,`title`,`description`,`closeTrigger`);vm.build();var ym=V(`progress`).parts(`root`,`label`,`track`,`range`,`valueText`,`view`,`circle`,`circleTrack`,`circleRange`);ym.build();var bm=V(`qr-code`).parts(`root`,`frame`,`pattern`,`overlay`,`downloadTrigger`);bm.build();var xm=V(`radio-group`).parts(`root`,`label`,`item`,`itemText`,`itemControl`,`indicator`);xm.build();var Sm=V(`rating-group`).parts(`root`,`label`,`item`,`control`);Sm.build();var Cm=V(`scroll-area`).parts(`root`,`viewport`,`content`,`scrollbar`,`thumb`,`corner`);Cm.build();var wm=xm.rename(`segment-group`);wm.build();var Tm=V(`select`).parts(`label`,`positioner`,`trigger`,`indicator`,`clearTrigger`,`item`,`itemText`,`itemIndicator`,`itemGroup`,`itemGroupLabel`,`list`,`content`,`root`,`control`,`valueText`),Em=Tm.build(),Dm=e=>new Dp(e);Dm.empty=()=>new Dp({items:[]});var Om=e=>e.ids?.root??`select:${e.id}`,km=e=>e.ids?.content??`select:${e.id}:content`,Am=e=>e.ids?.trigger??`select:${e.id}:trigger`,jm=e=>e.ids?.clearTrigger??`select:${e.id}:clear-trigger`,Mm=e=>e.ids?.label??`select:${e.id}:label`,Nm=e=>e.ids?.control??`select:${e.id}:control`,Pm=(e,t)=>e.ids?.item?.(t)??`select:${e.id}:option:${t}`,Fm=e=>e.ids?.hiddenSelect??`select:${e.id}:select`,Im=e=>e.ids?.positioner??`select:${e.id}:positioner`,Lm=(e,t)=>e.ids?.itemGroup?.(t)??`select:${e.id}:optgroup:${t}`,Rm=(e,t)=>e.ids?.itemGroupLabel?.(t)??`select:${e.id}:optgroup-label:${t}`,zm=e=>e.getById(Fm(e)),Bm=e=>e.getById(km(e)),Vm=e=>e.getById(Am(e)),Hm=e=>e.getById(jm(e)),Um=e=>e.getById(Im(e)),Wm=(e,t)=>t==null?null:e.getById(Pm(e,t)),Gm={clearTriggerLabel:`Clear value`};function Km(e,t){let{context:n,prop:r,scope:i,state:a,computed:o,send:s}=e,c=xr(Gm,r(`translations`)),l=r(`disabled`)||n.get(`fieldsetDisabled`),u=!!r(`invalid`),d=!!r(`required`),f=!!r(`readOnly`),p=r(`composite`),m=r(`collection`),h=a.hasTag(`open`),g=a.matches(`focused`),_=n.get(`highlightedValue`),v=n.get(`highlightedItem`),y=o(`selectedItems`),b=n.get(`currentPlacement`),x=b?np(b):void 0,S=o(`isTypingAhead`),C=o(`isInteractive`),w=_?Pm(i,_):void 0;function T(e){let t=m.getItemDisabled(e.item),r=m.getItemValue(e.item);return Or(r,()=>`[zag-js] No value found for item ${JSON.stringify(e.item)}`),{value:r,disabled:!!(l||t),highlighted:_===r,selected:n.get(`value`).includes(r)}}let E=xp({...r(`positioning`),placement:b});return{open:h,focused:g,empty:n.get(`value`).length===0,highlightedItem:v,highlightedValue:_,selectedItems:y,hasSelectedItems:o(`hasSelectedItems`),value:n.get(`value`),valueAsString:o(`valueAsString`),collection:m,multiple:!!r(`multiple`),disabled:!!l,reposition(e={}){s({type:`POSITIONING.SET`,options:e})},focus(){Vm(i)?.focus({preventScroll:!0})},setOpen(e){a.hasTag(`open`)!==e&&s({type:e?`OPEN`:`CLOSE`})},selectValue(e){s({type:`ITEM.SELECT`,value:e})},setValue(e){s({type:`VALUE.SET`,value:e})},selectAll(){s({type:`VALUE.SET`,value:m.getValues()})},setHighlightValue(e){s({type:`HIGHLIGHTED_VALUE.SET`,value:e})},clearHighlightValue(){s({type:`HIGHLIGHTED_VALUE.CLEAR`})},clearValue(e){s(e?{type:`ITEM.CLEAR`,value:e}:{type:`VALUE.CLEAR`})},getItemState:T,getRootProps(){return t.element({...Em.root.attrs,dir:r(`dir`),id:Om(i),"data-invalid":z(u),"data-readonly":z(f)})},getLabelProps(){return t.label({dir:r(`dir`),id:Mm(i),...Em.label.attrs,"data-disabled":z(l),"data-invalid":z(u),"data-readonly":z(f),"data-required":z(d),htmlFor:Fm(i),onClick(e){e.defaultPrevented||l||Vm(i)?.focus({preventScroll:!0})}})},getControlProps(){return t.element({...Em.control.attrs,dir:r(`dir`),id:Nm(i),"data-state":h?`open`:`closed`,"data-focus":z(g),"data-disabled":z(l),"data-invalid":z(u)})},getValueTextProps(){return t.element({...Em.valueText.attrs,dir:r(`dir`),"data-disabled":z(l),"data-invalid":z(u),"data-focus":z(g)})},getTriggerProps(){return t.button({id:Am(i),disabled:l,dir:r(`dir`),type:`button`,role:`combobox`,"aria-controls":km(i),"aria-expanded":h,"aria-haspopup":`listbox`,"data-state":h?`open`:`closed`,"aria-invalid":u,"aria-required":d,"aria-labelledby":Mm(i),...Em.trigger.attrs,"data-disabled":z(l),"data-invalid":z(u),"data-readonly":z(f),"data-placement":b,"data-side":x,"data-placeholder-shown":z(!o(`hasSelectedItems`)),onClick(e){C&&(e.defaultPrevented||s({type:`TRIGGER.CLICK`}))},onFocus(){s({type:`TRIGGER.FOCUS`})},onBlur(){s({type:`TRIGGER.BLUR`})},onKeyDown(e){if(e.defaultPrevented||!C)return;let t={ArrowUp(){s({type:`TRIGGER.ARROW_UP`})},ArrowDown(e){s({type:e.altKey?`OPEN`:`TRIGGER.ARROW_DOWN`})},ArrowLeft(){s({type:`TRIGGER.ARROW_LEFT`})},ArrowRight(){s({type:`TRIGGER.ARROW_RIGHT`})},Home(){s({type:`TRIGGER.HOME`})},End(){s({type:`TRIGGER.END`})},Enter(){s({type:`TRIGGER.ENTER`})},Space(e){s(S?{type:`TRIGGER.TYPEAHEAD`,key:e.key}:{type:`TRIGGER.ENTER`})}}[Ha(e,{dir:r(`dir`),orientation:`vertical`})];if(t){t(e),e.preventDefault();return}os.isValidEvent(e)&&(s({type:`TRIGGER.TYPEAHEAD`,key:e.key}),e.preventDefault())}})},getIndicatorProps(){return t.element({...Em.indicator.attrs,dir:r(`dir`),"aria-hidden":!0,"data-state":h?`open`:`closed`,"data-disabled":z(l),"data-invalid":z(u),"data-readonly":z(f)})},getItemProps(e){let n=T(e);return t.element({id:Pm(i,n.value),role:`option`,...Em.item.attrs,dir:r(`dir`),"data-value":n.value,"aria-selected":n.selected,"data-state":n.selected?`checked`:`unchecked`,"data-highlighted":z(n.highlighted),"data-disabled":z(n.disabled),"aria-disabled":xi(n.disabled),onPointerMove(e){n.disabled||e.pointerType!==`mouse`||ku()===`pointer`&&n.value!==_&&s({type:`ITEM.POINTER_MOVE`,value:n.value})},onClick(e){e.defaultPrevented||n.disabled||s({type:`ITEM.CLICK`,src:`pointerup`,value:n.value})},onPointerLeave(t){n.disabled||e.persistFocus||t.pointerType===`mouse`&&ku()===`pointer`&&s({type:`ITEM.POINTER_LEAVE`})}})},getItemTextProps(e){let n=T(e);return t.element({...Em.itemText.attrs,"data-state":n.selected?`checked`:`unchecked`,"data-disabled":z(n.disabled),"data-highlighted":z(n.highlighted)})},getItemIndicatorProps(e){let n=T(e);return t.element({"aria-hidden":!0,...Em.itemIndicator.attrs,"data-state":n.selected?`checked`:`unchecked`,hidden:!n.selected})},getItemGroupLabelProps(e){let{htmlFor:n}=e;return t.element({...Em.itemGroupLabel.attrs,id:Rm(i,n),dir:r(`dir`),role:`presentation`})},getItemGroupProps(e){let{id:n}=e;return t.element({...Em.itemGroup.attrs,"data-disabled":z(l),id:Lm(i,n),"aria-labelledby":Rm(i,n),role:`group`,dir:r(`dir`)})},getClearTriggerProps(){return t.button({...Em.clearTrigger.attrs,id:jm(i),type:`button`,"aria-label":c.clearTriggerLabel,"data-invalid":z(u),disabled:l,hidden:!o(`hasSelectedItems`),dir:r(`dir`),onClick(e){e.defaultPrevented||s({type:`CLEAR.CLICK`})}})},getHiddenSelectProps(){let e=n.get(`value`),a=r(`multiple`)?e:e?.[0],o=e=>{eo(Ua(e))||s({type:`VALUE.SET`,value:qm(e.currentTarget)})};return t.select({name:r(`name`),form:r(`form`),disabled:l,multiple:r(`multiple`),required:r(`required`),"aria-hidden":!0,id:Fm(i),defaultValue:a,style:cs,tabIndex:-1,autoComplete:r(`autoComplete`),onChange:o,onInput:o,onFocus(){Vm(i)?.focus({preventScroll:!0})},"aria-labelledby":Mm(i)})},getPositionerProps(){return t.element({...Em.positioner.attrs,dir:r(`dir`),id:Im(i),style:E.floating})},getContentProps(){return t.element({hidden:!h,dir:r(`dir`),id:km(i),role:p?`listbox`:`dialog`,...Em.content.attrs,"data-state":h?`open`:`closed`,"data-placement":b,"data-side":x,"data-activedescendant":w,"aria-activedescendant":p?w:void 0,"aria-multiselectable":r(`multiple`)&&p?!0:void 0,"aria-labelledby":Mm(i),tabIndex:0,onKeyDown(e){if(!C||!Gi(e.currentTarget,Ma(e)))return;if(e.key===`Tab`&&!bo(e)){e.preventDefault();return}let t={ArrowUp(){s({type:`CONTENT.ARROW_UP`})},ArrowDown(){s({type:`CONTENT.ARROW_DOWN`})},Home(){s({type:`CONTENT.HOME`})},End(){s({type:`CONTENT.END`})},Enter(){s({type:`ITEM.CLICK`,src:`keydown.enter`})},Space(e){S?s({type:`CONTENT.TYPEAHEAD`,key:e.key}):t.Enter?.(e)}},n=t[Ha(e)];if(n){n(e),e.preventDefault();return}Hi(Ma(e))||os.isValidEvent(e)&&(s({type:`CONTENT.TYPEAHEAD`,key:e.key}),e.preventDefault())}})},getListProps(){return t.element({...Em.list.attrs,tabIndex:0,role:p?void 0:`listbox`,"aria-labelledby":Am(i),"aria-activedescendant":p?void 0:w,"aria-multiselectable":!p&&r(`multiple`)?!0:void 0})}}}var qm=e=>e.multiple?Array.from(e.selectedOptions,e=>e.value):e.value?[e.value]:[],{and:Jm,not:Ym,or:Xm}=li(),Zm=ui({props({props:e}){return{loopFocus:!1,closeOnSelect:!e.multiple,composite:!0,defaultValue:[],...e,collection:e.collection??Dm.empty(),positioning:{placement:`bottom-start`,gutter:8,...e.positioning}}},context({prop:e,bindable:t,getContext:n}){let r=e(`value`)??e(`defaultValue`)??[],i=e(`collection`).findMany(r);return{value:t(()=>({defaultValue:e(`defaultValue`),value:e(`value`),isEqual:Jn,onChange(t){let r=n(),i=e(`collection`),a=Np({values:t,collection:i,selectedItemMap:r.get(`selectedItemMap`)}),o=e(`value`)??t,s=o===t?a:Np({values:o,collection:i,selectedItemMap:a.nextSelectedItemMap});return r.set(`selectedItemMap`,s.nextSelectedItemMap),e(`onValueChange`)?.({value:t,items:a.selectedItems})}})),highlightedValue:t(()=>({defaultValue:e(`defaultHighlightedValue`)||null,value:e(`highlightedValue`),onChange(t){e(`onHighlightChange`)?.({highlightedValue:t,highlightedItem:e(`collection`).find(t),highlightedIndex:e(`collection`).indexOf(t)})}})),currentPlacement:t(()=>({defaultValue:void 0})),fieldsetDisabled:t(()=>({defaultValue:!1})),highlightedItem:t(()=>({defaultValue:null})),selectedItemMap:t(()=>({defaultValue:Pp({selectedItems:i,collection:e(`collection`)})}))}},refs(){return{typeahead:{...os.defaultOptions}}},computed:{hasSelectedItems:({context:e})=>e.get(`value`).length>0,isTypingAhead:({refs:e})=>e.get(`typeahead`).keysSoFar!==``,isDisabled:({prop:e,context:t})=>!!e(`disabled`)||!!t.get(`fieldsetDisabled`),isInteractive:({prop:e})=>!(e(`disabled`)||e(`readOnly`)),selectedItems:({context:e,prop:t})=>jp({values:e.get(`value`),collection:t(`collection`),selectedItemMap:e.get(`selectedItemMap`)}),valueAsString:({computed:e,prop:t})=>t(`collection`).stringifyItems(e(`selectedItems`))},initialState({prop:e}){return e(`open`)||e(`defaultOpen`)?`open`:`idle`},entry:[`syncSelectElement`],watch({context:e,prop:t,track:n,action:r}){n([()=>e.get(`value`).toString()],()=>{r([`syncSelectedItems`,`syncSelectElement`,`dispatchChangeEvent`])}),n([()=>t(`open`)],()=>{r([`toggleVisibility`])}),n([()=>e.get(`highlightedValue`)],()=>{r([`syncHighlightedItem`])}),n([()=>t(`collection`).toString()],()=>{r([`syncCollection`])})},on:{"HIGHLIGHTED_VALUE.SET":{actions:[`setHighlightedItem`]},"HIGHLIGHTED_VALUE.CLEAR":{actions:[`clearHighlightedItem`]},"ITEM.SELECT":{actions:[`selectItem`]},"ITEM.CLEAR":{actions:[`clearItem`]},"VALUE.SET":{actions:[`setSelectedItems`]},"VALUE.CLEAR":{actions:[`clearSelectedItems`]},"CLEAR.CLICK":{actions:[`clearSelectedItems`,`focusTriggerEl`]}},effects:[`trackFormControlState`],states:{idle:{tags:[`closed`],on:{"CONTROLLED.OPEN":[{guard:`isTriggerClickEvent`,target:`open`,actions:[`setInitialFocus`,`highlightFirstSelectedItem`]},{target:`open`,actions:[`setInitialFocus`]}],"TRIGGER.CLICK":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`invokeOnOpen`,`setInitialFocus`,`highlightFirstSelectedItem`]}],"TRIGGER.FOCUS":{target:`focused`},OPEN:[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`]}]}},focused:{tags:[`closed`],on:{"CONTROLLED.OPEN":[{guard:`isTriggerClickEvent`,target:`open`,actions:[`setInitialFocus`,`highlightFirstSelectedItem`]},{guard:`isTriggerArrowUpEvent`,target:`open`,actions:[`setInitialFocus`,`highlightComputedLastItem`]},{guard:Xm(`isTriggerArrowDownEvent`,`isTriggerEnterEvent`),target:`open`,actions:[`setInitialFocus`,`highlightComputedFirstItem`]},{target:`open`,actions:[`setInitialFocus`]}],OPEN:[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`]}],"TRIGGER.BLUR":{target:`idle`},"TRIGGER.CLICK":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`,`highlightFirstSelectedItem`]}],"TRIGGER.ENTER":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`,`highlightComputedFirstItem`]}],"TRIGGER.ARROW_UP":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`,`highlightComputedLastItem`]}],"TRIGGER.ARROW_DOWN":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`,`highlightComputedFirstItem`]}],"TRIGGER.ARROW_LEFT":[{guard:Jm(Ym(`multiple`),`hasSelectedItems`),actions:[`selectPreviousItem`]},{guard:Ym(`multiple`),actions:[`selectLastItem`]}],"TRIGGER.ARROW_RIGHT":[{guard:Jm(Ym(`multiple`),`hasSelectedItems`),actions:[`selectNextItem`]},{guard:Ym(`multiple`),actions:[`selectFirstItem`]}],"TRIGGER.HOME":{guard:Ym(`multiple`),actions:[`selectFirstItem`]},"TRIGGER.END":{guard:Ym(`multiple`),actions:[`selectLastItem`]},"TRIGGER.TYPEAHEAD":{guard:Ym(`multiple`),actions:[`selectMatchingItem`]}}},open:{tags:[`open`],exit:[`scrollContentToTop`],effects:[`trackDismissableElement`,`trackFocusVisible`,`computePlacement`,`scrollToHighlightedItem`],on:{"CONTROLLED.CLOSE":[{guard:`restoreFocus`,target:`focused`,actions:[`focusTriggerEl`,`clearHighlightedItem`]},{target:`idle`,actions:[`clearHighlightedItem`]}],CLOSE:[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{guard:`restoreFocus`,target:`focused`,actions:[`invokeOnClose`,`focusTriggerEl`,`clearHighlightedItem`]},{target:`idle`,actions:[`invokeOnClose`,`clearHighlightedItem`]}],"TRIGGER.CLICK":[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{target:`focused`,actions:[`invokeOnClose`,`clearHighlightedItem`]}],"ITEM.CLICK":[{guard:Jm(`closeOnSelect`,`isOpenControlled`),actions:[`selectHighlightedItem`,`invokeOnClose`]},{guard:`closeOnSelect`,target:`focused`,actions:[`selectHighlightedItem`,`invokeOnClose`,`focusTriggerEl`,`clearHighlightedItem`]},{actions:[`selectHighlightedItem`]}],"CONTENT.HOME":{actions:[`highlightFirstItem`]},"CONTENT.END":{actions:[`highlightLastItem`]},"CONTENT.ARROW_DOWN":[{guard:Jm(`hasHighlightedItem`,`loop`,`isLastItemHighlighted`),actions:[`highlightFirstItem`]},{guard:`hasHighlightedItem`,actions:[`highlightNextItem`]},{actions:[`highlightFirstItem`]}],"CONTENT.ARROW_UP":[{guard:Jm(`hasHighlightedItem`,`loop`,`isFirstItemHighlighted`),actions:[`highlightLastItem`]},{guard:`hasHighlightedItem`,actions:[`highlightPreviousItem`]},{actions:[`highlightLastItem`]}],"CONTENT.TYPEAHEAD":{actions:[`highlightMatchingItem`]},"ITEM.POINTER_MOVE":{actions:[`highlightItem`]},"ITEM.POINTER_LEAVE":{actions:[`clearHighlightedItem`]},"POSITIONING.SET":{actions:[`reposition`]}}}},implementations:{guards:{loop:({prop:e})=>!!e(`loopFocus`),multiple:({prop:e})=>!!e(`multiple`),hasSelectedItems:({computed:e})=>!!e(`hasSelectedItems`),hasHighlightedItem:({context:e})=>e.get(`highlightedValue`)!=null,isFirstItemHighlighted:({context:e,prop:t})=>e.get(`highlightedValue`)===t(`collection`).firstValue,isLastItemHighlighted:({context:e,prop:t})=>e.get(`highlightedValue`)===t(`collection`).lastValue,closeOnSelect:({prop:e,event:t})=>!!(t.closeOnSelect??e(`closeOnSelect`)),restoreFocus:({event:e})=>Qm(e),isOpenControlled:({prop:e})=>e(`open`)!==void 0,isTriggerClickEvent:({event:e})=>e.previousEvent?.type===`TRIGGER.CLICK`,isTriggerEnterEvent:({event:e})=>e.previousEvent?.type===`TRIGGER.ENTER`,isTriggerArrowUpEvent:({event:e})=>e.previousEvent?.type===`TRIGGER.ARROW_UP`,isTriggerArrowDownEvent:({event:e})=>e.previousEvent?.type===`TRIGGER.ARROW_DOWN`},effects:{trackFocusVisible({scope:e}){return Mu({root:e.getRootNode?.()})},trackFormControlState({context:e,scope:t}){return Qa(zm(t),{onFieldsetDisabledChange(t){e.set(`fieldsetDisabled`,t)},onFormReset(){let t=e.initial(`value`);e.set(`value`,t)}})},trackDismissableElement({scope:e,send:t,prop:n}){let r=()=>Bm(e),i=!0;return Il(r,{type:`listbox`,defer:!0,exclude:[Vm(e),Hm(e)],onFocusOutside:n(`onFocusOutside`),onPointerDownOutside:n(`onPointerDownOutside`),onInteractOutside(e){n(`onInteractOutside`)?.(e),i=!(e.detail.focusable||e.detail.contextmenu)},onDismiss(){t({type:`CLOSE`,src:`interact-outside`,restoreFocus:i})}})},computePlacement({context:e,prop:t,scope:n}){let r=t(`positioning`);return e.set(`currentPlacement`,r.placement),yp(()=>Vm(n),()=>Um(n),{defer:!0,...r,onComplete(t){e.set(`currentPlacement`,t.placement)}})},scrollToHighlightedItem({context:e,prop:t,scope:n}){let r=r=>{let i=e.get(`highlightedValue`);if(i==null||ku()===`pointer`)return;let a=Bm(n),o=t(`scrollToIndexFn`);if(o){let e=t(`collection`).indexOf(i);o?.({index:e,immediate:r,getElement:()=>Wm(n,i)});return}Zo(Wm(n,i),{rootEl:a,block:`nearest`})};return So(()=>{Au(`virtual`),r(!0)}),Eo(()=>Bm(n),{defer:!0,attributes:[`data-activedescendant`],callback(){r(!1)}})}},actions:{reposition({context:e,prop:t,scope:n,event:r}){yp(Vm(n),()=>Um(n),{...t(`positioning`),...r.options,defer:!0,listeners:!1,onComplete(t){e.set(`currentPlacement`,t.placement)}})},toggleVisibility({send:e,prop:t,event:n}){e({type:t(`open`)?`CONTROLLED.OPEN`:`CONTROLLED.CLOSE`,previousEvent:n})},highlightPreviousItem({context:e,prop:t}){let n=e.get(`highlightedValue`);if(n==null)return;let r=t(`collection`).getPreviousValue(n,1,t(`loopFocus`));r!=null&&e.set(`highlightedValue`,r)},highlightNextItem({context:e,prop:t}){let n=e.get(`highlightedValue`);if(n==null)return;let r=t(`collection`).getNextValue(n,1,t(`loopFocus`));r!=null&&e.set(`highlightedValue`,r)},highlightFirstItem({context:e,prop:t}){let n=t(`collection`).firstValue;e.set(`highlightedValue`,n)},highlightLastItem({context:e,prop:t}){let n=t(`collection`).lastValue;e.set(`highlightedValue`,n)},setInitialFocus({scope:e}){So(()=>{yo({root:Bm(e)})?.focus({preventScroll:!0})})},focusTriggerEl({event:e,scope:t}){Qm(e)&&So(()=>{Vm(t)?.focus({preventScroll:!0})})},selectHighlightedItem({context:e,prop:t,event:n}){let r=n.value??e.get(`highlightedValue`);r!=null&&t(`collection`).has(r)&&(t(`onSelect`)?.({value:r}),r=t(`deselectable`)&&!t(`multiple`)&&e.get(`value`).includes(r)?null:r,e.set(`value`,e=>r==null?[]:t(`multiple`)?Vn(e,r):[r]))},highlightComputedFirstItem({context:e,prop:t,computed:n}){let r=t(`collection`),i=n(`hasSelectedItems`)?r.sort(e.get(`value`))[0]:r.firstValue;e.set(`highlightedValue`,i)},highlightComputedLastItem({context:e,prop:t,computed:n}){let r=t(`collection`),i=n(`hasSelectedItems`)?r.sort(e.get(`value`))[0]:r.lastValue;e.set(`highlightedValue`,i)},highlightFirstSelectedItem({context:e,prop:t,computed:n}){if(!n(`hasSelectedItems`))return;let r=t(`collection`).sort(e.get(`value`))[0];e.set(`highlightedValue`,r)},highlightItem({context:e,event:t}){e.set(`highlightedValue`,t.value)},highlightMatchingItem({context:e,prop:t,event:n,refs:r}){let i=t(`collection`).search(n.key,{state:r.get(`typeahead`),currentValue:e.get(`highlightedValue`)});i!=null&&e.set(`highlightedValue`,i)},setHighlightedItem({context:e,event:t}){e.set(`highlightedValue`,t.value)},clearHighlightedItem({context:e}){e.set(`highlightedValue`,null)},selectItem({context:e,prop:t,event:n}){t(`onSelect`)?.({value:n.value});let r=t(`deselectable`)&&!t(`multiple`)&&e.get(`value`).includes(n.value)?null:n.value;e.set(`value`,e=>r==null?[]:t(`multiple`)?Vn(e,r):[r])},clearItem({context:e,event:t}){e.set(`value`,e=>e.filter(e=>e!==t.value))},setSelectedItems({context:e,event:t}){e.set(`value`,t.value)},clearSelectedItems({context:e}){e.set(`value`,[])},selectPreviousItem({context:e,prop:t}){let[n]=e.get(`value`),r=t(`collection`).getPreviousValue(n);r&&e.set(`value`,[r])},selectNextItem({context:e,prop:t}){let[n]=e.get(`value`),r=t(`collection`).getNextValue(n);r&&e.set(`value`,[r])},selectFirstItem({context:e,prop:t}){let n=t(`collection`).firstValue;n&&e.set(`value`,[n])},selectLastItem({context:e,prop:t}){let n=t(`collection`).lastValue;n&&e.set(`value`,[n])},selectMatchingItem({context:e,prop:t,event:n,refs:r}){let i=t(`collection`).search(n.key,{state:r.get(`typeahead`),currentValue:e.get(`value`)[0]});i!=null&&e.set(`value`,[i])},scrollContentToTop({prop:e,scope:t}){if(e(`scrollToIndexFn`)){let n=e(`collection`).firstValue;e(`scrollToIndexFn`)?.({index:0,immediate:!0,getElement:()=>Wm(t,n)})}else Bm(t)?.scrollTo(0,0)},invokeOnOpen({prop:e,context:t}){e(`onOpenChange`)?.({open:!0,value:t.get(`value`)})},invokeOnClose({prop:e,context:t}){e(`onOpenChange`)?.({open:!1,value:t.get(`value`)})},syncSelectElement({context:e,prop:t,scope:n}){let r=zm(n);if(r){if(e.get(`value`).length===0&&!t(`multiple`)){r.selectedIndex=-1;return}for(let t of r.options)t.selected=e.get(`value`).includes(t.value)}},syncCollection({context:e,prop:t}){let n=t(`collection`),r=n.find(e.get(`highlightedValue`));r&&e.set(`highlightedItem`,r);let i=Np({values:e.get(`value`),collection:n,selectedItemMap:e.get(`selectedItemMap`)});e.set(`selectedItemMap`,i.nextSelectedItemMap)},syncSelectedItems({context:e,prop:t}){let n=Np({values:e.get(`value`),collection:t(`collection`),selectedItemMap:e.get(`selectedItemMap`)});e.set(`selectedItemMap`,n.nextSelectedItemMap)},syncHighlightedItem({context:e,prop:t}){let n=t(`collection`),r=e.get(`highlightedValue`),i=r?n.find(r):null;e.set(`highlightedItem`,i)},dispatchChangeEvent({scope:e}){queueMicrotask(()=>{let t=zm(e);if(!t)return;let n=new(e.getWin()).Event(`change`,{bubbles:!0,composed:!0});t.dispatchEvent(to(n))})}}}});function Qm(e){let t=e.restoreFocus??e.previousEvent?.restoreFocus;return t==null||!!t}var $m=V(`slider`).parts(`root`,`label`,`thumb`,`valueText`,`track`,`range`,`control`,`markerGroup`,`marker`,`draggingIndicator`);$m.build();var eh=Object.defineProperty,th=(e,t,n)=>t in e?eh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nh=(e,t,n)=>th(e,typeof t==`symbol`?t:t+``,n),rh=V(`splitter`).parts(`root`,`panel`,`resizeTrigger`,`resizeTriggerIndicator`),ih=rh.build(),ah=e=>e.ids?.root??`splitter:${e.id}`,oh=(e,t)=>e.ids?.resizeTrigger?.(t)??`splitter:${e.id}:splitter:${t}`,sh=(e,t)=>e.ids?.panel?.(t)??`splitter:${e.id}:panel:${t}`,ch=e=>`splitter:${e.id}:global-cursor`,lh=e=>e.getById(ah(e)),uh=(e,t)=>t==null?null:e.getById(oh(e,t)),dh=e=>Ai(e)&&e.dataset.part===`panel`?e.dataset.id:void 0,fh=e=>{let t=e?.previousElementSibling??null;for(;t;){let e=dh(t);if(e)return e;t=t.previousElementSibling}},ph=e=>{let t=e?.nextElementSibling??null;for(;t;){let e=dh(t);if(e)return e;t=t.nextElementSibling}},mh=(e,t)=>{let[n,r]=t.split(`:`);if(n&&r)return t;let i=uh(e,t),a=n||fh(i),o=r||ph(i);return a&&o?`${a}:${o}`:null},hh=(e,t)=>{let n=t?`col-resize`:`row-resize`;return e.isAtMin&&(n=t?`e-resize`:`s-resize`),e.isAtMax&&(n=t?`w-resize`:`n-resize`),n},gh=e=>Ho(lh(e),`[role=separator]${Ti(ah(e))}`),_h=e=>e.getDoc().getElementById(ch(e)),vh=(e,t,n,r)=>{let i=_h(e),a=`* { cursor: ${hh(t,n)} !important; }`;if(i)i.textContent=a;else{let t=e.getDoc().createElement(`style`);r&&(t.nonce=r),t.id=ch(e),t.textContent=a,e.getDoc().head.appendChild(t)}},yh=e=>{_h(e)?.remove()};function bh({size:e,panels:t,pivotIndices:n}){let r=0,i=100,a=0,o=0,s=n[0];return Or(s,()=>`No pivot index found`),t.forEach((e,t)=>{let{maxSize:n=100,minSize:c=0}=e;t===s?(r=c,i=n):(a+=c,o+=n)}),{valueMax:Math.min(i,100-a),valueMin:Math.max(r,100-o),valueNow:e[s]}}function xh(e,t,n){let[r,i]=n.split(`:`),a=t.findIndex(e=>e.id===r),o=t.findIndex(e=>e.id===i);if(a===-1||o===-1)return{beforeId:r||void 0,afterId:i||void 0,valueMax:void 0,valueMin:void 0,valueNow:void 0};let{valueMax:s,valueMin:c,valueNow:l}=bh({size:e,panels:t,pivotIndices:[a,o]});return{beforeId:r,afterId:i,valueMax:Math.round(s),valueMin:Math.round(c),valueNow:l==null?void 0:Math.round(l)}}function Sh(e,t,n=10){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function Ch(e,t,n=10){return e==null||t==null?!1:Sh(e,t,n)===0}function wh(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],a=t[r];if(!Ch(i,a,n))return!1}return!0}var Th=/^(-?\d*\.?\d+)(%|px|em|rem|vw|vh)?$/,Eh=/^(-?\d*\.?\d+)%$/;function Dh(e,t){if(!e)return 0;let n=e.getBoundingClientRect();return t===`horizontal`?n.width:n.height}function Oh(e,t){return Dh(e,t)}function kh(e,t,n){let r=n.ownerDocument.defaultView;if(r)switch(t){case`px`:return e;case`em`:return e*Number.parseFloat(r.getComputedStyle(n).fontSize);case`rem`:return e*Number.parseFloat(r.getComputedStyle(n.ownerDocument.documentElement).fontSize);case`vw`:return e/100*r.innerWidth;case`vh`:return e/100*r.innerHeight;default:return}}function Ah(e,t,n){if(e==null)return;if(typeof e==`number`)return e;let r=e.trim().match(Th);if(!r)return;let i=Number.parseFloat(r[1]);if(!Number.isFinite(i))return;let a=r[2];if(a==null||a===`%`)return i;if(!t)return;let o=Dh(t,n);if(o===0)return;let s=kh(i,a,t);return s==null?void 0:s/o*100}function jh(e){if(e==null)return;if(typeof e==`number`)return`${e}%`;let t=e.trim();if(Eh.test(t))return t;let n=t.match(Th);if(!n)return;let r=Number.parseFloat(n[1]);if(!Number.isFinite(r))return;let i=n[2];return i==null?`${r}%`:`${r}${i}`}function Mh({sizes:e,panels:t,rootEl:n,orientation:r}){let i=Array(t.length),a=100,o=0;for(let s=0;s<t.length;s++){let t=Ah(e?.[s],n,r);t!=null&&(o++,i[s]=t,a-=t)}for(let e=0;e<t.length;e++){if(i[e]!=null)continue;let n=t.length-o,r=n>0?a/n:0;o++,i[e]=r,a-=r}return i}function Nh(e,t,n){return e.map(e=>({...e,minSize:Ah(e.minSize,t,n),maxSize:Ah(e.maxSize,t,n),collapsedSize:Ah(e.collapsedSize,t,n)}))}function Ph(e,t){let n=e.find(e=>e.id===t);return Or(n,()=>`Panel data not found for id "${t}"`),n}function Fh(e,t){return e.findIndex(e=>e===t||e.id===t.id)}function Ih(e,t){return e.findIndex(e=>e.id===t)}function Lh(e,t,n){let r=Ih(e,t.id),i=r===e.length-1?[r-1,r]:[r,r+1],a=n[r];return{...t,panelSize:a,pivotIndices:i}}function Rh(e){return e.sort((e,t)=>{let n=e.order,r=t.order;return n==null&&r==null?0:n==null?-1:r==null?1:n-r})}function zh(e){return e.map(e=>e.id).sort().join(`:`)}function Bh(e){return e.map(e=>e.id).sort().map(t=>{let n=e.find(e=>e.id===t);return JSON.stringify(n)}).join(`,`)}function Vh({size:e,defaultSize:t,dragState:n,resolvedSizes:r,panels:i,panelIndex:a,horizontal:o,collapsed:s=!1,precision:c=3}){let l=r[a],u=e??t,d=i[a],f,p,m=1,h=o?`Width`:`Height`,g=d?jh(d.minSize):void 0,_=d?jh(d.maxSize):void 0,v=s?jh(d?.collapsedSize??0):g,y=jh(u);return l==null?y==null?f=`1`:y.endsWith(`%`)?f=Number.parseFloat(y).toPrecision(c):(p=Hh({basis:y,minSize:g,maxSize:_}),f=`0`,m=0):f=i.length===1?`1`:l.toPrecision(c),{flexBasis:p??0,flexGrow:f,flexShrink:m,...v?{[`min${h}`]:v}:{},..._?{[`max${h}`]:_}:{},overflow:`hidden`,pointerEvents:n===null?void 0:`none`}}function Hh({basis:e,minSize:t,maxSize:n}){return`clamp(${t??`0%`}, ${e}, ${n??`100%`})`}function Uh(e,t){let{state:n,send:r,prop:i,computed:a,context:o,scope:s}=e,c=a(`horizontal`),l=n.matches(`dragging`),u=i(`registry`),d=i(`orientation`),f=i(`panels`),p=o.get(`panels`),m=()=>{let e=o.get(`size`);return e.length>0?e:Mh({sizes:i(`size`)??i(`defaultSize`),panels:f,rootEl:null,orientation:d})},h=e=>{let t=f.findIndex(t=>t.id===e),n=i(`size`)?.[t],r=i(`defaultSize`)?.[t],a=o.get(`dragState`),s=o.get(`size`),l=p[t],u=s[t],d=!!l?.collapsible&&u!=null&&Ch(u,l.collapsedSize??0);return Vh({size:n,defaultSize:r,dragState:a,resolvedSizes:s,panels:f,panelIndex:t,horizontal:c,collapsed:d})},g=e=>{let[t,n]=e.split(`:`);if(t&&n)return e;if(t){let n=f.findIndex(e=>e.id===t),r=f[n+1];return r?`${t}:${r.id}`:e}if(n){let t=f.findIndex(e=>e.id===n),r=f[t-1];return r?`${r.id}:${n}`:e}return e},_=e=>{let{id:t,disabled:r}=e,i=o.get(`dragState`)?.resizeTriggerId===t;return{dragging:i,focused:i||n.matches(`focused`)&&o.get(`keyboardState`)?.resizeTriggerId===t,disabled:!!r}};return{dragging:l,orientation:d,getPanels(){return f},getPanelById(e){return Ph(f,e)},getItems(){return f.flatMap((e,t,n)=>{let r=n[t+1];return e&&r?[{type:`panel`,id:e.id},{type:`handle`,id:`${e.id}:${r.id}`}]:[{type:`panel`,id:e.id}]})},getSizes(){return m()},setSizes(e){r({type:`SIZE.SET`,size:e})},resetSizes(){r({type:`SIZE.RESET`})},collapsePanel(e){r({type:`PANEL.COLLAPSE`,id:e})},expandPanel(e,t){r({type:`PANEL.EXPAND`,id:e,minSize:t})},resizePanel(e,t){r({type:`PANEL.RESIZE`,id:e,size:t})},getPanelSize(e){let t=o.get(`panels`),n=m(),r=Ph(t,e),{panelSize:i}=Lh(t,r,n);return Or(i!=null,()=>`Panel size not found for panel "${r.id}"`),i},isPanelCollapsed(e){let t=o.get(`panels`),n=m(),r=Ph(t,e),{collapsedSize:i=0,collapsible:a,panelSize:s}=Lh(t,r,n);return Or(s!=null,()=>`Panel size not found for panel "${r.id}"`),a===!0&&Ch(s,i)},isPanelExpanded(e){let t=o.get(`panels`),n=m(),r=Ph(t,e),{collapsedSize:i=0,collapsible:a,panelSize:s}=Lh(t,r,n);return Or(s!=null,()=>`Panel size not found for panel "${r.id}"`),!a||Sh(s,i)>0},getLayout(){return zh(i(`panels`))},getRootProps(){return t.element({...ih.root.attrs,"data-orientation":d,"data-dragging":z(l),id:ah(s),dir:i(`dir`),style:{display:`flex`,flexDirection:c?`row`:`column`,height:`100%`,width:`100%`,overflow:`hidden`}})},getPanelProps(e){let{id:n}=e;return t.element({...ih.panel.attrs,"data-orientation":d,"data-dragging":z(l),dir:i(`dir`),"data-id":n,"data-index":Ih(i(`panels`),n),id:sh(s,n),"data-ownedby":ah(s),style:h(n)})},getResizeTriggerState:_,getResizeTriggerIndicator(e){let n=_(e);return t.element({...ih.resizeTriggerIndicator.attrs,"data-orientation":d,"data-focus":z(n.focused),"data-dragging":z(n.dragging),"data-disabled":z(n.disabled),"data-ownedby":ah(s)})},getResizeTriggerProps(e){let{id:n}=e,a=_(e),o=g(n),l=xh(m(),p,o);return t.element({...ih.resizeTrigger.attrs,dir:i(`dir`),id:oh(s,n),role:`separator`,"data-id":n,"data-ownedby":ah(s),tabIndex:a.disabled?void 0:0,"aria-valuenow":l.valueNow,"aria-valuemin":l.valueMin,"aria-valuemax":l.valueMax,"data-orientation":d,"aria-orientation":d,"aria-controls":l.beforeId&&l.afterId?`${sh(s,l.beforeId)} ${sh(s,l.afterId)}`:void 0,"data-focus":z(a.focused),"data-dragging":z(a.dragging),"data-disabled":z(a.disabled),style:{touchAction:`none`,userSelect:`none`,WebkitUserSelect:`none`,flex:`0 0 auto`,pointerEvents:a.disabled||a.dragging&&!a.focused?`none`:void 0,cursor:a.disabled||u?void 0:c?`col-resize`:`row-resize`,[c?`minHeight`:`minWidth`]:`0`},onPointerDown(e){if(!La(e))return;if(a.disabled){e.preventDefault();return}if(e.currentTarget.focus({preventScroll:!0,focusVisible:!1}),u)return;let t=Wa(e);r({type:`POINTER_DOWN`,id:n,point:t}),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault(),e.stopPropagation()},onPointerUp(e){a.disabled||e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)},onPointerOver(){a.disabled||u||r({type:`POINTER_OVER`,id:n})},onPointerLeave(){a.disabled||u||r({type:`POINTER_LEAVE`,id:n})},onBlur(){a.disabled||r({type:`BLUR`})},onFocus(){a.disabled||r({type:`FOCUS`,id:n})},onKeyDown(e){if(e.defaultPrevented||a.disabled)return;let t=i(`keyboardResizeBy`),o=0;o=e.shiftKey?10:t??1;let s={Enter(){r({type:`ENTER`,id:n})},ArrowUp(){r({type:`KEYBOARD_MOVE`,id:n,delta:c?0:-o})},ArrowDown(){r({type:`KEYBOARD_MOVE`,id:n,delta:c?0:o})},ArrowLeft(){r({type:`KEYBOARD_MOVE`,id:n,delta:c?-o:0})},ArrowRight(){r({type:`KEYBOARD_MOVE`,id:n,delta:c?o:0})},Home(){r({type:`KEYBOARD_MOVE`,id:n,delta:-100})},End(){r({type:`KEYBOARD_MOVE`,id:n,delta:100})},F6(){r({type:`FOCUS.CYCLE`,id:n,shiftKey:e.shiftKey})}}[Ha(e,{dir:i(`dir`),orientation:d})];s&&(s(e),e.preventDefault())}})}}}function Wh({panels:e,prevLayout:t,prevGroupSize:n,nextGroupSize:r}){if(n<=0||r<=0)return t;let i=[...t],a=[],o=0,s=0;if(e.forEach((e,c)=>{if(e.resizeBehavior===`preserve-pixel-size`){let e=t[c]/100*n/r*100;i[c]=e,o+=e}else a.push(c),s+=t[c]}),a.length===0){let e=i.reduce((e,t)=>e+t,0);if(Ch(e,100))return i;if(e<=0)return t;let n=100/e;return i.map(e=>e*n)}let c=100-o;if(c<=0){let e=i.reduce((e,t)=>e+t,0);if(Ch(e,100))return i;let t=100/Math.max(e,1);return i.map(e=>e*t)}if(Ch(s,0)){let e=c/a.length;return a.forEach(t=>{i[t]=e}),i}a.forEach(e=>{i[e]=t[e]/s*c});let l=i.reduce((e,t)=>e+t,0);if(Ch(l,100))return i;let u=100/l;return i.map(e=>e*u)}function Gh({panels:e,index:t,size:n}){let r=e[t];Or(r,()=>`Panel data not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,maxSize:o=100,minSize:s=0}=r;if(Sh(n,s)<0){if(a){let e=(i+s)/2;n=Sh(n,e)<0?i:s}else n=s}return n=Math.min(o,n),n=parseFloat(n.toFixed(10)),n}function Kh(e){let{delta:t,initialSize:n,panels:r,pivotIndices:i,prevSize:a,trigger:o}=e;if(Ch(t,0))return n;let s=[...n],[c,l]=i;Or(c,()=>`Invalid first pivot index`),Or(l,()=>`Invalid second pivot index`);let u=0;if(o===`keyboard`){{let e=t<0?l:c,i=r[e];Or(i,()=>`Panel data not found for index ${e}`);let{collapsedSize:a=0,collapsible:o,minSize:s=0}=i;if(o){let r=n[e];if(Or(r,()=>`Previous size not found for panel index ${e}`),Ch(r,a)){let e=s-r;Sh(e,Math.abs(t))>0&&(t=t<0?0-e:e)}}}{let e=t<0?c:l,i=r[e];Or(i,()=>`No panel data found for index ${e}`);let{collapsedSize:a=0,collapsible:o,minSize:s=0}=i;if(o){let r=n[e];if(Or(r,()=>`Previous size not found for panel index ${e}`),Ch(r,s)){let e=r-a;Sh(e,Math.abs(t))>0&&(t=t<0?0-e:e)}}}}{let e=t<0?1:-1,i=t<0?l:c,a=0;for(;;){let t=n[i];Or(t,()=>`Previous size not found for panel index ${i}`);let o=Gh({panels:r,index:i,size:100})-t;if(a+=o,i+=e,i<0||i>=r.length)break}let o=Math.min(Math.abs(t),Math.abs(a));t=t<0?0-o:o}{let e=t<0?c:l;for(;e>=0&&e<r.length;){let i=Math.abs(t)-Math.abs(u),a=n[e];Or(a,()=>`Previous size not found for panel index ${e}`);let o=a-i,c=Gh({panels:r,index:e,size:o});if(!Ch(a,c)&&(u+=a-c,s[e]=c,u.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?e--:e++}}if(wh(a,s))return a;{let e=t<0?l:c,i=n[e];Or(i,()=>`Previous size not found for panel index ${e}`);let a=i+u,o=Gh({panels:r,index:e,size:a});if(s[e]=o,!Ch(o,a)){let e=a-o,n=t<0?l:c;for(;n>=0&&n<r.length;){let i=s[n];Or(i,()=>`Previous size not found for panel index ${n}`);let a=i+e,o=Gh({panels:r,index:n,size:a});if(Ch(i,o)||(e-=o-i,s[n]=o),Ch(e,0))break;t>0?n--:n++}}}return Ch(s.reduce((e,t)=>t+e,0),100)?s:a}function qh({size:e,panels:t}){let n=[...e],r=n.reduce((e,t)=>e+t,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel size: ${n.map(e=>`${e}%`).join(`, `)}`);if(!Ch(r,100)&&n.length>0)for(let e=0;e<t.length;e++){let t=n[e];Or(t,()=>`No size data found for index ${e}`);let i=100/r*t;n[e]=i}let i=0;for(let e=0;e<t.length;e++){let r=n[e];Or(r,()=>`No size data found for index ${e}`);let a=Gh({panels:t,index:e,size:r});r!=a&&(i+=r-a,n[e]=a)}if(!Ch(i,0))for(let e=0;e<t.length;e++){let r=n[e];Or(r,()=>`No size data found for index ${e}`);let a=r+i,o=Gh({panels:t,index:e,size:a});if(r!==o&&(i-=o-r,n[e]=o,Ch(i,0)))break}return n}var Jh=ui({props({props:e}){return kr(e,[`panels`]),{orientation:`horizontal`,defaultSize:[],dir:`ltr`,...e,panels:Rh(e.panels)}},initialState(){return`idle`},context({prop:e,bindable:t,getContext:n,getRefs:r}){return{panels:t(()=>({defaultValue:Nh(e(`panels`),null,e(`orientation`))})),size:t(()=>({defaultValue:[],isEqual(e,t){return t!=null&&wh(e,t)},onChange(t){let i=n(),a=r();if(a.get(`suppressOnResize`))return;let o=a.get(`panelSizeBeforeCollapse`),s=Object.fromEntries(o.entries()),c=i.get(`dragState`)?.resizeTriggerId??null,l=zh(e(`panels`));e(`onResize`)?.({size:t,layout:l,resizeTriggerId:c,expandToSizes:s})}})),dragState:t(()=>({defaultValue:null})),keyboardState:t(()=>({defaultValue:null}))}},watch({track:e,action:t,prop:n}){e([()=>Bh(n(`panels`)),()=>JSON.stringify(n(`size`)??[]),()=>JSON.stringify(n(`defaultSize`)??[])],()=>{t([`syncSize`])})},refs(){return{panelSizeBeforeCollapse:new Map,prevDelta:0,panelIdToLastNotifiedSizeMap:new Map,initialSize:null,prevInitialLayout:null,prevGroupSize:null,lastRequestedSize:null,suppressOnResize:!1}},computed:{horizontal({prop:e}){return e(`orientation`)===`horizontal`}},on:{"SIZE.SET":{actions:[`setSize`]},"SIZE.RESET":{actions:[`resetSize`]},"PANEL.COLLAPSE":{actions:[`collapsePanel`]},"PANEL.EXPAND":{actions:[`expandPanel`]},"PANEL.RESIZE":{actions:[`resizePanel`]},"ROOT.RESIZE":{actions:[`syncSize`]}},entry:[`syncSize`],exit:[`clearGlobalCursor`],effects:[`trackResizeHandles`,`trackRootResize`],states:{idle:{entry:[`clearDraggingState`,`clearKeyboardState`],on:{POINTER_OVER:{target:`hover:temp`,actions:[`setKeyboardState`]},FOCUS:{target:`focused`,actions:[`setKeyboardState`]},POINTER_DOWN:{target:`dragging`,actions:[`setDraggingState`]}}},"hover:temp":{effects:[`waitForHoverDelay`],on:{HOVER_DELAY:{target:`hover`},FOCUS:{target:`focused`,actions:[`setKeyboardState`]},POINTER_DOWN:{target:`dragging`,actions:[`setDraggingState`]},POINTER_LEAVE:{target:`idle`}}},hover:{tags:[`focus`],on:{FOCUS:{target:`focused`,actions:[`setKeyboardState`]},POINTER_DOWN:{target:`dragging`,actions:[`setDraggingState`]},POINTER_LEAVE:{target:`idle`}}},focused:{tags:[`focus`],on:{BLUR:{target:`idle`},ENTER:{actions:[`collapseOrExpandPanel`]},POINTER_DOWN:{target:`dragging`,actions:[`setDraggingState`]},KEYBOARD_MOVE:{actions:[`invokeOnResizeStart`,`setKeyboardValue`,`invokeOnResizeEnd`]},"FOCUS.CYCLE":{actions:[`focusNextResizeTrigger`]}}},dragging:{tags:[`focus`],effects:[`trackPointerMove`],entry:[`invokeOnResizeStart`],on:{POINTER_MOVE:{actions:[`setPointerValue`,`setGlobalCursor`]},POINTER_UP:[{guard:`isResizeTriggerFocused`,target:`focused`,actions:[`invokeOnResizeEnd`,`setKeyboardState`,`clearDraggingState`,`clearGlobalCursor`]},{target:`idle`,actions:[`invokeOnResizeEnd`,`clearGlobalCursor`]}]}}},implementations:{guards:{isResizeTriggerFocused({context:e,scope:t}){let n=e.get(`dragState`);return t.isActiveElement(uh(t,n?.resizeTriggerId))}},effects:{trackResizeHandles:({prop:e,scope:t,send:n})=>{let r=e(`registry`);if(!r)return;let i=[],a=()=>{i.forEach(e=>e()),i=gh(t).map(i=>{let a=i.dataset.id;if(a)return r.register({id:oh(t,a),element:i,orientation:e(`orientation`),onActivate(e){n({type:`POINTER_DOWN`,id:a,point:e})},onDeactivate(){n({type:`POINTER_UP`})}})}).filter(Boolean)};a();let o=Oo(lh(t),{callback:a});return()=>{i.forEach(e=>e()),o?.()}},trackRootResize:({scope:e,send:t})=>{let n=lh(e);if(n)return Yo.observe(n,()=>{t({type:`ROOT.RESIZE`})})},waitForHoverDelay:({send:e})=>Tr(()=>{e({type:`HOVER_DELAY`})},250),trackPointerMove:({scope:e,send:t})=>Bo(e.getDoc(),{onPointerMove(e){t({type:`POINTER_MOVE`,point:e.point})},onPointerUp(){t({type:`POINTER_UP`})}})},actions:{setSize(e){let{context:t,event:n,prop:r,scope:i}=e,a=n.size,o=t.get(`size`),s=t.get(`panels`),c=qh({size:Mh({sizes:a,panels:r(`panels`),rootEl:lh(i),orientation:r(`orientation`)}),panels:s});Jn(o,c)||Yh(e,c)},resetSize(e){let{refs:t,context:n,prop:r,scope:i}=e;Yh(e,t.get(`initialSize`)??qh({size:Mh({sizes:r(`size`)??r(`defaultSize`),panels:r(`panels`),rootEl:lh(i),orientation:r(`orientation`)}),panels:n.get(`panels`)}))},syncSize(e){let{context:t,scope:n,prop:r,refs:i}=e,a=lh(n);if(!a)return;let o=r(`orientation`),s=Oh(a,o);if(s<=0)return;let c=Nh(r(`panels`),a,r(`orientation`));t.set(`panels`,c);let l=r(`size`)??r(`defaultSize`),u=`${zh(r(`panels`))}:${JSON.stringify(r(`size`)??[])}:${JSON.stringify(r(`defaultSize`)??[])}`,d=i.get(`prevGroupSize`),f=t.get(`size`),p=Mh({sizes:l,panels:r(`panels`),rootEl:a,orientation:o}),m=qh({size:d!=null&&d!==s&&f.length===c.length?Wh({panels:c,prevLayout:f,prevGroupSize:d,nextGroupSize:s}):p,panels:c});i.get(`prevInitialLayout`)!==u&&(i.set(`initialSize`,m),i.set(`prevInitialLayout`,u));let h=t.get(`size`);Jn(h,m)||(i.set(`suppressOnResize`,r(`size`)!=null||h.length===0),t.set(`size`,m),i.set(`suppressOnResize`,!1)),i.set(`prevGroupSize`,s)},setDraggingState({context:e,event:t,prop:n,scope:r}){let i=n(`orientation`),a=e.get(`size`),o=t.id,s=mh(r,o);if(!s||!lh(r))return;let c=uh(r,o);Or(c,()=>`Drag handle element not found for id "${o}"`);let l=i===`horizontal`?t.point.x:t.point.y;e.set(`dragState`,{resizeTriggerId:t.id,resolvedResizeTriggerId:s,resizeTriggerRect:c.getBoundingClientRect(),initialCursorPosition:l,initialSize:a})},clearDraggingState({context:e}){e.set(`dragState`,null)},setKeyboardState({context:e,event:t,scope:n}){let r=t.id??e.get(`dragState`)?.resizeTriggerId;r!=null&&e.set(`keyboardState`,{resizeTriggerId:r,resolvedResizeTriggerId:mh(n,r)})},clearKeyboardState({context:e}){e.set(`keyboardState`,null)},collapsePanel(e){let{context:t,event:n,refs:r}=e,i=t.get(`size`),a=t.get(`panels`),o=a.find(e=>e.id===n.id);if(Or(o,()=>`Panel data not found for id "${n.id}"`),o.collapsible){let{collapsedSize:t=0,panelSize:n,pivotIndices:s}=Lh(a,o,i);if(Or(n!=null,()=>`Panel size not found for panel "${o.id}"`),!Ch(n,t)){r.get(`panelSizeBeforeCollapse`).set(o.id,n);let c=Kh({delta:Fh(a,o)===a.length-1?n-t:t-n,initialSize:i,panels:a,pivotIndices:s,prevSize:i,trigger:`imperative-api`});Jn(i,c)||Yh(e,c)}}},expandPanel(e){let{context:t,event:n,refs:r}=e,i=t.get(`panels`),a=t.get(`size`),o=i.find(e=>e.id===n.id);if(Or(o,()=>`Panel data not found for id "${n.id}"`),o.collapsible){let{collapsedSize:t=0,panelSize:s=0,minSize:c=0,pivotIndices:l}=Lh(i,o,a),u=n.minSize??c;if(Ch(s,t)){let t=r.get(`panelSizeBeforeCollapse`).get(o.id),n=t!=null&&t>=u?t:u,c=Kh({delta:Fh(i,o)===i.length-1?s-n:n-s,initialSize:a,panels:i,pivotIndices:l,prevSize:a,trigger:`imperative-api`});Jn(a,c)||Yh(e,c)}}},resizePanel(e){let{context:t,event:n}=e,r=t.get(`size`),i=t.get(`panels`),a=Ph(i,n.id),o=n.size,{panelSize:s,pivotIndices:c}=Lh(i,a,r);Or(s!=null,()=>`Panel size not found for panel "${a.id}"`);let l=Kh({delta:Fh(i,a)===i.length-1?s-o:o-s,initialSize:r,panels:i,pivotIndices:c,prevSize:r,trigger:`imperative-api`});Jn(r,l)||Yh(e,l)},setPointerValue(e){let{context:t,event:n,prop:r,scope:i}=e,a=t.get(`dragState`);if(!a)return;let{resolvedResizeTriggerId:o,initialSize:s,initialCursorPosition:c}=a,l=t.get(`panels`),u=lh(i);Or(u,()=>`Panel group element not found`);let d=o.split(`:`).map(e=>l.findIndex(t=>t.id===e)),f=r(`orientation`)===`horizontal`,p=f?n.point.x:n.point.y,m=u.getBoundingClientRect(),h=f?m.width:m.height,g=(p-c)/h*100,_=t.get(`size`),v=Kh({delta:g,initialSize:s??_,panels:l,pivotIndices:d,prevSize:_,trigger:`mouse-or-touch`});Jn(_,v)||Yh(e,v)},setKeyboardValue(e){let{context:t,event:n}=e,r=t.get(`panels`),i=mh(e.scope,n.id);if(!i)return;let a=n.delta,o=i.split(`:`).map(e=>r.findIndex(t=>t.id===e)),s=t.get(`size`),c=Kh({delta:a,initialSize:s,panels:r,pivotIndices:o,prevSize:s,trigger:`keyboard`});Jn(s,c)||Yh(e,c)},invokeOnResizeEnd({context:e,prop:t,refs:n}){queueMicrotask(()=>{let r=e.get(`dragState`);t(`onResizeEnd`)?.({size:n.get(`lastRequestedSize`)??e.get(`size`),resizeTriggerId:r?.resizeTriggerId??null})})},invokeOnResizeStart({prop:e}){queueMicrotask(()=>{e(`onResizeStart`)?.()})},collapseOrExpandPanel(e){let{context:t,refs:n}=e,r=t.get(`panels`),i=t.get(`size`),[a,o]=(t.get(`keyboardState`)?.resolvedResizeTriggerId)?.split(`:`)??[],s=r.findIndex(e=>e.id===a);if(s===-1)return;let c=r[s];Or(c,()=>`No panel data found for index ${s}`);let l=i[s],{collapsedSize:u=0,collapsible:d,minSize:f=0}=c;if(l!=null&&d){let t=[a,o].map(e=>r.findIndex(t=>t.id===e)),s=Kh({delta:Ch(l,u)?f-u:u-l,initialSize:n.get(`initialSize`)??i,panels:r,pivotIndices:t,prevSize:i,trigger:`keyboard`});Jn(i,s)||Yh(e,s)}},setGlobalCursor(e){let{context:t,scope:n,prop:r}=e;if(r(`registry`))return;let i=t.get(`dragState`);if(!i)return;let a=t.get(`panels`),o=r(`orientation`)===`horizontal`,[s]=i.resolvedResizeTriggerId.split(`:`),c=a[a.findIndex(e=>e.id===s)],l=xh(t.get(`size`),a,i.resolvedResizeTriggerId);vh(n,{isAtMin:Ch(l.valueNow,l.valueMin)||Ch(l.valueNow,c.collapsedSize),isAtMax:Ch(l.valueNow,l.valueMax)},o,r(`nonce`))},clearGlobalCursor({scope:e}){yh(e)},focusNextResizeTrigger({event:e,scope:t}){let n=gh(t),r=n.findIndex(t=>t.dataset.id===e.id);(e.shiftKey?Gn(n,r):Un(n,r))?.focus()}}}});function Yh(e,t){let{refs:n,prop:r,context:i}=e,a=i.get(`panels`),o=r(`onCollapse`),s=r(`onExpand`),c=r(`onResize`),l=r(`onResizeStart`),u=r(`onResizeEnd`),d=n.get(`panelIdToLastNotifiedSizeMap`),f=i.get(`dragState`),p=i.get(`keyboardState`),m=f===null&&p===null;if(n.set(`lastRequestedSize`,t),m&&l&&queueMicrotask(()=>{l()}),r(`size`)==null)i.set(`size`,t);else if(c){let e=n.get(`panelSizeBeforeCollapse`),i=Object.fromEntries(e.entries()),a=f?.resizeTriggerId??null;c({size:t,layout:zh(r(`panels`)),resizeTriggerId:a,expandToSizes:i})}t.forEach((e,t)=>{let n=a[t];Or(n,()=>`Panel data not found for index ${t}`);let{collapsedSize:r=0,collapsible:i,id:c}=n,l=d.get(c);(l==null||e!==l)&&(d.set(c,e),i&&l!=null&&(o||s)&&(Ch(l,r)&&!Ch(e,r)&&s?.({panelId:c,size:e}),!Ch(l,r)&&Ch(e,r)&&o?.({panelId:c,size:e})))}),m&&u&&queueMicrotask(()=>{u({size:t,resizeTriggerId:null})})}function Xh(e,t,n=!1){return n?e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y:e.x<=t.x+t.width&&e.x+e.width>=t.x&&e.y<=t.y+t.height&&e.y+e.height>=t.y}function Zh(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}function Qh(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:Wi(e),b:Wi(t)},r=null;for(;n.a.at(-1)===n.b.at(-1);){let e=n.a.pop();n.b.pop(),r=e}Or(r,()=>`[stacking-order] Stacking order can only be calculated for elements with a common ancestor`);let i={a:rg(ng(n.a)),b:rg(ng(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var $h=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function eg(e){let t=$i(Ui(e)??e).display;return t===`flex`||t===`inline-flex`}function tg(e){let t=$i(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||eg(e))||+t.opacity<1||tr(t,`transform`)&&t.transform!==`none`||tr(t,`webkitTransform`)&&t.webkitTransform!==`none`||tr(t,`mixBlendMode`)&&t.mixBlendMode!==`normal`||tr(t,`filter`)&&t.filter!==`none`||tr(t,`webkitFilter`)&&t.webkitFilter!==`none`||tr(t,`isolation`)&&t.isolation===`isolate`||$h.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function ng(e){let t=e.length;for(;t--;){let n=e[t];if(Or(n,()=>`[stacking-order] missing node in findStackingContext`),tg(n))return n}return null}var rg=e=>e&&Number($i(e).zIndex)||0,ig=class{constructor(e={}){nh(this,`handles`,new Map),nh(this,`state`,{activeHandleIds:new Set,isPointerDown:!1}),nh(this,`listenerAttached`,!1),nh(this,`options`),nh(this,`handlePointerMove`,e=>{if(this.state.isPointerDown)return;let t=this.getPointerType(e),n=this.findHitHandles(e.clientX,e.clientY,t),r=new Set(n.map(e=>e.id));(r.size!==this.state.activeHandleIds.size||[...r].some(e=>!this.state.activeHandleIds.has(e)))&&(this.state.activeHandleIds=r,this.updateCursor(n))}),nh(this,`handlePointerDown`,e=>{let t=this.getPointerType(e),n=this.findIntersectingHandles(e.clientX,e.clientY,t,e.target);if(n.length>0){this.state.isPointerDown=!0,this.state.activeHandleIds=new Set(n.map(e=>e.id));let t={x:e.clientX,y:e.clientY};n.forEach(e=>{e.onActivate(t)}),this.updateCursor(n)}}),nh(this,`handlePointerUp`,e=>{this.state.isPointerDown&&(this.state.isPointerDown=!1,this.handles.forEach(e=>{this.state.activeHandleIds.has(e.id)&&e.onDeactivate()}),this.state.activeHandleIds.clear(),this.clearGlobalCursor())}),nh(this,`globalCursorId`,`splitter-registry-cursor`),this.options={nonce:e.nonce??``,hitAreaMargins:{coarse:e.hitAreaMargins?.coarse??15,fine:e.hitAreaMargins?.fine??5}}}register(e){return this.handles.set(e.id,e),this.attachGlobalListeners(),()=>{this.handles.delete(e.id),this.state.activeHandleIds.delete(e.id),this.handles.size===0&&this.detachGlobalListeners()}}attachGlobalListeners(){this.listenerAttached||=(this.doc.addEventListener(`pointermove`,this.handlePointerMove,!0),this.doc.addEventListener(`pointerdown`,this.handlePointerDown,!0),this.doc.addEventListener(`pointerup`,this.handlePointerUp,!0),!0)}detachGlobalListeners(){this.listenerAttached&&=(this.doc.removeEventListener(`pointermove`,this.handlePointerMove,!0),this.doc.removeEventListener(`pointerdown`,this.handlePointerDown,!0),this.doc.removeEventListener(`pointerup`,this.handlePointerUp,!0),!1)}getPointerType(e){return e.pointerType===`touch`||e.pointerType===`pen`?`coarse`:`fine`}get doc(){let e=this.handles.values().next().value;return Ki(e?.element)}findHitHandles(e,t,n){let r=[],i=this.options.hitAreaMargins[n];return this.handles.forEach(n=>{let a=n.element.getBoundingClientRect();e>=a.left-i&&e<=a.right+i&&t>=a.top-i&&t<=a.bottom+i&&r.push(n)}),r}findIntersectingHandles(e,t,n,r){let i=this.findHitHandles(e,t,n),a=ki(r)?r:null;return!a||!Gi(this.doc,a)?i:i.filter(e=>{let t=e.element;if(a===t||Gi(t,a)||Gi(a,t))return!0;try{if(Qh(a,t)>0){let e=t.getBoundingClientRect(),n=a;for(;n&&!n.contains(t);){if(Xh(Zh(n.getBoundingClientRect()),Zh(e),!0))return!1;n=Ui(n)}}}catch{}return!0})}updateCursor(e){if(e.length===0){this.clearGlobalCursor();return}let t=e.some(e=>e.orientation===`horizontal`),n=e.some(e=>e.orientation===`vertical`),r=`default`;t&&n?r=`move`:t?r=`ew-resize`:n&&(r=`ns-resize`),this.setGlobalCursor(r)}setGlobalCursor(e){let t=this.doc,n=t.getElementById(this.globalCursorId),r=`* { cursor: ${e} !important; }`;n?n.textContent=r:(n=t.createElement(`style`),n.id=this.globalCursorId,n.textContent=r,this.options.nonce&&(n.nonce=this.options.nonce),t.head.appendChild(n))}clearGlobalCursor(){this.doc.getElementById(this.globalCursorId)?.remove()}},ag=(e={})=>new ig(e),og=V(`switch`).parts(`root`,`label`,`control`,`thumb`),sg=og.build(),cg=e=>e.ids?.root??`switch:${e.id}`,lg=e=>e.ids?.label??`switch:${e.id}:label`,ug=e=>e.ids?.thumb??`switch:${e.id}:thumb`,dg=e=>e.ids?.control??`switch:${e.id}:control`,fg=e=>e.ids?.hiddenInput??`switch:${e.id}:input`,pg=e=>e.getById(cg(e)),mg=e=>e.getById(fg(e));function hg(e,t){let{context:n,send:r,prop:i,scope:a}=e,o=!!i(`disabled`),s=!!i(`readOnly`),c=!!i(`required`),l=!!n.get(`checked`),u=!o&&n.get(`focused`),d=!o&&n.get(`focusVisible`),f={"data-active":z(!o&&n.get(`active`)),"data-focus":z(u),"data-focus-visible":z(d),"data-readonly":z(s),"data-hover":z(n.get(`hovered`)),"data-disabled":z(o),"data-state":l?`checked`:`unchecked`,"data-invalid":z(i(`invalid`)),"data-required":z(c)};return{checked:l,disabled:o,focused:u,setChecked(e){r({type:`CHECKED.SET`,checked:e,isTrusted:!1})},toggleChecked(){r({type:`CHECKED.TOGGLE`,checked:l,isTrusted:!1})},getRootProps(){return t.label({...sg.root.attrs,...f,dir:i(`dir`),id:cg(a),htmlFor:fg(a),onPointerMove(){o||r({type:`CONTEXT.SET`,context:{hovered:!0}})},onPointerLeave(){o||r({type:`CONTEXT.SET`,context:{hovered:!1}})},onClick(e){o||(Ma(e)===mg(a)&&e.stopPropagation(),Oa()&&mg(a)?.focus())}})},getLabelProps(){return t.element({...sg.label.attrs,...f,dir:i(`dir`),id:lg(a)})},getThumbProps(){return t.element({...sg.thumb.attrs,...f,dir:i(`dir`),id:ug(a),"aria-hidden":!0})},getControlProps(){return t.element({...sg.control.attrs,...f,dir:i(`dir`),id:dg(a),"aria-hidden":!0})},getHiddenInputProps(){return t.input({id:fg(a),type:`checkbox`,required:i(`required`),defaultChecked:l,disabled:o,"aria-labelledby":lg(a),"aria-invalid":i(`invalid`),name:i(`name`),form:i(`form`),value:i(`value`),style:cs,onFocus(){let e=ju();r({type:`CONTEXT.SET`,context:{focused:!0,focusVisible:e}})},onBlur(){r({type:`CONTEXT.SET`,context:{focused:!1,focusVisible:!1}})},onClick(e){if(s){e.preventDefault();return}let t=e.currentTarget.checked;r({type:`CHECKED.SET`,checked:t,isTrusted:!0})}})}}}var{not:gg}=li(),_g=ui({props({props:e}){return{defaultChecked:!1,label:`switch`,value:`on`,...e}},initialState(){return`ready`},context({prop:e,bindable:t}){return{checked:t(()=>({defaultValue:e(`defaultChecked`),value:e(`checked`),onChange(t){e(`onCheckedChange`)?.({checked:t})}})),fieldsetDisabled:t(()=>({defaultValue:!1})),focusVisible:t(()=>({defaultValue:!1})),active:t(()=>({defaultValue:!1})),focused:t(()=>({defaultValue:!1})),hovered:t(()=>({defaultValue:!1}))}},computed:{isDisabled:({context:e,prop:t})=>t(`disabled`)||e.get(`fieldsetDisabled`)},watch({track:e,prop:t,context:n,action:r}){e([()=>t(`disabled`)],()=>{r([`removeFocusIfNeeded`])}),e([()=>n.get(`checked`)],()=>{r([`syncInputElement`])})},effects:[`trackFormControlState`,`trackPressEvent`,`trackFocusVisible`],on:{"CHECKED.TOGGLE":[{guard:gg(`isTrusted`),actions:[`toggleChecked`,`dispatchChangeEvent`]},{actions:[`toggleChecked`]}],"CHECKED.SET":[{guard:gg(`isTrusted`),actions:[`setChecked`,`dispatchChangeEvent`]},{actions:[`setChecked`]}],"CONTEXT.SET":{actions:[`setContext`]}},states:{ready:{}},implementations:{guards:{isTrusted:({event:e})=>!!e.isTrusted},effects:{trackPressEvent({computed:e,scope:t,context:n}){if(!e(`isDisabled`))return Vo({pointerNode:pg(t),keyboardNode:mg(t),isValidKey:e=>e.key===` `,onPress:()=>n.set(`active`,!1),onPressStart:()=>n.set(`active`,!0),onPressEnd:()=>n.set(`active`,!1)})},trackFocusVisible({computed:e,scope:t}){if(!e(`isDisabled`))return Mu({root:t.getRootNode()})},trackFormControlState({context:e,send:t,scope:n}){return Qa(mg(n),{onFieldsetDisabledChange(t){e.set(`fieldsetDisabled`,t)},onFormReset(){t({type:`CHECKED.SET`,checked:!!e.initial(`checked`),src:`form-reset`})}})}},actions:{setContext({context:e,event:t}){for(let n in t.context)e.set(n,t.context[n])},syncInputElement({context:e,scope:t}){let n=mg(t);n&&qa(n,!!e.get(`checked`))},removeFocusIfNeeded({context:e,prop:t}){t(`disabled`)&&e.set(`focused`,!1)},setChecked({context:e,event:t}){e.set(`checked`,t.checked)},toggleChecked({context:e}){e.set(`checked`,!e.get(`checked`))},dispatchChangeEvent({context:e,scope:t}){queueMicrotask(()=>{Ja(mg(t),{checked:e.get(`checked`)})})}}}}),vg=V(`tagsInput`).parts(`root`,`label`,`control`,`input`,`clearTrigger`,`item`,`itemPreview`,`itemInput`,`itemText`,`itemDeleteTrigger`);vg.build();var yg=e=>{if(!e)return;let t=$i(e),n=Ji(e),r=Ki(e),i=()=>{requestAnimationFrame(()=>{e.style.height=`auto`;let n;n=t.boxSizing===`content-box`?e.scrollHeight-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):e.scrollHeight+parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),t.maxHeight!==`none`&&n>parseFloat(t.maxHeight)?(t.overflowY===`hidden`&&(e.style.overflowY=`scroll`),n=parseFloat(t.maxHeight)):t.overflowY!==`hidden`&&(e.style.overflowY=`hidden`),e.style.height=`${n}px`})};e.addEventListener(`input`,i),e.form?.addEventListener(`reset`,i);let a=Object.getOwnPropertyDescriptor(e,`value`),o=a?.set?a:Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),`value`);o?.set&&Object.defineProperty(e,"value",{...o,set(e){o.set?.call(this,e),i()}});let s=new n.ResizeObserver(()=>{requestAnimationFrame(()=>i())});s.observe(e);let c=new n.MutationObserver(()=>i());return c.observe(e,{attributes:!0,attributeFilter:[`rows`,`placeholder`]}),r.fonts?.addEventListener(`loadingdone`,i),()=>{e.removeEventListener(`input`,i),e.form?.removeEventListener(`reset`,i),r.fonts?.removeEventListener(`loadingdone`,i),s.disconnect(),c.disconnect()}},bg=V(`tooltip`).parts(`trigger`,`arrow`,`arrowTip`,`positioner`,`content`);bg.build();var xg=V(`tree-view`).parts(`branch`,`branchContent`,`branchControl`,`branchIndentGuide`,`branchIndicator`,`branchText`,`branchTrigger`,`item`,`itemIndicator`,`itemText`,`label`,`nodeCheckbox`,`nodeRenameInput`,`root`,`tree`);xg.build();var Sg=typeof window<`u`?F.useLayoutEffect:F.useEffect,[Cg,wg]=jr({name:`CheckboxContext`,hookName:`useCheckboxContext`,providerName:`<CheckboxProvider />`}),Tg=e=>e.children(wg()),Eg=(0,F.forwardRef)((e,t)=>{let n=R(wg().getControlProps(),e);return(0,I.jsx)(B.div,{...n,ref:t})});Eg.displayName=`CheckboxControl`;var[Dg,Og]=jr({name:`FieldsetContext`,hookName:`useFieldsetContext`,providerName:`<FieldsetProvider />`,strict:!1});function kg(e){let{value:t,onChange:n,defaultValue:r}=e,[i,a]=(0,F.useState)(r),o=t!==void 0;return[o?t:i,(0,F.useCallback)(e=>(o||a(e),n?.(e)),[o,n])]}function Ag(e={}){let t=Og(),{defaultValue:n,value:r,onValueChange:i,disabled:a=t?.disabled,readOnly:o,name:s,invalid:c=t?.invalid,maxSelectedValues:l}=e,u=!(a||o),d=Es(i,{sync:!0}),[f,p]=kg({value:r,defaultValue:n||[],onChange:d}),m=e=>f.some(t=>String(t)===String(e)),h=e=>{m(e)?v(e):_(e)},g=l!=null&&f.length>=l,_=e=>{u&&(m(e)||g||p(f.concat(e)))},v=e=>{u&&p(f.filter(t=>String(t)!==String(e)))};return{isChecked:m,value:f,name:s,disabled:!!a,readOnly:!!o,invalid:!!c,setValue:p,addValue:_,toggleValue:h,getItemProps:e=>{let t=e.value==null?void 0:m(e.value);return{checked:t,onCheckedChange(){e.value!=null&&h(e.value)},name:s,disabled:a||g&&!t,readOnly:o,invalid:c}}}}var[jg,Mg]=jr({name:`CheckboxGroupContext`,hookName:`useCheckboxGroupContext`,providerName:`<CheckboxGroupProvider />`,strict:!1}),Ng=Ss(),Pg=(0,F.forwardRef)((e,t)=>{let[n,r]=Ng(e,[`defaultValue`,`value`,`onValueChange`,`disabled`,`invalid`,`readOnly`,`name`,`maxSelectedValues`]),i=Ag(n);return(0,I.jsx)(jg,{value:i,children:(0,I.jsx)(B.div,{ref:t,role:`group`,...r,...Wu.build().group.attrs})})});Pg.displayName=`CheckboxGroup`;var Fg=Ss(),Ig=(0,F.forwardRef)((e,t)=>{let[n,r]=Fg(e,[`value`]);return(0,I.jsx)(jg,{value:n.value,children:(0,I.jsx)(B.div,{ref:t,role:`group`,...r,...Wu.build().group.attrs})})});Ig.displayName=`CheckboxGroupProvider`;var[Lg,Rg]=jr({name:`FieldContext`,hookName:`useFieldContext`,providerName:`<FieldProvider />`,strict:!1}),zg=e=>e.children(Rg()),Bg=(0,F.forwardRef)((e,t)=>{let n=Rg(),r=R(n.getErrorTextProps(),e);return n?.invalid?(0,I.jsx)(B.span,{...r,ref:t}):null});Bg.displayName=`FieldErrorText`;var Vg=(0,F.forwardRef)((e,t)=>{let n=R(Rg()?.getHelperTextProps(),e);return(0,I.jsx)(B.span,{...n,ref:t})});Vg.displayName=`FieldHelperText`;var Hg=(0,F.forwardRef)((e,t)=>{let n=R(Rg()?.getInputProps(),e);return(0,I.jsx)(B.input,{...n,ref:t})});Hg.displayName=`FieldInput`;var Ug=e=>{let{value:t,children:n}=e,r=Rg(),i=(0,F.useMemo)(()=>{if(!r)throw Error(`Field.Item must be used within Field.Root`);let e=`field::${r.ids.control}::item::${t}`,n=`${e}::label`,i=()=>({...r.getInputProps(),id:e});return{...r,ids:{...r.ids,control:e,label:n},getLabelProps:()=>({...r.getLabelProps(),id:n,htmlFor:e}),getInputProps:()=>({...i(),...sm.input.attrs}),getSelectProps:()=>({...i(),...sm.select.attrs}),getTextareaProps:()=>({...i(),...sm.textarea.attrs})}},[r,t]);return(0,I.jsx)(Lg,{value:i,children:n})};Ug.displayName=`FieldItem`;var Wg=(0,F.forwardRef)((e,t)=>{let n=R(Rg()?.getLabelProps(),e);return(0,I.jsx)(B.label,{...n,ref:t})});Wg.displayName=`FieldLabel`;var Gg=(0,F.forwardRef)(({fallback:e,...t},n)=>{let r=Rg();if(!r.required)return e;let i=R(r.getRequiredIndicatorProps(),t);return(0,I.jsx)(B.span,{...i,ref:n,children:t.children??`*`})});Gg.displayName=`FieldRequiredIndicator`;var Kg=(e={})=>{let t=Og(),n=Nr(),{ids:r,target:i,disabled:a=!!t?.disabled,invalid:o=!1,readOnly:s=!1,required:c=!1}=e,[l,u]=(0,F.useState)(!1),[d,f]=(0,F.useState)(!1),p=(0,F.useId)(),m=e.id??p,h=(0,F.useRef)(null),g=r?.control??`field::${m}`,_=r?.errorText??`field::${m}::error-text`,v=r?.helperText??`field::${m}::helper-text`,y=r?.label??`field::${m}::label`;Sg(()=>{let e=h.current;if(!e)return;let t=()=>{let e=n.getRootNode();u(!!e.getElementById(_)),f(!!e.getElementById(v))};t();let r=new(n.getWindow()).MutationObserver(t);return r.observe(e,{childList:!0,subtree:!0}),()=>r.disconnect()},[n,_,v]);let b=(0,F.useMemo)(()=>()=>({...sm.root.attrs,id:g,ref:h,role:`group`,"data-disabled":z(a),"data-invalid":z(o),"data-readonly":z(s)}),[a,o,s,g]),x=i?`field::${m}::item::${i}`:void 0,S=(0,F.useMemo)(()=>()=>({...sm.label.attrs,id:y,"data-disabled":z(a),"data-invalid":z(o),"data-readonly":z(s),"data-required":z(c),htmlFor:x??m}),[a,o,s,c,m,y,x]),C=l&&o?_:void 0,w=(0,F.useMemo)(()=>()=>({"aria-describedby":d?v:void 0,"aria-errormessage":C,"aria-invalid":xi(o),"data-invalid":z(o),"data-required":z(c),"data-readonly":z(s),id:m,required:c,disabled:a,readOnly:s}),[d,v,o,c,s,m,C,a]),T=(0,F.useMemo)(()=>()=>({...w(),...sm.input.attrs}),[w]),E=(0,F.useMemo)(()=>()=>({...w(),...sm.textarea.attrs}),[w]),D=(0,F.useMemo)(()=>()=>({...w(),...sm.select.attrs}),[w]),ee=(0,F.useMemo)(()=>()=>({id:v,...sm.helperText.attrs,"data-disabled":z(a)}),[a,v]),O=(0,F.useMemo)(()=>()=>({id:_,...sm.errorText.attrs,"aria-live":`polite`}),[_]),k=(0,F.useMemo)(()=>()=>({"aria-hidden":!0,...sm.requiredIndicator.attrs}),[]);return{ariaDescribedby:d?v:void 0,ids:{root:g,control:m,label:y,errorText:_,helperText:v},refs:{rootRef:h},disabled:a,invalid:o,readOnly:s,required:c,getLabelProps:S,getRootProps:b,getInputProps:T,getTextareaProps:E,getSelectProps:D,getHelperTextProps:ee,getErrorTextProps:O,getRequiredIndicatorProps:k}},qg=Ss(),Jg=(0,F.forwardRef)((e,t)=>{let[n,r]=qg(e,[`id`,`ids`,`disabled`,`invalid`,`readOnly`,`required`,`target`]),i=Kg(n),a=R(i.getRootProps(),r),o=Fr(t,i.refs.rootRef);return(0,I.jsx)(Lg,{value:i,children:(0,I.jsx)(B.div,{...a,ref:o})})});Jg.displayName=`FieldRoot`;var Yg=Ss(),Xg=(0,F.forwardRef)((e,t)=>{let[{value:n},r]=Yg(e,[`value`]),i=R(n.getRootProps(),r);return(0,I.jsx)(Lg,{value:n,children:(0,I.jsx)(B.div,{...i,ref:t})})});Xg.displayName=`FieldRootProvider`;var Zg=(0,F.forwardRef)((e,t)=>{let n=R(Rg()?.getSelectProps(),e);return(0,I.jsx)(B.select,{...n,ref:t})});Zg.displayName=`FieldSelect`;var Qg=(0,F.forwardRef)((e,t)=>{let{autoresize:n,...r}=e,i=(0,F.useRef)(null),a=R(Rg()?.getTextareaProps(),{style:{resize:n?`none`:void 0}},r),o=Fr(t,i);return(0,F.useEffect)(()=>{if(n)return yg(i.current)},[n]),(0,I.jsx)(B.textarea,{...a,ref:o})});Qg.displayName=`FieldTextarea`;var $g=xs({Context:()=>zg,ErrorText:()=>Bg,HelperText:()=>Vg,Input:()=>Hg,Item:()=>Ug,Label:()=>Wg,RequiredIndicator:()=>Gg,Root:()=>Jg,RootProvider:()=>Xg,Select:()=>Zg,Textarea:()=>Qg}),e_=(0,F.forwardRef)((e,t)=>{let n=R(wg().getHiddenInputProps(),e),r=Rg();return(0,I.jsx)(B.input,{"aria-describedby":r?.ariaDescribedby,...n,ref:t})});e_.displayName=`CheckboxHiddenInput`;var t_=(0,F.forwardRef)((e,t)=>{let{indeterminate:n,...r}=e,i=wg(),a=R(i.getIndicatorProps(),r),o=n?i.indeterminate:i.checked;return(0,I.jsx)(B.div,{...a,hidden:!o,ref:t})});t_.displayName=`CheckboxIndicator`;var n_=(0,F.forwardRef)((e,t)=>{let n=R(wg().getLabelProps(),e);return(0,I.jsx)(B.span,{...n,ref:t})});n_.displayName=`CheckboxLabel`;var r_=(e={})=>{let t=Mg(),n=Rg(),r=(0,F.useMemo)(()=>R(t?.getItemProps({value:e.value})??{},e),[e,t]),i=(0,F.useId)(),{getRootNode:a}=Nr(),{dir:o}=ys();return zu(Ps(Vu,{id:i,ids:{label:n?.ids.label,hiddenInput:n?.ids.control},dir:o,disabled:n?.disabled,readOnly:n?.readOnly,invalid:n?.invalid,required:n?.required,getRootNode:a,...r}),zs)},i_=Ss(),a_=(0,F.forwardRef)((e,t)=>{let[n,r]=i_(e,[`checked`,`defaultChecked`,`disabled`,`form`,`id`,`ids`,`invalid`,`name`,`onCheckedChange`,`readOnly`,`required`,`value`]),i=r_(n),a=R(i.getRootProps(),r);return(0,I.jsx)(Cg,{value:i,children:(0,I.jsx)(B.label,{...a,ref:t})})});a_.displayName=`CheckboxRoot`;var o_=Ss(),s_=(0,F.forwardRef)((e,t)=>{let[{value:n},r]=o_(e,[`value`]),i=R(n.getRootProps(),r);return(0,I.jsx)(Cg,{value:n,children:(0,I.jsx)(B.label,{...i,ref:t})})});s_.displayName=`CheckboxRootProvider`;var c_=xs({Context:()=>Tg,Control:()=>Eg,Group:()=>Pg,GroupProvider:()=>Ig,HiddenInput:()=>e_,Indicator:()=>t_,Label:()=>n_,Root:()=>a_,RootProvider:()=>s_}),l_=e=>new Dp(e),[u_,d_]=jr({name:`DialogContext`,hookName:`useDialogContext`,providerName:`<DialogProvider />`}),f_=(0,F.forwardRef)((e,t)=>{let n=d_(),r=Us({...bc(),present:n.open}),i=R(n.getBackdropProps(),r.getPresenceProps(),e),a=Fr(r.ref,t);return(0,I.jsx)(Ws,{presence:r,children:(0,I.jsx)(B.div,{...i,ref:a})})});f_.displayName=`DialogBackdrop`;var p_=(0,F.forwardRef)((e,t)=>{let n=R(d_().getCloseTriggerProps(),e);return(0,I.jsx)(B.button,{...n,ref:t})});p_.displayName=`DialogCloseTrigger`;var m_=(0,F.forwardRef)((e,t)=>{let n=d_(),r=Ks(),i=R(n.getContentProps(),r.getPresenceProps(),e),a=Fr(r.ref,t);return(0,I.jsx)(Ws,{presence:r,children:(0,I.jsx)(B.div,{...i,ref:a})})});m_.displayName=`DialogContent`;var h_=e=>e.children(d_()),g_=(0,F.forwardRef)((e,t)=>{let n=R(d_().getDescriptionProps(),e);return(0,I.jsx)(B.div,{...n,ref:t})});g_.displayName=`DialogDescription`;var __=(0,F.forwardRef)((e,t)=>{let n=R(d_().getPositionerProps(),e);return Ks().unmounted?null:(0,I.jsx)(B.div,{...n,ref:t})});__.displayName=`DialogPositioner`;var v_=e=>{let t=(0,F.useId)(),{getRootNode:n}=Nr(),{dir:r}=ys();return rm(Ps(im,{id:t,getRootNode:n,dir:r,...e}),zs)},y_=e=>{let[t,{children:n,...r}]=Cs(e),[i]=xc(t),a=v_(r),o=Us(R({present:a.open},t));return(0,I.jsx)(u_,{value:a,children:(0,I.jsx)(yc,{value:i,children:(0,I.jsx)(Gs,{value:o,children:n})})})},b_=e=>{let[t,{value:n,children:r}]=Cs(e),[i]=xc(t),a=Us(R({present:n.open},t));return(0,I.jsx)(u_,{value:n,children:(0,I.jsx)(yc,{value:i,children:(0,I.jsx)(Gs,{value:a,children:r})})})},x_=(0,F.forwardRef)((e,t)=>{let n=R(d_().getTitleProps(),e);return(0,I.jsx)(B.h2,{...n,ref:t})});x_.displayName=`DialogTitle`;var S_=Ss(),C_=(0,F.forwardRef)((e,t)=>{let[n,r]=S_(e,[`value`]),i=d_(),a=Ks(),o=i.getTriggerProps(n),s=R({...o,"aria-controls":a.unmounted?void 0:o[`aria-controls`]},r);return(0,I.jsx)(B.button,{...s,ref:t})});C_.displayName=`DialogTrigger`;var w_=xs({Backdrop:()=>f_,CloseTrigger:()=>p_,Content:()=>m_,Context:()=>h_,Description:()=>g_,Positioner:()=>__,Root:()=>y_,RootProvider:()=>b_,Title:()=>x_,Trigger:()=>C_}),T_=e=>{let{children:t,disabled:n}=e,[r,i]=(0,F.useState)(e.container?.current),a=(0,F.useSyncExternalStore)(D_,()=>!1,()=>!0),{getRootNode:o}=Nr();if((0,F.useEffect)(()=>{i(()=>e.container?.current)},[e.container]),a||n)return(0,I.jsx)(I.Fragment,{children:t});let s=r??E_(o);return(0,I.jsx)(I.Fragment,{children:F.Children.map(t,e=>(0,et.createPortal)(e,s))})},E_=e=>{let t=e?.(),n=t.getRootNode();return Ii(n)?n:Ki(t).body},D_=()=>()=>{},[O_,k_]=jr({name:`SelectContext`,hookName:`useSelectContext`,providerName:`<SelectProvider />`}),A_=(0,F.forwardRef)((e,t)=>{let n=R(k_().getClearTriggerProps(),e);return(0,I.jsx)(B.button,{...n,ref:t})});A_.displayName=`SelectClearTrigger`;var j_=(0,F.forwardRef)((e,t)=>{let n=k_(),r=Ks(),i=R(n.getContentProps(),r.getPresenceProps(),e),a=Fr(r.ref,t);return(0,I.jsx)(Ws,{presence:r,children:(0,I.jsx)(B.div,{...i,ref:a})})});j_.displayName=`SelectContent`;var M_=e=>e.children(k_()),N_=(0,F.forwardRef)((e,t)=>{let n=R(k_().getControlProps(),e);return(0,I.jsx)(B.div,{...n,ref:t})});N_.displayName=`SelectControl`;var P_=(0,F.forwardRef)((e,t)=>{let n=k_(),r=R(n.getHiddenSelectProps(),e),i=n.value.length===0,a=Rg();return(0,I.jsxs)(B.select,{"aria-describedby":a?.ariaDescribedby,...r,ref:t,children:[i&&(0,I.jsx)(`option`,{value:``}),n.collection.items.map((e,t)=>(0,I.jsx)(`option`,{value:n.collection.getItemValue(e)??``,disabled:n.collection.getItemDisabled(e),children:n.collection.stringifyItem(e)},t))]})});P_.displayName=`SelectHiddenSelect`;var F_=(0,F.forwardRef)((e,t)=>{let n=R(k_().getIndicatorProps(),e);return(0,I.jsx)(B.div,{...n,ref:t})});F_.displayName=`SelectIndicator`;var[I_,L_]=jr({name:`SelectItemContext`,hookName:`useSelectItemContext`,providerName:`<SelectItemProvider />`}),[R_,z_]=jr({name:`SelectItemPropsContext`,hookName:`useSelectItemPropsContext`,providerName:`<SelectItemPropsProvider />`}),B_=Ss(),V_=(0,F.forwardRef)((e,t)=>{let[n,r]=B_(e,[`item`,`persistFocus`]),i=k_(),a=R(i.getItemProps(n),r),o=i.getItemState(n);return(0,I.jsx)(R_,{value:n,children:(0,I.jsx)(I_,{value:o,children:(0,I.jsx)(B.div,{...a,ref:t})})})});V_.displayName=`SelectItem`;var H_=e=>e.children(L_()),[U_,W_]=jr({name:`SelectItemGroupPropsContext`,hookName:`useSelectItemGroupPropsContext`,providerName:`<SelectItemGroupPropsProvider />`}),G_=Ss(),K_=(0,F.forwardRef)((e,t)=>{let n=(0,F.useId)(),[r,i]=G_(e,[`id`]),a={id:n,...r},o=R(k_().getItemGroupProps(a),i);return(0,I.jsx)(U_,{value:a,children:(0,I.jsx)(B.div,{...o,ref:t})})});K_.displayName=`SelectItemGroup`;var q_=(0,F.forwardRef)((e,t)=>{let n=k_(),r=W_(),i=R(n.getItemGroupLabelProps({htmlFor:r.id}),e);return(0,I.jsx)(B.div,{...i,ref:t})});q_.displayName=`SelectItemGroupLabel`;var J_=(0,F.forwardRef)((e,t)=>{let n=k_(),r=z_(),i=R(n.getItemIndicatorProps(r),e);return(0,I.jsx)(B.div,{...i,ref:t})});J_.displayName=`SelectItemIndicator`;var Y_=(0,F.forwardRef)((e,t)=>{let n=k_(),r=z_(),i=R(n.getItemTextProps(r),e);return(0,I.jsx)(B.span,{...i,ref:t})});Y_.displayName=`SelectItemText`;var X_=(0,F.forwardRef)((e,t)=>{let n=R(k_().getLabelProps(),e);return(0,I.jsx)(B.label,{...n,ref:t})});X_.displayName=`SelectLabel`;var Z_=(0,F.forwardRef)((e,t)=>{let n=R(k_().getListProps(),e);return(0,I.jsx)(B.div,{...n,ref:t})});Z_.displayName=`SelectList`;var Q_=(0,F.forwardRef)((e,t)=>{let n=R(k_().getPositionerProps(),e);return Ks().unmounted?null:(0,I.jsx)(B.div,{...n,ref:t})});Q_.displayName=`SelectPositioner`;var $_=e=>{let t=(0,F.useId)(),{dir:n}=ys(),{getRootNode:r}=Nr(),i=Rg();return Km(Ps(Zm,{id:t,ids:{label:i?.ids.label,hiddenSelect:i?.ids.control},disabled:i?.disabled,readOnly:i?.readOnly,invalid:i?.invalid,required:i?.required,dir:n,getRootNode:r,...e}),zs)},ev=(0,F.forwardRef)((e,t)=>{let[n,r]=Cs(e),[i,a]=Ss()(r,`closeOnSelect.collection.composite.defaultHighlightedValue.defaultOpen.defaultValue.deselectable.disabled.form.highlightedValue.id.ids.invalid.loopFocus.multiple.name.onFocusOutside.onHighlightChange.onInteractOutside.onOpenChange.onPointerDownOutside.onSelect.onValueChange.open.positioning.readOnly.required.scrollToIndexFn.translations.autoComplete.value`.split(`.`)),o=$_(i),s=Us(R({present:o.open},n)),c=R(o.getRootProps(),a);return(0,I.jsx)(O_,{value:o,children:(0,I.jsx)(Gs,{value:s,children:(0,I.jsx)(B.div,{...c,ref:t})})})}),tv=(0,F.forwardRef)((e,t)=>{let[n,r]=Cs(e),[{value:i},a]=Ss()(r,[`value`]),o=Us(R({present:i.open},n)),s=R(i.getRootProps(),a);return(0,I.jsx)(O_,{value:i,children:(0,I.jsx)(Gs,{value:o,children:(0,I.jsx)(B.div,{...s,ref:t})})})}),nv=(0,F.forwardRef)((e,t)=>{let n=R(k_().getTriggerProps(),e);return(0,I.jsx)(B.button,{...n,ref:t})});nv.displayName=`SelectTrigger`;var rv=(0,F.forwardRef)((e,t)=>{let{children:n,placeholder:r,...i}=e,a=k_(),o=R(a.getValueTextProps(),i);return(0,I.jsx)(B.span,{...o,ref:t,children:n||a.valueAsString||r})});rv.displayName=`SelectValueText`;var iv=xs({ClearTrigger:()=>A_,Content:()=>j_,Context:()=>M_,Control:()=>N_,HiddenSelect:()=>P_,Indicator:()=>F_,Item:()=>V_,ItemContext:()=>H_,ItemGroup:()=>K_,ItemGroupLabel:()=>q_,ItemIndicator:()=>J_,ItemText:()=>Y_,Label:()=>X_,List:()=>Z_,Positioner:()=>Q_,Root:()=>ev,RootProvider:()=>tv,Trigger:()=>nv,ValueText:()=>rv}),av=e=>ag(e),[ov,sv]=jr({name:`SplitterContext`,hookName:`useSplitterContext`,providerName:`<SplitterProvider />`}),cv=e=>e.children(sv()),lv=Ss(),uv=(0,F.forwardRef)((e,t)=>{let[n,r]=lv(e,[`id`]),i=R(sv().getPanelProps(n),r);return(0,I.jsx)(B.div,{...i,ref:t})});uv.displayName=`SplitterPanel`;var[dv,fv]=jr({name:`SplitterResizeTriggerPropsContext`,hookName:`useSplitterResizeTriggerPropsContext`,providerName:`<SplitterResizeTriggerPropsProvider />`}),pv=Ss(),mv=(0,F.forwardRef)((e,t)=>{let[n,r]=pv(e,[`disabled`,`id`]),i=R(sv().getResizeTriggerProps(n),r);return(0,I.jsx)(dv,{value:n,children:(0,I.jsx)(B.button,{ref:t,...i})})});mv.displayName=`SplitterResizeTrigger`;var hv=(0,F.forwardRef)((e,t)=>{let n=sv(),r=fv(),i=R(n.getResizeTriggerIndicator(r),e);return(0,I.jsx)(B.div,{ref:t,...i})});hv.displayName=`SplitterResizeTriggerIndicator`;var gv=e=>{let t=(0,F.useId)(),{getRootNode:n}=Nr(),{dir:r}=ys();return Uh(Ps(Jh,{id:t,dir:r,getRootNode:n,...e}),zs)},_v=Ss(),vv=(0,F.forwardRef)((e,t)=>{let[n,r]=_v(e,[`defaultSize`,`id`,`ids`,`keyboardResizeBy`,`nonce`,`onCollapse`,`onExpand`,`onResize`,`onResizeEnd`,`onResizeStart`,`orientation`,`panels`,`registry`,`size`]),i=gv(n),a=R(i.getRootProps(),r);return(0,I.jsx)(ov,{value:i,children:(0,I.jsx)(B.div,{...a,ref:t})})});vv.displayName=`SplitterRoot`;var yv=Ss(),bv=(0,F.forwardRef)((e,t)=>{let[{value:n},r]=yv(e,[`value`]),i=R(n.getRootProps(),r);return(0,I.jsx)(ov,{value:n,children:(0,I.jsx)(B.div,{...i,ref:t})})});bv.displayName=`SplitterRootProvider`;var xv=xs({Context:()=>cv,Panel:()=>uv,ResizeTrigger:()=>mv,ResizeTriggerIndicator:()=>hv,Root:()=>vv,RootProvider:()=>bv,createRegistry:()=>av,getLayout:()=>zh}),[Sv,Cv]=jr({name:`SwitchContext`,hookName:`useSwitchContext`,providerName:`<SwitchProvider />`}),wv=e=>e.children(Cv()),Tv=(0,F.forwardRef)((e,t)=>{let n=R(Cv().getControlProps(),e);return(0,I.jsx)(B.span,{...n,ref:t})});Tv.displayName=`SwitchControl`;var Ev=(0,F.forwardRef)((e,t)=>{let n=R(Cv().getHiddenInputProps(),e),r=Rg();return(0,I.jsx)(B.input,{"aria-describedby":r?.ariaDescribedby,...n,ref:t})});Ev.displayName=`SwitchHiddenInput`;var Dv=(0,F.forwardRef)((e,t)=>{let n=R(Cv().getLabelProps(),e);return(0,I.jsx)(B.span,{...n,ref:t})});Dv.displayName=`SwitchLabel`;var Ov=e=>{let t=(0,F.useId)(),{getRootNode:n}=Nr(),{dir:r}=ys(),i=Rg();return hg(Ps(_g,{id:t,ids:{label:i?.ids.label,hiddenInput:i?.ids.control},dir:r,disabled:i?.disabled,readOnly:i?.readOnly,invalid:i?.invalid,required:i?.required,getRootNode:n,...e}),zs)},kv=Ss(),Av=(0,F.forwardRef)((e,t)=>{let[n,r]=kv(e,[`checked`,`defaultChecked`,`disabled`,`form`,`id`,`ids`,`invalid`,`label`,`name`,`onCheckedChange`,`readOnly`,`required`,`value`]),i=Ov(n),a=R(i.getRootProps(),r);return(0,I.jsx)(Sv,{value:i,children:(0,I.jsx)(B.label,{...a,ref:t})})});Av.displayName=`SwitchRoot`;var jv=Ss(),Mv=(0,F.forwardRef)((e,t)=>{let[{value:n},r]=jv(e,[`value`]),i=R(n.getRootProps(),r);return(0,I.jsx)(Sv,{value:n,children:(0,I.jsx)(B.label,{...i,ref:t})})});Mv.displayName=`SwitchRootProvider`;var Nv=(0,F.forwardRef)((e,t)=>{let n=R(Cv().getThumbProps(),e);return(0,I.jsx)(B.span,{...n,ref:t})});Nv.displayName=`SwitchThumb`;var Pv=xs({Context:()=>wv,Control:()=>Tv,HiddenInput:()=>Ev,Label:()=>Dv,Root:()=>Av,RootProvider:()=>Mv,Thumb:()=>Nv});function Fv(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}var Iv=(e,t)=>{if(!e||typeof e!=`string`)return{invalid:!0,value:e};let[n,r]=e.split(`/`);if(!n||!r||n===`currentBg`)return{invalid:!0,value:n};let i=t(`colors.${n}`),a=t.raw(`opacity.${r}`)?.value;if(!a&&isNaN(Number(r)))return{invalid:!0,value:n};let o=a?Number(a)*100+`%`:`${r}%`,s=i??n;return{invalid:!1,color:s,value:`color-mix(in srgb, ${s} ${o}, transparent)`}},Lv=e=>(t,n)=>{let r=n.utils.colorMix(t);if(r.invalid)return{[e]:t};let i=`--mix-`+e;return{[i]:r.value,[e]:`var(${i}, ${r.color})`}};function Rv(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(e=>Rv(e));let t=Object.create(Object.getPrototypeOf(e));for(let n of Object.keys(e))t[n]=Rv(e[n]);return t}function zv(e,t){if(t==null)return e;for(let n of Object.keys(t))if(t[n]!==void 0&&n!==`__proto__`){if(!Wt(e[n])&&Wt(t[n]))Object.assign(e,{[n]:t[n]});else if(e[n]&&Wt(t[n]))zv(e[n],t[n]);else if(Array.isArray(t[n])&&Array.isArray(e[n])){let r=0;for(;r<t[n].length;r++)Wt(e[n][r])&&Wt(t[n][r])?zv(e[n][r],t[n][r]):e[n][r]=t[n][r]}else Object.assign(e,{[n]:t[n]})}return e}function Bv(e,...t){for(let n of t)zv(e,n);return e}var Vv=e=>e!=null;function Hv(e,t,n={}){let{stop:r,getKey:i}=n;function a(e,n=[]){if(Wt(e)||Array.isArray(e)){let o={};for(let[s,c]of Object.entries(e)){let l=i?.(s,c)??s,u=[...n,l];if(r?.(e,u))return t(e,n);let d=a(c,u);Vv(d)&&(o[l]=d)}return o}return t(e,n)}return a(e)}function Uv(e,t){return Array.isArray(e)?e.map(e=>Vv(e)?t(e):e):Wt(e)?Hv(e,e=>t(e)):Vv(e)?t(e):e}var Wv=[`value`,`type`,`description`],Gv=e=>e&&typeof e==`object`&&!Array.isArray(e),Kv=(...e)=>{let t=Bv({},...e.map(Rv));return t.theme?.tokens&&Hv(t.theme.tokens,e=>{let t=Object.keys(e).filter(e=>!Wv.includes(e)).length>0,n=Wv.some(t=>e[t]!=null);return t&&n&&(e.DEFAULT||={},Wv.forEach(t=>{var n;e[t]!=null&&((n=e.DEFAULT)[t]||(n[t]=e[t]),delete e[t])})),e},{stop(e){return Gv(e)&&Wv.some(t=>e[t]!=null)}}),t},qv=e=>e,Jv=e=>e,W=e=>e,Yv=e=>e,Xv=e=>e,Zv=e=>e,Qv=e=>e,$v=e=>e,ey=e=>e;function ty(){let e=e=>e;return new Proxy(e,{get(){return e}})}var ny=ty(),ry=ty(),iy=e=>e,ay=/[^a-zA-Z0-9_\u0081-\uffff-]/g;function oy(e){return`${e}`.replace(ay,e=>`\\${e}`)}var sy=/[A-Z]/g;function cy(e){return e.replace(sy,e=>`-${e.toLowerCase()}`)}function ly(e,t={}){let{fallback:n=``,prefix:r=``}=t,i=cy([`-`,r,oy(e)].filter(Boolean).join(`-`));return{var:i,ref:`var(${i}${n?`, ${n}`:``})`}}var uy=e=>/^var\(--.+\)$/.test(e),dy=(e,t)=>t==null?t:`${e}(${t})`,fy=e=>{if(uy(e)||e==null)return e;let t=typeof e==`string`&&!e.endsWith(`deg`);return typeof e==`number`||t?`${e}deg`:e},py=e=>({values:[`outside`,`inside`,`mixed`,`none`],transform(t,{token:n}){let r=n(`colors.colorPalette.focusRing`);return{inside:{"--focus-ring-color":r,[e]:{outlineOffset:`0px`,outlineWidth:`var(--focus-ring-width, 1px)`,outlineColor:`var(--focus-ring-color)`,outlineStyle:`var(--focus-ring-style, solid)`,borderColor:`var(--focus-ring-color)`}},outside:{"--focus-ring-color":r,[e]:{outlineWidth:`var(--focus-ring-width, 2px)`,outlineOffset:`var(--focus-ring-offset, 2px)`,outlineStyle:`var(--focus-ring-style, solid)`,outlineColor:`var(--focus-ring-color)`}},mixed:{"--focus-ring-color":r,[e]:{outlineWidth:`var(--focus-ring-width, 3px)`,outlineStyle:`var(--focus-ring-style, solid)`,outlineColor:`color-mix(in srgb, var(--focus-ring-color), transparent 60%)`,borderColor:`var(--focus-ring-color)`}},none:{"--focus-ring-color":r,[e]:{outline:`none`}}}[t]??{}}}),my=Lv(`borderColor`),hy=e=>({transition:e,transitionTimingFunction:`cubic-bezier(0.4, 0, 0.2, 1)`,transitionDuration:`150ms`}),gy=qv({hover:[`@media (hover: hover)`,`&:is(:hover, [data-hover]):not(:disabled, [data-disabled])`],active:`&:is(:active, [data-active]):not(:disabled, [data-disabled], [data-state=open])`,focus:`&:is(:focus, [data-focus])`,focusWithin:`&:is(:focus-within, [data-focus-within])`,focusVisible:`&:is(:focus-visible, [data-focus-visible])`,disabled:`&:is(:disabled, [disabled], [data-disabled], [aria-disabled=true])`,visited:`&:visited`,target:`&:target`,readOnly:`&:is([data-readonly], [aria-readonly=true], [readonly])`,readWrite:`&:read-write`,empty:`&:is(:empty, [data-empty])`,checked:`&:is(:checked, [data-checked], [aria-checked=true], [data-state=checked])`,enabled:`&:enabled`,expanded:`&:is([aria-expanded=true], [data-expanded], [data-state=expanded])`,highlighted:`&[data-highlighted]`,complete:`&[data-complete]`,incomplete:`&[data-incomplete]`,dragging:`&[data-dragging]`,before:`&::before`,after:`&::after`,firstLetter:`&::first-letter`,firstLine:`&::first-line`,marker:`&::marker`,selection:`&::selection`,file:`&::file-selector-button`,backdrop:`&::backdrop`,first:`&:first-of-type`,last:`&:last-of-type`,notFirst:`&:not(:first-of-type)`,notLast:`&:not(:last-of-type)`,only:`&:only-child`,even:`&:nth-of-type(even)`,odd:`&:nth-of-type(odd)`,peerFocus:`.peer:is(:focus, [data-focus]) ~ &`,peerHover:`.peer:is(:hover, [data-hover]):not(:disabled, [data-disabled]) ~ &`,peerActive:`.peer:is(:active, [data-active]):not(:disabled, [data-disabled]) ~ &`,peerFocusWithin:`.peer:focus-within ~ &`,peerFocusVisible:`.peer:is(:focus-visible, [data-focus-visible]) ~ &`,peerDisabled:`.peer:is(:disabled, [disabled], [data-disabled]) ~ &`,peerChecked:`.peer:is(:checked, [data-checked], [aria-checked=true], [data-state=checked]) ~ &`,peerInvalid:`.peer:is(:invalid, [data-invalid], [aria-invalid=true]) ~ &`,peerExpanded:`.peer:is([aria-expanded=true], [data-expanded], [data-state=expanded]) ~ &`,peerPlaceholderShown:`.peer:placeholder-shown ~ &`,groupFocus:`.group:is(:focus, [data-focus]) &`,groupHover:`.group:is(:hover, [data-hover]):not(:disabled, [data-disabled]) &`,groupActive:`.group:is(:active, [data-active]):not(:disabled, [data-disabled]) &`,groupFocusWithin:`.group:focus-within &`,groupFocusVisible:`.group:is(:focus-visible, [data-focus-visible]) &`,groupDisabled:`.group:is(:disabled, [disabled], [data-disabled]) &`,groupChecked:`.group:is(:checked, [data-checked], [aria-checked=true], [data-state=checked]) &`,groupExpanded:`.group:is([aria-expanded=true], [data-expanded], [data-state=expanded]) &`,groupInvalid:`.group:invalid &`,indeterminate:`&:is(:indeterminate, [data-indeterminate], [aria-checked=mixed], [data-state=indeterminate])`,required:`&:is([data-required], [aria-required=true])`,valid:`&:is([data-valid], [data-state=valid])`,invalid:`&:is([data-invalid], [aria-invalid=true], [data-state=invalid])`,autofill:`&:autofill`,inRange:`&:is(:in-range, [data-in-range])`,outOfRange:`&:is(:out-of-range, [data-outside-range])`,placeholder:`&::placeholder, &[data-placeholder]`,placeholderShown:`&:is(:placeholder-shown, [data-placeholder-shown])`,pressed:`&:is([aria-pressed=true], [data-pressed])`,selected:`&:is([aria-selected=true], [data-selected])`,grabbed:`&:is([aria-grabbed=true], [data-grabbed])`,underValue:`&[data-state=under-value]`,overValue:`&[data-state=over-value]`,atValue:`&[data-state=at-value]`,default:`&:default`,optional:`&:optional`,open:`&:is([open], [data-open], [data-state=open])`,closed:`&:is([closed], [data-closed], [data-state=closed])`,fullscreen:`&:is(:fullscreen, [data-fullscreen])`,loading:`&:is([data-loading], [aria-busy=true])`,hidden:`&:is([hidden], [data-hidden])`,current:`&[data-current]`,currentPage:`&[aria-current=page]`,currentStep:`&[aria-current=step]`,today:`&[data-today]`,unavailable:`&[data-unavailable]`,rangeStart:`&[data-range-start]`,rangeEnd:`&[data-range-end]`,now:`&[data-now]`,topmost:`&[data-topmost]`,motionReduce:`@media (prefers-reduced-motion: reduce)`,motionSafe:`@media (prefers-reduced-motion: no-preference)`,print:`@media print`,landscape:`@media (orientation: landscape)`,portrait:`@media (orientation: portrait)`,dark:`.dark &, .dark .chakra-theme:not(.light) &`,light:`:root &, .light &`,osDark:`@media (prefers-color-scheme: dark)`,osLight:`@media (prefers-color-scheme: light)`,highContrast:`@media (forced-colors: active)`,lessContrast:`@media (prefers-contrast: less)`,moreContrast:`@media (prefers-contrast: more)`,ltr:`[dir=ltr] &`,rtl:`[dir=rtl] &`,scrollbar:`&::-webkit-scrollbar`,scrollbarThumb:`&::-webkit-scrollbar-thumb`,scrollbarTrack:`&::-webkit-scrollbar-track`,horizontal:`&[data-orientation=horizontal]`,vertical:`&[data-orientation=vertical]`,icon:`& :where(svg)`,starting:`@starting-style`}),_y=ly(`bg-currentcolor`),vy=e=>e===_y.ref||e===`currentBg`,yy=e=>({...e(`colors`),currentBg:_y}),by=iy({conditions:gy,utilities:{background:{values:yy,shorthand:[`bg`],transform(e,t){if(vy(t.raw))return{background:_y.ref};let n=Lv(`background`)(e,t);return{...n,[_y.var]:n?.background}}},backgroundColor:{values:yy,shorthand:[`bgColor`],transform(e,t){if(vy(t.raw))return{backgroundColor:_y.ref};let n=Lv(`backgroundColor`)(e,t);return{...n,[_y.var]:n?.backgroundColor}}},backgroundSize:{shorthand:[`bgSize`]},backgroundPosition:{shorthand:[`bgPos`]},backgroundRepeat:{shorthand:[`bgRepeat`]},backgroundAttachment:{shorthand:[`bgAttachment`]},backgroundClip:{shorthand:[`bgClip`],values:[`text`],transform(e){return e===`text`?{color:`transparent`,backgroundClip:`text`}:{backgroundClip:e}}},backgroundGradient:{shorthand:[`bgGradient`],values(e){return{...e(`gradients`),"to-t":`linear-gradient(to top, var(--gradient))`,"to-tr":`linear-gradient(to top right, var(--gradient))`,"to-r":`linear-gradient(to right, var(--gradient))`,"to-br":`linear-gradient(to bottom right, var(--gradient))`,"to-b":`linear-gradient(to bottom, var(--gradient))`,"to-bl":`linear-gradient(to bottom left, var(--gradient))`,"to-l":`linear-gradient(to left, var(--gradient))`,"to-tl":`linear-gradient(to top left, var(--gradient))`}},transform(e){return{"--gradient-stops":`var(--gradient-from), var(--gradient-to)`,"--gradient":`var(--gradient-via-stops, var(--gradient-stops))`,backgroundImage:e}}},gradientFrom:{values:yy,transform:Lv(`--gradient-from`)},gradientTo:{values:yy,transform:Lv(`--gradient-to`)},gradientVia:{values:yy,transform(e,t){return{...Lv(`--gradient-via`)(e,t),"--gradient-via-stops":`var(--gradient-from), var(--gradient-via), var(--gradient-to)`}}},backgroundImage:{values(e){return{...e(`gradients`),...e(`assets`)}},shorthand:[`bgImg`,`bgImage`]},border:{values:`borders`},borderTop:{values:`borders`},borderLeft:{values:`borders`},borderBlockStart:{values:`borders`},borderRight:{values:`borders`},borderBottom:{values:`borders`},borderBlockEnd:{values:`borders`},borderInlineStart:{values:`borders`,shorthand:[`borderStart`]},borderInlineEnd:{values:`borders`,shorthand:[`borderEnd`]},borderInline:{values:`borders`,shorthand:[`borderX`]},borderBlock:{values:`borders`,shorthand:[`borderY`]},borderColor:{values:yy,transform:Lv(`borderColor`)},borderTopColor:{values:yy,transform:Lv(`borderTopColor`)},borderBlockStartColor:{values:yy,transform:Lv(`borderBlockStartColor`)},borderBottomColor:{values:yy,transform:Lv(`borderBottomColor`)},borderBlockEndColor:{values:yy,transform:Lv(`borderBlockEndColor`)},borderLeftColor:{values:yy,transform:Lv(`borderLeftColor`)},borderInlineStartColor:{values:yy,shorthand:[`borderStartColor`],transform:Lv(`borderInlineStartColor`)},borderRightColor:{values:yy,transform:Lv(`borderRightColor`)},borderInlineEndColor:{values:yy,shorthand:[`borderEndColor`],transform:Lv(`borderInlineEndColor`)},borderStyle:{values:`borderStyles`},borderTopStyle:{values:`borderStyles`},borderBlockStartStyle:{values:`borderStyles`},borderBottomStyle:{values:`borderStyles`},borderBlockEndStyle:{values:`borderStyles`},borderInlineStartStyle:{values:`borderStyles`,shorthand:[`borderStartStyle`]},borderInlineEndStyle:{values:`borderStyles`,shorthand:[`borderEndStyle`]},borderLeftStyle:{values:`borderStyles`},borderRightStyle:{values:`borderStyles`},borderRadius:{values:`radii`,shorthand:[`rounded`]},borderTopLeftRadius:{values:`radii`,shorthand:[`roundedTopLeft`]},borderStartStartRadius:{values:`radii`,shorthand:[`roundedStartStart`,`borderTopStartRadius`]},borderEndStartRadius:{values:`radii`,shorthand:[`roundedEndStart`,`borderBottomStartRadius`]},borderTopRightRadius:{values:`radii`,shorthand:[`roundedTopRight`]},borderStartEndRadius:{values:`radii`,shorthand:[`roundedStartEnd`,`borderTopEndRadius`]},borderEndEndRadius:{values:`radii`,shorthand:[`roundedEndEnd`,`borderBottomEndRadius`]},borderBottomLeftRadius:{values:`radii`,shorthand:[`roundedBottomLeft`]},borderBottomRightRadius:{values:`radii`,shorthand:[`roundedBottomRight`]},borderInlineStartRadius:{values:`radii`,property:`borderRadius`,shorthand:[`roundedStart`,`borderStartRadius`],transform:e=>({borderStartStartRadius:e,borderEndStartRadius:e})},borderInlineEndRadius:{values:`radii`,property:`borderRadius`,shorthand:[`roundedEnd`,`borderEndRadius`],transform:e=>({borderStartEndRadius:e,borderEndEndRadius:e})},borderTopRadius:{values:`radii`,property:`borderRadius`,shorthand:[`roundedTop`],transform:e=>({borderTopLeftRadius:e,borderTopRightRadius:e})},borderBottomRadius:{values:`radii`,property:`borderRadius`,shorthand:[`roundedBottom`],transform:e=>({borderBottomLeftRadius:e,borderBottomRightRadius:e})},borderLeftRadius:{values:`radii`,property:`borderRadius`,shorthand:[`roundedLeft`],transform:e=>({borderTopLeftRadius:e,borderBottomLeftRadius:e})},borderRightRadius:{values:`radii`,property:`borderRadius`,shorthand:[`roundedRight`],transform:e=>({borderTopRightRadius:e,borderBottomRightRadius:e})},borderWidth:{values:`borderWidths`},borderBlockStartWidth:{values:`borderWidths`},borderTopWidth:{values:`borderWidths`},borderBottomWidth:{values:`borderWidths`},borderBlockEndWidth:{values:`borderWidths`},borderRightWidth:{values:`borderWidths`},borderInlineWidth:{values:`borderWidths`,shorthand:[`borderXWidth`]},borderInlineStartWidth:{values:`borderWidths`,shorthand:[`borderStartWidth`]},borderInlineEndWidth:{values:`borderWidths`,shorthand:[`borderEndWidth`]},borderLeftWidth:{values:`borderWidths`},borderBlockWidth:{values:`borderWidths`,shorthand:[`borderYWidth`]},color:{values:yy,transform:Lv(`color`)},fill:{values:yy,transform:Lv(`fill`)},stroke:{values:yy,transform:Lv(`stroke`)},accentColor:{values:yy,transform:Lv(`accentColor`)},divideX:{values:{type:`string`},transform(e){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":{borderInlineStartWidth:e,borderInlineEndWidth:`0px`}}}},divideY:{values:{type:`string`},transform(e){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":{borderTopWidth:e,borderBottomWidth:`0px`}}}},divideColor:{values:yy,transform(e,t){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":my(e,t)}}},divideStyle:{property:`borderStyle`,transform(e){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":{borderStyle:e}}}},boxShadow:{values:`shadows`,shorthand:[`shadow`]},boxShadowColor:{values:yy,transform:Lv(`--shadow-color`),shorthand:[`shadowColor`]},mixBlendMode:{shorthand:[`blendMode`]},backgroundBlendMode:{shorthand:[`bgBlendMode`]},opacity:{values:`opacity`},filter:{transform(e){return e===`auto`?{filter:`var(--blur) var(--brightness) var(--contrast) var(--grayscale) var(--hue-rotate) var(--invert) var(--saturate) var(--sepia) var(--drop-shadow)`}:{filter:e}}},blur:{values:`blurs`,transform:e=>({"--blur":dy(`blur`,e)})},brightness:{transform:e=>({"--brightness":dy(`brightness`,e)})},contrast:{transform:e=>({"--contrast":dy(`contrast`,e)})},grayscale:{transform:e=>({"--grayscale":dy(`grayscale`,e)})},hueRotate:{transform:e=>({"--hue-rotate":dy(`hue-rotate`,fy(e))})},invert:{transform:e=>({"--invert":dy(`invert`,e)})},saturate:{transform:e=>({"--saturate":dy(`saturate`,e)})},sepia:{transform:e=>({"--sepia":dy(`sepia`,e)})},dropShadow:{transform:e=>({"--drop-shadow":dy(`drop-shadow`,e)})},backdropFilter:{transform(e){return e===`auto`?{backdropFilter:`var(--backdrop-blur) var(--backdrop-brightness) var(--backdrop-contrast) var(--backdrop-grayscale) var(--backdrop-hue-rotate) var(--backdrop-invert) var(--backdrop-opacity) var(--backdrop-saturate) var(--backdrop-sepia)`}:{backdropFilter:e}}},backdropBlur:{values:`blurs`,transform:e=>({"--backdrop-blur":dy(`blur`,e)})},backdropBrightness:{transform:e=>({"--backdrop-brightness":dy(`brightness`,e)})},backdropContrast:{transform:e=>({"--backdrop-contrast":dy(`contrast`,e)})},backdropGrayscale:{transform:e=>({"--backdrop-grayscale":dy(`grayscale`,e)})},backdropHueRotate:{transform:e=>({"--backdrop-hue-rotate":dy(`hue-rotate`,fy(e))})},backdropInvert:{transform:e=>({"--backdrop-invert":dy(`invert`,e)})},backdropOpacity:{transform:e=>({"--backdrop-opacity":dy(`opacity`,e)})},backdropSaturate:{transform:e=>({"--backdrop-saturate":dy(`saturate`,e)})},backdropSepia:{transform:e=>({"--backdrop-sepia":dy(`sepia`,e)})},flexBasis:{values:`sizes`},gap:{values:`spacing`},rowGap:{values:`spacing`,shorthand:[`gapY`]},columnGap:{values:`spacing`,shorthand:[`gapX`]},flexDirection:{shorthand:[`flexDir`]},gridGap:{values:`spacing`},gridColumnGap:{values:`spacing`},gridRowGap:{values:`spacing`},outlineColor:{values:yy,transform:Lv(`outlineColor`)},focusRing:py(`&:is(:focus, [data-focus])`),focusVisibleRing:py(`&:is(:focus-visible, [data-focus-visible])`),focusRingColor:{values:yy,transform:Lv(`--focus-ring-color`)},focusRingOffset:{values:`spacing`,transform:e=>({"--focus-ring-offset":e})},focusRingWidth:{values:`borderWidths`,property:`outlineWidth`,transform:e=>({"--focus-ring-width":e})},focusRingStyle:{values:`borderStyles`,property:`outlineStyle`,transform:e=>({"--focus-ring-style":e})},aspectRatio:{values:`aspectRatios`},width:{values:`sizes`,shorthand:[`w`]},inlineSize:{values:`sizes`},height:{values:`sizes`,shorthand:[`h`]},blockSize:{values:`sizes`},boxSize:{values:`sizes`,property:`width`,transform:e=>({width:e,height:e})},minWidth:{values:`sizes`,shorthand:[`minW`]},minInlineSize:{values:`sizes`},minHeight:{values:`sizes`,shorthand:[`minH`]},minBlockSize:{values:`sizes`},maxWidth:{values:`sizes`,shorthand:[`maxW`]},maxInlineSize:{values:`sizes`},maxHeight:{values:`sizes`,shorthand:[`maxH`]},maxBlockSize:{values:`sizes`},hideFrom:{values:`breakpoints`,transform:(e,{raw:t,token:n})=>({[n.raw(`breakpoints.${t}`)?`@breakpoint ${t}`:`@media screen and (min-width: ${e})`]:{display:`none`}})},hideBelow:{values:`breakpoints`,transform(e,{raw:t,token:n}){return{[n.raw(`breakpoints.${t}`)?`@breakpoint ${t}Down`:`@media screen and (max-width: ${e})`]:{display:`none`}}}},overscrollBehavior:{shorthand:[`overscroll`]},overscrollBehaviorX:{shorthand:[`overscrollX`]},overscrollBehaviorY:{shorthand:[`overscrollY`]},scrollbar:{values:[`visible`,`hidden`],transform(e){switch(e){case`visible`:return{msOverflowStyle:`auto`,scrollbarWidth:`auto`,"&::-webkit-scrollbar":{display:`block`}};case`hidden`:return{msOverflowStyle:`none`,scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}};default:return{}}}},scrollbarColor:{values:yy,transform:Lv(`scrollbarColor`)},scrollbarGutter:{values:`spacing`},scrollbarWidth:{values:`sizes`},scrollMargin:{values:`spacing`},scrollMarginTop:{values:`spacing`},scrollMarginBottom:{values:`spacing`},scrollMarginLeft:{values:`spacing`},scrollMarginRight:{values:`spacing`},scrollMarginX:{values:`spacing`,transform:e=>({scrollMarginLeft:e,scrollMarginRight:e})},scrollMarginY:{values:`spacing`,transform:e=>({scrollMarginTop:e,scrollMarginBottom:e})},scrollPadding:{values:`spacing`},scrollPaddingTop:{values:`spacing`},scrollPaddingBottom:{values:`spacing`},scrollPaddingLeft:{values:`spacing`},scrollPaddingRight:{values:`spacing`},scrollPaddingInline:{values:`spacing`,shorthand:[`scrollPaddingX`]},scrollPaddingBlock:{values:`spacing`,shorthand:[`scrollPaddingY`]},scrollSnapType:{values:{none:`none`,x:`x var(--scroll-snap-strictness)`,y:`y var(--scroll-snap-strictness)`,both:`both var(--scroll-snap-strictness)`}},scrollSnapStrictness:{values:[`mandatory`,`proximity`],transform:e=>({"--scroll-snap-strictness":e})},scrollSnapMargin:{values:`spacing`},scrollSnapMarginTop:{values:`spacing`},scrollSnapMarginBottom:{values:`spacing`},scrollSnapMarginLeft:{values:`spacing`},scrollSnapMarginRight:{values:`spacing`},listStylePosition:{shorthand:[`listStylePos`]},listStyleImage:{values:`assets`,shorthand:[`listStyleImg`]},position:{shorthand:[`pos`]},zIndex:{values:`zIndex`},inset:{values:`spacing`},insetInline:{values:`spacing`,shorthand:[`insetX`]},insetBlock:{values:`spacing`,shorthand:[`insetY`]},top:{values:`spacing`},insetBlockStart:{values:`spacing`},bottom:{values:`spacing`},insetBlockEnd:{values:`spacing`},left:{values:`spacing`},right:{values:`spacing`},insetInlineStart:{values:`spacing`,shorthand:[`insetStart`]},insetInlineEnd:{values:`spacing`,shorthand:[`insetEnd`]},ring:{transform(e){return{"--ring-offset-shadow":`var(--ring-inset) 0 0 0 var(--ring-offset-width) var(--ring-offset-color)`,"--ring-shadow":`var(--ring-inset) 0 0 0 calc(var(--ring-width) + var(--ring-offset-width)) var(--ring-color)`,"--ring-width":e,boxShadow:`var(--ring-offset-shadow), var(--ring-shadow), var(--shadow, 0 0 #0000)`}}},ringColor:{values:yy,transform:Lv(`--ring-color`)},ringOffset:{transform:e=>({"--ring-offset-width":e})},ringOffsetColor:{values:yy,transform:Lv(`--ring-offset-color`)},ringInset:{transform:e=>({"--ring-inset":e})},margin:{values:`spacing`,shorthand:[`m`]},marginTop:{values:`spacing`,shorthand:[`mt`]},marginBlockStart:{values:`spacing`},marginRight:{values:`spacing`,shorthand:[`mr`]},marginBottom:{values:`spacing`,shorthand:[`mb`]},marginBlockEnd:{values:`spacing`},marginLeft:{values:`spacing`,shorthand:[`ml`]},marginInlineStart:{values:`spacing`,shorthand:[`ms`,`marginStart`]},marginInlineEnd:{values:`spacing`,shorthand:[`me`,`marginEnd`]},marginInline:{values:`spacing`,shorthand:[`mx`,`marginX`]},marginBlock:{values:`spacing`,shorthand:[`my`,`marginY`]},padding:{values:`spacing`,shorthand:[`p`]},paddingTop:{values:`spacing`,shorthand:[`pt`]},paddingRight:{values:`spacing`,shorthand:[`pr`]},paddingBottom:{values:`spacing`,shorthand:[`pb`]},paddingBlockStart:{values:`spacing`},paddingBlockEnd:{values:`spacing`},paddingLeft:{values:`spacing`,shorthand:[`pl`]},paddingInlineStart:{values:`spacing`,shorthand:[`ps`,`paddingStart`]},paddingInlineEnd:{values:`spacing`,shorthand:[`pe`,`paddingEnd`]},paddingInline:{values:`spacing`,shorthand:[`px`,`paddingX`]},paddingBlock:{values:`spacing`,shorthand:[`py`,`paddingY`]},textDecoration:{shorthand:[`textDecor`]},textDecorationColor:{values:yy,transform:Lv(`textDecorationColor`)},textShadow:{values:`shadows`},transform:{transform:e=>{let t=e;return e===`auto`&&(t=`translateX(var(--translate-x, 0)) translateY(var(--translate-y, 0)) rotate(var(--rotate, 0)) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1)) skewX(var(--skew-x, 0)) skewY(var(--skew-y, 0))`),e===`auto-gpu`&&(t=`translate3d(var(--translate-x, 0), var(--translate-y, 0), 0) rotate(var(--rotate, 0)) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1)) skewX(var(--skew-x, 0)) skewY(var(--skew-y, 0))`),{transform:t}}},skewX:{transform:e=>({"--skew-x":fy(e)})},skewY:{transform:e=>({"--skew-y":fy(e)})},scaleX:{transform:e=>({"--scale-x":e})},scaleY:{transform:e=>({"--scale-y":e})},scale:{transform(e){return e===`auto`?{scale:`var(--scale-x, 1) var(--scale-y, 1)`}:{scale:e}}},spaceXReverse:{values:{type:`boolean`},transform(e){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":{"--space-x-reverse":e?`1`:void 0}}}},spaceX:{property:`marginInlineStart`,values:`spacing`,transform:e=>({"& > :not(style, [hidden]) ~ :not(style, [hidden])":{"--space-x-reverse":`0`,marginInlineStart:`calc(${e} * calc(1 - var(--space-x-reverse)))`,marginInlineEnd:`calc(${e} * var(--space-x-reverse))`}})},spaceYReverse:{values:{type:`boolean`},transform(e){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":{"--space-y-reverse":e?`1`:void 0}}}},spaceY:{property:`marginTop`,values:`spacing`,transform:e=>({"& > :not(style, [hidden]) ~ :not(style, [hidden])":{"--space-y-reverse":`0`,marginTop:`calc(${e} * calc(1 - var(--space-y-reverse)))`,marginBottom:`calc(${e} * var(--space-y-reverse))`}})},rotate:{transform(e){return e===`auto`?{rotate:`var(--rotate-x, 0) var(--rotate-y, 0) var(--rotate-z, 0)`}:{rotate:fy(e)}}},rotateX:{transform(e){return{"--rotate-x":fy(e)}}},rotateY:{transform(e){return{"--rotate-y":fy(e)}}},translate:{transform(e){return e===`auto`?{translate:`var(--translate-x) var(--translate-y)`}:{translate:e}}},translateX:{values:`spacing`,transform:e=>({"--translate-x":e})},translateY:{values:`spacing`,transform:e=>({"--translate-y":e})},transition:{values:[`all`,`common`,`colors`,`opacity`,`position`,`backgrounds`,`size`,`shadow`,`transform`],transform(e){switch(e){case`all`:return hy(`all`);case`position`:return hy(`left, right, top, bottom, inset-inline, inset-block`);case`colors`:return hy(`color, background-color, border-color, text-decoration-color, fill, stroke`);case`opacity`:return hy(`opacity`);case`shadow`:return hy(`box-shadow`);case`transform`:return hy(`transform`);case`size`:return hy(`width, height`);case`backgrounds`:return hy(`background, background-color, background-image, background-position`);case`common`:return hy(`color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter`);default:return{transition:e}}}},transitionDuration:{values:`durations`},transitionProperty:{values:{common:`background-color, border-color, color, fill, stroke, opacity, box-shadow, translate, transform`,colors:`background-color, border-color, color, fill, stroke`,size:`width, height`,position:`left, right, top, bottom, inset-inline, inset-block`,background:`background, background-color, background-image, background-position`}},transitionTimingFunction:{values:`easings`},animation:{values:`animations`},animationDuration:{values:`durations`},animationDelay:{values:`durations`},animationTimingFunction:{values:`easings`},fontFamily:{values:`fonts`},fontSize:{values:`fontSizes`},fontWeight:{values:`fontWeights`},lineHeight:{values:`lineHeights`},letterSpacing:{values:`letterSpacings`},textIndent:{values:`spacing`},truncate:{values:{type:`boolean`},transform(e){return e===!0?{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`}:{}}},lineClamp:{transform(e){return e===`none`?{WebkitLineClamp:`unset`}:{overflow:`hidden`,display:`-webkit-box`,WebkitLineClamp:e,WebkitBoxOrient:`vertical`,textWrap:`wrap`}}},borderSpacing:{values:e=>({...e(`spacing`),auto:`var(--border-spacing-x, 0) var(--border-spacing-y, 0)`})},borderSpacingX:{values:`spacing`,transform(e){return{"--border-spacing-x":e}}},borderSpacingY:{values:`spacing`,transform(e){return{"--border-spacing-y":e}}},srOnly:{values:{type:`boolean`},transform(e){return xy[e]||{}}},debug:{values:{type:`boolean`},transform(e){return e?{outline:`1px solid blue !important`,"& > *":{outline:`1px solid red !important`}}:{}}},caretColor:{values:yy,transform:Lv(`caretColor`)},cursor:{values:`cursor`}}}),xy={true:{position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},false:{position:`static`,width:`auto`,height:`auto`,padding:`0`,margin:`0`,overflow:`visible`,clip:`auto`,whiteSpace:`normal`}},Sy=``.split(`,`),Cy=`WebkitAppearance,WebkitBorderBefore,WebkitBorderBeforeColor,WebkitBorderBeforeStyle,WebkitBorderBeforeWidth,WebkitBoxReflect,WebkitLineClamp,WebkitMask,WebkitMaskAttachment,WebkitMaskClip,WebkitMaskComposite,WebkitMaskImage,WebkitMaskOrigin,WebkitMaskPosition,WebkitMaskPositionX,WebkitMaskPositionY,WebkitMaskRepeat,WebkitMaskRepeatX,WebkitMaskRepeatY,WebkitMaskSize,WebkitOverflowScrolling,WebkitTapHighlightColor,WebkitTextFillColor,WebkitTextStroke,WebkitTextStrokeColor,WebkitTextStrokeWidth,WebkitTouchCallout,WebkitUserModify,WebkitUserSelect,accentColor,alignContent,alignItems,alignSelf,alignTracks,all,anchorName,anchorScope,animation,animationComposition,animationDelay,animationDirection,animationDuration,animationFillMode,animationIterationCount,animationName,animationPlayState,animationRange,animationRangeEnd,animationRangeStart,animationTimeline,animationTimingFunction,appearance,aspectRatio,backdropFilter,backfaceVisibility,background,backgroundAttachment,backgroundBlendMode,backgroundClip,backgroundColor,backgroundImage,backgroundOrigin,backgroundPosition,backgroundPositionX,backgroundPositionY,backgroundRepeat,backgroundSize,blockSize,border,borderBlock,borderBlockColor,borderBlockEnd,borderBlockEndColor,borderBlockEndStyle,borderBlockEndWidth,borderBlockStart,borderBlockStartColor,borderBlockStartStyle,borderBlockStartWidth,borderBlockStyle,borderBlockWidth,borderBottom,borderBottomColor,borderBottomLeftRadius,borderBottomRightRadius,borderBottomStyle,borderBottomWidth,borderCollapse,borderColor,borderEndEndRadius,borderEndStartRadius,borderImage,borderImageOutset,borderImageRepeat,borderImageSlice,borderImageSource,borderImageWidth,borderInline,borderInlineColor,borderInlineEnd,borderInlineEndColor,borderInlineEndStyle,borderInlineEndWidth,borderInlineStart,borderInlineStartColor,borderInlineStartStyle,borderInlineStartWidth,borderInlineStyle,borderInlineWidth,borderLeft,borderLeftColor,borderLeftStyle,borderLeftWidth,borderRadius,borderRight,borderRightColor,borderRightStyle,borderRightWidth,borderSpacing,borderStartEndRadius,borderStartStartRadius,borderStyle,borderTop,borderTopColor,borderTopLeftRadius,borderTopRightRadius,borderTopStyle,borderTopWidth,borderWidth,bottom,boxAlign,boxDecorationBreak,boxDirection,boxFlex,boxFlexGroup,boxLines,boxOrdinalGroup,boxOrient,boxPack,boxShadow,boxSizing,breakAfter,breakBefore,breakInside,captionSide,caret,caretColor,caretShape,clear,clip,clipPath,clipRule,color,colorInterpolationFilters,colorScheme,columnCount,columnFill,columnGap,columnRule,columnRuleColor,columnRuleStyle,columnRuleWidth,columnSpan,columnWidth,columns,contain,containIntrinsicBlockSize,containIntrinsicHeight,containIntrinsicInlineSize,containIntrinsicSize,containIntrinsicWidth,container,containerName,containerType,content,contentVisibility,cornerShape,counterIncrement,counterReset,counterSet,cursor,cx,cy,d,direction,display,dominantBaseline,emptyCells,fieldSizing,fill,fillOpacity,fillRule,filter,flex,flexBasis,flexDirection,flexFlow,flexGrow,flexShrink,flexWrap,float,floodColor,floodOpacity,font,fontFamily,fontFeatureSettings,fontKerning,fontLanguageOverride,fontOpticalSizing,fontPalette,fontSize,fontSizeAdjust,fontSmooth,fontStretch,fontStyle,fontSynthesis,fontSynthesisPosition,fontSynthesisSmallCaps,fontSynthesisStyle,fontSynthesisWeight,fontVariant,fontVariantAlternates,fontVariantCaps,fontVariantEastAsian,fontVariantEmoji,fontVariantLigatures,fontVariantNumeric,fontVariantPosition,fontVariationSettings,fontWeight,forcedColorAdjust,gap,grid,gridArea,gridAutoColumns,gridAutoFlow,gridAutoRows,gridColumn,gridColumnEnd,gridColumnGap,gridColumnStart,gridGap,gridRow,gridRowEnd,gridRowGap,gridRowStart,gridTemplate,gridTemplateAreas,gridTemplateColumns,gridTemplateRows,hangingPunctuation,height,hyphenateCharacter,hyphenateLimitChars,hyphens,imageOrientation,imageRendering,imageResolution,imeMode,initialLetter,initialLetterAlign,inlineSize,inset,insetBlock,insetBlockEnd,insetBlockStart,insetInline,insetInlineEnd,insetInlineStart,interpolateSize,isolation,justifyContent,justifyItems,justifySelf,justifyTracks,left,letterSpacing,lightingColor,lineBreak,lineClamp,lineHeight,lineHeightStep,listStyle,listStyleImage,listStylePosition,listStyleType,margin,marginBlock,marginBlockEnd,marginBlockStart,marginBottom,marginInline,marginInlineEnd,marginInlineStart,marginLeft,marginRight,marginTop,marginTrim,marker,markerEnd,markerMid,markerStart,mask,maskBorder,maskBorderMode,maskBorderOutset,maskBorderRepeat,maskBorderSlice,maskBorderSource,maskBorderWidth,maskClip,maskComposite,maskImage,maskMode,maskOrigin,maskPosition,maskRepeat,maskSize,maskType,masonryAutoFlow,mathDepth,mathShift,mathStyle,maxBlockSize,maxHeight,maxInlineSize,maxLines,maxWidth,minBlockSize,minHeight,minInlineSize,minWidth,mixBlendMode,objectFit,objectPosition,offset,offsetAnchor,offsetDistance,offsetPath,offsetPosition,offsetRotate,opacity,order,orphans,outline,outlineColor,outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowBlock,overflowClipBox,overflowClipMargin,overflowInline,overflowWrap,overflowX,overflowY,overlay,overscrollBehavior,overscrollBehaviorBlock,overscrollBehaviorInline,overscrollBehaviorX,overscrollBehaviorY,padding,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingBottom,paddingInline,paddingInlineEnd,paddingInlineStart,paddingLeft,paddingRight,paddingTop,page,pageBreakAfter,pageBreakBefore,pageBreakInside,paintOrder,perspective,perspectiveOrigin,placeContent,placeItems,placeSelf,pointerEvents,position,positionAnchor,positionArea,positionTry,positionTryFallbacks,positionTryOrder,positionVisibility,printColorAdjust,quotes,r,resize,right,rotate,rowGap,rubyAlign,rubyMerge,rubyPosition,rx,ry,scale,scrollBehavior,scrollMargin,scrollMarginBlock,scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginBottom,scrollMarginInline,scrollMarginInlineEnd,scrollMarginInlineStart,scrollMarginLeft,scrollMarginRight,scrollMarginTop,scrollPadding,scrollPaddingBlock,scrollPaddingBlockEnd,scrollPaddingBlockStart,scrollPaddingBottom,scrollPaddingInline,scrollPaddingInlineEnd,scrollPaddingInlineStart,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollSnapAlign,scrollSnapCoordinate,scrollSnapDestination,scrollSnapPointsX,scrollSnapPointsY,scrollSnapStop,scrollSnapType,scrollSnapTypeX,scrollSnapTypeY,scrollTimeline,scrollTimelineAxis,scrollTimelineName,scrollbarColor,scrollbarGutter,scrollbarWidth,shapeImageThreshold,shapeMargin,shapeOutside,shapeRendering,stopColor,stopOpacity,stroke,strokeDasharray,strokeDashoffset,strokeLinecap,strokeLinejoin,strokeMiterlimit,strokeOpacity,strokeWidth,tabSize,tableLayout,textAlign,textAlignLast,textAnchor,textBox,textBoxEdge,textBoxTrim,textCombineUpright,textDecoration,textDecorationColor,textDecorationLine,textDecorationSkip,textDecorationSkipInk,textDecorationStyle,textDecorationThickness,textEmphasis,textEmphasisColor,textEmphasisPosition,textEmphasisStyle,textIndent,textJustify,textOrientation,textOverflow,textRendering,textShadow,textSizeAdjust,textSpacingTrim,textTransform,textUnderlineOffset,textUnderlinePosition,textWrap,textWrapMode,textWrapStyle,timelineScope,top,touchAction,transform,transformBox,transformOrigin,transformStyle,transition,transitionBehavior,transitionDelay,transitionDuration,transitionProperty,transitionTimingFunction,translate,unicodeBidi,userSelect,vectorEffect,verticalAlign,viewTimeline,viewTimelineAxis,viewTimelineInset,viewTimelineName,viewTransitionName,visibility,whiteSpace,whiteSpaceCollapse,widows,width,willChange,wordBreak,wordSpacing,wordWrap,writingMode,x,y,zIndex,zoom,alignmentBaseline,baselineShift,colorInterpolation,colorRendering,glyphOrientationVertical`.split(`,`).concat(Sy),wy=new Map(Cy.map(e=>[e,!0]));function Ty(e){let t=Object.create(null);return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}var Ey=/&|@/,Dy=Ty(e=>wy.has(e)||e.startsWith(`--`)||Ey.test(e));function Oy(e,t){let n={};for(let r in e){let i=t(r,e[r]);n[i[0]]=i[1]}return n}function ky(e,t){let n={};return Hv(e,(e,t)=>{e&&(n[t.join(`.`)]=e.value)},{stop:t}),n}var Ay=Object.defineProperty,jy=(e,t,n)=>t in e?Ay(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,My=(e,t,n)=>jy(e,typeof t==`symbol`?t:t+``,n);function Ny(e){if(e===null)return`null`;if(e===void 0)return`undefined`;let t=typeof e;return t===`string`?`s:${e}`:t===`number`?`n:${e}`:t===`boolean`?`b:${e}`:t===`function`?`f:${e.name||`anonymous`}`:Array.isArray(e)?`a:[${e.map(Ny).join(`,`)}]`:t===`object`?`o:{${Object.keys(e).sort().map(t=>`${t}:${Ny(e[t])}`).join(`,`)}}`:String(e)}var Py=class{constructor(e=500){My(this,`cache`,new Map),My(this,`maxSize`),this.maxSize=e}get(e){let t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e!==void 0&&this.cache.delete(e)}this.cache.set(e,t)}clear(){this.cache.clear()}},Fy=e=>{let t=new Py;function n(...n){let r=n.length===1?Ny(n[0]):n.map(Ny).join(`|`),i=t.get(r);return i===void 0&&(i=e.apply(this,n),t.set(r,i)),i}return n},Iy=16,Ly=`px`,Ry=`em`,zy=`rem`;function By(e=``){let t=new RegExp(String.raw`-?\d+(?:\.\d+|\d*)`),n=RegExp(`${Ly}|${Ry}|${zy}`);return e.match(RegExp(`${t.source}(${n.source})`))?.[1]}function Vy(e=``){if(typeof e==`number`)return`${e}px`;let t=By(e);if(!t||t===Ly)return e;if(t===Ry||t===zy)return`${parseFloat(e)*Iy}${Ly}`}function Hy(e=``){let t=By(e);if(!t||t===zy)return e;if(t===Ry)return`${parseFloat(e)}${zy}`;if(t===Ly)return`${parseFloat(e)/Iy}${zy}`}var Uy=e=>e.charAt(0).toUpperCase()+e.slice(1);function Wy(e){let t=Ky(e),n=Object.fromEntries(t);function r(e){return n[e]}function i(e){return Jy(r(e))}function a(){let e=Object.keys(n),t=qy(e),a=e.flatMap(e=>{let t=r(e),n=[`${e}Down`,Jy({max:Gy(t.min)})];return[[e,Jy({min:t.min})],[`${e}Only`,i(e)],n]}).filter(([,e])=>e!==``).concat(t.map(([e,t])=>{let n=r(e),i=r(t);return[`${e}To${Uy(t)}`,Jy({min:n.min,max:Gy(i.min)})]}));return Object.fromEntries(a)}function o(){let e=a();return Object.fromEntries(Object.entries(e))}let s=o(),c=e=>s[e];function l(){return Xt([`base`,...Object.keys(n)])}function u(e){return Jy({min:r(e).min})}function d(e){return Jy({max:Gy(r(e).min)})}return{values:Object.values(n),only:i,keys:l,conditions:s,getCondition:c,up:u,down:d}}function Gy(e){return Hy(`${parseFloat(Vy(e)??``)-.04}px`)}function Ky(e){return Object.entries(e).sort(([,e],[,t])=>parseInt(e,10)<parseInt(t,10)?-1:1).map(([e,t],n,r)=>{let i=null;return n<=r.length-1&&(i=r[n+1]?.[1]),i!=null&&(i=Gy(i)),[e,{name:e,min:Hy(t),max:i}]})}function qy(e){let t=[];return e.forEach((n,r)=>{let i=r;i++;let a=e[i];for(;a;)t.push([n,a]),i++,a=e[i]}),t}function Jy({min:e,max:t}){return e==null&&t==null?``:[`@media screen`,e&&`(min-width: ${e})`,t&&`(max-width: ${t})`].filter(Boolean).join(` and `)}var Yy=/^@|&|&$/,Xy=e=>{let{breakpoints:t,conditions:n={}}=e,r=Oy(n,(e,t)=>[`_${e}`,t]),i=Object.assign({},r,t.conditions);function a(){return Object.keys(i)}function o(e){return a().includes(e)||Yy.test(e)||e.startsWith(`_`)}let s=Fy(e=>e.filter(e=>e!==`base`).sort((e,t)=>{let n=o(e),r=o(t);return n&&!r?1:!n&&r?-1:0}));function c(e){return e.startsWith(`@breakpoint`)?t.getCondition(e.replace(`@breakpoint `,``)):e}function l(e){return Reflect.get(i,e)||e}return{keys:a,sort:s,has:o,resolve:l,breakpoints:t.keys(),expandAtRule:c}},Zy=Object.freeze(Object.create(null)),Qy=Object.freeze([]);function $y(){return Object.create(null)}var eb=e=>({minMax:RegExp(`(!?\\(\\s*min(-device-)?-${e})(.|
|
|
10
|
+
)+\\(\\s*max(-device)?-${e}`,`i`),min:RegExp(`\\(\\s*min(-device)?-${e}`,`i`),maxMin:RegExp(`(!?\\(\\s*max(-device)?-${e})(.|
|
|
11
|
+
)+\\(\\s*min(-device)?-${e}`,`i`),max:RegExp(`\\(\\s*max(-device)?-${e}`,`i`)}),tb=eb(`width`),nb=eb(`height`),rb=e=>({isMin:hb(e.minMax,e.maxMin,e.min),isMax:hb(e.maxMin,e.minMax,e.max)}),{isMin:ib,isMax:ab}=rb(tb),{isMin:ob,isMax:sb}=rb(nb),cb=/print/i,lb=/^print$/i,ub=/(-?\d*\.?\d+)(ch|em|ex|px|rem)/,db=/(\d)/,fb=Number.MAX_VALUE,pb={ch:8.8984375,em:16,rem:16,ex:8.296875,px:1};function mb(e){let t=ub.exec(e)||(ib(e)||ob(e)?db.exec(e):null);return t?t[0]===`0`?0:parseFloat(t[1])*(pb[t[2]]||1):fb}function hb(e,t,n){return r=>e.test(r)||!t.test(r)&&n.test(r)}function gb(e,t){let n=cb.test(e),r=lb.test(e),i=cb.test(t),a=lb.test(t);return n&&i?!r&&a?1:r&&!a?-1:e.localeCompare(t):n?1:i?-1:null}var _b=Fy((e,t)=>{let n=gb(e,t);if(n!==null)return n;let r=ib(e)||ob(e),i=ab(e)||sb(e),a=ib(t)||ob(t),o=ab(t)||sb(t);if(r&&o)return-1;if(i&&a)return 1;let s=mb(e),c=mb(t);return s===fb&&c===fb?e.localeCompare(t):s===fb?1:c===fb?-1:s===c?e.localeCompare(t):s>c?i?-1:1:i?1:-1});function vb(e){return e.sort(([e],[t])=>_b(e,t))}function yb(e){let t=[],n=[],r={};for(let[i,a]of Object.entries(e))i.startsWith(`@media`)?t.push([i,a]):i.startsWith(`@container`)?n.push([i,a]):r[i]=Wt(a)?yb(a):a;let i=vb(t),a=vb(n);return{...r,...Object.fromEntries(i),...Object.fromEntries(a)}}var bb=/\s*!(important)?/i,xb=Fy(e=>Gt(e)?bb.test(e):!1),Sb=Fy(e=>Gt(e)?e.replace(bb,``).trim():e);function Cb(e){let{transform:t,conditions:n,normalize:r}=e,i=Eb(e);return Fy(function(...e){let a=i(...e),o=r(a),s=$y();return Hv(o,(e,r)=>{if(e==null)return;let[i,...a]=n.sort(r).map(n.resolve),o=xb(e);o&&(e=Sb(e));let c=t(i,e)??Zy;c=Hv(c,e=>Gt(e)&&o?`${e} !important`:e,{getKey:e=>n.expandAtRule(e)}),wb(s,a.flat(),c)}),yb(s)})}function wb(e,t,n){let r=e;for(let e of t)e&&(r[e]||(r[e]=$y()),r=r[e]);Bv(r,n)}function Tb(...e){return e.filter(e=>{if(!Wt(e))return!1;let t=Ut(e);return Object.keys(t).length>0})}function Eb(e){function t(t){let n=Tb(...t);return n.length===1?n:n.map(t=>e.normalize(t))}return Fy(function(...e){return Bv({},...t(e))})}var Db=e=>({base:Zy,variants:Zy,defaultVariants:Zy,compoundVariants:[],...e});function Ob(e){let{css:t,conditions:n,normalize:r,layers:i}=e;function a(e={}){let s=Db(e),{base:c,defaultVariants:l,compoundVariants:u}=s,d=Oy(s.variants,(e,t)=>[e,Oy(t,(e,t)=>[e,r(t)])]),f=Cb({conditions:n,normalize:r,transform(e,t){return d[e]?.[t]}}),p=Fy(function(e={}){let n=r({...l,...Ut(e)}),a={...r(c)};Bv(a,f(n));let s=o(u,n);return i.wrap(`recipes`,t(a,s))}),m=Object.keys(d),h=e=>{let[t,n]=rn(Fv(e,[`recipe`]),m),r=m.includes(`colorPalette`),i=m.includes(`orientation`);return r||(t.colorPalette=e.colorPalette||l.colorPalette),i&&(n.orientation=e.orientation),[t,n]},g=Oy(d,(e,t)=>[e,Object.keys(t)]),_=Fy(function(e){return t(p(e))});return Object.assign(_,{className:e.className,__cva__:!0,variantMap:g,variantKeys:m,raw:p,config:e,splitVariantProps:h,merge(e){return a(Ab(this,e))}})}function o(e,n){let r=Zy;return e.forEach(e=>{Object.entries(e).every(([e,t])=>e===`css`||(Array.isArray(t)?t:[t]).some(t=>n[e]===t))&&(r=t(r,e.css))}),r}return a}var kb=e=>(e?.__cva__?e.config:e)??Zy;function Ab(e,t){let n=Db(kb(e)),r=Db(kb(t)),i=Xt(Object.keys(n.variants),Object.keys(r.variants)),a=Bv({},n.base,r.base),o=Object.fromEntries(i.map(e=>[e,Bv({},n.variants[e],r.variants[e])])),s=Bv({},n.defaultVariants,r.defaultVariants),c=[...n.compoundVariants,...r.compoundVariants];return{className:qt(n.className,r.className),base:a,variants:o,defaultVariants:s,compoundVariants:c}}var jb={reset:`reset`,base:`base`,tokens:`tokens`,recipes:`recipes`},Mb={reset:0,base:1,tokens:2,recipes:3};function Nb(e){let t=e.layers??jb,n=Object.values(t).sort((e,t)=>Mb[e]-Mb[t]);return{names:n,atRule:`@layer ${n.join(`, `)};`,wrap(n,r){return e.disableLayers?r:{[`@layer ${t[n]}`]:r}}}}function Pb(e){let{utility:t,normalize:n}=e,{hasShorthand:r,resolveShorthand:i}=t;return function(e){return Hv(e,n,{stop:e=>Array.isArray(e),getKey:r?i:void 0})}}function Fb(e){let{preflight:t}=e;if(!t)return{};let{scope:n=``,level:r=`parent`}=Wt(t)?t:{},i=``;n&&r===`parent`?i=`${n} `:n&&r===`element`&&(i=`&${n}`);let a={"*":{margin:`0px`,padding:`0px`,font:`inherit`,wordWrap:`break-word`,WebkitTapHighlightColor:`transparent`},"*, *::before, *::after, *::backdrop":{boxSizing:`border-box`,borderWidth:`0px`,borderStyle:`solid`,borderColor:`var(--global-color-border, currentColor)`},hr:{height:`0px`,color:`inherit`,borderTopWidth:`1px`},body:{minHeight:`100dvh`,position:`relative`},img:{borderStyle:`none`},"img, svg, video, canvas, audio, iframe, embed, object":{display:`block`,verticalAlign:`middle`},iframe:{border:`none`},"img, video":{maxWidth:`100%`,height:`auto`},"p, h1, h2, h3, h4, h5, h6":{overflowWrap:`break-word`},"ol, ul":{listStyle:`none`},"code, kbd, pre, samp":{fontSize:`1em`},"button, [type='button'], [type='reset'], [type='submit']":{WebkitAppearance:`button`,backgroundColor:`transparent`,backgroundImage:`none`},"button, input, optgroup, select, textarea":{color:`inherit`},"button, select":{textTransform:`none`},table:{textIndent:`0px`,borderColor:`inherit`,borderCollapse:`collapse`},"*::placeholder":{opacity:`unset`,color:`#9ca3af`,userSelect:`none`},textarea:{resize:`vertical`},summary:{display:`list-item`},small:{fontSize:`80%`},"sub, sup":{fontSize:`75%`,lineHeight:0,position:`relative`,verticalAlign:`baseline`},sub:{bottom:`-0.25em`},sup:{top:`-0.5em`},dialog:{padding:`0px`},a:{color:`inherit`,textDecoration:`inherit`},"abbr:where([title])":{textDecoration:`underline dotted`},"b, strong":{fontWeight:`bolder`},"i, em":{fontStyle:`italic`},"code, kbd, samp, pre":{fontSize:`1em`,"--font-mono-fallback":`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New'`,fontFamily:`var(--global-font-mono, var(--font-mono-fallback))`},'input[type="text"], input[type="email"], input[type="search"], input[type="password"]':{WebkitAppearance:`none`,MozAppearance:`none`},"input[type='search']":{WebkitAppearance:`textfield`,outlineOffset:`-2px`},"::-webkit-search-decoration, ::-webkit-search-cancel-button":{WebkitAppearance:`none`},"::-webkit-file-upload-button":{WebkitAppearance:`button`,font:`inherit`},'input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button':{height:`auto`},"input[type='number']":{MozAppearance:`textfield`},":-moz-ui-invalid":{boxShadow:`none`},":-moz-focusring":{outline:`auto`},"[hidden]:where(:not([hidden='until-found']))":{display:`none !important`}},o={[n||`html`]:{lineHeight:1.5,"--font-fallback":`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'`,WebkitTextSizeAdjust:`100%`,WebkitFontSmoothing:`antialiased`,MozOsxFontSmoothing:`grayscale`,textRendering:`optimizeLegibility`,touchAction:`manipulation`,MozTabSize:`4`,tabSize:`4`,fontFamily:`var(--global-font-body, var(--font-fallback))`}};if(r===`element`){let e=Object.entries(a).reduce((e,[t,n])=>(e[t]={[i]:n},e),{});Object.assign(o,e)}else i?o[i]=a:Object.assign(o,a);return o}function Ib(e){let{conditions:t,isValidProperty:n}=e,r=Fy((e,r)=>!n(e)||!r.split(`,`).every(e=>e===`base`||t.has(e)));return function(e){return Hv(e,e=>e,{stop:e=>Array.isArray(e),getKey:(e,n)=>!Wt(n)||t.has(e)?e:r(e,Object.keys(n).join(`,`))?Rb(e).map(e=>{let t=e.startsWith(`&`)?e.slice(1):e;return Lb(t)?`${t} &`:`&${t}`}).join(`, `):e})}}function Lb(e){let t=e.toLowerCase();return t.startsWith(`:host-context`)||t.startsWith(`:host`)||t.startsWith(`::slotted`)}function Rb(e){let t=[],n=0,r=``,i=!1;for(let a=0;a<e.length;a++){let o=e[a];if(o===`\\`&&!i){i=!0,r+=o;continue}if(i){i=!1,r+=o;continue}o===`(`?n++:o===`)`&&n--,o===`,`&&n===0?(t.push(r.trim()),r=``):r+=o}return r&&t.push(r.trim()),t}var zb=(e=Zy)=>{let t=t=>({base:e.base?.[t]??Zy,variants:$y(),defaultVariants:e.defaultVariants??Zy,compoundVariants:e.compoundVariants?Bb(e.compoundVariants,t):Qy}),n=(e.slots??[]).map(e=>[e,t(e)]);for(let[t,r]of Object.entries(e.variants??{}))for(let[e,i]of Object.entries(r))n.forEach(([n,r])=>{var a;(a=r.variants)[t]??(a[t]={}),r.variants[t][e]=i[n]??Zy});return Object.fromEntries(n)},Bb=(e,t)=>e.filter(e=>e.css[t]).map(e=>({...e,css:e.css[t]}));function Vb(e){let{cva:t}=e;return function(e=Zy){let n=Object.entries(zb(e)).map(([e,n])=>[e,t(n)]),r=Fy(function(e){let t=n.map(([t,n])=>[t,n(e)]);return Object.fromEntries(t)}),i=e.variants??Zy,a=Object.keys(i);function o(t){let[n,r]=rn(Fv(t,[`recipe`]),a),i=a.includes(`colorPalette`),o=a.includes(`orientation`);return i||(n.colorPalette=t.colorPalette||e.defaultVariants?.colorPalette),o&&(r.orientation=t.orientation),[n,r]}let s=Oy(i,(e,t)=>[e,Object.keys(t)]),c={};return e.className&&(c=Object.fromEntries(e.slots.map(t=>[t,`${e.className}__${t}`]))),Object.assign(r,{variantMap:s,variantKeys:a,splitVariantProps:o,classNameMap:c})}}var Hb=()=>e=>Array.from(new Set(e)),Ub=/([\0-\x1f\x7f]|^-?\d)|^-$|^-|[^\x80-\uFFFF\w-]/g,Wb=function(e,t){return t?e===`\0`?`�`:e===`-`&&e.length===1?`\\-`:e.slice(0,-1)+`\\`+e.charCodeAt(e.length-1).toString(16):`\\`+e},Gb=e=>(e+``).replace(Ub,Wb),Kb=(e,t)=>{let n=``,r=0,i=`char`,a=``,o=``,s=[];for(;r<e.length;){let c=e[r];if(c===`{`){let i=e.indexOf(`}`,r);if(i===-1)break;let a=e.slice(r+1,i),o=t(a);n+=o??a,r=i+1;continue}if(i===`token`&&c===`,`){e[r]===``&&r++,i=`fallback`,s.push(i);let c=t(a);c?.endsWith(`)`)&&(n+=c.slice(0,-1)),a=``,o=``;continue}if(i===`fallback`&&o+c===`, var(`){let t=qb(e.slice(r+1))+r+1,a=e.slice(r+1,t);if(t===-1)break;n+=`, var(`+a+`)`,r=t+1,i=s.pop()??i,o=``;continue}if(i===`token`||i===`fallback`){if(r++,c===`)`){i=s.pop()??i??`char`,o+=c;let e=a&&(t(a)??Gb(a));if(o){if(o=o.slice(1).trim(),!o.startsWith(`token(`)&&o.endsWith(`)`)&&(o=o.slice(0,-1)),o.includes(`token(`)){let e=Kb(o,t);e&&(o=e.slice(0,-1))}else if(o){let e=t(o);e&&(o=e)}}let r=n.at(-1);o?r?.trim()?n+=e.slice(0,-1)+(`, `+o+`)`):n+=o:n+=e||`)`,a=``,o=``,i=`char`;continue}i===`token`&&(a+=c),i===`fallback`&&(o+=c);continue}let l=e.indexOf(`token(`,r);if(l!==-1){let t=l+6;n+=e.slice(r,l),r=t,i=`token`,s.push(i);continue}n+=c,r++}return n},qb=e=>{let t=0,n=[`(`];for(;t<e.length;){let r=e[t];if(r===`(`)n.push(r);else if(r===`)`&&(n.pop(),n.length===0))return t;t++}return t};function Jb(e){let t={};return e.forEach((e,n)=>{e instanceof Map?t[n]=Object.fromEntries(e):t[n]=e}),t}var Yb=/({([^}]*)})/g,Xb=/[{}]/g,Zb=/\w+\.\w+/,Qb=e=>{if(!Gt(e))return[];let t=e.match(Yb);return t?t.map(e=>e.replace(Xb,``).trim()):[]},$b=e=>Yb.test(e);function ex(e){if(!e.extensions?.references)return e.extensions?.cssVar?.ref??e.value;let t=e.extensions.references??{},n=e.value,r=Object.keys(t);for(let e=0;e<r.length;e++){let i=r[e],a=t[i];if(a.extensions.conditions)continue;let o=ex(a);n=n.replace(`{${i}}`,o)}return e.value=n,delete e.extensions.references,e.value}function tx(e,t){if(t==null||!Array.isArray(t))return t;switch(e){case`easings`:return`cubic-bezier(${t.join(`, `)})`;case`animations`:case`fonts`:case`gradients`:case`shadows`:return t.join(`, `);default:return t}}function nx(e,t){let n={};for(let r in t)n[r]=tx(e,t[r]);return n}var rx=/calc/g;function ix(e){return Wt(e)&&e.reference?e.reference:String(e)}var ax=(e,...t)=>t.map(ix).join(` ${e} `).replace(rx,``),ox=(...e)=>`calc(${ax(`+`,...e)})`,sx=(...e)=>`calc(${ax(`-`,...e)})`,cx=(...e)=>`calc(${ax(`*`,...e)})`,lx=(...e)=>`calc(${ax(`/`,...e)})`,ux=e=>{let t=ix(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith(`-`)?String(t).slice(1):`-${t}`:cx(t,-1)},dx=Object.assign(e=>({add:(...t)=>dx(ox(e,...t)),subtract:(...t)=>dx(sx(e,...t)),multiply:(...t)=>dx(cx(e,...t)),divide:(...t)=>dx(lx(e,...t)),negate:()=>dx(ux(e)),toString:()=>e.toString()}),{add:ox,subtract:sx,multiply:cx,divide:lx,negate:ux}),fx={enforce:`pre`,transform(e){let{prefix:t,allTokens:n,formatCssVar:r,formatTokenName:i,registerToken:a}=e;n.filter(({extensions:e})=>e.category===`spacing`).forEach(e=>{let n=e.path.slice(),o=r(n,t);if(Gt(e.value)&&e.value===`0rem`)return;let s=[...e.path],c=s[s.length-1];c!=null&&(s[s.length-1]=`-${c}`);let l={...e,value:dx.negate(o.ref),name:i(s),path:s,extensions:{...e.extensions,negative:!0,prop:`-${e.extensions.prop}`,originalPath:n}};a(l)})}},px=new Set([`spacing`,`sizes`,`borderWidths`,`fontSizes`,`radii`]),mx=[fx,{enforce:`post`,transform(e){let{allTokens:t,registerToken:n,formatTokenName:r}=e,i=t.filter(({extensions:e})=>e.category===`colors`),a=new Map,o=new Map;i.forEach(e=>{let{colorPalette:t}=e.extensions;t&&(t.keys.forEach(e=>{a.set(r(e),e)}),t.roots.forEach(n=>{let i=r(n),s=o.get(i)||[];if(s.push(e),o.set(i,s),e.extensions.default&&n.length===1){let e=t.keys[0]?.filter(Boolean);if(!e.length)return;let i=n.concat(e);a.set(r(i),[])}}))}),a.forEach(e=>{let t=[`colors`,`colorPalette`,...e].filter(Boolean),i=r(t),a={name:i,value:i,originalValue:i,path:t,extensions:{condition:`base`,originalPath:t,category:`colors`,prop:r(t.slice(1)),virtual:!0}};n(a,`pre`)})}},{enforce:`post`,transform(e){e.allTokens.filter(e=>px.has(e.extensions.category)&&!e.extensions.negative).forEach(e=>{Object.assign(e.extensions,{pixelValue:Vy(e.value)})})}},{enforce:`post`,transform(e){let t=[],n=[];e.allTokens.forEach(e=>{e.value===``?t.push(e):n.push(e)}),e.allTokens.splice(0,e.allTokens.length,...n),t.forEach(t=>{if(e.tokenMap.get(t.name)!==t)return;let n=e.allTokens.find(e=>e.name===t.name);if(!n){e.tokenMap.delete(t.name);return}t.extensions.conditions&&!n.extensions.conditions&&(n.extensions.conditions=t.extensions.conditions),e.tokenMap.set(t.name,n)})}}],hx=[{type:`extensions`,enforce:`pre`,name:`tokens/css-var`,transform(e,t){let{prefix:n,formatCssVar:r}=t,{negative:i,originalPath:a}=e.extensions;return{cssVar:r((i?a:e.path).filter(Boolean),n)}}},{enforce:`post`,type:`value`,name:`tokens/conditionals`,transform(e,t){let{prefix:n,formatCssVar:r,getByName:i}=t,a=Qb(e.value);return a.length&&a.forEach(t=>{if(!i(t))return;let a=r(t.split(`.`),n);e.value=e.value.replaceAll(`{${t}}`,a.ref)}),e.value}},{type:`extensions`,enforce:`pre`,name:`tokens/colors/colorPalette`,match(e){return e.extensions.category===`colors`&&!e.extensions.virtual},transform(e,t){let n=e.path.slice();if(n.pop(),n.shift(),n.length===0){let t=[...e.path];t.shift(),n=t}if(n.length===0)return{};let r=n.reduce((e,t,n,r)=>{let i=r.slice(0,n+1);return e.push(i),e},[]),i=n[0],a=t.formatTokenName(n),o=e.path.slice(e.path.indexOf(i)+1).reduce((e,t,n,r)=>(e.push(r.slice(n)),e),[]);return o.length===0&&o.push([``]),{colorPalette:{value:a,roots:r,keys:o}}}}],gx=e=>Wt(e)&&Object.prototype.hasOwnProperty.call(e,`value`);function _x(e){return e?{breakpoints:Uv(e,e=>({value:e})),sizes:Oy(e,(e,t)=>[`breakpoint-${e}`,{value:t}])}:{breakpoints:{},sizes:{}}}function vx(e){let{prefix:t=``,tokens:n={},semanticTokens:r={},breakpoints:i={}}=e,a=e=>e.join(`.`),o=(e,t)=>ly(e.join(`-`),{prefix:t}),s=[],c=new Map,l=new Map,u=new Map,d=new Map,f=new Map,p=new Map,m=new Map,h=new Map,g=[];function _(e,t){s.push(e),(e.extensions.condition===`base`||!c.has(e.name))&&c.set(e.name,e),t&&h.forEach(n=>{n.enforce===t&&re(n,e)})}let v=_x(i),y=Ut({...n,breakpoints:v.breakpoints,sizes:{...n.sizes,...v.sizes}});function b(){Hv(y,(e,t)=>{let n=t.includes(`DEFAULT`);t=yx(t);let r=t[0],i=a(t),o=tx(r,(Gt(e)?{value:e}:e).value),s={value:o,originalValue:o,name:i,path:t,extensions:{condition:`base`,originalPath:t,category:r,prop:a(t.slice(1))}};n&&(s.extensions.default=!0),_(s)},{stop:gx}),Hv(r,(e,t)=>{let n=t.includes(`DEFAULT`);t=bx(yx(t));let r=t[0],i=a(t),o=nx(r,(Gt(e.value)||Array.isArray(e.value)?{value:{base:e.value}}:e).value),s={value:o.base??``,originalValue:o.base??``,name:i,path:t,extensions:{originalPath:t,category:r,conditions:o,condition:`base`,prop:a(t.slice(1))}};n&&(s.extensions.default=!0),_(s)},{stop:gx})}function x(e){return c.get(e)}function S(e){let{condition:t}=e.extensions;t&&(l.has(t)||l.set(t,new Set),l.get(t).add(e))}function C(e){let{category:t,prop:n,condition:r,conditions:i}=e.extensions;if(!t)return;m.has(t)||m.set(t,new Map);let a=m.get(t),o=a.get(n);if(r==null||r===`base`){a.set(n,e);return}i&&!o&&a.set(n,e)}function w(e){let{condition:t,negative:n,virtual:r,cssVar:i}=e.extensions;!n&&!r&&t&&i&&e.value!==``&&(u.has(t)||u.set(t,new Map),u.get(t).set(i.var,e.value))}function T(e){let{category:t,prop:n,cssVar:r,negative:i}=e.extensions;if(!t)return;p.has(t)||p.set(t,new Map);let a=i?e.extensions.conditions?e.originalValue:e.value:r.ref;p.get(t).set(n,a),f.set([t,n].join(`.`),a)}function E(e){let{colorPalette:t,virtual:n,default:r}=e.extensions;t&&!n&&t.roots.forEach(n=>{let i=a(n);d.has(i)||d.set(i,new Map);let o=Sx([...e.path],[...n]),s=x(a(o));if(!s||!s.extensions.cssVar)return;let{var:c}=s.extensions.cssVar;if(d.get(i).set(c,e.extensions.cssVar.ref),r&&n.length===1){let r=x(a([`colors`,`colorPalette`]));if(!r)return;let i=x(a(e.path));if(!i)return;let o=t.keys[0]?.filter(Boolean);if(!o.length)return;let s=a(n.concat(o));d.has(s)||d.set(s,new Map),d.get(s).set(r.extensions.cssVar.var,i.extensions.cssVar.ref)}})}let D={};function ee(){s.forEach(e=>{S(e),C(e),w(e),T(e),E(e)}),D=Jb(p)}let O=(e,t)=>{if(!e||typeof e!=`string`)return{invalid:!0,value:e};let[n,r]=e.split(`/`);if(!n||!r)return{invalid:!0,value:n};let i=t(n),a=x(`opacity.${r}`)?.value;if(!a&&isNaN(Number(r)))return{invalid:!0,value:n};let o=a?Number(a)*100+`%`:`${r}%`,s=i??n;return{invalid:!1,color:s,value:`color-mix(in srgb, ${s} ${o}, transparent)`}},k=Fy((e,t)=>f.get(e)??t),A={prefix:t,allTokens:s,tokenMap:c,registerToken:_,getByName:x,formatTokenName:a,formatCssVar:o,flatMap:f,cssVarMap:u,categoryMap:m,colorPaletteMap:d,getVar:k,getCategoryValues:Fy(e=>D[e]||null),expandReferenceInValue:Fy(e=>Kb(e,e=>{if(e){if(e.includes(`/`)){let t=O(e,e=>k(e));if(t.invalid)throw Error(`Invalid color mix at `+e+`: `+t.value);return t.value}return k(e)||(Zb.test(e)?Gb(e):e)}}))};function te(...e){e.forEach(e=>{h.set(e.name,e)})}function ne(...e){g.push(...e)}function re(e,t){if(t.extensions.references||Kt(e.match)&&!e.match(t))return;let n=(t=>e.transform(t,A))(t);switch(!0){case e.type===`extensions`:Object.assign(t.extensions,n);break;case e.type===`value`:t.value=n;break;default:t[e.type]=n}}function j(e){g.forEach(t=>{t.enforce===e&&t.transform(A)})}function ie(e){h.forEach(t=>{t.enforce===e&&s.forEach(e=>{re(t,e)})})}function ae(){s.slice().forEach(e=>{let t=xx(e);t&&t.length!==0&&t.forEach(e=>{_(e)})})}function oe(e){let t=Qb(e),n=[];for(let e=0;e<t.length;e++){let r=x(t[e]);r&&n.push(r)}return n}function se(){s.forEach(e=>{if(!$b(e.value))return;let t=oe(e.value);e.extensions.references=t.reduce((e,t)=>(e[t.name]=t,e),{})})}function M(){s.forEach(e=>{ex(e)})}function ce(){j(`pre`),ie(`pre`),ae(),se(),M(),j(`post`),ie(`post`),ee()}return b(),te(...hx),ne(...mx),ce(),A}function yx(e){return e[0]===`DEFAULT`?e:e.filter(e=>e!==`DEFAULT`)}function bx(e){return e.filter(e=>e!==`base`)}function xx(e){if(!e.extensions.conditions)return;let{conditions:t}=e.extensions,n=[];return Hv(t,(t,r)=>{let i=bx(r);if(!i.length)return;let a={...e,value:t,extensions:{...e.extensions,condition:i.join(`:`)}};n.push(a)}),n}function Sx(e,t){let n=e.findIndex((n,r)=>t.every((t,n)=>e[r+n]===t));return n===-1?e:(e.splice(n,t.length),e.splice(n,0,`colorPalette`),e)}Hb()([`aspectRatios`,`zIndex`,`opacity`,`colors`,`fonts`,`fontSizes`,`fontWeights`,`lineHeights`,`letterSpacings`,`sizes`,`shadows`,`spacing`,`radii`,`cursor`,`borders`,`borderWidths`,`borderStyles`,`durations`,`easings`,`animations`,`blurs`,`gradients`,`breakpoints`,`assets`]);function Cx(e){return e}function wx(e){return Oy(e,(e,t)=>[e,Cx(t)])}function Tx(e){let t=wx(e.config),n=e.tokens,r=new Map,i=new Map;function a(e,n){t[e]=Cx(n),o(e,n)}let o=(e,t)=>{let n=h(t);n&&(i.set(e,n),d(e,t))},s=()=>{for(let[e,n]of Object.entries(t))n&&o(e,n)},c=()=>{for(let[e,n]of Object.entries(t)){let{shorthand:t}=n??{};t&&(Array.isArray(t)?t:[t]).forEach(t=>r.set(t,e))}},l=()=>{let e=Jb(n.colorPaletteMap);a(`colorPalette`,{values:Object.keys(e),transform:Fy(t=>e[t])})},u=new Map,d=(e,t)=>{if(!t)return;let n=h(t,e=>`type:Tokens["${e}"]`);if(typeof n==`object`&&n.type){u.set(e,new Set([`type:${n.type}`]));return}if(n){let t=new Set(Object.keys(n));u.set(e,t)}let r=u.get(e)??new Set;t.property&&u.set(e,r.add(`CssProperties["${t.property}"]`))},f=()=>{for(let[e,n]of Object.entries(t))n&&d(e,n)},p=(e,t)=>{let n=u.get(e)??new Set;u.set(e,new Set([...n,...t]))},m=()=>{let e=new Map;for(let[t,n]of u.entries()){if(n.size===0){e.set(t,[`string`]);continue}let r=Array.from(n).map(e=>e.startsWith(`CssProperties`)?e:e.startsWith(`type:`)?e.replace(`type:`,``):JSON.stringify(e));e.set(t,r)}return e},h=(e,t)=>{let{values:r}=e,i=e=>{let n=t?.(e);return n?{[n]:n}:void 0};if(Gt(r))return i?.(r)??n.getCategoryValues(r)??Zy;if(Array.isArray(r)){let e={};for(let t=0;t<r.length;t++)e[r[t]]=r[t];return e}return Kt(r)?r(t?i:n.getCategoryValues):r},g=Fy((e,t)=>({[e]:e.startsWith(`--`)?n.getVar(t,t):t})),_=Object.assign(n.getVar,{raw:e=>n.getByName(e)}),v=Fy((e,r)=>{let a=x(e);Gt(r)&&!r.includes(`_EMO_`)&&(r=n.expandReferenceInValue(r));let o=t[a];if(!o)return g(a,r);let s=i.get(a)?.[r];return o.transform?o.transform(s??r,{raw:r,token:_,utils:{colorMix:e=>Iv(e,_)}}):g(e,s??r)});function y(){c(),l(),s(),f()}y();let b=r.size>0,x=Fy(e=>r.get(e)??e);return{keys:()=>[...Array.from(r.keys()),...Object.keys(t)],hasShorthand:b,transform:v,shorthands:r,resolveShorthand:x,register:a,getTypes:m,addPropertyType:p}}function Ex(...e){let t=Kv(...e),{theme:n={},utilities:r={},globalCss:i={},cssVarsRoot:a=`:where(:root, :host)`,cssVarsPrefix:o=`chakra`,preflight:s}=t,c=Nb(t),l=vx({breakpoints:n.breakpoints,tokens:n.tokens,semanticTokens:n.semanticTokens,prefix:o}),u=Wy(n.breakpoints??Zy),d=Xy({conditions:t.conditions??Zy,breakpoints:u}),f=Tx({config:r,tokens:l});function p(){let{textStyles:e,layerStyles:t,animationStyles:r}=n,i=Ut({textStyle:e,layerStyle:t,animationStyle:r});for(let[e,t]of Object.entries(i)){let n=ky(t??Zy,Ox);f.register(e,{values:Object.keys(n),transform(e){return y(n[e])}})}}p(),f.addPropertyType(`animationName`,Object.keys(n.keyframes??Zy));let m=new Set([`css`,...f.keys(),...d.keys()]),h=Fy(e=>m.has(e)||Dy(e)),g=e=>{if(Array.isArray(e)){let t=$y();for(let n=0;n<e.length;n++){let r=e[n];if(r!=null){let e=d.breakpoints[n];t[e]=r}}return t}return e},_=Pb({utility:f,normalize:g}),v=Ib({conditions:d,isValidProperty:h}),y=Cb({transform:f.transform,conditions:d,normalize:_}),b=Ob({css:y,conditions:d,normalize:_,layers:c}),x=Vb({cva:b});function S(){let e={};for(let[t,n]of l.cssVarMap.entries()){let r=Object.fromEntries(n);if(Object.keys(r).length===0)continue;let i=t===`base`?a:d.resolve(t),o=i.startsWith(`@`);Bv(e,y(v({[i]:o?{[a]:r}:r})))}return c.wrap(`tokens`,e)}function C(){let e=Oy(n.keyframes??Zy,(e,t)=>[`@keyframes ${e}`,t]),t=Object.assign({},e,y(v(i)));return c.wrap(`base`,t)}function w(e){return rn(e,h)}function T(){let e=Fb({preflight:s});return c.wrap(`reset`,e)}let E=Dx(l),D=(e,t)=>E.get(e)?.value||t;D.var=(e,t)=>E.get(e)?.variable||t;function ee(e,t){return n.recipes?.[e]??t}function O(e,t){return n.slotRecipes?.[e]??t}let k=new Map,A=new Map;function te(e,t){let n=k.get(e);return n||(n=b(ee(e,t??Zy)),k.set(e,n)),n}function ne(e,t){let n=A.get(e);return n||(n=x(O(e,t??Zy)),A.set(e,n)),n}function re(e){return Object.hasOwnProperty.call(n.recipes??Zy,e)}function j(e){return Object.hasOwnProperty.call(n.slotRecipes??Zy,e)}function ie(e){return re(e)||j(e)}return{$$chakra:!0,_config:t,_global:[T(),C(),S()],breakpoints:u,tokens:l,conditions:d,utility:f,token:D,properties:m,layers:c,isValidProperty:h,splitCssProps:w,normalizeValue:g,getTokenCss:S,getGlobalCss:C,getPreflightCss:T,css:y,cva:b,sva:x,getRecipe:ee,getSlotRecipe:O,getRecipeFn:te,getSlotRecipeFn:ne,hasRecipe:ie,isRecipe:re,isSlotRecipe:j,query:{layerStyles:kx(n.layerStyles??Zy),textStyles:kx(n.textStyles??Zy),animationStyles:kx(n.animationStyles??Zy),tokens:Ax(l,Object.keys(n.tokens??Zy),(e,t)=>!e.extensions.conditions&&!t.includes(`colorPalette`)),semanticTokens:Ax(l,Object.keys(n.semanticTokens??Zy),e=>!!e.extensions.conditions),keyframes:jx(n.keyframes??Zy),breakpoints:jx(n.breakpoints??Zy)}}}function Dx(e){let t=new Map,n=new Set(e.allTokens.map(e=>e.name));for(let r of n){let n=e.getByName(r);if(!n?.extensions.cssVar)continue;let{cssVar:i,virtual:a,conditions:o}=n.extensions,s=o||a?i.ref:n.value;t.set(r,{value:s,variable:i.ref})}return t}var Ox=e=>Wt(e)&&`value`in e,kx=e=>({list(){return Object.keys(ky(e,Ox))},search(e){return this.list().filter(t=>t.includes(e))}}),Ax=(e,t,n)=>({categoryKeys:t,list(t){let r=e.categoryMap.get(t),i=r?[...r.entries()]:[],a=[];for(let e=0;e<i.length;e++){let[t,r]=i[e];n(r,t)&&a.push(t)}return a},search(e,t){return this.list(e).filter(e=>e.includes(t))}}),jx=e=>({list(){return Object.keys(e)},search(e){return this.list().filter(t=>t.includes(e))}}),Mx={sm:`480px`,md:`768px`,lg:`1024px`,xl:`1280px`,"2xl":`1536px`},Nx=`var(--chakra-empty, )`,Px=Xv({"*":{fontFeatureSettings:`"cv11"`,"--ring-inset":Nx,"--ring-offset-width":`0px`,"--ring-offset-color":`#fff`,"--ring-color":`rgba(66, 153, 225, 0.6)`,"--ring-offset-shadow":`0 0 #0000`,"--ring-shadow":`0 0 #0000`,...Object.fromEntries([`brightness`,`contrast`,`grayscale`,`hue-rotate`,`invert`,`saturate`,`sepia`,`drop-shadow`].map(e=>[`--${e}`,Nx])),...Object.fromEntries([`blur`,`brightness`,`contrast`,`grayscale`,`hue-rotate`,`invert`,`opacity`,`saturate`,`sepia`].map(e=>[`--backdrop-${e}`,Nx])),"--global-font-mono":`fonts.mono`,"--global-font-body":`fonts.body`,"--global-color-border":`colors.border`},html:{color:`fg`,bg:`bg`,lineHeight:`1.5`,colorPalette:`gray`},"*::placeholder, *[data-placeholder]":{color:`fg.muted/80`},"*::selection":{bg:`colorPalette.emphasized/80`}}),Fx=ey({"fill.muted":{value:{background:`colorPalette.muted`,color:`colorPalette.fg`}},"fill.subtle":{value:{background:`colorPalette.subtle`,color:`colorPalette.fg`}},"fill.surface":{value:{background:`colorPalette.subtle`,color:`colorPalette.fg`,boxShadow:`0 0 0px 1px var(--shadow-color)`,boxShadowColor:`colorPalette.muted`}},"fill.solid":{value:{background:`colorPalette.solid`,color:`colorPalette.contrast`}},"outline.subtle":{value:{color:`colorPalette.fg`,boxShadow:`inset 0 0 0px 1px var(--shadow-color)`,boxShadowColor:`colorPalette.subtle`}},"outline.solid":{value:{borderWidth:`1px`,borderColor:`colorPalette.solid`,color:`colorPalette.fg`}},"indicator.bottom":{value:{position:`relative`,"--indicator-color-fallback":`colors.colorPalette.solid`,_before:{content:`""`,position:`absolute`,bottom:`var(--indicator-offset-y, 0)`,insetInline:`var(--indicator-offset-x, 0)`,height:`var(--indicator-thickness, 2px)`,background:`var(--indicator-color, var(--indicator-color-fallback))`}}},"indicator.top":{value:{position:`relative`,"--indicator-color-fallback":`colors.colorPalette.solid`,_before:{content:`""`,position:`absolute`,top:`var(--indicator-offset-y, 0)`,insetInline:`var(--indicator-offset-x, 0)`,height:`var(--indicator-thickness, 2px)`,background:`var(--indicator-color, var(--indicator-color-fallback))`}}},"indicator.start":{value:{position:`relative`,"--indicator-color-fallback":`colors.colorPalette.solid`,_before:{content:`""`,position:`absolute`,insetInlineStart:`var(--indicator-offset-x, 0)`,insetBlock:`var(--indicator-offset-y, 0)`,width:`var(--indicator-thickness, 2px)`,background:`var(--indicator-color, var(--indicator-color-fallback))`}}},"indicator.end":{value:{position:`relative`,"--indicator-color-fallback":`colors.colorPalette.solid`,_before:{content:`""`,position:`absolute`,insetInlineEnd:`var(--indicator-offset-x, 0)`,insetBlock:`var(--indicator-offset-y, 0)`,width:`var(--indicator-thickness, 2px)`,background:`var(--indicator-color, var(--indicator-color-fallback))`}}},disabled:{value:{opacity:`0.5`,cursor:`not-allowed`}},none:{value:{}}}),Ix=$v({"slide-fade-in":{value:{transformOrigin:`var(--transform-origin)`,"&[data-placement^=top]":{animationName:`slide-from-bottom, fade-in`},"&[data-placement^=bottom]":{animationName:`slide-from-top, fade-in`},"&[data-placement^=left]":{animationName:`slide-from-right, fade-in`},"&[data-placement^=right]":{animationName:`slide-from-left, fade-in`}}},"slide-fade-out":{value:{transformOrigin:`var(--transform-origin)`,"&[data-placement^=top]":{animationName:`slide-to-bottom, fade-out`},"&[data-placement^=bottom]":{animationName:`slide-to-top, fade-out`},"&[data-placement^=left]":{animationName:`slide-to-right, fade-out`},"&[data-placement^=right]":{animationName:`slide-to-left, fade-out`}}},"scale-fade-in":{value:{transformOrigin:`var(--transform-origin)`,animationName:`scale-in, fade-in`}},"scale-fade-out":{value:{transformOrigin:`var(--transform-origin)`,animationName:`scale-out, fade-out`}}}),Lx=Jv({className:`chakra-badge`,base:{display:`inline-flex`,alignItems:`center`,borderRadius:`l2`,gap:`1`,fontWeight:`medium`,fontVariantNumeric:`tabular-nums`,whiteSpace:`nowrap`,userSelect:`none`},variants:{variant:{solid:{bg:`colorPalette.solid`,color:`colorPalette.contrast`},subtle:{bg:`colorPalette.subtle`,color:`colorPalette.fg`},outline:{color:`colorPalette.fg`,"--outline-shadow-legacy":`colors.colorPalette.muted`,"--outline-shadow":`colors.colorPalette.border`,shadow:`inset 0 0 0px 1px var(--shadow-color)`,shadowColor:`var(--outline-shadow, var(--outline-shadow-legacy))`},surface:{bg:`colorPalette.subtle`,color:`colorPalette.fg`,shadow:`inset 0 0 0px 1px var(--shadow-color)`,shadowColor:`colorPalette.muted`},plain:{color:`colorPalette.fg`}},size:{xs:{textStyle:`2xs`,px:`1`,minH:`4`},sm:{textStyle:`xs`,px:`1.5`,minH:`5`},md:{textStyle:`sm`,px:`2`,minH:`6`},lg:{textStyle:`sm`,px:`2.5`,minH:`7`}}},defaultVariants:{variant:`subtle`,size:`sm`}}),Rx=Jv({className:`chakra-button`,base:{display:`inline-flex`,appearance:`none`,alignItems:`center`,justifyContent:`center`,userSelect:`none`,position:`relative`,borderRadius:`l2`,whiteSpace:`nowrap`,verticalAlign:`middle`,borderWidth:`1px`,borderColor:`transparent`,cursor:`button`,flexShrink:`0`,outline:`0`,lineHeight:`1.2`,isolation:`isolate`,fontWeight:`medium`,transitionProperty:`common`,transitionDuration:`moderate`,focusVisibleRing:`outside`,_disabled:{layerStyle:`disabled`},_icon:{flexShrink:`0`}},variants:{size:{"2xs":{h:`6`,minW:`6`,textStyle:`xs`,px:`2`,gap:`1`,_icon:{width:`3.5`,height:`3.5`}},xs:{h:`8`,minW:`8`,textStyle:`xs`,px:`2.5`,gap:`1`,_icon:{width:`4`,height:`4`}},sm:{h:`9`,minW:`9`,px:`3.5`,textStyle:`sm`,gap:`2`,_icon:{width:`4`,height:`4`}},md:{h:`10`,minW:`10`,textStyle:`sm`,px:`4`,gap:`2`,_icon:{width:`5`,height:`5`}},lg:{h:`11`,minW:`11`,textStyle:`md`,px:`5`,gap:`3`,_icon:{width:`5`,height:`5`}},xl:{h:`12`,minW:`12`,textStyle:`md`,px:`5`,gap:`2.5`,_icon:{width:`5`,height:`5`}},"2xl":{h:`16`,minW:`16`,textStyle:`lg`,px:`7`,gap:`3`,_icon:{width:`6`,height:`6`}}},variant:{solid:{bg:`colorPalette.solid`,color:`colorPalette.contrast`,borderColor:`transparent`,_hover:{bg:`colorPalette.solid/90`},_expanded:{bg:`colorPalette.solid/90`}},subtle:{bg:`colorPalette.subtle`,color:`colorPalette.fg`,borderColor:`transparent`,_hover:{bg:`colorPalette.muted`},_expanded:{bg:`colorPalette.muted`}},surface:{bg:`colorPalette.subtle`,color:`colorPalette.fg`,shadow:`0 0 0px 1px var(--shadow-color)`,shadowColor:`colorPalette.muted`,_hover:{bg:`colorPalette.muted`},_expanded:{bg:`colorPalette.muted`}},outline:{borderWidth:`1px`,"--outline-color-legacy":`colors.colorPalette.muted`,"--outline-color":`colors.colorPalette.border`,borderColor:`var(--outline-color, var(--outline-color-legacy))`,color:`colorPalette.fg`,_hover:{bg:`colorPalette.subtle`},_expanded:{bg:`colorPalette.subtle`}},ghost:{bg:`transparent`,color:`colorPalette.fg`,_hover:{bg:`colorPalette.subtle`},_expanded:{bg:`colorPalette.subtle`}},plain:{color:`colorPalette.fg`}}},defaultVariants:{size:`md`,variant:`solid`}}),zx=Jv({className:`chakra-checkmark`,base:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,flexShrink:`0`,color:`white`,borderWidth:`1px`,borderColor:`transparent`,borderRadius:`l1`,cursor:`checkbox`,focusVisibleRing:`outside`,_icon:{boxSize:`full`},_invalid:{colorPalette:`red`,borderColor:`border.error`},_disabled:{opacity:`0.5`,cursor:`disabled`}},variants:{size:{xs:{boxSize:`3`},sm:{boxSize:`4`},md:{boxSize:`5`,p:`0.5`},lg:{boxSize:`6`,p:`0.5`}},variant:{solid:{borderColor:`border.emphasized`,"&:is([data-state=checked], [data-state=indeterminate])":{bg:`colorPalette.solid`,color:`colorPalette.contrast`,borderColor:`colorPalette.solid`}},outline:{borderColor:`border`,"&:is([data-state=checked], [data-state=indeterminate])":{color:`colorPalette.fg`,borderColor:`colorPalette.solid`}},subtle:{bg:`colorPalette.muted`,borderColor:`colorPalette.muted`,"&:is([data-state=checked], [data-state=indeterminate])":{color:`colorPalette.fg`}},plain:{"&:is([data-state=checked], [data-state=indeterminate])":{color:`colorPalette.fg`}},inverted:{borderColor:`border`,color:`colorPalette.fg`,"&:is([data-state=checked], [data-state=indeterminate])":{borderColor:`colorPalette.solid`}}},filled:{true:{bg:`bg`}}},defaultVariants:{variant:`solid`,size:`md`}}),{variants:Bx,defaultVariants:Vx}=Lx,Hx=Jv({className:`chakra-code`,base:{fontFamily:`mono`,alignItems:`center`,display:`inline-flex`,borderRadius:`l2`},variants:Bx,defaultVariants:Vx}),Ux=Jv({className:`color-swatch`,base:{boxSize:`var(--swatch-size)`,shadow:`inset 0 0 0 1px rgba(0, 0, 0, 0.1)`,"--checker-size":`8px`,"--checker-bg":`colors.bg`,"--checker-fg":`colors.bg.emphasized`,background:`linear-gradient(var(--color), var(--color)), repeating-conic-gradient(var(--checker-fg) 0%, var(--checker-fg) 25%, var(--checker-bg) 0%, var(--checker-bg) 50%) 0% 50% / var(--checker-size) var(--checker-size) !important`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,flexShrink:`0`},variants:{size:{"2xs":{"--swatch-size":`sizes.3.5`},xs:{"--swatch-size":`sizes.4`},sm:{"--swatch-size":`sizes.4.5`},md:{"--swatch-size":`sizes.5`},lg:{"--swatch-size":`sizes.6`},xl:{"--swatch-size":`sizes.7`},"2xl":{"--swatch-size":`sizes.8`},inherit:{"--swatch-size":`inherit`},full:{"--swatch-size":`100%`}},shape:{square:{borderRadius:`none`},circle:{borderRadius:`full`},rounded:{borderRadius:`l1`}}},defaultVariants:{size:`md`,shape:`rounded`}}),Wx=Jv({className:`chakra-container`,base:{position:`relative`,maxWidth:`8xl`,w:`100%`,mx:`auto`,px:{base:`4`,md:`6`,lg:`8`}},variants:{centerContent:{true:{display:`flex`,flexDirection:`column`,alignItems:`center`}},fluid:{true:{maxWidth:`full`}}}}),Gx=Jv({className:`chakra-heading`,base:{fontFamily:`heading`,fontWeight:`semibold`},variants:{size:{xs:{textStyle:`xs`},sm:{textStyle:`sm`},md:{textStyle:`md`},lg:{textStyle:`lg`},xl:{textStyle:`xl`},"2xl":{textStyle:`2xl`},"3xl":{textStyle:`3xl`},"4xl":{textStyle:`4xl`},"5xl":{textStyle:`5xl`},"6xl":{textStyle:`6xl`},"7xl":{textStyle:`7xl`}}},defaultVariants:{size:`xl`}}),Kx=Jv({className:`chakra-icon`,base:{display:`inline-block`,lineHeight:`1em`,flexShrink:`0`,color:`currentcolor`,verticalAlign:`middle`},variants:{size:{inherit:{},xs:{boxSize:`3`},sm:{boxSize:`4`},md:{boxSize:`5`},lg:{boxSize:`6`},xl:{boxSize:`7`},"2xl":{boxSize:`8`}}},defaultVariants:{size:`inherit`}}),qx=Jv({className:`chakra-input`,base:{width:`100%`,minWidth:`0`,outline:`0`,position:`relative`,appearance:`none`,textAlign:`start`,borderRadius:`l2`,_disabled:{layerStyle:`disabled`},height:`var(--input-height)`,minW:`var(--input-height)`,"--focus-color":`colors.colorPalette.focusRing`,"--error-color":`colors.border.error`,_invalid:{focusRingColor:`var(--error-color)`,borderColor:`var(--error-color)`}},variants:{size:{"2xs":{textStyle:`xs`,px:`2`,"--input-height":`sizes.7`},xs:{textStyle:`xs`,px:`2`,"--input-height":`sizes.8`},sm:{textStyle:`sm`,px:`2.5`,"--input-height":`sizes.9`},md:{textStyle:`sm`,px:`3`,"--input-height":`sizes.10`},lg:{textStyle:`md`,px:`4`,"--input-height":`sizes.11`},xl:{textStyle:`md`,px:`4.5`,"--input-height":`sizes.12`},"2xl":{textStyle:`lg`,px:`5`,"--input-height":`sizes.16`}},variant:{outline:{bg:`transparent`,borderWidth:`1px`,borderColor:`border`,focusVisibleRing:`inside`,focusRingColor:`var(--focus-color)`},subtle:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.muted`,focusVisibleRing:`inside`,focusRingColor:`var(--focus-color)`},flushed:{bg:`transparent`,borderBottomWidth:`1px`,borderBottomColor:`border`,borderRadius:`0`,px:`0`,_focusVisible:{borderColor:`var(--focus-color)`,boxShadow:`0px 1px 0px 0px var(--focus-color)`,_invalid:{borderColor:`var(--error-color)`,boxShadow:`0px 1px 0px 0px var(--error-color)`}}}}},defaultVariants:{size:`md`,variant:`outline`}}),Jx=Jv({className:`chakra-input-addon`,base:{flex:`0 0 auto`,width:`auto`,display:`flex`,alignItems:`center`,whiteSpace:`nowrap`,alignSelf:`stretch`,borderRadius:`l2`},variants:{size:qx.variants.size,variant:{outline:{borderWidth:`1px`,borderColor:`border`,bg:`bg.muted`},subtle:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.emphasized`},flushed:{borderBottom:`1px solid`,borderColor:`inherit`,borderRadius:`0`,px:`0`,bg:`transparent`}}},defaultVariants:{size:`md`,variant:`outline`}}),Yx=Jv({className:`chakra-kbd`,base:{display:`inline-flex`,alignItems:`center`,fontWeight:`medium`,fontFamily:`mono`,flexShrink:`0`,whiteSpace:`nowrap`,wordSpacing:`-0.5em`,userSelect:`none`,px:`1`,borderRadius:`l2`},variants:{variant:{raised:{bg:`colorPalette.subtle`,color:`colorPalette.fg`,borderWidth:`1px`,borderBottomWidth:`2px`,borderColor:`colorPalette.muted`},outline:{borderWidth:`1px`,color:`colorPalette.fg`},subtle:{bg:`colorPalette.muted`,color:`colorPalette.fg`},plain:{color:`colorPalette.fg`}},size:{sm:{textStyle:`xs`,height:`4.5`},md:{textStyle:`sm`,height:`5`},lg:{textStyle:`md`,height:`6`}}},defaultVariants:{size:`md`,variant:`raised`}}),Xx=Jv({className:`chakra-link`,base:{display:`inline-flex`,alignItems:`center`,outline:`none`,gap:`1.5`,cursor:`pointer`,borderRadius:`l1`,focusVisibleRing:`outside`},variants:{variant:{underline:{color:`colorPalette.fg`,textDecoration:`underline`,textUnderlineOffset:`3px`,textDecorationColor:`currentColor/20`},plain:{color:`colorPalette.fg`,_hover:{textDecoration:`underline`,textUnderlineOffset:`3px`,textDecorationColor:`currentColor/20`}}}},defaultVariants:{variant:`plain`}}),Zx=Jv({className:`chakra-mark`,base:{bg:`transparent`,color:`inherit`,whiteSpace:`nowrap`},variants:{variant:{subtle:{bg:`colorPalette.subtle`,color:`inherit`},solid:{bg:`colorPalette.solid`,color:`colorPalette.contrast`},text:{fontWeight:`medium`},plain:{}}}}),Qx=Jv({className:`chakra-radiomark`,base:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,verticalAlign:`top`,color:`white`,borderWidth:`1px`,borderColor:`transparent`,borderRadius:`full`,cursor:`radio`,_focusVisible:{outline:`2px solid`,outlineColor:`colorPalette.focusRing`,outlineOffset:`2px`},_invalid:{colorPalette:`red`,borderColor:`red.500`},_disabled:{opacity:`0.5`,cursor:`disabled`},"& .dot":{height:`100%`,width:`100%`,borderRadius:`full`,bg:`currentColor`,scale:`0.4`}},variants:{variant:{solid:{borderWidth:`1px`,borderColor:`border.emphasized`,_checked:{bg:`colorPalette.solid`,color:`colorPalette.contrast`,borderColor:`colorPalette.solid`}},subtle:{borderWidth:`1px`,bg:`colorPalette.muted`,borderColor:`colorPalette.muted`,color:`transparent`,_checked:{color:`colorPalette.fg`}},outline:{borderWidth:`1px`,borderColor:`inherit`,_checked:{color:`colorPalette.fg`,borderColor:`colorPalette.solid`},"& .dot":{scale:`0.6`}},inverted:{bg:`bg`,borderWidth:`1px`,borderColor:`inherit`,_checked:{color:`colorPalette.solid`,borderColor:`currentcolor`}}},size:{xs:{boxSize:`3`},sm:{boxSize:`4`},md:{boxSize:`5`},lg:{boxSize:`6`}},filled:{true:{bg:`bg`}}},defaultVariants:{variant:`solid`,size:`md`}}),$x={badge:Lx,button:Rx,code:Hx,container:Wx,heading:Gx,input:qx,inputAddon:Jx,kbd:Yx,link:Xx,mark:Zx,separator:Jv({className:`chakra-separator`,base:{display:`block`,borderColor:`border`},variants:{variant:{solid:{borderStyle:`solid`},dashed:{borderStyle:`dashed`},dotted:{borderStyle:`dotted`}},orientation:{vertical:{borderInlineStartWidth:`var(--separator-thickness)`},horizontal:{borderTopWidth:`var(--separator-thickness)`}},size:{xs:{"--separator-thickness":`0.5px`},sm:{"--separator-thickness":`1px`},md:{"--separator-thickness":`2px`},lg:{"--separator-thickness":`3px`}}},defaultVariants:{size:`sm`,variant:`solid`,orientation:`horizontal`}}),skeleton:Jv({className:`chakra-skeleton`,base:{},variants:{loading:{true:{borderRadius:`l2`,boxShadow:`none`,backgroundClip:`padding-box`,cursor:`default`,color:`transparent`,pointerEvents:`none`,userSelect:`none`,flexShrink:`0`,"&::before, &::after, *":{visibility:`hidden`}},false:{background:`unset`,animation:`fade-in var(--fade-duration, 0.1s) ease-out !important`}},variant:{pulse:{background:`bg.emphasized`,animation:`pulse`,animationDuration:`var(--duration, 1.2s)`},shine:{"--animate-from":`200%`,"--animate-to":`-200%`,"--start-color":`colors.bg.muted`,"--end-color":`colors.bg.emphasized`,backgroundImage:`linear-gradient(270deg,var(--start-color),var(--end-color),var(--end-color),var(--start-color))`,backgroundSize:`400% 100%`,animation:`bg-position var(--duration, 5s) ease-in-out infinite`},none:{animation:`none`}}},defaultVariants:{variant:`pulse`,loading:!0}}),skipNavLink:Jv({className:`chakra-skip-nav`,base:{display:`inline-flex`,bg:`bg.panel`,padding:`2.5`,borderRadius:`l2`,fontWeight:`semibold`,focusVisibleRing:`outside`,textStyle:`sm`,userSelect:`none`,border:`0`,height:`1px`,width:`1px`,margin:`-1px`,outline:`0`,overflow:`hidden`,position:`absolute`,clip:`rect(0 0 0 0)`,_focusVisible:{clip:`auto`,width:`auto`,height:`auto`,position:`fixed`,top:`6`,insetStart:`6`}}}),spinner:Jv({className:`chakra-spinner`,base:{display:`inline-block`,borderColor:`currentColor`,borderStyle:`solid`,borderWidth:`2px`,borderRadius:`full`,width:`var(--spinner-size)`,height:`var(--spinner-size)`,animation:`spin`,animationDuration:`slowest`,"--spinner-track-color":`transparent`,borderBottomColor:`var(--spinner-track-color)`,borderInlineStartColor:`var(--spinner-track-color)`},variants:{size:{inherit:{"--spinner-size":`1em`},xs:{"--spinner-size":`sizes.3`},sm:{"--spinner-size":`sizes.4`},md:{"--spinner-size":`sizes.5`},lg:{"--spinner-size":`sizes.8`},xl:{"--spinner-size":`sizes.10`}}},defaultVariants:{size:`md`}}),textarea:Jv({className:`chakra-textarea`,base:{width:`100%`,minWidth:`0`,outline:`0`,position:`relative`,appearance:`none`,textAlign:`start`,borderRadius:`l2`,_disabled:{layerStyle:`disabled`},"--focus-color":`colors.colorPalette.focusRing`,"--error-color":`colors.border.error`,_invalid:{focusRingColor:`var(--error-color)`,borderColor:`var(--error-color)`}},variants:{size:{xs:{textStyle:`xs`,px:`2`,py:`1.5`,scrollPaddingBottom:`1.5`},sm:{textStyle:`sm`,px:`2.5`,py:`2`,scrollPaddingBottom:`2`},md:{textStyle:`sm`,px:`3`,py:`2`,scrollPaddingBottom:`2`},lg:{textStyle:`md`,px:`4`,py:`3`,scrollPaddingBottom:`3`},xl:{textStyle:`md`,px:`4.5`,py:`3.5`,scrollPaddingBottom:`3.5`}},variant:{outline:{bg:`transparent`,borderWidth:`1px`,borderColor:`border`,focusVisibleRing:`inside`},subtle:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.muted`,focusVisibleRing:`inside`},flushed:{bg:`transparent`,borderBottomWidth:`1px`,borderBottomColor:`border`,borderRadius:`0`,px:`0`,_focusVisible:{borderColor:`var(--focus-color)`,boxShadow:`0px 1px 0px 0px var(--focus-color)`}}}},defaultVariants:{size:`md`,variant:`outline`}}),icon:Kx,checkmark:zx,radiomark:Qx,colorSwatch:Ux},eS=ry.colors({bg:{DEFAULT:{value:{_light:`{colors.white}`,_dark:`{colors.black}`}},subtle:{value:{_light:`{colors.gray.50}`,_dark:`{colors.gray.950}`}},muted:{value:{_light:`{colors.gray.100}`,_dark:`{colors.gray.900}`}},emphasized:{value:{_light:`{colors.gray.200}`,_dark:`{colors.gray.800}`}},inverted:{value:{_light:`{colors.black}`,_dark:`{colors.white}`}},panel:{value:{_light:`{colors.white}`,_dark:`{colors.gray.950}`}},error:{value:{_light:`{colors.red.50}`,_dark:`{colors.red.950}`}},warning:{value:{_light:`{colors.orange.50}`,_dark:`{colors.orange.950}`}},success:{value:{_light:`{colors.green.50}`,_dark:`{colors.green.950}`}},info:{value:{_light:`{colors.blue.50}`,_dark:`{colors.blue.950}`}}},fg:{DEFAULT:{value:{_light:`{colors.black}`,_dark:`{colors.gray.50}`}},muted:{value:{_light:`{colors.gray.600}`,_dark:`{colors.gray.400}`}},subtle:{value:{_light:`{colors.gray.400}`,_dark:`{colors.gray.500}`}},inverted:{value:{_light:`{colors.gray.50}`,_dark:`{colors.black}`}},error:{value:{_light:`{colors.red.500}`,_dark:`{colors.red.400}`}},warning:{value:{_light:`{colors.orange.600}`,_dark:`{colors.orange.300}`}},success:{value:{_light:`{colors.green.600}`,_dark:`{colors.green.300}`}},info:{value:{_light:`{colors.blue.600}`,_dark:`{colors.blue.300}`}}},border:{DEFAULT:{value:{_light:`{colors.gray.200}`,_dark:`{colors.gray.800}`}},muted:{value:{_light:`{colors.gray.100}`,_dark:`{colors.gray.900}`}},subtle:{value:{_light:`{colors.gray.50}`,_dark:`{colors.gray.950}`}},emphasized:{value:{_light:`{colors.gray.300}`,_dark:`{colors.gray.700}`}},inverted:{value:{_light:`{colors.gray.800}`,_dark:`{colors.gray.200}`}},error:{value:{_light:`{colors.red.500}`,_dark:`{colors.red.400}`}},warning:{value:{_light:`{colors.orange.500}`,_dark:`{colors.orange.400}`}},success:{value:{_light:`{colors.green.500}`,_dark:`{colors.green.400}`}},info:{value:{_light:`{colors.blue.500}`,_dark:`{colors.blue.400}`}}},gray:{contrast:{value:{_light:`{colors.white}`,_dark:`{colors.black}`}},fg:{value:{_light:`{colors.gray.800}`,_dark:`{colors.gray.200}`}},subtle:{value:{_light:`{colors.gray.100}`,_dark:`{colors.gray.900}`}},muted:{value:{_light:`{colors.gray.200}`,_dark:`{colors.gray.800}`}},emphasized:{value:{_light:`{colors.gray.300}`,_dark:`{colors.gray.700}`}},solid:{value:{_light:`{colors.gray.900}`,_dark:`{colors.white}`}},focusRing:{value:{_light:`{colors.gray.400}`,_dark:`{colors.gray.400}`}},border:{value:{_light:`{colors.gray.200}`,_dark:`{colors.gray.800}`}}},red:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.red.700}`,_dark:`{colors.red.300}`}},subtle:{value:{_light:`{colors.red.100}`,_dark:`{colors.red.900}`}},muted:{value:{_light:`{colors.red.200}`,_dark:`{colors.red.800}`}},emphasized:{value:{_light:`{colors.red.300}`,_dark:`{colors.red.700}`}},solid:{value:{_light:`{colors.red.600}`,_dark:`{colors.red.600}`}},focusRing:{value:{_light:`{colors.red.500}`,_dark:`{colors.red.500}`}},border:{value:{_light:`{colors.red.500}`,_dark:`{colors.red.400}`}}},orange:{contrast:{value:{_light:`white`,_dark:`black`}},fg:{value:{_light:`{colors.orange.700}`,_dark:`{colors.orange.300}`}},subtle:{value:{_light:`{colors.orange.100}`,_dark:`{colors.orange.900}`}},muted:{value:{_light:`{colors.orange.200}`,_dark:`{colors.orange.800}`}},emphasized:{value:{_light:`{colors.orange.300}`,_dark:`{colors.orange.700}`}},solid:{value:{_light:`{colors.orange.600}`,_dark:`{colors.orange.500}`}},focusRing:{value:{_light:`{colors.orange.500}`,_dark:`{colors.orange.500}`}},border:{value:{_light:`{colors.orange.500}`,_dark:`{colors.orange.400}`}}},green:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.green.700}`,_dark:`{colors.green.300}`}},subtle:{value:{_light:`{colors.green.100}`,_dark:`{colors.green.900}`}},muted:{value:{_light:`{colors.green.200}`,_dark:`{colors.green.800}`}},emphasized:{value:{_light:`{colors.green.300}`,_dark:`{colors.green.700}`}},solid:{value:{_light:`{colors.green.600}`,_dark:`{colors.green.600}`}},focusRing:{value:{_light:`{colors.green.500}`,_dark:`{colors.green.500}`}},border:{value:{_light:`{colors.green.500}`,_dark:`{colors.green.400}`}}},blue:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.blue.700}`,_dark:`{colors.blue.300}`}},subtle:{value:{_light:`{colors.blue.100}`,_dark:`{colors.blue.900}`}},muted:{value:{_light:`{colors.blue.200}`,_dark:`{colors.blue.800}`}},emphasized:{value:{_light:`{colors.blue.300}`,_dark:`{colors.blue.700}`}},solid:{value:{_light:`{colors.blue.600}`,_dark:`{colors.blue.600}`}},focusRing:{value:{_light:`{colors.blue.500}`,_dark:`{colors.blue.500}`}},border:{value:{_light:`{colors.blue.500}`,_dark:`{colors.blue.400}`}}},yellow:{contrast:{value:{_light:`black`,_dark:`black`}},fg:{value:{_light:`{colors.yellow.800}`,_dark:`{colors.yellow.300}`}},subtle:{value:{_light:`{colors.yellow.100}`,_dark:`{colors.yellow.900}`}},muted:{value:{_light:`{colors.yellow.200}`,_dark:`{colors.yellow.800}`}},emphasized:{value:{_light:`{colors.yellow.300}`,_dark:`{colors.yellow.700}`}},solid:{value:{_light:`{colors.yellow.300}`,_dark:`{colors.yellow.300}`}},focusRing:{value:{_light:`{colors.yellow.500}`,_dark:`{colors.yellow.500}`}},border:{value:{_light:`{colors.yellow.500}`,_dark:`{colors.yellow.500}`}}},teal:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.teal.700}`,_dark:`{colors.teal.300}`}},subtle:{value:{_light:`{colors.teal.100}`,_dark:`{colors.teal.900}`}},muted:{value:{_light:`{colors.teal.200}`,_dark:`{colors.teal.800}`}},emphasized:{value:{_light:`{colors.teal.300}`,_dark:`{colors.teal.700}`}},solid:{value:{_light:`{colors.teal.600}`,_dark:`{colors.teal.600}`}},focusRing:{value:{_light:`{colors.teal.500}`,_dark:`{colors.teal.500}`}},border:{value:{_light:`{colors.teal.500}`,_dark:`{colors.teal.400}`}}},purple:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.purple.700}`,_dark:`{colors.purple.300}`}},subtle:{value:{_light:`{colors.purple.100}`,_dark:`{colors.purple.900}`}},muted:{value:{_light:`{colors.purple.200}`,_dark:`{colors.purple.800}`}},emphasized:{value:{_light:`{colors.purple.300}`,_dark:`{colors.purple.700}`}},solid:{value:{_light:`{colors.purple.600}`,_dark:`{colors.purple.600}`}},focusRing:{value:{_light:`{colors.purple.500}`,_dark:`{colors.purple.500}`}},border:{value:{_light:`{colors.purple.500}`,_dark:`{colors.purple.400}`}}},pink:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.pink.700}`,_dark:`{colors.pink.300}`}},subtle:{value:{_light:`{colors.pink.100}`,_dark:`{colors.pink.900}`}},muted:{value:{_light:`{colors.pink.200}`,_dark:`{colors.pink.800}`}},emphasized:{value:{_light:`{colors.pink.300}`,_dark:`{colors.pink.700}`}},solid:{value:{_light:`{colors.pink.600}`,_dark:`{colors.pink.600}`}},focusRing:{value:{_light:`{colors.pink.500}`,_dark:`{colors.pink.500}`}},border:{value:{_light:`{colors.pink.500}`,_dark:`{colors.pink.400}`}}},cyan:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.cyan.700}`,_dark:`{colors.cyan.300}`}},subtle:{value:{_light:`{colors.cyan.100}`,_dark:`{colors.cyan.900}`}},muted:{value:{_light:`{colors.cyan.200}`,_dark:`{colors.cyan.800}`}},emphasized:{value:{_light:`{colors.cyan.300}`,_dark:`{colors.cyan.700}`}},solid:{value:{_light:`{colors.cyan.600}`,_dark:`{colors.cyan.600}`}},focusRing:{value:{_light:`{colors.cyan.500}`,_dark:`{colors.cyan.500}`}},border:{value:{_light:`{colors.cyan.500}`,_dark:`{colors.cyan.400}`}}}}),tS=ry.radii({l1:{value:`{radii.xs}`},l2:{value:`{radii.sm}`},l3:{value:`{radii.md}`}}),nS=ry.shadows({xs:{value:{_light:`0px 1px 2px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/20}`,_dark:`0px 1px 1px {black/64}, 0px 0px 1px inset {colors.gray.300/20}`}},sm:{value:{_light:`0px 2px 4px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/30}`,_dark:`0px 2px 4px {black/64}, 0px 0px 1px inset {colors.gray.300/30}`}},md:{value:{_light:`0px 4px 8px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/30}`,_dark:`0px 4px 8px {black/64}, 0px 0px 1px inset {colors.gray.300/30}`}},lg:{value:{_light:`0px 8px 16px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/30}`,_dark:`0px 8px 16px {black/64}, 0px 0px 1px inset {colors.gray.300/30}`}},xl:{value:{_light:`0px 16px 24px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/30}`,_dark:`0px 16px 24px {black/64}, 0px 0px 1px inset {colors.gray.300/30}`}},"2xl":{value:{_light:`0px 24px 40px {colors.gray.900/16}, 0px 0px 1px {colors.gray.900/30}`,_dark:`0px 24px 40px {black/64}, 0px 0px 1px inset {colors.gray.300/30}`}},inner:{value:{_light:`inset 0 2px 4px 0 {black/5}`,_dark:`inset 0 2px 4px 0 black`}},inset:{value:{_light:`inset 0 0 0 1px {black/5}`,_dark:`inset 0 0 0 1px {colors.gray.300/5}`}}}),rS=qc.extendWith(`itemBody`),iS=V(`action-bar`).parts(`positioner`,`content`,`separator`,`selectionTrigger`,`closeTrigger`),aS=V(`alert`).parts(`title`,`description`,`root`,`indicator`,`content`),oS=V(`breadcrumb`).parts(`link`,`currentLink`,`item`,`list`,`root`,`ellipsis`,`separator`),sS=V(`blockquote`).parts(`root`,`icon`,`content`,`caption`),cS=V(`card`).parts(`root`,`header`,`body`,`footer`,`title`,`description`),lS=V(`checkbox-card`,[`root`,`control`,`label`,`description`,`addon`,`indicator`,`content`]),uS=V(`data-list`).parts(`root`,`item`,`itemLabel`,`itemValue`),dS=Rp.extendWith(`indicatorGroup`),fS=zp.extendWith(`header`,`body`,`footer`,`backdrop`),pS=zp.extendWith(`header`,`body`,`footer`,`backdrop`),mS=am.extendWith(`textarea`),hS=V(`empty-state`,[`root`,`content`,`indicator`,`title`,`description`]),gS=om.extendWith(`requiredIndicator`),_S=cm.extendWith(`content`),vS=lm.extendWith(`itemContent`,`dropzoneContent`,`fileText`),yS=V(`list`).parts(`root`,`item`,`indicator`),bS=hm.extendWith(`itemCommand`),xS=V(`select`).parts(`root`,`field`,`indicator`),SS=vm.extendWith(`header`,`body`,`footer`),CS=xm.extendWith(`itemAddon`,`itemIndicator`),wS=CS.extendWith(`itemContent`,`itemDescription`),TS=Sm.extendWith(`itemIndicator`),ES=Tm.extendWith(`indicatorGroup`),DS=Fp.extendWith(`indicatorGroup`,`empty`),OS=$m.extendWith(`markerIndicator`,`markerLabel`),kS=V(`stat`).parts(`root`,`label`,`helpText`,`valueText`,`valueUnit`,`indicator`),AS=V(`status`).parts(`root`,`indicator`),jS=V(`steps`,[`root`,`list`,`item`,`trigger`,`indicator`,`separator`,`content`,`title`,`description`,`nextTrigger`,`prevTrigger`,`progress`]),MS=og.extendWith(`indicator`),NS=V(`table`).parts(`root`,`header`,`body`,`row`,`columnHeader`,`cell`,`footer`,`caption`),PS=V(`toast`).parts(`root`,`title`,`description`,`indicator`,`closeTrigger`,`actionTrigger`),FS=V(`tabs`).parts(`root`,`trigger`,`list`,`content`,`contentGroup`,`indicator`),IS=V(`tag`).parts(`root`,`label`,`closeTrigger`,`startElement`,`endElement`),LS=V(`timeline`).parts(`root`,`item`,`content`,`separator`,`indicator`,`connector`,`title`,`description`),RS=Sp.extendWith(`channelText`),zS=V(`code-block`,[`root`,`content`,`title`,`header`,`footer`,`control`,`overlay`,`code`,`codeText`,`copyTrigger`,`copyIndicator`,`collapseTrigger`,`collapseIndicator`,`collapseText`]),BS=rh.extendWith(`resizeTriggerSeparator`,`resizeTriggerIndicator`);Gu.extendWith(`valueText`);var VS=pm,HS=W({className:`chakra-accordion`,slots:rS.keys(),base:{root:{width:`full`,"--accordion-radius":`radii.l2`},item:{overflowAnchor:`none`},itemTrigger:{display:`flex`,alignItems:`center`,textAlign:`start`,width:`full`,outline:`0`,gap:`3`,fontWeight:`medium`,borderRadius:`var(--accordion-radius)`,_focusVisible:{outline:`2px solid`,outlineColor:`colorPalette.focusRing`},_disabled:{layerStyle:`disabled`}},itemBody:{pt:`var(--accordion-padding-y)`,pb:`calc(var(--accordion-padding-y) * 2)`},itemContent:{overflow:`hidden`,borderRadius:`var(--accordion-radius)`,_open:{animationName:`expand-height, fade-in`,animationDuration:`moderate`},_closed:{animationName:`collapse-height, fade-out`,animationDuration:`moderate`}},itemIndicator:{transition:`rotate 0.2s`,transformOrigin:`center`,color:`fg.subtle`,_open:{rotate:`180deg`},_icon:{width:`1.2em`,height:`1.2em`}}},variants:{variant:{outline:{item:{borderBottomWidth:`1px`}},subtle:{itemTrigger:{px:`var(--accordion-padding-x)`},itemContent:{px:`var(--accordion-padding-x)`},item:{borderRadius:`var(--accordion-radius)`,_open:{bg:`colorPalette.subtle`}}},enclosed:{root:{borderWidth:`1px`,borderRadius:`var(--accordion-radius)`,divideY:`1px`,overflow:`hidden`},itemTrigger:{px:`var(--accordion-padding-x)`},itemContent:{px:`var(--accordion-padding-x)`},item:{_open:{bg:`bg.subtle`}}},plain:{}},size:{sm:{root:{"--accordion-padding-x":`spacing.3`,"--accordion-padding-y":`spacing.2`},itemTrigger:{textStyle:`sm`,py:`var(--accordion-padding-y)`}},md:{root:{"--accordion-padding-x":`spacing.4`,"--accordion-padding-y":`spacing.2`},itemTrigger:{textStyle:`md`,py:`var(--accordion-padding-y)`}},lg:{root:{"--accordion-padding-x":`spacing.4.5`,"--accordion-padding-y":`spacing.2.5`},itemTrigger:{textStyle:`lg`,py:`var(--accordion-padding-y)`}}}},defaultVariants:{size:`md`,variant:`outline`}}),US=W({className:`chakra-action-bar`,slots:iS.keys(),base:{positioner:{position:`fixed`,display:`flex`,pointerEvents:`none`,insetInline:`0`,"--action-bar-offset":`spacing.4`},content:{bg:`bg.panel`,shadow:`md`,display:`flex`,alignItems:`center`,gap:`3`,borderRadius:`l3`,py:`2.5`,px:`3`,pointerEvents:`auto`,translate:`calc(-1 * var(--scrollbar-width) / 2) 0px`,_open:{animationName:`slide-from-bottom, fade-in`,animationDuration:`moderate`},_closed:{animationName:`slide-to-bottom, fade-out`,animationDuration:`faster`}},separator:{width:`1px`,height:`5`,bg:`border`},selectionTrigger:{display:`inline-flex`,alignItems:`center`,gap:`2`,alignSelf:`stretch`,textStyle:`sm`,px:`4`,py:`1`,borderRadius:`l2`,borderWidth:`1px`,borderStyle:`dashed`}},variants:{placement:{bottom:{positioner:{bottom:`calc(env(safe-area-inset-bottom) + var(--action-bar-offset))`,justifyContent:`center`}},"bottom-start":{positioner:{bottom:`calc(env(safe-area-inset-bottom) + var(--action-bar-offset))`,justifyContent:`flex-start`,ps:`var(--action-bar-offset)`}},"bottom-end":{positioner:{bottom:`calc(env(safe-area-inset-bottom) + var(--action-bar-offset))`,justifyContent:`flex-end`,pe:`var(--action-bar-offset)`}}}},defaultVariants:{placement:`bottom`}}),WS=W({slots:aS.keys(),className:`chakra-alert`,base:{root:{width:`full`,display:`flex`,alignItems:`flex-start`,position:`relative`,borderRadius:`l3`},title:{fontWeight:`medium`},description:{display:`inline`},indicator:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,flexShrink:`0`,width:`1em`,height:`1em`,_icon:{boxSize:`full`}},content:{display:`flex`,flex:`1`,gap:`1`}},variants:{status:{info:{root:{colorPalette:`blue`}},warning:{root:{colorPalette:`orange`}},success:{root:{colorPalette:`green`}},error:{root:{colorPalette:`red`}},neutral:{root:{colorPalette:`gray`}}},inline:{true:{content:{display:`inline-flex`,flexDirection:`row`,alignItems:`center`}},false:{content:{display:`flex`,flexDirection:`column`}}},variant:{subtle:{root:{bg:`colorPalette.subtle`,color:`colorPalette.fg`}},surface:{root:{bg:`colorPalette.subtle`,color:`colorPalette.fg`,shadow:`inset 0 0 0px 1px var(--shadow-color)`,shadowColor:`colorPalette.muted`},indicator:{color:`colorPalette.fg`}},outline:{root:{color:`colorPalette.fg`,shadow:`inset 0 0 0px 1px var(--shadow-color)`,"--outline-shadow-legacy":`colors.colorPalette.muted`,"--outline-shadow":`colors.colorPalette.border`,shadowColor:`var(--outline-shadow, var(--outline-shadow-legacy))`},indicator:{color:`colorPalette.fg`}},solid:{root:{bg:`colorPalette.solid`,color:`colorPalette.contrast`},indicator:{color:`colorPalette.contrast`}}},size:{sm:{root:{gap:`2`,px:`3`,py:`3`,textStyle:`xs`},indicator:{textStyle:`lg`}},md:{root:{gap:`3`,px:`4`,py:`4`,textStyle:`sm`},indicator:{textStyle:`xl`}},lg:{root:{gap:`3`,px:`4`,py:`4`,textStyle:`md`},indicator:{textStyle:`2xl`}}}},defaultVariants:{status:`info`,variant:`subtle`,size:`md`,inline:!1}}),GS=W({slots:Jc.keys(),className:`chakra-avatar`,base:{root:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,fontWeight:`medium`,position:`relative`,verticalAlign:`top`,flexShrink:`0`,userSelect:`none`,width:`var(--avatar-size)`,height:`var(--avatar-size)`,fontSize:`var(--avatar-font-size)`,borderRadius:`var(--avatar-radius)`,"&[data-group-item]":{borderWidth:`2px`,borderColor:`bg`}},image:{width:`100%`,height:`100%`,objectFit:`cover`,borderRadius:`var(--avatar-radius)`},fallback:{lineHeight:`1`,textTransform:`uppercase`,fontWeight:`medium`,fontSize:`var(--avatar-font-size)`,borderRadius:`var(--avatar-radius)`}},variants:{size:{full:{root:{"--avatar-size":`100%`,"--avatar-font-size":`100%`}},"2xs":{root:{"--avatar-font-size":`fontSizes.2xs`,"--avatar-size":`sizes.6`}},xs:{root:{"--avatar-font-size":`fontSizes.xs`,"--avatar-size":`sizes.8`}},sm:{root:{"--avatar-font-size":`fontSizes.sm`,"--avatar-size":`sizes.9`}},md:{root:{"--avatar-font-size":`fontSizes.md`,"--avatar-size":`sizes.10`}},lg:{root:{"--avatar-font-size":`fontSizes.md`,"--avatar-size":`sizes.11`}},xl:{root:{"--avatar-font-size":`fontSizes.lg`,"--avatar-size":`sizes.12`}},"2xl":{root:{"--avatar-font-size":`fontSizes.xl`,"--avatar-size":`sizes.16`}}},variant:{solid:{root:{bg:`colorPalette.solid`,color:`colorPalette.contrast`}},subtle:{root:{bg:`colorPalette.muted`,color:`colorPalette.fg`}},outline:{root:{color:`colorPalette.fg`,borderWidth:`1px`,"--outline-shadow-legacy":`colors.colorPalette.muted`,"--outline-shadow":`colors.colorPalette.border`,borderColor:`var(--outline-shadow, var(--outline-shadow-legacy))`}}},shape:{square:{},rounded:{root:{"--avatar-radius":`radii.l3`}},full:{root:{"--avatar-radius":`radii.full`}}},borderless:{true:{root:{"&[data-group-item]":{borderWidth:`0px`}}}}},defaultVariants:{size:`md`,shape:`full`,variant:`subtle`}}),KS=W({className:`chakra-blockquote`,slots:sS.keys(),base:{root:{position:`relative`,display:`flex`,flexDirection:`column`,gap:`2`},caption:{textStyle:`sm`,color:`fg.muted`},icon:{boxSize:`5`}},variants:{justify:{start:{root:{alignItems:`flex-start`,textAlign:`start`}},center:{root:{alignItems:`center`,textAlign:`center`}},end:{root:{alignItems:`flex-end`,textAlign:`end`}}},variant:{subtle:{root:{paddingX:`5`,borderStartWidth:`4px`,borderStartColor:`colorPalette.muted`},icon:{color:`colorPalette.fg`}},solid:{root:{paddingX:`5`,borderStartWidth:`4px`,borderStartColor:`colorPalette.solid`},icon:{color:`colorPalette.solid`}},plain:{root:{paddingX:`5`},icon:{color:`colorPalette.solid`}}}},defaultVariants:{variant:`subtle`,justify:`start`}}),qS=W({className:`chakra-breadcrumb`,slots:oS.keys(),base:{list:{display:`flex`,alignItems:`center`,wordBreak:`break-word`,color:`fg.muted`,listStyle:`none`},link:{outline:`0`,textDecoration:`none`,borderRadius:`l1`,focusRing:`outside`,display:`inline-flex`,alignItems:`center`,gap:`2`},item:{display:`inline-flex`,alignItems:`center`},separator:{color:`fg.muted`,opacity:`0.8`,_icon:{boxSize:`1em`},_rtl:{rotate:`180deg`}},ellipsis:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,_icon:{boxSize:`1em`}}},variants:{variant:{underline:{link:{color:`colorPalette.fg`,textDecoration:`underline`,textUnderlineOffset:`0.2em`,textDecorationColor:`colorPalette.muted`},currentLink:{color:`colorPalette.fg`}},plain:{link:{color:`fg.muted`,_hover:{color:`fg`}},currentLink:{color:`fg`}}},size:{sm:{list:{gap:`1`,textStyle:`xs`}},md:{list:{gap:`1.5`,textStyle:`sm`}},lg:{list:{gap:`2`,textStyle:`md`}}}},defaultVariants:{variant:`plain`,size:`md`}}),JS=W({className:`chakra-card`,slots:cS.keys(),base:{root:{display:`flex`,flexDirection:`column`,position:`relative`,minWidth:`0`,wordWrap:`break-word`,borderRadius:`l3`,color:`fg`,textAlign:`start`},title:{fontWeight:`semibold`},description:{color:`fg.muted`,fontSize:`sm`},header:{paddingInline:`var(--card-padding)`,paddingTop:`var(--card-padding)`,display:`flex`,flexDirection:`column`,gap:`1.5`},body:{padding:`var(--card-padding)`,flex:`1`,display:`flex`,flexDirection:`column`},footer:{display:`flex`,alignItems:`center`,gap:`2`,paddingInline:`var(--card-padding)`,paddingBottom:`var(--card-padding)`}},variants:{size:{sm:{root:{"--card-padding":`spacing.4`},title:{textStyle:`md`}},md:{root:{"--card-padding":`spacing.6`},title:{textStyle:`lg`}},lg:{root:{"--card-padding":`spacing.7`},title:{textStyle:`xl`}}},variant:{elevated:{root:{bg:`bg.panel`,boxShadow:`md`}},outline:{root:{bg:`bg.panel`,borderWidth:`1px`,borderColor:`border`}},subtle:{root:{bg:`bg.muted`}}}},defaultVariants:{variant:`outline`,size:`md`}}),YS=W({className:`carousel`,slots:ou.keys(),base:{root:{position:`relative`,display:`flex`,gap:`2`,_horizontal:{flexDirection:`column`},_vertical:{flexDirection:`row`}},item:{_horizontal:{width:`100%`},_vertical:{height:`100%`}},control:{display:`flex`,alignItems:`center`,_horizontal:{flexDirection:`row`,width:`100%`},_vertical:{flexDirection:`column`,height:`100%`}},indicatorGroup:{display:`flex`,justifyContent:`center`,gap:`3`,_horizontal:{flexDirection:`row`},_vertical:{flexDirection:`column`}},indicator:{width:`2.5`,height:`2.5`,borderRadius:`full`,bg:`colorPalette.subtle`,cursor:`button`,_current:{bg:`colorPalette.solid`}}},defaultVariants:{}}),XS=W({slots:Wu.keys(),className:`chakra-checkbox`,base:{root:{display:`inline-flex`,gap:`2`,alignItems:`center`,verticalAlign:`top`,position:`relative`},control:zx.base,label:{fontWeight:`medium`,userSelect:`none`,_disabled:{opacity:`0.5`}}},variants:{size:{xs:{root:{gap:`1.5`},label:{textStyle:`xs`},control:zx.variants?.size?.xs},sm:{root:{gap:`2`},label:{textStyle:`sm`},control:zx.variants?.size?.sm},md:{root:{gap:`2.5`},label:{textStyle:`sm`},control:zx.variants?.size?.md},lg:{root:{gap:`3`},label:{textStyle:`md`},control:zx.variants?.size?.lg}},variant:{outline:{control:zx.variants?.variant?.outline},solid:{control:zx.variants?.variant?.solid},subtle:{control:zx.variants?.variant?.subtle}}},defaultVariants:{variant:`solid`,size:`md`}}),ZS=W({slots:lS.keys(),className:`chakra-checkbox-card`,base:{root:{display:`flex`,flexDirection:`column`,userSelect:`none`,position:`relative`,borderRadius:`l2`,flex:`1`,focusVisibleRing:`outside`,_disabled:{opacity:`0.8`},_invalid:{outline:`2px solid`,outlineColor:`border.error`}},control:{display:`inline-flex`,flex:`1`,position:`relative`,borderRadius:`inherit`,justifyContent:`var(--checkbox-card-justify)`,alignItems:`var(--checkbox-card-align)`},label:{fontWeight:`medium`,display:`flex`,alignItems:`center`,gap:`2`,flex:`1`,_disabled:{opacity:`0.5`}},description:{opacity:`0.64`,textStyle:`sm`,_disabled:{opacity:`0.5`}},addon:{_disabled:{opacity:`0.5`}},indicator:zx.base,content:{display:`flex`,flexDirection:`column`,flex:`1`,gap:`1`,justifyContent:`var(--checkbox-card-justify)`,alignItems:`var(--checkbox-card-align)`}},variants:{size:{sm:{root:{textStyle:`sm`},control:{padding:`3`,gap:`1.5`},addon:{px:`3`,py:`1.5`,borderTopWidth:`1px`},indicator:zx.variants?.size.sm},md:{root:{textStyle:`sm`},control:{padding:`4`,gap:`2.5`},addon:{px:`4`,py:`2`,borderTopWidth:`1px`},indicator:zx.variants?.size.md},lg:{root:{textStyle:`md`},control:{padding:`4`,gap:`3.5`},addon:{px:`4`,py:`2`,borderTopWidth:`1px`},indicator:zx.variants?.size.lg}},variant:{surface:{root:{borderWidth:`1px`,borderColor:`border`,_checked:{bg:`colorPalette.subtle`,color:`colorPalette.fg`,borderColor:`colorPalette.muted`},_disabled:{bg:`bg.muted`}},indicator:zx.variants?.variant.solid},subtle:{root:{bg:`bg.muted`},control:{_checked:{bg:`colorPalette.muted`,color:`colorPalette.fg`}},indicator:zx.variants?.variant.plain},outline:{root:{borderWidth:`1px`,borderColor:`border`,_checked:{boxShadow:`inset 0 0 0 1px var(--shadow-color)`,boxShadowColor:`colorPalette.solid`,borderColor:`colorPalette.solid`}},indicator:zx.variants?.variant.solid},solid:{root:{borderWidth:`1px`,_checked:{bg:`colorPalette.solid`,color:`colorPalette.contrast`,borderColor:`colorPalette.solid`}},indicator:zx.variants?.variant.inverted}},justify:{start:{root:{"--checkbox-card-justify":`flex-start`}},end:{root:{"--checkbox-card-justify":`flex-end`}},center:{root:{"--checkbox-card-justify":`center`}}},align:{start:{root:{"--checkbox-card-align":`flex-start`},content:{textAlign:`start`}},end:{root:{"--checkbox-card-align":`flex-end`},content:{textAlign:`end`}},center:{root:{"--checkbox-card-align":`center`},content:{textAlign:`center`}}},orientation:{vertical:{control:{flexDirection:`column`}},horizontal:{control:{flexDirection:`row`}}}},defaultVariants:{size:`md`,variant:`outline`,align:`start`,orientation:`horizontal`}}),QS=W({slots:zS.keys(),className:`code-block`,base:{root:{colorPalette:`gray`,rounded:`var(--code-block-radius)`,overflow:`hidden`,bg:`bg`,color:`fg`,borderWidth:`1px`,"--code-block-max-height":`320px`,"--code-block-bg":`colors.bg`,"--code-block-fg":`colors.fg`,"--code-block-obscured-opacity":`0.5`,"--code-block-obscured-blur":`1px`,"--code-block-line-number-width":`sizes.3`,"--code-block-line-number-margin":`spacing.4`,"--code-block-highlight-bg":`{colors.teal.focusRing/20}`,"--code-block-highlight-border":`colors.teal.focusRing`,"--code-block-highlight-added-bg":`{colors.green.focusRing/20}`,"--code-block-highlight-added-border":`colors.green.focusRing`,"--code-block-highlight-removed-bg":`{colors.red.focusRing/20}`,"--code-block-highlight-removed-border":`colors.red.focusRing`},header:{display:`flex`,alignItems:`center`,gap:`2`,position:`relative`,px:`var(--code-block-padding)`,minH:`var(--code-block-header-height)`,mb:`calc(var(--code-block-padding) / 2 * -1)`},title:{display:`inline-flex`,alignItems:`center`,gap:`1.5`,flex:`1`,color:`fg.muted`},control:{gap:`1.5`,display:`inline-flex`,alignItems:`center`},footer:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:`2`,px:`var(--code-block-padding)`,minH:`var(--code-block-header-height)`},content:{position:`relative`,colorScheme:`dark`,borderBottomRadius:`var(--code-block-radius)`,maxHeight:`var(--code-block-max-height)`,"& ::selection":{bg:`blue.500/40`},_expanded:{maxHeight:`unset`}},overlay:{"--bg":`{colors.black/50}`,display:`flex`,alignItems:`flex-end`,justifyContent:`center`,padding:`4`,bgImage:`linear-gradient(0deg,var(--bg) 25%,transparent 100%)`,color:`white`,minH:`5rem`,pos:`absolute`,bottom:`0`,insetInline:`0`,zIndex:`1`,fontWeight:`medium`,_expanded:{display:`none`}},code:{fontFamily:`mono`,lineHeight:`tall`,whiteSpace:`pre`,counterReset:`line 0`,overflowX:`auto`,overflowY:`hidden`},codeText:{px:`var(--code-block-padding)`,py:`var(--code-block-padding)`,position:`relative`,display:`block`,width:`100%`,"&[data-has-focused]":{"& [data-line]:not([data-focused])":{transitionProperty:`opacity, filter`,transitionDuration:`moderate`,transitionTimingFunction:`ease-in-out`,opacity:`var(--code-block-obscured-opacity)`,filter:`blur(var(--code-block-obscured-blur))`},"&:hover":{"--code-block-obscured-opacity":`1`,"--code-block-obscured-blur":`0px`}},"&[data-has-line-numbers][data-plaintext]":{paddingInlineStart:`calc(var(--code-block-line-number-width) + var(--code-block-line-number-margin) + var(--code-block-padding))`},"& [data-line]":{position:`relative`,paddingInlineEnd:`var(--code-block-padding)`,"--highlight-bg":`var(--code-block-highlight-bg)`,"--highlight-border":`var(--code-block-highlight-border)`,"&[data-highlight], &[data-diff]":{display:`inline-block`,width:`full`,"&:after":{content:`''`,display:`block`,position:`absolute`,top:`0`,insetStart:`calc(var(--code-block-padding) * -1)`,insetEnd:`0px`,width:`calc(100% + var(--code-block-padding) * 2)`,height:`100%`,bg:`var(--highlight-bg)`,borderStartWidth:`2px`,borderStartColor:`var(--highlight-border)`}},"&[data-diff='added']":{"--highlight-bg":`var(--code-block-highlight-added-bg)`,"--highlight-border":`var(--code-block-highlight-added-border)`},"&[data-diff='removed']":{"--highlight-bg":`var(--code-block-highlight-removed-bg)`,"--highlight-border":`var(--code-block-highlight-removed-border)`}},"&[data-word-wrap]":{"&[data-plaintext], & [data-line]":{whiteSpace:`pre-wrap`,wordBreak:`break-all`}},"&[data-has-line-numbers]":{"--content":`counter(line)`,"& [data-line]:before":{content:`var(--content)`,counterIncrement:`line`,width:`var(--code-block-line-number-width)`,marginRight:`var(--code-block-line-number-margin)`,display:`inline-block`,textAlign:`end`,userSelect:`none`,whiteSpace:`nowrap`,opacity:.4},"& [data-diff='added']:before":{content:`'+'`},"& [data-diff='removed']:before":{content:`'-'`}}}},variants:{size:{sm:{root:{"--code-block-padding":`spacing.4`,"--code-block-radius":`radii.md`,"--code-block-header-height":`sizes.8`},title:{textStyle:`xs`},code:{fontSize:`xs`}},md:{root:{"--code-block-padding":`spacing.4`,"--code-block-radius":`radii.lg`,"--code-block-header-height":`sizes.10`},title:{textStyle:`xs`},code:{fontSize:`sm`}},lg:{root:{"--code-block-padding":`spacing.5`,"--code-block-radius":`radii.xl`,"--code-block-header-height":`sizes.12`},title:{textStyle:`sm`},code:{fontSize:`sm`}}}},defaultVariants:{size:`md`}}),$S=W({slots:Ku.keys(),className:`chakra-collapsible`,base:{content:{overflow:`hidden`,_open:{animationName:`expand-height, fade-in`,animationDuration:`moderate`,"&[data-has-collapsed-size]":{animationName:`expand-height`}},_closed:{animationName:`collapse-height, fade-out`,animationDuration:`moderate`,"&[data-has-collapsed-size]":{animationName:`collapse-height`}}}}}),eC=W({className:`colorPicker`,slots:RS.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`},label:{color:`fg`,fontWeight:`medium`,textStyle:`sm`,_disabled:{opacity:`0.5`}},valueText:{textAlign:`start`},control:{display:`flex`,alignItems:`center`,flexDirection:`row`,gap:`2`,position:`relative`},swatchTrigger:{display:`flex`,alignItems:`center`,justifyContent:`center`},trigger:{display:`flex`,alignItems:`center`,justifyContent:`center`,flexDirection:`row`,flexShrink:`0`,gap:`2`,textStyle:`sm`,minH:`var(--input-height)`,minW:`var(--input-height)`,px:`1`,rounded:`l2`,_disabled:{opacity:`0.5`},"--focus-color":`colors.colorPalette.focusRing`,"&:focus-visible":{borderColor:`var(--focus-color)`,outline:`1px solid var(--focus-color)`},"&[data-fit-content]":{"--input-height":`unset`,px:`0`,border:`0`}},content:{display:`flex`,flexDirection:`column`,bg:`bg.panel`,borderRadius:`l3`,boxShadow:`lg`,width:`64`,p:`4`,gap:`3`,"--color-picker-z-index":`zIndex.popover`,zIndex:`calc(var(--color-picker-z-index) + var(--layer-index, 0))`,_open:{animationStyle:`slide-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`slide-fade-out`,animationDuration:`faster`}},area:{height:`180px`,borderRadius:`l2`,overflow:`hidden`},areaThumb:{borderRadius:`full`,height:`var(--thumb-size)`,width:`var(--thumb-size)`,borderWidth:`2px`,borderColor:`white`,shadow:`sm`,focusVisibleRing:`mixed`,focusRingColor:`white`},areaBackground:{height:`full`},channelSlider:{borderRadius:`l2`,flex:`1`},channelSliderTrack:{height:`var(--slider-height)`,borderRadius:`inherit`,boxShadow:`inset 0 0 0 1px rgba(0,0,0,0.1)`},channelText:{textStyle:`xs`,color:`fg.muted`,fontWeight:`medium`,textTransform:`capitalize`},swatchGroup:{display:`flex`,flexDirection:`row`,flexWrap:`wrap`,gap:`2`},swatch:{...Ux.base,borderRadius:`l1`},swatchIndicator:{color:`white`,rounded:`full`},channelSliderThumb:{borderRadius:`full`,height:`var(--thumb-size)`,width:`var(--thumb-size)`,borderWidth:`2px`,borderColor:`white`,shadow:`sm`,transform:`translate(-50%, -50%)`,focusVisibleRing:`outside`,focusRingOffset:`1px`},channelInput:{...qx.base,"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:`none`,margin:0}},formatSelect:{textStyle:`xs`,textTransform:`uppercase`,borderWidth:`1px`,minH:`6`,focusRing:`inside`,rounded:`l2`},transparencyGrid:{borderRadius:`l2`},view:{display:`flex`,flexDirection:`column`,gap:`2`}},variants:{size:{"2xs":{channelInput:qx.variants?.size?.[`2xs`],swatch:{"--swatch-size":`sizes.4.5`},trigger:{"--input-height":`sizes.7`},area:{"--thumb-size":`sizes.3`},channelSlider:{"--slider-height":`sizes.3`,"--thumb-size":`sizes.3`}},xs:{channelInput:qx.variants?.size?.xs,swatch:{"--swatch-size":`sizes.5`},trigger:{"--input-height":`sizes.8`},area:{"--thumb-size":`sizes.3.5`},channelSlider:{"--slider-height":`sizes.3.5`,"--thumb-size":`sizes.3.5`}},sm:{channelInput:qx.variants?.size?.sm,swatch:{"--swatch-size":`sizes.6`},trigger:{"--input-height":`sizes.9`},area:{"--thumb-size":`sizes.3.5`},channelSlider:{"--slider-height":`sizes.3.5`,"--thumb-size":`sizes.3.5`}},md:{channelInput:qx.variants?.size?.md,swatch:{"--swatch-size":`sizes.7`},trigger:{"--input-height":`sizes.10`},area:{"--thumb-size":`sizes.3.5`},channelSlider:{"--slider-height":`sizes.3.5`,"--thumb-size":`sizes.3.5`}},lg:{channelInput:qx.variants?.size?.lg,swatch:{"--swatch-size":`sizes.7`},trigger:{"--input-height":`sizes.11`},area:{"--thumb-size":`sizes.3.5`},channelSlider:{"--slider-height":`sizes.3.5`,"--thumb-size":`sizes.3.5`}},xl:{channelInput:qx.variants?.size?.xl,swatch:{"--swatch-size":`sizes.8`},trigger:{"--input-height":`sizes.12`},area:{"--thumb-size":`sizes.3.5`},channelSlider:{"--slider-height":`sizes.3.5`,"--thumb-size":`sizes.3.5`}},"2xl":{channelInput:qx.variants?.size?.[`2xl`],swatch:{"--swatch-size":`sizes.10`},trigger:{"--input-height":`sizes.16`},area:{"--thumb-size":`sizes.3.5`},channelSlider:{"--slider-height":`sizes.3.5`,"--thumb-size":`sizes.3.5`}}},variant:{outline:{channelInput:qx.variants?.variant?.outline,trigger:{borderWidth:`1px`}},subtle:{channelInput:qx.variants?.variant?.subtle,trigger:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.muted`}}}},defaultVariants:{size:`md`,variant:`outline`}}),tC=W({className:`chakra-combobox`,slots:DS.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`,width:`full`},label:{fontWeight:`medium`,userSelect:`none`,textStyle:`sm`,_disabled:{layerStyle:`disabled`}},control:{pos:`relative`,"--padding-factor":`1`,"--combobox-input-padding-end":`var(--combobox-input-padding-x)`,"&:has([data-part=trigger]), &:has([data-part=clear-trigger])":{"--combobox-input-padding-end":`calc(var(--combobox-input-height) * var(--padding-factor))`},"&:has([data-part=trigger]):has([data-part=clear-trigger]:not([hidden]))":{"--padding-factor":`1.5`}},input:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,background:`bg.panel`,width:`full`,minH:`var(--combobox-input-height)`,ps:`var(--combobox-input-padding-x)`,pe:`var(--combobox-input-padding-end)`,"--input-height":`var(--combobox-input-height)`,borderRadius:`l2`,outline:0,userSelect:`none`,textAlign:`start`,_placeholderShown:{color:`fg.muted`},_disabled:{layerStyle:`disabled`},"--focus-color":`colors.colorPalette.focusRing`,"--error-color":`colors.border.error`,_invalid:{focusRingColor:`var(--error-color)`,borderColor:`var(--error-color)`}},trigger:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,"--input-height":`var(--combobox-input-height)`},clearTrigger:{color:`fg.muted`,pointerEvents:`auto`,focusVisibleRing:`inside`,focusRingWidth:`2px`,rounded:`l1`},indicatorGroup:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:`1`,pos:`absolute`,insetEnd:`0`,top:`0`,bottom:`0`,px:`var(--combobox-input-padding-x)`,_icon:{boxSize:`var(--combobox-indicator-size)`},"[data-disabled] &":{opacity:.5}},content:{background:`bg.panel`,display:`flex`,flexDirection:`column`,"--combobox-z-index":`zIndex.popover`,zIndex:`calc(var(--combobox-z-index) + var(--layer-index, 0))`,borderRadius:`l2`,outline:0,maxH:`96`,overflowY:`auto`,boxShadow:`md`,_open:{animationStyle:`slide-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`slide-fade-out`,animationDuration:`0s`},"&[data-empty]:not(:has([data-scope=combobox][data-part=empty]))":{opacity:0}},item:{position:`relative`,userSelect:`none`,display:`flex`,alignItems:`center`,gap:`2`,py:`var(--combobox-item-padding-y)`,px:`var(--combobox-item-padding-x)`,cursor:`option`,justifyContent:`space-between`,flex:`1`,textAlign:`start`,borderRadius:`l1`,_highlighted:{bg:`bg.emphasized/60`},_disabled:{pointerEvents:`none`,opacity:`0.5`},_icon:{boxSize:`var(--combobox-indicator-size)`}},empty:{py:`var(--combobox-item-padding-y)`,px:`var(--combobox-item-padding-x)`},itemText:{flex:`1`},itemGroup:{pb:`var(--combobox-item-padding-y)`,_last:{pb:`0`}},itemGroupLabel:{fontWeight:`medium`,py:`var(--combobox-item-padding-y)`,px:`var(--combobox-item-padding-x)`}},variants:{variant:{outline:{input:{bg:`transparent`,borderWidth:`1px`,borderColor:`border`,focusVisibleRing:`inside`}},subtle:{input:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.muted`,focusVisibleRing:`inside`}},flushed:{input:{bg:`transparent`,borderBottomWidth:`1px`,borderBottomColor:`border`,borderRadius:`0`,px:`0`,_focusVisible:{borderColor:`var(--focus-color)`,boxShadow:`0px 1px 0px 0px var(--focus-color)`}},indicatorGroup:{px:`0`}}},size:{xs:{root:{"--combobox-input-height":`sizes.8`,"--combobox-input-padding-x":`spacing.2`,"--combobox-indicator-size":`sizes.3.5`},input:{textStyle:`xs`},content:{"--combobox-item-padding-x":`spacing.1.5`,"--combobox-item-padding-y":`spacing.1`,"--combobox-indicator-size":`sizes.3.5`,p:`1`,textStyle:`xs`},trigger:{textStyle:`xs`,gap:`1`}},sm:{root:{"--combobox-input-height":`sizes.9`,"--combobox-input-padding-x":`spacing.2.5`,"--combobox-indicator-size":`sizes.4`},input:{textStyle:`sm`},content:{"--combobox-item-padding-x":`spacing.2`,"--combobox-item-padding-y":`spacing.1.5`,"--combobox-indicator-size":`sizes.4`,p:`1`,textStyle:`sm`},trigger:{textStyle:`sm`,gap:`1`}},md:{root:{"--combobox-input-height":`sizes.10`,"--combobox-input-padding-x":`spacing.3`,"--combobox-indicator-size":`sizes.4`},input:{textStyle:`sm`},content:{"--combobox-item-padding-x":`spacing.2`,"--combobox-item-padding-y":`spacing.1.5`,"--combobox-indicator-size":`sizes.4`,p:`1`,textStyle:`sm`},itemIndicator:{display:`flex`,alignItems:`center`,justifyContent:`center`},trigger:{textStyle:`sm`,gap:`2`}},lg:{root:{"--combobox-input-height":`sizes.12`,"--combobox-input-padding-x":`spacing.4`,"--combobox-indicator-size":`sizes.5`},input:{textStyle:`md`},content:{"--combobox-item-padding-y":`spacing.2`,"--combobox-item-padding-x":`spacing.3`,"--combobox-indicator-size":`sizes.5`,p:`1.5`,textStyle:`md`},trigger:{textStyle:`md`,py:`3`,gap:`2`}}}},defaultVariants:{size:`md`,variant:`outline`}}),nC=W({slots:uS.keys(),className:`chakra-data-list`,base:{itemLabel:{display:`flex`,alignItems:`center`,gap:`1`},itemValue:{display:`flex`,minWidth:`0`,flex:`1`}},variants:{orientation:{horizontal:{root:{display:`flex`,flexDirection:`column`},item:{display:`inline-flex`,alignItems:`center`,gap:`4`},itemLabel:{minWidth:`120px`}},vertical:{root:{display:`flex`,flexDirection:`column`},item:{display:`flex`,flexDirection:`column`,gap:`1`}}},size:{sm:{root:{gap:`3`},item:{textStyle:`xs`}},md:{root:{gap:`4`},item:{textStyle:`sm`}},lg:{root:{gap:`5`},item:{textStyle:`md`}}},variant:{subtle:{itemLabel:{color:`fg.muted`}},bold:{itemLabel:{fontWeight:`medium`},itemValue:{color:`fg.muted`}}}},defaultVariants:{size:`md`,orientation:`vertical`,variant:`subtle`}}),rC=W({className:`chakra-date-input`,slots:Ip.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`,width:`full`,_disabled:{opacity:`0.5`}},label:{textStyle:`label`},control:{display:`flex`,alignItems:`center`,width:`full`},segmentGroup:{flex:`1`,outline:`0`,position:`relative`,appearance:`none`,textAlign:`start`,borderRadius:`l2`,height:`var(--input-height)`,minW:`var(--input-height)`,"--focus-color":`colors.colorPalette.focusRing`,"--error-color":`colors.border.error`,_invalid:{focusRingColor:`var(--error-color)`,borderColor:`var(--error-color)`},display:`flex`,alignItems:`center`,gap:`1`,cursor:`text`},segment:{borderRadius:`l1`,px:`0.5`,outline:`none`,_placeholderShown:{color:`fg.subtle`},"&[data-type=literal]":{px:`0`,color:`fg.subtle`}}},variants:{size:{"2xs":{segmentGroup:{textStyle:`xs`,px:`1.5`,"--input-height":`sizes.7`}},xs:{segmentGroup:{textStyle:`xs`,px:`1.5`,"--input-height":`sizes.8`}},sm:{segmentGroup:{textStyle:`sm`,px:`2`,"--input-height":`sizes.9`}},md:{segmentGroup:{textStyle:`sm`,px:`2.5`,"--input-height":`sizes.10`}},lg:{segmentGroup:{textStyle:`md`,px:`3.5`,"--input-height":`sizes.11`}},xl:{segmentGroup:{textStyle:`md`,px:`4`,"--input-height":`sizes.12`}},"2xl":{segmentGroup:{textStyle:`lg`,px:`4.5`,"--input-height":`sizes.16`}}},variant:{outline:{segmentGroup:{bg:`transparent`,borderWidth:`1px`,borderColor:`border`,focusRing:`inside`,focusRingColor:`var(--focus-color)`},segment:{_focus:{bg:`colorPalette.emphasized`,color:`fg`}}},subtle:{segmentGroup:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.muted`,focusRing:`inside`,focusRingColor:`var(--focus-color)`},segment:{_focus:{bg:`colorPalette.subtle`,color:`colorPalette.fg`}}},flushed:{segmentGroup:{bg:`transparent`,borderBottomWidth:`1px`,borderBottomColor:`border`,borderRadius:`0`,px:`0`,_focus:{borderColor:`var(--focus-color)`,boxShadow:`0px 1px 0px 0px var(--focus-color)`,_invalid:{borderColor:`var(--error-color)`,boxShadow:`0px 1px 0px 0px var(--error-color)`}}},segment:{_focus:{bg:`colorPalette.subtle`,color:`colorPalette.fg`}}}}},defaultVariants:{size:`md`,variant:`outline`}}),iC=Zv({display:`inline-flex`,alignItems:`center`,justifyContent:`center`,boxSize:`var(--datepicker-nav-trigger-size)`,borderRadius:`l2`,color:`fg`,focusVisibleRing:`inside`,focusRingWidth:`2px`,_hover:{bg:`colorPalette.subtle`},_focusVisible:{boxShadow:`0 0 0 2px var(--colors-color-palette-focus-ring)`},_disabled:{opacity:.5},_icon:{boxSize:`4`}}),aC=Zv({height:`var(--datepicker-select-height)`,ps:`2`,pe:`8`,textStyle:`sm`,borderWidth:`1px`,borderRadius:`l2`,outline:`none`,focusVisibleRing:`inside`,appearance:`none`,fieldSizing:`content`,backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")`,backgroundRepeat:`no-repeat`,backgroundPosition:`right 0.375rem center`,backgroundSize:`1.25em`}),oC=W({className:`date-picker`,slots:dS.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`,width:`full`,"--datepicker-indicators-offset":`sizes.3`,_disabled:{opacity:.5}},label:{textStyle:`sm`,fontWeight:`medium`},indicatorGroup:{position:`absolute`,insetEnd:`var(--datepicker-indicators-offset)`,top:`50%`,transform:`translateY(-50%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:`1`},control:{display:`flex`,alignItems:`center`,gap:`2`,width:`full`,position:`relative`},input:{flex:`1`,minWidth:`0`,height:`var(--datepicker-input-height)`,"--input-height":`var(--datepicker-input-height)`,px:`var(--datepicker-input-px)`,textStyle:`sm`,bg:`transparent`,borderRadius:`l2`,outline:`0`,appearance:`none`,color:`fg`,"--focus-color":`colors.colorPalette.focusRing`,"--error-color":`colors.border.error`,_invalid:{focusRingColor:`var(--error-color)`,borderColor:`var(--error-color)`}},trigger:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:`6`,height:`6`,borderRadius:`l1`,color:`fg.muted`,outline:`none`,_hover:{color:`fg`},focusVisibleRing:`inside`,focusRingWidth:`2px`,_icon:{boxSize:`4`}},content:{display:`flex`,flexDirection:`column`,gap:`3`,p:`3`,minW:`18rem`,bg:`bg.panel`,borderRadius:`l2`,boxShadow:`lg`,color:`fg`,"--date-picker-z-index":`zIndex.popover`,zIndex:`calc(var(--date-picker-z-index) + var(--layer-index, 0))`,outline:`none`,_open:{animationStyle:`scale-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`scale-fade-out`,animationDuration:`faster`}},view:{display:`flex`,flexDirection:`column`,gap:`3`},viewControl:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:`2`,height:`var(--datepicker-nav-trigger-size)`},viewTrigger:{display:`inline-flex`,flex:`1`,alignItems:`center`,justifyContent:`center`,gap:`1`,py:`1.5`,px:`2`,textStyle:`sm`,fontWeight:`semibold`,borderRadius:`l2`,focusVisibleRing:`inside`,focusRingWidth:`2px`,_hover:{bg:`colorPalette.subtle`}},prevTrigger:iC,nextTrigger:iC,rangeText:{textStyle:`sm`,fontWeight:`semibold`},table:{borderCollapse:`separate`,borderSpacing:`0`},tableHeader:{width:`var(--table-cell-size)`,py:`2`,textStyle:`xs`,fontWeight:`medium`,color:`fg.muted`,textAlign:`center`,textTransform:`uppercase`,"&[data-type='week-number']":{color:`fg.subtle`}},tableCell:{py:`0.5`,"&[data-type='week-number']":{color:`fg.subtle`}},tableCellTrigger:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:`var(--table-cell-size)`,minHeight:`var(--table-cell-size)`,textStyle:`sm`,borderRadius:`l2`,focusVisibleRing:`inside`,focusRingWidth:`2px`,focusRingOffset:`0px`,cursor:`default`,position:`relative`,_hover:{bg:`colorPalette.subtle`},"[data-view=month] &, [data-view=year] &":{width:`calc(var(--table-cell-size) * 1.75)`},_today:{color:`colorPalette.fg`,fontWeight:`semibold`,textDecoration:`underline`,textUnderlineOffset:`3px`,textDecorationThickness:`2px`},"&[data-selected]":{bg:`colorPalette.solid`,color:`colorPalette.contrast`,_hover:{bg:`colorPalette.solid`}},"&[data-in-range]":{bg:`colorPalette.subtle`,color:`colorPalette.fg`,borderRadius:`0`,_hover:{bg:`colorPalette.subtle`}},"&[data-in-range][data-selected]":{bg:`colorPalette.solid`,color:`colorPalette.contrast`,borderRadius:`0`,_hover:{bg:`colorPalette.solid`},"&[data-range-start][data-range-end]":{borderRadius:`l2`},"&[data-range-start]:not([data-range-end])":{borderStartRadius:`l2`,borderEndRadius:`0`},"&[data-range-end]:not([data-range-start])":{borderEndRadius:`l2`,borderStartRadius:`0`}},_disabled:{opacity:.4}},monthSelect:aC,yearSelect:aC,clearTrigger:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:`6`,height:`6`,flexShrink:0,textStyle:`xs`,borderRadius:`l2`,color:`fg.muted`,_hover:{color:`fg`},focusVisibleRing:`inside`,_icon:{width:`4`,height:`4`}}},variants:{size:{xs:{root:{"--datepicker-input-height":`sizes.8`,"--datepicker-input-px":`sizes.2`,"--datepicker-indicators-offset":`sizes.2`},view:{"--table-cell-size":`sizes.8`,"--datepicker-nav-trigger-size":`sizes.7`,"--datepicker-select-height":`sizes.8`}},sm:{root:{"--datepicker-input-height":`sizes.9`,"--datepicker-input-px":`sizes.2.5`,"--datepicker-indicators-offset":`sizes.2.5`},view:{"--table-cell-size":`sizes.9`,"--datepicker-nav-trigger-size":`sizes.8`,"--datepicker-select-height":`sizes.9`}},md:{root:{"--datepicker-input-height":`sizes.10`,"--datepicker-input-px":`sizes.3`},view:{"--table-cell-size":`sizes.10`,"--datepicker-nav-trigger-size":`sizes.8`,"--datepicker-select-height":`sizes.10`}},lg:{root:{"--datepicker-input-height":`sizes.11`,"--datepicker-input-px":`sizes.4`},view:{"--table-cell-size":`sizes.10`,"--datepicker-nav-trigger-size":`sizes.9`,"--datepicker-select-height":`sizes.10`}},xl:{root:{"--datepicker-input-height":`sizes.12`,"--datepicker-input-px":`sizes.4.5`},view:{"--table-cell-size":`sizes.10`,"--datepicker-nav-trigger-size":`sizes.9`,"--datepicker-select-height":`sizes.10`}}},hideOutsideDays:{true:{tableCellTrigger:{"&[data-outside-range]":{visibility:`hidden`}}}},variant:{outline:{input:{bg:`transparent`,borderWidth:`1px`,borderColor:`border`,focusVisibleRing:`inside`,focusRingColor:`var(--focus-color)`}},subtle:{input:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.muted`,focusVisibleRing:`inside`,focusRingColor:`var(--focus-color)`}},flushed:{input:{bg:`transparent`,borderBottomWidth:`1px`,borderBottomColor:`border`,borderRadius:`0`,px:`0`,_focusVisible:{borderColor:`var(--focus-color)`,boxShadow:`0px 1px 0px 0px var(--focus-color)`,_invalid:{borderColor:`var(--error-color)`,boxShadow:`0px 1px 0px 0px var(--error-color)`}}},indicatorGroup:{insetEnd:`0`}}}},defaultVariants:{size:`md`,variant:`outline`}}),sC=W({slots:fS.keys(),className:`chakra-dialog`,base:{backdrop:{bg:`blackAlpha.500`,pos:`fixed`,left:0,top:0,w:`100dvw`,h:`100dvh`,"--dialog-z-index":`zIndex.popover`,zIndex:`calc(var(--dialog-z-index) + var(--layer-index, 0) - 1)`,_open:{animationName:`fade-in`,animationDuration:`slow`},_closed:{animationName:`fade-out`,animationDuration:`moderate`}},positioner:{display:`flex`,width:`100dvw`,height:`100dvh`,position:`fixed`,left:0,top:0,"--dialog-z-index":`zIndex.popover`,zIndex:`calc(var(--dialog-z-index) + var(--layer-index, 0))`,justifyContent:`center`,overscrollBehaviorY:`none`},content:{display:`flex`,flexDirection:`column`,position:`relative`,width:`100%`,outline:0,borderRadius:`l3`,textStyle:`sm`,my:`var(--dialog-margin, var(--dialog-base-margin))`,"--dialog-z-index":`zIndex.popover`,zIndex:`calc(var(--dialog-z-index) + var(--layer-index, 0))`,bg:`bg.panel`,boxShadow:`lg`,_open:{animationDuration:`moderate`},_closed:{animationDuration:`faster`}},header:{display:`flex`,gap:`2`,flex:0,px:`6`,pt:`6`,pb:`4`},body:{flex:`1`,px:`6`,pt:`2`,pb:`6`},footer:{display:`flex`,alignItems:`center`,justifyContent:`flex-end`,gap:`3`,px:`6`,pt:`2`,pb:`4`},title:{textStyle:`lg`,fontWeight:`semibold`},description:{color:`fg.muted`},closeTrigger:{pos:`absolute`,top:`2`,insetEnd:`2`}},variants:{placement:{center:{positioner:{alignItems:`center`},content:{"--dialog-base-margin":`auto`,mx:`auto`}},top:{positioner:{alignItems:`flex-start`},content:{"--dialog-base-margin":`spacing.16`,mx:`auto`}},bottom:{positioner:{alignItems:`flex-end`},content:{"--dialog-base-margin":`spacing.16`,mx:`auto`}}},scrollBehavior:{inside:{positioner:{overflow:`hidden`},content:{maxH:`calc(100% - 7.5rem)`},body:{overflow:`auto`}},outside:{positioner:{overflow:`auto`,pointerEvents:`auto`}}},size:{xs:{content:{maxW:`sm`}},sm:{content:{maxW:`md`}},md:{content:{maxW:`lg`}},lg:{content:{maxW:`2xl`}},xl:{content:{maxW:`4xl`}},cover:{positioner:{padding:`10`},content:{width:`100%`,height:`100%`,"--dialog-margin":`0`}},full:{content:{maxW:`100dvw`,minH:`100dvh`,"--dialog-margin":`0`,borderRadius:`0`}}},motionPreset:{scale:{content:{_open:{animationName:`scale-in, fade-in`},_closed:{animationName:`scale-out, fade-out`}}},"slide-in-bottom":{content:{_open:{animationName:`slide-from-bottom, fade-in`},_closed:{animationName:`slide-to-bottom, fade-out`}}},"slide-in-top":{content:{_open:{animationName:`slide-from-top, fade-in`},_closed:{animationName:`slide-to-top, fade-out`}}},"slide-in-left":{content:{_open:{animationName:`slide-from-left, fade-in`},_closed:{animationName:`slide-to-left, fade-out`}}},"slide-in-right":{content:{_open:{animationName:`slide-from-right, fade-in`},_closed:{animationName:`slide-to-right, fade-out`}}},none:{}}},defaultVariants:{size:`md`,scrollBehavior:`outside`,placement:`top`,motionPreset:`scale`}}),cC=W({slots:pS.keys(),className:`chakra-drawer`,base:{backdrop:{bg:`blackAlpha.500`,pos:`fixed`,insetInlineStart:0,top:0,w:`100vw`,h:`100dvh`,"--drawer-z-index":`zIndex.popover`,zIndex:`calc(var(--drawer-z-index) + var(--layer-index, 0) - 1)`,_open:{animationName:`fade-in`,animationDuration:`slow`},_closed:{animationName:`fade-out`,animationDuration:`moderate`}},positioner:{display:`flex`,width:`100vw`,height:`100dvh`,position:`fixed`,insetInlineStart:0,top:0,"--drawer-z-index":`zIndex.popover`,zIndex:`calc(var(--drawer-z-index) + var(--layer-index, 0))`,overscrollBehaviorY:`none`},content:{display:`flex`,flexDirection:`column`,position:`relative`,width:`100%`,outline:0,"--drawer-z-index":`zIndex.popover`,zIndex:`calc(var(--drawer-z-index) + var(--layer-index, 0))`,textStyle:`sm`,maxH:`100dvh`,color:`inherit`,bg:`bg.panel`,boxShadow:`lg`,_open:{animationDuration:`slowest`,animationTimingFunction:`ease-in-smooth`},_closed:{animationDuration:`slower`,animationTimingFunction:`ease-in-smooth`}},header:{display:`flex`,alignItems:`center`,gap:`2`,flex:0,px:`6`,pt:`6`,pb:`4`},body:{px:`6`,py:`2`,flex:`1`,overflow:`auto`},footer:{display:`flex`,alignItems:`center`,justifyContent:`flex-end`,gap:`3`,px:`6`,pt:`2`,pb:`4`},title:{flex:`1`,textStyle:`lg`,fontWeight:`semibold`},description:{color:`fg.muted`},closeTrigger:{pos:`absolute`,top:`3`,insetEnd:`2`}},variants:{size:{xs:{content:{maxW:`xs`}},sm:{content:{maxW:`md`}},md:{content:{maxW:`lg`}},lg:{content:{maxW:`2xl`}},xl:{content:{maxW:`4xl`}},full:{content:{maxW:`100vw`,h:`100dvh`}}},placement:{start:{positioner:{justifyContent:`flex-start`,alignItems:`stretch`},content:{_open:{animationName:{base:`slide-from-left-full, fade-in`,_rtl:`slide-from-right-full, fade-in`}},_closed:{animationName:{base:`slide-to-left-full, fade-out`,_rtl:`slide-to-right-full, fade-out`}}}},end:{positioner:{justifyContent:`flex-end`,alignItems:`stretch`},content:{_open:{animationName:{base:`slide-from-right-full, fade-in`,_rtl:`slide-from-left-full, fade-in`}},_closed:{animationName:{base:`slide-to-right-full, fade-out`,_rtl:`slide-to-left-full, fade-out`}}}},top:{positioner:{justifyContent:`stretch`,alignItems:`flex-start`},content:{maxW:`100%`,_open:{animationName:`slide-from-top-full, fade-in`},_closed:{animationName:`slide-to-top-full, fade-out`}}},bottom:{positioner:{justifyContent:`stretch`,alignItems:`flex-end`},content:{maxW:`100%`,_open:{animationName:`slide-from-bottom-full, fade-in`},_closed:{animationName:`slide-to-bottom-full, fade-out`}}}},contained:{true:{positioner:{padding:`4`},content:{borderRadius:`l3`}}}},defaultVariants:{size:`xs`,placement:`end`}}),lC=Zv({fontSize:`inherit`,fontWeight:`inherit`,textAlign:`inherit`,bg:`transparent`,borderRadius:`l2`}),uC=W({slots:mS.keys(),className:`chakra-editable`,base:{root:{display:`inline-flex`,alignItems:`center`,position:`relative`,gap:`1.5`,width:`full`},preview:{...lC,py:`1`,px:`1`,display:`inline-flex`,alignItems:`center`,transitionProperty:`common`,transitionDuration:`moderate`,cursor:`text`,_hover:{bg:`bg.muted`},_disabled:{userSelect:`none`}},input:{...lC,outline:`0`,py:`1`,px:`1`,transitionProperty:`common`,transitionDuration:`normal`,width:`full`,focusVisibleRing:`inside`,focusRingWidth:`2px`,_placeholder:{opacity:.6}},control:{display:`inline-flex`,alignItems:`center`,gap:`1.5`}},variants:{size:{sm:{root:{textStyle:`sm`},preview:{minH:`8`},input:{minH:`8`}},md:{root:{textStyle:`sm`},preview:{minH:`9`},input:{minH:`9`}},lg:{root:{textStyle:`md`},preview:{minH:`10`},input:{minH:`10`}}}},defaultVariants:{size:`md`}}),dC=W({slots:hS.keys(),className:`chakra-empty-state`,base:{root:{width:`full`},content:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`},indicator:{display:`flex`,alignItems:`center`,justifyContent:`center`,color:`fg.subtle`,_icon:{boxSize:`1em`}},title:{fontWeight:`semibold`},description:{textStyle:`sm`,color:`fg.muted`}},variants:{size:{sm:{root:{px:`4`,py:`6`},title:{textStyle:`md`},content:{gap:`4`},indicator:{textStyle:`2xl`}},md:{root:{px:`8`,py:`12`},title:{textStyle:`lg`},content:{gap:`6`},indicator:{textStyle:`4xl`}},lg:{root:{px:`12`,py:`16`},title:{textStyle:`xl`},content:{gap:`8`},indicator:{textStyle:`6xl`}}}},defaultVariants:{size:`md`}}),fC=W({className:`chakra-field`,slots:gS.keys(),base:{requiredIndicator:{color:`fg.error`,lineHeight:`1`},root:{display:`flex`,width:`100%`,position:`relative`,gap:`1.5`},label:{display:`flex`,alignItems:`center`,textAlign:`start`,textStyle:`sm`,fontWeight:`medium`,gap:`1`,userSelect:`none`,_disabled:{opacity:`0.5`}},errorText:{display:`inline-flex`,alignItems:`center`,fontWeight:`medium`,gap:`1`,color:`fg.error`,textStyle:`xs`},helperText:{color:`fg.muted`,textStyle:`xs`}},variants:{orientation:{vertical:{root:{flexDirection:`column`,alignItems:`flex-start`}},horizontal:{root:{flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`},label:{flex:`0 0 var(--field-label-width, 80px)`}}}},defaultVariants:{orientation:`vertical`}}),pC=W({className:`fieldset`,slots:_S.keys(),base:{root:{display:`flex`,flexDirection:`column`,width:`full`},content:{display:`flex`,flexDirection:`column`,width:`full`},legend:{color:`fg`,fontWeight:`medium`,_disabled:{opacity:`0.5`}},helperText:{color:`fg.muted`,textStyle:`sm`},errorText:{display:`inline-flex`,alignItems:`center`,color:`fg.error`,gap:`2`,fontWeight:`medium`,textStyle:`sm`}},variants:{size:{sm:{root:{spaceY:`2`},content:{gap:`1.5`},legend:{textStyle:`sm`}},md:{root:{spaceY:`4`},content:{gap:`4`},legend:{textStyle:`sm`}},lg:{root:{spaceY:`6`},content:{gap:`4`},legend:{textStyle:`md`}}}},defaultVariants:{size:`md`}}),mC=W({className:`chakra-file-upload`,slots:vS.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`4`,width:`100%`,alignItems:`flex-start`},label:{fontWeight:`medium`,textStyle:`sm`},dropzone:{background:`bg`,borderRadius:`l3`,borderWidth:`2px`,borderStyle:`dashed`,display:`flex`,alignItems:`center`,flexDirection:`column`,gap:`4`,justifyContent:`center`,minHeight:`2xs`,px:`3`,py:`2`,transition:`backgrounds`,focusVisibleRing:`outside`,_hover:{bg:`bg.subtle`},_dragging:{bg:`colorPalette.subtle`,borderStyle:`solid`,borderColor:`colorPalette.solid`}},dropzoneContent:{display:`flex`,flexDirection:`column`,alignItems:`center`,textAlign:`center`,gap:`1`,textStyle:`sm`},item:{pos:`relative`,textStyle:`sm`,animationName:`fade-in`,animationDuration:`moderate`,background:`bg`,borderRadius:`l2`,borderWidth:`1px`,width:`100%`,display:`flex`,alignItems:`center`,gap:`3`,p:`4`},itemGroup:{width:`100%`,display:`flex`,flexDirection:`column`,gap:`3`,_empty:{display:`none`}},itemName:{color:`fg`,fontWeight:`medium`,lineClamp:`1`},itemContent:{display:`flex`,flexDirection:`column`,gap:`0.5`,flex:`1`},itemSizeText:{color:`fg.muted`,textStyle:`xs`},itemDeleteTrigger:{display:`flex`,alignItems:`center`,justifyContent:`center`,alignSelf:`flex-start`,boxSize:`5`,p:`2px`,color:`fg.muted`,cursor:`button`},itemPreview:{color:`fg.muted`,_icon:{boxSize:`4.5`}}},defaultVariants:{}}),hC=W({slots:um.keys(),className:`chakra-floating-panel`,base:{positioner:{"--floating-panel-z-index":`zIndex.popover`,zIndex:`calc(var(--floating-panel-z-index) + var(--layer-index, 0))`,"&:has([data-topmost])":{"--layer-index":`100`},"&:has([data-behind])":{"--layer-index":`-100`}},content:{display:`flex`,flexDirection:`column`,bg:`bg.panel`,borderRadius:`l2`,boxShadow:`lg`,overflow:`hidden`,outline:0,position:`relative`,_open:{animationName:`scale-in, fade-in`,animationDuration:`moderate`}},dragTrigger:{flex:`1`,display:`flex`,alignItems:`center`,gap:`2`,minW:`0`},header:{display:`flex`,alignItems:`center`,gap:`2`,px:`3`,py:`2`,borderBottomWidth:`1px`,bg:`bg.subtle`,flex:`none`},title:{fontWeight:`semibold`,textStyle:`sm`,flex:`1`,truncate:!0},body:{flex:`1`,overflow:`auto`,p:`3`,textStyle:`sm`},resizeTrigger:{zIndex:`1`,"--size":`sizes.2.5`,'&[data-axis="n"], &[data-axis="s"]':{h:`var(--size)`},'&[data-axis="e"], &[data-axis="w"]':{w:`var(--size)`},'&[data-axis]:is([data-axis="ne"], [data-axis="nw"], [data-axis="se"], [data-axis="sw"])':{w:`var(--size)`,h:`var(--size)`}}}}),gC=W({className:`chakra-hover-card`,slots:dm.keys(),base:{content:{position:`relative`,display:`flex`,flexDirection:`column`,textStyle:`sm`,"--hovercard-bg":`colors.bg.panel`,bg:`var(--hovercard-bg)`,boxShadow:`lg`,maxWidth:`80`,borderRadius:`l3`,"--hover-card-z-index":`zIndex.popover`,zIndex:`calc(var(--hover-card-z-index) + var(--layer-index, 0))`,transformOrigin:`var(--transform-origin)`,outline:`0`,_open:{animationStyle:`slide-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`slide-fade-out`,animationDuration:`faster`}},arrow:{"--arrow-size":`sizes.3`,"--arrow-background":`var(--hovercard-bg)`},arrowTip:{borderTopWidth:`0.5px`,borderLeftWidth:`0.5px`}},variants:{size:{xs:{content:{padding:`3`}},sm:{content:{padding:`4`}},md:{content:{padding:`5`}},lg:{content:{padding:`6`}}}},defaultVariants:{size:`md`}}),_C=W({className:`chakra-list`,slots:yS.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`var(--list-gap)`,"& :where(ul, ol)":{marginTop:`var(--list-gap)`}},item:{whiteSpace:`normal`,display:`list-item`},indicator:{marginEnd:`2`,minHeight:`1lh`,flexShrink:0,display:`inline-block`,verticalAlign:`middle`}},variants:{variant:{marker:{root:{listStyle:`revert`},item:{_marker:{color:`fg.subtle`}}},plain:{item:{alignItems:`flex-start`,display:`inline-flex`}}},align:{center:{item:{alignItems:`center`}},start:{item:{alignItems:`flex-start`}},end:{item:{alignItems:`flex-end`}}}},defaultVariants:{variant:`marker`}}),vC=W({className:`chakra-listbox`,slots:VS.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`,width:`full`},content:{display:`flex`,maxH:`96`,p:`1`,gap:`1`,textStyle:`sm`,outline:`none`,scrollPadding:`1`,_horizontal:{flexDirection:`row`,overflowX:`auto`},_vertical:{flexDirection:`column`,overflowY:`auto`},"--listbox-item-padding-x":`spacing.2`,"--listbox-item-padding-y":`spacing.1.5`},item:{position:`relative`,userSelect:`none`,display:`flex`,alignItems:`center`,gap:`2`,cursor:`pointer`,justifyContent:`space-between`,flex:`1`,textAlign:`start`,borderRadius:`l1`,py:`var(--listbox-item-padding-y)`,px:`var(--listbox-item-padding-x)`,_highlighted:{outline:`2px solid`,outlineColor:`border.emphasized`},_disabled:{pointerEvents:`none`,opacity:`0.5`}},empty:{py:`var(--listbox-item-padding-y)`,px:`var(--listbox-item-padding-x)`},itemText:{flex:`1`},itemGroup:{mt:`1.5`,_first:{mt:`0`}},itemGroupLabel:{py:`1.5`,px:`2`,fontWeight:`medium`},label:{fontWeight:`medium`,userSelect:`none`,textStyle:`sm`,_disabled:{layerStyle:`disabled`}},valueText:{lineClamp:`1`,maxW:`80%`},itemIndicator:{display:`flex`,alignItems:`center`,justifyContent:`center`,_icon:{boxSize:`4`}}},variants:{variant:{subtle:{content:{bg:`bg.panel`,borderWidth:`1px`,borderRadius:`l2`},item:{_hover:{bg:`bg.emphasized/60`},_selected:{bg:`bg.muted`}}},solid:{content:{bg:`bg.panel`,borderWidth:`1px`,borderRadius:`l2`},item:{_selected:{bg:`colorPalette.solid`,color:`colorPalette.contrast`}}},plain:{}}},defaultVariants:{variant:`subtle`}}),yC=W({className:`chakra-marquee`,slots:mm.keys(),base:{root:{position:`relative`,width:`100%`,"--marquee-edge-color":`colors.bg`,"--marquee-edge-size":`20%`,"&[data-paused]":{animationPlayState:`paused !important`,"& *":{animationPlayState:`paused !important`}}},viewport:{overflow:`hidden`,display:`flex`,width:`100%`,height:`100%`},content:{display:`flex`,minWidth:`max-content`,animationTimingFunction:`linear`,animationFillMode:`forwards`,animationDuration:`var(--marquee-duration)`,animationDelay:`var(--marquee-delay)`,animationIterationCount:`var(--marquee-loop-count)`,_motionReduce:{animation:`none !important`},"&[data-side='start'], &[data-side='end']":{animationName:`marqueeX`},"&[data-side='top'], &[data-side='bottom']":{animationName:`marqueeY`},"&[data-reverse]":{animationDirection:`reverse`},"&[data-orientation='horizontal']":{flexDirection:`row`},"&[data-orientation='vertical']":{flexDirection:`column`}},edge:{position:`absolute`,zIndex:`1`,pointerEvents:`none`,"&[data-side='start']":{width:`var(--marquee-edge-size)`,insetY:`0`,insetInlineStart:`0`,background:`linear-gradient(to right, var(--marquee-edge-color, white), transparent)`,_rtl:{background:`linear-gradient(to left, var(--marquee-edge-color, white), transparent)`}},"&[data-side='end']":{width:`var(--marquee-edge-size)`,insetY:`0`,insetInlineEnd:`0`,background:`linear-gradient(to left, var(--marquee-edge-color, white), transparent)`,_rtl:{background:`linear-gradient(to right, var(--marquee-edge-color, white), transparent)`}},"&[data-side='top']":{height:`var(--marquee-edge-size)`,insetX:`0`,top:`0`,background:`linear-gradient(to bottom, var(--marquee-edge-color, white), transparent)`},"&[data-side='bottom']":{height:`var(--marquee-edge-size)`,insetX:`0`,bottom:`0`,background:`linear-gradient(to top, var(--marquee-edge-color, white), transparent)`}}}}),bC=W({className:`chakra-menu`,slots:bS.keys(),base:{content:{outline:0,"--menu-bg":`colors.bg.panel`,bg:`var(--menu-bg)`,boxShadow:`lg`,color:`fg`,maxHeight:`var(--available-height)`,"--menu-z-index":`zIndex.popover`,zIndex:`calc(var(--menu-z-index) + var(--layer-index, 0))`,borderRadius:`l2`,overflow:`hidden`,overflowY:`auto`,_open:{animationStyle:`slide-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`slide-fade-out`,animationDuration:`faster`}},item:{textDecoration:`none`,color:`fg`,userSelect:`none`,borderRadius:`l1`,width:`100%`,display:`flex`,cursor:`menuitem`,alignItems:`center`,textAlign:`start`,position:`relative`,flex:`0 0 auto`,outline:0,_disabled:{layerStyle:`disabled`},"&[data-type]":{ps:`8`}},itemText:{flex:`1`},itemIndicator:{position:`absolute`,insetStart:`2`,transform:`translateY(-50%)`,top:`50%`},itemGroupLabel:{px:`2`,py:`1.5`,fontWeight:`semibold`,textStyle:`sm`},indicator:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,flexShrink:`0`},itemCommand:{opacity:`0.6`,textStyle:`xs`,ms:`auto`,ps:`4`,letterSpacing:`widest`,fontFamily:`inherit`},separator:{height:`1px`,bg:`bg.muted`,my:`1`,mx:`-1`},arrow:{"--arrow-size":`sizes.3`,"--arrow-background":`var(--menu-bg)`},arrowTip:{borderTopWidth:`1px`,borderLeftWidth:`1px`}},variants:{variant:{subtle:{item:{_highlighted:{bg:`bg.emphasized/60`}}},solid:{item:{_highlighted:{bg:`colorPalette.solid`,color:`colorPalette.contrast`}}}},size:{sm:{content:{minW:`8rem`,padding:`1`,scrollPadding:`1`},item:{gap:`1`,textStyle:`xs`,py:`1`,px:`1.5`}},md:{content:{minW:`8rem`,padding:`1.5`,scrollPadding:`1.5`},item:{gap:`2`,textStyle:`sm`,py:`1.5`,px:`2`}}}},defaultVariants:{size:`md`,variant:`subtle`}}),xC=W({className:`chakra-select`,slots:ES.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`,width:`full`},trigger:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,width:`full`,minH:`var(--select-trigger-height)`,"--input-height":`var(--select-trigger-height)`,px:`var(--select-trigger-padding-x)`,borderRadius:`l2`,userSelect:`none`,textAlign:`start`,focusVisibleRing:`inside`,_placeholderShown:{color:`fg.muted/80`},_disabled:{layerStyle:`disabled`},_invalid:{borderColor:`border.error`}},indicatorGroup:{display:`flex`,alignItems:`center`,gap:`1`,pos:`absolute`,insetEnd:`0`,top:`0`,bottom:`0`,px:`var(--select-trigger-padding-x)`,pointerEvents:`none`},indicator:{display:`flex`,alignItems:`center`,justifyContent:`center`,color:{base:`fg.muted`,_disabled:`fg.subtle`,_invalid:`fg.error`}},content:{background:`bg.panel`,display:`flex`,flexDirection:`column`,"--select-z-index":`zIndex.popover`,zIndex:`calc(var(--select-z-index) + var(--layer-index, 0))`,borderRadius:`l2`,outline:0,maxH:`96`,overflowY:`auto`,boxShadow:`md`,_open:{animationStyle:`slide-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`slide-fade-out`,animationDuration:`fastest`}},item:{position:`relative`,userSelect:`none`,display:`flex`,alignItems:`center`,gap:`2`,cursor:`option`,justifyContent:`space-between`,flex:`1`,textAlign:`start`,borderRadius:`l1`,_highlighted:{bg:`bg.emphasized/60`},_disabled:{pointerEvents:`none`,opacity:`0.5`},_icon:{width:`4`,height:`4`}},control:{pos:`relative`},itemText:{flex:`1`},itemGroup:{_first:{mt:`0`}},itemGroupLabel:{py:`1`,fontWeight:`medium`},label:{fontWeight:`medium`,userSelect:`none`,textStyle:`sm`,_disabled:{layerStyle:`disabled`}},valueText:{lineClamp:`1`,maxW:`80%`},clearTrigger:{color:`fg.muted`,pointerEvents:`auto`,focusVisibleRing:`inside`,focusRingWidth:`2px`,rounded:`l1`}},variants:{variant:{outline:{trigger:{bg:`transparent`,borderWidth:`1px`,borderColor:`border`,_expanded:{borderColor:`border.emphasized`}}},subtle:{trigger:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.muted`}},ghost:{trigger:{bg:`transparent`,_expanded:{bg:`bg.muted`}}}},size:{xs:{root:{"--select-trigger-height":`sizes.8`,"--select-trigger-padding-x":`spacing.2`},content:{p:`1`,gap:`1`,textStyle:`xs`},trigger:{textStyle:`xs`,gap:`1`},item:{py:`1`,px:`2`},itemGroupLabel:{py:`1`,px:`2`},indicator:{_icon:{width:`3.5`,height:`3.5`}}},sm:{root:{"--select-trigger-height":`sizes.9`,"--select-trigger-padding-x":`spacing.2.5`},content:{p:`1`,textStyle:`sm`},trigger:{textStyle:`sm`,gap:`1`},indicator:{_icon:{width:`4`,height:`4`}},item:{py:`1`,px:`1.5`},itemGroup:{mt:`1`},itemGroupLabel:{py:`1`,px:`1.5`}},md:{root:{"--select-trigger-height":`sizes.10`,"--select-trigger-padding-x":`spacing.3`},content:{p:`1`,textStyle:`sm`},itemGroup:{mt:`1.5`},item:{py:`1.5`,px:`2`},itemIndicator:{display:`flex`,alignItems:`center`,justifyContent:`center`},itemGroupLabel:{py:`1.5`,px:`2`},trigger:{textStyle:`sm`,gap:`2`},indicator:{_icon:{width:`4`,height:`4`}}},lg:{root:{"--select-trigger-height":`sizes.12`,"--select-trigger-padding-x":`spacing.4`},content:{p:`1.5`,textStyle:`md`},itemGroup:{mt:`2`},item:{py:`2`,px:`3`},itemGroupLabel:{py:`2`,px:`3`},trigger:{textStyle:`md`,py:`3`,gap:`2`},indicator:{_icon:{width:`5`,height:`5`}}}}},defaultVariants:{size:`md`,variant:`outline`}}),SC=W({className:`chakra-native-select`,slots:xS.keys(),base:{root:{height:`fit-content`,display:`flex`,width:`100%`,position:`relative`},field:{width:`100%`,minWidth:`0`,outline:`0`,appearance:`none`,borderRadius:`l2`,"--error-color":`colors.border.error`,"--input-height":`var(--select-field-height)`,height:`var(--select-field-height)`,_disabled:{layerStyle:`disabled`},_invalid:{focusRingColor:`var(--error-color)`,borderColor:`var(--error-color)`},focusVisibleRing:`inside`,lineHeight:`normal`,"& > option, & > optgroup":{bg:`bg`}},indicator:{position:`absolute`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,pointerEvents:`none`,top:`50%`,transform:`translateY(-50%)`,height:`100%`,color:`fg.muted`,_disabled:{opacity:`0.5`},_invalid:{color:`fg.error`},_icon:{width:`1em`,height:`1em`}}},variants:{variant:{outline:{field:xC.variants?.variant.outline.trigger},subtle:{field:xC.variants?.variant.subtle.trigger},plain:{field:{bg:`transparent`,color:`fg`,focusRingWidth:`2px`}},ghost:{field:xC.variants?.variant.ghost.trigger}},size:{xs:{root:{"--select-field-height":`sizes.8`},field:{textStyle:`xs`,ps:`2`,pe:`6`},indicator:{textStyle:`sm`,insetEnd:`1.5`}},sm:{root:{"--select-field-height":`sizes.9`},field:{textStyle:`sm`,ps:`2.5`,pe:`8`},indicator:{textStyle:`md`,insetEnd:`2`}},md:{root:{"--select-field-height":`sizes.10`},field:{textStyle:`sm`,ps:`3`,pe:`8`},indicator:{textStyle:`lg`,insetEnd:`2`}},lg:{root:{"--select-field-height":`sizes.11`},field:{textStyle:`md`,ps:`4`,pe:`8`},indicator:{textStyle:`xl`,insetEnd:`3`}},xl:{root:{"--select-field-height":`sizes.12`},field:{textStyle:`md`,ps:`4.5`,pe:`10`},indicator:{textStyle:`xl`,insetEnd:`3`}}}},defaultVariants:xC.defaultVariants}),CC=Zv({display:`flex`,justifyContent:`center`,alignItems:`center`,flex:`1`,userSelect:`none`,cursor:`button`,lineHeight:`1`,color:`fg.muted`,"--stepper-base-radius":`radii.l1`,"--stepper-radius":`calc(var(--stepper-base-radius) + 1px)`,_icon:{boxSize:`1em`},_disabled:{opacity:`0.5`},_hover:{bg:`bg.muted`},_active:{bg:`bg.emphasized`}}),wC=W({className:`chakra-number-input`,slots:gm.keys(),base:{root:{position:`relative`,zIndex:`0`,isolation:`isolate`},input:{...qx.base,verticalAlign:`top`,pe:`calc(var(--stepper-width) + 0.5rem)`},control:{display:`flex`,flexDirection:`column`,position:`absolute`,top:`0`,insetEnd:`0px`,margin:`1px`,width:`var(--stepper-width)`,height:`calc(100% - 2px)`,zIndex:`1`,borderStartWidth:`1px`,divideY:`1px`},incrementTrigger:{...CC,borderTopEndRadius:`var(--stepper-radius)`},decrementTrigger:{...CC,borderBottomEndRadius:`var(--stepper-radius)`},valueText:{fontWeight:`medium`,fontFeatureSettings:`pnum`,fontVariantNumeric:`proportional-nums`}},variants:{size:{xs:{input:qx.variants.size.xs,control:{fontSize:`2xs`,"--stepper-width":`sizes.4`}},sm:{input:qx.variants.size.sm,control:{fontSize:`xs`,"--stepper-width":`sizes.5`}},md:{input:qx.variants.size.md,control:{fontSize:`sm`,"--stepper-width":`sizes.6`}},lg:{input:qx.variants.size.lg,control:{fontSize:`sm`,"--stepper-width":`sizes.6`}}},variant:Oy(qx.variants.variant,(e,t)=>[e,{input:t}])},defaultVariants:{size:`md`,variant:`outline`}}),{variants:TC,defaultVariants:EC}=qx,DC=W({className:`chakra-pin-input`,slots:_m.keys(),base:{input:{...qx.base,textAlign:`center`,width:`var(--input-height)`},control:{display:`inline-flex`,gap:`2`,isolation:`isolate`}},variants:{size:Oy(TC.size,(e,t)=>[e,{input:{...t,px:`1`}}]),variant:Oy(TC.variant,(e,t)=>[e,{input:t}]),attached:{true:{control:{gap:`0`,spaceX:`-1px`},input:{_notFirst:{borderStartRadius:`0`},_notLast:{borderEndRadius:`0`},_focusVisible:{zIndex:`1`}}}}},defaultVariants:EC}),OC=W({className:`chakra-popover`,slots:SS.keys(),base:{content:{position:`relative`,display:`flex`,flexDirection:`column`,textStyle:`sm`,"--popover-bg":`colors.bg.panel`,bg:`var(--popover-bg)`,boxShadow:`lg`,"--popover-size":`sizes.xs`,"--popover-mobile-size":`calc(100dvw - 1rem)`,width:{base:`min(var(--popover-mobile-size), var(--popover-size))`,sm:`var(--popover-size)`},borderRadius:`l3`,"--popover-z-index":`zIndex.popover`,zIndex:`calc(var(--popover-z-index) + var(--layer-index, 0))`,outline:`0`,transformOrigin:`var(--transform-origin)`,maxHeight:`var(--available-height)`,_open:{animationStyle:`scale-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`scale-fade-out`,animationDuration:`faster`}},header:{paddingInline:`var(--popover-padding)`,paddingTop:`var(--popover-padding)`},body:{padding:`var(--popover-padding)`,flex:`1`},footer:{display:`flex`,alignItems:`center`,paddingInline:`var(--popover-padding)`,paddingBottom:`var(--popover-padding)`},arrow:{"--arrow-size":`sizes.3`,"--arrow-background":`var(--popover-bg)`},arrowTip:{borderTopWidth:`1px`,borderLeftWidth:`1px`}},variants:{size:{xs:{content:{"--popover-padding":`spacing.3`}},sm:{content:{"--popover-padding":`spacing.4`}},md:{content:{"--popover-padding":`spacing.5`}},lg:{content:{"--popover-padding":`spacing.6`}}}},defaultVariants:{size:`md`}}),kC=W({slots:ym.keys(),className:`chakra-progress`,base:{root:{textStyle:`sm`,position:`relative`},track:{overflow:`hidden`,position:`relative`},range:{display:`flex`,alignItems:`center`,justifyContent:`center`,transitionProperty:`width, height`,transitionDuration:`slow`,height:`100%`,bgColor:`var(--track-color)`,_indeterminate:{"--animate-from-x":`-40%`,"--animate-to-x":`100%`,position:`absolute`,willChange:`left`,minWidth:`50%`,animation:`position 1s ease infinite normal none running`,backgroundImage:`linear-gradient(to right, transparent 0%, var(--track-color) 50%, transparent 100%)`}},label:{display:`inline-flex`,fontWeight:`medium`,alignItems:`center`,gap:`1`},valueText:{textStyle:`xs`,lineHeight:`1`,fontWeight:`medium`}},variants:{variant:{outline:{track:{shadow:`inset`,bgColor:`bg.muted`},range:{bgColor:`colorPalette.solid`}},subtle:{track:{bgColor:`colorPalette.muted`},range:{bgColor:`colorPalette.solid/72`}}},shape:{square:{},rounded:{track:{borderRadius:`l1`}},full:{track:{borderRadius:`full`}}},striped:{true:{range:{backgroundImage:`linear-gradient(45deg, var(--stripe-color) 25%, transparent 25%, transparent 50%, var(--stripe-color) 50%, var(--stripe-color) 75%, transparent 75%, transparent)`,backgroundSize:`var(--stripe-size) var(--stripe-size)`,"--stripe-size":`1rem`,"--stripe-color":{_light:`rgba(255, 255, 255, 0.3)`,_dark:`rgba(0, 0, 0, 0.3)`}}}},animated:{true:{range:{"--animate-from":`var(--stripe-size)`,animation:`bg-position 1s linear infinite`}}},size:{xs:{track:{h:`1.5`}},sm:{track:{h:`2`}},md:{track:{h:`2.5`}},lg:{track:{h:`3`}},xl:{track:{h:`4`}}}},defaultVariants:{variant:`outline`,size:`md`,shape:`rounded`}}),AC=W({className:`chakra-progress-circle`,slots:ym.keys(),base:{root:{display:`inline-flex`,textStyle:`sm`,position:`relative`},circle:{_indeterminate:{animation:`spin 2s linear infinite`}},circleTrack:{"--track-color":`colors.colorPalette.muted`,stroke:`var(--track-color)`},circleRange:{stroke:`colorPalette.solid`,transitionProperty:`stroke-dashoffset, stroke-dasharray`,transitionDuration:`0.6s`,_indeterminate:{animation:`circular-progress 1.5s linear infinite`}},label:{display:`inline-flex`},valueText:{lineHeight:`1`,fontWeight:`medium`,letterSpacing:`tight`,fontVariantNumeric:`tabular-nums`}},variants:{size:{xs:{circle:{"--size":`24px`,"--thickness":`4px`},valueText:{textStyle:`2xs`}},sm:{circle:{"--size":`32px`,"--thickness":`5px`},valueText:{textStyle:`2xs`}},md:{circle:{"--size":`40px`,"--thickness":`6px`},valueText:{textStyle:`xs`}},lg:{circle:{"--size":`48px`,"--thickness":`7px`},valueText:{textStyle:`sm`}},xl:{circle:{"--size":`64px`,"--thickness":`8px`},valueText:{textStyle:`sm`}}}},defaultVariants:{size:`md`}}),jC=W({slots:bm.keys(),className:`chakra-qr-code`,base:{root:{position:`relative`,width:`fit-content`,"--qr-code-overlay-size":`calc(var(--qr-code-size) / 3)`},frame:{width:`var(--qr-code-size)`,height:`var(--qr-code-size)`,fill:`currentColor`},overlay:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:`var(--qr-code-overlay-size)`,height:`var(--qr-code-overlay-size)`,padding:`1`,bg:`bg`,rounded:`l1`}},variants:{size:{"2xs":{root:{"--qr-code-size":`40px`}},xs:{root:{"--qr-code-size":`64px`}},sm:{root:{"--qr-code-size":`80px`}},md:{root:{"--qr-code-size":`120px`}},lg:{root:{"--qr-code-size":`160px`}},xl:{root:{"--qr-code-size":`200px`}},"2xl":{root:{"--qr-code-size":`240px`}},full:{root:{"--qr-code-size":`100%`}}}},defaultVariants:{size:`md`}}),MC=W({className:`chakra-radio-card`,slots:wS.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`,isolation:`isolate`},item:{flex:`1`,display:`flex`,flexDirection:`column`,userSelect:`none`,position:`relative`,borderRadius:`l2`,_focus:{bg:`colorPalette.muted/20`},_disabled:{opacity:`0.5`},_checked:{zIndex:`1`}},label:{display:`inline-flex`,fontWeight:`medium`,textStyle:`sm`,_disabled:{opacity:`0.5`}},itemText:{fontWeight:`medium`,flex:`1`},itemDescription:{opacity:`0.64`,textStyle:`sm`},itemControl:{display:`inline-flex`,flex:`1`,pos:`relative`,rounded:`inherit`,justifyContent:`var(--radio-card-justify)`,alignItems:`var(--radio-card-align)`,_disabled:{bg:`bg.muted`}},itemIndicator:Qx.base,itemAddon:{roundedBottom:`inherit`,_disabled:{color:`fg.muted`}},itemContent:{display:`flex`,flexDirection:`column`,flex:`1`,gap:`1`,justifyContent:`var(--radio-card-justify)`,alignItems:`var(--radio-card-align)`}},variants:{size:{sm:{item:{textStyle:`sm`},itemControl:{padding:`3`,gap:`1.5`},itemAddon:{px:`3`,py:`1.5`,borderTopWidth:`1px`},itemIndicator:Qx.variants?.size.sm},md:{item:{textStyle:`sm`},itemControl:{padding:`4`,gap:`2.5`},itemAddon:{px:`4`,py:`2`,borderTopWidth:`1px`},itemIndicator:Qx.variants?.size.md},lg:{item:{textStyle:`md`},itemControl:{padding:`4`,gap:`3.5`},itemAddon:{px:`4`,py:`2`,borderTopWidth:`1px`},itemIndicator:Qx.variants?.size.lg}},variant:{surface:{item:{borderWidth:`1px`,_checked:{bg:`colorPalette.subtle`,color:`colorPalette.fg`,borderColor:`colorPalette.muted`}},itemIndicator:Qx.variants?.variant.solid},subtle:{item:{bg:`bg.muted`},itemControl:{_checked:{bg:`colorPalette.muted`,color:`colorPalette.fg`}},itemIndicator:Qx.variants?.variant.outline},outline:{item:{borderWidth:`1px`,_checked:{boxShadow:`inset 0 0 0 1px var(--shadow-color)`,boxShadowColor:`colorPalette.solid`,borderColor:`colorPalette.solid`}},itemControl:{_disabled:{bg:`unset`}},itemIndicator:Qx.variants?.variant.solid},solid:{item:{borderWidth:`1px`,_checked:{bg:`colorPalette.solid`,color:`colorPalette.contrast`,borderColor:`colorPalette.solid`}},itemControl:{_disabled:{bg:`unset`}},itemIndicator:Qx.variants?.variant.inverted}},justify:{start:{item:{"--radio-card-justify":`flex-start`}},end:{item:{"--radio-card-justify":`flex-end`}},center:{item:{"--radio-card-justify":`center`}}},align:{start:{item:{"--radio-card-align":`flex-start`},itemControl:{textAlign:`start`}},end:{item:{"--radio-card-align":`flex-end`},itemControl:{textAlign:`end`}},center:{item:{"--radio-card-align":`center`},itemControl:{textAlign:`center`}}},orientation:{vertical:{itemControl:{flexDirection:`column`}},horizontal:{itemControl:{flexDirection:`row`}}}},defaultVariants:{size:`md`,variant:`outline`,align:`start`,orientation:`horizontal`}}),NC=W({className:`chakra-radio-group`,slots:CS.keys(),base:{item:{display:`inline-flex`,alignItems:`center`,position:`relative`,fontWeight:`medium`,_disabled:{cursor:`disabled`}},itemControl:Qx.base,label:{userSelect:`none`,textStyle:`sm`,_disabled:{opacity:`0.5`}}},variants:{variant:{outline:{itemControl:Qx.variants?.variant?.outline},subtle:{itemControl:Qx.variants?.variant?.subtle},solid:{itemControl:Qx.variants?.variant?.solid}},size:{xs:{item:{textStyle:`xs`,gap:`1.5`},itemControl:Qx.variants?.size?.xs},sm:{item:{textStyle:`sm`,gap:`2`},itemControl:Qx.variants?.size?.sm},md:{item:{textStyle:`sm`,gap:`2.5`},itemControl:Qx.variants?.size?.md},lg:{item:{textStyle:`md`,gap:`3`},itemControl:Qx.variants?.size?.lg}}},defaultVariants:{size:`md`,variant:`solid`}}),PC=W({className:`chakra-rating-group`,slots:TS.keys(),base:{root:{display:`inline-flex`},control:{display:`inline-flex`,alignItems:`center`},item:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,userSelect:`none`},itemIndicator:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:`1em`,height:`1em`,position:`relative`,"--clip-path":{base:`inset(0 50% 0 0)`,_rtl:`inset(0 0 0 50%)`},_icon:{stroke:`currentColor`,width:`100%`,height:`100%`,display:`inline-block`,flexShrink:0,position:`absolute`,left:0,top:0},"& [data-bg]":{color:`bg.emphasized`},"& [data-fg]":{color:`transparent`},"&[data-highlighted]:not([data-half])":{"& [data-fg]":{color:`colorPalette.solid`}},"&[data-half]":{"& [data-fg]":{color:`colorPalette.solid`,clipPath:`var(--clip-path)`}}}},variants:{size:{xs:{item:{textStyle:`sm`}},sm:{item:{textStyle:`md`}},md:{item:{textStyle:`xl`}},lg:{item:{textStyle:`2xl`}}}},defaultVariants:{size:`md`}}),FC=W({className:`chakra-scroll-area`,slots:Cm.keys(),base:{root:{display:`flex`,flexDirection:`column`,width:`100%`,height:`100%`,position:`relative`,overflow:`hidden`,"--scrollbar-margin":`2px`,"--scrollbar-click-area":`calc(var(--scrollbar-size) + calc(var(--scrollbar-margin) * 2))`},viewport:{display:`flex`,flexDirection:`column`,height:`100%`,width:`100%`,borderRadius:`inherit`,WebkitOverflowScrolling:`touch`,scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}},content:{minWidth:`100%`},scrollbar:{display:`flex`,userSelect:`none`,touchAction:`none`,borderRadius:`full`,colorPalette:`gray`,transition:`opacity 150ms 300ms`,position:`relative`,margin:`var(--scrollbar-margin)`,"&:not([data-overflow-x], [data-overflow-y])":{display:`none`},bg:`{colors.colorPalette.solid/10}`,"--thumb-bg":`{colors.colorPalette.solid/25}`,"&:is(:hover, :active)":{"--thumb-bg":`{colors.colorPalette.solid/50}`},_before:{content:`""`,position:`absolute`},_vertical:{width:`var(--scrollbar-size)`,flexDirection:`column`,"&::before":{width:`var(--scrollbar-click-area)`,height:`100%`,insetInlineStart:`calc(var(--scrollbar-margin) * -1)`}},_horizontal:{height:`var(--scrollbar-size)`,flexDirection:`row`,"&::before":{height:`var(--scrollbar-click-area)`,width:`100%`,top:`calc(var(--scrollbar-margin) * -1)`}}},thumb:{borderRadius:`inherit`,bg:`var(--thumb-bg)`,transition:`backgrounds`,_vertical:{width:`full`},_horizontal:{height:`full`}},corner:{bg:`bg.muted`,margin:`var(--scrollbar-margin)`,opacity:0,transition:`opacity 150ms 300ms`,"&[data-hover]":{transitionDelay:`0ms`,opacity:1}}},variants:{variant:{hover:{scrollbar:{opacity:`0`,"&[data-hover], &[data-scrolling]":{opacity:`1`,transitionDuration:`faster`,transitionDelay:`0ms`}}},always:{scrollbar:{opacity:`1`}}},size:{xs:{root:{"--scrollbar-size":`sizes.1`}},sm:{root:{"--scrollbar-size":`sizes.1.5`}},md:{root:{"--scrollbar-size":`sizes.2`}},lg:{root:{"--scrollbar-size":`sizes.3`}}}},defaultVariants:{size:`md`,variant:`hover`}}),IC=W({className:`chakra-segment-group`,slots:wm.keys(),base:{root:{"--segment-radius":`radii.l2`,"--segment-indicator-bg":{_light:`colors.bg`,_dark:`colors.bg.emphasized`},"--segment-indicator-shadow":`shadows.sm`,borderRadius:`var(--segment-radius)`,display:`inline-flex`,boxShadow:`inset`,minW:`max-content`,textAlign:`center`,position:`relative`,isolation:`isolate`,bg:`bg.muted`,_vertical:{flexDirection:`column`}},item:{display:`flex`,alignItems:`center`,justifyContent:`center`,userSelect:`none`,fontSize:`sm`,position:`relative`,color:`fg`,borderRadius:`var(--segment-radius)`,_disabled:{opacity:`0.5`},"&:has(input:focus-visible)":{focusRing:`outside`},_before:{content:`""`,position:`absolute`,bg:`border`,transition:`opacity 0.2s`},_horizontal:{_before:{insetInlineStart:0,insetBlock:`1.5`,width:`1px`}},_vertical:{_before:{insetBlockStart:0,insetInline:`1.5`,height:`1px`}},"& + &[data-state=checked], &[data-state=checked] + &, &:first-of-type":{_before:{opacity:`0`}},"&[data-state=checked][data-ssr]":{shadow:`sm`,bg:`bg`,borderRadius:`var(--segment-radius)`}},indicator:{shadow:`var(--segment-indicator-shadow)`,pos:`absolute`,bg:`var(--segment-indicator-bg)`,width:`var(--width)`,height:`var(--height)`,top:`var(--top)`,left:`var(--left)`,zIndex:-1,borderRadius:`var(--segment-radius)`}},variants:{size:{xs:{item:{textStyle:`xs`,px:`3`,gap:`1`,height:`6`}},sm:{item:{textStyle:`sm`,px:`4`,gap:`2`,height:`8`}},md:{item:{textStyle:`sm`,px:`4`,gap:`2`,height:`10`}},lg:{item:{textStyle:`md`,px:`4.5`,gap:`3`,height:`11`}}}},defaultVariants:{size:`md`}}),LC=W({className:`chakra-slider`,slots:OS.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1`,textStyle:`sm`,position:`relative`,isolation:`isolate`,touchAction:`none`},label:{fontWeight:`medium`,textStyle:`sm`},control:{display:`inline-flex`,alignItems:`center`,position:`relative`},track:{overflow:`hidden`,borderRadius:`full`,flex:`1`},range:{width:`inherit`,height:`inherit`,_disabled:{bg:`border.emphasized!`}},markerGroup:{position:`absolute!`,zIndex:`1`},marker:{"--marker-bg":{base:`white`,_underValue:`colors.bg`},display:`flex`,alignItems:`center`,gap:`calc(var(--slider-thumb-size) / 2)`,color:`fg.muted`,textStyle:`xs`},markerIndicator:{width:`var(--slider-marker-size)`,height:`var(--slider-marker-size)`,borderRadius:`full`,bg:`var(--marker-bg)`},thumb:{width:`var(--slider-thumb-size)`,height:`var(--slider-thumb-size)`,display:`flex`,alignItems:`center`,justifyContent:`center`,outline:0,zIndex:`2`,borderRadius:`full`,transition:`shadow`,_focusVisible:{ring:`3px`,ringColor:`colorPalette.focusRing/50`}}},variants:{size:{sm:{root:{"--slider-thumb-size":`sizes.4`,"--slider-track-size":`sizes.1.5`,"--slider-marker-center":`6px`,"--slider-marker-size":`sizes.1`,"--slider-marker-inset":`3px`}},md:{root:{"--slider-thumb-size":`sizes.5`,"--slider-track-size":`sizes.2`,"--slider-marker-center":`8px`,"--slider-marker-size":`sizes.1`,"--slider-marker-inset":`4px`}},lg:{root:{"--slider-thumb-size":`sizes.6`,"--slider-track-size":`sizes.2.5`,"--slider-marker-center":`9px`,"--slider-marker-size":`sizes.1.5`,"--slider-marker-inset":`5px`}}},variant:{outline:{track:{shadow:`inset`,bg:`bg.emphasized/72`},range:{bg:`colorPalette.solid`},thumb:{borderWidth:`2px`,borderColor:`colorPalette.solid`,bg:`bg`,_disabled:{bg:`border.emphasized`,borderColor:`border.emphasized`}}},solid:{track:{bg:`colorPalette.subtle`,_disabled:{bg:`bg.muted`}},range:{bg:`colorPalette.solid`},thumb:{bg:`colorPalette.solid`,_disabled:{bg:`border.emphasized`}}}},orientation:{vertical:{root:{display:`inline-flex`},control:{flexDirection:`column`,height:`100%`,minWidth:`var(--slider-thumb-size)`,"&:has(.chakra-slider__markerLabel)":{marginEnd:`4`}},track:{width:`var(--slider-track-size)`},thumb:{left:`50%`,translate:`-50% 0`},markerGroup:{insetStart:`var(--slider-marker-center)`,insetBlock:`var(--slider-marker-inset)`},marker:{flexDirection:`row`}},horizontal:{control:{flexDirection:`row`,width:`100%`,minHeight:`var(--slider-thumb-size)`,"&:has(.chakra-slider__markerLabel)":{marginBottom:`4`}},track:{height:`var(--slider-track-size)`},thumb:{top:`50%`,translate:`0 -50%`},markerGroup:{top:`var(--slider-marker-center)`,insetInline:`var(--slider-marker-inset)`},marker:{flexDirection:`column`}}}},defaultVariants:{size:`md`,variant:`outline`,orientation:`horizontal`}}),RC=W({slots:BS.keys(),className:`splitter`,base:{resizeTrigger:{"--splitter-border-color":`colors.border`,"--splitter-thumb-color":`colors.bg`,"--splitter-thumb-size":`sizes.2`,"--splitter-thumb-inset":`calc(var(--splitter-thumb-size) * -0.5)`,"--splitter-border-size":`1px`,"--splitter-handle-size":`sizes.6`,outline:`0`,display:`grid`,placeItems:`center`,position:`relative`,_focus:{"--splitter-border-color":`colors.border.emphasized`,"--splitter-thumb-color":`colors.colorPalette.subtle`},_dragging:{"--splitter-thumb-color":`colors.colorPalette.focusRing`},_horizontal:{minWidth:`var(--splitter-thumb-size)`,marginInline:`var(--splitter-thumb-inset)`},_vertical:{minHeight:`var(--splitter-thumb-size)`,marginBlock:`var(--splitter-thumb-inset)`}},resizeTriggerSeparator:{position:`absolute`,bg:`var(--splitter-border-color)`,"[data-part='resize-trigger'][data-orientation=horizontal] &":{insetInlineEnd:`calc(var(--splitter-thumb-size) * 0.5)`,insetBlock:`0`,insetInlineStart:`auto`,w:`var(--splitter-border-size)`},"[data-part='resize-trigger'][data-orientation=vertical] &":{insetBlockEnd:`calc(var(--splitter-thumb-size) * 0.5)`,insetInline:`0`,insetBlockStart:`auto`,h:`var(--splitter-border-size)`}},resizeTriggerIndicator:{position:`relative`,rounded:`full`,bg:`var(--splitter-thumb-color)`,shadow:`xs`,borderWidth:`1px`,zIndex:`1`,"[data-part='resize-trigger'][data-orientation=horizontal] &":{w:`full`,h:`var(--splitter-handle-size)`},"[data-part='resize-trigger'][data-orientation=vertical] &":{w:`var(--splitter-handle-size)`,h:`full`},"[data-part='resize-trigger'][data-focus]:focus-visible &":{outlineWidth:`2px`,outlineColor:`colorPalette.focusRing`,outlineStyle:`solid`},"[data-part='resize-trigger'][data-disabled] &":{visibility:`hidden`}}}}),zC=W({className:`chakra-stat`,slots:kS.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1`,position:`relative`,flex:`1`},label:{display:`inline-flex`,gap:`1.5`,alignItems:`center`,color:`fg.muted`,textStyle:`sm`},helpText:{color:`fg.muted`,textStyle:`xs`},valueUnit:{color:`fg.muted`,textStyle:`xs`,fontWeight:`initial`,letterSpacing:`initial`},valueText:{verticalAlign:`baseline`,fontWeight:`semibold`,letterSpacing:`tight`,fontFeatureSettings:`pnum`,fontVariantNumeric:`proportional-nums`,display:`inline-flex`,gap:`1`},indicator:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,marginEnd:1,"& :where(svg)":{w:`1em`,h:`1em`},"&[data-type=up]":{color:`fg.success`},"&[data-type=down]":{color:`fg.error`}}},variants:{size:{sm:{valueText:{textStyle:`xl`}},md:{valueText:{textStyle:`2xl`}},lg:{valueText:{textStyle:`3xl`}}}},defaultVariants:{size:`md`}}),BC=W({className:`chakra-status`,slots:AS.keys(),base:{root:{display:`inline-flex`,alignItems:`center`,gap:`2`},indicator:{width:`0.64em`,height:`0.64em`,flexShrink:0,borderRadius:`full`,forcedColorAdjust:`none`,bg:`colorPalette.solid`}},variants:{size:{sm:{root:{textStyle:`xs`}},md:{root:{textStyle:`sm`}},lg:{root:{textStyle:`md`}}}},defaultVariants:{size:`md`}}),VC=W({className:`chakra-steps`,slots:jS.keys(),base:{root:{display:`flex`,width:`full`},list:{display:`flex`,justifyContent:`space-between`,"--steps-gutter":`spacing.3`,"--steps-thickness":`2px`},title:{fontWeight:`medium`,color:`fg`},description:{color:`fg.muted`},separator:{bg:`border`,flex:`1`},indicator:{display:`flex`,justifyContent:`center`,alignItems:`center`,flexShrink:`0`,borderRadius:`full`,fontWeight:`medium`,width:`var(--steps-size)`,height:`var(--steps-size)`,_icon:{flexShrink:`0`,width:`var(--steps-icon-size)`,height:`var(--steps-icon-size)`}},item:{position:`relative`,display:`flex`,gap:`3`,flex:`1 0 0`,"&:last-of-type":{flex:`initial`,"& [data-part=separator]":{display:`none`}}},trigger:{display:`flex`,alignItems:`center`,gap:`3`,textAlign:`start`,focusVisibleRing:`outside`,borderRadius:`l2`},content:{focusVisibleRing:`outside`}},variants:{orientation:{vertical:{root:{flexDirection:`row`,height:`100%`},list:{flexDirection:`column`,alignItems:`flex-start`},separator:{position:`absolute`,width:`var(--steps-thickness)`,height:`100%`,maxHeight:`calc(100% - var(--steps-size) - var(--steps-gutter) * 2)`,top:`calc(var(--steps-size) + var(--steps-gutter))`,insetStart:`calc(var(--steps-size) / 2 - 1px)`},item:{alignItems:`flex-start`}},horizontal:{root:{flexDirection:`column`,width:`100%`},list:{flexDirection:`row`,alignItems:`center`},separator:{width:`100%`,height:`var(--steps-thickness)`,marginX:`var(--steps-gutter)`},item:{alignItems:`center`}}},variant:{solid:{indicator:{_incomplete:{borderWidth:`var(--steps-thickness)`},_current:{bg:`colorPalette.muted`,borderWidth:`var(--steps-thickness)`,borderColor:`colorPalette.solid`,color:`colorPalette.fg`},_complete:{bg:`colorPalette.solid`,borderColor:`colorPalette.solid`,color:`colorPalette.contrast`}},separator:{_complete:{bg:`colorPalette.solid`}}},subtle:{indicator:{_incomplete:{bg:`bg.muted`},_current:{bg:`colorPalette.muted`,color:`colorPalette.fg`},_complete:{bg:`colorPalette.emphasized`,color:`colorPalette.fg`}},separator:{_complete:{bg:`colorPalette.emphasized`}}}},size:{xs:{root:{gap:`2.5`},list:{"--steps-size":`sizes.6`,"--steps-icon-size":`sizes.3.5`,textStyle:`xs`},title:{textStyle:`sm`}},sm:{root:{gap:`3`},list:{"--steps-size":`sizes.8`,"--steps-icon-size":`sizes.4`,textStyle:`xs`},title:{textStyle:`sm`}},md:{root:{gap:`4`},list:{"--steps-size":`sizes.10`,"--steps-icon-size":`sizes.4`,textStyle:`sm`},title:{textStyle:`sm`}},lg:{root:{gap:`6`},list:{"--steps-size":`sizes.11`,"--steps-icon-size":`sizes.5`,textStyle:`md`},title:{textStyle:`md`}}}},defaultVariants:{size:`md`,variant:`solid`,orientation:`horizontal`}}),HC=W({slots:MS.keys(),className:`chakra-switch`,base:{root:{display:`inline-flex`,gap:`2.5`,alignItems:`center`,position:`relative`,verticalAlign:`middle`,"--switch-diff":`calc(var(--switch-width) - var(--switch-height))`,"--switch-x":{base:`var(--switch-diff)`,_rtl:`calc(var(--switch-diff) * -1)`}},label:{lineHeight:`1`,userSelect:`none`,fontSize:`sm`,fontWeight:`medium`,_disabled:{opacity:`0.5`}},indicator:{position:`absolute`,height:`var(--switch-height)`,width:`var(--switch-height)`,fontSize:`var(--switch-indicator-font-size)`,fontWeight:`medium`,flexShrink:0,userSelect:`none`,display:`grid`,placeContent:`center`,transition:`inset-inline-start 0.12s ease`,insetInlineStart:`calc(var(--switch-x) - 2px)`,_checked:{insetInlineStart:`2px`}},control:{display:`inline-flex`,gap:`0.5rem`,flexShrink:0,justifyContent:`flex-start`,cursor:`switch`,borderRadius:`full`,position:`relative`,width:`var(--switch-width)`,height:`var(--switch-height)`,transition:`backgrounds`,_disabled:{opacity:`0.5`,cursor:`not-allowed`},_invalid:{outline:`2px solid`,outlineColor:`border.error`,outlineOffset:`2px`}},thumb:{display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,transitionProperty:`translate`,transitionDuration:`fast`,borderRadius:`inherit`,_checked:{translate:`var(--switch-x) 0`}}},variants:{variant:{solid:{control:{borderRadius:`full`,bg:`bg.emphasized`,focusVisibleRing:`outside`,_checked:{bg:`colorPalette.solid`}},thumb:{bg:`white`,width:`var(--switch-height)`,height:`var(--switch-height)`,scale:`0.8`,boxShadow:`sm`,_checked:{bg:`colorPalette.contrast`}}},raised:{control:{borderRadius:`full`,height:`calc(var(--switch-height) / 2)`,bg:`bg.muted`,boxShadow:`inset`,_checked:{bg:`colorPalette.solid/60`}},thumb:{width:`var(--switch-height)`,height:`var(--switch-height)`,position:`relative`,top:`calc(var(--switch-height) * -0.25)`,bg:`white`,boxShadow:`xs`,focusVisibleRing:`outside`,_checked:{bg:`colorPalette.solid`}}}},size:{xs:{root:{"--switch-width":`sizes.6`,"--switch-height":`sizes.3`,"--switch-indicator-font-size":`fontSizes.xs`}},sm:{root:{"--switch-width":`sizes.8`,"--switch-height":`sizes.4`,"--switch-indicator-font-size":`fontSizes.xs`}},md:{root:{"--switch-width":`sizes.10`,"--switch-height":`sizes.5`,"--switch-indicator-font-size":`fontSizes.sm`}},lg:{root:{"--switch-width":`sizes.12`,"--switch-height":`sizes.6`,"--switch-indicator-font-size":`fontSizes.md`}}}},defaultVariants:{variant:`solid`,size:`md`}}),UC=W({className:`chakra-table`,slots:NS.keys(),base:{root:{fontVariantNumeric:`lining-nums tabular-nums`,borderCollapse:`collapse`,width:`full`,textAlign:`start`,verticalAlign:`top`},row:{_selected:{bg:`colorPalette.subtle`}},cell:{textAlign:`start`,alignItems:`center`},columnHeader:{fontWeight:`medium`,textAlign:`start`,color:`fg`},caption:{fontWeight:`medium`,textStyle:`xs`},footer:{fontWeight:`medium`}},variants:{interactive:{true:{body:{"& tr":{_hover:{bg:`colorPalette.subtle`}}}}},stickyHeader:{true:{header:{"& :where(tr)":{top:`var(--table-sticky-offset, 0)`,position:`sticky`,zIndex:1}}}},striped:{true:{row:{"&:nth-of-type(odd) td":{bg:`bg.muted`}}}},showColumnBorder:{true:{columnHeader:{"&:not(:last-of-type)":{borderInlineEndWidth:`1px`}},cell:{"&:not(:last-of-type)":{borderInlineEndWidth:`1px`}}}},variant:{line:{columnHeader:{borderBottomWidth:`1px`},cell:{borderBottomWidth:`1px`},row:{bg:`bg`}},outline:{root:{boxShadow:`0 0 0 1px {colors.border}`},columnHeader:{borderBottomWidth:`1px`},header:{bg:`bg.muted`},row:{"&:not(:last-of-type)":{borderBottomWidth:`1px`}},footer:{borderTopWidth:`1px`}}},size:{sm:{root:{textStyle:`sm`},columnHeader:{px:`2`,py:`2`},cell:{px:`2`,py:`2`}},md:{root:{textStyle:`sm`},columnHeader:{px:`3`,py:`3`},cell:{px:`3`,py:`3`}},lg:{root:{textStyle:`md`},columnHeader:{px:`4`,py:`3`},cell:{px:`4`,py:`3`}}}},defaultVariants:{variant:`line`,size:`md`}}),WC=W({slots:FS.keys(),className:`chakra-tabs`,base:{root:{"--tabs-trigger-radius":`radii.l2`,"--tabs-indicator-shadow":`shadows.xs`,"--tabs-indicator-bg":`colors.bg`,position:`relative`,_horizontal:{display:`block`},_vertical:{display:`flex`}},list:{display:`inline-flex`,position:`relative`,isolation:`isolate`,minH:`var(--tabs-height)`,_horizontal:{flexDirection:`row`},_vertical:{flexDirection:`column`}},trigger:{outline:`0`,minW:`var(--tabs-height)`,height:`var(--tabs-height)`,display:`flex`,alignItems:`center`,fontWeight:`medium`,position:`relative`,cursor:`button`,gap:`2`,_focusVisible:{zIndex:1,outline:`2px solid`,outlineColor:`colorPalette.focusRing`},_disabled:{cursor:`not-allowed`,opacity:.5}},content:{focusVisibleRing:`inside`,_horizontal:{width:`100%`,pt:`var(--tabs-content-padding)`},_vertical:{height:`100%`,ps:`var(--tabs-content-padding)`}},indicator:{width:`var(--width)`,height:`var(--height)`,borderRadius:`var(--tabs-trigger-radius)`,bg:`var(--tabs-indicator-bg)`,shadow:`var(--tabs-indicator-shadow)`,zIndex:-1}},variants:{fitted:{true:{list:{display:`flex`},trigger:{flex:1,textAlign:`center`,justifyContent:`center`}}},justify:{start:{list:{justifyContent:`flex-start`}},center:{list:{justifyContent:`center`}},end:{list:{justifyContent:`flex-end`}}},size:{sm:{root:{"--tabs-height":`sizes.9`,"--tabs-content-padding":`spacing.3`},trigger:{py:`1`,px:`3`,textStyle:`sm`}},md:{root:{"--tabs-height":`sizes.10`,"--tabs-content-padding":`spacing.4`},trigger:{py:`2`,px:`4`,textStyle:`sm`}},lg:{root:{"--tabs-height":`sizes.11`,"--tabs-content-padding":`spacing.4.5`},trigger:{py:`2`,px:`4.5`,textStyle:`md`}}},variant:{line:{list:{display:`flex`,borderColor:`border`,_horizontal:{borderBottomWidth:`1px`},_vertical:{borderEndWidth:`1px`}},trigger:{color:`fg.muted`,_disabled:{_active:{bg:`initial`}},_selected:{color:`fg`,_horizontal:{layerStyle:`indicator.bottom`,"--indicator-offset-y":`-1px`,"--indicator-color":`colors.colorPalette.solid`},_vertical:{layerStyle:`indicator.end`,"--indicator-offset-x":`-1px`}}}},subtle:{trigger:{borderRadius:`var(--tabs-trigger-radius)`,color:`fg.muted`,_selected:{bg:`colorPalette.subtle`,color:`colorPalette.fg`}}},enclosed:{list:{bg:`bg.muted`,padding:`1`,borderRadius:`l3`,minH:`calc(var(--tabs-height) - 4px)`},trigger:{justifyContent:`center`,color:`fg.muted`,borderRadius:`var(--tabs-trigger-radius)`,_selected:{bg:`bg`,color:`colorPalette.fg`,shadow:`xs`}}},outline:{list:{"--line-thickness":`1px`,"--line-offset":`calc(var(--line-thickness) * -1)`,borderColor:`border`,display:`flex`,_horizontal:{_before:{content:`""`,position:`absolute`,bottom:`0px`,width:`100%`,borderBottomWidth:`var(--line-thickness)`,borderBottomColor:`border`}},_vertical:{_before:{content:`""`,position:`absolute`,insetInline:`var(--line-offset)`,height:`calc(100% - calc(var(--line-thickness) * 2))`,borderEndWidth:`var(--line-thickness)`,borderEndColor:`border`}}},trigger:{color:`fg.muted`,borderWidth:`1px`,borderColor:`transparent`,_selected:{bg:`currentBg`,color:`colorPalette.fg`},_horizontal:{borderTopRadius:`var(--tabs-trigger-radius)`,marginBottom:`var(--line-offset)`,marginEnd:{_notLast:`var(--line-offset)`},_selected:{borderColor:`border`,borderBottomColor:`transparent`}},_vertical:{borderStartRadius:`var(--tabs-trigger-radius)`,marginEnd:`var(--line-offset)`,marginBottom:{_notLast:`var(--line-offset)`},_selected:{borderColor:`border`,borderEndColor:`transparent`}}}},plain:{trigger:{color:`fg.muted`,_selected:{color:`colorPalette.fg`},borderRadius:`var(--tabs-trigger-radius)`,"&[data-selected][data-ssr]":{bg:`var(--tabs-indicator-bg)`,shadow:`var(--tabs-indicator-shadow)`,borderRadius:`var(--tabs-trigger-radius)`}}}}},defaultVariants:{size:`md`,variant:`line`}}),GC=Lx.variants?.variant,KC=W({slots:IS.keys(),className:`chakra-tag`,base:{root:{display:`inline-flex`,alignItems:`center`,verticalAlign:`top`,maxWidth:`100%`,userSelect:`none`,borderRadius:`l2`,focusVisibleRing:`outside`},label:{lineClamp:`1`},closeTrigger:{display:`flex`,alignItems:`center`,justifyContent:`center`,outline:`0`,borderRadius:`l1`,color:`currentColor`,focusVisibleRing:`inside`,focusRingWidth:`2px`},startElement:{flexShrink:0,boxSize:`var(--tag-element-size)`,ms:`var(--tag-element-offset)`,"&:has([data-scope=avatar])":{boxSize:`var(--tag-avatar-size)`,ms:`calc(var(--tag-element-offset) * 1.5)`},_icon:{boxSize:`100%`}},endElement:{flexShrink:0,boxSize:`var(--tag-element-size)`,me:`var(--tag-element-offset)`,_icon:{boxSize:`100%`},"&:has(button)":{ms:`calc(var(--tag-element-offset) * -1)`}}},variants:{size:{sm:{root:{px:`1.5`,minH:`4.5`,gap:`1`,"--tag-avatar-size":`spacing.3`,"--tag-element-size":`spacing.3`,"--tag-element-offset":`-2px`},label:{textStyle:`xs`}},md:{root:{px:`1.5`,minH:`5`,gap:`1`,"--tag-avatar-size":`spacing.3.5`,"--tag-element-size":`spacing.3.5`,"--tag-element-offset":`-2px`},label:{textStyle:`xs`}},lg:{root:{px:`2`,minH:`6`,gap:`1.5`,"--tag-avatar-size":`spacing.4.5`,"--tag-element-size":`spacing.4`,"--tag-element-offset":`-3px`},label:{textStyle:`sm`}},xl:{root:{px:`2.5`,minH:`8`,gap:`1.5`,"--tag-avatar-size":`spacing.6`,"--tag-element-size":`spacing.4.5`,"--tag-element-offset":`-4px`},label:{textStyle:`sm`}}},variant:{subtle:{root:GC?.subtle},solid:{root:GC?.solid},outline:{root:GC?.outline},surface:{root:GC?.surface}}},defaultVariants:{size:`md`,variant:`surface`}}),qC=W({slots:vg.keys(),className:`tags-input`,base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`,width:`full`},label:{fontWeight:`medium`,textStyle:`sm`,_disabled:{opacity:`0.5`}},control:{"--focus-color":`colors.colorPalette.focusRing`,"--error-color":`colors.border.error`,minH:`var(--tags-input-height)`,"--input-height":`var(--tags-input-height)`,px:`var(--tags-input-px)`,py:`var(--tags-input-py)`,gap:`var(--tags-input-gap)`,display:`flex`,flexWrap:`wrap`,alignItems:`center`,borderRadius:`l2`,pos:`relative`,transitionProperty:`border-color, box-shadow`,transitionDuration:`normal`,_disabled:{opacity:`0.5`},_invalid:{borderColor:`var(--error-color)`}},input:{flex:`1`,minWidth:`20`,outline:`none`,bg:`transparent`,color:`fg`,px:`calc(var(--tags-input-item-px) / 1.25)`,height:`var(--tags-input-item-height)`,_readOnly:{display:`none`}},item:{maxWidth:`100%`,minWidth:`0`},itemText:{lineClamp:`1`,minWidth:`0`},itemInput:{outline:`none`,bg:`transparent`,minWidth:`2ch`,color:`inherit`,px:`var(--tags-input-item-px)`,height:`var(--tags-input-item-height)`},itemPreview:{height:`var(--tags-input-item-height)`,userSelect:`none`,display:`inline-flex`,alignItems:`center`,gap:`1`,rounded:`l1`,px:`var(--tags-input-item-px)`,maxWidth:`100%`},itemDeleteTrigger:{display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:`0`,boxSize:`calc(var(--tags-input-item-height) / 1.5)`,cursor:{base:`button`,_disabled:`initial`},me:`-1`,opacity:`0.4`,_hover:{opacity:`1`},"[data-highlighted] &":{opacity:`1`},_icon:{boxSize:`80%`}},clearTrigger:{display:`flex`,alignItems:`center`,justifyContent:`center`,boxSize:`calc(var(--tags-input-item-height) / 1.5)`,cursor:{base:`button`,_disabled:`initial`},color:`fg.muted`,focusVisibleRing:`inside`,focusRingWidth:`2px`,rounded:`l1`,_icon:{boxSize:`5`}}},variants:{size:{xs:{root:{"--tags-input-height":`sizes.8`,"--tags-input-px":`spacing.1.5`,"--tags-input-py":`spacing.1`,"--tags-input-gap":`spacing.1`,"--tags-input-item-height":`sizes.6`,"--tags-input-item-px":`spacing.2`,textStyle:`xs`}},sm:{root:{"--tags-input-height":`sizes.9`,"--tags-input-px":`spacing.1.5`,"--tags-input-py":`spacing.1`,"--tags-input-gap":`spacing.1`,"--tags-input-item-height":`sizes.6`,"--tags-input-item-px":`spacing.2`,textStyle:`sm`}},md:{root:{"--tags-input-height":`sizes.10`,"--tags-input-px":`spacing.1.5`,"--tags-input-py":`spacing.1`,"--tags-input-gap":`spacing.1`,"--tags-input-item-height":`sizes.7`,"--tags-input-item-px":`spacing.2`,textStyle:`sm`}},lg:{root:{"--tags-input-height":`sizes.11`,"--tags-input-px":`spacing.1.5`,"--tags-input-py":`spacing.1`,"--tags-input-gap":`spacing.1`,"--tags-input-item-height":`sizes.8`,"--tags-input-item-px":`spacing.2`,textStyle:`md`}}},variant:{outline:{control:{borderWidth:`1px`,bg:`bg`,_focus:{outlineWidth:`1px`,outlineStyle:`solid`,outlineColor:`var(--focus-color)`,borderColor:`var(--focus-color)`,_invalid:{outlineColor:`var(--error-color)`,borderColor:`var(--error-color)`}}},itemPreview:{bg:`colorPalette.subtle`,_highlighted:{bg:`colorPalette.muted`}}},subtle:{control:{bg:`bg.muted`,borderWidth:`1px`,borderColor:`transparent`,_focus:{outlineWidth:`1px`,outlineStyle:`solid`,outlineColor:`var(--focus-color)`,borderColor:`var(--focus-color)`,_invalid:{outlineColor:`var(--error-color)`,borderColor:`var(--error-color)`}}},itemPreview:{bg:`bg`,borderWidth:`1px`,_highlighted:{bg:`colorPalette.subtle`,borderColor:`colorPalette.emphasized`}}},flushed:{control:{borderRadius:`0`,px:`0`,bg:`transparent`,borderBottomWidth:`1px`,borderBottomColor:`border`,_focus:{borderColor:`var(--focus-color)`,boxShadow:`0px 1px 0px 0px var(--focus-color)`}},itemPreview:{bg:`colorPalette.subtle`,_highlighted:{bg:`colorPalette.muted`}}}}},defaultVariants:{size:`md`,variant:`outline`}}),JC=W({slots:LS.keys(),className:`chakra-timeline`,base:{root:{display:`flex`,flexDirection:`column`,width:`full`,"--timeline-thickness":`1px`,"--timeline-gutter":`4px`},item:{"--timeline-content-gap":`spacing.6`,display:`flex`,position:`relative`,alignItems:`flex-start`,flexShrink:0,gap:`4`,_last:{"--timeline-content-gap":`0`}},separator:{display:`var(--timeline-separator-display)`,position:`absolute`,borderStartWidth:`var(--timeline-thickness)`,ms:`calc(-1 * var(--timeline-thickness) / 2)`,insetInlineStart:`calc(var(--timeline-indicator-size) / 2)`,insetBlock:`0`,borderColor:`border`},indicator:{outline:`2px solid {colors.bg}`,position:`relative`,flexShrink:`0`,boxSize:`var(--timeline-indicator-size)`,fontSize:`var(--timeline-font-size)`,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:`full`,fontWeight:`medium`},connector:{alignSelf:`stretch`,position:`relative`},content:{pb:`var(--timeline-content-gap)`,display:`flex`,flexDirection:`column`,width:`full`,gap:`2`},title:{display:`flex`,fontWeight:`medium`,flexWrap:`wrap`,gap:`1.5`,alignItems:`center`,mt:`var(--timeline-margin)`},description:{color:`fg.muted`,textStyle:`xs`}},variants:{variant:{subtle:{indicator:{bg:`colorPalette.muted`}},solid:{indicator:{bg:`colorPalette.solid`,color:`colorPalette.contrast`}},outline:{indicator:{bg:`currentBg`,borderWidth:`1px`,borderColor:`colorPalette.muted`}},plain:{}},showLastSeparator:{true:{item:{_last:{"--timeline-separator-display":`initial`}}},false:{item:{_last:{"--timeline-separator-display":`none`}}}},size:{sm:{root:{"--timeline-indicator-size":`sizes.4`,"--timeline-font-size":`fontSizes.2xs`},title:{textStyle:`xs`}},md:{root:{"--timeline-indicator-size":`sizes.5`,"--timeline-font-size":`fontSizes.xs`},title:{textStyle:`sm`}},lg:{root:{"--timeline-indicator-size":`sizes.6`,"--timeline-font-size":`fontSizes.xs`},title:{mt:`0.5`,textStyle:`sm`}},xl:{root:{"--timeline-indicator-size":`sizes.8`,"--timeline-font-size":`fontSizes.sm`},title:{mt:`1.5`,textStyle:`sm`}}}},defaultVariants:{size:`md`,variant:`solid`,showLastSeparator:!1}}),YC=W({slots:PS.keys(),className:`chakra-toast`,base:{root:{width:`full`,display:`flex`,alignItems:`flex-start`,position:`relative`,gap:`3`,py:`4`,ps:`4`,pe:`6`,borderRadius:`l2`,translate:`var(--x) var(--y)`,scale:`var(--scale)`,zIndex:`var(--z-index)`,height:`var(--height)`,opacity:`var(--opacity)`,willChange:`translate, opacity, scale`,transition:`translate 400ms, scale 400ms, opacity 400ms, height 400ms, box-shadow 200ms`,transitionTimingFunction:`cubic-bezier(0.21, 1.02, 0.73, 1)`,_closed:{transition:`translate 400ms, scale 400ms, opacity 200ms`,transitionTimingFunction:`cubic-bezier(0.06, 0.71, 0.55, 1)`},bg:`bg.panel`,color:`fg`,boxShadow:`xl`,"--toast-trigger-bg":`colors.bg.muted`,"&[data-type=warning]":{bg:`orange.solid`,color:`orange.contrast`,"--toast-trigger-bg":`{white/10}`,"--toast-border-color":`{white/40}`},"&[data-type=success]":{bg:`green.solid`,color:`green.contrast`,"--toast-trigger-bg":`{white/10}`,"--toast-border-color":`{white/40}`},"&[data-type=error]":{bg:`red.solid`,color:`red.contrast`,"--toast-trigger-bg":`{white/10}`,"--toast-border-color":`{white/40}`}},title:{fontWeight:`medium`,textStyle:`sm`,marginEnd:`2`},description:{display:`inline`,textStyle:`sm`,opacity:`0.8`},indicator:{flexShrink:`0`,boxSize:`5`},actionTrigger:{textStyle:`sm`,fontWeight:`medium`,height:`8`,px:`3`,borderRadius:`l2`,alignSelf:`center`,borderWidth:`1px`,borderColor:`var(--toast-border-color, inherit)`,transition:`background 200ms`,_hover:{bg:`var(--toast-trigger-bg)`}},closeTrigger:{position:`absolute`,top:`1`,insetEnd:`1`,padding:`1`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,color:`{currentColor/60}`,borderRadius:`l2`,textStyle:`md`,transition:`background 200ms`,_icon:{boxSize:`1em`}}}}),XC=W({slots:bg.keys(),className:`chakra-tooltip`,base:{content:{"--tooltip-bg":`colors.bg.inverted`,bg:`var(--tooltip-bg)`,color:`fg.inverted`,px:`2.5`,py:`1`,borderRadius:`l2`,fontWeight:`medium`,textStyle:`xs`,boxShadow:`md`,maxW:`xs`,zIndex:`tooltip`,transformOrigin:`var(--transform-origin)`,_open:{animationStyle:`scale-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`scale-fade-out`,animationDuration:`fast`}},arrow:{"--arrow-size":`sizes.2`,"--arrow-background":`var(--tooltip-bg)`},arrowTip:{borderTopWidth:`1px`,borderLeftWidth:`1px`,borderColor:`var(--tooltip-bg)`}}}),ZC=Zv({display:`flex`,alignItems:`center`,gap:`var(--tree-item-gap)`,rounded:`l2`,userSelect:`none`,position:`relative`,"--tree-depth":`calc(var(--depth) - 1)`,"--tree-indentation-offset":`calc(var(--tree-indentation) * var(--tree-depth))`,"--tree-offset":`calc(var(--tree-padding-inline) + var(--tree-indentation-offset))`,ps:`var(--tree-offset)`,pe:`var(--tree-padding-inline)`,py:`var(--tree-padding-block)`,focusVisibleRing:`inside`,focusRingColor:`border.emphasized`,focusRingWidth:`2px`,"&:hover, &:focus-visible":{bg:`bg.muted`},_disabled:{layerStyle:`disabled`}}),QC=Zv({flex:`1`}),$C=Zv({_selected:{bg:`colorPalette.subtle`,color:`colorPalette.fg`}}),ew=Zv({_selected:{layerStyle:`fill.solid`}}),tw={accordion:HS,actionBar:US,alert:WS,avatar:GS,blockquote:KS,breadcrumb:qS,card:JS,carousel:YS,checkbox:XS,checkboxCard:ZS,codeBlock:QS,collapsible:$S,dataList:nC,dateInput:rC,datePicker:oC,dialog:sC,drawer:cC,editable:uC,emptyState:dC,field:fC,fieldset:pC,fileUpload:mC,hoverCard:gC,list:_C,listbox:vC,menu:bC,nativeSelect:SC,numberInput:wC,pinInput:DC,popover:OC,progress:kC,progressCircle:AC,radioCard:MC,radioGroup:NC,ratingGroup:PC,scrollArea:FC,segmentGroup:IC,select:xC,combobox:tC,slider:LC,splitter:RC,stat:zC,steps:VC,switch:HC,table:UC,tabs:WC,tag:KC,tagsInput:qC,toast:YC,tooltip:XC,status:BC,timeline:JC,colorPicker:eC,qrCode:jC,treeView:W({slots:xg.keys(),className:`chakra-tree-view`,base:{root:{width:`full`,display:`flex`,flexDirection:`column`,gap:`2`},tree:{display:`flex`,flexDirection:`column`,"--tree-item-gap":`spacing.2`,"--tree-indentation":`calc(var(--tree-indent-size) + var(--tree-icon-size) * 0.5)`,_icon:{boxSize:`var(--tree-icon-size)`}},label:{fontWeight:`medium`,textStyle:`sm`},branch:{position:`relative`},branchContent:{position:`relative`},branchIndentGuide:{height:`100%`,width:`1px`,bg:`border`,position:`absolute`,"--tree-depth":`calc(var(--depth) - 1)`,"--tree-indentation-offset":`calc(var(--tree-indentation) * var(--tree-depth))`,"--tree-offset":`calc(var(--tree-padding-inline) + var(--tree-indentation-offset))`,insetInlineStart:`calc(var(--tree-offset) + var(--tree-icon-size) * 0.5)`,zIndex:`1`},branchIndicator:{color:`fg.muted`,transformOrigin:`center`,transitionDuration:`normal`,transitionProperty:`transform`,transitionTimingFunction:`default`,_open:{transform:`rotate(90deg)`}},branchTrigger:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`},branchControl:ZC,item:ZC,itemText:QC,branchText:QC,nodeCheckbox:{display:`inline-flex`}},variants:{size:{md:{tree:{textStyle:`sm`,"--tree-indent-size":`spacing.4`,"--tree-icon-size":`spacing.4`,"--tree-padding-inline":`spacing.3`,"--tree-padding-block":`spacing.1.5`}},sm:{tree:{textStyle:`sm`,"--tree-indent-size":`spacing.4`,"--tree-icon-size":`spacing.3`,"--tree-padding-inline":`spacing.3`,"--tree-padding-block":`spacing.1`}},xs:{tree:{textStyle:`xs`,"--tree-indent-size":`spacing.4`,"--tree-icon-size":`spacing.3`,"--tree-padding-inline":`spacing.2`,"--tree-padding-block":`spacing.1`}}},variant:{subtle:{branchControl:$C,item:$C},solid:{branchControl:ew,item:ew}},animateContent:{true:{branchContent:{_open:{animationName:`expand-height, fade-in`,animationDuration:`moderate`},_closed:{animationName:`collapse-height, fade-out`,animationDuration:`moderate`}}}}},defaultVariants:{size:`md`,variant:`subtle`}}),marquee:yC,floatingPanel:hC},nw=Qv({"2xs":{value:{fontSize:`2xs`,lineHeight:`0.75rem`}},xs:{value:{fontSize:`xs`,lineHeight:`1rem`}},sm:{value:{fontSize:`sm`,lineHeight:`1.25rem`}},md:{value:{fontSize:`md`,lineHeight:`1.5rem`}},lg:{value:{fontSize:`lg`,lineHeight:`1.75rem`}},xl:{value:{fontSize:`xl`,lineHeight:`1.875rem`}},"2xl":{value:{fontSize:`2xl`,lineHeight:`2rem`}},"3xl":{value:{fontSize:`3xl`,lineHeight:`2.375rem`}},"4xl":{value:{fontSize:`4xl`,lineHeight:`2.75rem`,letterSpacing:`-0.025em`}},"5xl":{value:{fontSize:`5xl`,lineHeight:`3.75rem`,letterSpacing:`-0.025em`}},"6xl":{value:{fontSize:`6xl`,lineHeight:`4.5rem`,letterSpacing:`-0.025em`}},"7xl":{value:{fontSize:`7xl`,lineHeight:`5.75rem`,letterSpacing:`-0.025em`}},none:{value:{}},label:{value:{fontSize:`sm`,lineHeight:`1.25rem`,fontWeight:`medium`}}}),rw=ny.animations({spin:{value:`spin 1s linear infinite`},ping:{value:`ping 1s cubic-bezier(0, 0, 0.2, 1) infinite`},pulse:{value:`pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite`},bounce:{value:`bounce 1s infinite`}}),iw=ny.aspectRatios({square:{value:`1 / 1`},landscape:{value:`4 / 3`},portrait:{value:`3 / 4`},wide:{value:`16 / 9`},ultrawide:{value:`18 / 5`},golden:{value:`1.618 / 1`}}),aw=ny.blurs({none:{value:` `},sm:{value:`4px`},md:{value:`8px`},lg:{value:`12px`},xl:{value:`16px`},"2xl":{value:`24px`},"3xl":{value:`40px`},"4xl":{value:`64px`}}),ow=ny.borders({xs:{value:`0.5px solid`},sm:{value:`1px solid`},md:{value:`2px solid`},lg:{value:`4px solid`},xl:{value:`8px solid`}}),sw=ny.colors({transparent:{value:`transparent`},current:{value:`currentColor`},black:{value:`#09090B`},white:{value:`#FFFFFF`},whiteAlpha:{50:{value:`rgba(255, 255, 255, 0.04)`},100:{value:`rgba(255, 255, 255, 0.06)`},200:{value:`rgba(255, 255, 255, 0.08)`},300:{value:`rgba(255, 255, 255, 0.16)`},400:{value:`rgba(255, 255, 255, 0.24)`},500:{value:`rgba(255, 255, 255, 0.36)`},600:{value:`rgba(255, 255, 255, 0.48)`},700:{value:`rgba(255, 255, 255, 0.64)`},800:{value:`rgba(255, 255, 255, 0.80)`},900:{value:`rgba(255, 255, 255, 0.92)`},950:{value:`rgba(255, 255, 255, 0.95)`}},blackAlpha:{50:{value:`rgba(0, 0, 0, 0.04)`},100:{value:`rgba(0, 0, 0, 0.06)`},200:{value:`rgba(0, 0, 0, 0.08)`},300:{value:`rgba(0, 0, 0, 0.16)`},400:{value:`rgba(0, 0, 0, 0.24)`},500:{value:`rgba(0, 0, 0, 0.36)`},600:{value:`rgba(0, 0, 0, 0.48)`},700:{value:`rgba(0, 0, 0, 0.64)`},800:{value:`rgba(0, 0, 0, 0.80)`},900:{value:`rgba(0, 0, 0, 0.92)`},950:{value:`rgba(0, 0, 0, 0.95)`}},gray:{50:{value:`#fafafa`},100:{value:`#f4f4f5`},200:{value:`#e4e4e7`},300:{value:`#d4d4d8`},400:{value:`#a1a1aa`},500:{value:`#71717a`},600:{value:`#52525b`},700:{value:`#3f3f46`},800:{value:`#27272a`},900:{value:`#18181b`},950:{value:`#111111`}},red:{50:{value:`#fef2f2`},100:{value:`#fee2e2`},200:{value:`#fecaca`},300:{value:`#fca5a5`},400:{value:`#f87171`},500:{value:`#ef4444`},600:{value:`#dc2626`},700:{value:`#991919`},800:{value:`#511111`},900:{value:`#300c0c`},950:{value:`#1f0808`}},orange:{50:{value:`#fff7ed`},100:{value:`#ffedd5`},200:{value:`#fed7aa`},300:{value:`#fdba74`},400:{value:`#fb923c`},500:{value:`#f97316`},600:{value:`#ea580c`},700:{value:`#92310a`},800:{value:`#6c2710`},900:{value:`#3b1106`},950:{value:`#220a04`}},yellow:{50:{value:`#fefce8`},100:{value:`#fef9c3`},200:{value:`#fef08a`},300:{value:`#fde047`},400:{value:`#facc15`},500:{value:`#eab308`},600:{value:`#ca8a04`},700:{value:`#845209`},800:{value:`#713f12`},900:{value:`#422006`},950:{value:`#281304`}},green:{50:{value:`#f0fdf4`},100:{value:`#dcfce7`},200:{value:`#bbf7d0`},300:{value:`#86efac`},400:{value:`#4ade80`},500:{value:`#22c55e`},600:{value:`#16a34a`},700:{value:`#116932`},800:{value:`#124a28`},900:{value:`#042713`},950:{value:`#03190c`}},teal:{50:{value:`#f0fdfa`},100:{value:`#ccfbf1`},200:{value:`#99f6e4`},300:{value:`#5eead4`},400:{value:`#2dd4bf`},500:{value:`#14b8a6`},600:{value:`#0d9488`},700:{value:`#0c5d56`},800:{value:`#114240`},900:{value:`#032726`},950:{value:`#021716`}},blue:{50:{value:`#eff6ff`},100:{value:`#dbeafe`},200:{value:`#bfdbfe`},300:{value:`#a3cfff`},400:{value:`#60a5fa`},500:{value:`#3b82f6`},600:{value:`#2563eb`},700:{value:`#173da6`},800:{value:`#1a3478`},900:{value:`#14204a`},950:{value:`#0c142e`}},cyan:{50:{value:`#ecfeff`},100:{value:`#cffafe`},200:{value:`#a5f3fc`},300:{value:`#67e8f9`},400:{value:`#22d3ee`},500:{value:`#06b6d4`},600:{value:`#0891b2`},700:{value:`#0c5c72`},800:{value:`#134152`},900:{value:`#072a38`},950:{value:`#051b24`}},purple:{50:{value:`#faf5ff`},100:{value:`#f3e8ff`},200:{value:`#e9d5ff`},300:{value:`#d8b4fe`},400:{value:`#c084fc`},500:{value:`#a855f7`},600:{value:`#9333ea`},700:{value:`#641ba3`},800:{value:`#4a1772`},900:{value:`#2f0553`},950:{value:`#1a032e`}},pink:{50:{value:`#fdf2f8`},100:{value:`#fce7f3`},200:{value:`#fbcfe8`},300:{value:`#f9a8d4`},400:{value:`#f472b6`},500:{value:`#ec4899`},600:{value:`#db2777`},700:{value:`#a41752`},800:{value:`#6d0e34`},900:{value:`#45061f`},950:{value:`#2c0514`}}}),cw=ny.cursor({button:{value:`pointer`},checkbox:{value:`default`},disabled:{value:`not-allowed`},menuitem:{value:`default`},option:{value:`default`},radio:{value:`default`},slider:{value:`default`},switch:{value:`pointer`}}),lw=ny.durations({fastest:{value:`50ms`},faster:{value:`100ms`},fast:{value:`150ms`},moderate:{value:`200ms`},slow:{value:`300ms`},slower:{value:`400ms`},slowest:{value:`500ms`}}),uw=ny.easings({"ease-in":{value:`cubic-bezier(0.42, 0, 1, 1)`},"ease-out":{value:`cubic-bezier(0, 0, 0.58, 1)`},"ease-in-out":{value:`cubic-bezier(0.42, 0, 0.58, 1)`},"ease-in-smooth":{value:`cubic-bezier(0.32, 0.72, 0, 1)`}}),dw=ny.fontSizes({"2xs":{value:`0.625rem`},xs:{value:`0.75rem`},sm:{value:`0.875rem`},md:{value:`1rem`},lg:{value:`1.125rem`},xl:{value:`1.25rem`},"2xl":{value:`1.5rem`},"3xl":{value:`1.875rem`},"4xl":{value:`2.25rem`},"5xl":{value:`3rem`},"6xl":{value:`3.75rem`},"7xl":{value:`4.5rem`},"8xl":{value:`6rem`},"9xl":{value:`8rem`}}),fw=ny.fontWeights({thin:{value:`100`},extralight:{value:`200`},light:{value:`300`},normal:{value:`400`},medium:{value:`500`},semibold:{value:`600`},bold:{value:`700`},extrabold:{value:`800`},black:{value:`900`}}),pw=`-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"`,mw=ny.fonts({heading:{value:`Inter, ${pw}`},body:{value:`Inter, ${pw}`},mono:{value:`SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace`}}),hw=Yv({spin:{"0%":{transform:`rotate(0deg)`},"100%":{transform:`rotate(360deg)`}},pulse:{"50%":{opacity:`0.5`}},ping:{"75%, 100%":{transform:`scale(2)`,opacity:`0`}},bounce:{"0%, 100%":{transform:`translateY(-25%)`,animationTimingFunction:`cubic-bezier(0.8,0,1,1)`},"50%":{transform:`none`,animationTimingFunction:`cubic-bezier(0,0,0.2,1)`}},"bg-position":{from:{backgroundPosition:`var(--animate-from, 1rem) 0`},to:{backgroundPosition:`var(--animate-to, 0) 0`}},position:{from:{insetInlineStart:`var(--animate-from-x)`,insetBlockStart:`var(--animate-from-y)`},to:{insetInlineStart:`var(--animate-to-x)`,insetBlockStart:`var(--animate-to-y)`}},"circular-progress":{"0%":{strokeDasharray:`1, 400`,strokeDashoffset:`0`},"50%":{strokeDasharray:`400, 400`,strokeDashoffset:`-100%`},"100%":{strokeDasharray:`400, 400`,strokeDashoffset:`-260%`}},"expand-height":{from:{height:`var(--collapsed-height, 0)`},to:{height:`var(--height)`}},"collapse-height":{from:{height:`var(--height)`},to:{height:`var(--collapsed-height, 0)`}},"expand-width":{from:{width:`var(--collapsed-width, 0)`},to:{width:`var(--width)`}},"collapse-width":{from:{width:`var(--width)`},to:{width:`var(--collapsed-width, 0)`}},"fade-in":{from:{opacity:0},to:{opacity:1}},"fade-out":{from:{opacity:1},to:{opacity:0}},"slide-from-left-full":{from:{translate:`-100% 0`},to:{translate:`0 0`}},"slide-from-right-full":{from:{translate:`100% 0`},to:{translate:`0 0`}},"slide-from-top-full":{from:{translate:`0 -100%`},to:{translate:`0 0`}},"slide-from-bottom-full":{from:{translate:`0 100%`},to:{translate:`0 0`}},"slide-to-left-full":{from:{translate:`0 0`},to:{translate:`-100% 0`}},"slide-to-right-full":{from:{translate:`0 0`},to:{translate:`100% 0`}},"slide-to-top-full":{from:{translate:`0 0`},to:{translate:`0 -100%`}},"slide-to-bottom-full":{from:{translate:`0 0`},to:{translate:`0 100%`}},"slide-from-top":{"0%":{translate:`0 calc(var(--slide-from-top-distance, 0.5rem) * -1)`},to:{translate:`0`}},"slide-from-bottom":{"0%":{translate:`0 var(--slide-from-bottom-distance, 0.5rem)`},to:{translate:`0`}},"slide-from-left":{"0%":{translate:`calc(var(--slide-from-left-distance, 0.5rem) * -1) 0`},to:{translate:`0`}},"slide-from-right":{"0%":{translate:`var(--slide-from-right-distance, 0.5rem) 0`},to:{translate:`0`}},"slide-to-top":{"0%":{translate:`0`},to:{translate:`0 calc(var(--slide-to-top-distance, 0.5rem) * -1)`}},"slide-to-bottom":{"0%":{translate:`0`},to:{translate:`0 var(--slide-to-bottom-distance, 0.5rem)`}},"slide-to-left":{"0%":{translate:`0`},to:{translate:`calc(var(--slide-to-left-distance, 0.5rem) * -1) 0`}},"slide-to-right":{"0%":{translate:`0`},to:{translate:`var(--slide-to-right-distance, 0.5rem) 0`}},"scale-in":{from:{scale:`0.95`},to:{scale:`1`}},"scale-out":{from:{scale:`1`},to:{scale:`0.95`}},marqueeX:{from:{transform:`translateX(0%)`},to:{transform:`translateX(var(--marquee-translate))`}},marqueeY:{from:{transform:`translateY(0%)`},to:{transform:`translateY(var(--marquee-translate))`}}}),gw=ny.letterSpacings({tighter:{value:`-0.05em`},tight:{value:`-0.025em`},wide:{value:`0.025em`},wider:{value:`0.05em`},widest:{value:`0.1em`}}),_w=ny.lineHeights({shorter:{value:1.25},short:{value:1.375},moderate:{value:1.5},tall:{value:1.625},taller:{value:2}}),vw=ny.radii({none:{value:`0`},"2xs":{value:`0.0625rem`},xs:{value:`0.125rem`},sm:{value:`0.25rem`},md:{value:`0.375rem`},lg:{value:`0.5rem`},xl:{value:`0.75rem`},"2xl":{value:`1rem`},"3xl":{value:`1.5rem`},"4xl":{value:`2rem`},full:{value:`9999px`}}),yw=ny.spacing({.5:{value:`0.125rem`},1:{value:`0.25rem`},1.5:{value:`0.375rem`},2:{value:`0.5rem`},2.5:{value:`0.625rem`},3:{value:`0.75rem`},3.5:{value:`0.875rem`},4:{value:`1rem`},4.5:{value:`1.125rem`},5:{value:`1.25rem`},6:{value:`1.5rem`},7:{value:`1.75rem`},8:{value:`2rem`},9:{value:`2.25rem`},10:{value:`2.5rem`},11:{value:`2.75rem`},12:{value:`3rem`},14:{value:`3.5rem`},16:{value:`4rem`},20:{value:`5rem`},24:{value:`6rem`},28:{value:`7rem`},32:{value:`8rem`},36:{value:`9rem`},40:{value:`10rem`},44:{value:`11rem`},48:{value:`12rem`},52:{value:`13rem`},56:{value:`14rem`},60:{value:`15rem`},64:{value:`16rem`},72:{value:`18rem`},80:{value:`20rem`},96:{value:`24rem`}}),bw=ny.sizes({"3xs":{value:`14rem`},"2xs":{value:`16rem`},xs:{value:`20rem`},sm:{value:`24rem`},md:{value:`28rem`},lg:{value:`32rem`},xl:{value:`36rem`},"2xl":{value:`42rem`},"3xl":{value:`48rem`},"4xl":{value:`56rem`},"5xl":{value:`64rem`},"6xl":{value:`72rem`},"7xl":{value:`80rem`},"8xl":{value:`90rem`}}),xw=ny.sizes({max:{value:`max-content`},min:{value:`min-content`},fit:{value:`fit-content`},prose:{value:`60ch`},full:{value:`100%`},dvh:{value:`100dvh`},svh:{value:`100svh`},lvh:{value:`100lvh`},dvw:{value:`100dvw`},svw:{value:`100svw`},lvw:{value:`100lvw`},vw:{value:`100vw`},vh:{value:`100vh`}}),Sw=ny.sizes({"1/2":{value:`50%`},"1/3":{value:`33.333333%`},"2/3":{value:`66.666667%`},"1/4":{value:`25%`},"3/4":{value:`75%`},"1/5":{value:`20%`},"2/5":{value:`40%`},"3/5":{value:`60%`},"4/5":{value:`80%`},"1/6":{value:`16.666667%`},"2/6":{value:`33.333333%`},"3/6":{value:`50%`},"4/6":{value:`66.666667%`},"5/6":{value:`83.333333%`},"1/12":{value:`8.333333%`},"2/12":{value:`16.666667%`},"3/12":{value:`25%`},"4/12":{value:`33.333333%`},"5/12":{value:`41.666667%`},"6/12":{value:`50%`},"7/12":{value:`58.333333%`},"8/12":{value:`66.666667%`},"9/12":{value:`75%`},"10/12":{value:`83.333333%`},"11/12":{value:`91.666667%`}}),Cw=Ex(Kv(by,iy({preflight:!0,cssVarsPrefix:`chakra`,cssVarsRoot:`:where(html, .chakra-theme)`,globalCss:Px,theme:{breakpoints:Mx,keyframes:hw,tokens:{aspectRatios:iw,animations:rw,blurs:aw,borders:ow,colors:sw,durations:lw,easings:uw,fonts:mw,fontSizes:dw,fontWeights:fw,letterSpacings:gw,lineHeights:_w,radii:vw,spacing:yw,sizes:ny.sizes({...bw,...yw,...Sw,...xw}),zIndex:ny.zIndex({hide:{value:-1},base:{value:0},docked:{value:10},dropdown:{value:1e3},sticky:{value:1100},banner:{value:1200},overlay:{value:1300},modal:{value:1400},popover:{value:1500},skipNav:{value:1600},toast:{value:1700},tooltip:{value:1800},max:{value:2147483647}}),cursor:cw},semanticTokens:{colors:eS,shadows:nS,radii:tS},recipes:$x,slotRecipes:tw,textStyles:nw,layerStyles:Fx,animationStyles:Ix}}))),ww=vn(`div`,{base:{position:`absolute`,display:`flex`,alignItems:`center`,justifyContent:`center`},variants:{axis:{horizontal:{insetStart:`50%`,translate:`-50%`,_rtl:{translate:`50%`}},vertical:{top:`50%`,translate:`0 -50%`},both:{insetStart:`50%`,top:`50%`,translate:`-50% -50%`,_rtl:{translate:`50% -50%`}}}},defaultVariants:{axis:`both`}});ww.displayName=`AbsoluteCenter`;var Tw=e=>(0,I.jsx)(vn.svg,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:(0,I.jsx)(`path`,{d:`M20 6 9 17l-5-5`})}),Ew=e=>(0,I.jsx)(vn.svg,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:(0,I.jsx)(`path`,{d:`m6 9 6 6 6-6`})}),Dw=e=>(0,I.jsx)(vn.svg,{viewBox:`0 0 24 24`,fill:`currentColor`,...e,children:(0,I.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M18.7071 6.70711C19.0976 6.31658 19.0976 5.68342 18.7071 5.29289C18.3166 4.90237 17.6834 4.90237 17.2929 5.29289L12 10.5858L6.70711 5.29289C6.31658 4.90237 5.68342 4.90237 5.29289 5.29289C4.90237 5.68342 4.90237 6.31658 5.29289 6.70711L10.5858 12L5.29289 17.2929C4.90237 17.6834 4.90237 18.3166 5.29289 18.7071C5.68342 19.0976 6.31658 19.0976 6.70711 18.7071L12 13.4142L17.2929 18.7071C17.6834 19.0976 18.3166 19.0976 18.7071 18.7071C19.0976 18.3166 19.0976 17.6834 18.7071 17.2929L13.4142 12L18.7071 6.70711Z`})}),{PropsProvider:Ow,withContext:kw}=Dn({key:`badge`}),Aw=kw(`span`),{withContext:jw,PropsProvider:Mw}=Dn({key:`spinner`}),Nw=jw(`span`),Pw=F.forwardRef(function(e,t){let{spinner:n=(0,I.jsx)(Nw,{size:`inherit`,borderWidth:`0.125em`,color:`inherit`}),spinnerPlacement:r=`start`,children:i,text:a,visible:o=!0,...s}=e;return o?a?(0,I.jsxs)(qs,{ref:t,display:`contents`,...s,children:[r===`start`&&n,a,r===`end`&&n]}):n?(0,I.jsxs)(qs,{ref:t,display:`contents`,...s,children:[(0,I.jsx)(ww,{display:`inline-flex`,children:n}),(0,I.jsx)(qs,{visibility:`hidden`,display:`contents`,children:i})]}):(0,I.jsx)(qs,{ref:t,display:`contents`,...s,children:i}):i});Pw.displayName=`Loader`;var{useRecipeResult:Fw,PropsProvider:Iw,usePropsContext:Lw}=Dn({key:`button`}),Rw=(0,F.forwardRef)(function(e,t){let n=Lw(),r=(0,F.useMemo)(()=>zt(n,e),[n,e]),i=Fw(r),{loading:a,loadingText:o,children:s,spinner:c,spinnerPlacement:l,...u}=i.props;return(0,I.jsx)(vn.button,{type:`button`,ref:t,...u,"data-loading":z(a),disabled:a||u.disabled,className:qt(i.className,r.className),css:[i.styles,r.css],children:!r.asChild&&a?(0,I.jsx)(Pw,{spinner:c,text:o,spinnerPlacement:l,children:s}):s})});Rw.displayName=`Button`;var zw=(0,F.forwardRef)(function(e,t){let n=En({key:`checkmark`,recipe:e.recipe}),[r,i]=n.splitVariantProps(e),{checked:a,indeterminate:o,disabled:s,unstyled:c,children:l,css:u,...d}=i,f=c?wn:n(r);return(0,I.jsx)(vn.svg,{ref:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3px`,strokeLinecap:`round`,strokeLinejoin:`round`,"data-state":o?`indeterminate`:a?`checked`:`unchecked`,"data-disabled":z(s),css:[f,u],...d,children:o?(0,I.jsx)(`path`,{d:`M5 12h14`}):a?(0,I.jsx)(`polyline`,{points:`20 6 9 17 4 12`}):null})});zw.displayName=`Checkmark`;var{withProvider:Bw,withContext:Vw,useStyles:Hw,PropsProvider:Uw}=Ic({key:`checkbox`});Bw(c_.RootProvider,`root`,{forwardAsChild:!0});var Ww=Bw(c_.Root,`root`,{forwardAsChild:!0}),Gw=Vw(c_.Label,`label`,{forwardAsChild:!0}),Kw=(0,F.forwardRef)(function(e,t){let{checked:n,indeterminate:r,...i}=e,a=wg(),o=Hw();return n&&a.checked?(0,I.jsx)(vn.svg,{ref:t,asChild:!0,...i,css:[o.indicator,e.css],children:n}):r&&a.indeterminate?(0,I.jsx)(vn.svg,{ref:t,asChild:!0,...i,css:[o.indicator,e.css],children:r}):(0,I.jsx)(zw,{ref:t,checked:a.checked,indeterminate:a.indeterminate,disabled:a.disabled,unstyled:!0,...i,css:[o.indicator,e.css]})}),qw=Vw(c_.Control,`control`,{forwardAsChild:!0,defaultProps:{children:(0,I.jsx)(Kw,{})}});vn(c_.Group,{base:{display:`flex`,flexDirection:`column`,gap:`1.5`}},{forwardAsChild:!0}),c_.Context;var Jw=c_.HiddenInput,Yw=(0,F.forwardRef)(function(e,t){return(0,I.jsx)(Rw,{px:`0`,py:`0`,_icon:{fontSize:`1.2em`},ref:t,...e})});Yw.displayName=`IconButton`;var Xw=F.forwardRef(function(e,t){return(0,I.jsx)(Yw,{variant:`ghost`,"aria-label":`Close`,ref:t,...e,children:e.children??(0,I.jsx)(Dw,{})})});Xw.displayName=`CloseButton`;function Zw(e){let{gap:t,direction:n}=e,r={column:{marginY:t,marginX:0,borderInlineStartWidth:0,borderTopWidth:`1px`},"column-reverse":{marginY:t,marginX:0,borderInlineStartWidth:0,borderTopWidth:`1px`},row:{marginX:t,marginY:0,borderInlineStartWidth:`1px`,borderTopWidth:0},"row-reverse":{marginX:t,marginY:0,borderInlineStartWidth:`1px`,borderTopWidth:0}};return{"&":Uv(n,e=>r[e])}}function Qw(e){return F.Children.toArray(e).filter(e=>(0,F.isValidElement)(e))}var $w=(0,F.forwardRef)(function(e,t){let{direction:n=`column`,align:r,justify:i,gap:a=`0.5rem`,wrap:o,children:s,separator:c,className:l,...u}=e,d=(0,F.useMemo)(()=>Zw({gap:a,direction:n}),[a,n]),f=(0,F.useMemo)(()=>(0,F.isValidElement)(c)?Qw(s).map((e,t,n)=>{let r=e.key===void 0?t:e.key,i=c,a=(0,F.cloneElement)(i,{css:[d,i.props.css]});return(0,I.jsxs)(F.Fragment,{children:[e,t===n.length-1?null:a]},r)}):s,[s,c,d]);return(0,I.jsx)(vn.div,{ref:t,display:`flex`,alignItems:r,justifyContent:i,flexDirection:n,flexWrap:o,gap:c?void 0:a,className:qt(`chakra-stack`,l),...u,children:f})});$w.displayName=`Stack`;var{withRootProvider:eT,withContext:tT,useStyles:nT,PropsProvider:rT}=Ic({key:`dialog`});eT(w_.RootProvider,{defaultProps:{unmountOnExit:!0,lazyMount:!0}});var iT=eT(w_.Root,{defaultProps:{unmountOnExit:!0,lazyMount:!0}});tT(w_.Trigger,`trigger`,{forwardAsChild:!0});var aT=tT(w_.Positioner,`positioner`,{forwardAsChild:!0}),oT=tT(w_.Content,`content`,{forwardAsChild:!0});tT(w_.Description,`description`,{forwardAsChild:!0});var sT=tT(w_.Title,`title`,{forwardAsChild:!0}),cT=tT(w_.CloseTrigger,`closeTrigger`,{forwardAsChild:!0});(0,F.forwardRef)(function(e,t){let n=d_();return(0,I.jsx)(vn.button,{type:`button`,...e,ref:t,onClick:t=>{e.onClick?.(t),n.setOpen(!1)}})});var lT=tT(w_.Backdrop,`backdrop`,{forwardAsChild:!0}),uT=tT(`div`,`body`);tT(`div`,`footer`);var dT=tT(`div`,`header`);w_.Context;var{useRecipeResult:fT,PropsProvider:pT}=Dn({key:`icon`}),mT=F.forwardRef(function(e,t){let{styles:n,className:r,props:i}=fT({asChild:!e.as,...e});return(0,I.jsx)(vn.svg,{ref:t,focusable:!1,"aria-hidden":`true`,...i,css:[n,e.css],className:qt(r,e.className)})});function hT(e){let{viewBox:t=`0 0 24 24`,d:n,displayName:r,defaultProps:i={}}=e,a=F.Children.toArray(e.path),o=(0,F.forwardRef)((e,r)=>(0,I.jsx)(mT,{ref:r,asChild:!1,viewBox:t,...i,...e,children:a.length?a:(0,I.jsx)(`path`,{fill:`currentColor`,d:n})}));return o.displayName=r,o}var{withProvider:gT,withContext:_T,useStyles:vT,useClassNames:yT,PropsProvider:bT}=Ic({key:`field`}),xT=gT($g.Root,`root`,{forwardAsChild:!0}),ST=_T($g.Label,`label`,{forwardAsChild:!0}),CT=_T($g.HelperText,`helperText`,{forwardAsChild:!0}),wT=_T($g.ErrorText,`errorText`,{forwardAsChild:!0});hT({d:`M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z`,defaultProps:{boxSize:`1em`}}),(0,F.forwardRef)(function(e,t){let{fallback:n,children:r=`*`,...i}=e,a=Rg(),o=yT(),s=vT();return a?.required?(0,I.jsx)(vn.span,{ref:t,"aria-hidden":`true`,...i,className:qt(o.requiredIndicator,e.className),css:[s.requiredIndicator,e.css],children:r}):n});var G=(0,F.forwardRef)(function(e,t){return(0,I.jsx)($w,{align:`center`,...e,direction:`row`,ref:t})});G.displayName=`HStack`;var{withContext:TT,PropsProvider:ET}=Dn({key:`input`}),DT=TT($g.Input),[OT,kT]=Qt({name:`NativeSelectBasePropsContext`,hookName:`useNativeSelectBaseProps`,providerName:`<NativeSelectRoot />`,strict:!1}),{withProvider:AT,useClassNames:jT,useStyles:MT,PropsProvider:NT}=Ic({key:`nativeSelect`}),PT=AT(`div`,`root`,{wrapElement(e,t){let n=Rg(),r=!!(n?.disabled??t.disabled),i=!!(n?.invalid??t.invalid);return(0,I.jsx)(OT,{value:{disabled:r,invalid:i},children:e})}}),FT=vn($g.Select,{},{forwardAsChild:!0}),IT=(0,F.forwardRef)(function(e,t){let{children:n,placeholder:r,unstyled:i,...a}=e,{disabled:o,invalid:s}=kT(),c=MT(),l=jT();return(0,I.jsxs)(FT,{disabled:o,"data-invalid":z(s),...a,ref:t,className:qt(l.field,e.className),css:[i?void 0:c.field,e.css],children:[r&&(0,I.jsx)(`option`,{value:``,children:r}),n]})}),{withProvider:LT,withContext:RT,useStyles:zT,PropsProvider:BT}=Ic({key:`select`});LT(iv.RootProvider,`root`,{forwardAsChild:!0});var VT=LT(iv.Root,`root`,{forwardAsChild:!0,defaultProps:{positioning:{sameWidth:!0}}}),HT=RT(iv.Trigger,`trigger`,{forwardAsChild:!0}),UT=RT(iv.Positioner,`positioner`,{forwardAsChild:!0}),WT=RT(iv.Content,`content`,{forwardAsChild:!0});RT(iv.List,`list`,{forwardAsChild:!0});var GT=RT(iv.ValueText,`valueText`,{forwardAsChild:!0});RT(iv.ClearTrigger,`clearTrigger`,{forwardAsChild:!0,defaultProps:{children:(0,I.jsx)(Dw,{boxSize:`1em`})}}),RT(iv.ItemGroup,`itemGroup`,{forwardAsChild:!0}),RT(iv.ItemGroupLabel,`itemGroupLabel`,{forwardAsChild:!0});var KT=RT(iv.Item,`item`,{forwardAsChild:!0});RT(iv.ItemText,`itemText`,{forwardAsChild:!0}),RT(iv.ItemIndicator,`itemIndicator`,{forwardAsChild:!0,defaultProps:{children:(0,I.jsx)(Tw,{})}}),RT(`div`,`indicatorGroup`),RT(iv.Indicator,`indicator`,{forwardAsChild:!0,defaultProps:{children:(0,I.jsx)(Ew,{})}});var qT=RT(iv.Control,`control`,{forwardAsChild:!0});RT(iv.Label,`label`,{forwardAsChild:!0}),iv.Context;var JT=iv.HiddenSelect;iv.ItemContext;var{withProvider:YT,withContext:XT,useStyles:ZT,PropsProvider:QT}=Ic({key:`splitter`});YT(xv.RootProvider,`root`,{forwardAsChild:!0});var $T=YT(xv.Root,`root`,{forwardAsChild:!0}),eE=XT(xv.Panel,`panel`,{forwardAsChild:!0}),tE=XT(`div`,`resizeTriggerSeparator`),nE=XT(xv.ResizeTriggerIndicator,`resizeTriggerIndicator`),rE=XT(xv.ResizeTrigger,`resizeTrigger`,{forwardAsChild:!0,defaultProps:{"aria-label":`Resize`,children:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(tE,{}),(0,I.jsx)(nE,{})]})}});xv.Context;var{withProvider:iE,withContext:aE,useStyles:oE,PropsProvider:sE}=Ic({key:`switch`});iE(Pv.RootProvider,`root`,{forwardAsChild:!0});var cE=iE(Pv.Root,`root`,{forwardAsChild:!0}),lE=aE(Pv.Label,`label`,{forwardAsChild:!0}),uE=aE(Pv.Thumb,`thumb`,{forwardAsChild:!0}),dE=aE(Pv.Control,`control`,{forwardAsChild:!0,defaultProps:{children:(0,I.jsx)(uE,{})}});(0,F.forwardRef)(function(e,t){let n=Cv(),r=oE(),{fallback:i,children:a,unstyled:o,...s}=e;return(0,I.jsx)(vn.span,{ref:t,"data-checked":z(n.checked),...s,css:[o?void 0:r.indicator,e.css],children:n.checked?a:i})}),(0,F.forwardRef)(function(e,t){let n=Cv(),{fallback:r,children:i,...a}=e;return(0,I.jsx)(vn.span,{ref:t,"data-checked":z(n.checked),...a,children:n.checked?i:r})}),Pv.Context;var fE=Pv.HiddenInput,{StylesProvider:pE,ClassNamesProvider:mE,useRecipeResult:hE,withContext:gE,useStyles:_E,PropsProvider:vE}=Ic({key:`table`}),yE=(0,F.forwardRef)(function({native:e,...t},n){let{styles:r,props:i,classNames:a}=hE(t),o=(0,F.useMemo)(()=>e?{...r.root,"& thead":r.header,"& tbody":r.body,"& tfoot":r.footer,"& thead th":r.columnHeader,"& tr":r.row,"& td":r.cell,"& caption":r.caption}:r.root,[r,e]);return(0,I.jsx)(mE,{value:a,children:(0,I.jsx)(pE,{value:r,children:(0,I.jsx)(vn.table,{ref:n,...i,css:[o,t.css],className:qt(a?.root,t.className)})})})}),bE=gE(`tr`,`row`),xE=vn(`div`,{base:{display:`block`,whiteSpace:`nowrap`,WebkitOverflowScrolling:`touch`,overflow:`auto`,maxWidth:`100%`}}),SE=gE(`thead`,`header`);gE(`tfoot`,`footer`);var CE=gE(`th`,`columnHeader`),wE=gE(`td`,`cell`);gE(`caption`,`caption`,{defaultProps:{captionSide:`bottom`}});var TE=gE(`tbody`,`body`);gE(`colgroup`),gE(`col`);var{withContext:EE,PropsProvider:DE}=Dn({key:`textarea`}),OE=EE($g.Textarea),kE=(0,F.forwardRef)(function(e,t){return(0,I.jsx)($w,{align:`center`,...e,direction:`column`,ref:t})});kE.displayName=`VStack`;var AE=F.createContext(void 0),jE=e=>{let t=F.useContext(AE);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},ME=({client:e,children:t})=>(F.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,I.jsx)(AE.Provider,{value:e,children:t})),NE={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},PE=new class{#e=NE;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function FE(e){setTimeout(e,0)}var IE=typeof window>`u`||`Deno`in globalThis;function LE(){}function RE(e,t){return typeof e==`function`?e(t):e}function zE(e){return typeof e==`number`&&e>=0&&e!==1/0}function BE(e,t){return Math.max(e+(t||0)-Date.now(),0)}function VE(e,t){return typeof e==`function`?e(t):e}function HE(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==WE(o,t.options))return!1}else if(!KE(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function UE(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(GE(t.options.mutationKey)!==GE(a))return!1}else if(!KE(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function WE(e,t){return(t?.queryKeyHashFn||GE)(e)}function GE(e){return JSON.stringify(e,(e,t)=>ZE(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function KE(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!KE(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!KE(e[r],t[r]))return!1;return!0}return!1}var qE=Object.prototype.hasOwnProperty;function JE(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=XE(e)&&XE(t);if(!r&&!(ZE(e)&&ZE(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:qE.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=JE(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function YE(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function XE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ZE(e){if(!QE(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!QE(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function QE(e){return Object.prototype.toString.call(e)===`[object Object]`}function $E(e){return new Promise(t=>{PE.setTimeout(t,e)})}function eD(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:JE(e,t)}function tD(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function nD(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var rD=Symbol();function iD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===rD?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function aD(e,t){return typeof e==`function`?e(...t):!!e}function oD(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var sD=()=>IE,cD=()=>sD(),lD=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},uD=new class extends lD{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},dD=FE;function fD(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=dD,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var pD=fD(),mD=new class extends lD{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function hD(e){return Math.min(1e3*2**e,3e4)}function gD(e){return(e??`online`)!==`online`||mD.isOnline()}var _D=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function vD(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(LE);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new _D(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>uD.isFocused()&&(e.networkMode===`always`||mD.isOnline())&&e.canRun(),p=()=>gD(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(cD()?0:3),a=e.retryDelay??hD,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),$E(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var yD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),zE(this.gcTime)&&(this.#e=PE.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(cD()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(PE.clearTimeout(this.#e),this.#e=void 0)}};function bD(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{oD(e,()=>t.signal,()=>n=!0)},u=iD(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?nD:tD;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?SD:xD,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:xD(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function xD(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function SD(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var CD=class extends yD{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ED(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=ED(this.options);e.data!==void 0&&(this.setState(TD(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=eD(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(LE).catch(LE):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>VE(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===rD||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>VE(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!BE(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=iD(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?bD(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=vD({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof _D&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof _D){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...wD(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...TD(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),pD.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function wD(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:gD(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function TD(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ED(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var DD=class extends lD{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),kD(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return AD(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return AD(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof VE(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!YE(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&jD(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||VE(this.options.enabled,this.#t)!==VE(t.enabled,this.#t)||VE(this.options.staleTime,this.#t)!==VE(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||VE(this.options.enabled,this.#t)!==VE(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return YE(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(LE)),t}#h(e){return!cD()&&VE(this.options.enabled,this.#t)!==!1&&zE(e)}#g(){this.#b();let e=VE(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=BE(this.#r.dataUpdatedAt,e)+1;this.#u=PE.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return VE(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=PE.setInterval(()=>{(this.options.refetchIntervalInBackground||uD.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(PE.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(PE.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&kD(e,t),o=i&&jD(e,n,t,r);(a||o)&&(l={...l,...wD(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=eD(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=eD(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:MD(e,t),refetch:this.refetch,isEnabled:VE(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),YE(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();pD.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function OD(e,t){return VE(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||VE(t.retryOnMount,e)!==!1)}function kD(e,t){return OD(e,t)||e.state.data!==void 0&&AD(e,t,t.refetchOnMount)}function AD(e,t,n){if(VE(t.enabled,e)!==!1&&VE(t.staleTime,e)!==`static`){let r=VE(n,e);return r===`always`||r!==!1&&MD(e,t)}return!1}function jD(e,t,n,r){return(e!==t||VE(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&MD(e,n)}function MD(e,t){return VE(t.enabled,e)!==!1&&e.isStaleByTime(VE(t.staleTime,e))}var ND=class extends yD{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||PD(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=vD({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),pD.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function PD(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var FD=class extends lD{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new ND({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=ID(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=ID(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=ID(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=ID(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){pD.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>UE(t,e))}findAll(e={}){return this.getAll().filter(t=>UE(e,t))}notify(e){pD.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return pD.batch(()=>Promise.all(e.map(e=>e.continue().catch(LE))))}};function ID(e){return e.options.scope?.id}var LD=class extends lD{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),YE(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&GE(t.mutationKey)!==GE(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??PD();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){pD.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},RD=class extends lD{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??WE(r,t),a=this.get(i);return a||(a=new CD({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){pD.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>HE(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>HE(e,t)):t}notify(e){pD.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){pD.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){pD.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},zD=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new RD,this.#t=e.mutationCache||new FD,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=uD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=mD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(VE(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=RE(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return pD.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;pD.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return pD.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=pD.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(LE).catch(LE)}invalidateQueries(e,t={}){return pD.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=pD.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(LE)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(LE)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(VE(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(VE(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(LE).catch(LE)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(LE).catch(LE)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return mD.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(GE(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{KE(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(GE(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{KE(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=WE(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===rD&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},BD=F.createContext(!1),VD=()=>F.useContext(BD);BD.Provider;function HD(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var UD=F.createContext(HD()),WD=()=>F.useContext(UD),GD=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?aD(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},KD=e=>{F.useEffect(()=>{e.clearReset()},[e])},qD=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||aD(n,[e.error,r])),JD=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},YD=(e,t)=>e?.suspense&&t.isPending,XD=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ZD(e,t,n){let r=VD(),i=WD(),a=jE(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,JD(o),GD(o,i,s),KD(i);let[l]=F.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(F.useSyncExternalStore(F.useCallback(e=>{let t=d?l.subscribe(pD.batchCalls(e)):LE;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),F.useEffect(()=>{l.setOptions(o)},[o,l]),YD(o,u))throw XD(o,l,i);if(qD({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function QD(e,t){return ZD(e,DD,t)}function $D(e,t){let n=jE(t);return tO({filters:{...e,status:`pending`}},n).length}function eO(e,t){return e.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}function tO(e={},t){let n=jE(t).getMutationCache(),r=F.useRef(e),i=F.useRef(null);return i.current===null&&(i.current=eO(n,e)),F.useEffect(()=>{r.current=e}),F.useSyncExternalStore(F.useCallback(e=>n.subscribe(()=>{let t=JE(i.current,eO(n,r.current));i.current!==t&&(i.current=t,pD.schedule(e))}),[n]),()=>i.current,()=>i.current)}function nO(e,t){let n=jE(t),[r]=F.useState(()=>new LD(n,e));F.useEffect(()=>{r.setOptions(e)},[r,e]);let i=F.useSyncExternalStore(F.useCallback(e=>r.subscribe(pD.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=F.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(LE)},[r]);if(i.error&&aD(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function rO(e,t){let n=new Set;for(let t of e)iO(t,n);let r=new Map;return t.map(e=>{let t=new Set;iO(e,t);let i=new Map;for(let e of t){if(!n.has(e))continue;let r=2;for(;n.has(`${e}_${r}`)||t.has(`${e}_${r}`);)r++;i.set(e,`${e}_${r}`)}for(let[e,t]of i)r.set(e,t);let a=i.size===0&&r.size===0?e:aO(e,i,r);return iO(a,n),a})}function iO(e,t){for(let n of[`id`,`as`]){let r=e.step[n];typeof r==`string`&&t.add(r)}if(e.kind===`bracket`){for(let n of e.children)iO(n,t);let n=e.elseChildren??[];for(let e of n)iO(e,t)}}function aO(e,t,n){let r={...e.step};for(let e of[`id`,`as`]){let n=r[e];typeof n==`string`&&t.has(n)&&(r[e]=t.get(n))}for(let e of[`over`,`from`]){let t=r[e];typeof t==`string`&&n.has(t)&&(r[e]=n.get(t))}return e.kind===`card`?{...e,step:r}:{...e,step:r,children:e.children.map(e=>aO(e,t,n)),...e.elseChildren!==void 0&&{elseChildren:e.elseChildren.map(e=>aO(e,t,n))}}}var oO=`value`,sO=`items`,cO=`item`;function lO(e,t,n=oO){return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:n,selector:e.selector,kind:`css`,...e.take!==`text`&&{take:e.take}}}}function uO(e,t,n={}){let r=n.id??oO,i=e.jsonpath===void 0?`xpath`:`jsonpath`,a=e.jsonpath??e.xpath;if(a===void 0)throw Error(`documentReadCardNode: the node has neither a jsonpath nor an xpath`);if(n.generalize===!0&&e.listPath===void 0)throw Error(`documentReadCardNode: this node has no list to generalise to (it is not part of an array or a repeated sibling group)`);let o=n.generalize===!0?e.listPath:a,s=i===`xpath`&&n.namespaces!==void 0&&Object.keys(n.namespaces).length>0?n.namespaces:void 0;return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:r,selector:o,kind:i,...n.generalize===!0&&{many:!0},...s!==void 0&&{namespaces:s}}}}function dO(e,t){if(e.jsonpath===void 0)throw Error(`paginateFromNextNode: pagination reads a JSON/YAML "next" value (node.jsonpath)`);return{kind:`bracket`,path:t,stepType:`paginate`,sentence:[],children:[],step:{type:`paginate`,next:{jsonpath:e.jsonpath},steps:[]}}}function fO(e,t,n={}){let r=n.itemsId??sO,i=n.itemAlias??cO,a=n.fieldId??oO,o=xO(t);return[{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:r,selector:e.item.selector,kind:`css`,take:`html`,many:!0}},{kind:`bracket`,path:o,stepType:`forEach`,sentence:[],children:[{kind:`card`,path:`${o}.steps.0`,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:a,from:i,selector:e.field.selector,kind:`css`,...e.field.take!==`text`&&{take:e.field.take}}}],step:{type:`forEach`,over:r,as:i,emit:!0,steps:[]}}]}function pO(e){if(e.jsonpath===void 0||e.listPath===void 0)return;let t=e.listPath.lastIndexOf(`[*]`);if(t===-1)return;let n=e.listPath.slice(t+3);return{items:e.listPath.slice(0,t+3),field:n===``?`$`:`$${n}`}}function mO(e,t,n,r){return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:r,from:n,selector:e,kind:`jsonpath`,take:`json`}}}function hO(e,t){let n=pO(e);if(n===void 0)return;let r=xO(t);return[{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:sO,selector:n.items,kind:`jsonpath`,take:`json`,many:!0}},{kind:`bracket`,path:r,stepType:`forEach`,sentence:[],children:[mO(n.field,`${r}.steps.0`,cO,oO)],step:{type:`forEach`,over:sO,as:cO,emit:!0,steps:[]}}]}function gO(e,t){let n=pO(t);if(n===void 0)return;let r=e.find(e=>e.kind===`card`&&e.step.type===`extract`&&e.step.kind===`jsonpath`&&e.step.selector===n.items&&e.step.many===!0),i=e.findIndex(e=>e.kind===`bracket`&&e.stepType===`forEach`&&e.step.over===r?.step.id),a=e[i];if(r===void 0||a?.kind!==`bracket`)return;let[o]=rO(e,[mO(n.field,`${a.path}.steps.${a.children.length}`,String(a.step.as),oO)]);return e.map((e,t)=>t===i?{...a,children:[...a.children,o]}:e).map((e,t)=>bO(e,`steps.${t}`))}function _O(e){let t=e[e.length-1];return t?.kind===`card`&&t.stepType===`emit`?e.length-1:e.length}function vO(e,t,n){let r=rO(t===void 0?e:e.filter((e,n)=>n!==t),n),i=_O(e),a=t===void 0?[...e.slice(0,i),...r,...e.slice(i)]:[...e.slice(0,t),...r,...e.slice(t+1)];return(r.some(e=>e.kind===`bracket`&&e.stepType===`forEach`&&e.step.emit===!0)&&yO(a[a.length-1])?a.slice(0,-1):a).map((e,t)=>bO(e,`steps.${t}`))}function yO(e){return e?.kind===`card`&&e.stepType===`emit`}function bO(e,t){return e.kind===`card`?{...e,path:t}:{...e,path:t,children:e.children.map((e,n)=>bO(e,`${t}.steps.${n}`))}}function xO(e){let t=e.split(`.`),n=Number(t[t.length-1]);return[...t.slice(0,-1),String(n+1)].join(`.`)}function SO(e){let t=0;for(let n of e)t=Math.trunc(t*31+(n.codePointAt(0)??0));return`hsl(${Math.abs(t)%360}, 65%, 42%)`}function CO(e){return e.kind===`bracket`}function wO(e,t){if(t===``)return e.steps;let[n,r]=t.split(`::`,2),i=kO(e.steps,n);return i===void 0?[]:r===`else`?i.elseChildren??[]:i.children}function TO(e,t,n){if(t===``)return{...e,steps:n};let[r,i]=t.split(`::`,2);return{...e,steps:DO(e.steps,r,i,n)}}function EO(e,t,n){return{...e,steps:OO(e.steps,t,n)}}function DO(e,t,n,r){return e.map(e=>CO(e)?e.path===t?n===`else`?{...e,elseChildren:r}:{...e,children:r}:{...e,children:DO(e.children,t,n,r),elseChildren:e.elseChildren===void 0?void 0:DO(e.elseChildren,t,n,r)}:e)}function OO(e,t,n){return e.map(e=>e.path===t?n(e):CO(e)?{...e,children:OO(e.children,t,n),elseChildren:e.elseChildren===void 0?void 0:OO(e.elseChildren,t,n)}:e)}function kO(e,t){for(let n of e){if(!CO(n))continue;if(n.path===t)return n;let e=kO(n.children,t);if(e!==void 0)return e;if(n.elseChildren!==void 0){let e=kO(n.elseChildren,t);if(e!==void 0)return e}}}function AO(e){if(e===``)return`steps`;let[t,n]=e.split(`::`,2);return`${t}.${n===`else`?`else`:`steps`}`}function jO(e,t){if(e!==void 0&&t!==void 0)return MO(e.steps,t)}function MO(e,t){for(let n of e){if(n.step.id===t)return n;if(!CO(n))continue;let e=MO(n.children,t);if(e!==void 0)return e;if(n.elseChildren!==void 0){let e=MO(n.elseChildren,t);if(e!==void 0)return e}}}function NO(e){return e===void 0?[]:PO(e.steps)}function PO(e){return e.flatMap(e=>CO(e)?[e,...PO(e.children),...PO(e.elseChildren??[])]:[e])}function FO(e,t){return e.filter(e=>{if(e.path===t)return!0;if(!e.path.startsWith(`${t}.`))return!1;let n=e.path.slice(t.length+1);return!n.startsWith(`steps.`)&&!n.startsWith(`else.`)})}function IO(e){return new URLSearchParams(globalThis.location.search).get(e)??void 0}async function LO(e,t){let n=await fetch(`/api/command?token=${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),r=await n.json();if(!n.ok)throw Error(RO(r,n.status));return r}function RO(e,t){return typeof e==`object`&&e&&`error`in e?String(e.error):`request failed: ${t}`}function zO(){let e=IO(`token`)??``;return{token:e,initialFolder:IO(`folder`),initialOpen:IO(`open`),openPath:(t,n)=>LO(e,{type:`open-path`,path:t,...n!==void 0&&{workspace:n}}),openWorkspace:t=>LO(e,{type:`open-workspace`,folder:t}),chooseFolder:async()=>(await LO(e,{type:`choose-folder`})).folder,importDocument:(t,n,r)=>LO(e,{type:`import-document`,folder:t,name:n,bytes:r}),runSample:async(t,n,r)=>{await LO(e,{type:`run-sample`,recipeId:t,budget:n,...r!==void 0&&{stubs:r}})},stopRun:async()=>{await LO(e,{type:`stop-run`})},saveRecipe:async(t,n)=>{await LO(e,{type:`save-recipe`,path:t,recipe:n})},saveOutline:async(t,n)=>{await LO(e,{type:`save-outline`,path:t,outline:n})},fetchStartPage:async t=>(await LO(e,{type:`fetch-start-page`,recipeId:t})).html,takeSnapshot:(t,n)=>LO(e,{type:`take-snapshot`,recipeId:t,path:n}),verifySelector:(t,n,r)=>LO(e,{type:`verify-selector`,recipeId:t,path:n,selector:r}),inferSelector:(t,n,r)=>LO(e,{type:`infer-selector`,recipeId:t,path:n,nodeIds:r}),explainWhy:t=>LO(e,{type:`explain-why`,target:t}),inspectPage:(t,n)=>LO(e,{type:`inspect-page`,recipeId:t,path:n}),responsesSeen:(t,n)=>LO(e,{type:`responses-seen`,recipeId:t,path:n}),documentTree:(t,n)=>LO(e,{type:`document-tree`,recipeId:t,path:n}),pdfView:(t,n)=>LO(e,{type:`pdf-view`,recipeId:t,path:n}),tablePreview:(t,n,r)=>LO(e,{type:`table-preview`,recipeId:t,path:n,options:r}),regionPreview:(t,n,r)=>LO(e,{type:`region-preview`,recipeId:t,path:n,selector:r}),pdfBytesUrl:(t,n)=>`/api/pdf-bytes?token=${encodeURIComponent(e)}&recipeId=${encodeURIComponent(t)}&path=${encodeURIComponent(n)}`,gridView:(t,n,r)=>LO(e,{type:`grid-view`,recipeId:t,path:n,delimiter:r?.delimiter,encoding:r?.encoding}),gridPreview:(t,n,r)=>LO(e,{type:`grid-preview`,recipeId:t,path:n,options:r}),deckView:(t,n)=>LO(e,{type:`deck-view`,recipeId:t,path:n}),deckPreview:(t,n,r)=>LO(e,{type:`deck-preview`,recipeId:t,path:n,options:r}),startRecording:t=>LO(e,{type:`start-recording`,recipeId:t}),stopRecording:()=>LO(e,{type:`stop-recording`}),subscribe:t=>{let n=globalThis.location.protocol===`https:`?`wss`:`ws`,r=new WebSocket(`${n}://${globalThis.location.host}/ws?token=${encodeURIComponent(e)}`);return r.addEventListener(`message`,e=>{t(JSON.parse(String(e.data)))}),()=>{r.close()}}}}function BO(){return(0,F.useMemo)(()=>zO(),[])}function VO(){return new zD({defaultOptions:{queries:{retry:!1},mutations:{retry:!1}}})}function HO(e){return[`workspace`,e]}function UO(e){let t=BO();return QD({queryKey:HO(e),queryFn:()=>t.openWorkspace(e),enabled:e!==void 0})}var WO=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},GO=(e=>e?WO(e):WO),KO=e=>e;function qO(e,t=KO){let n=F.useSyncExternalStore(e.subscribe,F.useCallback(()=>t(e.getState()),[e,t]),F.useCallback(()=>t(e.getInitialState()),[e,t]));return F.useDebugValue(n),n}var JO=e=>{let t=GO(e),n=e=>qO(t,e);return Object.assign(n,t),n},YO=(e=>e?JO(e):JO),XO={folder:``,editorTab:`steps`,showHidden:!1},K=YO((e,t)=>({...XO,setFolder:t=>{e({folder:t})},commitFolder:t=>{e({folder:t,openFolder:t})},selectRecipe:t=>{e({selectedRecipeId:t})},setEditorTab:t=>{e({editorTab:t})},startPicking:(t,n)=>{e({pickTarget:{recipeId:t,stepPath:n}})},stopPicking:()=>{e({pickTarget:void 0})},registerPick:n=>{let r=t().pickTarget;if(r?.firstNodeId===void 0)return e({pickTarget:{...r??{recipeId:``,stepPath:``},firstNodeId:n}}),{kind:`first`};let i=r.firstNodeId;return e({pickTarget:void 0}),{kind:`second`,firstNodeId:i}},setShowHidden:t=>{e({showHidden:t})},setHoveredNodeId:t=>{e({hoveredNodeId:t})},setHoveredStepId:t=>{e({hoveredStepId:t})}}));K.getState();var ZO={running:!1,records:[],rejected:[],traceLines:[]},QO=YO(e=>({...ZO,startRun:()=>{e({running:!0,records:[],rejected:[],traceLines:[],error:void 0})},appendTraceLine:t=>{e(e=>({traceLines:[...e.traceLines,t]}))},appendRecord:t=>{e(e=>({records:[...e.records,t]}))},appendRejected:t=>{e(e=>({rejected:[...e.rejected,t]}))},finishRun:t=>{e(t===void 0?{running:!1}:{running:!1,error:t})},setError:t=>{e({error:t})}}));QO.getState();var $O={active:!1,cards:[],notes:[]},ek=YO(e=>({...$O,startRecording:(t,n)=>{e({active:!0,recipeId:t,startUrl:n,cards:[],notes:[],stoppedSteps:void 0,error:void 0})},addCard:t=>{e(e=>({cards:[...e.cards,t]}))},addNote:t=>{e(e=>({notes:[...e.notes,t]}))},recordingStopped:t=>{e({active:!1,stoppedSteps:t})},dismissStopped:()=>{e({stoppedSteps:void 0,cards:[],notes:[]})},failStart:t=>{e({active:!1,error:t})},setError:t=>{e({error:t})}}));ek.getState();function tk(){let e=K(e=>e.openFolder),t=K(e=>e.selectedRecipeId);return UO(e).data?.recipes.find(e=>e.id===t)}function nk(){return UO(K(e=>e.openFolder)).data?.recipes.filter(e=>e.kind===`input`)??[]}function rk(){let e=BO(),t=jE();return nO({mutationFn:({path:t,recipe:n})=>e.saveRecipe(t,n),onSuccess:()=>{t.invalidateQueries({queryKey:[`workspace`]})}})}function ik(){let e=BO();return nO({mutationFn:({folder:t,name:n,bytes:r})=>e.importDocument(t,n,r)})}function ak(){let e=BO(),t=jE();return nO({mutationFn:({path:t,outline:n})=>e.saveOutline(t,n),onSuccess:()=>{t.invalidateQueries({queryKey:[`workspace`]})}})}function ok(){let e=BO(),t=QO(e=>e.startRun),n=QO(e=>e.finishRun),r=QO(e=>e.setError);return nO({mutationFn:({recipeId:t,budget:n,stubs:r})=>e.runSample(t,n,r),onMutate:()=>{t()},onError:e=>{n(),r(e instanceof Error?e.message:String(e))}})}function sk(){let e=BO();return nO({mutationFn:()=>e.stopRun()})}function ck(){let e=BO(),t=jE(),n=QO(e=>e.appendTraceLine),r=QO(e=>e.appendRecord),i=QO(e=>e.appendRejected),a=QO(e=>e.finishRun),o=ek(e=>e.addCard),s=ek(e=>e.addNote),c=ek(e=>e.recordingStopped);(0,F.useEffect)(()=>e.subscribe(e=>{switch(e.type){case`trace-line`:n(e.line);break;case`record`:r({key:e.key,data:e.data,scope:e.scope,mapping:e.mapping});break;case`record-rejected`:i({field:e.field,reason:e.reason,scope:e.scope});break;case`run-finished`:a(e.error);break;case`recording-card`:o({node:e.node,secret:e.secret});break;case`recording-note`:s({kind:e.kind,message:e.message,selector:e.kind===`next-link`?lk():void 0});break;case`recording-stopped`:c(e.steps),t.invalidateQueries({queryKey:[`snapshot`]});break;case`workspace-changed`:t.invalidateQueries({queryKey:[`workspace`]}),t.invalidateQueries({queryKey:[`snapshot`]})}}),[e,t,n,r,i,a,o,s,c])}function lk(){let e=ek.getState().cards,t=e[e.length-1];if(t===void 0||t.node.kind!==`card`||t.node.stepType!==`click`)return;let n=t.node.step.selector;return typeof n==`string`?n:void 0}function uk(e,t){let n=BO();return QD({queryKey:[`snapshot`,e,t],queryFn:()=>n.takeSnapshot(e,t),enabled:e!==void 0&&t!==void 0})}function dk(){let e=BO();return nO({mutationFn:({recipeId:t,path:n,nodeIds:r})=>e.inferSelector(t,n,r)})}function fk(){let e=BO();return nO({mutationFn:t=>e.explainWhy(t)})}function pk(e,t,n=!0){let r=BO();return QD({queryKey:[`inspect-page`,e,t],queryFn:()=>r.inspectPage(e,t),enabled:n&&e!==void 0&&t!==void 0})}function mk(){let e=BO();return nO({mutationFn:({recipeId:t,path:n})=>e.responsesSeen(t,n)})}function hk(e,t,n=!0){let r=BO();return QD({queryKey:[`document-tree`,e,t],queryFn:()=>r.documentTree(e,t),enabled:n&&e!==void 0&&t!==void 0})}function gk(e,t,n=!0){let r=BO();return QD({queryKey:[`pdf-view`,e,t],queryFn:()=>r.pdfView(e,t),enabled:n&&e!==void 0&&t!==void 0})}function _k(e,t,n){let r=BO();return QD({queryKey:[`table-preview`,e,t,n],queryFn:()=>r.tablePreview(e,t,n),enabled:e!==void 0&&t!==void 0&&n!==void 0})}function vk(e,t,n){let r=BO();return QD({queryKey:[`region-preview`,e,t,n],queryFn:()=>r.regionPreview(e,t,n),enabled:e!==void 0&&t!==void 0&&n!==void 0,placeholderData:e=>e})}function yk(e,t,n=!0,r){let i=BO();return QD({queryKey:[`grid-view`,e,t,r],queryFn:()=>i.gridView(e,t,r),enabled:n&&e!==void 0&&t!==void 0})}function bk(e,t,n){let r=BO();return QD({queryKey:[`grid-preview`,e,t,n],queryFn:()=>r.gridPreview(e,t,n),enabled:e!==void 0&&t!==void 0&&n!==void 0})}function xk(e,t,n=!0){let r=BO();return QD({queryKey:[`deck-view`,e,t],queryFn:()=>r.deckView(e,t),enabled:n&&e!==void 0&&t!==void 0})}function Sk(e,t,n){let r=BO();return QD({queryKey:[`deck-preview`,e,t,n],queryFn:()=>r.deckPreview(e,t,n),enabled:e!==void 0&&t!==void 0&&n!==void 0})}function Ck(){let e=BO(),t=ek(e=>e.startRecording),n=ek(e=>e.failStart);return nO({mutationFn:async({recipeId:t})=>{await e.startRecording(t)},onMutate:({recipeId:e,startUrl:n})=>{t(e,n)},onError:e=>{n(e instanceof Error?e.message:String(e))}})}function wk(){let e=BO();return nO({mutationFn:async()=>{await e.stopRecording()}})}function Tk(e){return typeof e==`object`?e.key:e}function Ek(e,t){let n=e.length;return new Proxy(e,{get(e,r,i){if(typeof r==`string`){let i=r.charCodeAt(0);if(i>=48&&i<=57){let i=+r;if(Number.isInteger(i)&&i>=0&&i<n){let n=e[i];if(typeof n!=`object`){let r=t[i*2];n=e[i]={index:i,key:n,start:r,size:t[i*2+1],end:r+t[i*2+1],lane:0}}return n}}if(r===`length`)return n}return Reflect.get(e,r,i)}})}function Dk(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function Ok(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var kk=(e,t)=>Math.abs(e-t)<1.01,Ak=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})},jk,Mk=()=>{if(jk!==void 0)return jk;if(typeof navigator>`u`)return jk=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return jk=!0;let e=navigator.maxTouchPoints;return jk=navigator.platform===`MacIntel`&&e!==void 0&&e>0},Nk=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Pk=e=>e,Fk=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},Ik=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(Nk(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(Nk(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},Lk={passive:!0},Rk=typeof window>`u`||`onscrollend`in window,zk=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&Rk,o=0,s=a?null:Ak(i,()=>t(n(r),!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,Lk),a&&r.addEventListener(`scrollend`,u,Lk),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},Bk=(e,t)=>zk(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),Vk=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},Hk=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})};function Uk(e,t,n,r){if(t===0)return!1;let i=r(0),a=new Set,o=0;for(;o<e;){let e=n(o);if(e===i)break;a.add(e),o++}let s=e-o;if(s===0||s>=t)return!1;for(let e=0;e<s;e++)if(r(e)!==n(o+e))return!1;for(let e=s;e<t;e++)if(a.has(r(e)))return!1;return!0}var Wk=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.isIndexInRange(n)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Pk,rangeExtractor:Fk,onChange:()=>{},measureElement:Vk,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=this._singleLaneMeasurements?.items??s,l=e=>Tk(c[e]),u=e>0?l(0):null,d=e>0?l(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==u||t.getItemKey(o-1)!==d)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>0&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==d)&&(o>e||Uk(e,o,l,t.getItemKey))&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:a,getItemKey:c}=this.options,l=0;for(;l<a&&c(l)!==e;)l++;if(l<a){let e=n[l];if(e){let n=Math.max(0,e.start+t);!i&&n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=Dk(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,Mk()&&this.targetWindow!=null&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,Lk),e.addEventListener(`touchend`,n,Lk),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(Mk()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this.scrollState?.behavior===`smooth`&&!kk(this.getScrollOffset()-i,this.scrollState.lastTargetOffset)||this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;let{target:e,maxAtWrite:t}=this._clampedAdjustment,n=this.getMaxScrollOffset();n>t+.5&&(this._clampedAdjustment=e>n+.5?{target:e,maxAtWrite:n}:null,this._scrollToOffset(e,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;if(this._iosDeferredAdjustment<0&&e>=t-1){this._iosDeferredAdjustment=0;return}let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Dk(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=Dk(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._singleLaneMeasurements?.flat;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e}let o=u===0?Array(e):this._singleLaneMeasurements.items.slice(),c;if(u===0)c=t+n;else{let e=u-1;c=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t);o[t]=e;let n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=c,a[t*2+1]=i,c+=i+s}this._singleLaneMeasurements={flat:a,items:o};let d=Ek(o,a);return this.measurementsCache=d,d}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Dk(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=qk(e,t,n,r,r===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Dk(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(!this.isIndexInRange(e))return;let n,r,i,a=this._singleLaneMeasurements?.flat;if(this.options.lanes===1&&a!=null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=this.itemSizeCache.get(i)??n,s=t-o;if(s!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,c=a?this.getTotalSize():0,l=this.getScrollOffset()+this.scrollAdjustments,u=this.itemSizeCache.has(i)?r+o<=l&&this.scrollDirection!==`backward`:r<l,d=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?u:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},s,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++;let f=!1;a?f=this.applyScrollAdjustment(this.getTotalSize()-c):d&&(f=this.applyScrollAdjustment(s)),this.notify(f),this._retryClampedAdjustment()}},this.getVirtualItems=Dk(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._singleLaneMeasurements?.flat,r=this.options.lanes===1&&n!=null;return Ok(t[Gk(0,t.length-1,r?e=>n[e*2]:e=>Ok(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0;let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0,e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._singleLaneMeasurements?.flat;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){if(e===0)return!1;if(Mk()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=e,!1;{let n=this.getScrollOffset()+this.scrollAdjustments+e,r=this.scrollElement,i=r!==null&&(`scrollHeight`in r||`document`in r)?this.getMaxScrollOffset():null;return this._clampedAdjustment=i!==null&&n>i+.5?{target:n,maxAtWrite:i}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&kk(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},Gk=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function Kk(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function qk(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=Kk(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=Gk(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var Jk=typeof document<`u`?F.useLayoutEffect:F.useEffect;function Yk({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=F.useReducer(e=>e+1,0)[1],a=F.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=F.useRef(!1),s=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}},c=e=>{let t=a.current;if(!t.enabled||!t.container)return;s(e);let n=!!e.options.horizontal,r=t.mode===`transform`,i=n?`left`:`top`,o=e.options.scrollMargin,c=e.getVirtualItems();for(let a of c){let s=a.start-o,c=e.elementsCache.get(a.key);c&&t.lastPositions.get(c)!==s&&(t.lastPositions.set(c,s),r?c.style.transform=n?`translate3d(${s}px, 0, 0)`:`translate3d(0, ${s}px, 0)`:c.style[i]=`${s}px`)}},l={...r,onChange:(t,n)=>{var s;let l=a.current,u=!0;if(l.enabled){c(t);let e=t.range,n=l.prevRange;u=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,u&&(l.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}u&&(e&&n&&!o.current?(0,et.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[u]=F.useState(()=>{let e=new Wk(l),t=e.measureElement;return e.measureElement=e=>{o.current=!0;try{t(e)}finally{o.current=!1}},Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return u.setOptions(l),Jk(()=>u._didMount(),[]),Jk(()=>(s(u),u._willUpdate())),Jk(()=>{c(u)}),u}function Xk(e){return Yk({observeElementRect:Ik,observeElementOffset:Bk,scrollToFn:Hk,...e})}function Zk(e,t,n=``,r=!1){let i=n.trim().toLowerCase();return i===``?Qk(e,t,0,r):$k(e,i,0,r).rows}function Qk(e,t,n,r){if(!r&&e.hidden)return[];let i=t.has(e.nodeId),a={key:e.nodeId,node:e,depth:n,hasChildren:e.children.length>0,expanded:i};return i?[a,...e.children.flatMap(e=>Qk(e,t,n+1,r))]:[a]}function $k(e,t,n,r){if(!r&&e.hidden)return{rows:[],matched:!1};let i=e.children.map(e=>$k(e,t,n+1,r));return!i.some(e=>e.matched)&&!eA(e,t)?{rows:[],matched:!1}:{rows:[{key:e.nodeId,node:e,depth:n,hasChildren:e.children.length>0,expanded:!0},...i.flatMap(e=>e.rows)],matched:!0}}function eA(e,t){return e.tag.toLowerCase().includes(t)||e.id?.toLowerCase().includes(t)===!0||e.classes?.some(e=>e.toLowerCase().includes(t))===!0||e.text?.toLowerCase().includes(t)===!0?!0:Object.values(e.attributes).some(e=>e.toLowerCase().includes(t))}var tA=3;function nA({row:e,highlightColor:t,hovered:n,onToggle:r,onHover:i,onClick:a,onContextMenu:o}){let{node:s,depth:c,hasChildren:l,expanded:u}=e,d=Object.entries(s.attributes).slice(0,tA),f=Object.keys(s.attributes).length-d.length;return(0,I.jsxs)(G,{gap:1,pl:`${c*14+4}px`,pr:2,h:`22px`,fontSize:`xs`,fontFamily:`mono`,opacity:s.hidden?.5:1,bg:n?`bg.emphasized`:void 0,style:t===void 0?void 0:{boxShadow:`inset 3px 0 0 ${t}`},cursor:`pointer`,whiteSpace:`nowrap`,overflow:`hidden`,onMouseEnter:()=>{i(!0)},onMouseLeave:()=>{i(!1)},onClick:a,onContextMenu:o,children:[l?(0,I.jsx)(H,{as:`button`,w:`12px`,flexShrink:0,color:`fg.muted`,onClick:e=>{e.stopPropagation(),r()},children:u?`▾`:`▸`}):(0,I.jsx)(L,{w:`12px`,flexShrink:0}),(0,I.jsx)(H,{as:`span`,color:`purple.fg`,children:`<${s.tag}`}),s.id!==void 0&&(0,I.jsx)(H,{as:`span`,color:`blue.fg`,children:`#${s.id}`}),s.classes?.map(e=>(0,I.jsx)(H,{as:`span`,color:`teal.fg`,children:`.${e}`},e)),d.map(([e,t])=>(0,I.jsx)(H,{as:`span`,color:`fg.muted`,children:`${e}="${t}"`},e)),f>0&&(0,I.jsx)(H,{as:`span`,color:`fg.muted`,children:`…+${f}`}),(0,I.jsx)(H,{as:`span`,color:`purple.fg`,children:`>`}),s.text!==void 0&&s.text!==``&&(0,I.jsx)(H,{as:`span`,color:`fg.muted`,truncate:!0,children:s.text}),s.repeatCount!==void 0&&(0,I.jsx)(Aw,{size:`xs`,colorPalette:`gray`,children:`×${s.repeatCount}`})]})}var rA=22,iA=20;function aA({tree:e,showHidden:t,query:n,expanded:r,onToggle:i,nodeColors:a,hoveredNodeId:o,onHoverNode:s,onPickNode:c,onContextMenuNode:l}){let u=(0,F.useRef)(null),d=Zk(e,r,n,t),f=Xk({count:d.length,getScrollElement:()=>u.current,estimateSize:()=>rA,overscan:iA});return(0,I.jsx)(L,{ref:u,h:`full`,overflow:`auto`,children:(0,I.jsx)(L,{h:`${f.getTotalSize()}px`,position:`relative`,children:f.getVirtualItems().map(e=>{let t=d[e.index];return t===void 0?null:(0,I.jsx)(L,{position:`absolute`,top:0,left:0,w:`full`,style:{transform:`translateY(${e.start}px)`},children:(0,I.jsx)(nA,{row:t,highlightColor:a.get(t.node.nodeId),hovered:o===t.node.nodeId,onToggle:()=>{i(t.node.nodeId)},onHover:e=>{s(e?t.node.nodeId:void 0)},onClick:()=>{c(t.node.nodeId)},onContextMenu:e=>{e.preventDefault(),l(t.node,e.clientX,e.clientY)}})},t.key)})})})}function oA({node:e,x:t,y:n,onClose:r,onChoose:i}){let a=(0,F.useRef)(null);(0,F.useEffect)(()=>{let e=e=>{a.current!==null&&!a.current.contains(e.target)&&r()},t=e=>{e.key===`Escape`&&r()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]);let o=Object.keys(e.attributes);return(0,I.jsxs)(L,{ref:a,position:`fixed`,top:`${n}px`,left:`${t}px`,zIndex:1e3,bg:`bg.panel`,borderWidth:`1px`,borderRadius:`md`,boxShadow:`lg`,py:1,minW:`190px`,fontSize:`sm`,children:[(0,I.jsx)(sA,{label:`Read as text`,onClick:()=>{i({kind:`take`,take:`text`})}}),(0,I.jsx)(sA,{label:`Read as html`,onClick:()=>{i({kind:`take`,take:`html`})}}),(0,I.jsx)(sA,{label:`Read as json`,onClick:()=>{i({kind:`take`,take:`json`})}}),o.length>0&&(0,I.jsxs)(L,{borderTopWidth:`1px`,mt:1,pt:1,children:[(0,I.jsx)(H,{px:3,py:`2px`,fontSize:`xs`,color:`fg.muted`,children:`As an attribute`}),o.map(e=>(0,I.jsx)(sA,{label:e,onClick:()=>{i({kind:`take`,take:`attr:${e}`})}},e))]}),(0,I.jsx)(L,{borderTopWidth:`1px`,mt:1,pt:1,children:(0,I.jsx)(sA,{label:`Regex on its text…`,onClick:()=>{i({kind:`regex`})}})})]})}function sA({label:e,onClick:t}){return(0,I.jsx)(H,{as:`button`,display:`block`,w:`full`,textAlign:`left`,px:3,py:`4px`,_hover:{bg:`bg.emphasized`},onClick:t,children:e})}var cA=`data-oc-node`;function lA(e,t){if(t.trim()===``)return new Set;try{let n=new DOMParser().parseFromString(e,`text/html`).querySelectorAll(t);return new Set(Array.from(n,e=>e.getAttribute(cA)).filter(e=>e!==null))}catch{return new Set}}function uA({findings:e,onPick:t}){return e.length===0?(0,I.jsx)(L,{p:3,color:`fg.muted`,fontSize:`sm`,children:`No JSON-LD, inline state, meta or link data found in this page.`}):(0,I.jsx)(kE,{align:`stretch`,gap:0,fontSize:`sm`,overflow:`auto`,h:`full`,children:e.map(e=>(0,I.jsxs)(L,{borderBottomWidth:`1px`,px:3,py:2,children:[(0,I.jsxs)(G,{justify:`space-between`,gap:2,children:[(0,I.jsx)(H,{fontWeight:`medium`,truncate:!0,children:e.label}),(0,I.jsx)(H,{as:`button`,flexShrink:0,fontSize:`xs`,color:`blue.fg`,onClick:()=>{t(e,void 0)},children:e.keys===void 0?`Read`:`Read whole value`})]}),e.keys!==void 0&&e.keys.length>0&&(0,I.jsx)(G,{wrap:`wrap`,gap:1,mt:1,children:e.keys.map(n=>(0,I.jsx)(H,{as:`button`,fontSize:`xs`,px:2,py:`1px`,borderRadius:`full`,borderWidth:`1px`,onClick:()=>{t(e,n)},children:n},n))})]},`${e.kind}-${e.selector}`))})}var dA=`data`;function fA(e,t,n,r=dA){if(e.kind===`meta`||e.kind===`link`)return[{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:r,selector:e.selector,kind:`css`,take:`attr:${e.attribute??`content`}`}}];let i={kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:r,selector:e.selector,kind:`css`}};return n===void 0?[i]:[i,{kind:`card`,path:pA(t),stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:`${r}_${n}`,from:r,selector:`$.${n}`,kind:`jsonpath`}}]}function pA(e){let t=e.split(`.`),n=Number(t[t.length-1]);return[...t.slice(0,-1),String(n+1)].join(`.`)}function mA({responses:e,loading:t,error:n,onCheck:r,onPick:i}){return(0,I.jsxs)(kE,{align:`stretch`,gap:2,p:3,fontSize:`sm`,overflow:`auto`,h:`full`,children:[(0,I.jsx)(H,{as:`button`,alignSelf:`flex-start`,colorPalette:`blue`,color:`colorPalette.fg`,fontWeight:`medium`,opacity:t?.6:1,pointerEvents:t?`none`:void 0,onClick:r,children:t?`Checking…`:`Check for JSON responses`}),n!==void 0&&(0,I.jsx)(H,{color:`red.fg`,children:n}),e!==void 0&&e.length===0&&(0,I.jsx)(H,{color:`fg.muted`,children:`No JSON responses seen while the page rendered.`}),e?.map(e=>(0,I.jsxs)(L,{borderWidth:`1px`,borderRadius:`md`,p:2,children:[(0,I.jsx)(H,{fontWeight:`medium`,truncate:!0,title:e.url,children:e.url}),(0,I.jsx)(H,{color:`fg.muted`,fontSize:`xs`,children:`${e.status} · ${e.size} bytes · ${e.shape}`}),(0,I.jsx)(H,{as:`button`,fontSize:`xs`,color:`blue.fg`,mt:1,onClick:()=>{i(e)},children:`Switch to api mode on this endpoint`})]},e.url))]})}var hA=`response`;function gA(e,t){return{mode:`api`,start:[{url:_A(e.url,t)}],steps:[{type:`request`,id:hA,url:`{{start.url}}`,as:`json`}]}}function _A(e,t){let n=new URL(e),r=new Map(Object.entries(t??{}).map(([e,t])=>[String(t),e])),i=[...n.searchParams].map(([e,t])=>{let n=r.get(t);return`${e}=${n===void 0?encodeURIComponent(t):`{{vars.${n}}}`}`});return`${n.origin}${n.pathname}${i.length===0?``:`?${i.join(`&`)}`}`}var vA=`start`,yA=`#dd6b20`;function bA({recipeId:e,recipe:t,snapshot:n,onSaveOutline:r,onSaveRecipe:i}){let[a,o]=(0,F.useState)(`tree`),[s,c]=(0,F.useState)(``),[l,u]=(0,F.useState)(!1),[d,f]=(0,F.useState)(()=>new Set),[p,m]=(0,F.useState)(void 0),[h,g]=(0,F.useState)(void 0),_=K(e=>e.hoveredStepId),v=K(e=>e.hoveredNodeId),y=K(e=>e.setHoveredNodeId),b=(0,F.useMemo)(()=>{let e=jO(t?.outline,_)?.step.selector;return typeof e==`string`?e:void 0},[t?.outline,_]),x=pk(e,vA,n!==void 0),S=dk(),C=mk(),w=(0,F.useMemo)(()=>{let e=new Map;if(n===void 0)return e;let r=t?.outline?.steps??[];for(let t of r){if(t.kind!==`card`)continue;let r=t.step;if(r.type===`extract`&&r.kind===`css`&&typeof r.id==`string`&&typeof r.selector==`string`)for(let t of lA(n.html,r.selector))e.set(t,SO(r.id))}if(b!==void 0&&b!==``)for(let t of lA(n.html,b))e.set(t,yA);return e},[n,t,b]);(0,F.useEffect)(()=>{f(new Set)},[e]),(0,F.useEffect)(()=>{x.data!==void 0&&f(e=>{if(e.size>0)return e;let t=x.data.tree,n=new Set([t.nodeId]),[r]=t.children;return r!==void 0&&t.children.length===1&&n.add(r.nodeId),n})},[x.data]);function T(e){f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function E(e){if(r===void 0||t?.outline===void 0)return;let n=vO(t.outline.steps,void 0,e);await r(t.file,{...t.outline,steps:n})}async function D(t,n){if(e===void 0)return;let r=await S.mutateAsync({recipeId:e,path:vA,nodeIds:[t]});if(r.kind!==`field`){g(r.kind===`unsupported`?r.reason:void 0);return}let i=n===void 0?r.field:{...r.field,take:n};await E([lO(i,`steps.0`)]),g(`Read card: ${i.selector}`)}async function ee(t){if(e===void 0)return;let n=await S.mutateAsync({recipeId:e,path:vA,nodeIds:[t]});if(n.kind!==`field`)return;let r=`text`;await E([lO({...n.field,take:`text`},`steps.0`,r),{kind:`card`,path:`steps.1`,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:`${r}_match`,from:r,selector:``,kind:`regex`}}]),g(`Read card: ${n.field.selector} → regex (fill the pattern in its form)`)}async function O(e,t){await E(fA(e,`steps.0`,t)),g(`Read card: ${e.selector}${t===void 0?``:` → $.${t}`}`)}async function k(e){if(i===void 0||t===void 0)return;let n;try{n=JSON.parse(t.text)}catch{g(`The recipe's JSON does not parse; fix it in the JSON tab first`);return}let r=gA(e,xA(n.vars)?n.vars:void 0);await i(t.file,{...n,...r}),g(`Switched to api mode: ${r.start[0].url}`)}function A(e){if(p===void 0)return;let t=p.node.nodeId;m(void 0),e.kind===`regex`?ee(t):D(t,e.take)}return(0,I.jsxs)(L,{h:`full`,display:`flex`,flexDirection:`column`,children:[(0,I.jsxs)(G,{px:2,py:1,borderBottomWidth:`1px`,gap:2,flexShrink:0,children:[(0,I.jsx)(SA,{label:`Tree`,active:a===`tree`,onClick:()=>{o(`tree`)}}),(0,I.jsx)(SA,{label:`Data in page`,active:a===`data`,count:x.data?.pageData.length,onClick:()=>{o(`data`)}}),(0,I.jsx)(SA,{label:`Responses`,active:a===`responses`,count:C.data?.responses.length,onClick:()=>{o(`responses`)}})]}),a===`tree`&&(0,I.jsxs)(G,{px:2,py:1,borderBottomWidth:`1px`,gap:2,flexShrink:0,children:[(0,I.jsx)(DT,{size:`xs`,placeholder:`Search by tag, class or text…`,value:s,onChange:e=>{c(e.target.value)}}),(0,I.jsx)(H,{as:`button`,fontSize:`xs`,color:l?`colorPalette.fg`:`fg.muted`,colorPalette:`orange`,whiteSpace:`nowrap`,onClick:()=>{u(e=>!e)},children:l?`Hide hidden`:`Show hidden`})]}),h!==void 0&&(0,I.jsx)(L,{px:2,py:`2px`,fontSize:`xs`,color:`fg.muted`,borderBottomWidth:`1px`,flexShrink:0,children:h}),(0,I.jsxs)(L,{flex:`1`,minH:`0`,position:`relative`,children:[a===`tree`&&x.data!==void 0&&(0,I.jsx)(aA,{tree:x.data.tree,showHidden:l,query:s,expanded:d,onToggle:T,nodeColors:w,hoveredNodeId:v,onHoverNode:y,onPickNode:e=>{D(e)},onContextMenuNode:(e,t,n)=>{m({node:e,x:t,y:n})}}),a===`tree`&&x.isFetching&&(0,I.jsx)(L,{p:3,color:`fg.muted`,fontSize:`sm`,children:`Inspecting…`}),a===`data`&&(0,I.jsx)(uA,{findings:x.data?.pageData??[],onPick:(e,t)=>{O(e,t)}}),a===`responses`&&(0,I.jsx)(mA,{responses:C.data?.responses,loading:C.isPending,error:C.error?.message,onCheck:()=>{e!==void 0&&C.mutate({recipeId:e,path:vA})},onPick:e=>{k(e)}}),p!==void 0&&(0,I.jsx)(oA,{node:p.node,x:p.x,y:p.y,onClose:()=>{m(void 0)},onChoose:A})]})]})}function xA(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function SA({label:e,active:t,count:n,onClick:r}){return(0,I.jsxs)(G,{as:`button`,gap:1,px:2,py:`2px`,borderRadius:`sm`,fontSize:`xs`,fontWeight:t?`semibold`:`normal`,color:t?`fg`:`fg.muted`,bg:t?`bg.emphasized`:void 0,onClick:r,children:[(0,I.jsx)(H,{as:`span`,children:e}),n!==void 0&&(0,I.jsx)(Aw,{size:`xs`,children:n})]})}var CA=`application/x-opencraw-card`;function wA(e){return JSON.stringify(e)}function TA(e){let t=e.getData(CA);if(t!==``)try{let e=JSON.parse(t);return e.kind===`card`||e.kind===`bracket`?e:void 0}catch{return}}function EA(e){return[...e.types].includes(CA)}var DA=(0,F.createContext)(void 0),OA=`myHook`;function kA(){return(0,F.useContext)(DA)}function AA({value:e,onChange:t,onCommit:n,size:r=`sm`,ariaLabel:i}){let a=kA(),o=()=>{n?.()};if(a===void 0||a.length===0)return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(DT,{size:r,"aria-label":i,value:e,onChange:e=>{t(e.target.value)},onBlur:o}),(0,I.jsx)(H,{fontSize:`xs`,color:`fg.muted`,children:a===void 0?"Studio has no hooks loaded: restart it with `opencraw studio --hooks <file>` to pick from a list.":`The hooks file exports no hooks.`})]});let s=e!==``&&!a.includes(e);return(0,I.jsx)(PT,{size:r,children:(0,I.jsxs)(IT,{"aria-label":i,value:e,onChange:e=>{t(e.target.value),o()},children:[(0,I.jsx)(`option`,{value:``,disabled:!0,children:`(choose a hook)`}),s&&(0,I.jsx)(`option`,{value:e,children:`${e} (not in the loaded hooks)`}),a.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})})}var jA=[{label:`Go to`,stepType:`goto`,bracket:!1},{label:`Read`,stepType:`extract`,bracket:!1},{label:`Loop`,stepType:`forEach`,bracket:!0},{label:`Next page`,stepType:`paginate`,bracket:!0},{label:`If`,stepType:`if`,bracket:!0},{label:`Fill form`,stepType:`fill`,bracket:!1},{label:`Click`,stepType:`click`,bracket:!1},{label:`Set`,stepType:`set`,bracket:!1},{label:`Collect`,stepType:`collect`,bracket:!1},{label:`Hook`,stepType:`hook`,bracket:!1},{label:`Emit`,stepType:`emit`,bracket:!1}];function MA(e,t=OA){switch(e){case`goto`:return{type:`goto`,url:``};case`extract`:return{type:`extract`,id:`value`,selector:``,kind:`css`};case`forEach`:return{type:`forEach`,as:`item`,over:``,steps:[]};case`paginate`:return{type:`paginate`,next:{selector:``},steps:[]};case`if`:return{type:`if`,test:``,steps:[]};case`fill`:return{type:`fill`,selector:``,value:``};case`click`:return{type:`click`,selector:``};case`set`:return{type:`set`,id:`value`,value:``};case`collect`:return{type:`collect`,into:``,value:``};case`hook`:return{type:`hook`,name:t};case`emit`:return{type:`emit`};default:return{type:e}}}var NA=[`forEach`,`paginate`,`if`];function PA(e,t,n=OA){let r=MA(e,n),i=[{kind:`word`,text:jA.find(t=>t.stepType===e)?.label??e}],a=NA.find(t=>t===e);return a===void 0?{kind:`card`,path:t,stepType:e,sentence:i,step:r,custom:!1}:{kind:`bracket`,path:t,stepType:a,sentence:i,step:r,children:[]}}function FA({onAdd:e,ariaLabel:t}){return(0,I.jsx)(PT,{size:`xs`,width:`9em`,variant:`outline`,children:(0,I.jsxs)(IT,{"aria-label":t,value:``,onChange:t=>{let n=t.target.value;n!==``&&e(n),t.target.value=``},children:[(0,I.jsx)(`option`,{value:``,disabled:!0,children:`+ Add step`}),jA.map(e=>(0,I.jsx)(`option`,{value:e.stepType,children:e.label},e.stepType))]})})}var IA=`application/x-opencraw-pill`;function LA({name:e,draggable:t=!0}){let n=t?t=>{t.dataTransfer.setData(IA,e),t.dataTransfer.setData(`text/plain`,e),t.dataTransfer.effectAllowed=`copy`}:void 0;return(0,I.jsx)(H,{as:`span`,display:`inline-block`,px:2,py:`1px`,borderRadius:`full`,fontSize:`xs`,fontWeight:`medium`,color:`white`,bg:SO(e),draggable:t,cursor:t?`grab`:void 0,onDragStart:n,children:e})}var RA=/^\{\{env\.[A-Za-z_]\w*\}\}$/;function zA({parts:e}){return(0,I.jsx)(G,{gap:1,wrap:`wrap`,fontSize:`sm`,children:e.map((e,t)=>{let n=`${t}:${e.kind}:${e.text}`;return e.kind===`pill`?(0,I.jsx)(LA,{name:e.text},n):e.kind===`code`&&RA.test(e.text)?(0,I.jsx)(BA,{placeholder:e.text},n):e.kind===`code`?(0,I.jsx)(H,{as:`code`,fontFamily:`mono`,fontSize:`xs`,bg:`bg.muted`,px:1,borderRadius:`sm`,children:e.text},n):(0,I.jsx)(H,{color:`fg.muted`,children:e.text},n)})})}function BA({placeholder:e}){let t=e.slice(6,-2);return(0,I.jsx)(H,{as:`span`,display:`inline-block`,px:2,py:`1px`,borderRadius:`full`,fontSize:`xs`,fontFamily:`mono`,fontWeight:`medium`,color:`red.fg`,bg:`red.subtle`,borderWidth:`1px`,borderColor:`red.muted`,title:`Never the real value — set the ${t} environment variable before running this recipe.`,children:e})}function VA({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function HA(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var UA=[],WA=0,{link:GA,unlink:KA,propagate:qA,checkDirty:JA,shallowPropagate:YA}=VA({update(e){return e._update()},notify(e){UA[ZA++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,tj(e))}}),XA=0,ZA=0,QA,$A=0;function ej(e){try{++$A,e()}finally{--$A||nj()}}function tj(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=KA(n,e)}function nj(){if(!($A>0)){for(;XA<ZA;){let e=UA[XA];UA[XA++]=void 0,e.notify()}XA=0,ZA=0}}function rj(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return QA!==void 0&&GA(i,QA,WA),i._snapshot},subscribe(e){let t=HA(e),n={current:!1},r=ij(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=QA,o=t?.compare??Object.is;if(n)QA=i,++WA,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{QA=a,n&&(i.flags&=-5),tj(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&JA(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&YA(e)}}else e&32&&(i.flags=e&-33);return QA!==void 0&&GA(i,QA,WA),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(qA(e),YA(e),nj())}},i}function ij(e){let t=()=>{let t=QA;QA=n,++WA,n.depsTail=void 0,n.flags=6;try{return e()}finally{QA=t,n.flags&=-5,tj(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&JA(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,tj(this)}};return t(),n}var aj=class{constructor(e,t){this.atom=rj(e),this.get=this.get.bind(this),this.setState=this.setState.bind(this),this.subscribe=this.subscribe.bind(this),t&&(this.actions=t(this))}setState(e){this.atom.set(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(HA(e))}},oj=class{constructor(e){this.atom=rj(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(HA(e))}};function sj(e,t){return typeof e==`function`?new oj(e):t?new aj(e,t):new aj(e)}var cj=class{constructor(e,t){this.fn=e,this.options=t,this.lastExecutionTime=0,this.isPending=!1,this.maybeExecute=(...e)=>{let t=Date.now()-this.lastExecutionTime;if(this.options.leading&&t>=this.options.wait)this.execute(...e);else if(this.lastArgs=e,!this.timeoutId&&this.options.trailing){let e=this.options.wait-t;this.isPending=!0,this.timeoutId=setTimeout(()=>{this.lastArgs!==void 0&&this.execute(...this.lastArgs)},e)}},this.execute=(...e)=>{this.fn(...e),this.options.onExecute?.(e,this),this.lastExecutionTime=Date.now(),this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.flush=()=>{this.isPending&&this.lastArgs&&this.execute(...this.lastArgs)},this.cancel=()=>{this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.clearTimeout=()=>{this.timeoutId&&=(clearTimeout(this.timeoutId),void 0)},this.options.leading===void 0&&this.options.trailing===void 0&&(this.options.leading=!0,this.options.trailing=!0)}};function lj(e,t){return new cj(e,t).maybeExecute}var uj=class{#e=!0;#t;#n;#r;#i;#a;#o;#s;#c=0;#l=5;#u=!1;#d=!1;#f=null;#p=()=>{this.debugLog(`Connected to event bus`),this.#a=!0,this.#u=!1,this.debugLog(`Emitting queued events`,this.#i),this.#i.forEach(e=>this.emitEventToBus(e)),this.#i=[],this.stopConnectLoop(),this.#n().removeEventListener(`tanstack-connect-success`,this.#p)};#m=()=>{if(this.#c<this.#l){this.#c++,this.dispatchCustomEvent(`tanstack-connect`,{});return}this.#n().removeEventListener(`tanstack-connect`,this.#m),this.#d=!0,this.debugLog(`Max retries reached, giving up on connection`),this.stopConnectLoop()};#h=()=>{this.#u||(this.#u=!0,this.#n().addEventListener(`tanstack-connect-success`,this.#p),this.#m())};constructor({pluginId:e,debug:t=!1,enabled:n=!0,reconnectEveryMs:r=300}){this.#t=e,this.#e=n,this.#n=this.getGlobalTarget,this.#r=t,this.debugLog(` Initializing event subscription for plugin`,this.#t),this.#i=[],this.#a=!1,this.#d=!1,this.#o=null,this.#s=r}startConnectLoop(){this.#o!==null||this.#a||(this.debugLog(`Starting connect loop (every ${this.#s}ms)`),this.#o=setInterval(this.#m,this.#s))}stopConnectLoop(){this.#u=!1,this.#o!==null&&(clearInterval(this.#o),this.#o=null,this.#i=[],this.debugLog(`Stopped connect loop`))}debugLog(...e){this.#r&&console.log(`🌴 [tanstack-devtools:${this.#t}-plugin]`,...e)}getGlobalTarget(){if(typeof globalThis<`u`&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog(`Using global event target`),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<`u`&&window.addEventListener!==void 0)return this.debugLog(`Using window as event target`),window;let e=typeof EventTarget<`u`?new EventTarget:void 0;return e===void 0||e.addEventListener===void 0?(this.debugLog(`No event mechanism available, running in non-web environment`),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog(`Using new EventTarget as fallback`),e)}getPluginId(){return this.#t}dispatchCustomEventShim(e,t){try{let n=new Event(e,{detail:t});this.#n().dispatchEvent(n)}catch{this.debugLog(`Failed to dispatch shim event`)}}dispatchCustomEvent(e,t){try{this.#n().dispatchEvent(new CustomEvent(e,{detail:t}))}catch{this.dispatchCustomEventShim(e,t)}}emitEventToBus(e){this.debugLog(`Emitting event to client bus`,e),this.dispatchCustomEvent(`tanstack-dispatch-event`,e)}createEventPayload(e,t){return{type:`${this.#t}:${e}`,payload:t,pluginId:this.#t}}emit(e,t){if(!this.#e){this.debugLog(`Event bus client is disabled, not emitting event`,e,t);return}if(this.#f&&(this.debugLog(`Emitting event to internal event target`,e,t),this.#f.dispatchEvent(new CustomEvent(`${this.#t}:${e}`,{detail:this.createEventPayload(e,t)}))),this.#d){this.debugLog(`Previously failed to connect, not emitting to bus`);return}if(!this.#a){this.debugLog(`Bus not available, will be pushed as soon as connected`),this.#i.push(this.createEventPayload(e,t)),typeof CustomEvent<`u`&&!this.#u&&(this.#h(),this.startConnectLoop());return}return this.emitEventToBus(this.createEventPayload(e,t))}on(e,t,n){let r=n?.withEventTarget??!1,i=`${this.#t}:${e}`;if(r&&(this.#f||=new EventTarget,this.#f.addEventListener(i,e=>{t(e.detail)})),!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`,i),()=>{};let a=e=>{this.debugLog(`Received event from bus`,e.detail),t(e.detail)};return this.#n().addEventListener(i,a),this.debugLog(`Registered event to bus`,i),()=>{r&&this.#f?.removeEventListener(i,a),this.#n().removeEventListener(i,a)}}onAll(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}onAllPluginEvents(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;this.#t&&n.pluginId!==this.#t||e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}},dj=new class extends uj{constructor(){super({pluginId:`form-devtools`,reconnectEveryMs:1e3})}};function fj(e,t){return typeof e==`function`?e(t):e}function pj(e,t){return xj(t).reduce((e,t)=>{if(e===null)return null;if(e!==void 0)return e[t]},e)}function mj(e,t,n){let r=xj(t);function i(e){if(!r.length)return fj(n,e);let t=r.shift();if(typeof t==`string`||typeof t==`number`&&!Array.isArray(e))return typeof e==`object`?(e===null&&(e={}),{...e,[t]:i(e[t])}):{[t]:i()};if(Array.isArray(e)&&typeof t==`number`){let n=e.slice(0,t);return[...n.length?n:Array(t),i(e[t]),...e.slice(t+1)]}return[...Array(t),i()]}return i(e)}function hj(e,t){let n=xj(t);function r(e){if(!e)return;if(n.length===1){let t=n[0];if(Array.isArray(e)&&typeof t==`number`)return e.filter((e,n)=>n!==t);let{[t]:r,...i}=e;return i}let t=n.shift();if((typeof t==`string`||typeof t==`number`&&!Array.isArray(e))&&typeof e==`object`)return{...e,[t]:r(e[t])};if(typeof t==`number`&&Array.isArray(e)){if(t>=e.length)return e;let n=e.slice(0,t);return[...n.length?n:Array(t),r(e[t]),...e.slice(t+1)]}throw Error(`It seems we have created an infinite loop in deleteBy. `)}return r(e)}var gj=46,_j=91,vj=93,yj=48,bj=57;function xj(e){if(Array.isArray(e))return[...e];if(typeof e!=`string`)throw Error(`Path must be a string.`);let t=e.length,n=[],r=+(t>0&&e.charCodeAt(0)===_j),i=!0,a=-1;for(let o=r;o<=t;o++){let s=o<t?e.charCodeAt(o):-1;if(o===t||s===gj||s===_j||s===vj){let t=o-r;if(t>0){let a=i&&(t===1||e.charCodeAt(r)!==yj),s=e.slice(r,o);if(a){let e=parseInt(s,10);t<=15||String(e)===s?n.push(e):n.push(s)}else n.push(s)}else a!==vj&&(a!==-1||s!==vj)&&(a!==s||s!==gj&&s!==_j)&&n.push(``);r=o+1,i=!0}else(s<yj||s>bj)&&(i=!1);a=s}return n.length||n.push(``),n}function Sj(e){return!(Array.isArray(e)&&e.length===0)}function Cj(e,t){return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!1},runValidation:e=>e.validators.filter(Boolean).map(e=>({cause:e.cause,validate:e.fn}))})}function wj(e,t){let{asyncDebounceMs:n}=t,{onBlurAsyncDebounceMs:r,onChangeAsyncDebounceMs:i,onDynamicAsyncDebounceMs:a}=t.validators||{},o=n??0;return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!0},runValidation:t=>t.validators.filter(Boolean).map(t=>{let n=t?.cause||e,s=o;switch(n){case`change`:s=i??o;break;case`blur`:s=r??o;break;case`dynamic`:s=a??o;break;case`submit`:s=0}return e===`submit`&&(s=0),{cause:n,validate:t.fn,debounceMs:s}})})}var Tj=e=>!!e&&typeof e==`object`&&`fields`in e;function Ej(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||n.length===0&&!Array.isArray(e)&&!Array.isArray(t)&&(Object.getPrototypeOf(e)!==Object.prototype||Object.getPrototypeOf(t)!==Object.prototype))return!1;for(let i of n)if(!r.includes(i)||!Ej(e[i],t[i]))return!1;return!0}var Dj=({newFormValidatorError:e,isPreviousErrorFromFormValidator:t,previousErrorValue:n})=>e?{newErrorValue:e,newSource:`form`}:t?{newErrorValue:void 0,newSource:void 0}:n?{newErrorValue:n,newSource:`field`}:{newErrorValue:void 0,newSource:void 0},Oj=({formLevelError:e,fieldLevelError:t})=>t?{newErrorValue:t,newSource:`field`}:e?{newErrorValue:e,newSource:`form`}:{newErrorValue:void 0,newSource:void 0};function kj(e,t){return e==null?t:{...e,...t}}for(var Aj=256,jj=[],Mj;Aj--;)jj[Aj]=(Aj+256).toString(16).substring(1);function Nj(){let e=0,t,n=``;if(!Mj||Aj+16>256){for(Mj=Array(256),e=256;e--;)Mj[e]=256*Math.random()|0;e=0,Aj=0}for(;e<16;e++)t=Mj[Aj+e],n+=e===6?jj[t&15|64]:e===8?jj[t&63|128]:jj[t],e&1&&e>1&&e<11&&(n+=`-`);return Aj++,n}var Pj=lj(e=>dj.emit(`form-state`,{id:e.formId,state:e.store.state}),{wait:300});function Fj(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++)t[n]=Fj(e[n]);return t}if(e instanceof Map){let t=new Map;return e.forEach((e,n)=>{t.set(n,Fj(e))}),t}if(e instanceof Set){let t=new Set;return e.forEach(e=>{t.add(Fj(e))}),t}let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=Fj(e[n]));return t}function Ij(e,t){return t===e||t.startsWith(`${e}.`)||t.startsWith(`${e}[`)}var Lj=e=>{if(!e.validators)return e.runValidation({validators:[],form:e.form});let t=e.event.async,n=t?void 0:{fn:e.validators.onMount,cause:`mount`},r={fn:t?e.validators.onChangeAsync:e.validators.onChange,cause:`change`},i={fn:t?e.validators.onBlurAsync:e.validators.onBlur,cause:`blur`},a={fn:t?e.validators.onSubmitAsync:e.validators.onSubmit,cause:`submit`},o=t?void 0:{fn:()=>void 0,cause:`server`};switch(e.event.type){case`mount`:return e.runValidation({validators:[n],form:e.form});case`submit`:return e.runValidation({validators:[r,i,a,o],form:e.form});case`server`:return e.runValidation({validators:[],form:e.form});case`blur`:return e.runValidation({validators:[i,o],form:e.form});case`change`:return e.runValidation({validators:[r,o],form:e.form});default:throw Error(`Unknown validation event type: ${e.event.type}`)}};function Rj(e,t){let n=new Map;for(let r of e){let e=r.path??[],i=t,a=``;for(let t=0;t<e.length;t++){let n=e[t];if(n===void 0)continue;let r=typeof n==`object`?n.key:n,o=Number(r);a+=Array.isArray(i)&&!Number.isNaN(o)?`[${o}]`:(t>0?`.`:``)+String(r),i=typeof i==`object`&&i?i[r]:void 0}n.set(a,(n.get(a)??[]).concat(r))}return Object.fromEntries(n)}var zj=(e,t)=>{let n=Rj(e,t);return{form:n,fields:n}},Bj={validate({value:e,validationSource:t},n){let r=n[`~standard`].validate(e);if(r instanceof Promise)throw Error(`async function passed to sync validator`);if(r.issues)return t===`field`?r.issues:zj(r.issues,e)},async validateAsync({value:e,validationSource:t},n){let r=await n[`~standard`].validate(e);if(r.issues)return t===`field`?r.issues:zj(r.issues,e)}},Vj=e=>!!e&&`~standard`in e,Hj={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{},_arrayVersion:0,_pendingValidationsCount:0};function Uj(e){function t(t){let n=e.getFieldMeta(t)??Hj;e.setFieldMeta(t,{...n,_arrayVersion:(n._arrayVersion||0)+1})}function n(n,r,i){t(n);let a=s(n,r,`move`,i),c=Math.min(r,i),u=Math.max(r,i);for(let e=c;e<=u;e++)a.push(o(n,e));let d=Object.keys(e.fieldInfo).reduce((t,i)=>(i.startsWith(o(n,r))&&t.set(i,e.getFieldMeta(i)),t),new Map);l(a,r<i?`up`:`down`),Object.keys(e.fieldInfo).filter(e=>e.startsWith(o(n,i))).forEach(t=>{let a=t.replace(o(n,i),o(n,r)),s=d.get(a);s&&e.setFieldMeta(t,s)})}function r(e,n){t(e),l(s(e,n,`remove`),`up`)}function i(n,r,i){t(n),s(n,r,`swap`,i).forEach(t=>{if(!t.toString().startsWith(o(n,r)))return;let a=t.toString().replace(o(n,r),o(n,i)),[s,c]=[e.getFieldMeta(t),e.getFieldMeta(a)];s&&e.setFieldMeta(a,s),c&&e.setFieldMeta(t,c)})}function a(n,r){t(n);let i=s(n,r,`insert`);l(i,`down`),i.forEach(t=>{t.toString().startsWith(o(n,r))&&e.setFieldMeta(t,u())})}function o(e,t){return`${e}[${t}]`}function s(t,n,r,i){let a=[o(t,n)];switch(r){case`swap`:a.push(o(t,i));break;case`move`:{let[e,r]=[Math.min(n,i),Math.max(n,i)];for(let n=e;n<=r;n++)a.push(o(t,n));break}default:{let r=e.getFieldValue(t),i=Array.isArray(r)?r.length:0;for(let e=n+1;e<i;e++)a.push(o(t,e));break}}return Object.keys(e.fieldInfo).filter(e=>a.some(t=>e.startsWith(t)))}function c(e,t){return e.replace(/\[(\d+)\]/,(e,n)=>{let r=parseInt(n,10);return`[${t===`up`?r+1:Math.max(0,r-1)}]`})}function l(t,n){(n===`up`?t:[...t].reverse()).forEach(t=>{let r=c(t.toString(),n),i=e.getFieldMeta(r);i?e.setFieldMeta(t,i):e.setFieldMeta(t,u())})}let u=()=>Hj;return{bumpArrayVersion:t,handleArrayMove:n,handleArrayRemove:r,handleArraySwap:i,handleArrayInsert:a}}function Wj(e){return{values:e.values??{},errorMap:e.errorMap??{},fieldMetaBase:e.fieldMetaBase??{},formGroupStateBase:e.formGroupStateBase??{},isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}}}var Gj=class{constructor(e){this.options={},this.fieldInfo={},this.formGroupApis=new Set,this.mount=()=>{let e=this.store.subscribe(()=>{Pj(this)}),t=dj.on(`request-form-state`,e=>{e.payload.id===this._formId&&dj.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}),n=dj.on(`request-form-reset`,e=>{e.payload.id===this._formId&&this.reset()}),r=dj.on(`request-form-force-submit`,e=>{e.payload.id===this._formId&&(this._devtoolsSubmissionOverride=!0,this.handleSubmit(),this._devtoolsSubmissionOverride=!1)}),i=()=>{r(),n(),t(),e.unsubscribe(),dj.emit(`form-unmounted`,{id:this._formId})};this.options.listeners?.onMount?.({formApi:this});let{onMount:a}=this.options.validators||{};return dj.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options}),a&&this.validateSync(`mount`),i},this.update=e=>{if(!e)return;let t=this.options;this.options=e;let n=e.defaultValues&&!Ej(e.defaultValues,t.defaultValues)&&!this.state.isTouched,r=!Ej(e.defaultState,t.defaultState)&&!this.state.isTouched;if(n||r){if(ej(()=>{this.baseStore.setState(()=>Wj(Object.assign({},this.state,r?e.defaultState:{},n?{values:e.defaultValues}:{})))}),n){let e=Uj(this);for(let t of Object.keys(this.fieldInfo))Array.isArray(this.getFieldValue(t))&&e.bumpArrayVersion(t)}dj.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}},this.reset=(e,t)=>{let{fieldMeta:n}=this.state,r=this.resetFieldMeta(n);e&&!t?.keepDefaultValues&&(this.options={...this.options,defaultValues:e}),this.baseStore.setState(()=>{let t=e??this.options.defaultValues??this.options.defaultState?.values;return e||Object.values(this.fieldInfo).forEach(e=>{e.instance&&e.instance.options.defaultValue!==void 0&&(t=mj(t,e.instance.name,e.instance.options.defaultValue))}),Wj({...this.options.defaultState,values:t,fieldMetaBase:r})})},this.validateAllFields=async e=>{let t=[];return ej(()=>{Object.values(this.fieldInfo).forEach(n=>{if(!n.instance)return;let r=n.instance;t.push(Promise.resolve().then(()=>r.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.instance.store.state.meta.isTouched||n.instance.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null,a=[`${e}[${t}]`];for(let n=t+1;n<=(i??0);n++)a.push(`${e}[${n}]`);let o=Object.keys(this.fieldInfo).filter(e=>a.some(t=>e.startsWith(t))),s=[];return ej(()=>{o.forEach(e=>{s.push(Promise.resolve().then(()=>this.validateField(e,n)))})}),(await Promise.all(s)).flat()},this.validateField=(e,t)=>{let n=this.fieldInfo[e]?.instance;if(!n){let{hasErrored:n}=this.validateSync(t);return n&&!this.options.asyncAlways?this.getFieldMeta(e)?.errors??[]:this.validateAsync(t).then(()=>this.getFieldMeta(e)?.errors??[])}return n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0})),n.validate(t)},this.validateSync=(e,t)=>{let n=Cj(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||Lj}),r=!1,i={};return ej(()=>{for(let e of n){if(!e.validate)continue;let{formError:n,fieldErrors:a}=Kj(this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`},type:`validate`})),o=qj(e.cause),s=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(a||{})]);t?.filterFieldNames&&(s=new Set([...s].filter(t.filterFieldNames)));for(let e of s){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!a?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??Hj,r=a?.[e],{newErrorValue:s,newSource:c}=Dj({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[o]===`form`,previousErrorValue:t?.[o]});c===`form`&&(i[e]={...i[e],[o]:r}),t?.[o]!==s&&this.setFieldMeta(e,(e=Hj)=>({...e,errorMap:{...e.errorMap,[o]:s},errorSourceMap:{...e.errorSourceMap,[o]:c}}))}t?.dontUpdateFormErrorMap||this.state.errorMap?.[o]!==n&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:n}})),(n||a)&&(r=!0)}if(t?.dontUpdateFormErrorMap)return;let a=qj(`submit`);this.state.errorMap?.[a]&&e!==`submit`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[a]:void 0}}));let o=qj(`server`);this.state.errorMap?.[o]&&e!==`server`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:void 0}}))}),{hasErrored:r,fieldsErrorMap:i}},this.validateAsync=async(e,t)=>{let n=wj(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||Lj});this.state.isFormValidating||this.baseStore.setState(e=>({...e,isFormValidating:!0}));let r=[],i;for(let e of n){if(!e.validate)continue;let n=qj(e.cause);this.state.validationMetaMap[n]?.lastAbortController.abort();let a=new AbortController;this.state.validationMetaMap[n]={lastAbortController:a},r.push(new Promise(async n=>{let r;try{r=await new Promise((t,n)=>{setTimeout(async()=>{if(a.signal.aborted)return t(void 0);try{t(await this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`,signal:a.signal},type:`validateAsync`}))}catch(e){n(e)}},e.debounceMs)})}catch(e){r=e}let{formError:o,fieldErrors:s}=Kj(r);s&&(i=i?{...i,...s}:s);let c=qj(e.cause),l=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(i||{})]),u=Array.from(l);t?.filterFieldNames&&(u=u.filter(t.filterFieldNames));for(let e of u){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!i?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??Hj,r=i?.[e],{newErrorValue:a,newSource:o}=Dj({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[c]===`form`,previousErrorValue:t?.[c]});t?.[c]!==a&&this.setFieldMeta(e,(e=Hj)=>({...e,errorMap:{...e.errorMap,[c]:a},errorSourceMap:{...e.errorSourceMap,[c]:o}}))}t?.dontUpdateFormErrorMap||this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[c]:o}})),n(i?{fieldErrors:i,errorMapKey:c}:void 0)}))}let a=[],o={};if(r.length){a=await Promise.all(r);for(let e of a)if(e?.fieldErrors){let{errorMapKey:t}=e;for(let[n,r]of Object.entries(e.fieldErrors))o[n]={...o[n]||{},[t]:r}}}return this.baseStore.setState(e=>({...e,isFormValidating:!1})),o},this.validate=(e,t)=>{let{hasErrored:n,fieldsErrorMap:r}=this.validateSync(e,t);return n&&!this.options.asyncAlways?r:this.validateAsync(e,t)},this._handleSubmit=async e=>{this.baseStore.setState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),ej(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance&&(e.instance.store.state.meta.isTouched||e.instance.setMeta(e=>({...e,isTouched:!0})))})});let t=e??this.options.onSubmitMeta;if(!this.state.canSubmit&&!this._devtoolsSubmissionOverride&&this.baseStore.state.submissionAttempts<=1){this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t});return}this.baseStore.setState(e=>({...e,isSubmitting:!0}));let n=()=>{this.baseStore.setState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.state.isFieldsValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),dj.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validateAllFields`,errors:Object.values(this.state.fieldMeta).map(e=>e.errors).flat()});return}if(await this.validate(`submit`),!this.state.isValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),dj.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validate`,errors:this.state.errors});return}ej(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance?.triggerOnSubmitListener()})}),this.options.listeners?.onSubmit?.({formApi:this,meta:t});try{await this.options.onSubmit?.({value:this.state.values,formApi:this,meta:t}),ej(()=>{this.baseStore.setState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),dj.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!0}),n()})}catch(e){throw this.baseStore.setState(e=>({...e,isSubmitSuccessful:!1})),dj.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`inflight`,onError:e}),n(),e}},this.getFieldValue=e=>pj(this.state.values,e),this.getFieldMeta=e=>this.state.fieldMeta[e],this.getFormGroupMeta=e=>this.formGroupMetaDerived.state[e],this.getFieldInfo=e=>this.fieldInfo[e]||={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.setFieldMeta=(e,t)=>{this.baseStore.setState(n=>({...n,fieldMetaBase:{...n.fieldMetaBase,[e]:fj(t,n.fieldMetaBase[e])}}))},this.resetFieldMeta=e=>Object.keys(e).reduce((e,t)=>{let n=t;return e[n]=Hj,e},{}),this.setFieldValue=(e,t,n)=>{let r=n?.dontUpdateMeta??!1,i=n?.dontRunListeners??!1,a=n?.dontValidate??!1;ej(()=>{r||this.setFieldMeta(e,e=>({...e,isTouched:!0,isDirty:!0,errorMap:{...e?.errorMap,onMount:void 0}})),this.baseStore.setState(n=>({...n,values:mj(n.values,e,t)}))}),i||this.getFieldInfo(e).instance?.triggerOnChangeListener(),a||this.validateField(e,`change`)},this.deleteField=e=>{let t=[...Object.keys(this.fieldInfo).filter(t=>{let n=e.toString();return t.startsWith(`${n}.`)||t.startsWith(`${n}[`)}),e];this.baseStore.setState(e=>{let n={...e};return t.forEach(e=>{n.values=hj(n.values,e),delete this.fieldInfo[e],delete n.fieldMetaBase[e]}),n})},this.pushFieldValue=(e,t,n)=>{this.setFieldValue(e,e=>[...Array.isArray(e)?e:[],t],n),Uj(this).bumpArrayVersion(e)},this.insertFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>[...e.slice(0,t),n,...e.slice(t)],kj(r,{dontValidate:!0}));let i=r?.dontValidate??!1;i||await this.validateField(e,`change`),Uj(this).handleArrayInsert(e,t),i||await this.validateArrayFieldsStartingFrom(e,t,`change`)},this.replaceFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>e.map((e,r)=>r===t?n:e),kj(r,{dontValidate:!0})),Uj(this).bumpArrayVersion(e),(r?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.removeFieldValue=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null;if(this.setFieldValue(e,e=>e.filter((e,n)=>n!==t),kj(n,{dontValidate:!0})),Uj(this).handleArrayRemove(e,t),i!==null){let t=`${e}[${i}]`;this.deleteField(t)}(n?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.swapFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=e[t],i=e[n];return mj(mj(e,`${t}`,i),`${n}`,r)},kj(r,{dontValidate:!0})),Uj(this).handleArraySwap(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.moveFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=[...e];return r.splice(n,0,r.splice(t,1)[0]),r},kj(r,{dontValidate:!0})),Uj(this).handleArrayMove(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.clearFieldValues=(e,t)=>{let n=this.getFieldValue(e),r=Array.isArray(n)?Math.max(n.length-1,0):null;if(this.setFieldValue(e,[],kj(t,{dontValidate:!0})),Uj(this).bumpArrayVersion(e),r!==null)for(let t=0;t<=r;t++){let n=`${e}[${t}]`;this.deleteField(n)}(t?.dontValidate??!1)||this.validateField(e,`change`)},this.resetField=e=>{this.baseStore.setState(t=>{let n=this.getFieldInfo(e).instance?.options.defaultValue,r=pj(this.options.defaultValues,e),i=n??r;return{...t,fieldMetaBase:{...t.fieldMetaBase,[e]:Hj},values:i===void 0?t.values:mj(t.values,e,i)}})},this.setErrorMap=e=>{ej(()=>{Object.entries(e).forEach(([e,t])=>{let n=e;if(Tj(t)){let{formError:e,fieldErrors:r}=Kj(t);for(let e of Object.keys(this.fieldInfo))this.getFieldMeta(e)&&this.setFieldMeta(e,t=>({...t,errorMap:{...t.errorMap,[n]:r?.[e]},errorSourceMap:{...t.errorSourceMap,[n]:`form`}}));this.baseStore.setState(t=>({...t,errorMap:{...t.errorMap,[n]:e}}))}else this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[n]:t}}))})})},this.getAllErrors=()=>({form:{errors:this.state.errors,errorMap:this.state.errorMap},fields:Object.entries(this.state.fieldMeta).reduce((e,[t,n])=>(Object.keys(n).length&&n.errors.length&&(e[t]={errors:n.errors,errorMap:n.errorMap}),e),{})}),this.parseValuesWithSchema=e=>Bj.validate({value:this.state.values,validationSource:`form`},e),this.parseValuesWithSchemaAsync=e=>Bj.validateAsync({value:this.state.values,validationSource:`form`},e),this.timeoutIds={validations:{},listeners:{},formListeners:{}},this._formId=e?.formId??Nj(),this._devtoolsSubmissionOverride=!1;let t=Wj({...e?.defaultState,values:e?.defaultValues??e?.defaultState?.values});if(e?.transform){t=e.transform({state:t}).state;for(let e of Object.keys(t.errorMap)){let n=t.errorMap[e];if(n!==void 0&&Tj(n))for(let r of Object.keys(n.fields)){let i=n.fields[r];if(i===void 0)continue;let a=t.fieldMetaBase[r];t.fieldMetaBase[r]={isTouched:!1,isValidating:!1,isBlurred:!1,isDirty:!1,_arrayVersion:0,_pendingValidationsCount:0,...a??{},errorSourceMap:{...a?.errorSourceMap??{},onChange:`form`},errorMap:{...a?.errorMap??{},[e]:i}}}}}this.baseStore=sj(t);let n;this.fieldMetaDerived=sj(e=>{let t=this.baseStore.get(),r=0,i={};for(let a of Object.keys(t.fieldMetaBase)){let o=t.fieldMetaBase[a],s=n?.fieldMetaBase[a],c=e?.[a],l=pj(t.values,a),u=c?.errors;if(!s||o.errorMap!==s.errorMap){u=Object.values(o.errorMap??{}).filter(e=>e!==void 0);let e=this.getFieldInfo(a)?.instance;(!e||!e.options.disableErrorFlat)&&(u=u.flat(1))}let d=!Sj(u),f=!o.isDirty,p=Ej(l,this.getFieldInfo(a)?.instance?.options.defaultValue??pj(this.options.defaultValues,a));if(c&&c.isPristine===f&&c.isValid===d&&c.isDefaultValue===p&&c.errors===u&&o===s){i[a]=c,r++;continue}i[a]={...o,errors:u??[],isPristine:f,isValid:d,isDefaultValue:p}}return Object.keys(t.fieldMetaBase).length?e&&r===Object.keys(t.fieldMetaBase).length?e:(n=this.baseStore.get(),i):i}),this.formGroupMetaDerived=sj(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),r={};for(let i of this.formGroupApis){let a=i.name,o=t.formGroupStateBase[a]??{isSubmitted:!1,isSubmitting:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1},s=n[a],c=!1,l=!0,u=!1,d=!1,f=!0,p=!1;for(let e in n){if(e===a||!Ij(a,e))continue;let t=n[e];t&&(t.isValidating&&(c=!0),t.isValid||(l=!1),t.isTouched&&(u=!0),t.isBlurred&&(d=!0),t.isDefaultValue||(f=!1),t.isDirty&&(p=!0))}let m=!p,h=!!c||o.isValidating,g=s?.errorMap??{},_=s?.errorSourceMap??{},v=!!(g.onMount||Object.entries(n).some(([e,t])=>t&&e!==a&&Ij(a,e)&&t.errorMap.onMount)),y=e?.[a],b=y?.errors??[];(!y||y.__srcErrorMap!==g)&&(b=Object.values(g).reduce((e,t)=>{if(t===void 0)return e;if(t&&typeof t==`object`&&`fields`in t){let n=t.group;return n!==void 0&&e.push(n),e}return e.push(t),e},[]));let x=b.length===0,S=l&&x,C=i.options.canSubmitWhenInvalid??!1,w=o.submissionAttempts===0&&!u&&!v||!h&&!o.isSubmitting&&S||C;if(y&&y.errorMap===g&&y.errorSourceMap===_&&y.errors===b&&y.isFieldsValidating===c&&y.isFieldsValid===l&&y.isGroupValid===x&&y.isValid===S&&y.canSubmit===w&&y.isTouched===u&&y.isBlurred===d&&y.isPristine===m&&y.isDefaultValue===f&&y.isDirty===p&&y.isValidating===h&&y.isSubmitting===o.isSubmitting&&y.isSubmitted===o.isSubmitted&&y.submissionAttempts===o.submissionAttempts&&y.isSubmitSuccessful===o.isSubmitSuccessful){r[a]=y;continue}let T={...o,errorMap:g,errorSourceMap:_,_arrayVersion:s?._arrayVersion??0,isTouched:u,isBlurred:d,isDirty:p,isPristine:m,isDefaultValue:f,isValid:S,errors:b,isValidating:h,isFieldsValidating:c,isFieldsValid:l,isGroupValid:x,canSubmit:w};Object.defineProperty(T,"__srcErrorMap",{value:g,enumerable:!1,configurable:!0}),r[a]=T}return r});let r;this.store=sj(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),i=Object.values(n).filter(Boolean),a=i.some(e=>e.isValidating),o=i.every(e=>e.isValid),s=i.some(e=>e.isTouched),c=i.some(e=>e.isBlurred),l=i.every(e=>e.isDefaultValue),u=s&&t.errorMap?.onMount,d=i.some(e=>e.isDirty),f=!d,p=!!(t.errorMap?.onMount||i.some(e=>e?.errorMap?.onMount)),m=!!a,h=e?.errors??[];(!r||t.errorMap!==r.errorMap)&&(h=Object.values(t.errorMap).reduce((e,t)=>t===void 0?e:t&&Tj(t)?(e.push(t.form),e):(e.push(t),e),[]));let g=h.length===0,_=o&&g,v=this.options.canSubmitWhenInvalid??!1,y=t.submissionAttempts===0&&!s&&!p||!m&&!t.isSubmitting&&_||v,b=t.errorMap;if(u&&(h=h.filter(e=>e!==t.errorMap.onMount),b=Object.assign(b,{onMount:void 0})),e&&r&&e.errorMap===b&&e.fieldMeta===this.fieldMetaDerived.state&&e.errors===h&&e.isFieldsValidating===a&&e.isFieldsValid===o&&e.isFormValid===g&&e.isValid===_&&e.canSubmit===y&&e.isTouched===s&&e.isBlurred===c&&e.isPristine===f&&e.isDefaultValue===l&&e.isDirty===d&&Ej(r,t))return e;let x={...t,errorMap:b,fieldMeta:this.fieldMetaDerived.state,errors:h,isFieldsValidating:a,isFieldsValid:o,isFormValid:g,isValid:_,canSubmit:y,isTouched:s,isBlurred:c,isPristine:f,isDefaultValue:l,isDirty:d};return r=this.baseStore.get(),x}),this.handleSubmit=this.handleSubmit.bind(this),this.update(e||{})}get state(){return this.store.state}get formId(){return this._formId}runValidator(e){return Vj(e.validate)?Bj[e.type](e.value,e.validate):e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function Kj(e){return e?Tj(e)?{formError:Kj(e.form).formError,fieldErrors:e.fields}:{formError:e}:{formError:void 0}}function qj(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}var Jj=class e{constructor(t){this.options={},this.mount=()=>{this.options.defaultValue!==void 0&&!this.getMeta().isTouched&&this.form.setFieldValue(this.name,this.options.defaultValue,{dontUpdateMeta:!0});let e=this.getInfo();e.instance=this,this.update(this.options);let{onMount:t}=this.options.validators||{};if(t){let e=this.runValidator({validate:t,value:{value:this.state.value,fieldApi:this,validationSource:`field`},type:`validate`});e&&this.setMeta(t=>({...t,errorMap:{...t?.errorMap,onMount:e},errorSourceMap:{...t?.errorSourceMap,onMount:`field`}}))}return this.options.listeners?.onMount?.({value:this.state.value,fieldApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);let e=this.form.fieldInfo[this.name];if(e&&e.instance===this){for(let[t,n]of Object.entries(e.validationMetaMap))n?.lastAbortController.abort(),e.validationMetaMap[t]=void 0;this.form.baseStore.setState(e=>({...e,fieldMetaBase:{...e.fieldMetaBase,[this.name]:{...Hj,isTouched:e.fieldMetaBase[this.name]?.isTouched??Hj.isTouched,isBlurred:e.fieldMetaBase[this.name]?.isBlurred??Hj.isBlurred,isDirty:e.fieldMetaBase[this.name]?.isDirty??Hj.isDirty}}})),e.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,fieldApi:this}),this.form.options.listeners?.onFieldUnmount?.({formApi:this.form,fieldApi:this})}}},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(Ej(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,this.state.meta)},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,kj(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(e,t)=>{this.form.pushFieldValue(this.name,e,kj(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.insertValue=(e,t,n)=>{this.form.insertFieldValue(this.name,e,t,kj(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.replaceValue=(e,t,n)=>{this.form.replaceFieldValue(this.name,e,t,kj(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.removeValue=(e,t)=>{this.form.removeFieldValue(this.name,e,kj(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.swapValues=(e,t,n)=>{this.form.swapFieldValues(this.name,e,t,kj(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.moveValue=(e,t,n)=>{this.form.moveFieldValues(this.name,e,t,kj(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.clearValues=e=>{this.form.clearFieldValues(this.name,kj(e,{dontRunListeners:!0})),e?.dontRunListeners||this.triggerOnChangeListener()},this.getLinkedFields=t=>{let n=Object.values(this.form.fieldInfo),r=[];for(let i of n){if(!i.instance||!(i.instance instanceof e))continue;let{onChangeListenTo:n,onBlurListenTo:a}=i.instance.options.validators||{};t===`change`&&n?.includes(this.name)&&r.push(i.instance),t===`blur`&&a?.includes(this.name)&&r.push(i.instance)}return r},this.validateSync=(e,t)=>{let n=Cj(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||Lj}),r=this.getLinkedFields(e).reduce((t,n)=>{let r=Cj(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||Lj});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),i=!1;ej(()=>{let e=(e,n)=>{let r=Xj(n.cause),a=n.validate?Yj(e.runValidator({validate:n.validate,value:{value:e.store.state.value,validationSource:`field`,fieldApi:e},type:`validate`})):void 0,o=t[r],{newErrorValue:s,newSource:c}=Oj({formLevelError:o,fieldLevelError:a});e.state.meta.errorMap?.[r]!==s&&e.setMeta(e=>({...e,errorMap:{...e.errorMap,[r]:s},errorSourceMap:{...e.errorSourceMap,[r]:c}})),s&&(i=!0)};for(let t of n)e(this,t);for(let t of r)t.validate&&e(t.field,t)});let a=Xj(`submit`);return this.state.meta.errorMap?.[a]&&e!==`submit`&&!i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[a]:void 0},errorSourceMap:{...e.errorSourceMap,[a]:void 0}})),{hasErrored:i}},this.validateAsync=async(e,t)=>{let n=wj(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||Lj}),r=await t,i=this.getLinkedFields(e).reduce((t,n)=>{let r=wj(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||Lj});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),a=[],o=[],s=n.some(e=>e.validate),c=Array.from(new Set(i.filter(e=>e.validate).map(e=>e.field)));ej(()=>{s&&this.startValidation();for(let e of c)e.startValidation()});let l=(e,t,n)=>{let i=Xj(t.cause),a=e.getInfo();a.validationMetaMap[i]?.lastAbortController.abort();let o=new AbortController;a.validationMetaMap[i]={lastAbortController:o},n.push(new Promise(async n=>{let a;try{a=await new Promise((n,r)=>{e.timeoutIds.validations[t.cause]&&(clearTimeout(e.timeoutIds.validations[t.cause]),e.endValidation()),e.timeoutIds.validations[t.cause]=setTimeout(async()=>{if(o.signal.aborted)return n(void 0);try{n(await this.runValidator({validate:t.validate,value:{value:e.store.state.value,fieldApi:e,signal:o.signal,validationSource:`field`},type:`validateAsync`}))}catch(e){r(e)}},t.debounceMs)})}catch(e){a=e}if(o.signal.aborted)return n(void 0);let s=Yj(a),c=r[e.name]?.[i],{newErrorValue:l,newSource:u}=Oj({formLevelError:c,fieldLevelError:s});if(e.getInfo().instance!==e)return n(void 0);e.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:l},errorSourceMap:{...e.errorSourceMap,[i]:u}})),n(l)}))};for(let e of n)e.validate&&l(this,e,a);for(let e of i)e.validate&&l(e.field,e,o);let u=[];return(a.length||o.length)&&(u=await Promise.all(a),await Promise.all(o)),ej(()=>{s&&this.endValidation();for(let e of c)e.endValidation()}),u.filter(Boolean)},this.validate=(e,t)=>{if(!this.state.meta.isTouched)return[];let n=t?.skipGroupValidation?[]:Array.from(this.form.formGroupApis).filter(e=>this.name.startsWith(e.name)),r=(t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e)).fieldsErrorMap[this.name]??{};if(!t?.skipFormValidation)for(let t of n){if(t.state.meta.submissionAttempts===0)continue;let{fieldsErrorMap:n}=this.form.validateSync(e,{group:t,dontUpdateFormErrorMap:!0,filterFieldNames:e=>Ij(t.name,e)});r={...r,...n[this.name]??{}}}let{hasErrored:i}=this.validateSync(e,r),a=new WeakMap;for(let t of n){let{hasErrored:n}=t.validateSync(e,{},{skipRelatedFieldValidation:!0});a.set(t,n)}if(i&&!this.options.asyncAlways){this.getInfo().validationMetaMap[Xj(e)]?.lastAbortController.abort();let t=[];for(let r of n)r.getInfo().validationMetaMap[Xj(e)]?.lastAbortController.abort(),t.push(r.state.meta.errors);return[...this.state.meta.errors,...t.flat()]}let o=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e),s=this.validateAsync(e,o),c=[];for(let t of n)(!a.get(t)||t.options.asyncAlways)&&c.push(t.validateAsync(e,o,{skipRelatedFieldValidation:!0}));return c.length===0?s:Promise.all([s,...c]).then(e=>e.flat())},this.handleChange=e=>{this.setValue(e)},this.handleBlur=()=>{this.state.meta.isTouched||this.setMeta(e=>({...e,isTouched:!0})),this.state.meta.isBlurred||this.setMeta(e=>({...e,isBlurred:!0})),this.validate(`blur`),this.triggerOnBlurListener()},this.setErrorMap=e=>{this.setMeta(t=>({...t,errorMap:{...t.errorMap,...e}}))},this.parseValueWithSchema=e=>Bj.validate({value:this.state.value,validationSource:`field`},e),this.parseValueWithSchemaAsync=e=>Bj.validateAsync({value:this.state.value,validationSource:`field`},e),this.triggerOnBlurListener=()=>{let e=this.form.options.listeners?.onBlurDebounceMs;e&&e>0?(this.timeoutIds.formListeners.blur&&clearTimeout(this.timeoutIds.formListeners.blur),this.timeoutIds.formListeners.blur=setTimeout(()=>{this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onBlurDebounceMs;t&&t>0?(this.timeoutIds.listeners.blur&&clearTimeout(this.timeoutIds.listeners.blur),this.timeoutIds.listeners.blur=setTimeout(()=>{this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this});for(let e of this.form.formGroupApis)Ij(e.name,this.name)&&e.triggerOnChangeListener()},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,fieldApi:this})},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.store=sj(e=>{this.form.store.get();let n=this.form.getFieldMeta(this.name)??{...Hj,...t.defaultMeta},r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!Ej(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}})}get state(){return this.store.state}runValidator(e){return Vj(e.validate)?Bj[e.type](e.value,e.validate):e.validate(e.value)}startValidation(){this.setMeta(e=>{let t=e._pendingValidationsCount+1;return{...e,_pendingValidationsCount:t,isValidating:t>0&&!e.isValidating||e.isValidating}})}endValidation(){this.setMeta(e=>{let t=Math.max(0,e._pendingValidationsCount-1);return{...e,_pendingValidationsCount:t,isValidating:t===0&&e.isValidating?!1:e.isValidating}})}};function Yj(e){if(e)return e}function Xj(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function Zj(e){return{isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1}}function Qj(e){return{...Hj,...e,errors:[],isPristine:!0,isValid:!0,isDefaultValue:!0,isFieldsValidating:!1,isFieldsValid:!0,isGroupValid:!0,canSubmit:!0,isSubmitting:!1,isSubmitted:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1}}var $j=class e{constructor(t){this.options={},this.setFormGroupState=e=>{this.form.baseStore.setState(t=>{let n=t.formGroupStateBase[this.name]??Zj({});return{...t,formGroupStateBase:{...t.formGroupStateBase,[this.name]:e(n)}}})},this._lastDistributedFieldNames={},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(Ej(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,{...Hj,...this.options.defaultMeta})},this.mount=()=>{this.update(this.options),this.form.formGroupApis.add(this),this.fieldInfo.instance=this,this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:e.formGroupStateBase[this.name]??Zj({...this.options.defaultState})}}));let{onMount:e}=this.options.validators||{};if(e){let t=this.runValidator({validate:e,value:{value:this.state.value,groupApi:this,validationSource:`form`},type:`validate`}),n=t,r;tM(t)&&(n=t.group,r=t.fields);let i=eM(n);i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,onMount:i},errorSourceMap:{...e.errorSourceMap,onMount:`field`}})),this.distributeFieldErrors(`onMount`,r)}return this.options.listeners?.onMount?.({value:this.state.value,groupApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);if(this.fieldInfo.instance===this){for(let[e,t]of Object.entries(this.fieldInfo.validationMetaMap))t?.lastAbortController.abort(),this.fieldInfo.validationMetaMap[e]=void 0;this.form.formGroupApis.delete(this),this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:Zj({})}})),this.fieldInfo.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,groupApi:this})}}},this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,kj(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.fieldInfo,this.getRelatedFields=()=>{let e=Object.values(this.form.fieldInfo),t=[];for(let n of e)n.instance&&n.instance instanceof Jj&&n.instance.name.startsWith(this.name)&&t.push(n.instance);return t},this.getRelatedFieldMetasDerived=()=>{let e=Object.entries(this.form.fieldMetaDerived.state),t=[];for(let[n,r]of e)n!==this.name&&Ij(this.name,n)&&t.push({...r,name:n});return t},this.buildChildFieldName=e=>e===``?this.name:e.startsWith(`[`)?`${this.name}${e}`:`${this.name}.${e}`,this.distributeFieldErrors=(e,t)=>{let n=this._lastDistributedFieldNames[e]??new Set,r=new Set;if(t)for(let[e,n]of Object.entries(t))n!=null&&n!==!1&&r.add(this.buildChildFieldName(e));let i=new Set([...n,...r]),a=!1;for(let n of i){let r=n.startsWith(this.name+`[`)?n.slice(this.name.length):n.slice(this.name.length+1),i=t?.[r],o=this.form.getFieldMeta(n);if(!o&&!i)continue;let s=o?.errorMap[e],{newErrorValue:c,newSource:l}=Dj({newFormValidatorError:i,isPreviousErrorFromFormValidator:o?.errorSourceMap[e]===`form`,previousErrorValue:s});c&&(a=!0),(s!==c||o?.errorSourceMap[e]!==l)&&this.form.setFieldMeta(n,(t=Hj)=>({...t,errorMap:{...t.errorMap,[e]:c},errorSourceMap:{...t.errorSourceMap,[e]:l}}))}return this._lastDistributedFieldNames[e]=r,a},this.validateSync=(t,n,r={})=>{let i=Cj(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||Lj}),a=(r.skipRelatedFieldValidation?[]:this.getRelatedFields()).reduce((e,n)=>{let r=Cj(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||Lj});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),o=!1;ej(()=>{let t=(t,r)=>{let i=rM(r.cause),a=t===this,s;r.validate&&(s=t.runValidator({validate:r.validate,value:{value:t.store.state.value,validationSource:a?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validate`}));let c=s,l;a&&tM(s)&&(c=s.group,l=s.fields);let u=eM(c),d=n[i],{newErrorValue:f,newSource:p}=Oj({formLevelError:d,fieldLevelError:u});t.state.meta.errorMap?.[i]!==f&&t.setMeta(e=>({...e,errorMap:{...e.errorMap,[i]:f},errorSourceMap:{...e.errorSourceMap,[i]:p}})),f&&(o=!0),a&&this.distributeFieldErrors(i,l)&&(o=!0)};for(let e of i)t(this,e);for(let e of a)e.validate&&t(e.field,e)});let s=rM(`submit`);return this.state.meta.errorMap?.[s]&&t!==`submit`&&!o&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[s]:void 0},errorSourceMap:{...e.errorSourceMap,[s]:void 0}})),{hasErrored:o}},this.validateAsync=async(t,n,r={})=>{let i=wj(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||Lj}),a=await n,o=r.skipRelatedFieldValidation?[]:this.getRelatedFields(),s=o.reduce((e,n)=>{let r=wj(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||Lj});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),c=[],l=[],u=i.some(e=>e.validate)||s.some(e=>e.validate);if(u){this.state.meta.isValidating||this.setMeta(e=>({...e,isValidating:!0}));for(let e of o)e.setMeta(e=>({...e,isValidating:!0}))}let d=(t,n,r)=>{let i=rM(n.cause),o=t.getInfo();o.validationMetaMap[i]?.lastAbortController.abort();let s=new AbortController;o.validationMetaMap[i]={lastAbortController:s};let c=t===this;r.push(new Promise(async r=>{let o;try{o=await new Promise((r,i)=>{t.timeoutIds.validations[n.cause]&&clearTimeout(t.timeoutIds.validations[n.cause]),t.timeoutIds.validations[n.cause]=setTimeout(async()=>{if(s.signal.aborted)return r(void 0);try{r(await this.runValidator({validate:n.validate,value:{value:t.store.state.value,signal:s.signal,validationSource:c?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validateAsync`}))}catch(e){i(e)}},n.debounceMs)})}catch(e){o=e}if(s.signal.aborted)return r(void 0);let l=o,u;c&&tM(o)&&(l=o.group,u=o.fields);let d=eM(l),f=a[t.name]?.[i],{newErrorValue:p,newSource:m}=Oj({formLevelError:f,fieldLevelError:d});if(t.getInfo().instance!==t)return r(void 0);t.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:p},errorSourceMap:{...e.errorSourceMap,[i]:m}})),c&&this.distributeFieldErrors(i,u),r(p)}))};for(let e of i)e.validate&&d(this,e,c);for(let e of s)e.validate&&d(e.field,e,l);let f=[];if((c.length||l.length)&&(f=await Promise.all(c),await Promise.all(l)),u){this.setMeta(e=>({...e,isValidating:!1}));for(let e of o)e.setMeta(e=>({...e,isValidating:!1}))}return f.filter(Boolean)},this.validateAllFields=async e=>{let t=[];return ej(()=>{Object.values(this.getRelatedFields()).forEach(n=>{t.push(Promise.resolve().then(()=>n.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=(e,t,n)=>this.form.validateArrayFieldsStartingFrom(e,t,n),this.validateField=(e,t)=>this.form.validateField(e,t),this.getFieldValue=e=>this.form.getFieldValue(e),this.getFieldMeta=e=>this.form.getFieldMeta(e),this.setFieldMeta=(e,t)=>this.form.setFieldMeta(e,t),this.setFieldValue=(e,t)=>this.form.setFieldValue(e,t),this.deleteField=e=>this.form.deleteField(e),this.pushFieldValue=(e,t)=>this.form.pushFieldValue(e,t),this.insertFieldValue=(e,t,n)=>this.form.insertFieldValue(e,t,n),this.replaceFieldValue=(e,t,n)=>this.form.replaceFieldValue(e,t,n),this.swapFieldValues=(e,t,n)=>this.form.swapFieldValues(e,t,n),this.moveFieldValues=(e,t,n)=>this.form.moveFieldValues(e,t,n),this.clearFieldValues=e=>this.form.clearFieldValues(e),this.resetField=e=>this.form.resetField(e),this.removeFieldValue=(e,t)=>this.form.removeFieldValue(e,t),this.areRelatedFieldsValid=()=>Object.values(this.getRelatedFields()).every(e=>e.state.meta.isValid),this.validate=(e,t)=>{let{fieldsErrorMap:n}=t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>Ij(this.name,e)}),{hasErrored:r}=this.validateSync(e,n[this.name]??{},{skipRelatedFieldValidation:t?.skipRelatedFieldValidation});if(r&&!this.options.asyncAlways)return this.getInfo().validationMetaMap[rM(e)]?.lastAbortController.abort(),this.state.meta.errors;let i=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>Ij(this.name,e)});return this.validateAsync(e,i,{skipRelatedFieldValidation:t?.skipRelatedFieldValidation})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeGroupDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this})},e)):this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,groupApi:this})},this._handleSubmit=async e=>{this.setFormGroupState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),ej(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.state.meta.isTouched||e.setMeta(e=>({...e,isTouched:!0}))})});let t=e??this.options.onSubmitMeta;this.setFormGroupState(e=>({...e,isSubmitting:!0}));let n=()=>{this.setFormGroupState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.areRelatedFieldsValid()){n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});return}if(await this.validate(`submit`,{skipRelatedFieldValidation:!0}),!this.areRelatedFieldsValid()||!this.state.meta.isValid){n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});return}ej(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.options.listeners?.onGroupSubmit?.({value:e.state.value,fieldApi:e})})}),this.options.listeners?.onSubmit?.({groupApi:this,value:this.state.value});try{await this.options.onGroupSubmit?.({value:this.state.value,groupApi:this,meta:t}),ej(()=>{this.setFormGroupState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),n()})}catch(e){throw this.setFormGroupState(e=>({...e,isSubmitSuccessful:!1})),n(),e}},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.fieldInfo={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.store=sj(e=>{this.form.formGroupMetaDerived.get(),this.form.baseStore.get();let n=this.form.getFormGroupMeta(this.name)??Qj(t.defaultMeta),r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!Ej(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}}),this.handleSubmit=this.handleSubmit.bind(this)}get state(){return this.store.state}runValidator(e){if(Vj(e.validate)){let t=Bj[e.type](e.value,e.validate);return e.type===`validate`?nM(t):t.then(nM)}return e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function eM(e){if(e)return e}function tM(e){return!!e&&typeof e==`object`&&`fields`in e}function nM(e){if(!e||typeof e!=`object`||!(`form`in e)&&!(`fields`in e))return e;let{form:t,fields:n,...r}=e;return{...r,group:t,fields:n}}function rM(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function iM(e,t){if(!t)return;let n=Object.assign({},e,{state:Fj(e.state)});t(n),n.fieldInfo!==e.fieldInfo&&(e.fieldInfo=n.fieldInfo),n.options!==e.options&&(e.options=n.options);let r=Object.keys({values:null,validationMetaMap:null,fieldMetaBase:null,formGroupStateBase:null,isSubmitting:null,isSubmitted:null,isValidating:null,submissionAttempts:null,isSubmitSuccessful:null,_force_re_eval:null}).reduce((t,r)=>(e.state[r]!==n.state[r]&&(t[r]=n.state[r]),t),{});return ej(()=>{Object.keys(r).length&&e.baseStore.setState(e=>({...e,...r})),n.state.errorMap!==e.state.errorMap&&e.setErrorMap(n.state.errorMap)}),n}var aM=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),oM=o(((e,t)=>{t.exports=aM()})),sM=o((e=>{var t=u(),n=oM();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),cM=o(((e,t)=>{t.exports=sM()}))();function lM(e,t){return e===t}function uM(e,t=e=>e,n){let r=n?.compare??lM,i=(0,F.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,F.useCallback)(()=>e.get(),[e]);return(0,cM.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var dM=typeof window<`u`?F.useLayoutEffect:F.useEffect;function fM(e){let[t,n]=(0,F.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,F.useState)(()=>new Jj({...e})),a=r;(t.form!==e.form||t.name!==e.name)&&(a=new Jj({...e}),i(a),n({form:e.form,name:e.name}));let o=uM(a.store,e.mode===`array`?e=>e.meta._arrayVersion||0:e=>e.value),s=uM(a.store,e=>e.meta.isTouched),c=uM(a.store,e=>e.meta.isBlurred),l=uM(a.store,e=>e.meta.isDirty),u=uM(a.store,e=>e.meta.errorMap),d=uM(a.store,e=>e.meta.errorSourceMap),f=uM(a.store,e=>e.meta.isValidating),p=(0,F.useMemo)(()=>({...a,get state(){return{value:e.mode===`array`?a.state.value:o,get meta(){return{...a.state.meta,isTouched:s,isBlurred:c,isDirty:l,errorMap:u,errorSourceMap:d,isValidating:f}}}}}),[a,e.mode,o,s,c,l,u,d,f]);return dM(a.mount,[a]),dM(()=>{a.update(e)}),p}var pM=(({children:e,...t})=>{let n=fM(t),r=(0,F.useMemo)(()=>fj(e,n),[e,n]);return(0,I.jsx)(I.Fragment,{children:r})});function mM(){return(0,F.useState)(()=>Nj())[0]}var hM=F,gM=`19.3.0`.split(`.`)[0]===`17`?mM:hM.useId;function _M(e){let[t,n]=(0,F.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,F.useState)(()=>new $j({...e}));(t.form!==e.form||t.name!==e.name)&&(i(new $j({...e})),n({form:e.form,name:e.name}));let a=uM(r.store,e=>e.value),o=uM(r.store,e=>e.meta.isTouched),s=uM(r.store,e=>e.meta.isBlurred),c=uM(r.store,e=>e.meta.isDirty),l=uM(r.store,e=>e.meta.errorMap),u=uM(r.store,e=>e.meta.errorSourceMap),d=uM(r.store,e=>e.meta.isValidating),f=uM(r.store,e=>e.meta.isSubmitting),p=uM(r.store,e=>e.meta.isSubmitted),m=uM(r.store,e=>e.meta.submissionAttempts),h=uM(r.store,e=>e.meta.isSubmitSuccessful),g=uM(r.store,e=>e.meta.canSubmit),_=uM(r.store,e=>e.meta.isValid),v=uM(r.store,e=>e.meta.isFieldsValid),y=uM(r.store,e=>e.meta.isFieldsValidating),b=uM(r.store,e=>e.meta.isGroupValid),x=(0,F.useMemo)(()=>({...r,handleSubmit:((...e)=>r._handleSubmit(...e)),get state(){return{...r.state,value:a,get meta(){return{...r.state.meta,isTouched:o,isBlurred:s,isDirty:c,errorMap:l,errorSourceMap:u,isValidating:d,isSubmitting:f,isSubmitted:p,submissionAttempts:m,isSubmitSuccessful:h,canSubmit:g,isValid:_,isFieldsValid:v,isFieldsValidating:y,isGroupValid:b}}}}}),[r,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b]);return dM(r.mount,[r]),dM(()=>{r.update(e)}),x}var vM=(({children:e,...t})=>{let n=_M(t),r=(0,F.useMemo)(()=>fj(e,n),[e,n]);return(0,I.jsx)(I.Fragment,{children:r})});function yM({form:e,selector:t=e=>e,children:n}){let r=uM(e.store,t);return(0,I.jsx)(I.Fragment,{children:fj(n,r)})}function bM(e){let t=gM(),[n,r]=(0,F.useState)(e?.formId),[i,a]=(0,F.useState)(()=>new Gj({...e,formId:e?.formId??t}));if(n!==e?.formId){let n=e?.formId??t;a(new Gj({...e,formId:n})),r(n)}let o=(0,F.useMemo)(()=>{let e={...i,handleSubmit:((...e)=>i._handleSubmit(...e)),get formId(){return i._formId},get state(){return i.store.state}};return e.Field=function(e){return(0,I.jsx)(pM,{...e,form:i})},e.FormGroup=function(e){return(0,I.jsx)(vM,{...e,form:i})},e.Subscribe=function(e){return(0,I.jsx)(yM,{form:i,selector:e.selector,children:e.children})},e},[i]);dM(i.mount,[]),dM(()=>{i.update(e)});let s=(0,F.useRef)(!1);return dM(()=>{s.current&&e?.transform&&iM(i,e.transform)},[i,e?.transform]),dM(()=>{s.current=!0}),o}var xM={key:`id`,label:`id`,kind:`string`},SM={key:`when`,label:`when (template)`,kind:`string`},CM={goto:[{key:`url`,label:`url`,kind:`string`},{key:`waitUntil`,label:`wait until`,kind:`enum`,options:[`load`,`domcontentloaded`,`networkidle`,`commit`]},SM],click:[{key:`selector`,label:`selector`,kind:`string`},{key:`optional`,label:`optional`,kind:`boolean`},xM,SM],fill:[{key:`selector`,label:`selector`,kind:`string`},{key:`value`,label:`value (template)`,kind:`string`},xM,SM],press:[{key:`selector`,label:`selector`,kind:`string`},{key:`key`,label:`key`,kind:`string`},xM,SM],select:[{key:`selector`,label:`selector`,kind:`string`},{key:`value`,label:`value`,kind:`string`},xM,SM],scroll:[{key:`to`,label:`to`,kind:`string`},{key:`untilStable`,label:`until stable`,kind:`boolean`},SM],wait:[{key:`selector`,label:`selector`,kind:`string`},{key:`ms`,label:`ms`,kind:`number`},SM],screenshot:[{key:`path`,label:`path`,kind:`string`},xM,SM],request:[{key:`url`,label:`url`,kind:`string`},{key:`method`,label:`method`,kind:`enum`,options:[`GET`,`POST`,`PUT`,`PATCH`,`DELETE`,`HEAD`]},{key:`as`,label:`read as`,kind:`enum`,options:[`text`,`json`,`html`,`xml`,`csv`,`yaml`,`pdf`,`workbook`,`deck`]},xM,SM],extract:[{key:`selector`,label:`selector`,kind:`string`},{key:`kind`,label:`kind`,kind:`enum`,options:[`css`,`xpath`,`jsonpath`,`table`]},{key:`take`,label:`take`,kind:`string`},{key:`many`,label:`many`,kind:`boolean`},{key:`from`,label:`from (id)`,kind:`string`},xM,SM],set:[{key:`value`,label:`value (JSON)`,kind:`json`},xM,SM],collect:[{key:`into`,label:`into (id)`,kind:`string`},{key:`value`,label:`value (JSON)`,kind:`json`},SM],forEach:[{key:`as`,label:`as`,kind:`string`},{key:`over`,label:`over (id)`,kind:`string`},{key:`selector`,label:`selector (live elements)`,kind:`string`},{key:`emit`,label:`emits a record`,kind:`boolean`},xM,SM],paginate:[{key:`until`,label:`until (template)`,kind:`string`},{key:`maxPages`,label:`max pages`,kind:`number`},xM,SM],if:[{key:`test`,label:`test (template)`,kind:`string`},xM],hook:[{key:`name`,label:`hook`,kind:`hook`},{key:`args`,label:`args (JSON)`,kind:`json`},xM,SM],emit:[{key:`output`,label:`output recipe id`,kind:`string`},SM]};function wM({stepType:e,step:t,onChange:n,onCommit:r}){let[i,a]=(0,F.useState)(!1),o=CM[e]??[],s=bM({defaultValues:t});return(0,I.jsxs)($w,{gap:2,p:2,borderWidth:`1px`,borderRadius:`md`,bg:`bg.subtle`,children:[o.map(e=>(0,I.jsx)(s.Field,{name:e.key,validators:{onMount:({value:t})=>TM(e,t),onChange:({value:t})=>TM(e,t)},children:i=>(0,I.jsxs)($w,{gap:0,children:[(0,I.jsx)(EM,{field:e,value:i.state.value,onChange:r=>{i.handleChange(r),n({...t,[e.key]:r})},onCommit:()=>{i.handleBlur(),r()}}),i.state.meta.errors.length>0&&(0,I.jsx)(H,{fontSize:`xs`,color:`fg.error`,children:String(i.state.meta.errors[0])})]})},e.key)),o.length===0&&(0,I.jsx)(H,{fontSize:`xs`,color:`fg.muted`,children:`No common fields for this step type; edit its JSON below.`}),(0,I.jsxs)(L,{children:[(0,I.jsxs)(H,{as:`button`,fontSize:`xs`,color:`fg.muted`,cursor:`pointer`,onClick:()=>{a(e=>!e)},children:[i?`▾`:`▸`,` Advanced (JSON)`]}),i&&(0,I.jsx)(OM,{step:t,onChange:n,onCommit:r})]})]})}function TM(e,t){return t!==void 0&&typeof t!=`number`&&e.kind===`number`?`must be a number`:void 0}function EM({field:e,value:t,onChange:n,onCommit:r}){return e.kind===`boolean`?(0,I.jsxs)(Ww,{checked:t===!0,onCheckedChange:e=>{n(e.checked===!0),r()},children:[(0,I.jsx)(Jw,{}),(0,I.jsx)(qw,{}),(0,I.jsx)(Gw,{fontSize:`sm`,children:e.label})]}):e.kind===`enum`?(0,I.jsxs)(xT,{children:[(0,I.jsx)(ST,{fontSize:`xs`,children:e.label}),(0,I.jsx)(PT,{size:`sm`,children:(0,I.jsxs)(IT,{value:typeof t==`string`?t:``,onChange:e=>{n(e.target.value===``?void 0:e.target.value),r()},children:[(0,I.jsx)(`option`,{value:``,children:`(default)`}),e.options?.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})})]}):e.kind===`hook`?(0,I.jsxs)(xT,{children:[(0,I.jsx)(ST,{fontSize:`xs`,children:e.label}),(0,I.jsx)(AA,{ariaLabel:e.label,value:typeof t==`string`?t:``,onChange:n,onCommit:r})]}):e.kind===`json`?(0,I.jsx)(DM,{field:e,value:t,onChange:n,onCommit:r}):(0,I.jsxs)(xT,{children:[(0,I.jsx)(ST,{fontSize:`xs`,children:e.label}),(0,I.jsx)(DT,{size:`sm`,type:e.kind===`number`?`number`:`text`,value:t===void 0?``:String(t),onChange:t=>{n(e.kind===`number`?kM(t.target.value):t.target.value)},onBlur:r})]})}function DM({field:e,value:t,onChange:n,onCommit:r}){let[i,a]=(0,F.useState)(()=>AM(t));return(0,I.jsxs)(xT,{children:[(0,I.jsx)(ST,{fontSize:`xs`,children:e.label}),(0,I.jsx)(DT,{size:`sm`,fontFamily:`mono`,value:i,onChange:e=>{a(e.target.value)},onBlur:()=>{n(jM(i)),r()}})]})}function OM({step:e,onChange:t,onCommit:n}){let[r,i]=(0,F.useState)(()=>JSON.stringify(e,null,2)),[a,o]=(0,F.useState)();return(0,I.jsxs)($w,{gap:1,mt:1,children:[(0,I.jsx)(OE,{size:`sm`,fontFamily:`mono`,fontSize:`xs`,rows:6,"aria-label":`Advanced step JSON`,value:r,onChange:e=>{i(e.target.value)},onBlur:()=>{try{let e=JSON.parse(r);if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`a step is a JSON object`);o(void 0),t(e),n()}catch(e){o(e instanceof Error?e.message:String(e))}}}),a!==void 0&&(0,I.jsx)(H,{fontSize:`xs`,color:`fg.error`,children:a})]})}function kM(e){if(e===``)return;let t=Number(e);return Number.isNaN(t)?void 0:t}function AM(e){return typeof e==`string`?e:e===void 0?``:JSON.stringify(e)}function jM(e){try{return JSON.parse(e)}catch{return e}}function MM({listId:e,nodes:t,allIssues:n,actions:r,menuLabel:i}){return(0,I.jsxs)($w,{gap:1,children:[(0,I.jsx)(FA,{ariaLabel:`${i} at the start`,onAdd:t=>{r.insert(e,0,t)}}),t.map((a,o)=>(0,I.jsxs)($w,{gap:1,children:[(0,I.jsx)(NM,{node:a,listId:e,index:o,lastIndex:t.length-1,allIssues:n,actions:r}),(0,I.jsx)(FA,{ariaLabel:`${i} after this step`,onAdd:t=>{r.insert(e,o+1,t)}})]},a.path))]})}function NM({node:e,listId:t,index:n,lastIndex:r,allIssues:i,actions:a,readOnly:o=!1}){let[s,c]=(0,F.useState)(!1),l=e.kind===`bracket`,u=e.kind===`card`&&e.custom,d=FO(i,e.path),f=typeof e.step.id==`string`?e.step.id:void 0,p=K(e=>e.hoveredStepId),m=K(e=>e.setHoveredStepId),h=f!==void 0&&f===p;return(0,I.jsxs)($w,{gap:1,"data-testid":`outline-card-${e.path}`,children:[(0,I.jsxs)(G,{gap:2,p:2,borderWidth:`1px`,borderRadius:`md`,"data-highlighted":h,borderColor:h?`orange.solid`:void 0,bg:h?`orange.subtle`:u?`bg.muted`:`bg.panel`,cursor:o?`default`:`pointer`,onClick:o?void 0:()=>{c(e=>!e)},onMouseEnter:o||f===void 0?void 0:()=>{m(f)},onMouseLeave:o||f===void 0?void 0:()=>{m(void 0)},children:[!o&&(0,I.jsxs)($w,{gap:0,flexShrink:0,children:[(0,I.jsx)(Yw,{"aria-label":`Move up`,size:`2xs`,variant:`ghost`,disabled:n===0,onClick:e=>{e.stopPropagation(),a.move(t,n,-1)},children:`↑`}),(0,I.jsx)(Yw,{"aria-label":`Move down`,size:`2xs`,variant:`ghost`,disabled:n===r,onClick:e=>{e.stopPropagation(),a.move(t,n,1)},children:`↓`})]}),(0,I.jsxs)(L,{flex:`1`,children:[(0,I.jsx)(zA,{parts:e.sentence}),d.length>0&&(0,I.jsx)($w,{gap:0,mt:1,children:d.map(e=>(0,I.jsx)(H,{fontSize:`xs`,color:`fg.error`,children:e.message},e.message))})]}),!o&&(0,I.jsx)(Yw,{"aria-label":`Remove step`,size:`2xs`,variant:`ghost`,onClick:e=>{e.stopPropagation(),a.remove(t,n)},children:`✕`})]}),s&&!u&&!o&&(0,I.jsx)(L,{pl:8,children:(0,I.jsx)(wM,{stepType:e.stepType,step:e.step,onChange:t=>{a.edit(e.path,e=>({...e,step:t}))},onCommit:a.commit})}),s&&u&&!o&&(0,I.jsxs)(L,{pl:8,children:[(0,I.jsx)(H,{fontSize:`xs`,color:`fg.muted`,mb:1,children:`This step doesn't read as a sentence yet: edit its JSON directly.`}),(0,I.jsx)(wM,{stepType:e.stepType,step:e.step,onChange:t=>{a.edit(e.path,e=>({...e,step:t}))},onCommit:a.commit})]}),l&&(0,I.jsxs)(L,{pl:8,borderLeftWidth:`2px`,borderColor:`border.muted`,children:[(0,I.jsx)(MM,{listId:`${e.path}::then`,nodes:e.children,allIssues:i,actions:a,menuLabel:`Add step`}),e.stepType===`if`&&e.elseChildren!==void 0&&(0,I.jsxs)($w,{gap:1,mt:2,children:[(0,I.jsx)(H,{fontSize:`xs`,fontWeight:`medium`,color:`fg.muted`,children:`Else`}),(0,I.jsx)(MM,{listId:`${e.path}::else`,nodes:e.elseChildren,allIssues:i,actions:a,menuLabel:`Add step`})]}),e.stepType===`if`&&e.elseChildren===void 0&&(0,I.jsx)(Rw,{size:`xs`,variant:`outline`,mt:2,onClick:()=>{a.insert(`${e.path}::else`,0,`emit`)},children:`+ Add an else branch`})]})]})}var PM={edit:()=>{},commit:()=>{},move:()=>{},remove:()=>{},insert:()=>{}};function FM({recipe:e,onSaveOutline:t}){let[n,r]=(0,F.useState)(e?.outline);(0,F.useEffect)(()=>{r(e?.outline)},[e?.file,e?.text]);let[i,a]=(0,F.useState)(new Set),[o,s]=(0,F.useState)(!1),c=kA(),l=ek(e=>e.recipeId),u=ek(e=>e.active),d=ek(e=>e.stoppedSteps!==void 0),f=ek(e=>e.cards),p=ek(e=>e.notes);if(e===void 0)return(0,I.jsx)(L,{p:4,color:`fg.muted`,children:(0,I.jsx)(H,{children:`Select a recipe to see its steps.`})});if(n===void 0)return(0,I.jsx)(L,{p:4,color:`fg.muted`,children:(0,I.jsx)(H,{children:`This recipe has no steps to show (not an input recipe, or its JSON is not an object).`})});let m=n=>{r(n),t(e.file,n)},h={edit:(e,t)=>{r(n=>n===void 0?n:EO(n,e,t))},commit:()=>{r(n=>(n!==void 0&&t(e.file,n),n))},move:(e,t,r)=>{if(n===void 0)return;let i=wO(n,e),a=t+r;if(a<0||a>=i.length)return;let o=[...i],[s]=o.splice(t,1);o.splice(a,0,s),m(TO(n,e,o))},remove:(e,t)=>{if(n===void 0)return;let r=wO(n,e);m(TO(n,e,r.filter((e,n)=>n!==t)))},insert:(e,t,r)=>{if(n===void 0)return;let i=wO(n,e),a=PA(r,`${AO(e)}.${t}`,c?.[0]);m(TO(n,e,[...i.slice(0,t),a,...i.slice(t)]))}};function g(e,t){if(n===void 0||e.selector===void 0)return;let r={kind:`bracket`,path:`steps.${n.steps.length}`,stepType:`paginate`,sentence:[{kind:`word`,text:`For every page — click`},{kind:`code`,text:e.selector}],step:{type:`paginate`,next:{selector:e.selector},steps:[]},children:[]};m({...n,steps:[...n.steps,r]}),a(e=>new Set(e).add(t))}let _=l===e.id&&(u||d);function v(e){if(!EA(e.dataTransfer))return;e.preventDefault(),s(!1);let t=TA(e.dataTransfer);t!==void 0&&n!==void 0&&m({...n,steps:[...n.steps,{...t,path:`steps.${String(n.steps.length)}`}]})}function y(e){EA(e.dataTransfer)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,s(!0))}return(0,I.jsxs)(L,{h:`full`,overflow:`auto`,p:2,"data-testid":`steps-outline`,"data-card-over":o,outline:o?`2px dashed`:void 0,outlineColor:`blue.solid`,outlineOffset:`-4px`,onDragOver:y,onDragLeave:()=>{s(!1)},onDrop:v,children:[(0,I.jsx)(MM,{listId:``,nodes:n.steps,allIssues:e.issues,actions:h,menuLabel:`Add step`},e.file),_&&(0,I.jsxs)(L,{mt:3,pt:2,borderTopWidth:`1px`,borderColor:`border.muted`,"data-testid":`recording-cards`,children:[(0,I.jsxs)(G,{gap:2,mb:1,children:[(0,I.jsx)(H,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:u?`Recording…`:`Recording stopped`}),(0,I.jsxs)(Aw,{size:`sm`,colorPalette:u?`red`:`gray`,children:[f.length,` step`,f.length===1?``:`s`]})]}),(0,I.jsx)($w,{gap:1,children:f.map((e,t)=>(0,I.jsx)(NM,{node:e.node,listId:`recording`,index:t,lastIndex:f.length-1,allIssues:[],actions:PM,readOnly:!0},`recording:${t}:${e.node.path}`))}),p.length>0&&(0,I.jsx)($w,{gap:1,mt:2,children:p.map((e,t)=>(0,I.jsxs)(G,{gap:2,p:2,borderWidth:`1px`,borderRadius:`md`,borderColor:e.kind===`unsupported`?`orange.muted`:`border.muted`,bg:`bg.muted`,children:[(0,I.jsx)(H,{fontSize:`xs`,flex:`1`,children:e.message}),e.kind===`next-link`&&e.selector!==void 0&&!i.has(t)&&(0,I.jsx)(Rw,{size:`2xs`,colorPalette:`blue`,onClick:()=>{g(e,t)},children:`Turn into pagination`}),e.kind===`next-link`&&i.has(t)&&(0,I.jsx)(Aw,{size:`sm`,colorPalette:`green`,children:`Added`})]},`note:${t}:${e.message}`))})]})]})}function IM(){return(0,I.jsx)(L,{px:3,py:2,bg:`orange.subtle`,borderBottomWidth:`1px`,flexShrink:0,role:`status`,children:(0,I.jsx)(H,{fontSize:`sm`,children:`This page shows almost nothing. If it should have content, it builds it with JavaScript and the engine fetched it without a browser. Use Inspect to see the data it loads.`})})}var LM=`table`,RM=`text`,zM=4,BM=1;function VM(e){return`^${XM(e.trim())}`}function HM(e){let t=e.trim().toLowerCase().replace(/[^\d a-z]/gi,` `).trim().split(/\s+/).filter(e=>e!==``);if(t.length===0)return`column`;let[n,...r]=t;return n+r.map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function UM(e,t,n=LM){if(e.header===void 0)throw Error(`tableCardNode: pick the header row first`);let r=e.columns,i=r!==void 0&&Object.keys(r).length>0;return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:n,kind:`table`,selector:e.header,...e.until!==void 0&&{until:e.until},...i&&{columns:r}}}}function WM(e,t,n){let[r,i]=YM(n.x1,n.x2),[a,o]=YM(n.y1,n.y2);return`${e}=${String(t)} x=${String(Math.round(r))}..${String(Math.round(i))} y=${String(Math.round(a))}..${String(Math.round(o))}`}function GM(e){return{x1:e.x-BM,y1:e.y-BM,x2:e.x+Math.max(e.width,1)+BM,y2:e.y+e.height+BM}}function KM(e,t){return{x1:Math.min(e.x1,t.x1),y1:Math.min(e.y1,t.y1),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function qM(e){let[t=``]=e.split(`
|
|
12
|
+
`,1),n=t.trim().toLowerCase().replace(/[^\d a-z]/gi,` `).trim().split(/\s+/).filter(e=>e!==``).slice(0,zM);if(n.length===0)return RM;let[r,...i]=n;return r+i.map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function JM(e,t,n){return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:n,kind:`region`,selector:e}}}function YM(e,t){return e<=t?[e,t]:[t,e]}function XM(e){return e.replace(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}var ZM=`table`;function QM(e){return`${VM(e)}$`}function $M(e){return e.map(e=>String(e.value).trim()).filter(e=>e!==``).join(` `)}function eN(e){let t=e.rows.map(e=>e.map(e=>e.value));for(let n of e.merges){let e=t[n.top]?.[n.left]??``;for(let r=n.top;r<=n.bottom;r+=1){t[r]??=[];for(let i=n.left;i<=n.right;i+=1)t[r][i]=e}}return t}function tN(e,t,n){let r=[];for(let i of t){let t=String(e[i]?.[n]??``).trim();t!==``&&!r.includes(t)&&r.push(t)}return r.join(` `)}function nN(e,t){let n=VM(t);return Object.entries(e.columns??{}).find(([,e])=>e===n)?.[0]??t}function rN(e,t,n=ZM){if(e.header===void 0)throw Error(`gridTableCardNode: pick the header row first`);let r=e.columns,i=r!==void 0&&Object.keys(r).length>0,a=e.fillDown!==void 0&&e.fillDown.length>0;return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:n,kind:`table`,selector:e.header,...e.sheet!==void 0&&{sheet:e.sheet},...e.until!==void 0&&{until:e.until},...i&&{columns:r},...e.headerRows!==void 0&&e.headerRows>1&&{headerRows:e.headerRows},...a&&{fillDown:e.fillDown},...e.includeHidden===!0&&{includeHidden:!0}}}}function iN(e,t){let n=t.top===t.bottom?`[${String(t.top)}]`:`[${String(t.top)}:${String(t.bottom+1)}]`,r=t.left===t.right?`[${String(t.left)}]`:`[${String(t.left)}:${String(t.right+1)}]`;return`$.sheets[?(@.name==${lN(e)})].rows${n}${r}`}function aN(e,t){return{top:Math.min(e.top,t.top),left:Math.min(e.left,t.left),bottom:Math.max(e.bottom,t.bottom),right:Math.max(e.right,t.right)}}function oN(e){return e.top===e.bottom&&e.left===e.right}function sN(e,t){let n=[];for(let r=t.top;r<=t.bottom;r+=1){let i=e.rows[r]?.slice(t.left,t.right+1)??[];n.push(i.map(e=>String(e.value)).join(` `))}return n.join(`
|
|
13
|
+
`)}function cN(e,t,n,r){return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:n,kind:`jsonpath`,selector:e,take:`json`,...r&&{many:!0}}}}function lN(e){return e.includes(`'`)?`"${e.replace(/["\\]/g,String.raw`\$&`)}"`:`'${e}'`}var uN=`table`,dN=`value`,fN=1;function pN(e){return`${VM(e)}$`}function mN(e,t,n=uN){if(e.header===void 0)throw Error(`deckTableCardNode: pick the header row first`);let r=e.columns,i=r!==void 0&&Object.keys(r).length>0,a=e.fillDown!==void 0&&e.fillDown.length>0;return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:n,kind:`table`,selector:e.header,...e.slide!==void 0&&{slide:e.slide},...e.shapes===!0&&{shapes:!0},...e.until!==void 0&&{until:e.until},...i&&{columns:r},...e.headerRows!==void 0&&e.headerRows>1&&{headerRows:e.headerRows},...a&&{fillDown:e.fillDown},...e.includeHidden===!0&&{includeHidden:!0}}}}function hN(e,t,n,r=dN){return{kind:`card`,path:n,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:r,selector:`$.slides[${String(e)}].charts[${String(t)}].series`,kind:`jsonpath`,take:`json`}}}function gN(e){return{x1:e.x-fN,y1:e.y-fN,x2:e.x+Math.max(e.width,1)+fN,y2:e.y+Math.max(e.height,1)+fN}}var _N=`#9b5de5`;function vN({left:e,top:t,text:n,loading:r,onAdd:i,onClear:a,onDragStart:o}){let s=n===void 0&&!r,[c=``]=(n??``).split(`
|
|
14
|
+
`,1);return(0,I.jsxs)(G,{"data-testid":`region-chip`,position:`absolute`,style:{left:`${String(e)}px`,top:`${String(t)}px`},zIndex:`docked`,gap:2,px:2,py:1,bg:`bg.panel`,borderWidth:`1px`,borderColor:_N,borderRadius:`md`,shadow:`md`,maxW:`420px`,draggable:n!==void 0,onDragStart:o,onMouseDown:e=>{e.stopPropagation()},onMouseUp:e=>{e.stopPropagation()},cursor:n===void 0?`default`:`grab`,title:n===void 0?void 0:`Drag onto the Steps tab to add it there`,children:[(0,I.jsx)(H,{fontSize:`xs`,fontFamily:`mono`,truncate:!0,flex:`1`,color:s?`fg.muted`:`fg`,children:r&&n===void 0?`reading…`:s?`nothing to read here`:c}),(0,I.jsx)(Rw,{size:`2xs`,colorPalette:`blue`,onClick:i,disabled:n===void 0,children:`Add to recipe`}),(0,I.jsx)(Xw,{size:`2xs`,"aria-label":`Clear selection`,onClick:a})]})}var yN=/^\s*(page|slide)=(\*|\d+)\s+x=(-?\d+(?:\.\d+)?)\.\.(-?\d+(?:\.\d+)?)\s+y=(-?\d+(?:\.\d+)?)\.\.(-?\d+(?:\.\d+)?)\s*$/,bN=/^\$\.sheets\[\?\(@\.name==(?:'([^']*)'|"((?:[^"\\]|\\.)*)")\)\]\.rows\[(\d+)(?::(\d+))?\]\[(\d+)(?::(\d+))?\]$/,xN=/^\$\.slides\[(\d+)\]\.charts\[(\d+)\]\.series$/;function SN(e){let t=[];for(let n of NO(e)){let{id:e,kind:r,selector:i}=n.step;typeof e==`string`&&typeof r==`string`&&typeof i==`string`&&n.step.type===`extract`&&t.push({id:e,kind:r,selector:i})}return t}function CN(e,t){let n=new Set([e.jsonpath,e.xpath,e.listPath].filter(e=>e!==void 0));return t.filter(e=>n.has(e.selector)&&(e.kind===`jsonpath`||e.kind===`xpath`)).map(e=>e.id)}function wN(e){let t=yN.exec(e);if(t===null)return;let[,n,r,i,a,o,s]=t;return{on:n,at:r===`*`?`*`:Number(r),box:{x1:Number(i),y1:Number(o),x2:Number(a),y2:Number(s)}}}function TN(e,t,n){let r=[];for(let i of e){if(i.kind!==`region`)continue;let e=wN(i.selector);e===void 0||e.on!==t||e.at!==`*`&&e.at!==n||r.push({id:i.id,box:e.box})}return r}function EN(e,t){let[n,r]=MN(e.x1,e.x2),[i,a]=MN(e.y1,e.y2),[o,s]=MN(t.x1,t.x2),[c,l]=MN(t.y1,t.y2),u=(r-n)*(a-i);return u===0?n>=o&&n<=s&&i>=c&&i<=l:Math.max(0,Math.min(r,s)-Math.max(n,o))*Math.max(0,Math.min(a,l)-Math.max(i,c))>=u/2}function DN(e,t){return t.filter(t=>EN(e,t.box)).map(e=>e.id)}function ON(e){let t=bN.exec(e);if(t===null)return;let[,n,r,i,a,o,s]=t;return{sheet:n??(r??``).replace(/\\(.)/g,`$1`),range:{top:Number(i),left:Number(o),bottom:a===void 0?Number(i):Number(a)-1,right:s===void 0?Number(o):Number(s)-1}}}function kN(e,t){let n=[];for(let r of e){if(r.kind!==`jsonpath`)continue;let e=ON(r.selector);e!==void 0&&e.sheet===t&&n.push({id:r.id,range:e.range})}return n}function AN(e,t,n){return n.filter(({range:n})=>e>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right).map(e=>e.id)}function jN(e,t,n){for(let r of e){if(r.kind!==`jsonpath`)continue;let e=xN.exec(r.selector);if(e!==null&&Number(e[1])===t&&Number(e[2])===n)return r.id}}function MN(e,t){return e<=t?[e,t]:[t,e]}var NN=[],PN=5,FN=24,IN=4,LN=`#1d4ed8`,RN=`#ea580c`;function zN({recipeId:e,stepPath:t,view:n,onTablePick:r,onChartPick:i,onRegionPick:a,steps:o=NN,hoveredStepId:s,onHoverStepId:c}){let[l,u]=(0,F.useState)(0),[d,f]=(0,F.useState)(`table`),[p,m]=(0,F.useState)(0),[h,g]=(0,F.useState)(`text`),[_,v]=(0,F.useState)({}),[y,b]=(0,F.useState)(void 0),[x,S]=(0,F.useState)(void 0),[C,w]=(0,F.useState)(void 0),T=(0,F.useRef)(void 0),E=n.slides[l],D=(0,F.useMemo)(()=>TN(o,`slide`,E?.number??-1),[o,E?.number]),ee=(0,F.useMemo)(()=>(E?.charts??[]).map((e,t)=>jN(o,l,t)),[o,E?.charts,l]),O=d===`table`?E?.tables[p]:void 0,k=_.headerRowIndex===void 0?void 0:Array.from({length:_.headerRows??1},(e,t)=>_.headerRowIndex+t),A=Sk(e,t,_.header===void 0?void 0:{slide:_.slide,shapes:_.shapes,header:_.header,until:_.until,columns:_.columns,headerRows:_.headerRows,fillDown:_.fillDown,includeHidden:_.includeHidden}),te=(0,F.useMemo)(()=>A.data?.matches.find(e=>e.slide===E?.number),[A.data,E?.number]),ne=x===void 0?void 0:WM(`slide`,x.slide,x.box),re=vk(e,t,ne),j=re.data?.matches.find(e=>e.page===x?.slide),ie=j?.text;if((0,F.useEffect)(()=>{_.header!==void 0&&r(mN(_,t))},[_]),(0,F.useEffect)(()=>{m(0),v({}),f(E!==void 0&&E.tables.length===0&&E.shapes.length>0?`shapes`:`table`)},[l]),E===void 0)return(0,I.jsx)(L,{p:4,color:`fg.muted`,children:(0,I.jsx)(H,{children:`This deck has no slides.`})});function ae(e){e!==d&&(f(e),v({}))}function oe(e){if(O===void 0)return;let t=$M(O.rows[e]);if(t!==``){if(h===`header`){v(n=>n.headerRowIndex!==void 0&&e===n.headerRowIndex+(n.headerRows??1)?{...n,headerRows:(n.headerRows??1)+1}:{slide:pN(E.title??``),includeHidden:n.includeHidden,header:VM(t),headerRowIndex:e,headerRows:1});return}h===`until`&&_.header!==void 0&&v(e=>({...e,until:VM(t)}))}}function se(e,t){if(O===void 0||k===void 0)return;let n=eN(O);if(h===`column`){let e=tN(n,k,t);if(e===``)return;v(t=>({...t,columns:{...t.columns,[HM(e)]:VM(e)}}));return}if(h===`fillDown`&&BN(O,e,t)){let e=tN(n,k,t);if(e===``)return;let r=nN(_,e);v(e=>{let t=e.fillDown??[];return t.includes(r)?e:{...e,fillDown:[...t,r]}})}}function M(e){let t=E.shapeRows.findIndex(t=>t.includes(e));if(t===-1)return;let n=E.shapeRows[t];if(h===`header`){let e=E.shapes[n[0]]?.text??``;if(e.trim()===``)return;v({slide:pN(E.title??``),shapes:!0,header:VM(e),headerRowIndex:t,headerRows:1});return}if(h===`until`){if(_.header===void 0)return;let e=E.shapes[n[0]]?.text??``;if(e.trim()===``)return;v(t=>({...t,until:VM(e)}));return}if(h===`column`){if(_.headerRowIndex!==t)return;let n=E.shapes[e]?.text??``;if(n.trim()===``)return;v(e=>({...e,columns:{...e.columns,[HM(n)]:VM(n)}}))}}function ce(e){f(`table`),m(e),v({})}function le(e){i(hN(l,e,t))}function ue(e,t){let n=x;S(t&&n!==void 0&&n.slide===E.number?{slide:E.number,box:KM(n.box,e)}:{slide:E.number,box:e})}function de(e){c!==void 0&&T.current!==e&&(T.current=e,c(e))}function fe(e){let t=VN(e);if(C!==void 0){w({...C,currentX:t.x,currentY:t.y});return}let n=GN(E,t);b(n),de(n===void 0?void 0:DN(gN(n),D)[0])}function pe(e){if(e.button!==0)return;let t=VN(e);w({startX:t.x,startY:t.y,currentX:t.x,currentY:t.y})}function me(e){if(C===void 0)return;let t=VN(e);if(w(void 0),Math.abs(t.x-C.startX)+Math.abs(t.y-C.startY)>IN){ue({x1:C.startX,y1:C.startY,x2:t.x,y2:t.y},e.shiftKey);return}let n=GN(E,t);if(n===void 0){e.shiftKey||S(void 0);return}ue(gN(n),e.shiftKey)}function he(){if(ne!==void 0&&ie!==void 0)return JM(ne,t,qM(ie))}function ge(){let e=he();e!==void 0&&(a(e),S(void 0))}function _e(e){let t=he();t!==void 0&&ie!==void 0&&(e.dataTransfer.setData(CA,wA(t)),e.dataTransfer.setData(`text/plain`,ie),e.dataTransfer.effectAllowed=`copy`)}let N=h===`text`,P=x!==void 0&&x.slide===E.number?x:void 0;return(0,I.jsxs)(L,{h:`full`,display:`flex`,flexDirection:`column`,children:[(0,I.jsxs)(G,{px:3,py:2,borderBottomWidth:`1px`,gap:3,flexShrink:0,flexWrap:`wrap`,children:[n.slides.length>1&&(0,I.jsx)(qN,{slides:n.slides,value:l,onChange:u}),(0,I.jsx)(KN,{label:`Text`,active:N,onClick:()=>{g(`text`)}}),!N&&(0,I.jsx)(KN,{label:`Native table`,active:d===`table`,onClick:()=>{ae(`table`)}}),!N&&(0,I.jsx)(KN,{label:`Text-box grid`,active:d===`shapes`,onClick:()=>{ae(`shapes`)}}),(0,I.jsx)(KN,{label:`Header row(s)`,active:h===`header`,onClick:()=>{g(`header`)}}),(0,I.jsx)(KN,{label:`Last row (until)`,active:h===`until`,onClick:()=>{g(`until`)}}),(0,I.jsx)(KN,{label:`Column`,active:h===`column`,onClick:()=>{g(`column`)}}),!N&&d===`table`&&(0,I.jsx)(KN,{label:`Fill down`,active:h===`fillDown`,onClick:()=>{g(`fillDown`)}}),N&&(0,I.jsx)(H,{fontSize:`xs`,color:`fg.muted`,visibility:x===void 0?`visible`:`hidden`,children:`Click a text box (shift+click to extend) or drag a box, then add it to the recipe or drag it onto the Steps tab.`}),_.header!==void 0&&(0,I.jsx)(Aw,{size:`sm`,colorPalette:`green`,children:`table: ${_.header}${_.until===void 0?``:` until ${_.until}`}`}),A.data?.error!==void 0&&(0,I.jsx)(Aw,{size:`sm`,colorPalette:`orange`,children:A.data.error}),re.data?.error!==void 0&&(0,I.jsx)(Aw,{size:`sm`,colorPalette:`orange`,children:re.data.error})]}),(0,I.jsxs)(L,{flex:`1`,minH:`0`,display:`flex`,overflow:`hidden`,children:[(0,I.jsxs)(L,{flex:`2`,minW:`0`,overflow:`auto`,p:3,children:[N&&(0,I.jsxs)(L,{position:`relative`,width:`${String(n.width)}px`,height:`${String(n.height)}px`,children:[(0,I.jsx)(JN,{slide:E,width:n.width,height:n.height}),(0,I.jsxs)(`svg`,{"data-testid":`deck-overlay`,width:n.width,height:n.height,style:{position:`absolute`,top:0,left:0,cursor:`crosshair`},onMouseMove:fe,onMouseDown:pe,onMouseUp:me,onMouseLeave:()=>{b(void 0),de(void 0)},children:[D.map(e=>(0,I.jsx)(`rect`,{"data-testid":`recipe-region`,"data-step-id":e.id,"data-highlighted":e.id===s,...WN(e.box),fill:e.id===s?`rgba(234, 88, 12, 0.22)`:`rgba(234, 88, 12, 0.05)`,stroke:RN,strokeWidth:e.id===s?2:1,strokeDasharray:e.id===s?void 0:`4 3`,pointerEvents:`none`,children:(0,I.jsx)(`title`,{children:`In the recipe: ${e.id}`})},`recipe:${e.id}`)),y!==void 0&&C===void 0&&(0,I.jsx)(`rect`,{"data-testid":`snap-target`,...UN(y),fill:`rgba(29, 78, 216, 0.08)`,stroke:LN,strokeWidth:1.5,strokeDasharray:`3 2`,pointerEvents:`none`}),P!==void 0&&(0,I.jsx)(`rect`,{"data-testid":`staged-region`,...WN(P.box),fill:`rgba(155, 93, 229, 0.12)`,stroke:`#9b5de5`,strokeWidth:1.5,pointerEvents:`none`}),P!==void 0&&j?.shapes.map(e=>(0,I.jsx)(`rect`,{"data-testid":`staged-shape`,...UN(e),fill:`rgba(155, 93, 229, 0.28)`,pointerEvents:`none`},HN(e))),C!==void 0&&(0,I.jsx)(`rect`,{...WN({x1:C.startX,y1:C.startY,x2:C.currentX,y2:C.currentY}),fill:`rgba(155, 93, 229, 0.2)`,stroke:`#9b5de5`,strokeDasharray:`4 2`,pointerEvents:`none`})]}),P!==void 0&&(0,I.jsx)(vN,{left:Math.min(P.box.x1,P.box.x2),top:Math.max(P.box.y1,P.box.y2)+6,text:ie,loading:re.isPending,onAdd:ge,onClear:()=>{S(void 0)},onDragStart:_e})]}),!N&&d===`shapes`&&(0,I.jsx)(JN,{slide:E,width:n.width,height:n.height,headerRowIndex:_.headerRowIndex,onPick:M}),!N&&d===`table`&&O!==void 0&&(0,I.jsx)(YN,{table:O,headerRowIndexes:k,mode:h,onRowPick:oe,onCellPick:se}),!N&&d===`table`&&O===void 0&&(0,I.jsx)(H,{color:`fg.muted`,fontSize:`sm`,children:`This slide has no native tables.`}),!N&&te!==void 0&&(0,I.jsx)(ZN,{match:te})]}),(0,I.jsx)(L,{flex:`1`,minW:`220px`,maxW:`320px`,borderLeftWidth:`1px`,overflow:`auto`,p:3,children:(0,I.jsx)(XN,{slide:E,activeSource:d,activeTableIndex:p,onTablePick:ce,onChartPick:le,chartStepIds:ee,hoveredStepId:s,onHoverStepId:de})})]})]})}function BN(e,t,n){let r=e.merges.find(e=>e.top===t&&e.left===n);return r!==void 0&&r.bottom>r.top&&r.left===r.right}function VN(e){let t=e.currentTarget.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}function HN(e){return`staged:${String(e.x)}:${String(e.y)}`}function UN(e){return{x:e.x,y:e.y,width:Math.max(e.width,1),height:Math.max(e.height,1)}}function WN(e){let[t,n]=[Math.min(e.x1,e.x2),Math.max(e.x1,e.x2)],[r,i]=[Math.min(e.y1,e.y2),Math.max(e.y1,e.y2)];return{x:t,y:r,width:n-t,height:i-r}}function GN(e,t){let n;for(let r of e.shapes){let e=UN(r),i=Math.max(e.x-t.x,0,t.x-(e.x+e.width)),a=Math.max(e.y-t.y,0,t.y-(e.y+e.height)),o=Math.hypot(i,a);o<=FN&&(n===void 0||o<n.distance)&&(n={shape:r,distance:o})}return n?.shape}function KN({label:e,active:t,onClick:n}){return(0,I.jsx)(H,{as:`button`,fontSize:`sm`,fontWeight:t?`semibold`:`normal`,color:t?`colorPalette.fg`:`fg`,colorPalette:`blue`,cursor:`pointer`,onClick:n,children:e})}function qN({slides:e,value:t,onChange:n}){let r=l_({items:e.map((e,t)=>({label:`Slide ${String(e.number)}${e.title===void 0||e.title===``?``:` — ${e.title}`}${e.hidden?` (hidden)`:``}`,value:String(t)}))});return(0,I.jsxs)(VT,{collection:r,size:`sm`,width:`220px`,value:[String(t)],onValueChange:e=>{n(Number(e.value[0]))},children:[(0,I.jsx)(JT,{}),(0,I.jsx)(qT,{children:(0,I.jsx)(HT,{children:(0,I.jsx)(GT,{})})}),(0,I.jsx)(UT,{children:(0,I.jsx)(WT,{children:r.items.map(e=>(0,I.jsx)(KT,{item:e,children:e.label},e.value))})})]})}function JN({slide:e,width:t,height:n,headerRowIndex:r,onPick:i}){let a=r===void 0?void 0:new Set(e.shapeRows[r]);return(0,I.jsx)(L,{position:`relative`,width:`${String(t)}px`,height:`${String(n)}px`,borderWidth:`1px`,bg:`bg.panel`,children:e.shapes.map((e,t)=>(0,I.jsx)(L,{position:`absolute`,style:{left:`${String(e.x)}px`,top:`${String(e.y)}px`,width:`${String(Math.max(e.width,1))}px`,height:`${String(Math.max(e.height,1))}px`},borderWidth:`1px`,borderColor:a?.has(t)===!0?`orange.fg`:`border.muted`,bg:a?.has(t)===!0?`orange.subtle`:`bg`,overflow:`hidden`,px:1,fontSize:`xs`,cursor:i===void 0?`default`:`pointer`,_hover:i===void 0?void 0:{bg:`bg.emphasized`},onClick:i===void 0?void 0:()=>{i(t)},title:e.placeholder,children:e.text},`${String(e.x)}:${String(e.y)}:${String(t)}`))})}function YN({table:e,headerRowIndexes:t,mode:n,onRowPick:r,onCellPick:i}){return(0,I.jsx)(yE,{size:`sm`,variant:`outline`,children:(0,I.jsx)(TE,{children:e.rows.map((e,a)=>(0,I.jsx)(bE,{bg:t?.includes(a)===!0?`yellow.subtle`:void 0,children:e.map((e,t)=>(0,I.jsx)(wE,{fontSize:`xs`,cursor:`pointer`,_hover:{bg:`bg.emphasized`},onClick:()=>{n===`header`||n===`until`?r(a):i(a,t)},children:String(e.value)},t))},a))})})}function XN({slide:e,activeSource:t,activeTableIndex:n,onTablePick:r,onChartPick:i,chartStepIds:a,hoveredStepId:o,onHoverStepId:s}){return(0,I.jsxs)(kE,{align:`stretch`,gap:4,children:[(0,I.jsxs)(L,{children:[(0,I.jsx)(H,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,mb:1,children:`Native tables (${String(e.tables.length)})`}),e.tables.length===0&&(0,I.jsx)(H,{fontSize:`xs`,color:`fg.muted`,children:`None on this slide.`}),(0,I.jsx)(kE,{align:`stretch`,gap:1,children:e.tables.map((e,i)=>(0,I.jsxs)(L,{as:`button`,textAlign:`left`,p:2,borderWidth:`1px`,borderRadius:`sm`,bg:t===`table`&&n===i?`bg.emphasized`:void 0,onClick:()=>{r(i)},children:[(0,I.jsx)(H,{fontSize:`xs`,fontWeight:`medium`,children:e.name}),(0,I.jsx)(H,{fontSize:`2xs`,color:`fg.muted`,children:`${String(e.rows.length)} rows`})]},e.name))})]}),(0,I.jsxs)(L,{children:[(0,I.jsx)(H,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,mb:1,children:`Charts (${String(e.charts.length)})`}),e.charts.length===0&&(0,I.jsx)(H,{fontSize:`xs`,color:`fg.muted`,children:`None on this slide.`}),(0,I.jsx)(kE,{align:`stretch`,gap:1,children:e.charts.map((e,t)=>(0,I.jsxs)(L,{as:`button`,"data-testid":`deck-chart`,"data-step-ids":a[t],"data-highlighted":a[t]!==void 0&&a[t]===o,textAlign:`left`,p:2,borderWidth:`1px`,borderRadius:`sm`,borderColor:a[t]===void 0?void 0:`orange.solid`,borderStyle:a[t]===void 0||a[t]===o?`solid`:`dashed`,bg:a[t]!==void 0&&a[t]===o?`orange.subtle`:void 0,onClick:()=>{i(t)},onMouseEnter:()=>{s(a[t])},onMouseLeave:()=>{s(void 0)},children:[(0,I.jsxs)(G,{gap:1,children:[(0,I.jsx)(H,{fontSize:`xs`,fontWeight:`medium`,children:e.title??e.type}),a[t]!==void 0&&(0,I.jsx)(Aw,{size:`xs`,colorPalette:`orange`,title:`Already in the recipe: the step reading this`,children:a[t]})]}),(0,I.jsx)(H,{fontSize:`2xs`,color:`fg.muted`,children:`${e.type} · ${String(e.series.length)} series`})]},t))})]}),(0,I.jsxs)(L,{children:[(0,I.jsx)(H,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,mb:1,children:`Notes`}),(0,I.jsx)(H,{fontSize:`xs`,color:e.notes===``?`fg.muted`:`fg`,whiteSpace:`pre-wrap`,children:e.notes===``?`None.`:e.notes})]})]})}function ZN({match:e}){let t=e.rows.slice(0,PN);return(0,I.jsxs)(L,{borderTopWidth:`1px`,mt:3,maxH:`160px`,overflow:`auto`,children:[(0,I.jsx)(G,{px:0,py:1,gap:2,children:(0,I.jsx)(H,{fontSize:`xs`,color:`fg.muted`,children:`Live preview: ${String(e.rows.length)} row${e.rows.length===1?``:`s`} matched${e.title===``?``:` ("${e.title}")`}`})}),(0,I.jsxs)(yE,{size:`sm`,variant:`outline`,children:[(0,I.jsx)(SE,{children:(0,I.jsx)(bE,{children:e.header.map(e=>(0,I.jsx)(CE,{fontSize:`2xs`,children:e},e))})}),(0,I.jsx)(TE,{children:t.map((t,n)=>(0,I.jsx)(bE,{children:e.header.map(e=>(0,I.jsx)(wE,{fontSize:`2xs`,children:String(t[e]??``)},e))},n))})]})]})}var QN=7,$N=4/3,eP=24,tP=64,nP=4;function rP(e,t,n){let r=e.defaultColumnWidth===void 0?tP:aP(e.defaultColumnWidth),i=e.defaultRowHeight===void 0?eP:oP(e.defaultRowHeight),a=[0];for(let n=0;n<t;n+=1){let t=e.columnWidths?.[String(n)];a.push(a[n]+(t===void 0?r:aP(t)))}let o=[0];for(let t=0;t<n;t+=1){let n=e.rowHeights?.[String(t)];o.push(o[t]+(n===void 0?i:oP(n)))}return{columnLefts:a,rowTops:o,width:a[t],height:o[n]}}function iP(e){let t=``;for(let n=e+1;n>0;n=Math.floor((n-1)/26))t=String.fromCodePoint(65+(n-1)%26)+t;return t}function aP(e){return Math.max(nP,Math.round(e*QN))}function oP(e){return Math.max(nP,Math.round(e*$N))}var sP=[],cP=24,lP=44,uP=30,dP=5;function fP({recipeId:e,stepPath:t,view:n,onTablePick:r,onCellPick:i,steps:a=sP,hoveredStepId:o,onHoverStepId:s,csvOverride:c,onCsvOverrideChange:l}){let[u,d]=(0,F.useState)(0),[f,p]=(0,F.useState)(`cell`),[m,h]=(0,F.useState)({}),[g,_]=(0,F.useState)(void 0),[v,y]=(0,F.useState)(void 0),[b,x]=(0,F.useState)(void 0),S=(0,F.useRef)(null),C=(0,F.useRef)(void 0),w=n.sheets[u],T=(0,F.useMemo)(()=>kN(a,w?.name??``),[a,w?.name]),E=(0,F.useMemo)(()=>w===void 0?[]:eN(w),[w]),D=(0,F.useMemo)(()=>w===void 0?[]:_P(w),[w]),ee=m.headerRowIndex===void 0?void 0:Array.from({length:m.headerRows??1},(e,t)=>m.headerRowIndex+t),O=bk(e,t,m.header===void 0?void 0:{sheet:m.sheet,header:m.header,until:m.until,columns:m.columns,headerRows:m.headerRows,fillDown:m.fillDown,includeHidden:m.includeHidden}),k=(0,F.useMemo)(()=>O.data?.matches.find(e=>e.sheet===w?.name),[O.data,w?.name]),A=(0,F.useMemo)(()=>rP(w??{},w?.columnCount??0,w?.rows.length??0),[w]),te=(0,F.useCallback)(e=>`${String(u)}:${String(e)}`,[u]),ne=Xk({count:w?.rows.length??0,getScrollElement:()=>S.current,estimateSize:e=>A.rowTops[e+1]-A.rowTops[e],getItemKey:te,overscan:uP});(0,F.useEffect)(()=>{m.header!==void 0&&r(rN(m,t))},[m]);let re=f===`cell`,j=b!==void 0&&w!==void 0&&b.sheet===w.name?b:void 0,ie=j===void 0?void 0:iN(j.sheet,j.range),ae=j===void 0||w===void 0?void 0:sN(w,j.range);if(w===void 0)return(0,I.jsx)(L,{p:4,color:`fg.muted`,children:(0,I.jsx)(H,{children:`This workbook has no sheets.`})});function oe(e){s!==void 0&&C.current!==e&&(C.current=e,s(e))}function se(e,t){let n=j;x(t&&n!==void 0?{sheet:w.name,range:aN(n.range,e)}:{sheet:w.name,range:e})}function M(e,t){re&&t.button===0&&(t.stopPropagation(),y(e))}function ce(e,t){if(!re)return;t.stopPropagation();let n=v??e;y(void 0),se({top:Math.min(n.row,e.row),left:Math.min(n.column,e.column),bottom:Math.max(n.row,e.row),right:Math.max(n.column,e.column)},t.shiftKey)}function le(e){re&&(y(void 0),e.shiftKey||x(void 0))}function ue(){if(j!==void 0&&ie!==void 0&&ae!==void 0)return cN(ie,t,qM(ae),!oN(j.range))}function de(){let e=ue();e!==void 0&&(i(e),x(void 0))}function fe(e){let t=ue();t!==void 0&&ae!==void 0&&(e.dataTransfer.setData(CA,wA(t)),e.dataTransfer.setData(`text/plain`,ae),e.dataTransfer.effectAllowed=`copy`)}function pe(e){if(d(e),f!==`sheet`)return;let t=n.sheets[e].name;h(e=>({...e,sheet:QM(t)}))}function me(e){let t=$M(w.rows[e]);t!==``&&h(n=>n.headerRowIndex!==void 0&&e===n.headerRowIndex+(n.headerRows??1)?{...n,headerRows:(n.headerRows??1)+1}:{sheet:n.sheet,includeHidden:n.includeHidden,header:VM(t),headerRowIndex:e,headerRows:1})}function he(e){if(m.header===void 0)return;let t=$M(w.rows[e]);t!==``&&h(e=>({...e,until:VM(t)}))}function ge(e){if(ee===void 0)return;let t=tN(E,ee,e);if(t===``)return;let n=HM(t);h(e=>({...e,columns:{...e.columns,[n]:VM(t)}}))}function _e(e){if(ee===void 0)return;let t=tN(E,ee,e);if(t===``)return;let n=nN(m,t);h(e=>{let t=e.fillDown??[];return t.includes(n)?e:{...e,fillDown:[...t,n]}})}function N(e,t,n){if(f===`header`){me(e);return}if(f===`until`){he(e);return}if(f===`column`){ge(t);return}f===`fillDown`&&n&&_e(t)}return(0,I.jsxs)(L,{h:`full`,display:`flex`,flexDirection:`column`,children:[(0,I.jsx)(G,{px:3,py:2,borderBottomWidth:`1px`,gap:1,flexShrink:0,flexWrap:`wrap`,children:n.sheets.map((e,t)=>(0,I.jsx)(xP,{sheet:e,active:t===u,onClick:()=>{pe(t)}},e.name))}),(0,I.jsxs)(G,{px:3,py:2,borderBottomWidth:`1px`,gap:3,flexShrink:0,flexWrap:`wrap`,children:[(0,I.jsx)(bP,{label:`Cell`,active:re,onClick:()=>{p(`cell`)}}),(0,I.jsx)(bP,{label:`Sheet`,active:f===`sheet`,onClick:()=>{p(`sheet`)}}),(0,I.jsx)(bP,{label:`Header row(s)`,active:f===`header`,onClick:()=>{p(`header`)}}),(0,I.jsx)(bP,{label:`First non-data row (until)`,active:f===`until`,onClick:()=>{p(`until`)}}),(0,I.jsx)(bP,{label:`Column`,active:f===`column`,onClick:()=>{p(`column`)}}),(0,I.jsx)(bP,{label:`Fill down`,active:f===`fillDown`,onClick:()=>{p(`fillDown`)}}),n.csv!==void 0&&(0,I.jsx)(DP,{format:n.csv,override:c,onChange:l}),re&&(0,I.jsx)(H,{fontSize:`xs`,color:`fg.muted`,visibility:b===void 0?`visible`:`hidden`,children:`Click a cell (shift+click, or press and release, for a range), then add it to the recipe or drag it onto the Steps tab.`}),m.header!==void 0&&(0,I.jsx)(Aw,{size:`sm`,colorPalette:`green`,children:`table: ${m.header}${m.until===void 0?``:` until ${m.until}`}`}),O.data?.error!==void 0&&(0,I.jsx)(Aw,{size:`sm`,colorPalette:`orange`,children:O.data.error})]}),(0,I.jsxs)(L,{flex:`1`,minH:`0`,display:`flex`,flexDirection:`column`,children:[(0,I.jsx)(L,{ref:S,flex:`1`,minH:`0`,overflow:`auto`,position:`relative`,onMouseUp:le,onMouseLeave:()=>{_(void 0),oe(void 0)},children:(0,I.jsxs)(L,{position:`relative`,style:{height:`${String(cP+A.height)}px`,width:`${String(lP+A.width)}px`},children:[(0,I.jsx)(hP,{geometry:A}),(0,I.jsx)(gP,{geometry:A,rowIndexes:ne.getVirtualItems().map(e=>e.index),hiddenRows:w.hiddenRows}),ne.getVirtualItems().map(e=>D[e.index]?.map(t=>t===void 0?null:(0,I.jsx)(TP,{cell:t,box:pP(A,e.index,t),isHeader:ee?.includes(e.index)??!1,isHidden:w.hiddenRows.includes(e.index),isSnapped:re&&g?.row===e.index&&g.column===t.columnIndex,isStaged:j!==void 0&&yP(j.range,e.index,t.columnIndex),stepIds:AN(e.index,t.columnIndex,T),hoveredStepId:o,onClick:re?void 0:()=>{N(e.index,t.columnIndex,t.isMergeLabel)},onMouseEnter:n=>{re&&_({row:e.index,column:t.columnIndex}),oe(n[0])},onMouseDown:re?n=>{M({row:e.index,column:t.columnIndex},n)}:void 0,onMouseUp:re?n=>{ce({row:e.index,column:t.columnIndex},n)}:void 0},`${String(e.index)}:${String(t.columnIndex)}`))),j!==void 0&&(0,I.jsx)(vN,{left:lP+A.columnLefts[j.range.left],top:cP+A.rowTops[j.range.bottom+1]+4,text:ae,loading:!1,onAdd:de,onClear:()=>{x(void 0)},onDragStart:fe})]})}),k!==void 0&&(0,I.jsx)(EP,{match:k})]})]})}function pP(e,t,n){let r=e.columnLefts.length-1,i=e.rowTops.length-1,a=e.columnLefts[n.columnIndex],o=e.rowTops[t];return{top:cP+o,left:lP+a,width:e.columnLefts[Math.min(n.columnIndex+n.colSpan,r)]-a,height:e.rowTops[Math.min(t+n.rowSpan,i)]-o}}var mP={fontSize:`11px`,fontWeight:600};function hP({geometry:e}){let t=e.columnLefts.length-1;return(0,I.jsxs)(L,{position:`sticky`,top:0,zIndex:3,bg:`bg.muted`,borderBottomWidth:`1px`,style:{height:`${String(cP)}px`,width:`${String(lP+e.columnLefts[t])}px`},children:[(0,I.jsx)(L,{position:`sticky`,left:0,zIndex:4,bg:`bg.muted`,borderRightWidth:`1px`,style:{width:`${String(lP)}px`,height:`${String(cP)}px`}}),Array.from({length:t},(t,n)=>(0,I.jsx)(L,{"data-testid":`column-header`,position:`absolute`,top:0,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRightWidth:`1px`,color:`fg.muted`,overflow:`hidden`,style:{...mP,left:`${String(lP+e.columnLefts[n])}px`,width:`${String(e.columnLefts[n+1]-e.columnLefts[n])}px`,height:`${String(cP)}px`},children:iP(n)},iP(n)))]})}function gP({geometry:e,rowIndexes:t,hiddenRows:n}){return(0,I.jsx)(L,{position:`sticky`,left:0,zIndex:2,bg:`bg.muted`,borderRightWidth:`1px`,style:{width:`${String(lP)}px`,height:`${String(e.height)}px`},children:t.map(t=>(0,I.jsx)(L,{"data-testid":`row-header`,position:`absolute`,left:0,display:`flex`,alignItems:`center`,justifyContent:`center`,borderBottomWidth:`1px`,color:`fg.muted`,overflow:`hidden`,opacity:n.includes(t)?.4:1,style:{...mP,top:`${String(e.rowTops[t])}px`,width:`${String(lP)}px`,height:`${String(e.rowTops[t+1]-e.rowTops[t])}px`},children:t+1},t))})}function _P(e){let t=vP(e.merges),n=new Map(e.merges.map(e=>[`${String(e.top)}:${String(e.left)}`,{rowSpan:e.bottom-e.top+1,colSpan:e.right-e.left+1}]));return e.rows.map((e,r)=>e.map((e,i)=>{let a=`${String(r)}:${String(i)}`;if(t.has(a))return;let o=n.get(a);return{columnIndex:i,rowSpan:o?.rowSpan??1,colSpan:o?.colSpan??1,value:e.value,type:e.type,isMergeLabel:o!==void 0&&o.rowSpan>1&&o.colSpan===1}}))}function vP(e){let t=new Set;for(let n of e)for(let e=n.top;e<=n.bottom;e+=1)for(let r=n.left;r<=n.right;r+=1)(e!==n.top||r!==n.left)&&t.add(`${String(e)}:${String(r)}`);return t}function yP(e,t,n){return t>=e.top&&t<=e.bottom&&n>=e.left&&n<=e.right}function bP({label:e,active:t,onClick:n}){return(0,I.jsx)(H,{as:`button`,fontSize:`sm`,fontWeight:t?`semibold`:`normal`,color:t?`colorPalette.fg`:`fg`,colorPalette:`blue`,cursor:`pointer`,onClick:n,children:e})}function xP({sheet:e,active:t,onClick:n}){return(0,I.jsxs)(G,{as:`button`,gap:1,px:2,py:1,borderRadius:`sm`,bg:t?`bg.emphasized`:void 0,opacity:e.hidden?.55:1,onClick:n,children:[(0,I.jsx)(H,{fontSize:`sm`,fontWeight:t?`semibold`:`normal`,children:e.name}),e.hidden&&(0,I.jsx)(Aw,{size:`xs`,colorPalette:`gray`,children:`hidden`})]})}var SP={string:`fg`,number:`orange.fg`,boolean:`blue.fg`,date:`purple.fg`};function CP(e,t,n){return e?`purple.fg`:t?`blue.fg`:n?`orange.solid`:`border.muted`}function wP(e,t,n,r){return n?`purple.muted`:r?`orange.subtle`:t?`yellow.subtle`:e.isMergeLabel?`purple.subtle`:`bg`}function TP({cell:e,box:t,isHeader:n,isHidden:r,isSnapped:i,isStaged:a,stepIds:o,hoveredStepId:s,onClick:c,onMouseEnter:l,onMouseDown:u,onMouseUp:d}){let f=o.length>0,p=s!==void 0&&o.includes(s);return(0,I.jsx)(L,{"data-testid":i?`snap-target`:a?`staged-cell`:`grid-cell`,"data-step-ids":f?o.join(` `):void 0,"data-highlighted":p,position:`absolute`,style:{top:`${String(t.top)}px`,left:`${String(t.left)}px`,width:`${String(t.width)}px`,height:`${String(t.height)}px`},borderWidth:f?`2px`:`1px`,borderStyle:f&&!p?`dashed`:`solid`,borderColor:CP(a,i,f),bg:wP(e,n,a,p),opacity:r?.4:1,overflow:`hidden`,px:1,fontSize:`xs`,color:SP[e.type],cursor:c===void 0?`cell`:`pointer`,_hover:{bg:a?`purple.muted`:`bg.emphasized`},onClick:c,onMouseEnter:l===void 0?void 0:()=>{l(o)},onMouseDown:u,onMouseUp:d,title:f?`In the recipe: ${o.join(`, `)}`:r?`Hidden row`:void 0,truncate:!0,children:String(e.value)})}function EP({match:e}){let t=e.rows.slice(0,dP);return(0,I.jsxs)(L,{borderTopWidth:`1px`,maxH:`160px`,overflow:`auto`,flexShrink:0,children:[(0,I.jsx)(G,{px:2,py:1,gap:2,children:(0,I.jsx)(H,{fontSize:`xs`,color:`fg.muted`,children:`Live preview: ${String(e.rows.length)} row${e.rows.length===1?``:`s`} matched${e.title===``?``:` ("${e.title}")`}`})}),(0,I.jsxs)(yE,{size:`sm`,variant:`outline`,children:[(0,I.jsx)(SE,{children:(0,I.jsx)(bE,{children:e.header.map(e=>(0,I.jsx)(CE,{fontSize:`2xs`,children:e},e))})}),(0,I.jsx)(TE,{children:t.map((t,n)=>(0,I.jsx)(bE,{children:e.header.map(e=>(0,I.jsx)(wE,{fontSize:`2xs`,children:String(t[e]??``)},e))},n))})]})]})}function DP({format:e,override:t,onChange:n}){let r=t?.delimiter??e.delimiter,i=t?.encoding??e.encoding;return(0,I.jsxs)(G,{gap:2,children:[(0,I.jsx)(H,{fontSize:`xs`,color:`fg.muted`,children:`Delimiter`}),(0,I.jsx)(DT,{size:`xs`,width:`40px`,defaultValue:r,onBlur:e=>{let i=e.target.value;i!==``&&i!==r&&n({delimiter:i,encoding:t?.encoding})}},r),(0,I.jsx)(H,{fontSize:`xs`,color:`fg.muted`,children:`Encoding`}),(0,I.jsx)(DT,{size:`xs`,width:`110px`,defaultValue:i,onBlur:e=>{let r=e.target.value;r!==``&&r!==i&&n({delimiter:t?.delimiter,encoding:r})}},i)]})}var OP=`modulepreload`,kP=function(e){return`/`+e},AP={},jP=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=kP(t,n),t=s(t),t in AP)return;AP[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:OP,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},MP=[],NP=1.5,PP=1.2,FP=24,IP=4,LP=[`#2e86ab`,`#3bb273`],RP=`#e4572e`,zP=`rgba(59, 178, 115, 0.18)`,BP=`#1d4ed8`,VP=`#ea580c`;function HP({recipeId:e,stepPath:t,view:n,bytesUrl:r,onTablePick:i,onRegionPick:a,steps:o=MP,hoveredStepId:s,onHoverStepId:c}){let[l,u]=(0,F.useState)(0),[d,f]=(0,F.useState)(`text`),[p,m]=(0,F.useState)({}),[h,g]=(0,F.useState)(void 0),[_,v]=(0,F.useState)(void 0),[y,b]=(0,F.useState)(void 0),x=(0,F.useRef)(null),S=(0,F.useRef)(void 0),C=n.pages[l],w=(0,F.useMemo)(()=>TN(o,`page`,C?.number??-1),[o,C?.number]),T=C===void 0?0:Math.ceil(C.width*NP),E=C===void 0?0:Math.ceil(C.height*NP),D=_k(e,t,p.header===void 0?void 0:{header:p.header,until:p.until,columns:p.columns}),ee=(0,F.useMemo)(()=>D.data?.matches.find(e=>e.page===C?.number),[D.data,C?.number]),O=_===void 0?void 0:WM(`page`,_.page,_.box),k=vk(e,t,O),A=k.data?.matches.find(e=>e.page===_?.page),te=A?.text;if((0,F.useEffect)(()=>{p.header!==void 0&&i(UM(p,t))},[p]),(0,F.useEffect)(()=>{let e=x.current;if(e===null||C===void 0)return;let t=new AbortController;return $P(e,r,C.number,NP,t.signal).catch(e=>{t.signal.aborted||console.error(`PDF canvas: could not render the page`,e)}),()=>{t.abort()}},[r,C?.number]),C===void 0)return(0,I.jsx)(L,{p:4,color:`fg.muted`,children:(0,I.jsx)(H,{children:`This PDF has no pages.`})});function ne(e){let t=e.cells[0]?.text??``;if(d===`header`){m({header:VM(t)});return}d===`until`&&p.header!==void 0&&m(e=>({...e,until:VM(t)}))}function re(e){p.header!==void 0&&m(t=>({...t,columns:{...t.columns,[HM(e)]:VM(e)}}))}function j(e,t){let n=_;v(t&&n!==void 0&&n.page===C.number?{page:C.number,box:KM(n.box,e)}:{page:C.number,box:e})}function ie(e){c!==void 0&&S.current!==e&&(S.current=e,c(e))}function ae(e){if(d!==`text`)return;let t=UP(e);if(y!==void 0){b({...y,currentX:t.x,currentY:t.y});return}let n=JP(C,t);g(n),ie(n===void 0?void 0:DN(GM(n),w)[0])}function oe(e){if(d!==`text`||e.button!==0)return;let t=UP(e);b({startX:t.x,startY:t.y,currentX:t.x,currentY:t.y})}function se(e){if(d!==`text`||y===void 0)return;let t=UP(e);if(b(void 0),Math.abs(t.x-y.startX)+Math.abs(t.y-y.startY)>IP){j(qP(C,y.startX,y.startY,t.x,t.y),e.shiftKey);return}let n=JP(C,t);if(n===void 0){e.shiftKey||v(void 0);return}j(GM(n),e.shiftKey)}function M(){if(O!==void 0&&te!==void 0)return JM(O,t,qM(te))}function ce(){let e=M();e!==void 0&&(a(e),v(void 0))}function le(e){let t=M();t!==void 0&&te!==void 0&&(e.dataTransfer.setData(CA,wA(t)),e.dataTransfer.setData(`text/plain`,te),e.dataTransfer.effectAllowed=`copy`)}let ue=d===`text`,de=_!==void 0&&_.page===C.number?_:void 0;return(0,I.jsxs)(L,{h:`full`,display:`flex`,flexDirection:`column`,children:[(0,I.jsxs)(G,{px:3,py:2,borderBottomWidth:`1px`,gap:3,flexShrink:0,flexWrap:`wrap`,children:[n.pages.length>1&&(0,I.jsx)(XP,{pages:n.pages.length,value:l,onChange:u}),(0,I.jsx)(YP,{label:`Text`,active:ue,onClick:()=>{f(`text`)}}),(0,I.jsx)(YP,{label:`Header row`,active:d===`header`,onClick:()=>{f(`header`)}}),(0,I.jsx)(YP,{label:`Last row (until)`,active:d===`until`,onClick:()=>{f(`until`)}}),(0,I.jsx)(YP,{label:`Column`,active:d===`column`,onClick:()=>{f(`column`)}}),(0,I.jsx)(H,{fontSize:`xs`,color:`fg.muted`,children:`${String(C.rowCount)} rows, ${String(C.cellCount)} cells${C.hasTextLayer?``:` — no text layer (a scan?)`}`}),ue&&(0,I.jsx)(H,{fontSize:`xs`,color:`fg.muted`,visibility:_===void 0?`visible`:`hidden`,children:`Click a line (shift+click to extend) or drag a box, then add it to the recipe or drag it onto the Steps tab.`}),p.header!==void 0&&(0,I.jsx)(Aw,{size:`sm`,colorPalette:`green`,children:`table: ${p.header}${p.until===void 0?``:` until ${p.until}`}`}),D.data?.error!==void 0&&(0,I.jsx)(Aw,{size:`sm`,colorPalette:`orange`,children:D.data.error}),k.data?.error!==void 0&&(0,I.jsx)(Aw,{size:`sm`,colorPalette:`orange`,children:k.data.error})]}),(0,I.jsx)(L,{flex:`1`,minH:`0`,overflow:`auto`,position:`relative`,children:(0,I.jsxs)(L,{position:`relative`,width:`${String(T)}px`,height:`${String(E)}px`,children:[(0,I.jsx)(`canvas`,{ref:x,width:T,height:E,style:{position:`absolute`,top:0,left:0}}),(0,I.jsxs)(`svg`,{"data-testid":`pdf-overlay`,width:T,height:E,style:{position:`absolute`,top:0,left:0,cursor:ue?`crosshair`:`pointer`},onMouseMove:ae,onMouseDown:oe,onMouseUp:se,onMouseLeave:()=>{g(void 0),ie(void 0)},children:[w.map(e=>(0,I.jsx)(`rect`,{"data-testid":`recipe-region`,"data-step-id":e.id,"data-highlighted":e.id===s,...KP(e.box,C.height),fill:e.id===s?`rgba(234, 88, 12, 0.22)`:`rgba(234, 88, 12, 0.05)`,stroke:VP,strokeWidth:e.id===s?2:1,strokeDasharray:e.id===s?void 0:`4 3`,pointerEvents:`none`,children:(0,I.jsx)(`title`,{children:`In the recipe: ${e.id}`})},`recipe:${e.id}`)),C.rows.map((e,t)=>(0,I.jsx)(ZP,{row:e,colour:e.cells[0]?.text!==void 0&&ee?.headerRowIndex===t?RP:LP[t%2],highlighted:ee?.matchedRowIndices.includes(t)??!1,scale:NP,pageHeight:C.height,cursor:ue?`crosshair`:`pointer`,onClick:ue?void 0:()=>{ne(e)}},`${String(e.top)}:${String(e.bottom)}`)),d===`column`&&ee!==void 0&&ee.bands.map(e=>(0,I.jsx)(QP,{band:e,scale:NP,pageHeight:C.height,onClick:()=>{re(e.name)}},e.column)),ue&&h!==void 0&&y===void 0&&(0,I.jsx)(`rect`,{"data-testid":`snap-target`,...GP(h,C.height),fill:`rgba(29, 78, 216, 0.08)`,stroke:BP,strokeWidth:1.5,strokeDasharray:`3 2`,pointerEvents:`none`}),de!==void 0&&(0,I.jsx)(`rect`,{"data-testid":`staged-region`,...KP(de.box,C.height),fill:`rgba(155, 93, 229, 0.12)`,stroke:`#9b5de5`,strokeWidth:1.5,pointerEvents:`none`}),de!==void 0&&A?.cells.map(e=>(0,I.jsx)(`rect`,{"data-testid":`staged-cell`,...GP(e,C.height),fill:`rgba(155, 93, 229, 0.28)`,pointerEvents:`none`},WP(e))),y!==void 0&&(0,I.jsx)(`rect`,{x:Math.min(y.startX,y.currentX),y:Math.min(y.startY,y.currentY),width:Math.abs(y.currentX-y.startX),height:Math.abs(y.currentY-y.startY),fill:`rgba(155, 93, 229, 0.2)`,stroke:`#9b5de5`,strokeDasharray:`4 2`,pointerEvents:`none`})]}),de!==void 0&&(0,I.jsx)(vN,{left:Math.min(de.box.x1,de.box.x2)*NP,top:(C.height-Math.min(de.box.y1,de.box.y2))*NP+6,text:te,loading:k.isPending,onAdd:ce,onClear:()=>{v(void 0)},onDragStart:le})]})})]})}function UP(e){let t=e.currentTarget.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}function WP(e){return`staged:${String(e.x)}:${String(e.y)}`}function GP(e,t){return{x:e.x*NP,y:(t-e.y-e.height)*NP,width:Math.max(e.width,1)*NP,height:e.height*NP*PP}}function KP(e,t){let[n,r]=[Math.min(e.x1,e.x2),Math.max(e.x1,e.x2)],[i,a]=[Math.min(e.y1,e.y2),Math.max(e.y1,e.y2)];return{x:n*NP,y:(t-a)*NP,width:(r-n)*NP,height:(a-i)*NP}}function qP(e,t,n,r,i){return{x1:t/NP,y1:e.height-n/NP,x2:r/NP,y2:e.height-i/NP}}function JP(e,t){let n;for(let r of e.rows)for(let i of r.cells){let r=GP(i,e.height),a=Math.max(r.x-t.x,0,t.x-(r.x+r.width)),o=Math.max(r.y-t.y,0,t.y-(r.y+r.height)),s=Math.hypot(a,o);s<=FP&&(n===void 0||s<n.distance)&&(n={cell:i,distance:s})}return n?.cell}function YP({label:e,active:t,onClick:n}){return(0,I.jsx)(H,{as:`button`,fontSize:`sm`,fontWeight:t?`semibold`:`normal`,color:t?`colorPalette.fg`:`fg`,colorPalette:`blue`,cursor:`pointer`,onClick:n,children:e})}function XP({pages:e,value:t,onChange:n}){let r=l_({items:Array.from({length:e},(e,t)=>({label:`Page ${String(t+1)}`,value:String(t)}))});return(0,I.jsxs)(VT,{collection:r,size:`sm`,width:`140px`,value:[String(t)],onValueChange:e=>{n(Number(e.value[0]))},children:[(0,I.jsx)(JT,{}),(0,I.jsx)(qT,{children:(0,I.jsx)(HT,{children:(0,I.jsx)(GT,{})})}),(0,I.jsx)(UT,{children:(0,I.jsx)(WT,{children:r.items.map(e=>(0,I.jsx)(KT,{item:e,children:e.label},e.value))})})]})}function ZP({row:e,colour:t,highlighted:n,scale:r,pageHeight:i,cursor:a,onClick:o}){return(0,I.jsxs)(`g`,{onClick:o,style:{cursor:a},children:[n&&e.cells.length>0&&(0,I.jsx)(`rect`,{x:Math.min(...e.cells.map(e=>e.x))*r,y:(i-e.top)*r,width:(Math.max(...e.cells.map(e=>e.x+e.width))-Math.min(...e.cells.map(e=>e.x)))*r,height:(e.top-e.bottom)*r,fill:zP}),e.cells.map(e=>(0,I.jsx)(`rect`,{x:e.x*r,y:(i-e.y-e.height)*r,width:Math.max(e.width,1)*r,height:e.height*r*PP,fill:`transparent`,stroke:t,strokeWidth:1.5},`${String(e.x)}:${String(e.y)}`))]})}function QP({band:e,scale:t,pageHeight:n,onClick:r}){return(0,I.jsx)(`rect`,{x:e.start*t,y:0,width:Math.max(e.end-e.start,1)*t,height:n*t,fill:`rgba(46, 134, 171, 0.08)`,stroke:`#2e86ab`,strokeDasharray:`4 2`,onClick:r,style:{cursor:`pointer`},children:(0,I.jsx)(`title`,{children:e.name})})}async function $P(e,t,n,r,i){let a=await jP(()=>import(`./pdf-Dt4HqIG1.js`),[]),o=await jP(()=>import(`./pdf.worker.min-D7i8o3wR.js`),[]);a.GlobalWorkerOptions.workerSrc=o.default;let s=a.getDocument({url:t}),c=await s.promise;try{let t=await c.getPage(n);if(i.aborted)return;let a=t.getViewport({scale:r});e.width=Math.ceil(a.width),e.height=Math.ceil(a.height);let o=e.getContext(`2d`);if(o===null)return;let s=t.render({canvas:e,canvasContext:o,viewport:a});i.addEventListener(`abort`,()=>{s.cancel()}),await s.promise}finally{await s.destroy()}}function eF(e,t){return{kind:`card`,path:t,stepType:`goto`,sentence:[{kind:`word`,text:`Go to`},{kind:`code`,text:e}],custom:!1,step:{type:`goto`,url:e}}}function tF(e,t){return[{type:`goto`,url:e},...t]}function nF(e,t,n,r){return{...n,steps:tF(e,t),keep:[`cookies`],saveTo:r}}function rF(e){let t=e.start;if(!Array.isArray(t))return;let n=t[0];if(typeof n!=`object`||!n)return;let r=n.url;return typeof r==`string`?r:void 0}function iF(e,t){let n=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`)),r=n===-1?`.`:e.slice(0,n),i=n===-1||e[n]===void 0?`/`:e[n];return`${r}${i}storage${i}${t}-session.json`}function aF(e,t,n){let r=[`[data-oc-node] { cursor: ${e?`crosshair`:`inherit`}; }`,`[data-oc-node]:hover { outline: 2px solid #3182ce !important; outline-offset: -2px; }`];return n!==void 0&&n!==``&&r.push(`${n} { outline: 2px solid #dd6b20 !important; outline-offset: -2px; background: rgba(221,107,32,0.08) !important; }`),t&&r.push(`[data-oc-hidden] { display: revert !important; visibility: visible !important; opacity: 0.5 !important; outline: 1px dashed #ed8936 !important; }`),r.join(`
|
|
15
|
+
`)}var oF=`data-oc-node`,sF=`opencraw-picker-style`;function cF({html:e,pickMode:t,showHidden:n,hoveredSelector:r,onHoverNode:i,onPickNode:a}){let o=(0,F.useRef)(null),s=(0,F.useRef)({pickMode:t,onHoverNode:i,onPickNode:a});return s.current={pickMode:t,onHoverNode:i,onPickNode:a},(0,F.useEffect)(()=>{let e=o.current;if(e===null)return;let t,n=e=>{s.current.onHoverNode(lF(e.target))},r=()=>{s.current.onHoverNode(void 0)},i=e=>{if(!s.current.pickMode)return;let t=lF(e.target);t!==void 0&&(e.preventDefault(),e.stopPropagation(),s.current.onPickNode(t))},a=()=>{let a=e.contentDocument;a!==null&&(a.addEventListener(`mouseover`,n),a.addEventListener(`mouseout`,r),a.addEventListener(`click`,i,{capture:!0}),t=()=>{a.removeEventListener(`mouseover`,n),a.removeEventListener(`mouseout`,r),a.removeEventListener(`click`,i,{capture:!0})})};return e.addEventListener(`load`,a),()=>{e.removeEventListener(`load`,a),t?.()}},[e]),(0,F.useEffect)(()=>{let e=o.current?.contentDocument;if(e==null)return;let i=e.getElementById(sF);i===null&&(i=e.createElement(`style`),i.id=sF,e.head?.append(i)),i.textContent=aF(t,n,r)}),(0,I.jsx)(`iframe`,{ref:o,title:`Snapshot`,sandbox:`allow-same-origin`,srcDoc:e,style:{width:`100%`,height:`100%`,border:`none`,background:`white`}})}function lF(e){return(e?.nodeType===Node.ELEMENT_NODE?e.closest(`[${CSS.escape(oF)}]`):null)?.getAttribute(oF)??void 0}var uF=[],dF={object:`purple.fg`,array:`purple.fg`,element:`purple.fg`,string:`green.fg`,number:`orange.fg`,boolean:`blue.fg`,null:`fg.muted`};function fF({tree:e,onPick:t,steps:n=uF,hoveredStepId:r,onHoverStepId:i}){let[a,o]=(0,F.useState)(()=>new Set);function s(e){o(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return(0,I.jsxs)(L,{h:`full`,overflow:`auto`,fontFamily:`mono`,fontSize:`xs`,py:2,children:[e.namespaces!==void 0&&Object.keys(e.namespaces).length>0&&(0,I.jsxs)(G,{px:2,pb:2,gap:2,flexWrap:`wrap`,children:[(0,I.jsx)(H,{color:`fg.muted`,children:`Namespaces:`}),Object.entries(e.namespaces).map(([e,t])=>(0,I.jsx)(Aw,{size:`xs`,colorPalette:`gray`,children:`${e}: ${t}`},e))]}),(0,I.jsx)(pF,{node:e.root,depth:0,collapsed:a,onToggle:s,onPick:t,steps:n,hoveredStepId:r,onHoverStepId:i})]})}function pF({node:e,depth:t,collapsed:n,onToggle:r,onPick:i,steps:a,hoveredStepId:o,onHoverStepId:s}){let c=e.children.length>0,l=n.has(e.id),u=e.valueType!==`object`&&e.valueType!==`array`&&e.valueType!==`element`,d=CN(e,a),f=o!==void 0&&d.includes(o);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(G,{"data-testid":`tree-node`,"data-highlighted":f,"data-step-ids":d.length===0?void 0:d.join(` `),gap:1,pl:`${t*14+4}px`,pr:2,minH:`20px`,cursor:`pointer`,bg:f?`orange.subtle`:void 0,_hover:{bg:f?`orange.subtle`:`bg.emphasized`},onClick:()=>{i(e,`value`)},onMouseEnter:s===void 0?void 0:()=>{s(d[0])},onMouseLeave:s===void 0?void 0:()=>{s(void 0)},children:[c?(0,I.jsx)(H,{as:`button`,w:`12px`,flexShrink:0,color:`fg.muted`,onClick:t=>{t.stopPropagation(),r(e.id)},children:l?`▸`:`▾`}):(0,I.jsx)(L,{w:`12px`,flexShrink:0}),(0,I.jsx)(H,{as:`span`,color:dF[e.valueType],fontWeight:`medium`,children:e.label}),u&&e.preview!==void 0&&(0,I.jsx)(H,{as:`span`,color:`fg.muted`,truncate:!0,children:e.preview}),d.map(e=>(0,I.jsx)(Aw,{size:`xs`,colorPalette:`orange`,variant:f?`solid`:`subtle`,title:`Already in the recipe: the step reading this`,flexShrink:0,children:e},e)),e.listPath!==void 0&&(0,I.jsx)(Aw,{as:`button`,size:`xs`,colorPalette:`blue`,onClick:t=>{t.stopPropagation(),i(e,`list`)},title:`Read every one of the ${String(e.listCount??0)} items in this list`,children:`[*] ×${String(e.listCount??0)}`}),u&&e.jsonpath!==void 0&&(0,I.jsx)(H,{as:`button`,fontSize:`2xs`,color:`fg.muted`,_hover:{color:`fg`,textDecoration:`underline`},onClick:t=>{t.stopPropagation(),i(e,`next`)},title:`Use as the pagination "next" cursor/URL`,children:`next →`})]}),c&&!l&&e.children.map(e=>(0,I.jsx)(pF,{node:e,depth:t+1,collapsed:n,onToggle:r,onPick:i,steps:a,hoveredStepId:o,onHoverStepId:s},e.id))]})}var mF=100,hF=`img, picture, video, canvas, svg, iframe, object, embed, input, select, textarea, table`,gF=`h1, h2, h3, h4, h5, h6, li, a[href]`;function _F(e){let t=new DOMParser().parseFromString(e,`text/html`).body;for(let e of t.querySelectorAll(`script, style, noscript, template`))e.remove();return(t.textContent??``).trim().length>=mF||t.querySelector(`${hF}, ${gF}`)!==null}function vF(e,t){let n=jO(e,t)?.step.selector;return typeof n==`string`?n:void 0}function yF(e,t,n){if(e!==void 0&&t!==void 0)for(let r of NO(e)){let e=r.step.selector,i=r.step.id;if(typeof e==`string`&&typeof i==`string`&&lA(t,e).has(n))return i}}var bF=`start`,xF=new Set([`json`,`yaml`,`jsonl`,`xml`]),SF=new Set([`csv`,`xlsx`]),CF=new Set([`pptx`]);function wF({recipe:e,onSaveOutline:t,onSaveRecipe:n}){let r=e?.id,i=uk(r,r===void 0?void 0:bF),a=dk(),[o,s]=(0,F.useState)(!1),c=BO(),l=i.data?.format,u=l!==void 0&&xF.has(l),d=l===`pdf`,f=l!==void 0&&SF.has(l),p=l!==void 0&&CF.has(l),m=!u&&!d&&!f&&!p,h=i.data?.html,g=(0,F.useMemo)(()=>h===void 0||_F(h),[h]),_=hk(r,r===void 0?void 0:bF,u),v=gk(r,r===void 0?void 0:bF,d),[y,b]=(0,F.useState)(void 0),x=yk(r,r===void 0?void 0:bF,f,y),S=xk(r,r===void 0?void 0:bF,p),C=K(e=>e.pickTarget),w=K(e=>e.showHidden),T=K(e=>e.hoveredStepId),E=K(e=>e.startPicking),D=K(e=>e.stopPicking),ee=K(e=>e.registerPick),O=K(e=>e.setShowHidden),k=K(e=>e.setHoveredNodeId),A=K(e=>e.setHoveredStepId),te=(0,F.useMemo)(()=>vF(e?.outline,T),[e?.outline,T]),ne=(0,F.useMemo)(()=>SN(e?.outline),[e?.outline]),re=t=>{k(t),A(t===void 0?void 0:yF(e?.outline,i.data?.html,t))},j=ek(e=>e.recipeId),ie=ek(e=>e.active),ae=ek(e=>e.cards.length),oe=ek(e=>e.stoppedSteps),se=ek(e=>e.error),M=ek(e=>e.dismissStopped),ce=Ck(),le=wk(),ue=j===r&&ie,de=j===r?oe:void 0,[fe,pe]=(0,F.useState)(void 0),me=e=>{pe(e===void 0?void 0:{text:e,ok:!0})},he=e=>{pe(e===void 0?void 0:{text:e,ok:!1})},ge=(0,F.useRef)(void 0),_e=(0,F.useRef)(void 0),N=C!==void 0&&C.recipeId===r;(0,F.useEffect)(()=>{_e.current=void 0,b(void 0)},[r]);async function P(e){if(r===void 0)return;let t=ee(e);if(t.kind===`first`){let t=await a.mutateAsync({recipeId:r,path:bF,nodeIds:[e]});if(t.kind!==`field`){he(t.kind===`unsupported`?t.reason:void 0);return}await Se(e=>(ge.current=_O(e),me(`Read card: ${t.field.selector} (${t.field.matches} match${t.field.matches===1?``:`es`})`),vO(e,void 0,[lO(t.field,`steps.${e.length}`)])));return}let n=await a.mutateAsync({recipeId:r,path:bF,nodeIds:[t.firstNodeId,e]});if(n.kind!==`list`){he(n.kind===`unsupported`?n.reason:void 0);return}await Se(e=>{let t=ge.current;ge.current=void 0;let r=t??_O(e);return me(`List: ${n.item.selector} (${n.item.matches} items) → ${n.field.selector}`),vO(e,t,fO(n,`steps.${r}`))})}async function ve(e,t){if(r!==void 0)try{if(t===`next`){await Se(t=>{let n=dO(e,`steps.${t.length}`);return me(`Paginate: next from ${e.jsonpath}`),vO(t,void 0,[n])});return}await Se(n=>{if(t===`list`){let t=gO(n,e);if(t!==void 0)return me(`Added to the list: ${String(e.listPath)}`),t;let r=hO(e,`steps.${_O(n)}`);if(r!==void 0)return me(`List: ${String(e.listPath)} (${String(e.listCount??0)} items)`),vO(n,void 0,r)}let r=uO(e,`steps.${n.length}`,{generalize:t===`list`,namespaces:_.data?.namespaces});return me(`Read card: ${r.step.selector}${t===`list`?` (${String(e.listCount??0)} items)`:``}`),vO(n,void 0,[r])})}catch(e){he(e instanceof Error?e.message:String(e))}}async function ye(e){await Se(t=>{let n=_e.current,r=n??_O(t);return _e.current=r,me(`table: ${String(e.step.selector)}`),vO(t,n,[{...e,path:`steps.${r}`}])})}async function be(e){await Se(t=>(me(`${String(e.step.kind)}: ${String(e.step.id)} ← ${String(e.step.selector)}`),vO(t,void 0,[{...e,path:`steps.${t.length}`}])))}async function xe(e){await Se(t=>(me(`jsonpath: ${String(e.step.selector)}`),vO(t,void 0,[{...e,path:`steps.${t.length}`}])))}async function Se(n){if(t===void 0||e?.outline===void 0)return;let r=n(e.outline.steps);await t(e.file,{...e.outline,steps:r})}function Ce(){if(r===void 0||e?.outline===void 0)return;let t=rF(e.outline.recipe);if(t===void 0){he(`this recipe has no start point to record from`);return}ce.mutate({recipeId:r,startUrl:t})}async function we(){if(de===void 0||e?.outline===void 0)return;let n=ek.getState().startUrl;if(n===void 0)return;let i=e.outline.recipe.session,a=TF(i)?i:{},o=a.bootstrap,s=TF(o)?o:void 0,c=iF(e.file,r??`recipe`),l={...a,bootstrap:nF(n,de,s,c)};await t?.(e.file,{...e.outline,recipe:{...e.outline.recipe,session:l}}),me(`Made the login: session.bootstrap, ${de.length} step${de.length===1?``:`s`}`),M()}async function Te(){if(de===void 0||e?.outline===void 0)return;let t=ek.getState().startUrl;if(t===void 0)return;let n=ek.getState().cards;await Se(e=>vO(e,void 0,[eF(t,`steps.${e.length}`),...n.map(e=>e.node)])),me(`Kept as steps: ${de.length} step${de.length===1?``:`s`}`),M()}if(r===void 0)return(0,I.jsx)(L,{p:4,color:`fg.muted`,children:(0,I.jsx)(H,{children:`Pick a recipe to see its snapshot here.`})});function Ee(){if(N){D();return}ge.current=void 0,E(r,bF)}return(0,I.jsxs)(L,{h:`full`,display:`flex`,flexDirection:`column`,children:[(0,I.jsxs)(G,{px:3,py:2,borderBottomWidth:`1px`,gap:3,flexShrink:0,minH:`38px`,children:[!u&&!d&&!f&&!p&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(H,{as:`button`,fontSize:`sm`,fontWeight:N?`semibold`:`normal`,color:N?`colorPalette.fg`:`fg`,colorPalette:`blue`,cursor:`pointer`,onClick:Ee,children:N?`Cancel pick`:`Read`}),(0,I.jsxs)(cE,{checked:w,onCheckedChange:e=>{O(e.checked)},size:`sm`,children:[(0,I.jsx)(fE,{}),(0,I.jsx)(dE,{}),(0,I.jsx)(lE,{fontSize:`sm`,children:`Show hidden`})]}),(0,I.jsx)(H,{as:`button`,fontSize:`sm`,fontWeight:o?`semibold`:`normal`,color:o?`colorPalette.fg`:`fg`,colorPalette:`purple`,cursor:`pointer`,onClick:()=>{s(e=>!e)},children:o?`Hide inspector`:`Inspect`}),(0,I.jsx)(H,{as:`button`,fontSize:`sm`,fontWeight:ue?`semibold`:`normal`,color:ue?`red.fg`:`fg`,colorPalette:`red`,cursor:`pointer`,onClick:()=>{ue?le.mutate():Ce()},children:ue?`Stop recording`:`Record`})]}),u&&(0,I.jsx)(H,{fontSize:`sm`,color:`fg.muted`,children:`Click a value to read it; [*] reads every item of a list.`}),(i.isFetching||u&&_.isFetching||d&&v.isFetching||f&&x.isFetching||p&&S.isFetching)&&(0,I.jsx)(Nw,{size:`xs`}),fe!==void 0&&(0,I.jsx)(Aw,{size:`sm`,colorPalette:fe.ok?`green`:`orange`,children:fe.text})]}),ue&&(0,I.jsxs)(G,{px:3,py:2,bg:`red.subtle`,color:`red.fg`,fontSize:`sm`,gap:3,flexShrink:0,"data-testid":`recording-banner`,children:[(0,I.jsx)(L,{w:`8px`,h:`8px`,borderRadius:`full`,bg:`red.solid`,flexShrink:0}),(0,I.jsx)(H,{children:`Recording — a browser window opened for you to drive; interact with it, not with the snapshot below.`}),(0,I.jsxs)(Aw,{size:`sm`,colorPalette:`red`,children:[ae,` step`,ae===1?``:`s`]})]}),se!==void 0&&j===r&&(0,I.jsx)(L,{px:3,py:1,bg:`red.subtle`,color:`red.fg`,fontSize:`sm`,flexShrink:0,children:se}),de!==void 0&&(0,I.jsxs)(G,{px:3,py:2,borderBottomWidth:`1px`,gap:3,flexShrink:0,"data-testid":`recording-stopped-bar`,children:[(0,I.jsxs)(H,{fontSize:`sm`,children:[`Recording stopped: `,de.length,` step`,de.length===1?``:`s`,` recorded.`]}),(0,I.jsx)(Rw,{size:`xs`,colorPalette:`blue`,onClick:()=>{we()},disabled:de.length===0,children:`Make this the login`}),(0,I.jsx)(Rw,{size:`xs`,variant:`outline`,onClick:()=>{Te()},disabled:de.length===0,children:`Keep as steps`}),(0,I.jsx)(Rw,{size:`xs`,variant:`ghost`,onClick:M,children:`Discard`})]}),m&&i.data!==void 0&&!g&&(0,I.jsx)(IM,{}),(0,I.jsxs)(L,{flex:`1`,minH:`0`,children:[u&&_.data!==void 0&&(0,I.jsx)(fF,{tree:_.data,onPick:(e,t)=>{ve(e,t)},steps:ne,hoveredStepId:T,onHoverStepId:A}),u&&_.isError&&(0,I.jsx)(L,{p:4,color:`fg.error`,children:(0,I.jsx)(H,{children:_.error.message})}),d&&v.data!==void 0&&(0,I.jsx)(HP,{recipeId:r,stepPath:bF,view:v.data,bytesUrl:c.pdfBytesUrl(r,bF),onTablePick:e=>{ye(e)},onRegionPick:e=>{be(e)},steps:ne,hoveredStepId:T,onHoverStepId:A}),d&&v.isError&&(0,I.jsx)(L,{p:4,color:`fg.error`,children:(0,I.jsx)(H,{children:v.error.message})}),f&&x.data!==void 0&&(0,I.jsx)(fP,{recipeId:r,stepPath:bF,view:x.data,onTablePick:e=>{ye(e)},onCellPick:e=>{be(e)},steps:ne,hoveredStepId:T,onHoverStepId:A,csvOverride:y,onCsvOverrideChange:b}),f&&x.isError&&(0,I.jsx)(L,{p:4,color:`fg.error`,children:(0,I.jsx)(H,{children:x.error.message})}),p&&S.data!==void 0&&(0,I.jsx)(zN,{recipeId:r,stepPath:bF,view:S.data,onTablePick:e=>{ye(e)},onChartPick:e=>{xe(e)},onRegionPick:e=>{be(e)},steps:ne,hoveredStepId:T,onHoverStepId:A}),p&&S.isError&&(0,I.jsx)(L,{p:4,color:`fg.error`,children:(0,I.jsx)(H,{children:S.error.message})}),!u&&!d&&!f&&!p&&i.data!==void 0&&!o&&(0,I.jsx)(cF,{html:i.data.html,pickMode:N,showHidden:w,hoveredSelector:te,onHoverNode:re,onPickNode:e=>{P(e)}}),!u&&!d&&!f&&!p&&i.data!==void 0&&o&&(0,I.jsxs)($T,{panels:[{id:`snapshot`,minSize:15},{id:`inspect`,minSize:20}],h:`full`,children:[(0,I.jsx)(eE,{id:`snapshot`,overflow:`hidden`,children:(0,I.jsx)(cF,{html:i.data.html,pickMode:N,showHidden:w,hoveredSelector:te,onHoverNode:re,onPickNode:e=>{P(e)}})}),(0,I.jsx)(rE,{id:`snapshot:inspect`}),(0,I.jsx)(eE,{id:`inspect`,overflow:`hidden`,children:(0,I.jsx)(bA,{recipeId:r,recipe:e,snapshot:i.data,onSaveOutline:t,onSaveRecipe:n})})]}),i.isError&&(0,I.jsxs)(L,{p:4,color:`fg.error`,role:`alert`,children:[(0,I.jsx)(H,{fontWeight:`semibold`,children:`Could not take a snapshot of this recipe's page.`}),(0,I.jsx)(H,{children:i.error.message})]}),!i.isFetching&&!i.isError&&i.data===void 0&&(0,I.jsx)(L,{p:4,color:`fg.muted`,children:(0,I.jsx)(H,{children:`Run a sample, or open a recipe, to see its snapshot here.`})})]})]})}function TF(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var EF=1024,DF=0,OF=class{constructor(e,t){this.from=e,this.to=t}},kF=class{constructor(e={}){this.id=DF++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=MF.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};kF.closedBy=new kF({deserialize:e=>e.split(` `)}),kF.openedBy=new kF({deserialize:e=>e.split(` `)}),kF.group=new kF({deserialize:e=>e.split(` `)}),kF.isolate=new kF({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),kF.contextHash=new kF({perNode:!0}),kF.lookAhead=new kF({perNode:!0}),kF.mounted=new kF({perNode:!0});var AF=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[kF.mounted.id]}},jF=Object.create(null),MF=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):jF,r=+!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[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 t=this.prop(kF.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(kF.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};MF.none=new MF(``,Object.create(null),0,8);var NF=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new MF(e.name,r,e.id,e.flags):e)}return new e(n)}},PF=new WeakMap,FF=new WeakMap,IF;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(IF||={});var LF=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=AF.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new ZF(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new ZF(PF.get(this)||this.topNode);return r.moveTo(e,t),PF.set(this,r._tree),r}get topNode(){return new UF(this,0,0,null)}resolve(e,t=0){let n=VF(PF.get(this)||this.topNode,e,t,!1);return PF.set(this,n),n}resolveInner(e,t=0){let n=VF(FF.get(this)||this.topNode,e,t,!0);return FF.set(this,n),n}resolveStack(e,t=0){return XF(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&IF.IncludeAnonymous)>0;for(let e=this.cursor(a|IF.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!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 t in this.props)e.push([+t,this.props[t]]);return e}balance(t={}){return this.children.length<=8?this:nI(MF.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(MF.none,t,n,r)))}static build(e){return $F(e)}};LF.empty=new LF(MF.none,[],[],0);var RF=class e{constructor(e,t){this.buffer=e,this.index=t}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 e(this.buffer,this.index)}},zF=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return MF.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(BF(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function BF(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function VF(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof UF&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:IF.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof UF&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var HF=class{cursor(e=0){return new ZF(this,e)}getChild(e,t=null,n=null){let r=WF(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return WF(this,e,t,n)}resolve(e,t=0){return VF(this,e,t,!1)}resolveInner(e,t=0){return VF(this,e,t,!0)}matchContext(e){return GF(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},UF=class e extends HF{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from,d;if(a&IF.EnterBracketed&&l instanceof LF&&(d=AF.get(l))&&!d.overlay&&d.bracketed&&r>=u&&r<=u+l.length||BF(i,r,u,u+l.length)){if(l instanceof zF){if(a&IF.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new qF(new KF(o,l,t,u),null,e)}else if(a&IF.IncludeAnonymous||!l.type.isAnonymous||QF(l)){let s;if(!(a&IF.IgnoreMounts)&&(s=AF.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&IF.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i,a)}}}if(a&IF.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let i;if(!(r&IF.IgnoreOverlays)&&(i=AF.get(this._tree))&&i.overlay){let a=t-this.from,o=r&IF.EnterBracketed&&i.bracketed;for(let{from:t,to:r}of i.overlay)if((n>0||o?t<=a:t<a)&&(n<0||o?r>=a:r>a))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,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 WF(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function GF(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var KF=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},qF=class e extends HF{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,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&IF.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new LF(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function JF(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof UF&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new YF(i,n)}var YF=class{constructor(e,t){this.heads=e,this.node=t}get next(){return JF(this.heads)}};function XF(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof UF?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=AF.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new UF(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(VF(o,t,n,!1))}}return i?JF(i):r}var ZF=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~IF.EnterBracketed,e instanceof UF)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.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,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof UF?(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,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}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,t,n=this.mode){return this.buffer?n&IF.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&IF.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&IF.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:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&IF.IncludeAnonymous||e instanceof zF||!e.type.isAnonymous||QF(e))return!1}return!0}move(e,t){if(t&&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,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new qF(this.buffer,t,this.stack[e]);return this.bufferNode=new qF(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return GF(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return GF(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function QF(e){return e.children.some(e=>e instanceof zF||!e.type.isAnonymous||QF(e))}function $F(e){let{buffer:t,nodeSet:n,maxBufferLength:r=EF,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new RF(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,b){let{id:x,start:S,end:C,size:w}=o,T=l,E=c;if(w<0){if(o.next(),w==-1){let t=i[x];_.push(t),v.push(S-e);return}if(w==-3){c=x;return}if(w==-4){l=x;return}throw RangeError(`Unrecognized record size: ${w}`)}let D=s[x],ee,O,k=S-e;if(C-S<=r&&(O=h(o.pos-t,y))){let t=new Uint16Array(O.size-O.skip),r=o.pos-O.size,i=t.length;for(;o.pos>r;)i=g(O.start,t,i);ee=new zF(t,C-O.start,n),k=O.start-e}else{let e=o.pos-w;o.next();let t=[],n=[],i=x>=a?x:-1,s=0,c=C;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,S,s,o.end,c,i,T,E),s=t.length,c=o.end),o.next()):b>2500?d(S,e,t,n):u(S,e,t,n,i,b+1);if(i>=0&&s>0&&s<t.length&&p(t,n,S,s,S,c,i,T,E),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(D,E);ee=nI(D,t,n,0,t.length,0,C-S,e,e)}else ee=m(D,t,n,C-S,T-C,E)}_.push(ee),v.push(k)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new zF(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof LF){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(kF.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[kF.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[kF.lookAhead,i];o=o?[e].concat(o):[e]}return new LF(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};scan:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0){if(n.size==-3||n.size==-4)d+=4;else break scan}else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new LF(s[e.topID],_.reverse(),v.reverse(),y)}var eI=new WeakMap;function tI(e,t){if(!e.isAnonymous||t instanceof zF||t.type!=e)return 1;let n=eI.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof LF)){n=1;break}n+=tI(e,r)}eI.set(t,n)}return n}function nI(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=tI(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=tI(e,t[s]);for(s++;s<i;s++){let n=tI(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(nI(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var rI=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},iI=class{startParse(e,t,n){return typeof e==`string`&&(e=new aI(e)),n=n?n.length?n.map(e=>new OF(e.from,e.to)):[new OF(0,0)]:[new OF(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},aI=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};new kF({perNode:!0});var oI=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new sI(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){n<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from;n<r.minRepeatTerm&&s==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&this.buffer[e-4]==0&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,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 t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new cI(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216)){if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}}})};return n(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 t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}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 t=new sI(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},sI=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},cI=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},lI=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.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 e(this.stack,this.pos,this.index)}};function uI(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var dI=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},fI=new dI,pI=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=fI,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.next=this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?-1: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,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=fI,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,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},mI=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;gI(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};mI.prototype.contextual=mI.prototype.fallback=mI.prototype.extend=!1;var hI=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?uI(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(gI(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};hI.prototype.contextual=mI.prototype.fallback=mI.prototype.extend=!1;function gI(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||vI(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function _I(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function vI(e,t,n,r){let i=_I(n,r,t);return i<0||_I(n,r,e)<i}var yI=typeof process<`u`&&/\bparse\b/.test({}.LOG),bI=null;function xI(e,t,n){let r=e.cursor(IF.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}var SI=class{constructor(e,t){this.fragments=e,this.nodeSet=t,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?xI(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?xI(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 t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],a=this.start[t]+n.positions[r];if(a>e)return this.nextStart=a,null;if(i instanceof LF){if(a==e){if(a<this.safeFrom)return null;let e=a+i.length;if(e<=this.safeTo){let t=i.prop(kF.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,a+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}},CI=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new dI)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if((!n||c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new dI,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new dI,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535){if(o[s+1]==1)s=OI(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(OI(o,s+2),t,n,r));break}}o[s]==t&&(r=this.putAction(OI(o,s+1),t,n,r))}return r}},wI=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,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 pI(t,r),this.tokens=new CI(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[oI.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new SI(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&kI(r);if(e)return yI&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw yI&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return yI&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500){if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=yI?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let o=this.fragments.nodeAt(r);o;){let r=this.parser.nodeSet.types[o.type.id]==o.type?i.getGoto(e.state,o.type.id):-1;if(r>-1&&o.length&&(!t||(o.prop(kF.contextHash)||0)==n))return e.useNode(o,r),yI&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(o.type.id)})`),!0;if(!(o instanceof LF)||o.children.length==0||o.positions[0]>0)break;let s=o.children[0];if(s instanceof LF&&o.positions[0]==0)o=s;else break}}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),yI&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),yI&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return TI(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=yI?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),yI&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(yI&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)yI&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))yI&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),yI&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),TI(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),LF.build({buffer:lI.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 t=(bI||=new WeakMap).get(e);return t||bI.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function TI(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var EI=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},DI=class e extends iI{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(` `);this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push(``);let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=kF[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let a=t[n+-r];for(let o=-r;o>0;o--)i(t[n++],e,a);n++}}}this.nodeSet=new NF(t.map((t,i)=>MF.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:i==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=EF;let a=uI(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(AI),this.states=uI(e.states,Uint32Array),this.data=uI(e.stateData),this.goto=uI(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new mI(a,e):e),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,t,n){let r=new wI(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535){if(n[i+1]==1)a=n[i=OI(n,i+2)];else if(n[i+1]==2)return OI(n,i+2);else break}if(a==t||a==0)return OI(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=OI(this.data,n+2);else break}r=t(OI(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=OI(this.data,n+2);else break}if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=AI(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.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 t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new EI(e,n,r)}static deserialize(t){return new e(t)}};function OI(e,t){return e[t]|e[t+1]<<16}function kI(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function AI(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}var jI=0,MI=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=jI++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new PI(e);return e=>e.modified.indexOf(t)>-1?e:PI.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},NI=0,PI=class e{constructor(e){this.name=e,this.instances=[],this.id=NI++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&FI(n,e.modified));if(r)return r;let i=[],a=new MI(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=II(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function FI(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function II(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function LI(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new zI(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return RI.add(t)}var RI=new kF({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth<=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new zI(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}}),zI=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}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}};zI.empty=new zI([],2,null);function BI(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}function VI(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+` `+e:e)}return n}function HI(e,t,n,r=0,i=e.length){let a=new UI(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,``,a.highlighters),a.flush(i)}var UI=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=``}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,i){let{type:a,from:o,to:s}=e;if(o>=n||s<=t)return;a.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(a)));let c=r,l=WI(e)||zI.empty,u=VI(i,l.tags);if(u&&(c&&(c+=` `),c+=u,l.mode==1&&(r+=(r?` `:``)+u)),this.startSpan(Math.max(t,o),c),l.opaque)return;let d=e.tree&&e.tree.prop(kF.mounted);if(d&&d.overlay){let a=e.node.enter(d.overlay[0].from+o,1),l=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),u=e.firstChild();for(let f=0,p=o;;f++){let m=f<d.overlay.length?d.overlay[f]:null,h=m?m.from+o:s,g=Math.max(t,p),_=Math.min(n,h);if(g<_&&u)for(;e.from<_&&(this.highlightRange(e,g,_,r,i),this.startSpan(Math.min(_,e.to),c),!(e.to>=h||!e.nextSibling())););if(!m||h>n)break;p=m.to+o,p>t&&(this.highlightRange(a.cursor(),Math.max(t,m.from+o),Math.min(n,p),``,l),this.startSpan(Math.min(n,p),c))}u&&e.parent()}else if(e.firstChild()){d&&(r=``);do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}};function WI(e){let t=e.type.prop(RI);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}var q=MI.define,GI=q(),KI=q(),qI=q(KI),JI=q(KI),YI=q(),XI=q(YI),ZI=q(YI),QI=q(),$I=q(QI),eL=q(),tL=q(),nL=q(),rL=q(nL),iL=q(),J={comment:GI,lineComment:q(GI),blockComment:q(GI),docComment:q(GI),name:KI,variableName:q(KI),typeName:qI,tagName:q(qI),propertyName:JI,attributeName:q(JI),className:q(KI),labelName:q(KI),namespace:q(KI),macroName:q(KI),literal:YI,string:XI,docString:q(XI),character:q(XI),attributeValue:q(XI),number:ZI,integer:q(ZI),float:q(ZI),bool:q(YI),regexp:q(YI),escape:q(YI),color:q(YI),url:q(YI),keyword:eL,self:q(eL),null:q(eL),atom:q(eL),unit:q(eL),modifier:q(eL),operatorKeyword:q(eL),controlKeyword:q(eL),definitionKeyword:q(eL),moduleKeyword:q(eL),operator:tL,derefOperator:q(tL),arithmeticOperator:q(tL),logicOperator:q(tL),bitwiseOperator:q(tL),compareOperator:q(tL),updateOperator:q(tL),definitionOperator:q(tL),typeOperator:q(tL),controlOperator:q(tL),punctuation:nL,separator:q(nL),bracket:rL,angleBracket:q(rL),squareBracket:q(rL),paren:q(rL),brace:q(rL),content:QI,heading:$I,heading1:q($I),heading2:q($I),heading3:q($I),heading4:q($I),heading5:q($I),heading6:q($I),contentSeparator:q(QI),list:q(QI),quote:q(QI),emphasis:q(QI),strong:q(QI),link:q(QI),monospace:q(QI),strikethrough:q(QI),inserted:q(),deleted:q(),changed:q(),invalid:q(),meta:iL,documentMeta:q(iL),annotation:q(iL),processingInstruction:q(iL),definition:MI.defineModifier(`definition`),constant:MI.defineModifier(`constant`),function:MI.defineModifier(`function`),standard:MI.defineModifier(`standard`),local:MI.defineModifier(`local`),special:MI.defineModifier(`special`)};for(let e in J){let t=J[e];t instanceof MI&&(t.name=e)}BI([{tag:J.link,class:`tok-link`},{tag:J.heading,class:`tok-heading`},{tag:J.emphasis,class:`tok-emphasis`},{tag:J.strong,class:`tok-strong`},{tag:J.keyword,class:`tok-keyword`},{tag:J.atom,class:`tok-atom`},{tag:J.bool,class:`tok-bool`},{tag:J.url,class:`tok-url`},{tag:J.labelName,class:`tok-labelName`},{tag:J.inserted,class:`tok-inserted`},{tag:J.deleted,class:`tok-deleted`},{tag:J.literal,class:`tok-literal`},{tag:J.string,class:`tok-string`},{tag:J.number,class:`tok-number`},{tag:[J.regexp,J.escape,J.special(J.string)],class:`tok-string2`},{tag:J.variableName,class:`tok-variableName`},{tag:J.local(J.variableName),class:`tok-variableName tok-local`},{tag:J.definition(J.variableName),class:`tok-variableName tok-definition`},{tag:J.special(J.variableName),class:`tok-variableName2`},{tag:J.definition(J.propertyName),class:`tok-propertyName tok-definition`},{tag:J.typeName,class:`tok-typeName`},{tag:J.namespace,class:`tok-namespace`},{tag:J.className,class:`tok-className`},{tag:J.macroName,class:`tok-macroName`},{tag:J.propertyName,class:`tok-propertyName`},{tag:J.operator,class:`tok-operator`},{tag:J.comment,class:`tok-comment`},{tag:J.meta,class:`tok-meta`},{tag:J.invalid,class:`tok-invalid`},{tag:J.punctuation,class:`tok-punctuation`}]);var aL=LI({String:J.string,Number:J.number,"True False":J.bool,PropertyName:J.propertyName,Null:J.null,", :":J.separator,"[ ]":J.squareBracket,"{ }":J.brace}),oL=DI.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:`#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O`,goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!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,`{`,14,`[`],[`closedBy`,8,`}`,15,`]`]],propSources:[aL],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~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#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!]~$zO]~~$}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~&yO[~~'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}),sL=[],cL=[];(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?cL:sL).push(n+=e[t])})();function lL(e){if(e<768)return!1;for(let t=0,n=sL.length;;){let r=t+n>>1;if(e<sL[r])n=r;else if(e>=cL[r])t=r+1;else return!0;if(t==n)return!1}}function uL(e){return e>=127462&&e<=127487}var dL=8205;function fL(e,t,n=!0,r=!0){return(n?pL:mL)(e,t,r)}function pL(e,t,n){if(t==e.length)return t;t&&gL(e.charCodeAt(t))&&_L(e.charCodeAt(t-1))&&t--;let r=hL(e,t);for(t+=vL(r);t<e.length;){let i=hL(e,t);if(r==dL||i==dL||n&&lL(i))t+=vL(i),r=i;else if(uL(i)){let n=0,r=t-2;for(;r>=0&&uL(hL(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function mL(e,t,n){for(;t>1;){let r=pL(e,t-2,n);if(r<t)return r;t--}return 0}function hL(e,t){let n=e.charCodeAt(t);if(!_L(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return gL(r)?(n-55296<<10)+(r-56320)+65536:n}function gL(e){return e>=56320&&e<57344}function _L(e){return e>=55296&&e<56320}function vL(e){return e<65536?1:2}var yL=class e{lineAt(e){if(e<0||e>this.length)throw 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 RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=kL(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),xL.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=kL(this,e,t);let n=[];return this.decompose(e,t,n,0),xL.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new TL(this),i=new TL(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new TL(this,e)}iterRange(e,t=this.length){return new EL(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new DL(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new bL(t):xL.from(bL.split(t,[]))}},bL=class e extends yL{constructor(e,t=SL(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new OL(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(wL(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=CL(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=kL(this,t,n);let i=CL(this.text,CL(r.text,wL(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):xL.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`
|
|
16
|
+
`){[e,t]=kL(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},xL=class e extends yL{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=kL(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=`
|
|
17
|
+
`){[e,t]=kL(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new bL(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof bL&&c&&(n=u[u.length-1])instanceof bL&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new bL(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}};yL.empty=new bL([``],0);function SL(e){let t=-1;for(let n of e)t+=n.length+1;return t}function CL(e,t,n=0,r=1e9){for(let i=0,a=0,o=!0;a<e.length&&i<=r;a++){let s=e[a],c=i+s.length;c>=n&&(c>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),o?(t[t.length-1]+=s,o=!1):t.push(s)),i=c+1}return t}function wL(e,t,n){return CL(e,[``],t,n)}var TL=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof bL?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof bL?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
18
|
+
`,this;e--}else if(r instanceof bL){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof bL?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},EL=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new TL(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),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!=``}},DL=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<`u`&&(yL.prototype[Symbol.iterator]=function(){return this.iter()},TL.prototype[Symbol.iterator]=EL.prototype[Symbol.iterator]=DL.prototype[Symbol.iterator]=function(){return this});var OL=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function kL(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function AL(e,t,n=!0,r=!0){return fL(e,t,n,r)}function jL(e){return e>=56320&&e<57344}function ML(e){return e>=55296&&e<56320}function NL(e,t){let n=e.charCodeAt(t);if(!ML(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return jL(r)?(n-55296<<10)+(r-56320)+65536:n}function PL(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function FL(e){return e<65536?1:2}var IL=/\r\n?|\n/,LL=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(LL||={}),RL=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){HL(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:WL(this,e)}mapDesc(e,t=!1){return e.empty?this:UL(this,e,t)}mapPos(e,t=-1,n=LL.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=LL.Simple&&c>=e&&(n==LL.TrackDel&&r<e&&c>e||n==LL.TrackBefore&&r<e||n==LL.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},zL=class e extends RL{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return HL(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return UL(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push(yL.empty);r.push(a?t.slice(i,i+a):yL.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:WL(this,e,!0)}map(e,t=!1){return e.empty?this:UL(this,e,t,!0)}iterChanges(e,t=!1){HL(this,e,t)}get desc(){return RL.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new GL(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);BL(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;BL(n,e,t),t>0&&VL(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);BL(n,e,-1),BL(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:RL.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(t,n,r){let i=[],a=[],o=0,s=null;function c(t=!1){if(!t&&!i.length)return;o<n&&BL(i,n-o,-1);let r=new e(i,a);s=s?s.compose(r.map(s)):r,i=[],a=[],o=0}function l(t){if(Array.isArray(t))for(let e of t)l(e);else if(t instanceof e){if(t.length!=n)throw RangeError(`Mismatched change set length (got ${t.length}, expected ${n})`);c(),s=s?s.compose(t.map(s)):t}else{let{from:e,to:s=e,insert:l}=t;if(e>s||e<0||s>n)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${n})`);let u=l?typeof l==`string`?yL.of(l.split(r||IL)):l:yL.empty,d=u.length;if(e==s&&d==0)return;e<o&&c(),e>o&&BL(i,e-o,-1),BL(i,s-e,d),VL(a,i,u),o=s}}return l(t),c(!s),s}static empty(t){return new e(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError(`Invalid JSON representation of ChangeSet`);let n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e];if(typeof i==`number`)n.push(i,-1);else if(!Array.isArray(i)||typeof i[0]!=`number`||i.some((e,t)=>t&&typeof e!=`string`))throw RangeError(`Invalid JSON representation of ChangeSet`);else if(i.length==1)n.push(i[0],0);else{for(;r.length<e;)r.push(yL.empty);r[e]=yL.of(i.slice(1)),n.push(i[0],r[e].length)}}return new e(n,r)}static createSet(t,n){return new e(t,n)}};function BL(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function VL(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(yL.empty);e.push(n)}}function HL(e,t,n){let r=e.inserted;for(let i=0,a=0,o=0;o<e.sections.length;){let s=e.sections[o++],c=e.sections[o++];if(c<0)i+=s,a+=s;else{let l=i,u=a,d=yL.empty;for(;l+=s,u+=c,c&&r&&(d=d.append(r[o-2>>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)s=e.sections[o++],c=e.sections[o++];t(i,l,a,u,d),i=l,a=u}}}function UL(e,t,n,r=!1){let i=[],a=r?[]:null,o=new GL(e),s=new GL(t);for(let e=-1;;)if(o.done&&s.len||s.done&&o.len)throw Error(`Mismatched change set lengths`);else if(o.ins==-1&&s.ins==-1){let e=Math.min(o.len,s.len);BL(i,e,-1),o.forward(e),s.forward(e)}else if(s.ins>=0&&(o.ins<0||e==o.i||o.off==0&&(s.len<o.len||s.len==o.len&&!n))){let t=s.len;for(BL(i,s.ins,-1);t;){let n=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=n&&(BL(i,0,o.ins),a&&VL(a,i,o.text),e=o.i),o.forward(n),t-=n}s.next()}else if(o.ins>=0){let t=0,n=o.len;for(;n;)if(s.ins==-1){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(s.ins==0&&s.len<n)n-=s.len,s.next();else break;BL(i,t,e<o.i?o.ins:0),a&&e<o.i&&VL(a,i,o.text),e=o.i,o.forward(o.len-n)}else if(o.done&&s.done)return a?zL.createSet(i,a):RL.create(i);else throw Error(`Mismatched change set lengths`)}function WL(e,t,n=!1){let r=[],i=n?[]:null,a=new GL(e),o=new GL(t);for(let e=!1;;)if(a.done&&o.done)return i?zL.createSet(r,i):RL.create(r);else if(a.ins==0)BL(r,a.len,0,e),a.next();else if(o.len==0&&!o.done)BL(r,0,o.ins,e),i&&VL(i,r,o.text),o.next();else if(a.done||o.done)throw Error(`Mismatched change set lengths`);else{let t=Math.min(a.len2,o.len),n=r.length;if(a.ins==-1){let n=o.ins==-1?-1:o.off?0:o.ins;BL(r,t,n,e),i&&n&&VL(i,r,o.text)}else o.ins==-1?(BL(r,a.off?0:a.len,t,e),i&&VL(i,r,a.textBit(t))):(BL(r,a.off?0:a.len,o.off?0:o.ins,e),i&&!o.off&&VL(i,r,o.text));e=(a.ins>t||o.ins>=0&&o.len>t)&&(e||r.length>n),a.forward2(t),o.forward(t)}}var GL=class{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,t=this.i-2>>1;return t>=e.length?yL.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?yL.empty:t[n].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)}},KL=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.flags=n,this.goalColumn=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 undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new e(r,i,this.flags,this.goalColumn)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return Y.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Y.range(this.anchor,r,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!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 RangeError(`Invalid JSON representation for SelectionRange`);return Y.range(e.anchor,e.head)}static create(t,n,r,i){return new e(t,n,r,i)}},Y=class e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(t,n=-1){return t.empty?this:e.create(this.ranges.map(e=>e.map(t,n)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new e([this.main],0)}addRange(t,n=!0){return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!=`number`||t.main>=t.ranges.length)throw RangeError(`Invalid JSON representation for EditorSelection`);return new e(t.ranges.map(e=>KL.fromJSON(e)),t.main)}static single(t,n=t){return new e([e.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw RangeError(`A selection needs at least one range`);for(let r=0,i=0;i<t.length;i++){let a=t[i];if(a.empty?a.from<=r:a.from<r)return e.normalized(t.slice(),n);r=a.to}return new e(t,n)}static cursor(e,t=0,n,r){return KL.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n)),r)}static range(e,t,n,r,i){let a=r==null?7:Math.min(6,r);return!i&&e!=t&&(i=t<e?1:-1),i&&(a|=i<0?8:16),t<e?KL.create(t,e,a|32,n):KL.create(e,t,a,n)}static undirectionalRange(e,t){return KL.create(e,t,64,void 0)}static normalized(t,n=0){let r=t[n];t.sort((e,t)=>e.from-t.from),n=t.indexOf(r);for(let r=1;r<t.length;r++){let i=t[r],a=t[r-1];if(i.empty?i.from<=a.to:i.from<a.to){let o=a.from,s=Math.max(i.to,a.to);r<=n&&n--,t.splice(--r,2,i.anchor>i.head?e.range(s,o):e.range(o,s))}}return new e(t,n)}};function qL(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError(`Selection points outside of document`)}var JL=0,X=class e{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=JL++,this.default=e([]),this.extensions=typeof i==`function`?i(this):i}get reader(){return this}static define(t={}){return new e(t.combine||(e=>e),t.compareInput||((e,t)=>e===t),t.compare||(t.combine?(e,t)=>e===t:YL),!!t.static,t.enables)}of(e){return new XL([],this,0,e)}compute(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new XL(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new XL(e,this,2,t)}from(e,t){return t||=e=>e,this.compute([e],n=>t(n.field(e)))}};function YL(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}var XL=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=JL++}dynamicSlot(e){let t=this.value,n=this.facet.compareInput,r=this.id,i=e[r]>>1,a=this.type==2,o=!1,s=!1,c=[];for(let t of this.dependencies)t==`doc`?o=!0:t==`selection`?s=!0:(e[t.id]??1)&1||c.push(e[t.id]);return{create(e){return e.values[i]=t(e),1},update(e,r){if(o&&r.docChanged||s&&(r.docChanged||r.selection)||QL(e,c)){let r=t(e);if(a?!ZL(r,e.values[i],n):!n(r,e.values[i]))return e.values[i]=r,1}return 0},reconfigure:(e,o)=>{let s,c=o.config.address[r];if(c!=null){let r=dR(o,c);if(this.dependencies.every(t=>t instanceof X?o.facet(t)===e.facet(t):t instanceof tR?o.field(t,!1)==e.field(t,!1):!0)||(a?ZL(s=t(e),r,n):n(s=t(e),r)))return e.values[i]=r,0}else s=t(e);return e.values[i]=s,1}}}get extension(){return this}};function ZL(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function QL(e,t){let n=!1;for(let r of t)uR(e,r)&1&&(n=!0);return n}function $L(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),a=r.filter(e=>!(e&1)),o=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<r.length;t++){let a=dR(e,r[t]);if(i[t]==2)for(let e of a)n.push(e);else n.push(a)}return t.combine(n)}return{create(e){for(let t of r)uR(e,t);return e.values[o]=s(e),1},update(e,n){if(!QL(e,a))return 0;let r=s(e);return t.compare(r,e.values[o])?0:(e.values[o]=r,1)},reconfigure(e,i){let a=QL(e,r),c=i.config.facets[t.id],l=i.facet(t);if(c&&!a&&YL(n,c))return e.values[o]=l,0;let u=s(e);return t.compare(u,l)?(e.values[o]=l,0):(e.values[o]=u,1)}}}var eR=X.define({static:!0}),tR=class e{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(t){let n=new e(JL++,t.create,t.update,t.compare||((e,t)=>e===t),t);return t.provide&&(n.provides=t.provide(n)),n}create(e){return(e.facet(eR).find(e=>e.field==this)?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(eR),i=n.facet(eR),a;return(a=r.find(e=>e.field==this))&&a!=i.find(e=>e.field==this)?(e.values[t]=a.create(e),1):n.config.address[this.id]==null?(e.values[t]=this.create(e),1):(e.values[t]=n.field(this),0)}}}init(e){return[this,eR.of({field:this,create:e})]}get extension(){return this}},nR={lowest:4,low:3,default:2,high:1,highest:0};function rR(e){return t=>new aR(t,e)}var iR={highest:rR(nR.highest),high:rR(nR.high),default:rR(nR.default),low:rR(nR.low),lowest:rR(nR.lowest)},aR=class{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}},oR=class e{of(e){return new sR(this,e)}reconfigure(t){return e.reconfigure.of({compartment:this,extension:t})}get(e){return e.config.compartments.get(this)}},sR=class{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}},cR=class e{constructor(e,t,n,r,i,a){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(t,n,r){let i=[],a=Object.create(null),o=new Map;for(let e of lR(t,n,o))e instanceof tR?i.push(e):(a[e.facet.id]||(a[e.facet.id]=[])).push(e);let s=Object.create(null),c=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push(t=>e.slot(t));let u=r?.config.facets;for(let e in a){let t=a[e],n=t[0].facet,i=u&&u[e]||[];if(t.every(e=>e.type==0)){if(s[n.id]=c.length<<1|1,YL(i,t))c.push(r.facet(n));else{let e=n.combine(t.map(e=>e.value));c.push(r&&n.compare(e,r.facet(n))?r.facet(n):e)}}else{for(let e of t)e.type==0?(s[e.id]=c.length<<1|1,c.push(e.value)):(s[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));s[n.id]=l.length<<1,l.push(e=>$L(e,n,t))}}let d=l.map(e=>e(s));return new e(t,o,d,s,c,a)}};function lR(e,t,n){let r=[[],[],[],[],[]],i=new Map;function a(e,o){let s=i.get(e);if(s!=null){if(s<=o)return;let t=r[s].indexOf(e);t>-1&&r[s].splice(t,1),e instanceof sR&&n.delete(e.compartment)}if(i.set(e,o),Array.isArray(e))for(let t of e)a(t,o);else if(e instanceof sR){if(n.has(e.compartment))throw RangeError(`Duplicate use of compartment in extensions`);let r=t.get(e.compartment)||e.inner;n.set(e.compartment,r),a(r,o)}else if(e instanceof aR)a(e.inner,e.prec);else if(e instanceof tR)r[o].push(e),e.provides&&a(e.provides,o);else if(e instanceof XL)r[o].push(e),e.facet.extensions&&a(e.facet.extensions,nR.default);else{let t=e.extension;if(!t)throw Error(`Unrecognized extension value in extension set (${e}).`);if(t==e)throw Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(t,o)}}return a(e,nR.default),r.reduce((e,t)=>e.concat(t))}function uR(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw Error(`Cyclic dependency between fields and/or facets`);if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function dR(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}var fR=X.define(),pR=X.define({combine:e=>e.some(e=>e),static:!0}),mR=X.define({combine:e=>e.length?e[0]:void 0,static:!0}),hR=X.define(),gR=X.define(),_R=X.define(),vR=X.define({combine:e=>e.length?e[0]:!1}),yR=class{constructor(e,t){this.type=e,this.value=t}static define(){return new bR}},bR=class{of(e){return new yR(this,e)}},xR=class{constructor(e){this.map=e}of(e){return new SR(this,e)}},SR=class e{constructor(e,t){this.type=e,this.value=t}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new e(this.type,n)}is(e){return this.type==e}static define(e={}){return new xR(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}};SR.reconfigure=SR.define(),SR.appendConfig=SR.define();var CR=class e{constructor(t,n,r,i,a,o){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,r&&qL(r,n.newLength),a.some(t=>t.type==e.time)||(this.annotations=a.concat(e.time.of(Date.now())))}static create(t,n,r,i,a,o){return new e(t,n,r,i,a,o)}get newDoc(){return 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 t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(e.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]==`.`))}};CR.time=yR.define(),CR.userEvent=yR.define(),CR.addToHistory=yR.define(),CR.remote=yR.define();function wR(e,t){let n=[];for(let r=0,i=0;;){let a,o;if(r<e.length&&(i==t.length||t[i]>=e[r]))a=e[r++],o=e[r++];else if(i<t.length)a=t[i++],o=t[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function TR(e,t,n){let r,i,a;return n?(r=t.changes,i=zL.empty(t.changes.length),a=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),i=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(r)),{changes:a,selection:t.selection?t.selection.map(i):e.selection?.map(r),effects:SR.mapEffects(e.effects,r).concat(SR.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function ER(e,t,n){let r=t.selection,i=jR(t.annotations);return t.userEvent&&(i=i.concat(CR.userEvent.of(t.userEvent))),{changes:t.changes instanceof zL?t.changes:zL.of(t.changes||[],n,e.facet(mR)),selection:r&&(r instanceof Y?r:Y.single(r.anchor,r.head)),effects:jR(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function DR(e,t,n){let r=ER(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let i=1;i<t.length;i++){t[i].filter===!1&&(n=!1);let a=!!t[i].sequential;r=TR(r,ER(e,t[i],a?r.changes.newLength:e.doc.length),a)}let i=CR.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return kR(n?OR(i):i)}function OR(e){let t=e.startState,n=!0;for(let r of t.facet(hR)){let t=r(e);if(t===!1){n=!1;break}Array.isArray(t)&&(n=n===!0?t:wR(n,t))}if(n!==!0){let r,i;if(n===!1)i=e.changes.invertedDesc,r=zL.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,i=t.filtered.mapDesc(t.changes).invertedDesc}e=CR.create(t,r,e.selection&&e.selection.map(i),SR.mapEffects(e.effects,i),e.annotations,e.scrollIntoView)}let r=t.facet(gR);for(let n=r.length-1;n>=0;n--){let i=r[n](e);e=i instanceof CR?i:Array.isArray(i)&&i.length==1&&i[0]instanceof CR?i[0]:DR(t,jR(i),!1)}return e}function kR(e){let t=e.startState,n=t.facet(_R),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=TR(r,ER(t,a,e.changes.newLength),!0))}return r==e?e:CR.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}var AR=[];function jR(e){return e==null?AR:Array.isArray(e)?e:[e]}var MR=(function(e){return e[e.Word=0]=`Word`,e[e.Space=1]=`Space`,e[e.Other=2]=`Other`,e})(MR||={}),NR=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,PR;try{PR=RegExp(`[\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{}function FR(e){if(PR)return PR.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>``&&(n.toUpperCase()!=n.toLowerCase()||NR.test(n)))return!0}return!1}function IR(e){return t=>{if(!/\S/.test(t))return MR.Space;if(FR(t))return MR.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return MR.Word;return MR.Other}}var LR=class e{constructor(e,t,n,r,i,a){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)uR(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw RangeError(`Field is not present in this state`);return}return uR(this,n),dR(this,n)}update(...e){return DR(this,e,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let e of t.effects)e.is(oR.reconfigure)?(n&&=(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),null),i.set(e.value.compartment,e.value.extension)):e.is(SR.reconfigure)?(n=null,r=e.value):e.is(SR.appendConfig)&&(n=null,r=jR(r).concat(e.value));let a;n?a=t.startState.values.slice():(n=cR.resolve(r,i,this),a=new e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let o=t.startState.facet(pR)?t.newSelection:t.newSelection.asSingle();new e(n,t.newDoc,o,a,(e,n)=>n.update(e,t),t)}replaceSelection(e){return typeof e==`string`&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:Y.cursor(t.from+e.length,-1)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],a=jR(n.effects);for(let n=1;n<t.ranges.length;n++){let o=e(t.ranges[n]),s=this.changes(o.changes),c=s.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(c);let l=r.mapDesc(s,!0);i.push(o.range.map(l)),r=r.compose(c),a=SR.mapEffects(a,c).concat(SR.mapEffects(jR(o.effects),l))}return{changes:r,selection:Y.create(i,t.mainIndex),effects:a}}changes(t=[]){return t instanceof zL?t:zL.of(t,this.doc.length,this.facet(e.lineSeparator))}toText(t){return yL.of(t.split(this.facet(e.lineSeparator)||IL))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(uR(this,t),dR(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof tR&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(t,n={},r){if(!t||typeof t.doc!=`string`)throw RangeError(`Invalid JSON representation for EditorState`);let i=[];if(r){for(let e in r)if(Object.prototype.hasOwnProperty.call(t,e)){let n=r[e],a=t[e];i.push(n.init(e=>n.spec.fromJSON(a,e)))}}return e.create({doc:t.doc,selection:Y.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=cR.resolve(t.extensions||[],new Map),r=t.doc instanceof yL?t.doc:yL.of((t.doc||``).split(n.staticFacet(e.lineSeparator)||IL)),i=t.selection?t.selection instanceof Y?t.selection:Y.single(t.selection.anchor,t.selection.head):Y.single(0);return qL(i,r.length),n.staticFacet(pR)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(e.tabSize)}get lineBreak(){return this.facet(e.lineSeparator)||`
|
|
19
|
+
`}get readOnly(){return this.facet(vR)}phrase(t,...n){for(let n of this.facet(e.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(e,t)=>{if(t==`$`)return`$`;let r=+(t||1);return!r||r>n.length?e:n[r-1]})),t}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(fR))for(let a of i(this,t,n))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){let t=this.languageDataAt(`wordChars`,e);return IR(t.length?t[0]:``)}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-n,o=e-n;for(;a>0;){let e=AL(t,a,!1);if(i(t.slice(e,a))!=MR.Word)break;a=e}for(;o<r;){let e=AL(t,o);if(i(t.slice(o,e))!=MR.Word)break;o=e}return a==o?null:Y.range(a+n,o+n)}};LR.allowMultipleSelections=pR,LR.tabSize=X.define({combine:e=>e.length?e[0]:4}),LR.lineSeparator=mR,LR.readOnly=vR,LR.phrases=X.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),LR.languageData=fR,LR.changeFilter=hR,LR.transactionFilter=gR,LR.transactionExtender=_R,oR.reconfigure=SR.define();function RR(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],a=r[e];if(a===void 0)r[e]=i;else if(a!==i&&i!==void 0){if(Object.hasOwnProperty.call(n,e))r[e]=n[e](a,i);else throw Error(`Config merge conflict for field `+e)}}for(let e in t)r[e]===void 0&&(r[e]=t[e]);return r}var zR=class{eq(e){return this==e}range(e,t=e){return VR.create(e,t,this)}};zR.prototype.startSide=zR.prototype.endSide=0,zR.prototype.point=!1,zR.prototype.mapMode=LL.TrackDel;function BR(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}var VR=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,r){return new e(t,n,r)}};function HR(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var UR=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return GR(this.to)}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let a=r,o=i.length;;){if(a==o)return a;let r=a+o>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==a)return s>=0?a:o;s>=0?o=r:a=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),a=this.findIndex(n,1e9,!1,i);i<a;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(t,n,r,i,a){let o=[],s=[],c=[],l=-1,u=-1;iter:for(let e=0;e<this.value.length;e++){let d=this.value[e],f=this.from[e]+t,p=this.to[e]+t,m,h;if(f==p){let e=n.mapPos(f,d.startSide,d.mapMode);if(e==null||(m=h=e,d.startSide!=d.endSide&&(h=n.mapPos(f,d.endSide),h<m)))continue}else if(m=n.mapPos(f,d.startSide),h=n.mapPos(p,d.endSide),m>h||m==h&&d.startSide>0&&d.endSide<=0)continue;if(!((h-m||d.endSide-d.startSide)<0)){if(l<0&&(l=m),d.point&&(u=Math.max(u,h-m)),(m-r||d.startSide-i)>=0)o.push(d),s.push(m-l),c.push(h-l),r=h,i=d.endSide;else{if(m==h)for(let e=o.length;e>0;e--){if((m-(c[e-1]+l)||d.startSide-o[e-1].endSide)>=0){o.splice(e,0,d),s.splice(e,0,m-l),c.splice(e,0,h-l);continue iter}if((m-(s[e-1]+l)||d.endSide-o[e-1].startSide)>0)break}a(m,h,d)}}}return{mapped:o.length?new e(s,c,o,u):null,pos:l}}},WR=class e{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(t,n,r,i){return new e(t,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 t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(HR)),this.isEmpty)return n.length?e.of(n):this;let s=new YR(this,null,-1).goto(0),c=0,l=[],u=new qR;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let e=n[c++];u.addInner(e.from,e.to,e.value,!1)||l.push(e)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||a<s.from||o(s.from,s.to,s.value))&&(u.addInner(s.from,s.to,s.value,!1)||l.push(VR.create(s.from,s.to,s.value))),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?e.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1,a,o=(e,t,n)=>{a||=new qR,a.addRange(e,t,n,!1)};for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],s=this.chunk[e],c=t.touchesRange(a,a+s.length);if(c===!1)i=Math.max(i,s.maxPoint),n.push(s),r.push(t.mapPos(a));else if(c===!0){let[e,c]=n.length?[GR(r)+GR(n).length,GR(GR(n).value).endSide]:[-1,-1],{mapped:l,pos:u}=s.map(a,t,e,c,o);l&&(i=Math.max(i,l.maxPoint),n.push(l),r.push(u))}}let s=this.nextLayer.map(t);return a&&(s=a.finishInner(s)),n.length==0?s:new e(r,n,s||e.empty,i)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],a=this.chunk[r];if(t>=i&&e<=i+a.length&&a.between(i,e-i,t-i,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return XR.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return XR.from(e).goto(t)}static compare(e,t,n,r,i=-1){let a=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=JR(a,o,n),c=new QR(a,s,i),l=new QR(o,s,i);n.iterGaps((e,t,n)=>$R(c,e,l,t,n,r)),n.empty&&n.length==0&&$R(c,0,l,0,0,r)}static eq(e,t,n=0,r){r??=1e9-1;let i=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),a=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=JR(i,a),s=new QR(i,o,0).goto(n),c=new QR(a,o,0).goto(n);for(;;){if(s.to!=c.to||!ez(s.active,c.active)||s.point&&(!c.point||!BR(s.point,c.point)))return!1;if(s.to>r)return!0;s.next(),c.next()}}static spans(e,t,n,r,i=-1){let a=new QR(e,null,i).goto(t),o=t,s=a.openStart;for(;;){let e=Math.min(a.to,n);if(a.point){let n=a.activeForPoint(a.to),i=a.pointFrom<t?n.length+1:a.point.startSide<0?n.length:Math.min(n.length,s);r.point(o,e,a.point,n,i,a.pointRank),s=Math.min(a.openEnd(e),n.length)}else e>o&&(r.span(o,e,a.active,s),s=a.openEnd(e));if(a.to>n)return s+(a.point&&a.to>n?1:0);o=a.to,a.next()}}static of(e,t=!1){let n=new qR;for(let r of e instanceof VR?[e]:t?KR(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(t){if(!t.length)return e.empty;let n=GR(t);for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=e.empty;i=i.nextLayer)n=new e(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}};WR.empty=new WR([],[],null,-1);function GR(e){return e[e.length-1]}function KR(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(HR(t,r)>0)return e.slice().sort(HR);t=r}return e}WR.empty.nextLayer=WR.empty;var qR=class e{finishChunk(e){this.chunks.push(new UR(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,t,n){this.addRange(e,t,n,!0)}addRange(t,n,r,i){this.addInner(t,n,r,i)||(this.nextLayer||=new e).addRange(t,n,r,i)}addInner(e,t,n,r){let i=e-this.lastTo||n.startSide-this.last.endSide;if(r&&i<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw 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(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(WR.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=WR.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function JR(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let a=r.get(e.chunk[t]);a!=null&&(n?n.mapPos(a):a)==e.chunkPos[t]&&!n?.touchesRange(a,a+e.chunk[t].length)&&i.add(e.chunk[t])}return i}var YR=class{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!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],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.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}},XR=class e{constructor(e){this.heap=e}static from(t,n=null,r=-1){let i=[];for(let e=0;e<t.length;e++)for(let a=t[e];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new YR(a,n,r,e));return i.length==1?i[0]:new e(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)ZR(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)ZR(this.heap,e);(this.to-e||this.value.endSide-t)<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(),ZR(this.heap,0)}}};function ZR(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var QR=class{constructor(e,t,n){this.minPoint=n,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=XR.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){tz(this.active,e),tz(this.activeTo,e),tz(this.activeRank,e),this.minActive=rz(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;nz(this.active,t,n),nz(this.activeTo,t,r),nz(this.activeRank,t,i),e&&nz(e,t,this.cursor.from),this.minActive=rz(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&tz(n,r)}else if(!this.cursor.value){this.to=this.endSide=1e9;break}else if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(!e.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}};function $R(e,t,n,r,i,a){e.goto(t),n.goto(r);let o=r+i,s=r,c=r-t,l=!!a.boundChange;for(let t=!1;;){let r=e.to+c-n.to,i=r||e.endSide-n.endSide,u=i<0?e.to+c:n.to,d=Math.min(u,o);if(e.point||n.point?(e.point&&n.point&&BR(e.point,n.point)&&ez(e.activeForPoint(e.to),n.activeForPoint(n.to))||a.comparePoint(s,d,e.point,n.point),t=!1):(t&&=(a.boundChange(s),!1),d>s&&!ez(e.active,n.active)&&a.compareRange(s,d,e.active,n.active),l&&d<o&&(r||e.openEnd(u)!=n.openEnd(u))&&(t=!0)),u>o)break;s=u,i<=0&&e.next(),i>=0&&n.next()}}function ez(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!BR(e[n],t[n]))return!1;return!0}function tz(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function nz(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function rz(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function iz(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=AL(e,i));return r}function az(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=e.charCodeAt(r)==9?n-i%n:1,r=AL(e,r)}return r===!0?-1:e.length}for(var oz=`ͼ`,sz=typeof Symbol>`u`?`__ͼ`:Symbol.for(oz),cz=typeof Symbol>`u`?`__styleSet`+Math.floor(Math.random()*1e8):Symbol(`styleSet`),lz=typeof globalThis<`u`?globalThis:typeof window<`u`?window:{},uz=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,t,a,o){let s=[],c=/^@(\w+)\b/.exec(e[0]),l=c&&c[1]==`keyframes`;if(c&&t==null)return a.push(e[0]+`;`);for(let n in t){let o=t[n];if(/&/.test(n))i(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),o,a);else if(o&&typeof o==`object`){if(!c)throw RangeError(`The value of a property (`+n+`) should be a primitive value.`);i(r(n),o,s,l)}else o!=null&&s.push(n.replace(/_.*/,``).replace(/[A-Z]/g,e=>`-`+e.toLowerCase())+`: `+o+`;`)}(s.length||l)&&a.push((n&&!c&&!o?e.map(n):e).join(`, `)+` {`+s.join(` `)+`}`)}for(let t in e)i(r(t),e[t],this.rules)}getRules(){return this.rules.join(`
|
|
20
|
+
`)}static newName(){let e=lz[sz]||1;return lz[sz]=e+1,oz+e.toString(36)}static mount(e,t,n){let r=e[cz],i=n&&n.nonce;r?i&&r.setNonce(i):r=new fz(e,i),r.mount(Array.isArray(t)?t:[t],e)}},dz=new Map,fz=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=dz.get(n);if(t)return e[cz]=t;this.sheet=new r.CSSStyleSheet,dz.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[cz]=this}mount(e,t){let n=this.sheet,r=0,i=0,a=!1;for(let t=0;t<e.length;t++){let o=e[t],s=this.modules.indexOf(o);if(s<i&&s>-1&&(this.modules.splice(s,1),a=!0,i--,s=-1),s==-1){if(this.modules.splice(i++,0,o),a=!0,n)for(let e=0;e<o.rules.length;e++)n.insertRule(o.rules[e],r++)}else{for(;i<s;)r+=this.modules[i++].rules.length;r+=o.rules.length,i++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{if(a){let e=``;for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+`
|
|
21
|
+
`;this.styleTag.textContent=e}let e=t.head||t;this.styleTag.parentNode!=e&&e.insertBefore(this.styleTag,e.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(`nonce`)!=e&&this.styleTag.setAttribute(`nonce`,e)}},pz={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:`'`},mz={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},hz=typeof navigator<`u`&&/Mac/.test(navigator.platform),gz=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),_z=0;_z<10;_z++)pz[48+_z]=pz[96+_z]=String(_z);for(var _z=1;_z<=24;_z++)pz[_z+111]=`F`+_z;for(var _z=65;_z<=90;_z++)pz[_z]=String.fromCharCode(_z+32),mz[_z]=String.fromCharCode(_z);for(var vz in pz)mz.hasOwnProperty(vz)||(mz[vz]=pz[vz]);function yz(e){var t=!(hz&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||gz&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?mz:pz)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}function bz(){var e=arguments[0];typeof e==`string`&&(e=document.createElement(e));var t=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`?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)xz(e,arguments[t]);return e}function xz(e,t){if(typeof t==`string`)e.appendChild(document.createTextNode(t));else if(t!=null){if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)xz(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}}var Sz=typeof navigator<`u`?navigator:{userAgent:``,vendor:``,platform:``},Cz=typeof document<`u`?document:{documentElement:{style:{}}},wz=/Edge\/(\d+)/.exec(Sz.userAgent),Tz=/MSIE \d/.test(Sz.userAgent),Ez=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Sz.userAgent),Dz=!!(Tz||Ez||wz),Oz=!Dz&&/gecko\/(\d+)/i.test(Sz.userAgent),kz=!Dz&&/Chrome\/(\d+)/.exec(Sz.userAgent),Az=`webkitFontSmoothing`in Cz.documentElement.style,jz=!Dz&&/Apple Computer/.test(Sz.vendor),Mz=jz&&(/Mobile\/\w+/.test(Sz.userAgent)||Sz.maxTouchPoints>2),Z={mac:Mz||/Mac/.test(Sz.platform),windows:/Win/.test(Sz.platform),linux:/Linux|X11/.test(Sz.platform),ie:Dz,ie_version:Tz?Cz.documentMode||6:Ez?+Ez[1]:wz?+wz[1]:0,gecko:Oz,gecko_version:Oz?+(/Firefox\/(\d+)/.exec(Sz.userAgent)||[0,0])[1]:0,chrome:!!kz,chrome_version:kz?+kz[1]:0,ios:Mz,android:/Android\b/.test(Sz.userAgent),webkit:Az,webkit_version:Az?+(/\bAppleWebKit\/(\d+)/.exec(Sz.userAgent)||[0,0])[1]:0,safari:jz,safari_version:jz?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Sz.userAgent)||[0,0])[1]:0,tabSize:Cz.documentElement.style.tabSize==null?`-moz-tab-size`:`tab-size`};function Nz(e,t){for(let n in e)n==`class`&&t.class?t.class+=` `+e.class:n==`style`&&t.style?t.style+=`;`+e.style:t[n]=e[n];return t}var Pz=Object.create(null);function Fz(e,t,n){if(e==t)return!0;e||=Pz,t||=Pz;let r=Object.keys(e),i=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let a of r)if(a!=n&&(i.indexOf(a)==-1||e[a]!==t[a]))return!1;return!0}function Iz(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]??e.removeAttribute(r)}for(let n in t){let r=t[n];n==`style`?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}function Lz(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i==`style`?e.style.cssText=``:e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i==`style`?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function Rz(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}var zz=class{eq(e){return!1}updateDOM(e,t,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,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},Bz=(function(e){return e[e.Text=0]=`Text`,e[e.WidgetBefore=1]=`WidgetBefore`,e[e.WidgetAfter=2]=`WidgetAfter`,e[e.WidgetRange=3]=`WidgetRange`,e})(Bz||={}),Q=class extends zR{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new Vz(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Uz(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:i,end:a}=Wz(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(a?t?2e8:1:-6e8)+1}return new Uz(e,n,r,t,e.widget||null,!0)}static line(e){return new Hz(e)}static set(e,t=!1){return WR.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};Q.none=WR.empty;var Vz=class e extends Q{constructor(e){let{start:t,end:n}=Wz(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||`span`,this.attrs=e.class&&e.attributes?Nz(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Pz}eq(t){return this==t||t instanceof e&&this.tagName==t.tagName&&Fz(this.attrs,t.attrs)}range(e,t=e){if(e>=t)throw RangeError(`Mark decorations may not be empty`);return super.range(e,t)}};Vz.prototype.point=!1;var Hz=class e extends Q{constructor(e){super(-2e8,-2e8,null,e)}eq(t){return t instanceof e&&this.spec.class==t.spec.class&&Fz(this.spec.attributes,t.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError(`Line decoration ranges must be zero-length`);return super.range(e,t)}};Hz.prototype.mapMode=LL.TrackBefore,Hz.prototype.point=!0;var Uz=class e extends Q{constructor(e,t,n,r,i,a){super(t,n,i,e),this.block=r,this.isReplace=a,this.mapMode=r?t<=0?LL.TrackBefore:LL.TrackAfter:LL.TrackDel}get type(){return this.startSide==this.endSide?this.startSide<=0?Bz.WidgetBefore:Bz.WidgetAfter:Bz.WidgetRange}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof e&&Gz(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError(`Invalid range for replacement decoration`);if(!this.isReplace&&t!=e)throw RangeError(`Widget decorations can only have zero-length ranges`);return super.range(e,t)}};Uz.prototype.point=!0;function Wz(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n??=e.inclusive,r??=e.inclusive,{start:n??t,end:r??t}}function Gz(e,t){return e==t||!!(e&&t&&e.compare(t))}function Kz(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}var qz=class e extends zR{constructor(e,t,n){super(),this.tagName=e,this.attributes=t,this.rank=n}eq(t){return t==this||t instanceof e&&this.tagName==t.tagName&&Fz(this.attributes,t.attributes)}static create(t){return new e(t.tagName,t.attributes||Pz,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(e,t=!1){return WR.of(e,t)}};qz.prototype.startSide=qz.prototype.endSide=-1;function Jz(e){let t;return t=e.nodeType==11?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function Yz(e,t){return t?e==t||e.contains(t.nodeType==1?t:t.parentNode):!1}function Xz(e,t){if(!t.anchorNode)return!1;try{return Yz(e,t.anchorNode)}catch{return!1}}function Zz(e){return e.nodeType==3?mB(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function Qz(e,t,n,r){return n?tB(e,t,n,r,-1)||tB(e,t,n,r,1):!1}function $z(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function eB(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function tB(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:nB(e))){if(e.nodeName==`DIV`)return!1;let n=e.parentNode;if(!n||n.nodeType!=1)return!1;t=$z(e)+(i<0?0:1),e=n}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable==`false`)return!1;t=i<0?nB(e):0}else return!1}}function nB(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function rB(e,t){let{left:n,right:r}=e;if(n==r)return e;let i=t?n:r;return{left:i,right:i,top:e.top,bottom:e.bottom}}function iB(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function aB(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function oB(e,t,n,r,i,a,o,s){let c=e.ownerDocument,l=c.defaultView||window;for(let u=e,d=!1;u&&!d;)if(u.nodeType==1){let e,f=u==c.body,p=1,m=1;if(f)e=iB(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:p,scaleY:m}=aB(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*m}}let h=0,g=0;if(i==`nearest`)t.top<e.top+o?(g=t.top-(e.top+o),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+o)):t.bottom>e.bottom-o&&(g=t.bottom-e.bottom+o,n<0&&t.top-g<e.top&&(g=t.top-(e.top+o)));else{let r=t.bottom-t.top,a=e.bottom-e.top;g=(i==`center`&&r<=a?t.top+r/2-a/2:i==`start`||i==`center`&&n<0?t.top-o:t.bottom-a+o)-e.top}if(r==`nearest`?t.left<e.left+a?(h=t.left-(e.left+a),n>0&&t.right>e.right+h&&(h=t.right-e.right+a)):t.right>e.right-a&&(h=t.right-e.right+a,n<0&&t.left<e.left+h&&(h=t.left-(e.left+a))):h=(r==`center`?t.left+(t.right-t.left)/2-(e.right-e.left)/2:r==`start`==s?t.left-a:t.right-(e.right-e.left)+a)-e.left,h||g){if(f)l.scrollBy(h,g);else{let e=0,n=0;if(g){let e=u.scrollTop;u.scrollTop+=g/m,n=(u.scrollTop-e)*m}if(h){let t=u.scrollLeft;u.scrollLeft+=h/p,e=(u.scrollLeft-t)*p}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-h)<1&&(r=`nearest`),n&&Math.abs(n-g)<1&&(i=`nearest`)}}if(f)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function sB(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let a=e.parentNode;a&&!(a==n.body||(!t||r)&&i);)if(a.nodeType==1)!i&&a.scrollHeight>a.clientHeight&&(i=a),t&&!r&&a.scrollWidth>a.clientWidth&&(r=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:r,y:i}}var cB=class{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:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?nB(t):0),n,Math.min(e.focusOffset,n?nB(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}};function lB(e){let t=[];for(let n=e;n;n=n.nodeType==11?n.host:n.parentNode)n.nodeType==1&&t.push({node:n,left:n.scrollLeft,top:n.scrollTop});return t}function uB(e,t=!0){for(let{node:n,left:r,top:i}of e)t&&n.scrollTop!=i&&(n.scrollTop=i),n.scrollLeft!=r&&(n.scrollLeft=r)}var dB=null;Z.safari&&Z.safari_version>=26&&(dB=!1);function fB(e){if(e.setActive)return e.setActive();if(dB)return e.focus(dB);let t=lB(e);e.focus(dB==null?{get preventScroll(){return dB={preventScroll:!0},!0}}:void 0),dB||(dB=!1,uB(t))}var pB;function mB(e,t,n=t){let r=pB||=document.createRange();return r.setEnd(e,n),r.setStart(e,t),r}function hB(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let a=new KeyboardEvent(`keydown`,i);a.synthetic=!0,e.dispatchEvent(a);let o=new KeyboardEvent(`keyup`,i);return o.synthetic=!0,e.dispatchEvent(o),a.defaultPrevented||o.defaultPrevented}function gB(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function _B(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,nB(n));;)if(r){if(n.nodeType!=1)return!1;let e=n.childNodes[r-1];e.contentEditable==`false`?r--:(n=e,r=nB(n))}else if(n==e)return!0;else r=$z(n),n=n.parentNode}function vB(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function yB(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r>0)return{node:n,offset:r};else if(n.nodeType==1&&r>0){if(n.contentEditable==`false`)return null;n=n.childNodes[r-1],r=nB(n)}else if(n.parentNode&&!eB(n))r=$z(n),n=n.parentNode;else return null}function bB(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};else if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable==`false`)return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!eB(n))r=$z(n)+1,n=n.parentNode;else return null}var xB=class e{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(t,n){return new e(t.parentNode,$z(t),n)}static after(t,n){return new e(t.parentNode,$z(t)+1,n)}},SB=(function(e){return e[e.LTR=0]=`LTR`,e[e.RTL=1]=`RTL`,e})(SB||={}),CB=SB.LTR,wB=SB.RTL;function TB(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}var EB=TB(`88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008`),DB=TB(`4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333`),OB=Object.create(null),kB=[];for(let e of[`()`,`[]`,`{}`]){let t=e.charCodeAt(0),n=e.charCodeAt(1);OB[t]=n,OB[n]=-t}function AB(e){return e<=247?EB[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?DB[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}var jB=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,MB=class{get dir(){return this.level%2?wB:CB}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let i=-1;for(let a=0;a<e.length;a++){let o=e[a];if(o.from<=t&&o.to>=t){if(o.level==n)return a;(i<0||(r==0?e[i].level>o.level:r<0?o.from<t:o.to>t))&&(i=a)}}if(i<0)throw RangeError(`Index out of range`);return i}};function NB(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!NB(r.inner,i.inner))return!1}return!0}var PB=[];function FB(e,t,n,r,i){for(let a=0;a<=r.length;a++){let o=a?r[a-1].to:t,s=a<r.length?r[a].from:n,c=a?256:i;for(let t=o,n=c,r=c;t<s;t++){let i=AB(e.charCodeAt(t));i==512?i=n:i==8&&r==4&&(i=16),PB[t]=i==4?2:i,i&7&&(r=i),n=i}for(let e=o,t=c,r=c;e<s;e++){let i=PB[e];if(i==128)e<s-1&&t==PB[e+1]&&t&24?i=PB[e]=t:PB[e]=256;else if(i==64){let i=e+1;for(;i<s&&PB[i]==64;)i++;let a=e&&t==8||i<n&&PB[i]==8?r==1?1:8:256;for(let t=e;t<i;t++)PB[t]=a;e=i-1}else i==8&&r==1&&(PB[e]=1);t=i,i&7&&(r=i)}}}function IB(e,t,n,r,i){let a=i==1?2:1;for(let o=0,s=0,c=0;o<=r.length;o++){let l=o?r[o-1].to:t,u=o<r.length?r[o].from:n;for(let t=l,n,r,o;t<u;t++)if(r=OB[n=e.charCodeAt(t)]){if(r<0){for(let e=s-3;e>=0;e-=3)if(kB[e+1]==-r){let n=kB[e+2],r=n&2?i:n&4?n&1?a:i:0;r&&(PB[t]=PB[kB[e]]=r),s=e;break}}else if(kB.length==189)break;else kB[s++]=t,kB[s++]=n,kB[s++]=c}else if((o=PB[t])==2||o==1){let e=o==i;c=+!e;for(let t=s-3;t>=0;t-=3){let n=kB[t+2];if(n&2)break;if(e)kB[t+2]|=2;else{if(n&4)break;kB[t+2]|=4}}}}}function LB(e,t,n,r){for(let i=0,a=r;i<=n.length;i++){let o=i?n[i-1].to:e,s=i<n.length?n[i].from:t;for(let c=o;c<s;){let o=PB[c];if(o==256){let o=c+1;for(;;)if(o==s){if(i==n.length)break;o=n[i++].to,s=i<n.length?n[i].from:t}else if(PB[o]==256)o++;else break;let l=a==1,u=l==((o<t?PB[o]:r)==1)?l?1:2:r;for(let t=o,r=i,a=r?n[r-1].to:e;t>c;)t==a&&(t=n[--r].from,a=r?n[r-1].to:e),PB[--t]=u;c=o}else a=o,c++}}}function RB(e,t,n,r,i,a,o){let s=r%2?2:1;if(r%2==i%2)for(let c=t,l=0;c<n;){let t=!0,u=!1;if(l==a.length||c<a[l].from){let e=PB[c];e!=s&&(t=!1,u=e==16)}let d=!t&&s==1?[]:null,f=t?r:r+1,p=c;run:for(;;)if(l<a.length&&p==a[l].from){if(u)break run;let m=a[l];if(!t)for(let e=m.to,t=l+1;;){if(e==n)break run;if(t<a.length&&a[t].from==e)e=a[t++].to;else if(PB[e]==s)break run;else break}l++,d?d.push(m):(m.from>c&&o.push(new MB(c,m.from,f)),zB(e,m.direction==CB==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.to),p=m.to}else if(p==n||(t?PB[p]!=s:PB[p]==s))break;else p++;d?RB(e,c,p,r+1,i,d,o):c<p&&o.push(new MB(c,p,f)),c=p}else for(let c=n,l=a.length;c>t;){let n=!0,u=!1;if(!l||c>a[l-1].to){let e=PB[c-1];e!=s&&(n=!1,u=e==16)}let d=!n&&s==1?[]:null,f=n?r:r+1,p=c;run:for(;;)if(l&&p==a[l-1].to){if(u)break run;let m=a[--l];if(!n)for(let e=m.from,n=l;;){if(e==t)break run;if(n&&a[n-1].to==e)e=a[--n].from;else if(PB[e-1]==s)break run;else break}d?d.push(m):(m.to<c&&o.push(new MB(m.to,c,f)),zB(e,m.direction==CB==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.from),p=m.from}else if(p==t||(n?PB[p-1]!=s:PB[p-1]==s))break;else p--;d?RB(e,p,c,r+1,i,d,o):p<c&&o.push(new MB(p,c,f)),c=p}}function zB(e,t,n,r,i,a,o){let s=t%2?2:1;FB(e,i,a,r,s),IB(e,i,a,r,s),LB(i,a,r,s),RB(e,i,a,t,n,r,o)}function BB(e,t,n){if(!e)return[new MB(0,0,+(t==wB))];if(t==CB&&!n.length&&!jB.test(e))return VB(e.length);if(n.length)for(;e.length>PB.length;)PB[PB.length]=256;let r=[],i=t==CB?0:1;return zB(e,i,i,n,0,e.length,r),r}function VB(e){return[new MB(0,e,0)]}var HB=``;function UB(e,t,n,r,i){if(!e.length)return null;let a=r.head-e.from,o;if(r.head==e.from&&r.assoc<0){if(!i)return null;a=t[o=0].side(!1,n)}else if(r.head==e.to&&r.assoc>0){if(i)return null;a=t[o=t.length-1].side(!0,n)}else o=MB.find(t,a,r.bidiLevel??-1,r.assoc);let s=t[o],c=s.side(i,n);if(a==c){let e=o+=i?1:-1;if(e<0||e>=t.length)return null;s=t[o=e],a=s.side(!i,n),c=s.side(i,n)}let l=AL(e.text,a,s.forward(i,n));(l<s.from||l>s.to)&&(l=c),HB=e.text.slice(Math.min(a,l),Math.max(a,l));let u=o==(i?t.length-1:0)?null:t[o+(i?1:-1)];if(l==c){if(!u)return i?Y.cursor(e.to,1):Y.cursor(e.from,-1);if(u.level+ +!i<s.level)return Y.cursor(u.side(!i,n)+e.from,u.forward(i,n)?1:-1,u.level)}return Y.cursor(l+e.from,s.forward(i,n)?-1:1,s.level)}function WB(e,t,n){for(let r=t;r<n;r++){let t=AB(e.charCodeAt(r));if(t==1)return CB;if(t==2||t==4)return wB}return CB}var GB=X.define(),KB=X.define(),qB=X.define(),JB=X.define(),YB=X.define(),XB=X.define(),ZB=X.define(),QB=X.define(),$B=X.define(),eV=X.define({combine:e=>e.some(e=>e)}),tV=X.define({combine:e=>e.some(e=>e)}),nV=X.define(),rV=class e{constructor(e,t,n,r,i,a=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i,this.isSnapshot=a}map(t){return t.empty?this:new e(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new e(Y.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},iV=SR.define({map:(e,t)=>e.map(t)}),aV=SR.define();function oV(e,t,n){let r=e.facet(JB);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+`:`,t):console.error(t))}var sV=X.define({combine:e=>!e.length||e[0]}),cV=0,lV=X.define({combine(e){return e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})}}),uV=class e{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(lV.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(lV.of({plugin:this,arg:e}))}static define(t,n){let{eventHandlers:r,eventObservers:i,provide:a,decorations:o}=n||{};return new e(cV++,t,r,i,e=>{let t=[];return o&&t.push(mV.of(t=>{let n=t.plugin(e);return n?o(n):Q.none})),a&&t.push(a(e)),t})}static fromClass(t,n){return e.define((e,n)=>new t(e,n),n)}},dV=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(!this.value){if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){oV(e.state,t,`CodeMirror plugin crashed`),this.deactivate()}}else if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(oV(e.state,t,`CodeMirror plugin crashed`),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}return this}destroy(e){if(this.value?.destroy)try{this.value.destroy()}catch(t){oV(e.state,t,`CodeMirror plugin crashed`)}}deactivate(){this.spec=this.value=null}},fV=X.define(),pV=X.define(),mV=X.define(),hV=X.define(),gV=X.define(),_V=X.define(),vV=X.define();function yV(e,t){let n=e.state.facet(vV);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return WR.spans(r,t.from,t.to,{point(){},span(e,n,r,a){let o=e-t.from,s=n-t.from,c=i;for(let e=r.length-1;e>=0;e--,a--){let n=r[e].spec.bidiIsolate,i;if(n??=WB(t.text,o,s),a>0&&c.length&&(i=c[c.length-1]).to==o&&i.direction==n)i.to=s,c=i.inner;else{let e={from:o,to:s,direction:n,inner:[]};c.push(e),c=e.inner}}}}),i}var bV=X.define();function xV(e){let t=0,n=0,r=0,i=0;for(let a of e.state.facet(bV)){let o=a(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:t,right:n,top:r,bottom:i}}var SV=X.define(),CV=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(t){return new e(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,a=0,o=0;;){let s=i<t.length?t[i].fromB:1e9,c=a<n.length?n[a]:1e9,l=Math.min(s,c);if(l==1e9)break;let u=l+o,d=l,f=u;for(;;)if(a<n.length&&n[a]<=d){let e=n[a+1];a+=2,d=Math.max(d,e);for(let e=i;e<t.length&&t[e].fromB<=d;e++)o=t[e].toA-t[e].toB;f=Math.max(f,e+o)}else if(i<t.length&&t[i].fromB<=d){let e=t[i++];d=Math.max(d,e.toB),f=Math.max(f,e.toA),o=e.toA-e.toB}else break;r.push(new e(u,f,l,d))}return r}},wV=class e{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=zL.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new CV(e,t,n,i))),this.changedRanges=r}static create(t,n,r){return new e(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},TV=[],EV=class{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return TV}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let e=this.domAttrs;e&&Iz(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:``)+(this.breakAfter?`#`:``)}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError(`Invalid child in posBefore`)}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t,n){return null}domPosFor(e,t){let n=$z(this.dom),r=this.length?e>0:t>0;return new xB(this.parent.dom,n+ +!!r,e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof kV)return e;return null}static get(e){return e.cmTile}},DV=class extends EV{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,n=null,r,i=e?.node==t?e:null,a=0;for(let o of this.children){if(o.sync(e),a+=o.length+o.breakAfter,r=n?n.nextSibling:t.firstChild,i&&r!=o.dom&&(i.written=!0),o.dom.parentNode==t)for(;r&&r!=o.dom;)r=OV(r);else t.insertBefore(o.dom,r);n=o.dom}for(r=n?n.nextSibling:t.firstChild,i&&r&&(i.written=!0);r;)r=OV(r);this.length=a}};function OV(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var kV=class extends DV{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=EV.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,i=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&i++,r=t.pop()}else{let a=n.children[r++];if(a instanceof AV)t.push(r),n=a,r=0;else{let t=i+a.length,n=e(a,i);if(n!==void 0)return n;i=t+a.breakAfter}}}resolveBlock(e,t){let n,r=-1,i,a=-1;if(this.blockTiles((o,s)=>{let c=s+o.length;if(e>=s&&e<=c){if(o.isWidget()&&t>=-1&&t<=1){if(o.flags&32)return!0;o.flags&16&&(n=void 0)}(s<e||e==c&&(t<-1?o.length:o.covers(1)))&&(!n||!o.isWidget()&&n.isWidget())&&(n=o,r=e-s),(c>e||e==s&&(t>1?o.length:o.covers(-1)))&&(!i||!o.isWidget()&&i.isWidget())&&(i=o,a=e-s)}}),!n&&!i)throw Error(`No tile at position `+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:a}}},AV=class e extends DV{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},jV=class e extends DV{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(t,n,r){let i=new e(n||document.createElement(`div`),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,i=-1,a=null,o=-1;function s(e,c){for(let l=0,u=0;l<e.children.length&&u<=c;l++){let d=e.children[l],f=u+d.length;f>=c&&(d.isComposite()?s(d,c-u):(!a||a.isHidden&&(t>0&&!(a.flags&32)||n&&NV(a,d)))&&(f>c||d.flags&32&&t<=1)?(a=d,o=c-u):(u<c||d.flags&16&&!d.isHidden&&t>=-1)&&(r=d,i=c-u)),u=f}}s(this,e);let c=(t<0?r:a)||r||a;return c?{tile:c,offset:c==r?i:o}:null}coordsIn(e,t,n){let r=this.resolveInline(e,t,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),t,n):MV(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new xB(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,e.flags&16?1:e.flags&32?-1:t);let i=n.tile.parent,a=!1;for(let e of i.children){if(a)return new xB(e.dom,0);e==n.tile&&(a=!0)}}return new xB(this.dom,0)}};function MV(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=Zz(t);return n[n.length-1]||null}function NV(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}var PV=class e extends DV{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},FV=class e extends EV{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t,n){let r=this.dom.nodeValue.length;e>r&&(e=r);let i=e,a=e,o=0;e==0&&t<0||e==r&&t>=0?Z.chrome||Z.gecko||(e?(i--,o=1):a<r&&(a++,o=-1)):t<0?i--:a<r&&a++;let s=mB(this.dom,i,a).getClientRects();if(!s.length)return null;let c=s[(o?o<0:t>=0)?0:s.length-1];return Z.safari&&!o&&c.width==0&&(c=Array.prototype.find.call(s,e=>e.width)||c),n==null?c:rB(c,(o?o>0:t<0)==n)}static of(t,n){let r=new e(n||document.createTextNode(t),t);return n||(r.flags|=2),r}},IV=class e extends EV{constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return rB(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=this.flags&16?!0:this.flags&32?!1:e>0;for(let i=r?t.length-1:0;n=t[i],!(e>0?i==0:i==t.length-1||n.top<n.bottom);i+=r?-1:1);return rB(n,!r)}}get overrideDOMText(){if(!this.length)return yL.empty;let{root:e}=this;if(!e)return yL.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(t,n,r,i,a){return a||(a=t.toDOM(n),t.editable||(a.contentEditable=`false`)),new e(a,r,t,i)}},LV=class extends EV{constructor(e){let t=document.createElement(`img`);t.className=`cm-widgetBuffer`,t.setAttribute(`aria-hidden`,`true`),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return yL.empty}coordsIn(e,t,n){let r=this.dom.getBoundingClientRect();return n==null?r:rB(r,t>0==n)}},RV=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:i,beforeBreak:a,parents:o}=this;for(;e||t>0;)if(!r.isComposite()){let t=r.length;if(i<t&&e){let a=Math.min(e,t-i);n&&n.skip(r,i,i+a),e-=a,i+=a}if(i==t)a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++;else if(!e)break}else if(a){if(!e)break;n&&n.break(),e--,a=!1}else if(i==r.children.length){if(!e&&!o.length)break;n&&n.leave(r),a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++}else{let s=r.children[i],c=s.breakAfter;(t>0?s.length<=e:s.length<e)&&(!n||n.skip(s,0,s.length)!==!1||!s.isComposite)?(a=!!c,i++,e-=s.length):(o.push({tile:r,index:i}),r=s,i=0,n&&s.isComposite()&&n.enter(s))}return this.tile=r,this.index=i,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},zV=class{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}},BV=class{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){this.flushBuffer();let i=this.ensureMarks(t,n),a=i.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let t=i.children[i.children.length-1]=new FV(a.dom,a.text+e);t.parent=i}else i.append(r||FV.of(e,this.cache.find(FV)?.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?XV(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],i=r.lastChild;if(i instanceof PV&&i.mark.eq(n.mark))i.dom!=n.dom&&i.setDOM(XV(n.dom)),r=i;else{let{dom:e}=n;this.cache.reused.get(n)&&EV.get(n.dom)&&(e=XV(n.dom));let t=PV.of(n.mark,e);r.append(t),r=t}this.cache.reused.set(n,2)}let i=EV.get(e.text);i&&this.cache.reused.set(i,2);let a=new FV(e.text,e.text.nodeValue);a.flags|=8,this.pos=e.range.toB,r.append(a)}addInlineWidget(e,t,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let i=this.ensureMarks(t,n);!r&&!(e.flags&16)&&i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){e||=qV;let n=jV.start(e,t||this.cache.find(jV)?.dom,!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){let n=this.curLine;for(let r=e.length-1;r>=0;r--){let i=e[r],a;if(t>0&&(a=n.lastChild)&&a instanceof PV&&a.mark.eq(i))n=a,t--;else{let e=PV.of(i,this.cache.find(PV,e=>e.mark.eq(i))?.dom);n.append(e),n=e,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!GV(this.curLine,!1)||e.dom.nodeName!=`BR`&&e.isWidget()&&!(Z.ios&&GV(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(QV,0,32)||new IV(QV.toDOM(),0,QV,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=e.rank*102+e.value.rank,n=new zV(e.from,e.to,e.value,t),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){this.updateBlockWrappers();let e=this.root;for(let t of this.wrappers){let n=e.lastChild;if(t.from<this.pos&&n instanceof AV&&n.wrapper.eq(t.wrapper))e=n;else{let n=AV.of(t.wrapper,this.cache.find(AV,e=>e.wrapper.eq(t.wrapper))?.dom);e.append(n),e=n}}return e}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(LV,void 0,1);return n&&(n.flags=t),n||new LV(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},VV=class{constructor(e){this.skipCount=0,this.text=``,this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text=``,this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw Error(`Ran out of text content when drawing inline views`);this.text=t;let i=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,i)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}},HV=[IV,jV,FV,PV,LV,AV,kV];for(let e=0;e<HV.length;e++)HV[e].bucket=e;var UV=class{constructor(e){this.view=e,this.buckets=HV.map(()=>[]),this.index=HV.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,i=this.buckets[r],a=this.index[r];for(let e=0;e<i.length;e++){let o=(e+a)%i.length,s=i[o];if((!t||t(s))&&!this.reused.has(s))return i.splice(o,1),o<a&&this.index[r]--,this.reused.set(s,n),s}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let i=0,a=0;;i++){if(i==r.length){if(a)return null;a=1,i=0}let o=r[i];if(!this.reused.has(o)&&(a==0?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view,o.widget)))return r.splice(i,1),i<this.index[0]&&this.index[0]--,o.widget==e&&o.length==t&&(o.flags&497)==n?(this.reused.set(o,1),o):(this.reused.set(o,2),new IV(o.dom,t,e,o.flags&-498|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},WV=class{constructor(e,t,n,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new UV(e),this.text=new VV(e.state.doc),this.builder=new BV(this.cache,new kV(e,e.contentDOM),WR.iter(n)),this.cache.reused.set(t,2),this.old=new RV(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,i=0,a=0;;){let o=a<e.length?e[a++]:null,s=o?o.fromA:this.old.root.length;if(s>r){let e=s-r;this.preserve(e,!a,!o),r=s,i+=e}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(i,t.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,o.toA),this.emit(t.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(i,o.toB)),i=o.toB,r=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=YV(this.old),i=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget()){if(this.openWidget)this.builder.continueWidget(n-t);else{let a=n>0||t<e.length?IV.of(e.widget,this.view,n-t,e.flags&496,this.cache.maybeReuse(e)):this.cache.reuse(e);a.flags&256?(a.flags&=-2,this.builder.addBlockWidget(a)):(this.builder.ensureLine(null),this.builder.addInlineWidget(a,r,i),i=r.length)}}else if(e.isText())this.builder.ensureLine(null),!t&&n==e.length&&!this.cache.reused.has(e)?this.builder.addText(e.text,r,i,this.cache.reuse(e)):(this.cache.add(e),this.builder.addText(e.text.slice(t,n),r,i)),i=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof LV)this.cache.add(e);else if(e instanceof PV)this.builder.ensureLine(null),this.builder.addMark(e,r,i),this.cache.reused.set(e,1),i=r.length;else return!1;this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof PV&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&=i=0:e instanceof PV&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,i=-1,a=WR.spans(this.decorations,e,t,{point:(e,t,a,o,s,c)=>{if(a instanceof Uz){if(this.disallowBlockEffectsFor[c]){if(a.block)throw RangeError(`Block decorations may not be specified via plugins`);if(t>this.view.state.doc.lineAt(e).to)throw RangeError(`Decorations that replace line breaks may not be specified via plugins`)}if(i=o.length,s>o.length)r.continueWidget(t-e);else{let i=a.widget||(a.block?ZV.block:ZV.inline),c=KV(a),l=this.cache.findWidget(i,t-e,c)||IV.of(i,this.view,t-e,c);a.block?(a.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(l)):(r.ensureLine(n),r.addInlineWidget(l,o,s))}n=null}else n=JV(n,a);t>e&&this.text.skip(t-e)},span:(e,t,a,o)=>{for(let i=e;i<t;){let s=this.text.next(Math.min(512,t-i));s==null?(r.addLineStartIfNotCovered(n),r.addBreak(),i++):(r.ensureLine(n),r.addText(s,a,i==e?o:a.length),i+=s.length),n=null}i=a.length}});i>-1&&(this.openWidget=a>i),this.openWidget||r.addLineStartIfNotCovered(n),this.openMarks=a}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let e=EV.get(r);if(r==this.view.contentDOM)break;e instanceof PV?t.push(e):e?.isLine()?n=e:e instanceof AV||(r.nodeName==`DIV`&&!n?n=new jV(r,qV):n||t.push(PV.of(new Vz({tagName:r.nodeName.toLowerCase(),attributes:Rz(r)}),r)))}return n?{line:n,marks:t}:null}};function GV(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function KV(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}var qV={class:`cm-line`};function JV(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r?e:(e||={class:`cm-line`},n&&Nz(n,e),r&&(e.class+=` `+r),e)}function YV(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof PV&&t.push(r.mark)}return t}function XV(e){let t=EV.get(e);return t&&t.setDOM(e.cloneNode()),e}var ZV=class extends zz{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}};ZV.inline=new ZV(`span`),ZV.block=new ZV(`div`);var QV=new class extends zz{toDOM(){return document.createElement(`br`)}get isHidden(){return!0}get editable(){return!0}},$V=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Q.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new kV(e,e.contentDOM),this.updateInner([new CV(0,0,0,e.state.doc.length)],null)}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(this.domChanged?.newSel?n=this.domChanged.newSel.head:!uH(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let r=n>-1?rH(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){let{from:n,to:r}=this.hasComposition;t=new CV(n,r,e.changes.mapPos(n,-1),e.changes.mapPos(r,1)).addToSet(t.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(Z.ie||Z.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,a=this.blockWrappers;this.updateDeco();let o=oH(i,this.decorations,e.changes);o.length&&(t=CV.extendWithRanges(t,o));let s=cH(a,this.blockWrappers,e.changes);return s.length&&(t=CV.extendWithRanges(t,s)),r&&!t.some(e=>e.fromA<=r.range.fromA&&e.toA>=r.range.toA)&&(t=r.range.addToSet(t.slice())),this.tile.flags&2&&t.length==0?!1:(this.updateInner(t,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,r=new WV(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&EV.get(t.text)&&r.cache.reused.set(EV.get(t.text),2),this.tile=r.run(e,t),eH(n,r.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+`px`,this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+`px`:``;let r=Z.chrome||Z.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=``});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof dH&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(aV)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,i=r==n,a=!i&&!(this.view.state.facet(sV)||n.tabIndex>-1)&&Xz(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(i||t||a))return;let o=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,c,l;if(s.empty?l=c=this.inlineDOMNearPos(s.anchor,s.assoc||1):(l=this.inlineDOMNearPos(s.head,s.head==s.from?1:-1),c=this.inlineDOMNearPos(s.anchor,s.anchor==s.from?1:-1)),Z.gecko&&s.empty&&!this.hasComposition&&tH(c)){let e=document.createTextNode(``);this.view.observer.ignore(()=>c.node.insertBefore(e,c.node.childNodes[c.offset]||null)),c=l=new xB(e,0),o=!0}let u=this.view.observer.selectionRange;(o||!u.focusNode||(!Qz(c.node,c.offset,u.anchorNode,u.anchorOffset)||!Qz(l.node,l.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,s))&&(this.view.observer.ignore(()=>{Z.android&&Z.chrome&&n.contains(u.focusNode)&&lH(u.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let e=Jz(this.view.root);if(e){if(s.empty){if(Z.gecko){let e=iH(c.node,c.offset);if(e&&e!=3){let t=(e==1?yB:bB)(c.node,c.offset);t&&(c=new xB(t.node,t.offset))}}e.collapse(c.node,c.offset),s.bidiLevel!=null&&e.caretBidiLevel!==void 0&&(e.caretBidiLevel=s.bidiLevel)}else if(e.extend){e.collapse(c.node,c.offset);try{e.extend(l.node,l.offset)}catch{}}else{let t=document.createRange();s.anchor>s.head&&([c,l]=[l,c]),t.setEnd(l.node,l.offset),t.setStart(c.node,c.offset),e.removeAllRanges(),e.addRange(t)}}a&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,l)),this.impreciseAnchor=c.precise?null:new xB(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new xB(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Qz(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=Jz(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let a=this.lineAt(t.head,t.assoc);if(!a)return;let o=a.posAtStart;if(t.head==o||t.head==o+a.length)return;let s=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!s||!c||s.bottom>c.top)return;let l=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(l.node,l.offset),n.modify(`move`,t.assoc<0?`forward`:`backward`,`lineboundary`),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,i)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let i;if(e==n.dom)i=n.dom.childNodes[t];else{let r=nB(e)==0?0:t==0?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;r==0&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}i=r<0?e:e.nextSibling}if(i==n.dom.firstChild)return r;for(;i&&!EV.get(i);)i=i.nextSibling;if(!i)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==i)return t;t+=r.length+r.breakAfter}}else if(n.isText())return e==n.dom?r+t:r+(t?n.length:0);else return r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(r,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,i=!1,a,o=-1,s=!1;return this.tile.blockTiles((t,c)=>{if(t.isWidget()){if(t.flags&32&&c>=e)return!0;t.flags&16&&(i=!0)}else{let l=c+t.length;if(c<=e&&(n=t,r=e-c,i=l<e),l>=e&&!a&&(a=t,o=e-c,s=c>e),c>e&&a)return!0}}),!n&&!a?this.domAtPos(e,t):(i&&a?n=null:s&&n&&(a=null),n&&t<0||!a?n.domIn(r,t):a.domIn(o,t))}coordsAt(e,t,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,t);return r.isWidget()?r.widget instanceof dH?null:r.coordsInWidget(i,t,!0):r.coordsIn(i,t,n)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(e,t){if(e.isComposite())for(let n of e.children){if(n.length>=t){let e=r(n,t);if(e)return e}if(t-=n.length,t<0)break}else if(e.isText()&&t<e.length){let n=AL(e.text,t);if(n==t)return null;let r=mB(e.dom,t,n).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}return r(t,n)}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,i=this.view.contentDOM.clientWidth,a=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,s=this.view.textDirection==SB.LTR,c=0,l=(e,u,d)=>{for(let f=0;f<e.children.length&&!(u>r);f++){let r=e.children[f],p=u+r.length,m=r.dom.getBoundingClientRect(),{height:h}=m;if(d&&!f&&(c+=m.top-d.top),r instanceof AV)p>n&&l(r,u,m);else if(u>=n&&(c>0&&t.push(-c),t.push(h+c),c=0,a)){let e=r.dom.lastChild,t=e?Zz(e):[];if(t.length){let e=t[t.length-1],n=s?e.right-m.left:m.right-e.left;n>o&&(o=n,this.minWidth=i,this.minWidthFrom=u,this.minWidthTo=p)}}d&&f==e.children.length-1&&(c+=d.bottom-m.bottom),u=p+r.breakAfter}};return l(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction==`rtl`?SB.RTL:SB.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=Zz(r.dom);if(e.length!=1)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;let t=document.createElement(`div`),n,r,i;return t.className=`cm-line`,t.style.width=`99999px`,t.style.position=`absolute`,t.textContent=`abc def ghi jkl mno pqr stu`,this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let e=Zz(t.firstChild)[0];n=t.getBoundingClientRect().height,r=e&&e.width?e.width/27:7,i=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],a=i?i.from-1:this.view.state.doc.length;if(a>n){let r=(t.lineBlockAt(a).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(Q.replace({widget:new dH(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,a))}if(!i)break;n=i.to+1}return Q.set(e)}updateDeco(){let e=1,t=this.view.state.facet(mV).map(t=>(this.dynamicDecorationMap[e++]=typeof t==`function`)?t(this.view):t),n=!1,r=this.view.state.facet(gV).map((e,t)=>{let r=typeof e==`function`;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(WR.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(hV).map(e=>typeof e==`function`?e(this.view):e)}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(nV))try{if(t(this.view,e.range,e))return!0}catch(e){oV(this.view.state,e,`scroll handler`)}let{range:t}=e,n=this.coordsAt(t.head,t.assoc||(t.head>t.anchor?-1:1)),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let i=xV(this.view),a={left:n.left-i.left,top:n.top-i.top,right:n.right+i.right,bottom:n.bottom+i.bottom},{offsetWidth:o,offsetHeight:s}=this.view.scrollDOM;if(oB(this.view.scrollDOM,a,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,o),-o),Math.max(Math.min(e.yMargin,s),-s),this.view.textDirection==SB.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(n.top>window.visualViewport.offsetTop+window.visualViewport.height||n.bottom<window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(t.head,1);if(e){let t=lB(e.dom);e.dom.scrollIntoView({block:`nearest`}),uB(t,!1)}}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){eH(this.tile)}};function eH(e,t){let n=t?.get(e);if(n!=1){n??e.destroy();for(let n of e.children)eH(n,t)}}function tH(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable==`false`)&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable==`false`)}function nH(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=yB(n.focusNode,n.focusOffset),i=bB(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let t=EV.get(i.node);if(!t||t.isText()&&t.text!=i.node.nodeValue)a=i;else if(e.docView.lastCompositionAfterCursor){let e=EV.get(r.node);!e||e.isText()&&e.text!=r.node.nodeValue||(a=i)}}if(e.docView.lastCompositionAfterCursor=a!=r,!a)return null;let o=t-a.offset;return{from:o,to:o+a.node.nodeValue.length,node:a.node}}function rH(e,t,n){let r=nH(e,n);if(!r)return null;let{node:i,from:a,to:o}=r,s=i.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(r.from,r.to)!=s)return null;let c=t.invertedDesc;return{range:new CV(c.mapPos(a),c.mapPos(o),a,o),text:i}}function iH(e,t){return e.nodeType==1?(t&&e.childNodes[t-1].contentEditable==`false`?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable==`false`?2:0):0}var aH=class{constructor(){this.changes=[]}compareRange(e,t){Kz(e,t,this.changes)}comparePoint(e,t){Kz(e,t,this.changes)}boundChange(e){Kz(e,e,this.changes)}};function oH(e,t,n){let r=new aH;return WR.compare(e,t,n,r),r.changes}var sH=class{constructor(){this.changes=[]}compareRange(e,t){Kz(e,t,this.changes)}comparePoint(){}boundChange(e){Kz(e,e,this.changes)}};function cH(e,t,n){let r=new sH;return WR.compare(e,t,n,r),r.changes}function lH(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable==`false`)return!0;return!1}function uH(e,t){let n=!1;return t&&e.iterChangedRanges((e,r)=>{e<t.to&&r>t.from&&(n=!0)}),n}var dH=class extends zz{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 fH(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(i.length==0)return Y.cursor(t);a==0?n=1:a==i.length&&(n=-1);let o=a,s=a;n<0?o=AL(i.text,a,!1):s=AL(i.text,a);let c=r(i.text.slice(o,s));for(;o>0;){let e=AL(i.text,o,!1);if(r(i.text.slice(e,o))!=c)break;o=e}for(;s<i.length;){let e=AL(i.text,s);if(r(i.text.slice(s,e))!=c)break;s=e}return Y.undirectionalRange(o+i.from,s+i.from)}function pH(e,t,n,r,i){let a=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>e.defaultLineHeight*1.5){let t=e.viewState.heightOracle.textHeight,r=Math.floor((i-n.top-(e.defaultLineHeight-t)*.5)/t);a+=r*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(n.from,n.to);return n.from+az(o,a,e.state.tabSize)}function mH(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let i of r.type){if(i.from>t)break;if(!(i.to<t)){if(i.from<t&&i.to>t)return i;(!e||i.type==Bz.Text&&(e.type!=i.type||(n<0?i.from<t:i.to>t)))&&(e=i)}}return e||r}return r}function hH(e,t,n,r){let i=mH(e,t.head,t.assoc||-1),a=!r||i.type!=Bz.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(a){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(i.from),o=e.posAtCoords({x:n==(r==SB.LTR)?t.right-1:t.left+1,y:(a.top+a.bottom)/2});if(o!=null)return Y.cursor(o,n?-1:1)}return Y.cursor(n?i.to:i.from,n?-1:1)}function gH(e,t,n,r){let i=e.state.doc.lineAt(t.head),a=e.bidiSpans(i),o=e.textDirectionAt(i.from);for(let s=t,c=null;;){let t=UB(i,a,o,s,n),l=HB;if(!t){if(i.number==(n?e.state.doc.lines:1))return s;l=`
|
|
22
|
+
`,i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),t=n?Y.cursor(i.from,-1):Y.cursor(i.to,1)}if(!c){if(!r)return t;c=r(l)}else if(!c(l))return s;s=t}}function _H(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==MR.Space&&(i=t),i==t}}function vH(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return Y.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),u=e.documentTop;if(l)o??=l.left-c.left,s=a<0?l.top:l.bottom;else{let t=e.viewState.lineBlockAt(i);o??=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-t.from)),s=(a<0?t.top:t.bottom)+u}let d=c.left+o,f=e.viewState.heightOracle.textHeight>>1,p=r??f;for(let t=0;;t+=f){let r=s+(p+t)*a,i=CH(e,{x:d,y:r},!1,a);if(n?r>c.bottom:r<c.top)return Y.cursor(i.pos,i.assoc);let l=e.coordsAtPos(i.pos,i.assoc),u=l?(l.top+l.bottom)/2:0;if(!l||(n?u>s:u<s))return Y.cursor(i.pos,i.assoc,void 0,o)}}function yH(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,a)=>{if(t>e&&t<i){let a=r||n||(t-e<i-t?-1:1);t=a<0?e:i,r=a}});if(!r)return t}}function bH(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],a=null;if(i.empty){let t=yH(e,i.from,0);t!=i.from&&(a=Y.cursor(t,-1))}else{let t=yH(e,i.from,-1),n=yH(e,i.to,1);(t!=i.from||n!=i.to)&&(a=i.undirectional?Y.undirectionalRange(i.from,i.to):Y.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}a&&(n||=t.ranges.slice(),n[r]=a)}return n?Y.create(n,t.mainIndex):t}function xH(e,t,n){let r=yH(e.state.facet(_V).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:Y.cursor(r,r<n.from?1:-1)}var SH=class{constructor(e,t){this.pos=e,this.assoc=t}};function CH(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),a=i.top+e.viewState.paddingTop,{x:o,y:s}=t,c=s-a,l;for(;;){if(c<0)return new SH(0,1);if(c>e.viewState.docHeight)return new SH(e.state.doc.length,-1);if(l=e.elementAtHeight(c),r==null)break;if(l.type==Bz.Text){if(r<0?l.to<e.viewport.from:l.from>e.viewport.to)break;let t=e.docView.coordsAt(r<0?l.from:l.to,r>0?-1:1);if(t&&(r<0?t.top<=c+a:t.bottom>=c+a))break}let t=e.viewState.heightOracle.textHeight/2;c=r>0?l.bottom+t:l.top-t}if(e.viewport.from>=l.to||e.viewport.to<=l.from){if(n)return null;if(l.type==Bz.Text){let t=pH(e,i,l,o,s);return new SH(t,t==l.from?1:-1)}}if(l.type!=Bz.Text)return c<(l.top+l.bottom)/2?new SH(l.from,1):new SH(l.to,-1);let u=e.docView.lineAt(l.from,2);return(!u||u.length!=l.length)&&(u=e.docView.lineAt(l.from,-2)),new wH(e,o,s,e.textDirectionAt(l.from)).scanTile(u,l.from)}var wH=class{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[MB.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[MB.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t,n=!1){let r=0,i=e.length-1,a=new Set,o=this.bidiIn(e[0],e[i]),s,c,l=-1,u=1e9,d;search:for(;r<i;){let n=i-r,f=r+i>>1;adjust:if(a.has(f)){for(let e=1;e<n;e++){let t=f+e;if(t>=i&&(t-=n),!a.has(t)){f=t;break adjust}}break search}a.add(f);let p=t(f),m=0;if(p)for(let e=0;e<p.length;e++){let t=p[e];if(!(t.width==0&&p.length>1)){if(t.bottom<this.y)(!s||s.bottom<t.bottom)&&(s=t),m=1;else if(t.top>this.y)(!c||c.top>t.top)&&(c=t),m=-1;else{let e=t.left>this.x?this.x-t.left:t.right<this.x?this.x-t.right:0,n=Math.abs(e);n<u&&(l=f,u=n,d=t),e&&(m=e<0==(this.baseDir==SB.LTR)?-1:1)}}}m==-1&&(!o||this.baseDirAt(e[f],1))?i=f:m==1&&(!o||this.baseDirAt(e[f+1],-1))&&(r=f+1)}if(!d){if(!c&&!s)return{i:0,after:!1};let n=s&&(!c||this.y-s.bottom<c.top-this.y)?s:c;return this.y=(n.top+n.bottom)/2,this.scan(e,t,!0)}if(u&&!n){let{top:n,bottom:r}=d;if(s&&s.bottom>(n+n+r)/3)return this.y=s.bottom-1,this.scan(e,t,!0);if(c&&c.top<(n+r+r)/3)return this.y=c.top+1,this.scan(e,t,!0)}let f=(o?this.dirAt(e[l],1):this.baseDir)==SB.LTR;return{i:l,after:this.x>(d.left+d.right)/2==f}}scanText(e,t){let n=[];for(let r=0;r<e.length;r=AL(e.text,r))n.push(t+r);n.push(t+e.length);let r=this.scan(n,r=>{let i=n[r]-t,a=n[r+1]-t;return mB(e.dom,i,a).getClientRects()});return r.after?new SH(n[r.i+1],-1):new SH(n[r.i],1)}scanTile(e,t){if(!e.length)return new SH(t,1);if(e.children.length==1){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let r=0,i=t;r<e.children.length;r++)n.push(i+=e.children[r].length);let r=this.scan(n,t=>{let n=e.children[t];return n.flags&48?null:(n.dom.nodeType==1?n.dom:mB(n.dom,0,n.length)).getClientRects()}),i=e.children[r.i],a=n[r.i];return i.isText()?this.scanText(i,a):i.isComposite()?this.scanTile(i,a):r.after?new SH(n[r.i+1],-1):new SH(a,1)}},TH=``,EH=class{constructor(e,t){this.points=e,this.view=t,this.text=``,this.lineSeparator=t.state.facet(LR.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=TH}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let i=EV.get(r),a=r.nextSibling;if(a==t){i?.breakAfter&&!a&&n!=this.view.contentDOM&&this.lineBreak();break}let o=EV.get(a);(i&&o?i.breakAfter:(i?i.breakAfter:eB(r))||eB(a)&&(r.nodeName!=`BR`||i?.isWidget())&&this.text.length>e)&&!OH(a,t)&&this.lineBreak(),r=a}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,a=1,o;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),a=this.lineSeparator.length):(o=r.exec(t))&&(i=o.index,a=o[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=a-1);n=i+a}}readNode(e){let t=EV.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.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,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(DH(e,n.node,n.offset)?t:0))}};function DH(e,t,n){for(;;){if(!t||n<nB(t))return!1;if(t==e)return!0;n=$z(t)+1,t=t.parentNode}}function OH(e,t){let n;for(;e!=t&&e;e=e.nextSibling){let t=EV.get(e);if(!t?.isWidget())return!1;t&&(n||=[]).push(t)}if(n){for(let e of n)if(e.overrideDOMText?.length)return!1}return!0}var kH=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},AH=class{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text=``,this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:a}=e.docView,o=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=jH(e.docView.tile,t,n,0))){let t=i||a?[]:IH(e),n=new EH(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=LH(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!Yz(e.contentDOM,t.focusNode)?o.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=a&&a.node==t.anchorNode&&a.offset==t.anchorOffset||!Yz(e.contentDOM,t.anchorNode)?o.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((Z.ios||Z.chrome)&&n!=r&&Math.min(n,r)<=o.main.from&&Math.max(n,r)>=o.main.to&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),a=s.from-t,o=s.to-i;(a==0||a==1||t==0)&&(o==0||o==-1||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}if(e.inputState.composing>-1&&o.ranges.length>1)this.newSel=o.replaceRange(Y.range(r,n));else if(e.lineWrapping&&r==n&&!(o.main.empty&&o.main.head==n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),r=0;t&&(r=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=Y.create([Y.cursor(n,r)])}else this.newSel=Y.single(r,n)}}};function jH(e,t,n,r){if(e.isComposite()){let i=-1,a=-1,o=-1,s=-1;for(let c=0,l=r,u=r;c<e.children.length;c++){let r=e.children[c],d=l+r.length;if(l<t&&d>n)return jH(r,t,n,l);if(d>=t&&i==-1&&(i=c,a=l),l>n&&r.dom.parentNode==e.dom){o=c,s=u;break}u=d,l=d+r.breakAfter}return{from:a,to:s<0?r+e.length:s,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o<e.children.length&&o>=0?e.children[o].dom:null}}return e.isText()?{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function MH(e,t){let n,{newSel:r}=t,{state:i}=e,a=i.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:r}=t.bounds,s=a.from,c=null;(o===8||Z.android&&t.text.length<r-e)&&(s=a.to,c=`end`);let l=i.doc.sliceString(e,r,TH),u,d;!a.empty&&a.from>=e&&a.to<=r&&(t.typeOver||l!=t.text)&&l.slice(0,a.from-e)==t.text.slice(0,a.from-e)&&l.slice(a.to-e)==t.text.slice(u=t.text.length-(l.length-(a.to-e)))?n={from:a.from,to:a.to,insert:yL.of(t.text.slice(a.from-e,u).split(TH))}:(d=FH(l,t.text,s-e,c))&&(Z.chrome&&o==13&&d.toB==d.from+2&&t.text.slice(d.from,d.toB)==``&&d.toB--,n={from:e+d.from,to:e+d.toA,insert:yL.of(t.text.slice(d.from,d.toB).split(TH))})}else r&&(!e.hasFocus&&i.facet(sV)||RH(r,a))&&(r=null);if(!n&&!r)return!1;if((Z.mac||Z.android)&&n&&n.from==n.to&&n.from==a.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute(`autocorrect`)==`off`?(r&&n.insert.length==2&&(r=Y.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:yL.of([n.insert.toString().replace(`.`,` `)])}):i.doc.lineAt(a.from).to<a.to&&e.docView.lineHasWidget(a.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:a.from,to:a.to,insert:i.toText(e.inputState.insertingText)}:Z.chrome&&n&&n.from==n.to&&n.from==a.head&&n.insert.toString()==`
|
|
23
|
+
`&&e.lineWrapping&&(r&&=Y.single(r.main.anchor-1,r.main.head-1),n={from:a.from,to:a.to,insert:yL.of([` `])}),n)return NH(e,n,r,o);if(r&&!RH(r,a)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin,n==`select.pointer`&&(r=bH(i.facet(_V).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}return!1}function NH(e,t,n,r=-1){if(Z.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(Z.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==` `)&&t.insert.length==1&&t.insert.lines==2&&hB(e.contentDOM,`Enter`,13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&hB(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&hB(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||=PH(e,t,n);return e.state.facet(XB).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function PH(e,t,n){let r,i=e.state,a=i.selection.main,o=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let n=t.from<a.from?-1:1,r=n<0?a.from:a.to,s=yH(i.facet(_V).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:Y.cursor(t.from+t.insert.length,-1)};else if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=a.from<t.from?i.sliceDoc(a.from,t.from):``,o=a.to>t.to?i.sliceDoc(t.to,a.to):``;r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=i.changes(t),s=n&&n.main.to<=o.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&nH(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(a.head);let d=a.to-t.to;r=i.changeByRange(n=>{if(n.from==a.from&&n.to==a.to)return{changes:o,range:s||n.map(o)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=l.from&&u<=l.to)return{range:n};let f=i.changes({from:u,to:r,insert:t.insert}),p=n.to-a.to;return{changes:f,range:s?Y.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(f)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let s=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=`.compose`,e.inputState.compositionFirstChange&&(s+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function FH(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let o=e.length,s=t.length;for(;o>0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if(r==`end`){let e=Math.max(0,a-Math.min(o,s));n-=o+e-a}if(o<a&&e.length<t.length){let e=n<=a&&n>=o?a-n:0;a-=e,s=a+(s-o),o=a}else if(s<a){let e=n<=a&&n>=s?a-n:0;a-=e,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function IH(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new kH(n,r)),(i!=n||a!=r)&&t.push(new kH(i,a))),t}function LH(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n<0||r<0?null:n==r?Y.create([Y.cursor(r+t,-1)]):Y.single(n+t,r+t)}function RH(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}var zH=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText=``,this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Z.safari&&e.contentDOM.addEventListener(`input`,()=>null),Z.gecko&&SU(e.contentDOM.ownerDocument)}handleEvent(e){$H(this.view,e)&&!this.ignoreDuringComposition(e)&&(e.type==`keydown`&&this.keydown(e)||(this.view.updateState==0?this.runHandlers(e.type,e):Promise.resolve().then(()=>this.runHandlers(e.type,e))))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=HH(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if(e!=`scroll`){let i=!t[e].handlers.length,a=n[e];a&&i!=!a.handlers.length&&(r.removeEventListener(e,this.handleEvent),a=null),a||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)e!=`scroll`&&!t[e]&&r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&GH.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Z.android&&Z.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(Z.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(UH.some(t=>t.keyCode==e.keyCode)&&!e.ctrlKey||WH.indexOf(e.key)>-1&&e.ctrlKey)){let t={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};t.shiftKey&&Z.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&BH(this.view.win)&&(t.shiftKey=!1);let n=this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:t};return setTimeout(()=>{this.pendingIOSKey==n&&this.flushIOSKey()},50),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let t=this.pendingIOSKey;return!t||this.view.observer.pendingRecords().length||t.key==`Enter`&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,hB(this.view.contentDOM,t.key,t.keyCode,t.mods))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Z.safari&&!Z.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function BH(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function VH(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){oV(n.state,e)}}}function HH(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(VH(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(VH(t.value,r))}}for(let e in eU)n(e).handlers.push(eU[e]);for(let e in tU)n(e).observers.push(tU[e]);return t}var UH=[{key:`Backspace`,keyCode:8,inputType:`deleteContentBackward`},{key:`Enter`,keyCode:13,inputType:`insertParagraph`},{key:`Enter`,keyCode:13,inputType:`insertLineBreak`},{key:`Delete`,keyCode:46,inputType:`deleteContentForward`}],WH=`dthko`,GH=[16,17,18,20,91,92,224,225],KH=6;function qH(e){return Math.max(0,e)*.7+8}function JH(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}var YH=class{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=sB(e.contentDOM),this.atoms=e.state.facet(_V).map(t=>t(e));let i=e.contentDOM.ownerDocument;i.addEventListener(`mousemove`,this.move=this.move.bind(this)),i.addEventListener(`mouseup`,this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(LR.allowMultipleSelections)&&XH(e,t),this.dragging=QH(e,t)&&dU(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&JH(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,i=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:o}=this.scrollParents.y.getBoundingClientRect());let s=xV(this.view);e.clientX-s.left<=r+KH?t=-qH(r-e.clientX):e.clientX+s.right>=a-KH&&(t=qH(e.clientX-a)),e.clientY-s.top<=i+KH?n=-qH(i-e.clientY):e.clientY+s.bottom>=o-KH&&(n=qH(e.clientY-o)),this.setScrollSpeed(t,n)}up(e){this.dragging??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,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=bH(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:`select.pointer`}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent(`input.type`))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function XH(e,t){let n=e.state.facet(GB);return n.length?n[0](t):Z.mac?t.metaKey:t.ctrlKey}function ZH(e,t){let n=e.state.facet(KB);return n.length?n[0](t):Z.mac?!t.altKey:!t.ctrlKey}function QH(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=Jz(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}function $H(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=EV.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}var eU=Object.create(null),tU=Object.create(null),nU=Z.ie&&Z.ie_version<15||Z.ios&&Z.webkit_version<604;function rU(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement(`textarea`));n.style.cssText=`position: fixed; left: -10000px; top: 10px`,n.focus(),setTimeout(()=>{e.focus(),n.remove(),aU(e,n.value)},50)}function iU(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function aU(e,t){t=iU(e.state,QB,t);let{state:n}=e,r,i=1,a=n.toText(t),o=a.lines==n.selection.ranges.length;if(_U!=null&&n.selection.ranges.every(e=>e.empty)&&_U==a.toString()){let e=-1;r=n.changeByRange(r=>{let s=n.doc.lineAt(r.from);if(s.from==e)return{range:r};e=s.from;let c=n.toText((o?a.line(i++).text:t)+n.lineBreak);return{changes:{from:s.from,insert:c},range:Y.cursor(r.from+c.length,-1)}})}else r=o?n.changeByRange(e=>{let t=a.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:Y.cursor(e.from+t.length,-1)}}):n.replaceSelection(a);e.dispatch(r,{userEvent:`input.paste`,scrollIntoView:!0})}tU.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,Z.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())},tU.wheel=tU.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},eU.keydown=(e,t)=>(e.inputState.setSelectionOrigin(`select`),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),tU.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin(`select.pointer`)},tU.touchmove=e=>{e.inputState.setSelectionOrigin(`select.pointer`)},tU.touchend=(e,t)=>{e.inputState.touchActive=!1},eU.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(qB))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=fU(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new YH(e,t,n,r)),r&&e.observer.ignore(()=>{fB(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin(`select.pointer`);return!1};function oU(e,t,n,r){if(r==1)return Y.cursor(t,n);if(r==2)return fH(e.state,t,n);{let r=e.docView.lineAt(t,n),i=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:i.from,o=r?r.posAtEnd:i.to;return o<e.state.doc.length&&o==i.to&&o++,Y.undirectionalRange(a,o)}}var sU=Z.ie&&Z.ie_version<=11,cU=null,lU=0,uU=0;function dU(e){if(!sU)return e.detail;let t=cU,n=uU;return cU=e,uU=Date.now(),lU=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(lU+1)%3:1}function fU(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=dU(t),i=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),i=i.map(e.changes))},get(t,a,o){let s=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),c,l=oU(e,s.pos,s.assoc,r);if(n.pos!=s.pos&&!a){let t=oU(e,n.pos,n.assoc,r),i=Math.min(t.from,l.from),a=Math.max(t.to,l.to);l=i<l.from?Y.range(i,a,l.assoc):Y.range(a,i,l.assoc)}return a?i.replaceRange(i.main.extend(l.from,l.to,l.assoc)):o&&r==1&&i.ranges.length>1&&(c=pU(i,s.pos))?c:o?i.addRange(l):Y.create([l])}}}function pU(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return Y.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-+(e.mainIndex>n))}return null}eU.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=Y.undirectionalRange(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData(`Text`,iU(e.state,$B,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed=`copyMove`),!1},eU.dragend=e=>(e.inputState.draggedContent=null,!1);function mU(e,t,n,r){if(n=iU(e.state,QB,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,o=r&&a&&ZH(e,t)?{from:a.from,to:a.to}:null,s={from:i,insert:n},c=e.state.changes(o?[o,s]:s);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:o?`move.drop`:`input.drop`}),e.inputState.draggedContent=null}eU.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,a=()=>{++i==n.length&&mU(e,t,r.filter(e=>e!=null).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=a,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),a()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData(`Text`);if(n)return mU(e,t,n,!0),!0}return!1},eU.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=nU?null:t.clipboardData;return n?(aU(e,n.getData(`text/plain`)||n.getData(`text/uri-list`)),!0):(rU(e),!1)};function hU(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement(`textarea`));r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function gU(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let a=e.doc.lineAt(r);a.number>i&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),i=a.number}r=!0}return{text:iU(e,$B,t.join(e.lineBreak)),ranges:n,linewise:r}}var _U=null;eU.copy=eU.cut=(e,t)=>{if(!Xz(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=gU(e.state);if(!n&&!i)return!1;_U=i?n:null,t.type==`cut`&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:`delete.cut`});let a=nU?null:t.clipboardData;return a?(a.clearData(),a.setData(`text/plain`,n),!0):(hU(e,n),!1)};var vU=yR.define();function yU(e,t){let n=[];for(let r of e.facet(ZB)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:vU.of(!0)}):null}function bU(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=yU(e.state,t);n?e.dispatch(n):e.update([])}},10)}tU.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),bU(e)},tU.blur=e=>{e.observer.clearSelectionRange(),bU(e)},tU.compositionstart=tU.compositionupdate=e=>{if(!e.observer.editContext&&(e.inputState.compositionFirstChange??(e.inputState.compositionFirstChange=!0),e.inputState.composing<0)){let{main:t}=e.state.selection;!t.empty&&e.lineBlockAt(t.from).from!=e.lineBlockAt(t.to).from&&e.dispatch({changes:e.state.selection.ranges.filter(e=>!e.empty).map(e=>({from:e.from,to:e.to})),userEvent:`input`}),e.inputState.composing=0}},tU.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,Z.chrome&&Z.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},tU.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},eU.beforeinput=(e,t)=>{if((t.inputType==`insertText`||t.inputType==`insertCompositionText`)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType==`insertReplacementText`&&e.observer.editContext){let n=t.dataTransfer?.getData(`text/plain`),r=t.getTargetRanges();if(n&&r.length){let t=r[0];return NH(e,{from:e.posAtDOM(t.startContainer,t.startOffset),to:e.posAtDOM(t.endContainer,t.endOffset),insert:e.state.toText(n)},null),!0}}let n;if(Z.chrome&&Z.android&&(n=UH.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(n.key,n.keyCode),n.key==`Backspace`||n.key==`Delete`)){let t=window.visualViewport?.height||0;setTimeout(()=>{(window.visualViewport?.height||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return Z.ios&&t.inputType==`deleteContentForward`&&e.observer.flushSoon(),Z.safari&&t.inputType==`insertText`&&e.inputState.composing>=0&&setTimeout(()=>tU.compositionend(e,t),20),!1};var xU=new Set;function SU(e){xU.has(e)||(xU.add(e),e.addEventListener(`copy`,()=>{}),e.addEventListener(`cut`,()=>{}))}var CU=[`pre-wrap`,`normal`,`pre-line`,`break-spaces`],wU=!1;function TU(){wU=!1}var EU=class{constructor(e){this.lineWrapping=e,this.doc=yL.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return CU.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,i,a){let o=CU.indexOf(e)>-1,s=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,s){this.heightSamples={};for(let e=0;e<a.length;e++){let t=a[e];t<0?e++:this.heightSamples[Math.floor(t*10)]=!0}}return s}},DU=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},OU=class e{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return typeof this._content==`number`?Bz.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 Uz?this._content.widget:null}get widgetLineBreaks(){return typeof this._content==`number`?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new e(this.from,this.length+t.length,this.top,this.height+t.height,n)}},kU=(function(e){return e[e.ByPos=0]=`ByPos`,e[e.ByHeight=1]=`ByHeight`,e[e.ByPosNoHeight=2]=`ByPosNoHeight`,e})(kU||={}),AU=.001,jU=class e{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>AU&&(wU=!0),this.height=e)}replace(t,n,r){return e.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,a=n.doc;for(let o=r.length-1;o>=0;o--){let{fromA:s,toA:c,fromB:l,toB:u}=r[o],d=i.lineAt(s,kU.ByPosNoHeight,n.setDoc(t),0,0),f=d.to>=c?d:i.lineAt(c,kU.ByPosNoHeight,n,0,0);for(u+=f.to-c,c=f.to;o>0&&d.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s<d.from&&(d=i.lineAt(s,kU.ByPosNoHeight,n,0,0));l+=d.from-s,s=d.from;let p=BU.build(n.setDoc(a),e,l,u);i=MU(i,i.replace(s,c,p))}return i.updateHeight(n,0)}static empty(){return new FU(0,0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,a=0;for(;;)if(n==r){if(i>a*2){let e=t[n-1];e.break?t.splice(--n,1,e.left,null,e.right):t.splice(--n,1,e.left,e.right),r+=1+e.break,i-=e.size}else if(a>i*2){let e=t[r];e.break?t.splice(r,1,e.left,null,e.right):t.splice(r,1,e.left,e.right),r+=2+e.break,a-=e.size}else break}else if(i<a){let e=t[n++];e&&(i+=e.size)}else{let e=t[--r];e&&(a+=e.size)}let o=!1;return t[n-1]==null?(o=!0,n--):t[n]??(o=!0,r++),new LU(e.of(t.slice(0,n)),o,e.of(t.slice(r)))}};function MU(e,t){return e==t?e:(e.constructor!=t.constructor&&(wU=!0),t)}jU.prototype.size=1;var NU=Q.replace({}),PU=class extends jU{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new OU(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new OU(r,0,n,this.spaceAbove,NU):this.mainBlock(n,r)}lineAt(e,t,n,r,i){let a=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,n,r,i).join(a):a}forEachLine(e,t,n,r,i,a){e<=i+this.length&&t>=i&&a(this.lineAt(0,kU.ByPos,n,r,i))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},FU=class e extends PU{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new OU(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof e||i instanceof IU&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof IU?i=new e(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):jU.of(r)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:``}${this.widgetHeight?`:`+this.widgetHeight:``})`}},IU=class e extends jU{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,a,o=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);a=t/i,this.length>i+1&&(o=(this.height-t)/(this.length-i-1))}else a=this.height/i;return{firstLine:n,lastLine:r,perLine:a,perChar:o}}blockAt(e,t,n,r){let{firstLine:i,lastLine:a,perLine:o,perChar:s}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),a=t.doc.lineAt(i),c=o+a.length*s,l=Math.max(n,e-c/2);return new OU(a.from,a.length,l,c,0)}{let r=Math.max(0,Math.min(a-i,Math.floor((e-n)/o))),{from:s,length:c}=t.doc.line(i+r);return new OU(s,c,n+o*r,o,0)}}lineAt(e,t,n,r,i){if(t==kU.ByHeight)return this.blockAt(e,n,r,i);if(t==kU.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new OU(t,r-t,0,0,0)}let{firstLine:a,perLine:o,perChar:s}=this.heightMetrics(n,i),c=n.doc.lineAt(e),l=o+c.length*s,u=c.number-a,d=r+o*u+s*(c.from-i-u);return new OU(c.from,c.length,Math.max(r,Math.min(d,r+this.height-l)),l,0)}forEachLine(e,t,n,r,i,a){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:o,perLine:s,perChar:c}=this.heightMetrics(n,i);for(let l=e,u=r;l<=t;){let t=n.doc.lineAt(l);if(l==e){let n=t.number-o;u+=s*n+c*(e-i-n)}let r=s+c*t.length;a(new OU(t.from,t.length,u,r,0)),u+=r,l=t.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let t=r[r.length-1];t instanceof e?r[r.length-1]=new e(t.length+i):r.push(null,new e(i-1))}if(t>0){let n=r[0];n instanceof e?r[0]=new e(t+n.length):r.unshift(new e(t-1),null)}return jU.of(r)}decomposeLeft(t,n){n.push(new e(t-1),null)}decomposeRight(t,n){n.push(null,new e(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let a=n+this.length;if(i&&i.from<=n+this.length&&i.more){let r=[],o=Math.max(n,i.from),s=-1;for(i.from>n&&r.push(new e(i.from-n-1).updateHeight(t,n));o<=a&&i.more;){let e=t.doc.lineAt(o).length;r.length&&r.push(null);let n=i.heights[i.index++],a=0;n<0&&(a=-n,n=i.heights[i.index++]),s==-1?s=n:Math.abs(n-s)>=AU&&(s=-2);let c=new FU(e,n,a);c.outdated=!1,r.push(c),o+=e+1}o<=a&&r.push(null,new e(a-o).updateHeight(t,o));let c=jU.of(r);return(s<0||Math.abs(c.height-this.height)>=AU||Math.abs(s-this.heightMetrics(t,n).perLine)>=AU)&&(wU=!0),MU(this,c)}return(r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}},LU=class extends jU{constructor(e,t,n){super(e.length+ +!!t+n.length,e.height+n.height,+!!t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let a=r+this.left.height,o=i+this.left.length+this.break,s=t==kU.ByHeight?e<a:e<o,c=s?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,a,o);if(this.break||(s?c.to<o:c.from>o))return c;let l=t==kU.ByPosNoHeight?kU.ByPosNoHeight:kU.ByPos;return s?c.join(this.right.lineAt(o,l,n,a,o)):this.left.lineAt(o,l,n,r,i).join(c)}forEachLine(e,t,n,r,i,a){let o=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,r,i,a),t>=s&&this.right.forEachLine(e,t,n,o,s,a);else{let c=this.lineAt(s,kU.ByPos,n,r,i);e<c.from&&this.left.forEachLine(e,Math.min(t,c.from-1),n,r,i,a),c.to>=e&&c.from<=t&&a(c),t>c.to&&this.right.forEachLine(Math.max(e,c.to+1),t,n,o,s,a)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let e of n)i.push(e);if(e>0&&RU(i,a-1),t<this.length){let e=i.length;this.decomposeRight(t,i),RU(i,e)}return jU.of(i)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?jU.of(this.break?[e,null,t]:[e,t]):(this.left=MU(this.left,e),this.right=MU(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:a}=this,o=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=o+a.length&&r.more?s=a=a.updateHeight(e,o,n,r):a.updateHeight(e,o,n),s?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?` `:`-`)+this.right}};function RU(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof IU&&(r=e[t+1])instanceof IU&&e.splice(t-1,3,new IU(n.length+1+r.length))}var zU=5,BU=class e{constructor(e,t){this.pos=e,this.oracle=t,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,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof FU?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new FU(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=t-e;n.block?this.addBlock(new PU(a,r,n)):(a||i||r>=zU)&&this.addLineDeco(r,i,a)}else t>e&&this.span(e,t);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:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,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 FU(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new IU(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof FU)return e;let t=new FU(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos+=e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos+=n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof FU)&&!this.isCovered?this.nodes.push(new FU(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let e of this.nodes)e instanceof FU&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(t,n,r,i){let a=new e(r,t);return WR.spans(n,r,i,a,0),a.finish(r)}};function VU(e,t,n){let r=new HU;return WR.compare(e,t,n,r,0),r.changes}var HU=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&Kz(e,t,this.changes,5)}};function UU(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,a=Math.max(0,n.left),o=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),c=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(t.nodeType==1){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&r.overflow!=`visible`){let r=n.getBoundingClientRect();a=Math.max(a,r.left),o=Math.min(o,r.right),s=Math.max(s,r.top),c=Math.min(t==e.parentNode?i.innerHeight:c,r.bottom)}t=r.position==`absolute`||r.position==`fixed`?n.offsetParent:n.parentNode}else if(t.nodeType==11)t=t.host;else break;return{left:a-n.left,right:Math.max(a,o)-n.left,top:s-(n.top+t),bottom:Math.max(s,c)-(n.top+t)}}function WU(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function GU(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}var KU=class{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return Q.replace({widget:new qU(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},qU=class extends zz{constructor(e,t){super(),this.size=e,this.vertical=t}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}},JU=class{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=eW,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=SB.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(pV).some(e=>typeof e!=`function`&&e.class==`cm-lineWrapping`);this.heightOracle=new EU(n),this.stateDeco=tW(t),this.heightMap=jU.empty().applyChanges(this.stateDeco,yL.empty,this.heightOracle.setDoc(t.doc),[new CV(0,0,0,t.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Q.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new YU(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?eW:new nW(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(rW(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=tW(this.state);let r=e.changedRanges,i=CV.extendWithRanges(r,VU(n,this.stateDeco,e?e.changes:zL.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);TU(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||wU)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let s=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<s.from||t.range.head>s.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t));let c=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(tV)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,i=n.whiteSpace;this.defaultTextDirection=n.direction==`rtl`?SB.RTL:SB.LTR;let a=this.heightOracle.mustRefreshForWrapping(i)||this.mustMeasureContent===`refresh`,o=t.getBoundingClientRect(),s=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,l=0;if(o.width&&o.height){let{scaleX:e,scaleY:n}=aB(t,o);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,c|=16,a=s=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=d)&&(this.paddingTop=u,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(s=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let f=sB(this.view.contentDOM,!1).y;f!=this.scrollParent&&(this.scrollParent=f,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=vB(this.scrollParent||e.win);let m=(this.printing?GU:UU)(t,this.paddingTop),h=m.top-this.pixelViewport.top,g=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let _=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(_!=this.inView&&(this.inView=_,_&&(s=!0)),!this.inView&&!this.scrollTarget&&!WU(e.dom))return 0;let v=o.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),s){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(a=!0),a||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:o,textHeight:s}=e.docView.measureTextSize();a=n>0&&r.refresh(i,n,o,s,Math.max(5,v/o),t),a&&(e.docView.minWidth=0,c|=16)}h>0&&g>0?l=Math.max(h,g):h<0&&g<0&&(l=Math.min(h,g)),TU();for(let n of this.viewports){let i=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(a?jU.empty().applyChanges(this.stateDeco,yL.empty,this.heightOracle,[new CV(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new DU(n.from,i))}wU&&(c|=2)}let y=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return y&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(l,this.scrollTarget),c|=this.updateForViewport()),(c&2||y)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]: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,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,s=new YU(r.lineAt(a-n*1e3,kU.ByHeight,i,0,0).from,r.lineAt(o+(1-n)*1e3,kU.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(e<s.from||e>s.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),a=r.lineAt(e,kU.ByPos,i,0,0),o;o=t.y==`center`?(a.top+a.bottom)/2-n/2:t.y==`start`||t.y==`nearest`&&e<s.from?a.top:a.bottom-n,s=new YU(r.lineAt(o-500,kU.ByHeight,i,0,0).from,r.lineAt(o+n+500,kU.ByHeight,i,0,0).to)}}return s}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new YU(this.heightMap.lineAt(n,kU.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,kU.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,kU.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,kU.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:o}=this;return(e==0||r<=a-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=o+Math.max(10,Math.min(n,250)))&&r>a-2e3&&i<o+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new KU(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,a=r<<1;if(this.defaultTextDirection!=SB.LTR&&!n)return[];let o=[],s=(r,a,c,l)=>{if(a-r<i)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<a){s(r,e-10,c,l),s(e+10,a,c,l);return}let f=$U(e,e=>e.from>=c.from&&e.to<=c.to&&Math.abs(e.from-r)<i&&Math.abs(e.to-a)<i&&!d.some(t=>e.from<t&&e.to>t));if(!f){if(a<c.to&&t&&n&&t.visibleRanges.some(e=>e.from<=a&&e.to>=a)){let e=t.moveToLineBoundary(Y.cursor(a),!1,!0).head;e>r&&(a=e)}let e=this.gapSize(c,r,a,l);f=new KU(r,a,e,n||e<2e6?e:2e6)}o.push(f)},c=t=>{if(t.length<a||t.type!=Bz.Text)return;let i=XU(t.from,t.to,this.stateDeco);if(i.total<a)return;let o=this.scrollTarget?this.scrollTarget.range.head:null,c,l;if(n){let e=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,n,a;if(o!=null){let r=QU(i,o),s=((this.visibleBottom-this.visibleTop)/2+e)/t.height;n=r-s,a=r+s}else n=(this.visibleTop-t.top-e)/t.height,a=(this.visibleBottom-t.top+e)/t.height;c=ZU(i,n),l=ZU(i,a)}else{let n=i.total*this.heightOracle.charWidth,a=r*this.heightOracle.charWidth,s=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=n.size-n.displaySize);let u=this.pixelViewport.left+s,d=this.pixelViewport.right+s,f,p;if(o!=null){let e=QU(i,o),t=((d-u)/2+a)/n;f=e-t,p=e+t}else f=(u-a)/n,p=(d+a)/n;c=ZU(i,f),l=ZU(i,p)}c>t.from&&s(t.from,c,t,i),l<t.to&&s(l,t.to,t,i)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(c):c(e);return o}gapSize(e,t,n,r){let i=QU(r,n)-QU(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){KU.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Q.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];WR.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(r&8);t++){let i=this.visibleRanges[t],a=n[t];(i.from!=a.from||i.to!=a.to)&&(r|=4,e&&e.mapPos(i.from,-1)==a.from&&e.mapPos(i.to,1)==a.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||rW(this.heightMap.lineAt(e,kU.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||rW(this.heightMap.lineAt(this.scaler.fromDOM(e),kU.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop*this.scaleY:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return rW(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}},YU=class{constructor(e,t){this.from=e,this.to=t}};function XU(e,t,n){let r=[],i=e,a=0;return WR.spans(n,e,t,{span(){},point(e,t){e>i&&(r.push({from:i,to:e}),a+=e-i),i=t}},20),i<t&&(r.push({from:i,to:t}),a+=t-i),{total:a,ranges:r}}function ZU({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],a=i-n;if(r<=a)return n+r;r-=a}}function QU(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function $U(e,t){for(let n of e)if(t(n))return n}var eW={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function tW(e){let t=e.facet(mV).filter(e=>typeof e!=`function`),n=e.facet(gV).filter(e=>typeof e!=`function`);return n.length&&t.push(WR.join(n)),t}var nW=class e{constructor(e,t,n){let r=0,i=0,a=0;this.viewports=n.map(({from:n,to:i})=>{let a=t.lineAt(n,kU.ByPos,e,0,0).top,o=t.lineAt(i,kU.ByPos,e,0,0).bottom;return r+=o-a,{from:n,to:i,top:a,bottom:o,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=a+(e.top-i)*this.scale,a=e.domBottom=e.domTop+(e.bottom-e.top),i=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(t){return t instanceof e&&this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,n)=>e.from==t.viewports[n].from&&e.to==t.viewports[n].to)}};function rW(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new OU(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>rW(e,t)):e._content)}var iW=X.define({combine:e=>e.join(` `)}),aW=X.define({combine:e=>e.indexOf(!0)>-1}),oW=uz.newName(),sW=uz.newName(),cW=uz.newName(),lW={"&light":`.`+sW,"&dark":`.`+cW};function uW(e,t,n){return new uz(t,{finish(t){return/&/.test(t)?t.replace(/&\w*/,t=>{if(t==`&`)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+` `+t}})}var dW=uW(`.`+oW,{"&":{position:`relative !important`,boxSizing:`border-box`,"&.cm-focused":{outline:`1px dotted #212121`},display:`flex !important`,flexDirection:`column`},".cm-scroller":{display:`flex !important`,alignItems:`flex-start !important`,fontFamily:`monospace`,lineHeight:1.4,height:`100%`,overflowX:`auto`,position:`relative`,zIndex:0,overflowAnchor:`none`},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:`block`,whiteSpace:`pre`,wordWrap:`normal`,boxSizing:`border-box`,minHeight:`100%`,padding:`4px 0`,outline:`none`,"&[contenteditable=true]":{WebkitUserModify:`read-write-plaintext-only`}},".cm-lineWrapping":{whiteSpace_fallback:`pre-wrap`,whiteSpace:`break-spaces`,wordBreak:`break-word`,overflowWrap:`anywhere`,flexShrink:1},"&light .cm-content":{caretColor:`black`},"&dark .cm-content":{caretColor:`white`},".cm-line":{display:`block`,padding:`0 2px 0 6px`},".cm-layer":{userSelect:`none`,position:`absolute`,left:0,top:0,contain:`size style`,"& > *":{position:`absolute`}},"&light .cm-selectionBackground":{background:`#d9d9d9`},"&dark .cm-selectionBackground":{background:`#222`},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#d7d4f0`},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#233`},".cm-cursorLayer":{pointerEvents:`none`},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:`steps(1) cm-blink 1.2s infinite`},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:`1.2px solid black`,marginLeft:`-0.6px`,pointerEvents:`none`},".cm-cursor":{display:`none`},"&dark .cm-cursor":{borderLeftColor:`#ddd`},".cm-selectionHandle":{backgroundColor:`currentColor`,width:`1.5px`},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:`""`,backgroundColor:`inherit`,borderRadius:`50%`,width:`8px`,height:`8px`,position:`absolute`,left:`-3.25px`},".cm-selectionHandle-start::before":{top:`-8px`},".cm-selectionHandle-end::before":{bottom:`-8px`},".cm-dropCursor":{position:`absolute`},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:`block`},".cm-iso":{unicodeBidi:`isolate`},".cm-announced":{position:`fixed`,top:`-10000px`},"@media print":{".cm-announced":{display:`none`}},"&light .cm-activeLine":{backgroundColor:`#cceeff44`},"&dark .cm-activeLine":{backgroundColor:`#99eeff33`},"&light .cm-specialChar":{color:`red`},"&dark .cm-specialChar":{color:`#f78`},".cm-gutters":{flexShrink:0,display:`flex`,height:`100%`,boxSizing:`border-box`,zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:`#f5f5f5`,color:`#6c6c6c`,border:`0px solid #ddd`,"&.cm-gutters-before":{borderRightWidth:`1px`},"&.cm-gutters-after":{borderLeftWidth:`1px`}},"&dark .cm-gutters":{backgroundColor:`#333338`,color:`#ccc`},".cm-gutter":{display:`flex !important`,flexDirection:`column`,flexShrink:0,boxSizing:`border-box`,minHeight:`100%`,overflow:`hidden`},".cm-gutterElement":{boxSizing:`border-box`},".cm-lineNumbers .cm-gutterElement":{padding:`0 3px 0 5px`,minWidth:`20px`,textAlign:`right`,whiteSpace:`nowrap`},"&light .cm-activeLineGutter":{backgroundColor:`#e2f2ff`},"&dark .cm-activeLineGutter":{backgroundColor:`#222227`},".cm-panels":{boxSizing:`border-box`,position:`sticky`,left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:`#f5f5f5`,color:`black`},".cm-panels-top":{top:`0`},".cm-panels-bottom":{bottom:`0`},"&light .cm-panels-top":{borderBottom:`1px solid #ddd`},"&light .cm-panels-bottom":{borderTop:`1px solid #ddd`},"&dark .cm-panels":{backgroundColor:`#333338`,color:`white`},".cm-dialog":{padding:`2px 19px 4px 6px`,position:`relative`,"& label":{fontSize:`80%`}},".cm-dialog-close":{position:`absolute`,top:`3px`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,fontSize:`14px`,padding:`0`},".cm-tab":{display:`inline-block`,overflow:`hidden`,verticalAlign:`bottom`},".cm-widgetBuffer":{verticalAlign:`text-top`,height:`1em`,width:0,display:`inline`},".cm-placeholder":{color:`#888`,display:`inline-block`,verticalAlign:`top`,userSelect:`none`},".cm-highlightSpace":{background:`radial-gradient(circle at 50% 55%, #aaa 20%, transparent 0) no-repeat`,backgroundSize:`.4em`,backgroundPosition:`calc(min(50%, 0px)) center`},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:`auto 100%`,backgroundPosition:`right 90%`,backgroundRepeat:`no-repeat`},".cm-trailingSpace":{backgroundColor:`#ff332255`},".cm-button":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,padding:`.2em 1em`,borderRadius:`1px`},"&light .cm-button":{backgroundImage:`linear-gradient(#eff1f5, #d9d9df)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#b4b4b4, #d0d3d6)`}},"&dark .cm-button":{backgroundImage:`linear-gradient(#393939, #111)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#111, #333)`}},".cm-textfield":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,border:`1px solid silver`,padding:`.2em .5em`},"&light .cm-textfield":{backgroundColor:`white`},"&dark .cm-textfield":{border:`1px solid #555`,backgroundColor:`inherit`}},lW),fW={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},pW=Z.ie&&Z.ie_version<=11,mW=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new cB,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(Z.ie&&Z.ie_version<=11||Z.ios&&e.composing)&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Z.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Z.chrome&&Z.chrome_version<126)&&(this.editContext=new vW(e),e.state.facet(sV)&&(e.contentDOM.editContext=this.editContext.editContext)),pW&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia(`print`)),typeof ResizeObserver==`function`&&(this.resizeScroll=new ResizeObserver(()=>{this.view.docView?.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(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.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(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent(`Event`))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers(`scroll`,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type!=`change`&&e.type||e.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(sV)?n.root.activeElement!=this.dom:!Xz(this.dom,r))return;let i=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Z.ie&&Z.ie_version<=11||Z.android&&Z.chrome)&&!n.state.selection.main.empty&&r.focusNode&&Qz(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Jz(e.root);if(!t)return!1;let n=Z.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&_W(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=Xz(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&_B(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||=this.scrollTargets.slice(0,e),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);for(let e of this.scrollTargets=t)e.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,fW),pW&&this.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),pW&&this.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&hB(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}(!this.delayedAndroidKey||e==`Enter`)&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!this.delayedAndroidKey?.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 t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),t==-1?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&Xz(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new AH(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=MH(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!RH(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type==`attributes`),e.type==`childList`){let n=hW(t,e.previousSibling||e.target.previousSibling,-1),r=hW(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return e.type==`characterData`?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener(`change`,this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener(`beforeprint`,this.onPrint),e.addEventListener(`scroll`,this.onScroll),e.document.addEventListener(`selectionchange`,this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener(`scroll`,this.onScroll),e.removeEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener(`change`,this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener(`beforeprint`,this.onPrint),e.document.removeEventListener(`selectionchange`,this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(sV)!=e.state.facet(sV)&&(e.view.contentDOM.editContext=e.state.facet(sV)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)==null||e.disconnect(),(t=this.gapIntersection)==null||t.disconnect(),(n=this.resizeScroll)==null||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function hW(e,t,n){for(;t;){let r=EV.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i==e.dom?n>0?t.nextSibling:t.previousSibling:i}return null}function gW(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return Qz(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function _W(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return gW(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener(`beforeinput`,r,!0),e.dom.ownerDocument.execCommand(`indent`),e.contentDOM.removeEventListener(`beforeinput`,r,!0),n?gW(e,n):null}var vW=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:i,head:a}=r,o=this.toEditorPos(n.updateRangeStart),s=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:o,drifted:!1});let c=s-o>n.text.length;o==this.from&&i<this.from?o=i:s==this.to&&i>this.to&&(s=i);let l=FH(e.state.sliceDoc(o,s),n.text,(c?r.from:r.to)-o,c?`end`:null);if(!l){let t=Y.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));RH(t,r)||e.dispatch({selection:t,userEvent:`select`});return}let u={from:l.from+o,to:l.toA+o,insert:yL.of(n.text.slice(l.from,l.toB).split(`
|
|
24
|
+
`))};if((Z.mac||Z.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:yL.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);NH(e,u,Y.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);t<a;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+` `:t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${/thin/i.test(r)?1:2}px`;n.push(Q.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:aV.of(Q.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{let t=Jz(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,a,o,s,c)=>{if(n)return;let l=c.length-(a-i);if(r&&a>=r.to){if(r.from==i&&r.to==a&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=l,this.to+=l;return}r=null,this.revertPending(e.state)}if(i+=t,a+=t,a<=this.from)this.from+=l,this.to+=l;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),c.toString()),this.to+=l}t+=l}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent(`input.type`)&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},$=class e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.clearAnnouncement=-1,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:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach(e=>t(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||gB(e.parent)||document,this.viewState=new JU(this,e.state||LR.create(e)),e.scrollTo&&e.scrollTo.is(iV)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(lV).map(e=>new dV(e));for(let e of this.plugins)e.update(this);this.observer=new mW(this),this.inputState=new zH(this),this.inputState.ensureHandlers(this.plugins),this.docView=new $V(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),document.fonts?.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=`refresh`,this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof CR?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(t){if(this.updateState!=0)throw Error(`Calls to EditorView.update are not allowed while an update is in progress`);let n=!1,r=!1,i,a=this.state;for(let e of t){if(e.startState!=a)throw RangeError(`Trying to update state with a transaction that doesn't start from the previous state.`);a=e.state}if(this.destroyed){this.viewState.state=a;return}let o=this.hasFocus,s=0,c=null;t.some(e=>e.annotation(vU))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=yU(a,o),c||(s=1));let l=this.observer.delayedAndroidKey,u=null;if(l?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(u=null)):this.observer.clear(),a.facet(LR.phrases)!=this.state.facet(LR.phrases))return this.setState(a);i=wV.create(this,a,t),i.flags|=s;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let n of t){if(d&&=d.map(n.changes),n.scrollIntoView){let{main:t}=n.state.selection,{x:r,y:i}=this.state.facet(e.cursorScrollMargin);d=new rV(t.empty?t:Y.cursor(t.head,t.head>t.anchor?-1:1),`nearest`,`nearest`,i,r)}for(let e of n.effects)e.is(iV)&&(d=e.value.clip(this.state))}this.viewState.update(i,d),this.bidiCache=xW.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(SV)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(e=>e.isUserEvent(`select.pointer`)))}finally{this.updateState=0}if(i.startState.facet(iW)!=i.state.facet(iW)&&(this.viewState.mustMeasureContent=!0),(n||r||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let e of this.state.facet(YB))try{e(i)}catch(e){oV(this.state,e,`update listener`)}(c||u)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),u&&!MH(this,u)&&l.force&&hB(this.contentDOM,l.key,l.keyCode)})}setState(e){if(this.updateState!=0)throw 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 t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new JU(this,e),this.plugins=e.facet(lV).map(e=>new dV(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new $V(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(lV),n=e.state.facet(lV);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new dV(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){oV(this.state,e,`doc view update listener`)}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:i,scrollAnchorHeight:a,scaleY:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(a<0){if(vB(n||this.win))i=-1,a=this.viewState.heightMap.height/this.viewState.scaleY;else{let e=this.viewState.scrollAnchorAt(r);i=e.from,a=e.top}o=this.viewState.scaleY}this.updateState=1;let s=this.viewState.measure();if(!s&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(e>5){console.warn(this.measureRequests.length?`Measure loop restarted more than 5 times`:`Viewport failed to stabilize`);break}let c=[];s&4||([this.measureRequests,c]=[c,this.measureRequests]);let l=c.map(e=>{try{return e.read(this)}catch(e){return oV(this.state,e),bW}}),u=wV.create(this,this.state,[]),d=!1;u.flags|=s,t?t.flags|=s:t=u,this.updateState=2,u.empty||(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),d=this.docView.update(u),d&&this.docViewUpdate());for(let e=0;e<c.length;e++)if(l[e]!=bW)try{let t=c[e];t.write&&t.write(l[e],this)}catch(e){oV(this.state,e)}if(d&&this.docView.updateSelection(!0),!u.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}{let e=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)/this.viewState.scaleY-a/o;if((e>1||e<-1)&&!(Z.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r+=e,n?i<0?n.scrollTop=n.scrollHeight:n.scrollTop+=e:this.win.scrollBy(0,e),a=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(YB))e(t)}get themeClasses(){return oW+` `+(this.state.facet(aW)?cW:sW)+` `+this.state.facet(iW)}updateAttrs(){let e=SW(this,fV,{class:`cm-editor`+(this.hasFocus?` cm-focused `:` `)+this.themeClasses}),t={spellcheck:`false`,autocorrect:`off`,autocapitalize:`off`,writingsuggestions:`false`,translate:`no`,contenteditable:this.state.facet(sV)?`true`:`false`,class:`cm-content`,style:`${Z.tabSize}: ${this.state.tabSize}`,role:`textbox`,"aria-multiline":`true`};this.state.readOnly&&(t[`aria-readonly`]=`true`),SW(this,pV,t);let n=this.observer.ignore(()=>{let n=Lz(this.contentDOM,this.contentAttrs,t),r=Lz(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(t){let n=!0;for(let r of t)for(let t of r.effects)if(t.is(e.announce)){n&&=(this.announceDOM.textContent=``,this.win.clearTimeout(this.clearAnnouncement),this.clearAnnouncement=this.win.setTimeout(()=>{this.announceDOM.textContent=`\xA0`},200),!1);let e=this.announceDOM.appendChild(document.createElement(`div`));e.textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(SV);let t=this.state.facet(e.cspNonce);uz.mount(this.root,this.styleModules.concat(dW).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw 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 t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.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,t,n){return xH(this,e,gH(this,e,t,n))}moveByGroup(e,t){return xH(this,e,gH(this,e,t,t=>_H(this,e.head,t)))}visualLineSide(e,t){return t?Y.cursor(e.to,1):Y.cursor(e.from,-1)}moveToLineBoundary(e,t,n=!0){return hH(this,e,t,n)}moveVertically(e,t,n){return xH(this,e,vH(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=CH(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),CH(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.state.doc.lineAt(e),r=this.bidiSpans(n),i=r[MB.find(r,e-n.from,-1,t)];return n.length&&(e==n.from&&t<0||e==n.to&&t>0)&&i.dir!=this.textDirectionAt(n.from)&&(e==n.to?(e=n.from+i.from,t=1):(e=n.from+i.to,t=-1)),this.docView.coordsAt(e,t,i.dir==SB.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(eV)||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>yW)return VB(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||NB(r.isolates,n=yV(this,e))))return r.order;n||=yV(this,e);let r=BB(e.text,t,n);return this.bidiCache.push(new xW(e.from,e.to,t,n,!0,r)),r}get hasFocus(){return(this.dom.ownerDocument.hasFocus()||Z.safari&&this.inputState?.lastContextMenu>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{fB(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.win.clearTimeout(this.clearAnnouncement),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return iV.of(new rV(typeof e==`number`?Y.cursor(e):e,t.y??`nearest`,t.x??`nearest`,t.yMargin??5,t.xMargin??5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return iV.of(new rV(Y.cursor(n.from),`start`,`start`,n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e==`boolean`?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return uV.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return uV.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=uz.newName(),r=[iW.of(n),SV.of(uW(`.${n}`,e))];return t&&t.dark&&r.push(aW.of(!0)),r}static baseTheme(e){return iR.lowest(SV.of(uW(`.`+oW,e,lW)))}static findFromDOM(e){let t=e.querySelector(`.cm-content`);return(t&&EV.get(t)||EV.get(e))?.root?.view||null}};$.styleModule=SV,$.inputHandler=XB,$.clipboardInputFilter=QB,$.clipboardOutputFilter=$B,$.scrollHandler=nV,$.focusChangeEffect=ZB,$.perLineTextDirection=eV,$.exceptionSink=JB,$.updateListener=YB,$.editable=sV,$.mouseSelectionStyle=qB,$.dragMovesSelection=KB,$.clickAddsSelectionRange=GB,$.decorations=mV,$.blockWrappers=hV,$.outerDecorations=gV,$.atomicRanges=_V,$.bidiIsolatedRanges=vV,$.cursorScrollMargin=X.define({combine:e=>{let t=5,n=5;for(let r of e)typeof r==`number`?t=n=r:{x:t,y:n}=r;return{x:t,y:n}}}),$.scrollMargins=bV,$.darkTheme=aW,$.cspNonce=X.define({combine:e=>e.length?e[0]:``}),$.contentAttributes=pV,$.editorAttributes=fV,$.lineWrapping=$.contentAttributes.of({class:`cm-lineWrapping`}),$.announce=SR.define();var yW=4096,bW={},xW=class e{constructor(e,t,n,r,i,a){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=a}static update(t,n){if(n.empty&&!t.some(e=>e.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:SB.LTR;for(let a=Math.max(0,t.length-10);a<t.length;a++){let o=t[a];o.dir==i&&!n.touchesRange(o.from,o.to)&&r.push(new e(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}};function SW(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],a=typeof t==`function`?t(e):t;a&&Nz(a,n)}return n}var CW=Z.mac?`mac`:Z.windows?`win`:Z.linux?`linux`:`key`;function wW(e,t){let n=e.split(/-(?!$)/),r=n[n.length-1];r==`Space`&&(r=` `);let i,a,o,s;for(let e=0;e<n.length-1;++e){let r=n[e];if(/^(cmd|meta|m)$/i.test(r))s=!0;else if(/^a(lt)?$/i.test(r))i=!0;else if(/^(c|ctrl|control)$/i.test(r))a=!0;else if(/^s(hift)?$/i.test(r))o=!0;else if(/^mod$/i.test(r))t==`mac`?s=!0:a=!0;else throw Error(`Unrecognized modifier name: `+r)}return i&&(r=`Alt-`+r),a&&(r=`Ctrl-`+r),s&&(r=`Meta-`+r),o&&(r=`Shift-`+r),r}function TW(e,t,n){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n!==!1&&t.shiftKey&&(e=`Shift-`+e),e}var EW=iR.default($.domEventHandlers({keydown(e,t){return FW(kW(t.state),e,t,`editor`)}})),DW=X.define({enables:EW}),OW=new WeakMap;function kW(e){let t=e.facet(DW),n=OW.get(t);return n||OW.set(t,n=NW(t.reduce((e,t)=>e.concat(t),[]))),n}function AW(e,t,n){return FW(kW(e.state),t,e,n)}var jW=null,MW=4e3;function NW(e,t=CW){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(n==null)r[e]=t;else if(n!=t)throw Error(`Key binding `+e+` is used both as a regular binding and as a multi-stroke prefix`)},a=(e,r,a,o,s)=>{let c=n[e]||(n[e]=Object.create(null)),l=r.split(/ (?!$)/).map(e=>wW(e,t));for(let t=1;t<l.length;t++){let n=l.slice(0,t).join(` `);i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=jW={view:t,prefix:n,scope:e};return setTimeout(()=>{jW==r&&(jW=null)},MW),!0}]})}let u=l.join(` `);i(u,!1);let d=c[u]||(c[u]={preventDefault:!1,stopPropagation:!1,run:(c._any?.run)?.slice()||[]});a&&d.run.push(a),o&&(d.preventDefault=!0),s&&(d.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(` `):[`editor`];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||={preventDefault:!1,stopPropagation:!1,run:[]};let{any:i}=r;for(let t in e)e[t].run.push(e=>i(e,PW))}let i=r[t]||r.key;if(i)for(let t of e)a(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&a(t,`Shift-`+i,r.shift,r.preventDefault,r.stopPropagation)}return n}var PW=null;function FW(e,t,n,r){PW=t;let i=yz(t),a=FL(NL(i,0))==i.length&&i!=` `,o=``,s=!1,c=!1,l=!1;jW&&jW.view==n&&jW.scope==r&&(o=jW.prefix+` `,GH.indexOf(t.keyCode)<0&&(c=!0,jW=null));let u=new Set,d=e=>{if(e){for(let t of e.run)if(!u.has(t)&&(u.add(t),t(n)))return e.stopPropagation&&(l=!0),!0;e.preventDefault&&(e.stopPropagation&&(l=!0),c=!0)}return!1},f=e[r],p,m;return f&&(d(f[o+TW(i,t,!a)])?s=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(Z.windows&&t.ctrlKey&&t.altKey)&&!(Z.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=pz[t.keyCode])&&p!=i?(d(f[o+TW(p,t,!0)])||t.shiftKey&&(m=mz[t.keyCode])!=i&&m!=p&&d(f[o+TW(m,t,!1)]))&&(s=!0):a&&t.shiftKey&&d(f[o+TW(i,t,!0)])&&(s=!0),!s&&d(f._any)&&(s=!0)),c&&(s=!0),s&&l&&t.stopPropagation(),PW=null,s}var IW=class e{constructor(e,t,n,r,i){this.className=e,this.left=t,this.top=n,this.width=r,this.height=i}draw(){let e=document.createElement(`div`);return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(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(t,n,r){if(r.empty){let i=t.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let a=LW(t);return[new e(n,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}return zW(t,n,r)}};function LW(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==SB.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function RW(e,t,n,r){let i=e.coordsAtPos(t,n*2);if(!i)return r;let a=e.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,s=e.posAtCoords({x:a.left+1,y:o}),c=e.posAtCoords({x:a.right-1,y:o});return s==null||c==null?r:{from:Math.max(r.from,Math.min(s,c)),to:Math.min(r.to,Math.max(s,c))}}function zW(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),a=e.textDirection==SB.LTR,o=e.contentDOM,s=o.getBoundingClientRect(),c=LW(e),l=o.querySelector(`.cm-line`),u=l&&window.getComputedStyle(l),d=s.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),f=s.right-(u?parseInt(u.paddingRight):0),p=mH(e,r,1),m=mH(e,i,-1),h=p.type==Bz.Text?p:null,g=m.type==Bz.Text?m:null;if(h&&(e.lineWrapping||p.widgetLineBreaks)&&(h=RW(e,r,1,h)),g&&(e.lineWrapping||m.widgetLineBreaks)&&(g=RW(e,i,-1,g)),h&&g&&h.from==g.from&&h.to==g.to)return v(y(n.from,n.to,h));{let t=h?y(n.from,null,h):b(p,!1),r=g?y(null,n.to,g):b(m,!0),i=[];return(h||p).to<(g||m).from-(h&&g?1:0)||p.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<r.top?i.push(_(d,t.bottom,f,r.top)):t.bottom<r.top&&e.elementAtHeight((t.bottom+r.top)/2).type==Bz.Text&&(t.bottom=r.top=(t.bottom+r.top)/2),v(t).concat(i).concat(v(r))}function _(e,n,r,i){return new IW(t,e-c.left,n-c.top,Math.max(0,r-e),i-n)}function v({top:e,bottom:t,horizontal:n}){let r=[];for(let i=0;i<n.length;i+=2)r.push(_(n[i],e,n[i+1],t));return r}function y(t,n,r){let i=1e9,o=-1e9,s=[];function c(t,n,c,l,u){let p=e.coordsAtPos(t,t==r.to?-2:2),m=e.coordsAtPos(c,c==r.from?2:-2);p&&m&&(i=Math.min(p.top,m.top,i),o=Math.max(p.bottom,m.bottom,o),u==SB.LTR?s.push(a&&n?d:p.left,a&&l?f:m.right):s.push(!a&&l?d:m.left,!a&&n?f:p.right))}let l=t??r.from,u=n??r.to;for(let r of e.visibleRanges)if(r.to>l&&r.from<u)for(let i=Math.max(r.from,l),a=Math.min(r.to,u);;){let r=e.state.doc.lineAt(i);for(let o of e.bidiSpans(r)){let e=o.from+r.from,s=o.to+r.from;if(e>=a)break;s>i&&c(Math.max(e,i),t==null&&e<=l,Math.min(s,a),n==null&&s>=u,o.dir)}if(i=r.to+1,i>=a)break}return s.length==0&&c(l,t==null,u,n==null,e.textDirection),{top:i,bottom:o,horizontal:s}}function b(e,t){let n=s.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}function BW(e,t){return e.constructor==t.constructor&&e.eq(t)}var VW=class{constructor(e,t){this.view=e,this.layer=t,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`),t.above&&this.dom.classList.add(`cm-layer-above`),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute(`aria-hidden`,`true`),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(HW)!=e.state.facet(HW)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(HW);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>!BW(e,this.drawn[t]))){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e,Z.webkit&&(this.dom.style.display=this.dom.firstChild?``:`none`)}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}},HW=X.define();function UW(e){return[uV.define(t=>new VW(t,e)),HW.of(e)]}var WW=X.define({combine(e){return RR(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function GW(e={}){return[WW.of(e),qW,YW,ZW,tV.of(!0)]}function KW(e){return e.startState.facet(WW)!=e.state.facet(WW)}var qW=UW({above:!0,markers(e){let{state:t}=e,n=t.facet(WW),r=[];for(let i of t.selection.ranges){let a=i==t.selection.main;if(i.empty||n.drawRangeCursor&&!(a&&Z.ios&&n.iosSelectionHandles)){let t=a?`cm-cursor cm-cursor-primary`:`cm-cursor cm-cursor-secondary`,n=i.empty?i:Y.cursor(i.head,i.assoc);for(let i of IW.forRange(e,t,n))r.push(i)}}return r},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName=t.style.animationName==`cm-blink`?`cm-blink2`:`cm-blink`);let n=KW(e);return n&&JW(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){JW(t.state,e)},class:`cm-cursorLayer`});function JW(e,t){t.style.animationDuration=e.facet(WW).cursorBlinkRate+`ms`}var YW=UW({above:!1,markers(e){let t=[],{main:n,ranges:r}=e.state.selection;for(let n of r)if(!n.empty)for(let r of IW.forRange(e,`cm-selectionBackground`,n))t.push(r);if(Z.ios&&!n.empty&&e.state.facet(WW).iosSelectionHandles){for(let r of IW.forRange(e,`cm-selectionHandle cm-selectionHandle-start`,Y.cursor(n.from,1)))t.push(r);for(let r of IW.forRange(e,`cm-selectionHandle cm-selectionHandle-end`,Y.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||KW(e)},class:`cm-selectionLayer`}),XW=Z.gecko&&Z.gecko_version==153?`#ffffff01`:`transparent`,ZW=iR.highest($.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:`${XW} !important`},caretColor:`transparent !important`},".cm-content":{caretColor:`transparent !important`,"& :focus":{caretColor:`initial !important`,"&::selection, & ::selection":{backgroundColor:`Highlight !important`}}}})),QW=SR.define({map(e,t){return e==null?null:t.mapPos(e)}}),$W=tR.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(QW)?t.value:e,e)}}),eG=uV.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field($W);n==null?this.cursor!=null&&((t=this.cursor)==null||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement(`div`)),this.cursor.className=`cm-dropCursor`),(e.startState.field($W)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field($W),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+`px`,this.cursor.style.top=e.top/n+`px`,this.cursor.style.height=e.height/n+`px`):this.cursor.style.left=`-100000px`}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field($W)!=e&&this.view.dispatch({effects:QW.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function tG(){return[$W,eG]}function nG(e,t,n,r,i){t.lastIndex=0;for(let a=e.iterRange(n,r),o=n,s;!a.next().done;o+=a.value.length)if(!a.lineBreak)for(;s=t.exec(a.value);)i(o+s.index,s)}function rG(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:a}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),a=Math.min(e.state.doc.lineAt(a).to,a+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=a:r.push({from:i,to:a});return r}var iG=class{constructor(e){let{regexp:t,decoration:n,decorate:r,boundary:i,maxLength:a=1e3}=e;if(!t.global)throw RangeError(`The regular expression given to MatchDecorator should have its 'g' flag set`);if(this.regexp=t,r)this.addMatch=(e,t,n,i)=>r(i,n,n+e[0].length,e,t);else if(typeof n==`function`)this.addMatch=(e,t,r,i)=>{let a=n(e,t,r);a&&i(r,r+e[0].length,a)};else if(n)this.addMatch=(e,t,r,i)=>i(r,r+e[0].length,n);else throw RangeError(`Either 'decorate' or 'decoration' should be provided to MatchDecorator`);this.boundary=i,this.maxLength=a}createDeco(e){let t=new qR,n=t.add.bind(t);for(let{from:t,to:r}of rG(e,this.maxLength))nG(e.state.doc,this.regexp,t,r,(t,r)=>this.addMatch(r,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((t,i,a,o)=>{o>=e.view.viewport.from&&a<=e.view.viewport.to&&(n=Math.min(a,n),r=Math.max(o,r))}),e.viewportMoved||r-n>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let i of e.visibleRanges){let a=Math.max(i.from,n),o=Math.min(i.to,r);if(o>=a){let n=e.state.doc.lineAt(a),r=n.to<o?e.state.doc.lineAt(o):n,s=Math.max(i.from,n.from),c=Math.min(i.to,r.to);if(this.boundary){for(;a>n.from;a--)if(this.boundary.test(n.text[a-1-n.from])){s=a;break}for(;o<r.to;o++)if(this.boundary.test(r.text[o-r.from])){c=o;break}}let l=[],u,d=(e,t,n)=>l.push(n.range(e,t));if(n==r)for(this.regexp.lastIndex=s-n.from;(u=this.regexp.exec(n.text))&&u.index<c-n.from;)this.addMatch(u,e,u.index+n.from,d);else nG(e.state.doc,this.regexp,s,c,(t,n)=>this.addMatch(n,e,t,d));t=t.update({filterFrom:s,filterTo:c,filter:(e,t)=>e<s||t>c,add:l})}}return t}},aG=/x/.unicode==null?`g`:`gu`,oG=RegExp(`[\0-\b
|
|
25
|
+
--\u2028\u2029-]`,aG),sG={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`},cG=null;function lG(){if(cG==null&&typeof document<`u`&&document.body){let e=document.body.style;cG=(e.tabSize??e.MozTabSize)!=null}return cG||!1}var uG=X.define({combine(e){let t=RR(e,{render:null,specialChars:oG,addSpecialChars:null});return(t.replaceTabs=!lG())&&(t.specialChars=RegExp(` |`+t.specialChars.source,aG)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+`|`+t.addSpecialChars.source,aG)),t}});function dG(e={}){return[uG.of(e),pG()]}var fG=null;function pG(){return fG||=uV.fromClass(class{constructor(e){this.view=e,this.decorations=Q.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(uG)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new iG({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,a=NL(t[0],0);if(a==9){let e=i.lineAt(r),t=n.state.tabSize,a=iz(e.text,t,r-e.from);return Q.replace({widget:new _G((t-a%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=Q.replace({widget:new gG(e,a)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(uG);e.startState.facet(uG)==t?this.decorations=this.decorator.updateDeco(e,this.decorations):(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view))}},{decorations:e=>e.decorations})}var mG=`•`;function hG(e){return e>=32?mG:e==10?``:String.fromCharCode(9216+e)}var gG=class extends zz{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=hG(this.code),n=e.state.phrase(`Control character`)+` `+(sG[this.code]||`0x`+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let i=document.createElement(`span`);return i.textContent=t,i.title=n,i.setAttribute(`aria-label`,n),i.className=`cm-specialChar`,i}ignoreEvent(){return!1}},_G=class extends zz{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 vG(){return bG}var yG=Q.line({class:`cm-activeLine`}),bG=uV.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(yG.range(i.from)),t=i.from)}return Q.set(n)}},{decorations:e=>e.decorations}),xG=class extends zz{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement(`span`);return t.className=`cm-placeholder`,t.style.pointerEvents=`none`,t.appendChild(typeof this.content==`string`?document.createTextNode(this.content):typeof this.content==`function`?this.content(e):this.content.cloneNode(!0)),t.setAttribute(`aria-hidden`,`true`),t}coordsAt(e){let t=e.firstChild?Zz(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=rB(t[0],n.direction!=`rtl`),i=parseInt(n.lineHeight);return r.bottom-r.top>i*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+i}:r}ignoreEvent(){return!1}};function SG(e){let t=uV.fromClass(class{constructor(t){this.view=t,this.placeholder=e?Q.set([Q.widget({widget:new xG(e),side:1}).range(0)]):Q.none}get decorations(){return this.view.state.doc.length?Q.none:this.placeholder}},{decorations:e=>e.decorations});return typeof e==`string`?[t,$.contentAttributes.of({"aria-placeholder":e})]:t}var CG=2e3;function wG(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),a=[];if(t.off>CG||n.off>CG||t.col<0||n.col<0){let o=Math.min(t.off,n.off),s=Math.max(t.off,n.off);for(let t=r;t<=i;t++){let n=e.doc.line(t);n.length<=s&&a.push(Y.range(n.from+o,n.to+s))}}else{let o=Math.min(t.col,n.col),s=Math.max(t.col,n.col);for(let t=r;t<=i;t++){let n=e.doc.line(t),r=az(n.text,o,e.tabSize,!0);if(r<0)a.push(Y.cursor(n.to));else{let t=az(n.text,s,e.tabSize);a.push(Y.range(n.from+r,n.from+t))}}}return a}function TG(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function EG(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,a=i>CG?-1:i==r.length?TG(e,t.clientX):iz(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:a,off:i}}function DG(e,t){let n=EG(e,t),r=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),i=e.state.doc.lineAt(t);n={line:i.number,col:n.col,off:Math.min(n.off,i.length)},r=r.map(e.changes)}},get(t,i,a){let o=EG(e,t);if(!o)return r;let s=wG(e.state,n,o);return s.length?a?Y.create(s.concat(r.ranges)):Y.create(s):r}}:null}function OG(e){let t=e?.eventFilter||(e=>e.altKey&&e.button==0);return $.mouseSelectionStyle.of((e,n)=>t(n)?DG(e,n):null)}var kG={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},AG={style:`cursor: crosshair`};function jG(e={}){let[t,n]=kG[e.key||`Alt`],r=uV.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){(e.keyCode==t||!n(e))&&this.set(!1)},mousemove(e){this.set(n(e))}}});return[r,$.contentAttributes.of(e=>e.plugin(r)?.isDown?AG:null)]}var MG=`-10000px`,NG=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let a=[],o=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)a[n]=this.createTooltipView(r,n?a[n-1]:null),o&&(o[n]=!!r.above);else{let r=a[n]=this.tooltipViews[s];o&&(o[n]=t[s]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)a.indexOf(e)<0&&(this.removeTooltipView(e),(n=e.destroy)==null||n.call(e));return t&&(o.forEach((e,n)=>t[n]=e),t.length=o.length),this.input=r,this.tooltips=i,this.tooltipViews=a,!0}};function PG(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}var FG=X.define({combine:e=>({position:Z.ios?`absolute`:e.find(e=>e.position)?.position||`fixed`,parent:e.find(e=>e.parent)?.parent||null,tooltipSpace:e.find(e=>e.tooltipSpace)?.tooltipSpace||PG})}),IG=new WeakMap,LG=uV.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(FG);this.position=t.position,this.parent=t.parent,this.classes=e.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 NG(e,VG,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver==`function`?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.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 e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(FG);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let e of this.manager.tooltipViews)e.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 e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add(`cm-tooltip`),e.arrow&&!n.dom.querySelector(`.cm-tooltip > .cm-tooltip-arrow`)){let e=document.createElement(`div`);e.className=`cm-tooltip-arrow`,n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=MG,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 e,t,n;this.view.win.removeEventListener(`resize`,this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(e=t.destroy)==null||e.call(t);this.parent&&this.container.remove(),(t=this.resizeObserver)==null||t.disconnect(),(n=this.intersectionObserver)==null||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position==`fixed`&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(Z.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||this.position==`absolute`){if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState)}let r=this.view.scrollDOM.getBoundingClientRect(),i=xV(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(FG).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){if(e.makeAbsolute){this.madeAbsolute=!0,this.position=`absolute`;for(let e of this.manager.tooltipViews)e.dom.style.position=`absolute`}let{visible:t,space:n,scaleX:r,scaleY:i}=e,a=[];for(let o=0;o<this.manager.tooltips.length;o++){let s=this.manager.tooltips[o],c=this.manager.tooltipViews[o],{dom:l}=c,u=e.pos[o],d=e.size[o];if(!u||s.clip!==!1&&(u.bottom<=Math.max(t.top,n.top)||u.top>=Math.min(t.bottom,n.bottom)||u.right<Math.max(t.left,n.left)-.1||u.left>Math.min(t.right,n.right)+.1)){l.style.top=MG;continue}let f=s.arrow?c.dom.querySelector(`.cm-tooltip-arrow`):null,p=f?7:0,m=d.right-d.left,h=IG.get(c)??d.bottom-d.top,g=c.offset||BG,_=this.view.textDirection==SB.LTR,v=d.width>n.right-n.left?_?n.left:n.right-d.width:_?Math.max(n.left,Math.min(u.left-(f?14:0)+g.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(f?14:0)-g.x),n.right-m),y=this.above[o];!s.strictSide&&(y?u.top-h-p-g.y<n.top:u.bottom+h+p+g.y>n.bottom)&&y==n.bottom-u.bottom>u.top-n.top&&(y=this.above[o]=!y);let b=(y?u.top-n.top:n.bottom-u.bottom)-p;if(b<h&&c.resize!==!1){if(b<this.view.defaultLineHeight){l.style.top=MG;continue}IG.set(c,h),l.style.height=(h=b)/i+`px`}else l.style.height&&(l.style.height=``);let x=y?u.top-h-p-g.y:u.bottom+p+g.y,S=v+m;if(c.overlap!==!0)for(let e of a)e.left<S&&e.right>v&&e.top<x+h&&e.bottom>x&&(x=y?e.top-h-2-p:e.bottom+p+2);if(this.position==`absolute`?(l.style.top=(x-e.parent.top)/i+`px`,RG(l,(v-e.parent.left)/r)):(l.style.top=x/i+`px`,RG(l,v/r)),f){let e=u.left+(_?g.x:-g.x)-(v+14-7);f.style.left=e/r+`px`}c.overlap!==!0&&a.push({left:v,top:x,right:S,bottom:x+h}),l.classList.toggle(`cm-tooltip-above`,y),l.classList.toggle(`cm-tooltip-below`,!y),c.positioned&&c.positioned(e.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 e of this.manager.tooltipViews)e.dom.style.top=MG}},{eventObservers:{scroll(){this.maybeMeasure()}}});function RG(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+`px`)}var zG=$.baseTheme({".cm-tooltip":{zIndex:500,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:`14px`,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`}}}),BG={x:0,y:0},VG=X.define({enables:[LG,zG]}),HG=X.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])}),UG=class e{static create(t){return new e(t)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement(`div`),this.dom.classList.add(`cm-tooltip-hover`),this.manager=new NG(e,HG,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add(`cm-tooltip-section`),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)==null||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp(`offset`)}get getCoords(){return this.passProp(`getCoords`)}get overlap(){return this.passProp(`overlap`)}get resize(){return this.passProp(`resize`)}},WG=VG.compute([HG],e=>{let t=e.facet(HG);return t.length===0?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>e.end??e.pos)),create:UG.create,above:t[0].above,arrow:t.some(e=>e.arrow)}}),GG=X.define(),KG=class{constructor(e,t,n,r,i,a){this.view=e,this.source=t,this.field=n,this.locked=r,this.setHover=i,this.hoverTime=a,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(e){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:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let r,i=1;if(n.isWidget())r=n.posAtStart;else{if(r=e.posAtCoords(t),r==null)return;let n=e.coordsAtPos(r);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(r)).find(e=>e.from<=r&&e.to>=r),o=a&&a.dir==SB.RTL?-1:1;i=t.x<n.left?-o:o}this.activateHover(e,r,i)}activateHover(e,t,n,r){let i=this.source(e,t,n),a=t=>{if(t&&(!Array.isArray(t)||t.length)){let n=Array.isArray(t)?t:[t];r&&this.locked.set(n,r),e.dispatch({effects:this.setHover.of(n)})}};if(i&&`then`in i){let n=this.pending={pos:t};i.then(e=>{this.pending==n&&(this.pending=null,a(e))},t=>oV(e.state,t,`hover tooltip`))}else a(i)}get tooltip(){let e=this.view.plugin(LG),t=e?e.manager.tooltips.findIndex(e=>e.create==UG.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){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:t,tooltip:n}=this;if(t.length&&!this.locked.has(t)&&n&&!JG(n.dom,e)||this.pending){let{pos:n}=t[0]||this.pending,r=t[0]?.end??n;(n==r?this.view.posAtCoords(this.lastMove)!=n:!YG(this.view,n,r,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length&&!this.locked.has(t)){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener(`mouseleave`,t);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener(`mouseleave`,t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener(`mouseleave`,this.mouseleave),this.view.dom.removeEventListener(`mousemove`,this.mousemove)}},qG=4;function JG(e,t){let{left:n,right:r,top:i,bottom:a}=e.getBoundingClientRect(),o;if(o=e.querySelector(`.cm-tooltip-arrow`)){let e=o.getBoundingClientRect();i=Math.min(e.top,i),a=Math.max(e.bottom,a)}return t.clientX>=n-qG&&t.clientX<=r+qG&&t.clientY>=i-qG&&t.clientY<=a+qG}function YG(e,t,n,r,i,a){let o=e.scrollDOM.getBoundingClientRect(),s=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>r||o.right<r||o.top>i||Math.min(o.bottom,s)<i)return!1;let c=e.posAtCoords({x:r,y:i},!1);return c>=t&&c<=n}function XG(e,t={}){let n=SR.define(),r=new WeakMap,i=tR.define({create(){return[]},update(e,a){let o=r.get(e);if(e.length&&(t.hideOnChange&&(a.docChanged||a.selection)||o&&o(a)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(a,e)))),a.docChanged&&e.length){let t=[];for(let n of e){let e=a.changes.mapPos(n.pos,-1,LL.TrackDel);if(e!=null){let r=Object.assign(Object.create(null),n);r.pos=e,r.end!=null&&(r.end=a.changes.mapPos(r.end)),t.push(r)}}e=t}for(let t of a.effects)t.is(n)&&(e=t.value,o=void 0),(t.is($G)&&!t.value||t.value==i)&&(e=[]);return e.length&&o&&r.set(e,o),e},provide:e=>HG.from(e)}),a=uV.define(a=>new KG(a,e,i,r,n,t.hoverTime||300));return{active:i,extension:[i,a,GG.of(a),WG]}}function ZG(e,t,n,r={}){let i=e.state.facet(GG).map(t=>e.plugin(t)).filter(e=>!!e);if(r.tooltip&&r.tooltip.active){let e=i.find(e=>e.field==r.tooltip.active);e&&(i=[e])}for(let a of i)a.activateHover(e,t,n,r.until??(()=>!1))}function QG(e,t){let n=e.plugin(LG);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}var $G=SR.define(),eK=X.define({combine(e){let t,n;for(let r of e)t||=r.topContainer,n||=r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function tK(e,t){let n=e.plugin(nK),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}var nK=uV.fromClass(class{constructor(e){this.input=e.state.facet(aK),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(eK);this.top=new rK(e,!0,t.topContainer),this.bottom=new rK(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}update(e){let t=e.state.facet(eK);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new rK(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new rK(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(aK);if(n!=this.input){let t=n.filter(e=>e),r=[],i=[],a=[],o=[];for(let n of t){let t=this.specs.indexOf(n),s;t<0?(s=n(e.view),o.push(s)):(s=this.panels[t],s.update&&s.update(e)),r.push(s),(s.top?i:a).push(s)}this.specs=t,this.panels=r,this.top.sync(i),this.bottom.sync(a);for(let e of o)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>$.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})}),rK=class{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes=``,this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&=(this.dom.remove(),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`;let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=iK(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=iK(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 iK(e){let t=e.nextSibling;return e.remove(),t}var aK=X.define({enables:nK});function oK(e,t){let n,r=new Promise(e=>n=e),i=e=>dK(e,t,n);e.state.field(cK,!1)?e.dispatch({effects:lK.of(i)}):e.dispatch({effects:SR.appendConfig.of(cK.init(()=>[i]))});let a=uK.of(i);return{close:a,result:r.then(t=>((e.win.queueMicrotask||(t=>e.win.setTimeout(t,10)))(()=>{e.state.field(cK).indexOf(i)>-1&&e.dispatch({effects:a})}),t))}}function sK(e,t){let n=e.state.field(cK,!1)||[];for(let r of n){let n=tK(e,r);if(n&&n.dom.classList.contains(t))return n}return null}var cK=tR.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(lK)?e=[n.value].concat(e):n.is(uK)&&(e=e.filter(e=>e!=n.value));return e},provide:e=>aK.computeN([e],t=>t.field(e))}),lK=SR.define(),uK=SR.define();function dK(e,t,n){let r=t.content?t.content(e,()=>o(null)):null;if(!r){if(r=bz(`form`),t.input){let e=bz(`input`,t.input);/^(text|password|number|email|tel|url)$/.test(e.type)&&e.classList.add(`cm-textfield`),e.name||=`input`,r.appendChild(bz(`label`,(t.label||``)+`: `,e))}else r.appendChild(document.createTextNode(t.label||``));r.appendChild(document.createTextNode(` `)),r.appendChild(bz(`button`,{class:`cm-button`,type:`submit`},t.submitLabel||`OK`))}let i=r.nodeName==`FORM`?[r]:r.querySelectorAll(`form`);for(let e=0;e<i.length;e++){let t=i[e];t.addEventListener(`keydown`,e=>{e.keyCode==27?(e.preventDefault(),o(null)):e.keyCode==13&&(e.preventDefault(),o(t))}),t.addEventListener(`submit`,e=>{e.preventDefault(),o(t)})}let a=bz(`div`,r,bz(`button`,{onclick:()=>o(null),"aria-label":e.state.phrase(`close`),class:`cm-dialog-close`,type:`button`},[`×`]));t.class&&(a.className=t.class),a.classList.add(`cm-dialog`);function o(t){a.contains(a.ownerDocument.activeElement)&&e.focus(),n(t)}return{dom:a,top:t.top,mount:()=>{if(t.focus){let e;e=typeof t.focus==`string`?r.querySelector(t.focus):r.querySelector(`input`)||r.querySelector(`button`),e&&`select`in e?e.select():e&&`focus`in e&&e.focus()}}}}var fK=class extends zR{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};fK.prototype.elementClass=``,fK.prototype.toDOM=void 0,fK.prototype.mapMode=LL.TrackBefore,fK.prototype.startSide=fK.prototype.endSide=-1,fK.prototype.point=!0;var pK=X.define(),mK=X.define(),hK={class:``,renderEmptyElements:!1,elementStyle:``,markers:()=>WR.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:`before`},gK=X.define();function _K(e){return[yK(),gK.of({...hK,...e})]}var vK=X.define({combine:e=>e.some(e=>e)});function yK(e){let t=[bK];return e&&e.fixed===!1&&t.push(vK.of(!0)),t}var bK=uV.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement(`div`),this.dom.className=`cm-gutters cm-gutters-before`,this.dom.setAttribute(`aria-hidden`,`true`),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.gutters=e.state.facet(gK).map(t=>new wK(e,t)),this.fixed=!e.state.facet(vK);for(let e of this.gutters)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position=`sticky`),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement(`div`),this.domAfter.className=`cm-gutters cm-gutters-after`,this.domAfter.setAttribute(`aria-hidden`,`true`),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.domAfter.style.position=this.fixed?`sticky`:``,this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+`px`;this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(vK)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?`sticky`:``,this.domAfter&&(this.domAfter.style.position=this.fixed?`sticky`:``)),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=WR.iter(this.view.state.facet(pK),this.view.viewport.from),r=[],i=this.gutters.map(e=>new CK(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let a of e.type)if(a.type==Bz.Text&&t){SK(n,r,a.from);for(let e of i)e.line(this.view,a,r);t=!1}else if(a.widget)for(let e of i)e.widget(this.view,a)}else if(e.type==Bz.Text){SK(n,r,e.from);for(let t of i)t.line(this.view,e,r)}else if(e.widget)for(let t of i)t.widget(this.view,e);for(let e of i)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(gK),n=e.state.facet(gK),r=e.docChanged||e.heightChanged||e.viewportChanged||!WR.eq(e.startState.facet(pK),e.state.facet(pK),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let i=[];for(let r of n){let n=t.indexOf(r);n<0?i.push(new wK(this.view,r)):(this.gutters[n].update(e),i.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),i.indexOf(e)<0&&e.destroy();for(let e of i)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>$.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==SB.LTR?{left:r,right:i}:{right:r,left:i}})});function xK(e){return Array.isArray(e)?e:[e]}function SK(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}var CK=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=WR.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,i=(t.top-this.height)/e.scaleY,a=t.height/e.scaleY;if(this.i==r.elements.length){let t=new TK(e,a,i,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,a,i,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];SK(this.cursor,r,t.from),n.length&&(r=r.concat(n));let i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);let a=this.gutter;(r.length!=0||a.config.renderEmptyElements)&&this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let n of e.state.facet(mK)){let i=n(e,t.widget,t);i&&(r||=[]).push(i)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},wK=class{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement(`div`),this.dom.className=`cm-gutter`+(this.config.class?` `+this.config.class:``);for(let n in t.domEventHandlers)this.dom.addEventListener(n,r=>{let i=r.target,a;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();a=(e.top+e.bottom)/2}else a=r.clientY;let o=e.lineBlockAtHeight(a-e.documentTop);t.domEventHandlers[n](e,o,r)&&r.preventDefault()});this.markers=xK(t.markers(e)),t.initialSpacer&&(this.spacer=new TK(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+=`visibility: hidden; pointer-events: none`)}update(e){let t=this.markers;if(this.markers=xK(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!WR.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},TK=class{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement(`div`),this.dom.className=`cm-gutterElement`,this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+`px`),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+`px`:``),EK(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n=`cm-gutterElement`,r=this.dom.firstChild;for(let i=0,a=0;;){let o=a,s=i<t.length?t[i++]:null,c=!1;if(s){let e=s.elementClass;e&&(n+=` `+e);for(let e=a;e<this.markers.length;e++)if(this.markers[e].compare(s)){o=e,c=!0;break}}else o=this.markers.length;for(;a<o;){let e=this.markers[a++];if(e.toDOM){e.destroy(r);let t=r.nextSibling;r.remove(),r=t}}if(!s)break;s.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(s.toDOM(e),r)),c&&a++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}};function EK(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}var DK=X.define(),OK=X.define(),kK=X.define({combine(e){return RR(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],i=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||i(e,t,n):i}return n}})}}),AK=class extends fK{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function jK(e,t){return e.state.facet(kK).formatNumber(t,e.state)}var MK=gK.compute([kK],e=>({class:`cm-lineNumbers`,renderEmptyElements:!1,markers(e){return e.state.facet(DK)},lineMarker(e,t,n){return n.some(e=>e.toDOM)?null:new AK(jK(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let r of e.state.facet(OK)){let i=r(e,t,n);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(kK)!=e.state.facet(kK),initialSpacer(e){return new AK(jK(e,PK(e.state.doc.lines)))},updateSpacer(e,t){let n=jK(t.view,PK(t.view.state.doc.lines));return n==e.number?e:new AK(n)},domEventHandlers:e.facet(kK).domEventHandlers,side:`before`}));function NK(e={}){return[kK.of(e),yK(),MK]}function PK(e){let t=9;for(;t<e;)t=t*10+9;return t}var FK=new class extends fK{constructor(){super(...arguments),this.elementClass=`cm-activeLineGutter`}},IK=pK.compute([`selection`],e=>{let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(FK.range(i)))}return WR.of(t)});function LK(){return IK}var RK=new kF;function zK(e){return X.define({combine:e?t=>t.concat(e):void 0})}var BK=new kF,VK=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,LR.prototype.hasOwnProperty(`tree`)||Object.defineProperty(LR.prototype,"tree",{get(){return WK(this)}}),this.parser=t,this.extension=[$K.of(this),LR.languageData.of((e,t,n)=>{let r=HK(e,t,n),i=r.type.prop(RK);if(!i)return[];let a=e.facet(i),o=r.type.prop(BK);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return HK(e,t,n).type.prop(RK)==this.data}findRegions(e){let t=e.facet($K);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(RK)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(kF.mounted);if(i){if(i.tree.prop(RK)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof LF&&r(i,e.positions[n]+t)}};return r(WK(e),0),n}get allowsNesting(){return!0}};VK.setState=SR.define();function HK(e,t,n){let r=e.facet($K),i=WK(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,IF.ExcludeBuffers|IF.EnterBracketed))e.type.isTop&&(i=e);return i}var UK=class e extends VK{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(t){let n=zK(t.languageData);return new e(n,t.parser.configure({props:[RK.add(e=>e.isTop?n:void 0)]}),t.name)}configure(t,n){return new e(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function WK(e){let t=e.field(VK.state,!1);return t?t.tree:LF.empty}var GK=class{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,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},KK=null,qK=class e{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new e(t,n,[],LF.empty,0,r,[],null)}startParse(){return this.parser.startParse(new GK(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=LF.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||=this.startParse(),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n){if(this.fragments=this.withoutTempSkipped(rI.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=this.parse.stoppedAt??this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0}if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(rI.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=KK;KK=this;try{return e()}finally{KK=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=JK(e,t.from,t.to);return e}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})),r=rI.applyChanges(r,e),i=LF.empty,a=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&s.push({from:n,to:r})}}}return new e(this.parser,n,r,i,a,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=JK(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&=(this.takeTree(),null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends iI{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=KK;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new LF(MF.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return KK}};function JK(e,t,n){return rI.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var YK=class e{constructor(e){this.context=e,this.tree=e.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=qK.create(t.facet($K).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}};VK.state=tR.define({create:YK.init,update(e,t){for(let e of t.effects)if(e.is(VK.setState))return e.value;return t.startState.facet($K)==t.state.facet($K)?e.apply(t):YK.init(t.state)}});var XK=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<`u`&&(XK=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});var ZK=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,QK=uV.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 t=this.view.state.field(VK.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(VK.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=XK(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(VK.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!ZK?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>ZK&&ZK()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:VK.setState.of(new YK(i.context))})),this.chunkBudget>0&&(!s||o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&=(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>oV(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),$K=X.define({combine(e){return e.length?e[0]:null},enables:e=>[VK.state,QK,$.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),eq=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},tq=X.define(),nq=X.define({combine:e=>{if(!e.length)return` `;let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error(`Invalid indent unit: `+JSON.stringify(e[0]));return t}});function rq(e){let t=e.facet(nq);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function iq(e,t){let n=``,r=e.tabSize,i=e.facet(nq)[0];if(i==` `){for(;t>=r;)n+=` `,t-=r;i=` `}for(let e=0;e<t;e++)n+=i;return n}function aq(e,t){e instanceof LR&&(e=new oq(e));for(let n of e.state.facet(tq)){let r=n(e,t);if(r!==void 0)return r}let n=WK(e.state);return n.length>=t?cq(e,n,t):null}var oq=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=rq(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return r!=null&&r>=n.from&&r<=n.to?i&&r==e?{text:``,from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return``;let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(i+=a-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return iz(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},sq=new kF;function cq(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return lq(r,e,n)}function lq(e,t,n){for(let r=e;r;r=r.next){let e=dq(r.node);if(e)return e(pq.create(t,n,r))}return 0}function uq(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function dq(e){let t=e.type.prop(sq);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(kF.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>gq(e,!0,1,void 0,n&&!uq(e)?t.from:void 0)}return e.parent==null?fq:null}function fq(){return 0}var pq=class e extends oq{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(t,n,r){return new e(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(mq(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return lq(this.context.next,this.base,this.pos)}};function mq(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function hq(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,a=e.state.doc.lineAt(n.from),o=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=o)return null;let e=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}function gq(e,t,n,r,i){let a=e.textAfter,o=a.match(/^\s*/)[0].length,s=r&&a.slice(o,o+r.length)==r||i==e.pos+o,c=t?hq(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}function _q({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}var vq=200;function yq(){return LR.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent(`input.type`)&&!e.isUserEvent(`input.complete`))return e;let t=e.startState.languageDataAt(`indentOnInput`,e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+vq)return e;let a=n.sliceString(i.from,r);if(!t.some(e=>e.test(a)))return e;let{state:o}=e,s=-1,c=[];for(let{head:e}of o.selection.ranges){let t=o.doc.lineAt(e);if(t.from==s)continue;s=t.from;let n=aq(o,t.from);if(n==null)continue;let r=/^\s*/.exec(t.text)[0],i=iq(o,n);r!=i&&c.push({from:t.from,to:t.from+r.length,insert:i})}return c.length?[e,{changes:c,sequential:!0}]:e})}var bq=X.define(),xq=new kF;function Sq(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}function Cq(e,t,n){let r=WK(e);if(r.length<n)return null;let i=r.resolveStack(n,1),a=null;for(let o=i;o;o=o.next){let i=o.node;if(i.to<=n||i.from>n)continue;if(a&&i.from<t)break;let s=i.type.prop(xq);if(s&&(i.to<r.length-50||r.length==e.doc.length||!wq(i))){let r=s(i,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(a=r)}}return a}function wq(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function Tq(e,t,n){for(let r of e.facet(bq)){let i=r(e,t,n);if(i)return i}return Cq(e,t,n)}function Eq(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}var Dq=SR.define({map:Eq}),Oq=SR.define({map:Eq});function kq(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}var Aq=tR.define({create(){return Q.none},update(e,t){t.isUserEvent(`delete`)&&t.changes.iterChangedRanges((t,n)=>e=jq(e,t,n)),e=e.map(t.changes);let n=[];for(let r of t.effects)r.is(Dq)&&!Nq(e,r.value.from,r.value.to)?n.push(r.value):r.is(Oq)&&(e=e.update({filter:(e,t)=>r.value.from!=e||r.value.to!=t,filterFrom:r.value.from,filterTo:r.value.to}));if(n.length){let{preparePlaceholder:r}=t.state.facet(Bq),i=n.map(e=>(r?Q.replace({widget:new Wq(r(t.state,e))}):Uq).range(e.from,e.to));e=e.update({add:i})}return t.selection&&(e=jq(e,t.selection.main.head)),e},provide:e=>$.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw RangeError(`Invalid JSON for fold state`);let t=[];for(let n=0;n<e.length;){let r=e[n++],i=e[n++];if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid JSON for fold state`);t.push(Uq.range(r,i))}return Q.set(t,!0)}});function jq(e,t,n=t){let r=!1;return e.between(t,n,(e,i)=>{e<n&&i>t&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(e,r)=>e>=n||r<=t}):e}function Mq(e,t,n){var r;let i=null;return(r=e.field(Aq,!1))==null||r.between(t,n,(e,t)=>{(!i||i.from>e)&&(i={from:e,to:t})}),i}function Nq(e,t,n){let r=!1;return e.between(t,t,(e,i)=>{e==t&&i==n&&(r=!0)}),r}function Pq(e,t){return e.field(Aq,!1)?t:t.concat(SR.appendConfig.of(Vq()))}var Fq=e=>{for(let t of kq(e)){let n=Tq(e.state,t.from,t.to);if(n)return e.dispatch({effects:Pq(e.state,[Dq.of(n),Lq(e,n)])}),!0}return!1},Iq=e=>{if(!e.state.field(Aq,!1))return!1;let t=[];for(let n of kq(e)){let r=Mq(e.state,n.from,n.to);r&&t.push(Oq.of(r),Lq(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function Lq(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return $.announce.of(`${e.state.phrase(n?`Folded lines`:`Unfolded lines`)} ${r} ${e.state.phrase(`to`)} ${i}.`)}var Rq=[{key:`Ctrl-Shift-[`,mac:`Cmd-Alt-[`,run:Fq},{key:`Ctrl-Shift-]`,mac:`Cmd-Alt-]`,run:Iq},{key:`Ctrl-Alt-[`,run:e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),a=Tq(t,i.from,i.to);a&&n.push(Dq.of(a)),r=(a?e.lineBlockAt(a.to):i).to+1}return n.length&&e.dispatch({effects:Pq(e.state,n)}),!!n.length}},{key:`Ctrl-Alt-]`,run:e=>{let t=e.state.field(Aq,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(Oq.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],zq={placeholderDOM:null,preparePlaceholder:null,placeholderText:`…`},Bq=X.define({combine(e){return RR(e,zq)}});function Vq(e){let t=[Aq,Jq];return e&&t.push(Bq.of(e)),t}function Hq(e,t){let{state:n}=e,r=n.facet(Bq),i=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=Mq(e.state,n.from,n.to);r&&e.dispatch({effects:Oq.of(r)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let a=document.createElement(`span`);return a.textContent=r.placeholderText,a.setAttribute(`aria-label`,n.phrase(`folded code`)),a.title=n.phrase(`unfold`),a.className=`cm-foldPlaceholder`,a.onclick=i,a}var Uq=Q.replace({widget:new class extends zz{toDOM(e){return Hq(e,null)}}}),Wq=class extends zz{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Hq(e,this.value)}},Gq={openText:`⌄`,closedText:`›`,markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1},Kq=class extends fK{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement(`span`);return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?`Fold line`:`Unfold line`),t}};function qq(e={}){let t={...Gq,...e},n=new Kq(t,!0),r=new Kq(t,!1),i=uV.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet($K)!=e.state.facet($K)||e.startState.field(Aq,!1)!=e.state.field(Aq,!1)||WK(e.startState)!=WK(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new qR;for(let i of e.viewportLineBlocks){let a=Mq(e.state,i.from,i.to)?r:Tq(e.state,i.from,i.to)?n:null;a&&t.add(i.from,i.from,a)}return t.finish()}}),{domEventHandlers:a}=t;return[i,_K({class:`cm-foldGutter`,markers(e){return e.plugin(i)?.markers||WR.empty},initialSpacer(){return new Kq(t,!1)},domEventHandlers:{...a,click:(e,t,n)=>{if(a.click&&a.click(e,t,n))return!0;let r=Mq(e.state,t.from,t.to);if(r)return e.dispatch({effects:Oq.of(r)}),!0;let i=Tq(e.state,t.from,t.to);return i?(e.dispatch({effects:Dq.of(i)}),!0):!1}}}),Vq()]}var Jq=$.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`}}),Yq=class e{constructor(e,t){this.specs=e;let n;function r(e){let t=uz.newName();return(n||=Object.create(null))[`.`+t]=e,t}let i=typeof t.all==`string`?t.all:t.all?r(t.all):void 0,a=t.scope;this.scope=a instanceof VK?e=>e.prop(RK)==a.data:a?e=>e==a:void 0,this.style=BI(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new uz(n):null,this.themeType=t.themeType}static define(t,n){return new e(t,n||{})}},Xq=X.define(),Zq=X.define({combine(e){return e.length?[e[0]]:null}});function Qq(e){let t=e.facet(Xq);return t.length?t:e.facet(Zq)}function $q(e,t){let n=[tJ],r;return e instanceof Yq&&(e.module&&n.push($.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(Zq.of(e)):r?n.push(Xq.computeN([$.darkTheme],t=>t.facet($.darkTheme)==(r==`dark`)?[e]:[])):n.push(Xq.of(e)),n}var eJ=class{constructor(e){this.markCache=Object.create(null),this.tree=WK(e.state),this.decorations=this.buildDeco(e,Qq(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=WK(e.state),n=Qq(e.state),r=n!=Qq(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&a>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return Q.none;let n=new qR;for(let{from:r,to:i}of e.visibleRanges)HI(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=Q.mark({class:r})))},r,i);return n.finish()}},tJ=iR.high(uV.fromClass(eJ,{decorations:e=>e.decorations})),nJ=Yq.define([{tag:J.meta,color:`#404740`},{tag:J.link,textDecoration:`underline`},{tag:J.heading,textDecoration:`underline`,fontWeight:`bold`},{tag:J.emphasis,fontStyle:`italic`},{tag:J.strong,fontWeight:`bold`},{tag:J.strikethrough,textDecoration:`line-through`},{tag:J.keyword,color:`#708`},{tag:[J.atom,J.bool,J.url,J.contentSeparator,J.labelName],color:`#219`},{tag:[J.literal,J.inserted],color:`#164`},{tag:[J.string,J.deleted],color:`#a11`},{tag:[J.regexp,J.escape,J.special(J.string)],color:`#e40`},{tag:J.definition(J.variableName),color:`#00f`},{tag:J.local(J.variableName),color:`#30a`},{tag:[J.typeName,J.namespace],color:`#085`},{tag:J.className,color:`#167`},{tag:[J.special(J.variableName),J.macroName],color:`#256`},{tag:J.definition(J.propertyName),color:`#00c`},{tag:J.comment,color:`#940`},{tag:J.invalid,color:`#f00`}]),rJ=$.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:`#328c8252`},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bb555544`}}),iJ=1e4,aJ=`()[]{}`,oJ=X.define({combine(e){return RR(e,{afterCursor:!0,brackets:aJ,maxScanDistance:iJ,renderMatch:lJ})}}),sJ=Q.mark({class:`cm-matchingBracket`}),cJ=Q.mark({class:`cm-nonmatchingBracket`});function lJ(e){let t=[],n=e.matched?sJ:cJ;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function uJ(e){let t=[],n=e.facet(oJ);for(let r of e.selection.ranges){if(!r.empty)continue;let i=gJ(e,r.head,-1,n)||r.head>0&&gJ(e,r.head-1,1,n)||n.afterCursor&&(gJ(e,r.head,1,n)||r.head<e.doc.length&&gJ(e,r.head+1,-1,n));i&&(t=t.concat(n.renderMatch(i,e)))}return Q.set(t,!0)}var dJ=[uV.fromClass(class{constructor(e){this.paused=!1,this.decorations=uJ(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=uJ(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),rJ];function fJ(e={}){return[oJ.of(e),dJ]}var pJ=new kF;function mJ(e,t,n){let r=e.prop(t<0?kF.openedBy:kF.closedBy);if(r)return r;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==+(t<0))return[n[r+t]]}return null}function hJ(e){let t=e.type.prop(pJ);return t?t(e.node):e}function gJ(e,t,n,r={}){let i=r.maxScanDistance||iJ,a=r.brackets||aJ,o=WK(e),s=o.resolveInner(t,n);for(let r=s;r;r=r.parent){let i=mJ(r.type,n,a);if(i&&r.from<r.to){let o=hJ(r);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return _J(e,t,n,r,o,i,a)}}return vJ(e,t,n,o,s.type,i,a)}function _J(e,t,n,r,i,a,o){let s=r.parent,c={from:i.from,to:i.to},l=0,u=s?.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(l==0&&a.indexOf(u.type.name)>-1&&u.from<u.to){let e=hJ(u);return{start:c,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if(mJ(u.type,n,o))l++;else if(mJ(u.type,-n,o)){if(l==0){let e=hJ(u);return{start:c,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}l--}}while(n<0?u.prevSibling():u.nextSibling());return{start:c,matched:!1}}function vJ(e,t,n,r,i,a,o){if(n<0?!t:t==e.doc.length)return null;let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),c=o.indexOf(s);if(c<0||c%2==0!=n>0)return null;let l={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!u.next().done&&e<=a;){let a=u.value;n<0&&(e+=a.length);let s=t+e*n;for(let e=n>0?0:a.length-1,t=n>0?a.length:-1;e!=t;e+=n){let t=o.indexOf(a[e]);if(!(t<0||r.resolveInner(s+e,1).type!=i)){if(t%2==0==n>0)d++;else if(d==1)return{start:l,end:{from:s+e,to:s+e+1},matched:t>>1==c>>1};else d--}}n>0&&(e+=a.length)}return u.done?{start:l,matched:!1}:null}var yJ=Object.create(null),bJ=[MF.none],xJ=[],SJ=Object.create(null),CJ=Object.create(null);for(let[e,t]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`]])CJ[e]=TJ(yJ,t);function wJ(e,t){xJ.indexOf(e)>-1||(xJ.push(e),console.warn(t))}function TJ(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||J[n];r?typeof r==`function`?t.length?t=t.map(r):wJ(n,`Modifier ${n} used at start of tag`):t.length?wJ(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:wJ(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,`_`),i=r+` `+n.map(e=>e.id),a=SJ[i];if(a)return a.id;let o=SJ[i]=MF.define({id:bJ.length,name:r,props:[LI({[r]:n})]});return bJ.push(o),o.id}SB.RTL,SB.LTR;var EJ=()=>e=>{try{JSON.parse(e.state.doc.toString())}catch(t){if(!(t instanceof SyntaxError))throw t;let n=DJ(t,e.state.doc);return[{from:n,message:t.message,severity:`error`,to:n}]}return[]};function DJ(e,t){let n;return(n=e.message.match(/at position (\d+)/))?Math.min(+n[1],t.length):(n=e.message.match(/at line (\d+) column (\d+)/))?Math.min(t.line(+n[1]).from+ +n[2]-1,t.length):0}var OJ=UK.define({name:`json`,parser:oL.configure({props:[sq.add({Object:_q({except:/^\s*\}/}),Array:_q({except:/^\s*\]/})}),xq.add({"Object Array":Sq})]}),languageData:{closeBrackets:{brackets:[`[`,`{`,`"`]},indentOnInput:/^\s*[\}\]]$/}});function kJ(){return new eq(OJ)}var AJ=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},jJ=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(JJ).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new qR,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=oY(s);if(i)o.add(n,n,Q.widget({widget:new $J(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,Q.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,MJ(f))}};function MJ(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0)){if(!r)r=new AJ(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new AJ(r.from,n,r.diagnostic)}}),r}function NJ(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(JJ).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(IJ))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function PJ(e,t){return e.field(zJ,!1)?t:t.concat(SR.appendConfig.of(cY))}function FJ(e,t){return{effects:PJ(e,[IJ.of(t)])}}var IJ=SR.define(),LJ=SR.define(),RJ=SR.define(),zJ=tR.define({create(){return new jJ(Q.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=MJ(n,e.selected.diagnostic,i)||MJ(n,null,i)}!n.size&&i&&t.state.facet(JJ).autoPanel&&(i=null),e=new jJ(n,i,r)}for(let n of t.effects)if(n.is(IJ)){let r=t.state.facet(JJ).autoPanel?n.value.length?tY.open:null:e.panel;e=jJ.init(n.value,r,t.state)}else n.is(LJ)?e=new jJ(e.diagnostics,n.value?tY.open:null,e.selected):n.is(RJ)&&(e=new jJ(e.diagnostics,e.panel,n.value));return e},provide:e=>[aK.from(e,e=>e.panel),$.decorations.from(e,e=>e.diagnostics)]}),BJ=Q.mark({class:`cm-lintRange cm-lintRange-active`});function VJ(e,t,n){let{diagnostics:r}=e.state.field(zJ),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(JJ).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:!0,create(){return{dom:HJ(e,i)}}}:null}function HJ(e,t){return bz(`ul`,{class:`cm-tooltip-lint`},t.map(t=>QJ(e,t,!1)))}var UJ=e=>{let t=e.state.field(zJ,!1);(!t||!t.panel)&&e.dispatch({effects:PJ(e.state,[LJ.of(!0)])});let n=tK(e,tY.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},WJ=e=>{let t=e.state.field(zJ,!1);return!t||!t.panel?!1:(e.dispatch({effects:LJ.of(!1)}),!0)},GJ=[{key:`Mod-Shift-m`,run:UJ,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(zJ,!1);if(!t)return!1;let n=e.state.selection.main,r=MJ(t.diagnostics,null,n.to+1);return!r&&(r=MJ(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),ZG(e,r.from,1,{tooltip:sY,until:e=>e.docChanged||e.newSelection.main.head<r.from||e.newSelection.main.head>r.to}),!0)}}],KJ=uV.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(JJ);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(JJ);t.length&&qJ(t.map(e=>Promise.resolve(e(this.view))),t=>{this.view.state.doc==e.doc&&this.view.dispatch(FJ(this.view.state,t.reduce((e,t)=>e.concat(t))))},e=>{oV(this.view.state,e)})}}update(e){let t=e.state.facet(JJ);(e.docChanged||t!=e.startState.facet(JJ)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}});function qJ(e,t,n){let r=[],i=-1;for(let a of e)a.then(n=>{r.push(n),clearTimeout(i),r.length==e.length?t(r):i=setTimeout(()=>t(r),200)},n)}var JJ=X.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...RR(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:YJ,tooltipFilter:YJ,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function YJ(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function XJ(e,t={}){return[JJ.of({source:e,config:t}),KJ,cY]}function ZJ(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function QJ(e,t,n){let r=n?ZJ(t.actions):[];return bz(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},bz(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=MJ(e.state.field(zJ).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),bz(`u`,s.slice(c,c+1)),s.slice(c+1)];return bz(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&bz(`div`,{class:`cm-diagnosticSource`},t.source))}var $J=class extends zz{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return bz(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},eY=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=QJ(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},tY=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)WJ(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=ZJ(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=MJ(this.view.state.field(zJ).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=bz(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=bz(`div`,{class:`cm-panel-lint`},this.list,bz(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>WJ(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(zJ).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(zJ),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new eY(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new eY(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=MJ(this.view.state.field(zJ).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:RJ.of(t)})}static open(t){return new e(t)}};function nY(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function rY(e){return nY(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var iY=$.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:rY(`#f11`)},".cm-lintRange-warning":{backgroundImage:rY(`orange`)},".cm-lintRange-info":{backgroundImage:rY(`#999`)},".cm-lintRange-hint":{backgroundImage:rY(`#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}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function aY(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function oY(e){let t=`hint`,n=1;for(let r of e){let e=aY(r.severity);e>n&&(n=e,t=r.severity)}return t}var sY=XG(VJ,{hideOn:NJ}),cY=[zJ,$.decorations.compute([zJ],e=>{let{selected:t,panel:n}=e.field(zJ);return!t||!n||t.from==t.to?Q.none:Q.set([BJ.range(t.from,t.to)])}),sY,iY];function lY(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var uY=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=hY(e.state,n.from);return r.line?fY(e):r.block?mY(e):!1};function dY(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var fY=dY(bY,0),pY=dY(yY,0),mY=dY((e,t)=>yY(e,t,vY(t)),0);function hY(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var gY=50;function _Y(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-gY,r),o=e.sliceDoc(i,i+gY),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=100?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+gY),d=e.sliceDoc(i-gY,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function vY(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function yY(e,t,n=t.selection.ranges){let r=n.map(e=>hY(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>_Y(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function bY(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=hY(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var xY=yR.define(),SY=yR.define(),CY=X.define(),wY=X.define({combine(e){return RR(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),TY=tR.define({create(){return WY.empty},update(e,t){let n=t.state.facet(wY),r=t.annotation(xY);if(r){let i=MY.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?NY(o,o.length,n.minDepth,i):zY(o,t.startState.selection),new WY(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(SY);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(CR.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=MY.fromTransaction(t),o=t.annotation(CR.time),s=t.annotation(CR.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new WY(e.done.map(MY.fromJSON),e.undone.map(MY.fromJSON))}});function EY(e={}){return[TY,wY.of(e),$.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?OY:e.inputType==`historyRedo`?kY:null;return n?(e.preventDefault(),n(t)):!1}})]}function DY(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(TY,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var OY=DY(0,!1),kY=DY(1,!1),AY=DY(0,!0),jY=DY(1,!0),MY=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&zL.fromJSON(t.changes),[],t.mapped&&RL.fromJSON(t.mapped),t.startSelection&&Y.fromJSON(t.startSelection),t.selectionsAfter.map(Y.fromJSON))}static fromTransaction(t,n){let r=LY;for(let e of t.startState.facet(CY)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,LY)}static selection(t){return new e(void 0,LY,void 0,void 0,t)}};function NY(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function PY(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function FY(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function IY(e,t){return e.length?t.length?e.concat(t):e:t}var LY=[],RY=200;function zY(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-RY));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),NY(e,e.length-1,1e9,n.setSelAfter(r)))}return[MY.selection([t])]}function BY(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function VY(e,t){if(!e.length)return e;let n=e.length,r=LY;for(;n;){let i=HY(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[MY.selection(r)]:LY}function HY(e,t,n){let r=IY(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):LY,n);if(!e.changes)return MY.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new MY(i,SR.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var UY=/^(input\.type|delete)($|\.)/,WY=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||UY.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,PY(s.changes,t.changes))||r==`input.type.compose`)?NY(o,o.length-1,i.minDepth,new MY(t.changes.compose(s.changes),IY(SR.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,LY)):NY(o,o.length,i.minDepth,t),new e(o,LY,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:LY;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&FY(a[a.length-1],t)?this:new e(zY(this.done,t),this.undone,n,r)}addMapping(t){return new e(VY(this.done,t),VY(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:xY.of({side:e,rest:BY(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?LY:r.slice(0,r.length-1);return i.mapped&&(n=VY(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:xY.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}return null}};WY.empty=new WY(LY,LY);var GY=[{key:`Mod-z`,run:OY,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:kY,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:kY,preventDefault:!0},{key:`Mod-u`,run:AY,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:jY,preventDefault:!0}];function KY(e,t){return Y.create(e.ranges.map(t),e.mainIndex)}function qY(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function JY({state:e,dispatch:t},n){let r=KY(e.selection,n);return!r.eq(e.selection,!0)&&(t(qY(e,r)),!0)}function YY(e,t){return Y.cursor(t?e.to:e.from)}function XY(e,t){return JY(e,n=>n.empty?e.moveByChar(n,t):YY(n,t))}function ZY(e){return e.textDirectionAt(e.state.selection.main.head)==SB.LTR}var QY=e=>XY(e,!ZY(e)),$Y=e=>XY(e,ZY(e));function eX(e,t){return JY(e,n=>n.empty?e.moveByGroup(n,t):YY(n,t))}var tX=e=>eX(e,!ZY(e)),nX=e=>eX(e,ZY(e));typeof Intl<`u`&&Intl.Segmenter;function rX(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function iX(e,t,n){let r=WK(e).resolveInner(t.head),i=n?kF.closedBy:kF.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;rX(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?gJ(e,r.from,1):gJ(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,Y.cursor(s,n?-1:1)}var aX=e=>JY(e,t=>iX(e.state,t,!ZY(e))),oX=e=>JY(e,t=>iX(e.state,t,ZY(e)));function sX(e,t){return JY(e,n=>{if(!n.empty)return YY(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var cX=e=>sX(e,!1),lX=e=>sX(e,!0);function uX(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet($.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function dX(e,t){let n=uX(e),{state:r}=e,i=KY(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):YY(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=$.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(qY(r,i),{effects:a}),!0}var fX=e=>dX(e,!1),pX=e=>dX(e,!0);function mX(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=Y.cursor(r.from+n))}return i}var hX=e=>JY(e,t=>mX(e,t,!0)),gX=e=>JY(e,t=>mX(e,t,!1)),_X=e=>JY(e,t=>mX(e,t,!ZY(e))),vX=e=>JY(e,t=>mX(e,t,ZY(e))),yX=e=>JY(e,t=>e.moveToLineBoundary(t,!1,!1)),bX=e=>JY(e,t=>e.moveToLineBoundary(t,!0,!1));function xX(e,t,n){let r=!1,i=KY(e.selection,t=>{let i=gJ(e,t.head,-1)||gJ(e,t.head,1)||t.head>0&&gJ(e,t.head-1,1)||t.head<e.doc.length&&gJ(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?Y.range(t.anchor,a):Y.cursor(a)});return r?(t(qY(e,i)),!0):!1}var SX=({state:e,dispatch:t})=>xX(e,t,!1);function CX(e,t,n){let r=KY(e.state.selection,e=>{e.undirectional&&e.head>=e.anchor!=t&&(e=Y.range(e.head,e.anchor));let r=n(e);return Y.range(e.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return!r.eq(e.state.selection)&&(e.dispatch(qY(e.state,r)),!0)}function wX(e,t){return CX(e,t,n=>e.moveByChar(n,t))}var TX=e=>wX(e,!ZY(e)),EX=e=>wX(e,ZY(e));function DX(e,t){return CX(e,t,n=>e.moveByGroup(n,t))}var OX=e=>DX(e,!ZY(e)),kX=e=>DX(e,ZY(e)),AX=e=>{let t=!ZY(e);return CX(e,t,n=>iX(e.state,n,t))},jX=e=>{let t=ZY(e);return CX(e,t,n=>iX(e.state,n,t))};function MX(e,t){return CX(e,t,n=>e.moveVertically(n,t))}var NX=e=>MX(e,!1),PX=e=>MX(e,!0);function FX(e,t){return CX(e,t,n=>e.moveVertically(n,t,uX(e).height))}var IX=e=>FX(e,!1),LX=e=>FX(e,!0),RX=e=>CX(e,!0,t=>mX(e,t,!0)),zX=e=>CX(e,!1,t=>mX(e,t,!1)),BX=e=>{let t=!ZY(e);return CX(e,t,n=>mX(e,n,t))},VX=e=>{let t=ZY(e);return CX(e,t,n=>mX(e,n,t))},HX=e=>CX(e,!1,t=>Y.cursor(e.lineBlockAt(t.head).from)),UX=e=>CX(e,!0,t=>Y.cursor(e.lineBlockAt(t.head).to)),WX=({state:e,dispatch:t})=>(t(qY(e,{anchor:0})),!0),GX=({state:e,dispatch:t})=>(t(qY(e,{anchor:e.doc.length})),!0),KX=({state:e,dispatch:t})=>(t(qY(e,{anchor:e.selection.main.anchor,head:0})),!0),qX=({state:e,dispatch:t})=>(t(qY(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),JX=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),YX=({state:e,dispatch:t})=>{let n=mZ(e).map(({from:t,to:n})=>Y.undirectionalRange(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:Y.create(n),userEvent:`select`})),!0},XX=({state:e,dispatch:t})=>{let n=KY(e.selection,t=>{let n=WK(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return Y.undirectionalRange(n.from,n.to)}return t});return!n.eq(e.selection)&&(t(qY(e,n)),!0)};function ZX(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}if(r.head==n.head)break;n=r}}return i.length!=r.ranges.length&&(e.dispatch(qY(n,Y.create(i,i.length-1))),!0)}var QX=e=>ZX(e,!1),$X=e=>ZX(e,!0),eZ=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=Y.create([n.main]):n.main.empty||(r=Y.create([Y.cursor(n.main.head)])),r?(t(qY(e,r)),!0):!1};function tZ(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=nZ(e,o,!1)):o>i&&(n=`delete.forward`,o=nZ(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=nZ(e,i,!1),a=nZ(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:Y.cursor(i,i<r.head?-1:1)}});return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?$.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function nZ(e,t,n){if(e instanceof $)for(let r of e.state.facet($.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var rZ=(e,t,n)=>tZ(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=iz(s,a.tabSize)%rq(a)||rq(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=AL(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=AL(o.text,c-o.from,!1,!1)+o.from);return c}),iZ=e=>rZ(e,!1,!0),aZ=e=>rZ(e,!0,!1),oZ=(e,t)=>tZ(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=AL(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),sZ=e=>oZ(e,!1),cZ=e=>oZ(e,!0),lZ=e=>tZ(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),uZ=e=>tZ(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),dZ=e=>tZ(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),fZ=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:yL.of([``,``])},range:Y.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},pZ=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:AL(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:AL(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:Y.cursor(a)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function mZ(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function hZ(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of mZ(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(Y.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(Y.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:Y.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var gZ=({state:e,dispatch:t})=>hZ(e,t,!1),_Z=({state:e,dispatch:t})=>hZ(e,t,!0);function vZ(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of mZ(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var yZ=({state:e,dispatch:t})=>vZ(e,t,!1),bZ=({state:e,dispatch:t})=>vZ(e,t,!0),xZ=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(mZ(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=KY(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function SZ(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=WK(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(kF.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var CZ=TZ(!1),wZ=TZ(!0);function TZ(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&SZ(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new oq(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=aq(s,r);for(c??=iz(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,iq(t,c)];return o&&l.push(iq(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:yL.of(l)},range:Y.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function EZ(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:Y.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var DZ=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new oq(e,{overrideIndentation:e=>n[e]??-1}),i=EZ(e,(t,i,a)=>{let o=aq(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=iq(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},OZ=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(EZ(e,(t,n)=>{n.push({from:t.from,insert:e.facet(nq)})}),{userEvent:`input.indent`})),!0),kZ=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(EZ(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=iz(r,e.tabSize),a=0,o=iq(e,Math.max(0,i-rq(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),AZ=e=>(e.setTabFocusMode(),!0),jZ=[{key:`Ctrl-b`,run:QY,shift:TX,preventDefault:!0},{key:`Ctrl-f`,run:$Y,shift:EX},{key:`Ctrl-p`,run:cX,shift:NX},{key:`Ctrl-n`,run:lX,shift:PX},{key:`Ctrl-a`,run:yX,shift:HX},{key:`Ctrl-e`,run:bX,shift:UX},{key:`Ctrl-d`,run:aZ},{key:`Ctrl-h`,run:iZ},{key:`Ctrl-k`,run:lZ},{key:`Ctrl-Alt-h`,run:sZ},{key:`Ctrl-o`,run:fZ},{key:`Ctrl-t`,run:pZ},{key:`Ctrl-v`,run:pX}],MZ=[{key:`ArrowLeft`,run:QY,shift:TX,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:tX,shift:OX,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:_X,shift:BX,preventDefault:!0},{key:`ArrowRight`,run:$Y,shift:EX,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:nX,shift:kX,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:vX,shift:VX,preventDefault:!0},{key:`ArrowUp`,run:cX,shift:NX,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:WX,shift:KX},{mac:`Ctrl-ArrowUp`,run:fX,shift:IX},{key:`ArrowDown`,run:lX,shift:PX,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:GX,shift:qX},{mac:`Ctrl-ArrowDown`,run:pX,shift:LX},{key:`PageUp`,run:fX,shift:IX},{key:`PageDown`,run:pX,shift:LX},{key:`Home`,run:gX,shift:zX,preventDefault:!0},{key:`Mod-Home`,run:WX,shift:KX},{key:`End`,run:hX,shift:RX,preventDefault:!0},{key:`Mod-End`,run:GX,shift:qX},{key:`Enter`,run:CZ,shift:CZ},{key:`Mod-a`,run:JX},{key:`Backspace`,run:iZ,shift:iZ,preventDefault:!0},{key:`Delete`,run:aZ,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:sZ,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:cZ,preventDefault:!0},{mac:`Mod-Backspace`,run:uZ,preventDefault:!0},{mac:`Mod-Delete`,run:dZ,preventDefault:!0}].concat(jZ.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),NZ=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:aX,shift:AX},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:oX,shift:jX},{key:`Alt-ArrowUp`,run:gZ},{key:`Shift-Alt-ArrowUp`,run:yZ},{key:`Alt-ArrowDown`,run:_Z},{key:`Shift-Alt-ArrowDown`,run:bZ},{key:`Mod-Alt-ArrowUp`,run:QX},{key:`Mod-Alt-ArrowDown`,run:$X},{key:`Escape`,run:eZ},{key:`Mod-Enter`,run:wZ},{key:`Alt-l`,mac:`Ctrl-l`,run:YX},{key:`Mod-i`,run:XX,preventDefault:!0},{key:`Mod-[`,run:kZ},{key:`Mod-]`,run:OZ},{key:`Mod-Alt-\\`,run:DZ},{key:`Shift-Mod-k`,run:xZ},{key:`Shift-Mod-\\`,run:SX},{key:`Mod-/`,run:uY},{key:`Alt-A`,mac:`Ctrl-A`,run:pY},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:AZ}].concat(MZ),PZ={key:`Tab`,run:OZ,shift:kZ},FZ=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,IZ=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(FZ(e)):FZ,this.query=this.normalize(t)}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 NL(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 t=PL(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=FL(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n,a=!0;;e++){let n=r.charCodeAt(e),o=this.match(n,i,a,this.bufferPos+this.bufferStart,e==r.length-1);if(o)return this.value=o,this;if(e==r.length-1)break;a&&e<t.length&&t.charCodeAt(e)==n?i++:a=!1}}}match(e,t,n,r,i){let a=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],o=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?a={from:n.from,to:r,precise:i&&n.precise}:(n.index++,o=!0)),o?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?a={from:t,to:r,precise:n&&i}:this.matches.push({from:t,index:1,precise:n})),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}};typeof Symbol<`u`&&(IZ.prototype[Symbol.iterator]=function(){return this});var LZ={from:-1,to:-1,match:/.*/.exec(``),precise:!0},RZ=`gm`+(/x/.unicode==null?``:`u`),zZ=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=LZ,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new HZ(e,t,n,r,i);this.re=new RegExp(t,RZ+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter();let a=e.lineAt(r);this.curLineStart=a.from,this.matchPos=WZ(e,r),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 t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=WZ(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},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}}},BZ=new WeakMap,VZ=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=BZ.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return BZ.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),BZ.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},HZ=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=LZ,this.matchPos=WZ(e,r),this.re=new RegExp(t,RZ+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=VZ.get(e,r,this.chunkEnd(r+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,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=WZ(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=VZ.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(zZ.prototype[Symbol.iterator]=HZ.prototype[Symbol.iterator]=function(){return this});function UZ(e){try{return new RegExp(e,RZ),!0}catch{return!1}}function WZ(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var GZ=e=>{let t=sK(e,`cm-goto-line`);if(t){let e=t.dom.querySelector(`input[type=text]`);return e&&e.select(),!0}let{state:n}=e,r=String(n.doc.lineAt(e.state.selection.main.head).number),{close:i,result:a}=oK(e,{class:`cm-goto-line`,label:n.phrase(`Go to line`),input:{type:`text`,name:`line`,value:r},focus:!0,submitLabel:n.phrase(`go`)});return a.then(t=>{let r=t&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.elements.line.value);if(!r){e.dispatch({effects:i});return}let a=n.doc.lineAt(n.selection.main.head),[,o,s,c,l]=r,u=c?+c.slice(1):0,d=s?+s:a.number;if(s&&l){let e=d/100;o&&(e=e*(o==`-`?-1:1)+a.number/n.doc.lines),d=Math.round(n.doc.lines*e)}else s&&o&&(d=d*(o==`-`?-1:1)+a.number);let f=n.doc.line(Math.max(1,Math.min(n.doc.lines,d))),p=Y.cursor(f.from+Math.max(0,Math.min(u,f.length)));e.dispatch({effects:[i,$.scrollIntoView(p.from,{y:`center`})],selection:p})}),!0},KZ={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},qZ=X.define({combine(e){return RR(e,KZ,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function JZ(e){let t=[eQ,$Z];return e&&t.push(qZ.of(e)),t}var YZ=Q.mark({class:`cm-selectionMatch`}),XZ=Q.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function ZZ(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=MR.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=MR.Word)}function QZ(e,t,n,r){return e(t.sliceDoc(n,n+1))==MR.Word&&e(t.sliceDoc(r-1,r))==MR.Word}var $Z=uV.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(qZ),{state:n}=e,r=n.selection;if(r.ranges.length>1)return Q.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return Q.none;let e=n.wordAt(i.head);if(!e)return Q.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return Q.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(ZZ(o,n,i.from,i.to)&&QZ(o,n,i.from,i.to)))return Q.none}else if(a=n.sliceDoc(i.from,i.to),!a)return Q.none}let s=[];for(let r of e.visibleRanges){let e=new IZ(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||ZZ(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(XZ.range(r,a)):(r>=i.to||a<=i.from)&&s.push(YZ.range(r,a)),s.length>t.maxMatches))return Q.none}}return Q.set(s)}},{decorations:e=>e.decorations}),eQ=$.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),tQ=({state:e,dispatch:t})=>{let{selection:n}=e,r=Y.create(n.ranges.map(t=>e.wordAt(t.head)||Y.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)};function nQ(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new IZ(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new IZ(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var rQ=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return tQ({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=nQ(e,r);return i?(t(e.update({selection:e.selection.addRange(Y.range(i.from,i.to),!1),effects:$.scrollIntoView(i.to)})),!0):!1},iQ=X.define({combine(e){return RR(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new RQ(e),scrollToMatch:e=>$.scrollIntoView(e)})}}),aQ=class{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||UZ(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
|
|
26
|
+
`:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new gQ(this):new uQ(this)}getCursor(e,t=0,n){let r=e.doc?e:LR.create({doc:e});return n??=r.doc.length,this.regexp?fQ(this,r,t,n):cQ(this,r,t,n)}},oQ=class{constructor(e){this.spec=e}};function sQ(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function cQ(e,t,n,r){let i;return e.wholeWord&&(i=lQ(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=sQ(e.test,t,i)),new IZ(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function lQ(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(pQ(i,n-a))!=MR.Word||t(mQ(i,n-a))!=MR.Word)&&(t(mQ(i,r-a))!=MR.Word||t(pQ(i,r-a))!=MR.Word))}var uQ=class extends oQ{constructor(e){super(e)}nextMatch(e,t,n){let r=cQ(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=cQ(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=cQ(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=cQ(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=cQ(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function dQ(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function fQ(e,t,n,r){let i;return e.wholeWord&&(i=hQ(t.charCategorizer(t.selection.main.head))),e.test&&(i=dQ(e.test,t,i)),new zZ(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function pQ(e,t){return e.slice(AL(e,t,!1),t)}function mQ(e,t){return e.slice(t,AL(e,t))}function hQ(e){return(t,n,r)=>!r[0].length||(e(pQ(r.input,r.index))!=MR.Word||e(mQ(r.input,r.index))!=MR.Word)&&(e(mQ(r.input,r.index+r[0].length))!=MR.Word||e(pQ(r.input,r.index+r[0].length))!=MR.Word)}var gQ=class extends oQ{nextMatch(e,t,n){let r=fQ(this.spec,e,n,e.doc.length).next();return r.done&&(r=fQ(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=fQ(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=fQ(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=fQ(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},_Q=SR.define(),vQ=SR.define(),yQ=tR.define({create(e){return new bQ(MQ(e).create(),null)},update(e,t){for(let n of t.effects)n.is(_Q)?e=new bQ(n.value.create(),e.panel):n.is(vQ)&&(e=new bQ(e.query,n.value?jQ:null));return e},provide:e=>aK.from(e,e=>e.panel)}),bQ=class{constructor(e,t){this.query=e,this.panel=t}},xQ=Q.mark({class:`cm-searchMatch`}),SQ=Q.mark({class:`cm-searchMatch cm-searchMatch-selected`}),CQ=uV.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(yQ))}update(e){let t=e.state.field(yQ);(t!=e.startState.field(yQ)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Q.none;let{view:n}=this,r=new qR;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?SQ:xQ)})}return r.finish()}},{decorations:e=>e.decorations});function wQ(e){return t=>{let n=t.state.field(yQ,!1);return n&&n.query.spec.valid?e(t,n):FQ(t)}}var TQ=wQ((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=Y.single(r.from,r.to),a=e.state.facet(iQ);return e.dispatch({selection:i,effects:[HQ(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),PQ(e),!0}),EQ=wQ((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=Y.single(i.from,i.to),o=e.state.facet(iQ);return e.dispatch({selection:a,effects:[HQ(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),PQ(e),!0}),DQ=wQ((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:Y.create(n.map(e=>Y.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),OQ=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new IZ(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(Y.range(t.value.from,t.value.to))}return t(e.update({selection:Y.create(a,o),userEvent:`select.search.matches`})),!0},kQ=wQ((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.precise?o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),u.push($.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`))):o=t.nextMatch(n,o.from,o.to);let d=e.state.changes(s);return o&&(c=Y.single(o.from,o.to).map(d),u.push(HQ(e,o)),u.push(n.facet(iQ).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effects:u,userEvent:`input.replace`}),!0}),AQ=wQ((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:e,to:i,precise:a}=r;a&&n.push({from:e,to:i,insert:t.getReplacement(r)})}if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:$.announce.of(r),userEvent:`input.replace.all`}),!0});function jQ(e){return e.state.facet(iQ).createPanel(e)}function MQ(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(iQ);return new aQ({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function NQ(e){let t=tK(e,jQ);return t&&t.dom.querySelector(`[main-field]`)}function PQ(e){let t=NQ(e);t&&t==e.root.activeElement&&t.select()}var FQ=e=>{let t=e.state.field(yQ,!1);if(t&&t.panel){let n=NQ(e);if(n&&n!=e.root.activeElement){let r=MQ(e.state,t.query.spec);r.valid&&e.dispatch({effects:_Q.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[vQ.of(!0),t?_Q.of(MQ(e.state,t.query.spec)):SR.appendConfig.of(WQ)]});return!0},IQ=e=>{let t=e.state.field(yQ,!1);if(!t||!t.panel)return!1;let n=tK(e,jQ);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:vQ.of(!1)}),!0},LQ=[{key:`Mod-f`,run:FQ,scope:`editor search-panel`},{key:`F3`,run:TQ,shift:EQ,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:TQ,shift:EQ,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:IQ,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:OQ},{key:`Mod-Alt-g`,run:GZ},{key:`Mod-d`,run:rQ,preventDefault:!0}],RQ=class{constructor(e){this.view=e;let t=this.query=e.state.field(yQ).query.spec;this.commit=this.commit.bind(this),this.searchField=bz(`input`,{value:t.search,placeholder:zQ(e,`Find`),"aria-label":zQ(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=bz(`input`,{value:t.replace,placeholder:zQ(e,`Replace`),"aria-label":zQ(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=bz(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=bz(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=bz(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return bz(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=bz(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>TQ(e),[zQ(e,`next`)]),n(`prev`,()=>EQ(e),[zQ(e,`previous`)]),n(`select`,()=>DQ(e),[zQ(e,`all`)]),bz(`label`,null,[this.caseField,zQ(e,`match case`)]),bz(`label`,null,[this.reField,zQ(e,`regexp`)]),bz(`label`,null,[this.wordField,zQ(e,`by word`)]),...e.state.readOnly?[]:[bz(`br`),this.replaceField,n(`replace`,()=>kQ(e),[zQ(e,`replace`)]),n(`replaceAll`,()=>AQ(e),[zQ(e,`replace all`)])],bz(`button`,{name:`close`,onclick:()=>IQ(e),"aria-label":zQ(e,`close`),type:`button`},[`×`])])}commit(){let e=new aQ({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:_Q.of(e)}))}keydown(e){AW(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?EQ:TQ)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),kQ(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(_Q)&&!e.value.eq(this.query)&&this.setQuery(e.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(iQ).top}};function zQ(e,t){return e.state.phrase(t)}var BQ=30,VQ=/[\s\.,:;?!]/;function HQ(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-BQ),o=Math.min(i,n+BQ),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<BQ;e++)if(!VQ.test(s[e+1])&&VQ.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-BQ;e--)if(!VQ.test(s[e-1])&&VQ.test(s[e])){s=s.slice(0,e);break}}return $.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var UQ=$.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`}}),WQ=[yQ,iR.low(CQ),UQ],GQ=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=WK(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(ZQ(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function KQ(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function qQ(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=KQ(t)+KQ(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function JQ(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:qQ(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}var YQ=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function XQ(e){return e.selection.main.from}function ZQ(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var QQ=yR.define();function $Q(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:Y.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}var e$=new WeakMap;function t$(e){if(!Array.isArray(e))return e;let t=e$.get(e);return t||e$.set(e,t=JQ(e)),t}var n$=SR.define(),r$=SR.define(),i$=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=NL(e,t),r=FL(n);this.chars.push(n);let i=e.slice(t,t+r),a=i.toUpperCase();this.folded.push(NL(a==i?i.toLowerCase():a,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:a}=this;if(t.length==1){let r=NL(e,0),i=FL(r),a=i==e.length?0:-100;if(r!=t[0]){if(r==n[0])a+=-200;else return null}return this.ret(a,[0,i])}let o=e.indexOf(this.pattern);if(o==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=t.length,c=0;if(o<0){for(let i=0,a=Math.min(e.length,200);i<a&&c<s;){let a=NL(e,i);(a==t[c]||a==n[c])&&(r[c++]=i),i+=FL(a)}if(c<s)return null}let l=0,u=0,d=!1,f=0,p=-1,m=-1,h=/[a-z]/.test(e),g=!0;for(let r=0,c=Math.min(e.length,200),_=0;r<c&&u<s;){let c=NL(e,r);o<0&&(l<s&&c==t[l]&&(i[l++]=r),f<s&&(c==t[f]||c==n[f]?(f==0&&(p=r),m=r+1,f++):f=0));let v,y=c<255?c>=48&&c<=57||c>=97&&c<=122?2:+(c>=65&&c<=90):(v=PL(c))==v.toLowerCase()?v==v.toUpperCase()?0:2:1;(!r||y==1&&h||_==0&&y!=0)&&(t[u]==c||n[u]==c&&(d=!0)?a[u++]=r:a.length&&(g=!1)),_=y,r+=FL(c)}return u==s&&a[0]==0&&g?this.result(-100+(d?-200:0),a,e):f==s&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):f==s?this.ret(-900-e.length,[p,m]):u==s?this.result(-100+(d?-200:0)+-700+(g?0:-1100),a,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?FL(NL(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}},a$=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},o$=X.define({combine(e){return RR(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:c$,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>s$(e(n),t(n)),optionClass:(e,t)=>n=>s$(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function s$(e,t){return e?t?e+` `+t:e:t}function c$(e,t,n,r,i,a){let o=e.textDirection==SB.RTL,s=o,c=!1,l=`top`,u,d,f=t.left-i.left,p=i.right-t.right,m=r.right-r.left,h=r.bottom-r.top;if(s&&f<Math.min(m,p)?s=!1:!s&&p<Math.min(m,f)&&(s=!0),m<=(s?f:p))u=Math.max(i.top,Math.min(n.top,i.bottom-h))-t.top,d=Math.min(400,s?f:p);else{c=!0,d=Math.min(400,(o?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=h||e>t.top?u=n.bottom-t.top:(l=`bottom`,u=t.bottom-n.top)}let g=(t.bottom-t.top)/a.offsetHeight,_=(t.right-t.left)/a.offsetWidth;return{style:`${l}: ${u/g}px; max-width: ${d/_}px`,class:`cm-completionInfo-`+(c?o?`left-narrow`:`right-narrow`:s?`left`:`right`)}}var l$=SR.define();function u$(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement(`div`);return t.classList.add(`cm-completionIcon`),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>`cm-completionIcon-`+e)),t.setAttribute(`aria-hidden`,`true`),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function d$(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.ceil((e-t)/n);return{from:e-r*n,to:e-(r-1)*n}}var f$=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass=``;let r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(o$);this.optionContent=u$(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=d$(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains(`cm-completionListIncompleteTop`)&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(`cm-completionListIncompleteBottom`)&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;t!=null&&(e.dispatch({effects:l$.of(t)}),n.preventDefault())}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(o$).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:r$.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(`scroll`,()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=d$(r.length,i,e.state.facet(o$).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(` `))e&&this.dom.classList.remove(e);for(let e of t.split(` `))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=d$(t.options.length,t.selected,this.view.state.facet(o$).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let a=typeof i==`string`?document.createTextNode(i):i(r);if(!a)return;`then`in a?a.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>oV(this.view.state,e,`completion info`)):(this.addInfoPane(a,r),n.setAttribute(`aria-describedby`,this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,n.id=`cm-completionInfo-`+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&(n.removeAttribute(`aria-selected`),n.removeAttribute(`aria-describedby`));return t&&m$(this.list,t),t}measureInfo(){let e=this.dom.querySelector(`[aria-selected]`);if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(o$).positionInfo(this.view,t,r,n,i,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,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0)){if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}};function p$(e,t){return n=>new f$(n,e,t)}function m$(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function h$(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+ +!!e.type}function g$(e,t){let n=[],r=null,i=null,a=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},o=t.facet(o$);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)a(new YQ(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,c=o.filterStrict?new a$(n):new i$(n);for(let t of r.result.options)if(s=c.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,o=s.score+(t.boost||0);if(a(new YQ(t,r.source,n,o)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(o,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,a=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(a))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let s=[],c=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!c||c.label!=t.label||c.detail!=t.detail||c.type!=null&&t.type!=null&&c.type!=t.type||c.apply!=t.apply||c.boost!=t.boost?s.push(e):h$(e.completion)>h$(c)&&(s[s.length-1]=e),c=e.completion}return s}var _$=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,S$(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=g$(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(o$).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,S$(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:j$,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},v$=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(C$,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(o$),i=(r.override||n.languageDataAt(`autocomplete`,XQ(n)).map(t$)).map(e=>(this.active.find(t=>t.source==e)||new T$(e,+!!this.active.some(e=>e.state!=0))).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(O$));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!y$(i,this.active)||o?a=_$.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new T$(e.source,0):e));for(let e of t.effects)e.is(l$)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?b$:x$}};function y$(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}var b$={"aria-autocomplete":`list`},x$={};function S$(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var C$=[];function w$(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(QQ);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}var T$=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=w$(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is(n$))i=new e(i.source,1,n.value);else if(n.is(r$))i=new e(i.source,0);else if(n.is(O$))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(XQ(e.state))}},E$=class e extends T${constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=XQ(t.state);if(o>a||!r||n&2&&(XQ(t.startState)==this.from||o<this.limit))return new T$(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return D$(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new GQ(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??XQ(t.state)):new T$(this.source,1,this.explicit)}map(t){if(t.empty)return this;let n=this.result.map?this.result.map(this.result,t):this.result;return n?new e(this.source,this.explicit,t.mapPos(this.limit),n,t.mapPos(this.from),t.mapPos(this.to,1)):new T$(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function D$(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):ZQ(e,!0).test(i)}var O$=SR.define({map(e,t){return e.map(e=>e.map(t))}}),k$=tR.define({create(){return v$.start()},update(e,t){return e.update(t)},provide:e=>[VG.from(e,e=>e.tooltip),$.contentAttributes.from(e,e=>e.attrs)]});function A$(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(k$).active.find(e=>e.source==t.source);return r instanceof E$&&(typeof n==`string`?e.dispatch({...$Q(e.state,n,r.from,r.to),annotations:QQ.of(t.completion)}):n(e,t.completion,r.from,r.to),!0)}var j$=p$(k$,A$);function M$(e,t=`option`){return n=>{let r=n.state.field(k$,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(o$).interactionDelay)return!1;let i=1,a;t==`page`&&(a=QG(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector(`li`).offsetHeight)-1));let{length:o}=r.open.options,s=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:o-1;return s<0?s=t==`page`?0:o-1:s>=o&&(s=t==`page`?o-1:0),n.dispatch({effects:l$.of(s)}),!0}}var N$=e=>{let t=e.state.field(k$,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(o$).interactionDelay?!1:A$(e,t.open.options[t.open.selected])},P$=e=>e.state.field(k$,!1)?(e.dispatch({effects:n$.of(!0)}),!0):!1,F$=e=>{let t=e.state.field(k$,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:r$.of(null)}),!0)},I$=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},L$=50,R$=1e3,z$=uV.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(k$).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(k$),n=e.state.facet(o$);if(!e.selectionSet&&!e.docChanged&&e.startState.field(k$)==t)return;let r=e.transactions.some(e=>{let t=w$(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>L$&&Date.now()-n.time>R$){for(let e of n.context.abortListeners)try{e()}catch(e){oV(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(n$)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(k$);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(o$).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new GQ(t,XQ(t),e.explicit,this.view),r=new I$(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:r$.of(null)}),oV(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(o$).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(o$),n=this.view.state.field(k$);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 n=XQ(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+ +!i.active.explicit),a=new E$(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending){if(i.done==null){let n=new T$(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:O$.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field(k$,!1);if(t&&t.tooltip&&this.view.state.facet(o$).closeOnBlur){let n=t.open&&QG(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:r$.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:n$.of(!1)}),20),this.composing=0}}}),B$=typeof navigator==`object`&&/Win/.test(navigator.platform),V$=iR.highest($.domEventHandlers({keydown(e,t){let n=t.state.field(k$,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(B$&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&A$(t,r),!1}})),H$=$.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`,cursor:`pointer`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".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`}}}),U$={brackets:[`(`,`[`,`{`,`'`,`"`],before:`)]}:;>`,stringPrefixes:[]},W$=SR.define({map(e,t){return t.mapPos(e,-1,LL.TrackAfter)??void 0}}),G$=new class extends zR{};G$.startSide=1,G$.endSide=-1;var K$=tR.define({create(){return WR.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(W$)&&(e=e.update({add:[G$.range(n.value,n.value+1)]}));return e}});function q$(){return[Q$,K$]}var J$=`()[]{}<>«»»«[]{}`;function Y$(e){for(let t=0;t<16;t+=2)if(J$.charCodeAt(t)==e)return J$.charAt(t+1);return PL(e<128?e:e+1)}function X$(e,t){return e.languageDataAt(`closeBrackets`,t)[0]||U$}var Z$=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),Q$=$.inputHandler.of((e,t,n,r)=>{if((Z$?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&FL(NL(r,0))==1||t!=i.from||n!=i.to)return!1;let a=e1(e.state,r);return a?(e.dispatch(a),!0):!1}),$$=[{key:`Backspace`,run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=X$(e,e.selection.main.head).brackets||U$.brackets,r=null,i=e.changeByRange(t=>{if(t.empty){let r=r1(e.doc,t.head);for(let i of n)if(i==r&&n1(e.doc,t.head)==Y$(NL(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:Y.cursor(t.head-i.length)}}return{range:r=t}});return r||t(e.update(i,{scrollIntoView:!0,userEvent:`delete.backward`})),!r}}];function e1(e,t){let n=X$(e,e.selection.main.head),r=n.brackets||U$.brackets;for(let i of r){let a=Y$(NL(i,0));if(t==i)return a==i?o1(e,i,r.indexOf(i+i+i)>-1,n):i1(e,i,a,n.before||U$.before);if(t==a&&t1(e,e.selection.main.from))return a1(e,i,a)}return null}function t1(e,t){let n=!1;return e.field(K$).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function n1(e,t){let n=e.sliceString(t,t+2);return n.slice(0,FL(NL(n,0)))}function r1(e,t){let n=e.sliceString(t-2,t);return FL(NL(n,0))==n.length?n:n.slice(1)}function i1(e,t,n,r){let i=null,a=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:W$.of(a.to+t.length),range:Y.range(a.anchor+t.length,a.head+t.length)};let o=n1(e.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:t+n,from:a.head},effects:W$.of(a.head+t.length),range:Y.cursor(a.head+t.length)}:{range:i=a}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:`input.type`})}function a1(e,t,n){let r=null,i=e.changeByRange(t=>t.empty&&n1(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:Y.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(i,{scrollIntoView:!0,userEvent:`input.type`})}function o1(e,t,n,r){let i=r.stringPrefixes||U$.stringPrefixes,a=null,o=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:W$.of(r.to+t.length),range:Y.range(r.anchor+t.length,r.head+t.length)};let o=r.head,s=n1(e.doc,o),c;if(s==t){if(s1(e,o))return{changes:{insert:t+t,from:o},effects:W$.of(o+t.length),range:Y.cursor(o+t.length)};if(t1(e,o)){let r=n&&e.sliceDoc(o,o+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:o,to:o+r.length,insert:r},range:Y.cursor(o+r.length)}}}else if(n&&e.sliceDoc(o-2*t.length,o)==t+t&&(c=l1(e,o-2*t.length,i))>-1&&s1(e,c))return{changes:{insert:t+t+t+t,from:o},effects:W$.of(o+t.length),range:Y.cursor(o+t.length)};else if(e.charCategorizer(o)(s)!=MR.Word&&l1(e,o,i)>-1&&!c1(e,o,t,i))return{changes:{insert:t+t,from:o},effects:W$.of(o+t.length),range:Y.cursor(o+t.length)};return{range:a=r}});return a?null:e.update(o,{scrollIntoView:!0,userEvent:`input.type`})}function s1(e,t){let n=WK(e).resolveInner(t+1);return n.parent&&n.from==t}function c1(e,t,n,r){let i=WK(e).resolveInner(t,-1),a=r.reduce((e,t)=>Math.max(e,t.length),0);for(let o=0;o<5;o++){let o=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+a)),s=o.indexOf(n);if(!s||s>-1&&r.indexOf(o.slice(0,s))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+s;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let c=i.to==t&&i.parent;if(!c)break;i=c}return!1}function l1(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=MR.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=MR.Word)return n}return-1}function u1(e={}){return[V$,k$,o$.of(e),z$,f1,H$]}var d1=[{key:`Ctrl-Space`,run:P$},{mac:"Alt-`",run:P$},{mac:`Alt-i`,run:P$},{key:`Escape`,run:F$},{key:`ArrowDown`,run:M$(!0)},{key:`ArrowUp`,run:M$(!1)},{key:`PageDown`,run:M$(!0,`page`)},{key:`PageUp`,run:M$(!1,`page`)},{key:`Enter`,run:N$}],f1=iR.highest(DW.computeN([o$],e=>e.facet(o$).defaultKeymap?[d1]:[])),p1=function(e){e===void 0&&(e={});var t=e.crosshairCursor,n=t!==void 0&&t,r=[];e.closeBracketsKeymap!==!1&&(r=r.concat($$)),e.defaultKeymap!==!1&&(r=r.concat(NZ)),e.searchKeymap!==!1&&(r=r.concat(LQ)),e.historyKeymap!==!1&&(r=r.concat(GY)),e.foldKeymap!==!1&&(r=r.concat(Rq)),e.completionKeymap!==!1&&(r=r.concat(d1)),e.lintKeymap!==!1&&(r=r.concat(GJ));var i=[];return e.lineNumbers!==!1&&i.push(NK()),e.highlightActiveLineGutter!==!1&&i.push(LK()),e.highlightSpecialChars!==!1&&i.push(dG()),e.history!==!1&&i.push(EY()),e.foldGutter!==!1&&i.push(qq()),e.drawSelection!==!1&&i.push(GW()),e.dropCursor!==!1&&i.push(tG()),e.allowMultipleSelections!==!1&&i.push(LR.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&i.push(yq()),e.syntaxHighlighting!==!1&&i.push($q(nJ,{fallback:!0})),e.bracketMatching!==!1&&i.push(fJ()),e.closeBrackets!==!1&&i.push(q$()),e.autocompletion!==!1&&i.push(u1()),e.rectangularSelection!==!1&&i.push(OG()),n!==!1&&i.push(jG()),e.highlightActiveLine!==!1&&i.push(vG()),e.highlightSelectionMatches!==!1&&i.push(JZ()),e.tabSize&&typeof e.tabSize==`number`&&i.push(nq.of(` `.repeat(e.tabSize))),i.concat([DW.of(r.flat())]).filter(Boolean)},m1=`#e5c07b`,h1=`#e06c75`,g1=`#56b6c2`,_1=`#ffffff`,v1=`#abb2bf`,y1=`#7d8799`,b1=`#61afef`,x1=`#98c379`,S1=`#d19a66`,C1=`#c678dd`,w1=`#21252b`,T1=`#2c313a`,E1=`#282c34`,D1=`#353a42`,O1=`#3E4451`,k1=`#528bff`,A1=[$.theme({"&":{color:v1,backgroundColor:E1},".cm-content":{caretColor:k1},".cm-cursor, .cm-dropCursor":{borderLeftColor:k1},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:O1},".cm-panels":{backgroundColor:w1,color:v1},".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:E1,color:y1,border:`none`},".cm-activeLineGutter":{backgroundColor:T1},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:D1},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:D1,borderBottomColor:D1},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:T1,color:v1}}},{dark:!0}),$q(Yq.define([{tag:J.keyword,color:C1},{tag:[J.name,J.deleted,J.character,J.propertyName,J.macroName],color:h1},{tag:[J.function(J.variableName),J.labelName],color:b1},{tag:[J.color,J.constant(J.name),J.standard(J.name)],color:S1},{tag:[J.definition(J.name),J.separator],color:v1},{tag:[J.typeName,J.className,J.number,J.changed,J.annotation,J.modifier,J.self,J.namespace],color:m1},{tag:[J.operator,J.operatorKeyword,J.url,J.escape,J.regexp,J.link,J.special(J.string)],color:g1},{tag:[J.meta,J.comment],color:y1},{tag:J.strong,fontWeight:`bold`},{tag:J.emphasis,fontStyle:`italic`},{tag:J.strikethrough,textDecoration:`line-through`},{tag:J.link,color:y1,textDecoration:`underline`},{tag:J.heading,fontWeight:`bold`,color:h1},{tag:[J.atom,J.bool,J.special(J.variableName)],color:S1},{tag:[J.processingInstruction,J.string,J.inserted],color:x1},{tag:J.invalid,color:_1}]))],j1=$.theme({"&":{backgroundColor:`#fff`}},{dark:!1}),M1=function(e){e===void 0&&(e={});var t=e,n=t.indentWithTab,r=n===void 0||n,i=t.editable,a=i===void 0||i,o=t.readOnly,s=o!==void 0&&o,c=t.theme,l=c===void 0?`light`:c,u=t.placeholder,d=u===void 0?``:u,f=t.basicSetup,p=f===void 0||f,m=[];switch(r&&m.unshift(DW.of([PZ])),p&&(typeof p==`boolean`?m.unshift(p1()):m.unshift(p1(p))),d&&m.unshift(SG(d)),l){case`light`:m.push(j1);break;case`dark`:m.push(A1);break;case`none`:break;default:m.push(l)}return a===!1&&m.push($.editable.of(!1)),s&&m.push(LR.readOnly.of(!0)),[...m]},N1=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)}),P1=class{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(e=>{try{e()}catch(e){console.error(`TimeoutLatch callback error:`,e)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}},F1=class{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}},I1=null,L1=()=>typeof window>`u`?new F1:(I1||=new F1,I1),R1=$.theme({"& .cm-scroller":{height:`100% !important`}}),z1=null,B1=null;function V1(e,t,n,r,i,a){if(!e&&!t&&!n&&!r&&!i&&!a)return null;var o=JSON.stringify({height:e,minHeight:t,maxHeight:n,width:r,minWidth:i,maxWidth:a});return o===z1?B1:(z1=o,B1=$.theme({"&":{height:e,minHeight:t,maxHeight:n,width:r,minWidth:i,maxWidth:a}}),B1)}var H1=yR.define(),U1=200,W1=[];function G1(e){var t=e.value,n=e.selection,r=e.onChange,i=e.onStatistics,a=e.onCreateEditor,o=e.onUpdate,s=e.extensions,c=s===void 0?W1:s,l=e.autoFocus,u=e.theme,d=u===void 0?`light`:u,f=e.height,p=f===void 0?null:f,m=e.minHeight,h=m===void 0?null:m,g=e.maxHeight,_=g===void 0?null:g,v=e.width,y=v===void 0?null:v,b=e.minWidth,x=b===void 0?null:b,S=e.maxWidth,C=S===void 0?null:S,w=e.placeholder,T=w===void 0?``:w,E=e.editable,D=E===void 0||E,ee=e.readOnly,O=ee!==void 0&&ee,k=e.indentWithTab,A=k===void 0||k,te=e.basicSetup,ne=te===void 0||te,re=e.root,j=e.initialState,ie=(0,F.useState)(),ae=ie[0],oe=ie[1],se=(0,F.useState)(),M=se[0],ce=se[1],le=(0,F.useState)(),ue=le[0],de=le[1],fe=(0,F.useState)(()=>({current:null}))[0],pe=(0,F.useState)(()=>({current:null}))[0],me=V1(p,h,_,y,x,C),he=$.updateListener.of(e=>{e.docChanged&&typeof r==`function`&&!e.transactions.some(e=>e.annotation(H1))&&(fe.current?fe.current.reset():(fe.current=new P1(()=>{if(pe.current){var e=pe.current;pe.current=null,e()}fe.current=null},U1),L1().add(fe.current)),r(e.state.doc.toString(),e)),i&&i(N1(e))}),ge=M1({theme:d,editable:D,readOnly:O,placeholder:T,indentWithTab:A,basicSetup:ne}),_e=[he,...me?[me]:[],R1,...ge];return o&&typeof o==`function`&&_e.push($.updateListener.of(o)),_e=_e.concat(c),(0,F.useLayoutEffect)(()=>{if(ae&&!ue){var e={doc:t,selection:n,extensions:_e},r=j?LR.fromJSON(j.json,e,j.fields):LR.create(e);if(de(r),!M){var i=new $({state:r,parent:ae,root:re});ce(i),a&&a(i,r)}}return()=>{M&&(de(void 0),ce(void 0))}},[ae,ue]),(0,F.useEffect)(()=>{e.container&&oe(e.container)},[e.container]),(0,F.useEffect)(()=>()=>{M&&(M.destroy(),ce(void 0)),fe.current&&=(fe.current.cancel(),null)},[M]),(0,F.useEffect)(()=>{l&&M&&M.focus()},[l,M]),(0,F.useEffect)(()=>{M&&M.dispatch({effects:SR.reconfigure.of(_e)})},[d,c,p,h,_,y,x,C,T,D,O,A,ne,r,o]),(0,F.useEffect)(()=>{if(t!==void 0){var e=M?M.state.doc.toString():``;if(M&&t!==e){var n=fe.current&&!fe.current.isDone,r=()=>{M&&t!==M.state.doc.toString()&&M.dispatch({changes:{from:0,to:M.state.doc.toString().length,insert:t||``},annotations:[H1.of(!0)]})};n?pe.current=r:r()}}},[t,M]),{state:ue,setState:de,view:M,setView:ce,container:ae,setContainer:oe}}var K1=[`className`,`value`,`selection`,`extensions`,`onChange`,`onStatistics`,`onCreateEditor`,`onUpdate`,`autoFocus`,`theme`,`height`,`minHeight`,`maxHeight`,`width`,`minWidth`,`maxWidth`,`basicSetup`,`placeholder`,`indentWithTab`,`editable`,`readOnly`,`root`,`initialState`],q1=(0,F.forwardRef)((e,t)=>{var n=e.className,r=e.value,i=r===void 0?``:r,a=e.selection,o=e.extensions,s=o===void 0?[]:o,c=e.onChange,l=e.onStatistics,u=e.onCreateEditor,d=e.onUpdate,f=e.autoFocus,p=e.theme,m=p===void 0?`light`:p,h=e.height,g=e.minHeight,_=e.maxHeight,v=e.width,y=e.minWidth,b=e.maxWidth,x=e.basicSetup,S=e.placeholder,C=e.indentWithTab,w=e.editable,T=e.readOnly,E=e.root,D=e.initialState,ee=lY(e,K1),O=(0,F.useRef)(null),k=G1({root:E,value:i,autoFocus:f,theme:m,height:h,minHeight:g,maxHeight:_,width:v,minWidth:y,maxWidth:b,basicSetup:x,placeholder:S,indentWithTab:C,editable:w,readOnly:T,selection:a,onChange:c,onStatistics:l,onCreateEditor:u,onUpdate:d,extensions:s,initialState:D}),A=k.state,te=k.view,ne=k.container,re=k.setContainer;(0,F.useImperativeHandle)(t,()=>({editor:O.current,state:A,view:te}),[O,ne,A,te]);var j=(0,F.useCallback)(e=>{O.current=e,re(e)},[re]);if(typeof i!=`string`)throw Error(`value must be typeof string but got `+typeof i);var ie=typeof m==`string`?`cm-theme-`+m:`cm-theme`;return(0,I.jsx)(`div`,nt({ref:j,className:``+ie+(n?` `+n:``)},ee))});q1.displayName=`CodeMirror`;function J1(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t||!n;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}function p(e){r=e,i=``,a=0,o=16,d=0}function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&Z1(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46){if(r++,r<e.length&&Z1(e.charCodeAt(r)))for(r++;r<e.length&&Z1(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r)}let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101)){if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&Z1(e.charCodeAt(r))){for(r++;r<e.length&&Z1(e.charCodeAt(r));)r++;n=r}else d=3}return e.substring(t,n)}function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
|
|
27
|
+
`;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=f(4,!0);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}i=r;continue}if(a>=0&&a<=31){if(X1(a)){t+=e.substring(i,r),d=2;break}d=6}r++}return t}function g(){if(i=``,d=0,a=r,c=s,u=l,r>=n)return a=n,o=17;let t=e.charCodeAt(r);if(Y1(t)){do r++,i+=String.fromCharCode(t),t=e.charCodeAt(r);while(Y1(t));return o=15}if(X1(t))return r++,i+=String.fromCharCode(t),t===13&&e.charCodeAt(r)===10&&(r++,i+=`
|
|
28
|
+
`),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!X1(e.charCodeAt(r));)r++;return i=e.substring(c,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;let t=n-1,a=!1;for(;r<t;){let t=e.charCodeAt(r);if(t===42&&e.charCodeAt(r+1)===47){r+=2,a=!0;break}r++,X1(t)&&(t===13&&e.charCodeAt(r)===10&&r++,s++,l=r)}return a||(r++,d=1),i=e.substring(c,r),o=13}return i+=String.fromCharCode(t),r++,o=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!Z1(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;r<n&&_(t);)r++,t=e.charCodeAt(r);if(a!==r){switch(i=e.substring(a,r),i){case`true`:return o=8;case`false`:return o=9;case`null`:return o=7}return o=16}return i+=String.fromCharCode(t),r++,o=16}}function _(e){if(Y1(e)||X1(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let e;do e=g();while(e>=12&&e<=15);return e}return{setPosition:p,getPosition:()=>r,scan:t?v:g,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>a,getTokenLength:()=>r-a,getTokenStartLine:()=>c,getTokenStartCharacter:()=>a-u,getTokenError:()=>d}}function Y1(e){return e===32||e===9}function X1(e){return e===10||e===13}function Z1(e){return e>=48&&e<=57}var Q1;(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(Q1||={}),Array(20).fill(0).map((e,t)=>` `.repeat(t));var $1=200;Array($1).fill(0).map((e,t)=>`
|
|
29
|
+
`+` `.repeat(t)),Array($1).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array($1).fill(0).map((e,t)=>`\r
|
|
30
|
+
`+` `.repeat(t)),Array($1).fill(0).map((e,t)=>`
|
|
31
|
+
`+` `.repeat(t)),Array($1).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array($1).fill(0).map((e,t)=>`\r
|
|
32
|
+
`+` `.repeat(t));var e0;(function(e){e.DEFAULT={allowTrailingComma:!1}})(e0||={});function t0(e,t=[],n=e0.DEFAULT){let r={type:`array`,offset:-1,length:-1,children:[],parent:void 0};function i(e){r.type===`property`&&(r.length=e-r.offset,r=r.parent)}function a(e){return r.children.push(e),e}r0(e,{onObjectBegin:e=>{r=a({type:`object`,offset:e,length:-1,parent:r,children:[]})},onObjectProperty:(e,t,n)=>{r=a({type:`property`,offset:t,length:-1,parent:r,children:[]}),r.children.push({type:`string`,value:e,offset:t,length:n,parent:r})},onObjectEnd:(e,t)=>{i(e+t),r.length=e+t-r.offset,r=r.parent,i(e+t)},onArrayBegin:(e,t)=>{r=a({type:`array`,offset:e,length:-1,parent:r,children:[]})},onArrayEnd:(e,t)=>{r.length=e+t-r.offset,r=r.parent,i(e+t)},onLiteralValue:(e,t,n)=>{a({type:i0(e),offset:t,length:n,parent:r,value:e}),i(t+n)},onSeparator:(e,t,n)=>{r.type===`property`&&(e===`:`?r.colonOffset=t:e===`,`&&i(t))},onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n);let o=r.children[0];return o&&delete o.parent,o}function n0(e,t){if(!e)return;let n=e;for(let e of t)if(typeof e==`string`){if(n.type!==`object`||!Array.isArray(n.children))return;let t=!1;for(let r of n.children)if(Array.isArray(r.children)&&r.children[0].value===e&&r.children.length===2){n=r.children[1],t=!0;break}if(!t)return}else{let t=e;if(n.type!==`array`||t<0||!Array.isArray(n.children)||t>=n.children.length)return;n=n.children[t]}return n}function r0(e,t,n=e0.DEFAULT){let r=J1(e,!1),i=[],a=0;function o(e){return e?()=>a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function s(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function c(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function l(e){return e?()=>{a>0?a++:e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice())===!1&&(a=1)}:()=>!0}function u(e){return e?()=>{a>0&&a--,a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}let d=l(t.onObjectBegin),f=c(t.onObjectProperty),p=u(t.onObjectEnd),m=l(t.onArrayBegin),h=u(t.onArrayEnd),g=c(t.onLiteralValue),_=s(t.onSeparator),v=o(t.onComment),y=s(t.onError),b=n&&n.disallowComments,x=n&&n.allowTrailingComma;function S(){for(;;){let e=r.scan();switch(r.getTokenError()){case 4:C(14);break;case 5:C(15);break;case 3:C(13);break;case 1:b||C(11);break;case 2:C(12);break;case 6:C(16)}switch(e){case 12:case 13:b?C(10):v();break;case 16:C(1);break;case 15:case 14:break;default:return e}}}function C(e,t=[],n=[]){if(y(e),t.length+n.length>0){let e=r.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){S();break}if(n.indexOf(e)!==-1)break;e=S()}}}function w(e){let t=r.getTokenValue();return e?g(t):(f(t),i.push(t)),S(),!0}function T(){switch(r.getToken()){case 11:let e=r.getTokenValue(),t=Number(e);isNaN(t)&&(C(2),t=0),g(t);break;case 7:g(null);break;case 8:g(!0);break;case 9:g(!1);break;default:return!1}return S(),!0}function E(){return r.getToken()===10?(w(!1),r.getToken()===6?(_(`:`),S(),O()||C(4,[],[2,5])):C(5,[],[2,5]),i.pop(),!0):(C(3,[],[2,5]),!1)}function D(){d(),S();let e=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(e||C(4,[],[]),_(`,`),S(),r.getToken()===2&&x)break}else e&&C(6,[],[]);E()||C(4,[],[2,5]),e=!0}return p(),r.getToken()===2?S():C(7,[2],[]),!0}function ee(){m(),S();let e=!0,t=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(t||C(4,[],[]),_(`,`),S(),r.getToken()===4&&x)break}else t&&C(6,[],[]);e?(i.push(0),e=!1):i[i.length-1]++,O()||C(4,[],[4,5]),t=!0}return h(),e||i.pop(),r.getToken()===4?S():C(8,[4],[]),!0}function O(){switch(r.getToken()){case 3:return ee();case 1:return D();case 10:return w(!0);default:return T()}}return S(),r.getToken()===17?n.allowEmptyContent?!0:(C(4,[],[]),!1):O()?(r.getToken()!==17&&C(9,[],[]),!0):(C(4,[],[]),!1)}function i0(e){switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`string`:return`string`;case`object`:return e?Array.isArray(e)?`array`:`object`:`null`;default:return`null`}}var a0;(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(a0||={});var o0;(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(o0||={});var s0=t0,c0=n0,l0;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(l0||={});function u0(e,t){let n=s0(e);return n===void 0?[]:t.map(e=>{let t=c0(n,d0(e.path))??n;return{from:t.offset,to:t.offset+t.length,severity:e.kind===`binding`?`warning`:`error`,message:e.message}})}function d0(e){if(e===``)return[];let t=[];for(let n of e.matchAll(/\[("(?:[^"\\]|\\.)*")\]|([^.[]+)/g))n[1]===void 0?t.push(/^\d+$/.test(n[2])?Number(n[2]):n[2]):t.push(JSON.parse(n[1]));return t}function f0({recipe:e,onSave:t}){let[n,r]=(0,F.useState)(e?.text??``),[i,a]=(0,F.useState)(!1),[o,s]=(0,F.useState)();(0,F.useEffect)(()=>{r(e?.text??``)},[e?.file,e?.text]);let c=(0,F.useMemo)(()=>[kJ(),XJ(t=>{let n=EJ()(t);return e===void 0||n.length>0?n:u0(t.state.doc.toString(),e.issues)})],[e]);if(e===void 0)return(0,I.jsx)(L,{p:4,color:`fg.muted`,children:(0,I.jsx)(H,{children:`Select a recipe to see its JSON.`})});let l=m0(n),u=n!==e.text,d=async()=>{if(l===void 0){a(!0),s(void 0);try{await t(e.file,JSON.parse(n))}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}};return(0,I.jsxs)($w,{h:`full`,p:2,gap:2,children:[(0,I.jsxs)($w,{direction:`row`,align:`center`,justify:`space-between`,children:[(0,I.jsx)(p0,{issueCount:e.issues.length,syntaxError:l}),(0,I.jsx)(Rw,{size:`sm`,onClick:()=>{d()},disabled:l!==void 0||i||!u,loading:i,children:`Save`})]}),e.issues.length>0&&l===void 0&&(0,I.jsx)($w,{gap:0,fontSize:`xs`,color:`fg.muted`,children:e.issues.map(e=>(0,I.jsxs)(H,{children:[(0,I.jsx)(H,{as:`span`,fontFamily:`mono`,children:e.path}),`: `,e.message]},`${e.path}:${e.message}`))}),o!==void 0&&(0,I.jsx)(H,{color:`fg.error`,fontSize:`sm`,children:o}),(0,I.jsx)(L,{flex:`1`,minH:0,fontFamily:`mono`,fontSize:`sm`,borderWidth:`1px`,borderColor:`border`,rounded:`md`,overflow:`hidden`,children:(0,I.jsx)(q1,{value:n,height:`100%`,extensions:c,onChange:e=>{r(e)},basicSetup:{tabSize:2}})})]})}function p0({issueCount:e,syntaxError:t}){return t===void 0?e>0?(0,I.jsxs)(Aw,{colorPalette:`orange`,children:[e,` issue`,e===1?``:`s`]}):(0,I.jsx)(Aw,{colorPalette:`green`,children:`valid`}):(0,I.jsxs)(Aw,{colorPalette:`red`,children:[`invalid JSON: `,t]})}function m0(e){try{JSON.parse(e);return}catch(e){return e instanceof Error?e.message:String(e)}}function h0({records:e,onCellClick:t,highlightedField:n,onHoverField:r,onSelectRecord:i}){if(e.length===0)return(0,I.jsx)(L,{p:4,color:`fg.muted`,children:(0,I.jsx)(H,{children:`No records yet. Run a sample to see them here.`})});let a=_0(e);if(a.length===0)return(0,I.jsx)(L,{p:4,color:`fg.muted`,children:(0,I.jsxs)(H,{children:[e.length,` record`,e.length===1?``:`s`,` emitted, but no output field is mapped yet, so there is nothing to show as columns. Add fields in the Record tab.`]})});let o=e=>r===void 0?{}:{onMouseEnter:()=>{r(e)},onMouseLeave:()=>{r(void 0)}};return(0,I.jsx)(xE,{h:`full`,children:(0,I.jsxs)(yE,{size:`sm`,stickyHeader:!0,children:[(0,I.jsx)(SE,{children:(0,I.jsx)(bE,{children:a.map(e=>(0,I.jsx)(CE,{bg:e===n?`orange.subtle`:void 0,"data-highlighted":e===n,...o(e),children:e},e))})}),(0,I.jsx)(TE,{children:e.map((e,r)=>(0,I.jsx)(bE,{cursor:i===void 0?void 0:`pointer`,onClick:i===void 0?void 0:()=>{i(r)},children:a.map(i=>(0,I.jsx)(g0,{value:e.data[i],highlighted:i===n,onClick:t===void 0?void 0:e=>{e.stopPropagation(),t(r,i)},...o(i)},i))},e.key??`row-${r}`))})]})})}function g0({value:e,onClick:t,highlighted:n=!1,onMouseEnter:r,onMouseLeave:i}){let a=n?`orange.subtle`:void 0;return e===void 0?(0,I.jsx)(wE,{color:`fg.muted`,fontStyle:`italic`,bg:a,"data-highlighted":n,onMouseEnter:r,onMouseLeave:i,children:`missing`}):e===null?t===void 0?(0,I.jsx)(wE,{color:`fg.muted`,fontStyle:`italic`,bg:a,"data-highlighted":n,onMouseEnter:r,onMouseLeave:i,children:`null`}):(0,I.jsx)(wE,{color:`fg.muted`,fontStyle:`italic`,cursor:`pointer`,textDecoration:`underline`,title:`Why is this missing?`,bg:a,"data-highlighted":n,onClick:t,onMouseEnter:r,onMouseLeave:i,children:`null`}):(0,I.jsx)(wE,{bg:a,"data-highlighted":n,onMouseEnter:r,onMouseLeave:i,children:typeof e==`object`?JSON.stringify(e):String(e)})}function _0(e){let t=[];for(let n of e)for(let e of Object.keys(n.data))t.includes(e)||t.push(e);return t}var v0={json:`application/json`,jsonl:`application/x-ndjson`,csv:`text/csv`};function y0(e,t,n=`records`){return{filename:`${n}.${t}`,mimeType:v0[t],content:b0(e,t)}}function b0(e,t){return t===`json`?x0(e):t===`jsonl`?S0(e):C0(e)}function x0(e){return JSON.stringify(e.map(e=>e.data),null,2)}function S0(e){return e.map(e=>JSON.stringify(e.data)).join(`
|
|
33
|
+
`)+(e.length===0?``:`
|
|
34
|
+
`)}function C0(e){let t=_0(e),n=[t.map(e=>T0(e)).join(`,`)];for(let r of e)n.push(t.map(e=>T0(w0(r.data[e]))).join(`,`));return n.join(`\r
|
|
35
|
+
`)+(e.length===0?``:`\r
|
|
36
|
+
`)}function w0(e){return e==null?``:typeof e==`object`?JSON.stringify(e):String(e)}function T0(e){return/["\r\n,]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function E0({records:e,onSelectRecord:t}){return e.length===0?(0,I.jsx)(L,{p:4,color:`fg.muted`,children:(0,I.jsx)(H,{children:`No records yet. Run a sample to see them here.`})}):(0,I.jsx)(L,{as:`pre`,p:2,h:`full`,overflow:`auto`,fontFamily:`mono`,fontSize:`xs`,whiteSpace:`pre-wrap`,children:S0(e).trimEnd().split(`
|
|
37
|
+
`).map((e,n)=>(0,I.jsx)(L,{as:`span`,display:`block`,cursor:t===void 0?void 0:`pointer`,_hover:t===void 0?void 0:{bg:`bg.muted`},onClick:t===void 0?void 0:()=>{t(n)},children:e},n))})}function D0({record:e,index:t,onClose:n}){return(0,I.jsx)(iT,{open:e!==void 0,onOpenChange:e=>{e.open||n()},size:`lg`,placement:`center`,scrollBehavior:`inside`,children:(0,I.jsxs)(T_,{children:[(0,I.jsx)(lT,{}),(0,I.jsx)(aT,{children:(0,I.jsxs)(oT,{children:[(0,I.jsxs)(dT,{display:`flex`,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,children:[(0,I.jsxs)(L,{minW:0,children:[(0,I.jsxs)(sT,{children:[`Record `,t===void 0?``:t+1]}),e?.key!=null&&(0,I.jsx)(H,{fontSize:`xs`,color:`fg.muted`,truncate:!0,title:e.key,children:e.key})]}),(0,I.jsx)(cT,{asChild:!0,children:(0,I.jsx)(Xw,{size:`sm`,"aria-label":`Close record`})})]}),(0,I.jsx)(uT,{pb:4,children:(0,I.jsx)(L,{as:`pre`,fontFamily:`mono`,fontSize:`xs`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,children:e===void 0?``:JSON.stringify(e.data,null,2)})})]})})]})})}function O0({records:e,onCellClick:t,highlightedField:n,onHoverField:r}){let[i,a]=(0,F.useState)(`table`),[o,s]=(0,F.useState)(!1),[c,l]=(0,F.useState)();function u(t){let n=y0(e,t);j0(n.filename,n.mimeType,n.content)}return(0,I.jsxs)(L,{flex:`1`,minH:`0`,display:`flex`,flexDirection:`column`,children:[(0,I.jsx)(A0,{view:i,onViewChange:a,onExport:u,onEnlarge:()=>{s(!0)},exportDisabled:e.length===0}),(0,I.jsx)(L,{flex:`1`,minH:`0`,overflow:`auto`,children:(0,I.jsx)(k0,{view:i,records:e,onCellClick:t,highlightedField:n,onHoverField:r,onSelectRecord:l})}),(0,I.jsx)(iT,{open:o,onOpenChange:e=>{s(e.open)},size:`cover`,placement:`center`,children:(0,I.jsxs)(T_,{children:[(0,I.jsx)(lT,{}),(0,I.jsx)(aT,{children:(0,I.jsxs)(oT,{h:`85vh`,display:`flex`,flexDirection:`column`,children:[(0,I.jsxs)(dT,{display:`flex`,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,children:[(0,I.jsxs)(sT,{children:[`Records (`,e.length,`)`]}),(0,I.jsx)(cT,{asChild:!0,children:(0,I.jsx)(Xw,{size:`sm`,"aria-label":`Close`})})]}),(0,I.jsxs)(uT,{flex:`1`,minH:`0`,display:`flex`,flexDirection:`column`,gap:2,pb:4,children:[(0,I.jsx)(A0,{view:i,onViewChange:a,onExport:u,exportDisabled:e.length===0}),(0,I.jsx)(L,{flex:`1`,minH:`0`,overflow:`auto`,children:(0,I.jsx)(k0,{view:i,records:e,onCellClick:t,highlightedField:n,onHoverField:r,onSelectRecord:l})})]})]})})]})}),(0,I.jsx)(D0,{record:c===void 0?void 0:e[c],index:c,onClose:()=>{l(void 0)}})]})}function k0({view:e,records:t,onCellClick:n,highlightedField:r,onHoverField:i,onSelectRecord:a}){return e===`table`?(0,I.jsx)(h0,{records:t,onCellClick:n,highlightedField:r,onHoverField:i,onSelectRecord:a}):(0,I.jsx)(E0,{records:t,onSelectRecord:a})}function A0({view:e,onViewChange:t,onExport:n,onEnlarge:r,exportDisabled:i}){return(0,I.jsxs)(G,{px:2,py:1,gap:2,borderBottomWidth:`1px`,flexShrink:0,children:[(0,I.jsx)(Rw,{size:`2xs`,variant:e===`table`?`solid`:`outline`,onClick:()=>{t(`table`)},children:`Table`}),(0,I.jsx)(Rw,{size:`2xs`,variant:e===`jsonl`?`solid`:`outline`,onClick:()=>{t(`jsonl`)},children:`JSONL`}),(0,I.jsx)(PT,{size:`xs`,width:`7em`,variant:`outline`,disabled:i,children:(0,I.jsxs)(IT,{"aria-label":`Export records`,value:``,onChange:e=>{let t=e.target.value;t!==``&&n(t),e.target.value=``},children:[(0,I.jsx)(`option`,{value:``,disabled:!0,children:`Export…`}),(0,I.jsx)(`option`,{value:`json`,children:`JSON`}),(0,I.jsx)(`option`,{value:`jsonl`,children:`JSONL`}),(0,I.jsx)(`option`,{value:`csv`,children:`CSV`})]})}),r!==void 0&&(0,I.jsx)(Rw,{size:`2xs`,variant:`outline`,onClick:r,marginStart:`auto`,children:`Enlarge`})]})}function j0(e,t,n){let r=new Blob([n],{type:t}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,document.body.append(a),a.click(),a.remove(),URL.revokeObjectURL(i)}function M0({rejected:e,onClick:t}){return e.length===0?null:(0,I.jsxs)($w,{borderTopWidth:`1px`,gap:0,flexShrink:0,maxH:`30%`,overflow:`auto`,children:[(0,I.jsxs)(L,{px:3,py:1,fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:[`Rejected (`,e.length,`)`]}),(0,I.jsx)(yE,{size:`sm`,children:(0,I.jsx)(TE,{children:e.map((e,n)=>(0,I.jsxs)(bE,{cursor:t===void 0?void 0:`pointer`,onClick:t===void 0?void 0:()=>{t(n)},children:[(0,I.jsx)(wE,{fontFamily:`mono`,fontWeight:`medium`,children:e.field}),(0,I.jsx)(wE,{color:`fg.error`,children:(0,I.jsx)(H,{truncate:!0,children:e.reason})})]},`${e.field}-${n}`))})})]})}function N0({lines:e}){return e.length===0?(0,I.jsx)(L,{p:4,color:`fg.muted`,children:(0,I.jsx)(H,{children:`No trace yet. Run a sample to see it here.`})}):(0,I.jsx)(L,{as:`pre`,p:2,h:`full`,overflow:`auto`,fontFamily:`mono`,fontSize:`xs`,whiteSpace:`pre-wrap`,children:e.join(`
|
|
38
|
+
`)})}function P0({loading:e,view:t,error:n}){return e===!0?(0,I.jsxs)($w,{p:4,direction:`row`,align:`center`,color:`fg.muted`,children:[(0,I.jsx)(Nw,{size:`sm`}),(0,I.jsx)(H,{children:`Working it out…`})]}):n===void 0?t===void 0?(0,I.jsx)(L,{p:4,color:`fg.muted`,children:(0,I.jsx)(H,{children:`Click a missing or rejected value in the Records tab to see why here.`})}):(0,I.jsxs)($w,{p:4,gap:2,children:[(0,I.jsxs)($w,{direction:`row`,gap:2,align:`center`,children:[(0,I.jsx)(Aw,{colorPalette:t.outcome===`rejected`?`red`:`orange`,children:t.outcome}),(0,I.jsx)(H,{fontFamily:`mono`,fontSize:`sm`,fontWeight:`medium`,children:t.field})]}),(0,I.jsx)(H,{children:t.sentence}),t.policy!==void 0&&(0,I.jsxs)(H,{fontSize:`xs`,color:`fg.muted`,children:[`policy: `,t.policy]}),t.stepPath!==void 0&&(0,I.jsxs)(H,{fontSize:`xs`,color:`fg.muted`,children:[`step: `,t.stepPath]})]}):(0,I.jsx)(L,{p:4,children:(0,I.jsx)(H,{color:`fg.error`,children:n})})}function F0({records:e,traceLines:t,rejected:n=[],onExplainMissing:r,onExplainRejected:i,whyLoading:a,whyView:o,whyError:s,highlightedField:c,onHoverField:l}){return(0,I.jsxs)(Vc,{defaultValue:`records`,h:`full`,display:`flex`,flexDirection:`column`,children:[(0,I.jsxs)(Wc,{children:[(0,I.jsxs)(Hc,{value:`records`,children:[`Records (`,e.length,`)`]}),(0,I.jsx)(Hc,{value:`trace`,children:`Trace`}),(0,I.jsx)(Hc,{value:`why`,children:`Why?`})]}),(0,I.jsxs)(Uc,{value:`records`,flex:`1`,minH:`0`,p:0,display:`flex`,flexDirection:`column`,children:[(0,I.jsx)(O0,{records:e,onCellClick:r,highlightedField:c,onHoverField:l}),(0,I.jsx)(M0,{rejected:n,onClick:i})]}),(0,I.jsx)(Uc,{value:`trace`,flex:`1`,minH:`0`,overflow:`auto`,p:0,children:(0,I.jsx)(N0,{lines:t})}),(0,I.jsx)(Uc,{value:`why`,flex:`1`,minH:`0`,overflow:`auto`,p:0,children:(0,I.jsx)(P0,{loading:a,view:o,error:s})})]})}var I0={string:`gray`,number:`blue`,integer:`blue`,boolean:`green`,date:`purple`,datetime:`purple`,currency:`orange`,url:`cyan`,enum:`pink`,array:`teal`,object:`teal`,json:`yellow`};function L0(e){return I0[e]??`gray`}function R0(e){return e!==void 0&&`each`in e}function z0(e){let t={};for(let[n,r]of Object.entries(e))!R0(r)&&typeof r.from==`string`&&(t[n]=r.from);return t}var B0=[`string`,`number`,`integer`,`boolean`,`date`,`datetime`,`currency`,`url`,`enum`,`array`,`object`,`json`],V0=[`fail`,`skip-record`,`null`,`default`],H0=/^[A-Z_][\w-]*$/i,U0=`trim.lowercase.uppercase.replace.regex.split.join.first.last.nth.slice.concat.coalesce.default.number.integer.boolean.toString.padStart.padEnd.currency.date.absoluteUrl.urlEncode.flatten.unique.sum.count.template.jsonpath.lookup.group`.split(`.`),W0={replace:[{name:`pattern`},{name:`replacement`},{name:`flags`}],regex:[{name:`pattern`},{name:`group`,numeric:!0},{name:`flags`}],split:[{name:`separator`}],join:[{name:`separator`}],nth:[{name:`index`,numeric:!0}],slice:[{name:`start`,numeric:!0},{name:`end`,numeric:!0}],concat:[{name:`separator`}],default:[{name:`value`}],number:[{name:`locale`}],boolean:[{name:`truthy`}],padStart:[{name:`length`,numeric:!0},{name:`char`}],padEnd:[{name:`length`,numeric:!0},{name:`char`}],currency:[{name:`locale`},{name:`currency`}],date:[{name:`format`},{name:`timezone`}],absoluteUrl:[{name:`base`}],template:[{name:`value`}],jsonpath:[{name:`path`}],lookup:[{name:`in`},{name:`key`},{name:`pick`}],group:[{name:`by`}]};function G0(e){return W0[e]??[]}function K0({transforms:e,trace:t,onChange:n}){let[r,i]=(0,F.useState)(!1),a=kA(),o=(t,r)=>{n(e.map((e,n)=>n===t?r:e))},s=t=>{n(e.filter((e,n)=>n!==t))},c=(t,r)=>{let i=t+r;if(i<0||i>=e.length)return;let a=[...e],o=a[t];a[t]=a[i],a[i]=o,n(a)},l=t=>{n([...e,t===`hook`?{op:t,name:a?.[0]??`myHook`}:{op:t}]),i(!1)};return(0,I.jsxs)($w,{direction:`row`,gap:2,wrap:`wrap`,align:`flex-start`,children:[e.map((n,r)=>(0,I.jsx)(q0,{transform:n,value:t?.steps[r]?.value,failed:t!==void 0&&t.steps.length<=r,onChange:e=>{o(r,e)},onRemove:()=>{s(r)},onMoveLeft:r===0?void 0:()=>{c(r,-1)},onMoveRight:r===e.length-1?void 0:()=>{c(r,1)}},r)),r?(0,I.jsx)(PT,{size:`xs`,width:`140px`,children:(0,I.jsxs)(IT,{defaultValue:``,onChange:e=>{e.target.value!==``&&l(e.target.value)},children:[(0,I.jsx)(`option`,{value:``,disabled:!0,children:`op…`}),U0.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e)),(0,I.jsx)(`option`,{value:`hook`,children:`hook (your code)`})]})}):(0,I.jsx)(Rw,{size:`xs`,variant:`outline`,onClick:()=>{i(!0)},children:`+ transform`})]})}function q0({transform:e,value:t,failed:n,onChange:r,onRemove:i,onMoveLeft:a,onMoveRight:o}){let[s,c]=(0,F.useState)(!1),l=e.op===`hook`,u=l?[]:G0(e.op),d=l||u.length>0;return(0,I.jsxs)(L,{borderWidth:`1px`,borderRadius:`md`,borderColor:n?`red.subtle`:void 0,px:2,py:1,fontSize:`xs`,children:[(0,I.jsxs)(G,{gap:1,children:[a!==void 0&&(0,I.jsx)(Yw,{"aria-label":`Move left`,size:`2xs`,variant:`ghost`,onClick:a,children:`‹`}),(0,I.jsxs)(H,{as:d?`button`:`span`,fontWeight:`medium`,cursor:d?`pointer`:void 0,onClick:d?()=>{c(!s)}:void 0,children:[e.op,l&&typeof e.name==`string`?`: ${e.name}`:``]}),o!==void 0&&(0,I.jsx)(Yw,{"aria-label":`Move right`,size:`2xs`,variant:`ghost`,onClick:o,children:`›`}),(0,I.jsx)(Yw,{"aria-label":`Remove ${e.op}`,size:`2xs`,variant:`ghost`,colorPalette:`red`,onClick:i,children:`×`})]}),t!==void 0&&(0,I.jsxs)(Aw,{mt:1,size:`sm`,colorPalette:n?`red`:`gray`,fontFamily:`mono`,maxW:`160px`,overflow:`hidden`,textOverflow:`ellipsis`,children:[`→ `,typeof t==`object`?JSON.stringify(t):String(t)]}),s&&l&&(0,I.jsx)($w,{mt:1,gap:1,children:(0,I.jsx)(AA,{size:`xs`,ariaLabel:`Hook name`,value:typeof e.name==`string`?e.name:``,onChange:t=>{r({...e,name:t})}})}),s&&u.length>0&&(0,I.jsx)($w,{mt:1,gap:1,children:u.map(t=>(0,I.jsxs)(G,{gap:1,children:[(0,I.jsx)(H,{color:`fg.muted`,minW:`70px`,children:t.name}),(0,I.jsx)(DT,{size:`2xs`,value:e[t.name]===void 0?``:String(e[t.name]),onChange:n=>{let i=n.target.value;r({...e,[t.name]:t.numeric?Number(i):i})}})]},t.name))})]})}function J0({name:e,field:t,rule:n,scopeIds:r,trace:i,value:a,missing:o,rejected:s,depth:c=0,stepId:l,highlighted:u=!1,onHoverStepId:d,onFieldChange:f,onRuleChange:p,onRename:m,onRemove:h,onExplainMissing:g,onExplainRejected:_}){let[v,y]=(0,F.useState)(!1),[b,x]=(0,F.useState)(e),[S,C]=(0,F.useState)(),[w,T]=(0,F.useState)(!1),E=t.generated!==void 0;return(0,I.jsxs)(L,{"data-testid":`${e}-row`,"data-highlighted":u,borderWidth:`1px`,borderRadius:`md`,p:2,ml:c*5,borderColor:u?`orange.solid`:s===void 0?void 0:`red.subtle`,bg:u?`orange.subtle`:void 0,onMouseEnter:l===void 0||d===void 0?void 0:()=>{d(l)},onMouseLeave:l===void 0||d===void 0?void 0:()=>{d(void 0)},children:[(0,I.jsxs)(G,{"data-testid":`${e}-summary`,gap:2,mb:2,align:`center`,wrap:`wrap`,fontSize:`xs`,children:[(0,I.jsx)(Aw,{size:`sm`,colorPalette:L0(t.type),children:t.type}),E?(0,I.jsx)(Aw,{size:`sm`,colorPalette:`gray`,children:`generated`}):l===void 0?(0,I.jsx)(Aw,{size:`sm`,colorPalette:`orange`,children:n===void 0?`not mapped`:`from a template`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(H,{color:`fg.muted`,children:`←`}),(0,I.jsx)(LA,{name:l,draggable:!1})]}),a!==void 0&&(0,I.jsxs)(H,{color:`fg.muted`,truncate:!0,maxW:`260px`,title:Y0(a),children:[`= `,Y0(a)]})]}),(0,I.jsxs)(G,{gap:2,align:`center`,wrap:`wrap`,children:[(0,I.jsxs)($w,{gap:0,children:[(0,I.jsx)(DT,{size:`xs`,width:`140px`,value:b,onChange:e=>{x(e.target.value)},onBlur:()=>{if(b!==e){if(!H0.test(b)){C(`a field name has no dots`);return}C(void 0),m(b)}}}),S!==void 0&&(0,I.jsx)(H,{fontSize:`2xs`,color:`fg.error`,children:S})]}),(0,I.jsx)(PT,{size:`xs`,width:`110px`,children:(0,I.jsx)(IT,{value:t.type,onChange:e=>{f({...t,type:e.target.value})},children:B0.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))})}),(0,I.jsx)(L,{"data-testid":`${e}-source-drop`,minW:`140px`,borderWidth:`1px`,borderStyle:`dashed`,borderRadius:`sm`,px:2,py:`2px`,fontSize:`xs`,bg:w?`colorPalette.subtle`:void 0,colorPalette:`blue`,onDragOver:e=>{e.dataTransfer.types.includes(`application/x-opencraw-pill`)&&(e.preventDefault(),T(!0))},onDragLeave:()=>{T(!1)},onDrop:e=>{e.preventDefault(),T(!1);let t=e.dataTransfer.getData(`application/x-opencraw-pill`)||e.dataTransfer.getData(`text/plain`);t!==``&&p({...n,from:t})},children:E?(0,I.jsxs)(H,{color:`fg.muted`,children:[`generated: `,t.generated]}):(0,I.jsx)(PT,{size:`xs`,children:(0,I.jsxs)(IT,{value:typeof n?.from==`string`?n.from:``,onChange:e=>{p(e.target.value===``?void 0:{...n,from:e.target.value})},children:[(0,I.jsx)(`option`,{value:``,children:`(drop a pill, or pick)`}),r.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})})}),(0,I.jsxs)(Ww,{size:`xs`,checked:t.key===!0,onCheckedChange:e=>{f({...t,key:e.checked===!0})},children:[(0,I.jsx)(Jw,{}),(0,I.jsx)(qw,{}),(0,I.jsx)(Gw,{children:`key`})]}),(0,I.jsxs)(Ww,{size:`xs`,checked:t.required===!0,disabled:E,onCheckedChange:e=>{f({...t,required:e.checked===!0})},children:[(0,I.jsx)(Jw,{}),(0,I.jsx)(qw,{}),(0,I.jsx)(Gw,{children:`required`})]}),o===!0&&(0,I.jsx)(Rw,{size:`2xs`,variant:`outline`,colorPalette:`orange`,onClick:g,children:`Why null?`}),s!==void 0&&(0,I.jsxs)(Rw,{size:`2xs`,variant:`outline`,colorPalette:`red`,onClick:_,title:s.reason,children:[s.count,` rejected`]}),(0,I.jsx)(Rw,{size:`2xs`,variant:`ghost`,onClick:()=>{y(!v)},children:v?`less`:`more`}),(0,I.jsx)(Yw,{"aria-label":`Remove ${e}`,size:`2xs`,variant:`ghost`,colorPalette:`red`,onClick:h,ml:`auto`,children:`×`})]}),!E&&t.type!==`object`&&(0,I.jsx)(L,{mt:2,children:(0,I.jsx)(K0,{transforms:n?.transform??[],trace:i,onChange:e=>{p(n===void 0?void 0:{...n,transform:e.length===0?void 0:e})}})}),v&&(0,I.jsxs)($w,{mt:2,direction:`row`,gap:3,wrap:`wrap`,fontSize:`xs`,children:[(0,I.jsxs)(Ww,{size:`xs`,checked:t.nullable===!0,onCheckedChange:e=>{f({...t,nullable:e.checked===!0})},children:[(0,I.jsx)(Jw,{}),(0,I.jsx)(qw,{}),(0,I.jsx)(Gw,{children:`nullable`})]}),(0,I.jsxs)(G,{gap:1,children:[(0,I.jsx)(H,{color:`fg.muted`,children:`onMissing`}),(0,I.jsx)(PT,{size:`xs`,width:`110px`,children:(0,I.jsxs)(IT,{value:t.onMissing??``,onChange:e=>{f({...t,onMissing:e.target.value===``?void 0:e.target.value})},children:[(0,I.jsx)(`option`,{value:``,children:`(recipe default)`}),V0.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})})]}),(0,I.jsxs)(G,{gap:1,children:[(0,I.jsx)(H,{color:`fg.muted`,children:`default`}),(0,I.jsx)(DT,{size:`xs`,width:`120px`,value:t.default===void 0?``:String(t.default),onChange:e=>{f({...t,default:e.target.value===``?void 0:e.target.value})}})]}),t.type===`currency`&&(0,I.jsxs)(G,{gap:1,children:[(0,I.jsx)(H,{color:`fg.muted`,children:`currency`}),(0,I.jsx)(DT,{size:`xs`,width:`60px`,value:t.currency??``,onChange:e=>{f({...t,currency:e.target.value||void 0})}})]}),(t.type===`date`||t.type===`datetime`)&&(0,I.jsxs)(G,{gap:1,children:[(0,I.jsx)(H,{color:`fg.muted`,children:`format`}),(0,I.jsx)(DT,{size:`xs`,width:`100px`,value:t.format??``,onChange:e=>{f({...t,format:e.target.value||void 0})}})]}),t.type===`enum`&&(0,I.jsxs)(G,{gap:1,children:[(0,I.jsx)(H,{color:`fg.muted`,children:`values`}),(0,I.jsx)(DT,{size:`xs`,width:`160px`,placeholder:`a, b, c`,value:(t.values??[]).join(`, `),onChange:e=>{f({...t,values:e.target.value.split(`,`).map(e=>e.trim()).filter(e=>e!==``)})}})]}),(0,I.jsxs)(G,{gap:1,children:[(0,I.jsx)(H,{color:`fg.muted`,children:`pattern`}),(0,I.jsx)(DT,{size:`xs`,width:`120px`,value:t.pattern??``,onChange:e=>{f({...t,pattern:e.target.value||void 0})}})]}),(0,I.jsxs)(G,{gap:1,children:[(0,I.jsx)(H,{color:`fg.muted`,children:`min`}),(0,I.jsx)(DT,{size:`xs`,width:`60px`,value:t.min??``,onChange:e=>{f({...t,min:e.target.value===``?void 0:Number(e.target.value)})}})]}),(0,I.jsxs)(G,{gap:1,children:[(0,I.jsx)(H,{color:`fg.muted`,children:`max`}),(0,I.jsx)(DT,{size:`xs`,width:`60px`,value:t.max??``,onChange:e=>{f({...t,max:e.target.value===``?void 0:Number(e.target.value)})}})]})]})]})}function Y0(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,79)}…`:t}function X0({suggestions:e,onAdd:t,onAddAll:n}){return e.length===0?null:(0,I.jsxs)(L,{"data-testid":`field-suggestions`,borderWidth:`1px`,borderStyle:`dashed`,borderRadius:`md`,p:2,bg:`bg.subtle`,children:[(0,I.jsxs)(G,{justify:`space-between`,mb:1,children:[(0,I.jsx)(H,{fontSize:`xs`,fontWeight:`medium`,children:`Read by the steps, not in the output yet`}),(0,I.jsxs)(Rw,{size:`2xs`,variant:`outline`,onClick:n,children:[`Add all (`,e.length,`)`]})]}),(0,I.jsx)($w,{direction:`row`,wrap:`wrap`,gap:2,children:e.map(e=>(0,I.jsxs)(G,{"data-testid":`suggestion-${e.source}`,gap:1,borderWidth:`1px`,borderRadius:`full`,pl:1,pr:1,py:`1px`,bg:`bg`,title:`${e.name}: ${e.field.type}, because ${e.reason}`,children:[(0,I.jsx)(LA,{name:e.source,draggable:!1}),(0,I.jsx)(H,{fontSize:`xs`,color:`fg.muted`,children:`→`}),(0,I.jsx)(H,{fontSize:`xs`,fontWeight:`medium`,children:e.name}),(0,I.jsx)(Aw,{size:`sm`,colorPalette:L0(e.field.type),children:e.field.type}),(0,I.jsx)(Rw,{size:`2xs`,variant:`ghost`,"aria-label":`Add ${e.name}`,onClick:()=>{t(e)},children:`+`})]},e.source))})]})}function Z0(e){let t=new Set(e.dataTransfer.types);return t.has(`application/x-opencraw-pill`)||t.has(`application/x-opencraw-card`)}function Q0({onPill:e,onCard:t,children:n}){let[r,i]=(0,F.useState)(!1);function a(e){!e.defaultPrevented&&Z0(e)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,i(!0))}function o(n){if(i(!1),n.defaultPrevented||!Z0(n))return;n.preventDefault();let r=TA(n.dataTransfer);if(r!==void 0){t(r);return}let a=n.dataTransfer.getData(IA);a!==``&&e(a)}return(0,I.jsx)(L,{"data-testid":`output-drop-zone`,"data-drop-over":r,borderWidth:`2px`,borderStyle:`dashed`,borderColor:r?`blue.solid`:`transparent`,bg:r?`blue.subtle`:void 0,borderRadius:`md`,minH:`4em`,onDragOver:a,onDragLeave:()=>{i(!1)},onDrop:o,children:n})}function $0(e){let t=t2(e);if(t===void 0)return[];let n=[];return e2(t,n),n}function e2(e,t){for(let n of e){if(typeof n!=`object`||!n)continue;let e=n;for(let n of[`id`,`as`]){let r=e[n];typeof r==`string`&&r.length>0&&!t.includes(r)&&t.push(r)}let r=t2(e);r!==void 0&&e2(r,t),Array.isArray(e.else)&&e2(e.else,t)}}function t2(e){if(typeof e!=`object`||!e)return;let t=e.steps;return Array.isArray(t)?t:void 0}var n2=new Set([`attr:href`,`attr:src`,`attr:data-src`]),r2=[[[`url`,`link`,`href`,`website`,`homepage`,`image`,`img`,`photo`,`thumbnail`,`src`],{type:`url`,reason:`its name says a link`}],[[`datetime`,`timestamp`],{type:`datetime`,reason:`its name says a moment in time`}],[[`date`,`day`,`published`,`created`,`updated`,`released`,`expires`,`expiry`,`until`,`since`],{type:`date`,reason:`its name says a date`}],[[`available`,`availability`,`active`,`enabled`,`instock`,`is`,`has`],{type:`boolean`,reason:`its name says yes or no`}],[[`qty`,`quantity`,`count`,`pages`,`year`,`age`,`rank`,`position`,`votes`,`reviews`],{type:`integer`,reason:`its name says a whole number`}],[[`price`,`cost`,`amount`,`total`,`fee`,`discount`,`salary`,`rate`,`rating`,`score`,`weight`,`height`,`width`,`length`,`percent`,`sconto`],{type:`number`,reason:`its name says an amount`}]];function i2(e,t,n){let r=f2(d2(e)),i=new Set(r.flatMap(e=>typeof e.over==`string`?[e.over]:[])),a=c2(n),o=new Set(Object.keys(t)),s=[],c=new Set;for(let e of r){let t=e.id;if(typeof t!=`string`||t===``||!s2(e)||i.has(t)||a.has(t)||c.has(t))continue;c.add(t);let n=o2(t,e),r=u2(t,o);o.add(r),s.push({source:t,name:r,field:{type:n.type,...n.items!==void 0&&{items:n.items}},rule:{from:t,...n.transform!==void 0&&{transform:n.transform}},reason:n.reason})}return s}function a2(e,t,n,r){let i=i2(t,n,r).find(t=>t.source===e);return i===void 0?{source:e,name:u2(e,new Set(Object.keys(n))),field:{type:`string`},rule:{from:e},reason:`text, the safe default`}:i}function o2(e,t){if(t.many===!0)return{type:`array`,items:{type:`string`},reason:`it reads every match, a list`};let n=typeof t.take==`string`?t.take:void 0;if(n!==void 0&&n2.has(n))return{type:`url`,transform:[{op:`absoluteUrl`}],reason:`it takes ${n}, a link (made absolute)`};let r=l2(e);for(let[e,t]of r2)if(r.some(t=>e.includes(t)))return t;return{type:`string`,reason:`text, the safe default`}}function s2(e){return e.type===`set`||e.type===`extract`&&e.kind!==`table`}function c2(e){let t=new Set,n=e=>{let n=Array.isArray(e.from)?e.from:[e.from];for(let e of n)t.add(e.split(`.`,1)[0])};for(let r of Object.values(e))if(`each`in r){t.add(r.each);for(let e of Object.values(r.fields))n(e)}else n(r);return t}function l2(e){return e.replace(/([a-z\d])([A-Z])/g,`$1 $2`).toLowerCase().split(/[^a-z\d]+/).filter(e=>e!==``)}function u2(e,t){let n=e.replace(/[^\w-]/g,`_`);H0.test(n)||(n=`field_${n}`);let r=n,i=2;for(;t.has(r);)r=`${n}${String(i)}`,i+=1;return r}function d2(e){if(typeof e!=`object`||!e)return[];let t=e.steps;return Array.isArray(t)?t:[]}function f2(e){return e.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e,n=Array.isArray(t.else)?t.else:[];return[t,...f2(d2(t)),...f2(n)]})}function p2({inputRecipe:e,outputRecipe:t,records:n,rejected:r,onSaveInput:i,onSaveOutput:a,onSaveOutline:o,onExplainMissing:s,onExplainRejected:c}){let[l,u]=(0,F.useState)(),[d,f]=(0,F.useState)(),[p,m]=(0,F.useState)(),[h,g]=(0,F.useState)(),[_,v]=(0,F.useState)(0),[y,b]=(0,F.useState)(!1),[x,S]=(0,F.useState)(),C=K(e=>e.hoveredStepId),w=K(e=>e.setHoveredStepId),T=(0,F.useRef)(new Set);if((0,F.useEffect)(()=>{let n=t===void 0?void 0:JSON.parse(t.text),r=e===void 0?void 0:JSON.parse(e.text);m(n===void 0?void 0:JSON.stringify(n)),g(r===void 0?void 0:JSON.stringify(r));let i=T.current;if(n!==void 0&&r!==void 0&&i.size>0){T.current=new Set;let e=i2(r,n.fields,r.mapping).filter(e=>i.has(e.source)),t={...n.fields},a={...r.mapping};for(let n of e)t[n.name]=n.field,a[n.name]=n.rule;u({...n,fields:t}),f({...r,mapping:a})}else u(n),f(r);v(0)},[e?.file,e?.text,t?.file,t?.text]),e===void 0)return(0,I.jsx)(L,{p:4,color:`fg.muted`,children:(0,I.jsx)(H,{children:`Select a recipe to see its output fields.`})});if(t===void 0||l===void 0||d===void 0)return(0,I.jsx)(L,{p:4,color:`fg.muted`,children:(0,I.jsx)(H,{children:`This recipe names no output recipe found in this workspace.`})});let E=$0(d),D=i2(d,l.fields,d.mapping),ee=n[_],O=JSON.stringify(l)!==p||JSON.stringify(d)!==h,k=(e,t)=>{let n={...l.fields};t===void 0?delete n[e]:n[e]=t,u({...l,fields:n})},A=(e,t)=>{if(t===e||l.fields[t]!==void 0)return;let n={};for(let[r,i]of Object.entries(l.fields))n[r===e?t:r]=i;u({...l,fields:n});let r={...d.mapping};r[e]!==void 0&&(r[t]=r[e],delete r[e]),f({...d,mapping:r})},te=(e,t)=>{let n={...d.mapping};t===void 0?delete n[e]:n[e]=t,f({...d,mapping:n})},ne=e=>{let t={...l.fields},n={...d.mapping};for(let r of e)t[r.name]=r.field,n[r.name]=r.rule;u({...l,fields:t}),f({...d,mapping:n})},re=e=>{ne([a2(e,d,l.fields,d.mapping)])},j=()=>{let e=`field`,t=1;for(;l.fields[e]!==void 0;)e=`field${t}`,t+=1;k(e,{type:`string`})},ie=async()=>{b(!0),S(void 0);try{await a(t.file,l),await i(e.file,d)}catch(e){S(e instanceof Error?e.message:String(e))}finally{b(!1)}},ae=async t=>{let n=e.outline;if(o!==void 0&&n!==void 0){S(void 0);try{O&&await ie(),T.current=new Set(m2(t)),await o(e.file,{...n,steps:[...n.steps,{...t,path:`steps.${String(n.steps.length)}`}]})}catch(e){T.current=new Set,S(e instanceof Error?e.message:String(e))}}};return(0,I.jsxs)($w,{h:`full`,p:2,gap:2,overflow:`auto`,children:[(0,I.jsxs)(G,{justify:`space-between`,wrap:`wrap`,children:[(0,I.jsxs)(G,{gap:3,fontSize:`xs`,color:`fg.muted`,children:[(0,I.jsxs)(G,{gap:1,children:[(0,I.jsx)(H,{children:`onMissing`}),(0,I.jsx)(PT,{size:`xs`,width:`110px`,children:(0,I.jsxs)(IT,{value:l.onMissing??``,onChange:e=>{u({...l,onMissing:e.target.value===``?void 0:e.target.value})},children:[(0,I.jsx)(`option`,{value:``,children:`(fail/null)`}),V0.filter(e=>e!=="default").map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})})]}),n.length>0&&(0,I.jsxs)(G,{gap:1,children:[(0,I.jsx)(H,{children:`record`}),(0,I.jsx)(PT,{size:`xs`,width:`70px`,children:(0,I.jsx)(IT,{value:_,onChange:e=>{v(Number(e.target.value))},children:n.map((e,t)=>(0,I.jsxs)(`option`,{value:t,children:[`#`,t+1]},e.key??t))})})]})]}),(0,I.jsxs)(G,{children:[x!==void 0&&(0,I.jsx)(H,{color:`fg.error`,fontSize:`xs`,children:x}),(0,I.jsx)(Rw,{size:`xs`,onClick:()=>{ie()},disabled:!O||y,loading:y,children:`Save`})]})]}),(0,I.jsx)(X0,{suggestions:D,onAdd:e=>{ne([e])},onAddAll:()=>{ne(D)}}),(0,I.jsxs)(Q0,{onPill:re,onCard:e=>{ae(e)},children:[Object.keys(l.fields).length===0&&D.length===0&&(0,I.jsx)(H,{fontSize:`xs`,color:`fg.muted`,p:2,children:`No output fields yet. Drag a pill from a Steps card, or a selection from the content pane, onto this list; or pick values and they show up above as proposals; or add a field by hand.`}),(0,I.jsx)($w,{gap:2,children:Object.entries(l.fields).map(([e,t])=>(0,I.jsx)(h2,{name:e,field:t,target:e,input:d,record:ee,rejected:r,scopeIds:E,hoveredStepId:C,onHoverStepId:w,setRule:te,onFieldChange:t=>{k(e,t)},onRename:t=>{A(e,t)},onRemove:()=>{k(e,void 0)},onExplainMissing:s===void 0?void 0:()=>{s(_,e)},onExplainRejected:c===void 0?void 0:()=>{let t=r.findIndex(t=>t.field===e);t!==-1&&c(t)}},e))})]}),(0,I.jsx)(L,{children:(0,I.jsx)(Rw,{size:`xs`,variant:`outline`,onClick:j,children:`+ field`})})]})}function m2(e){let t=typeof e.step.id==`string`?[e.step.id]:[];return e.kind===`bracket`?[...t,...e.children.flatMap(e=>m2(e)),...(e.elseChildren??[]).flatMap(e=>m2(e))]:t}function h2({name:e,field:t,target:n,input:r,record:i,rejected:a,scopeIds:o,depth:s=0,hoveredStepId:c,onHoverStepId:l,setRule:u,onFieldChange:d,onRename:f,onRemove:p,onExplainMissing:m,onExplainRejected:h}){if(t.type===`object`&&t.fields!==void 0)return(0,I.jsxs)($w,{gap:1,children:[(0,I.jsx)(J0,{name:e,field:t,scopeIds:o,depth:s,onFieldChange:d,onRename:f,onRemove:p,onRuleChange:()=>{}}),Object.entries(t.fields).map(([e,f])=>(0,I.jsx)(h2,{name:e,field:f,target:`${n}.${e}`,input:r,record:i,rejected:a,scopeIds:o,depth:s+1,hoveredStepId:c,onHoverStepId:l,setRule:u,onFieldChange:n=>{d({...t,fields:{...t.fields,[e]:n}})},onRename:n=>{let r={},i=Object.entries(t.fields??{});for(let[t,a]of i)r[t===e?n:t]=a;d({...t,fields:r})},onRemove:()=>{let n={...t.fields};delete n[e],d({...t,fields:n})}},e))]});if(t.type===`array`&&t.items?.type===`object`&&t.items.fields!==void 0){let i=r.mapping[n],a=R0(i)?i:void 0,f=t.items,p=f.fields;return(0,I.jsxs)($w,{gap:1,borderWidth:`1px`,borderRadius:`md`,p:2,ml:s*5,children:[(0,I.jsxs)(G,{gap:2,children:[(0,I.jsx)(H,{fontWeight:`medium`,fontSize:`sm`,children:e}),(0,I.jsx)(H,{fontSize:`xs`,color:`fg.muted`,children:`each`}),(0,I.jsx)(DT,{size:`xs`,width:`140px`,placeholder:`list id (e.g. items)`,value:a?.each??``,onChange:e=>{u(n,e.target.value===``?void 0:{each:e.target.value,fields:a?.fields??{}})}})]}),Object.entries(p).map(([e,r])=>{let i=a?.fields[e],m=typeof i?.from==`string`?i.from:void 0;return(0,I.jsx)(J0,{name:e,field:r,rule:i,scopeIds:o,depth:s+1,stepId:m,highlighted:m!==void 0&&m===c,onHoverStepId:l,onFieldChange:n=>{d({...t,items:{...f,fields:{...p,[e]:n}}})},onRename:n=>{let r={};for(let[t,i]of Object.entries(p))r[t===e?n:t]=i;d({...t,items:{...f,fields:r}})},onRemove:()=>{let n={...p};delete n[e],d({...t,items:{...f,fields:n}})},onRuleChange:t=>{let r={...a?.fields};t===void 0?delete r[e]:r[e]=t,u(n,{each:a?.each??``,fields:r})}},e)})]})}let g=r.mapping[n],_=g===void 0||R0(g)?void 0:g,v=i?.data[e],y=i?.mapping?.[n],b=a.filter(e=>e.field===n),x=typeof _?.from==`string`?_.from:void 0;return(0,I.jsx)(J0,{name:e,field:t,rule:_,scopeIds:o,trace:y,value:v,missing:v===null,rejected:b.length===0?void 0:{count:b.length,reason:b[b.length-1].reason},depth:s,stepId:x,highlighted:x!==void 0&&x===c,onHoverStepId:l,onFieldChange:d,onRename:f,onRemove:p,onRuleChange:e=>{u(n,e)},onExplainMissing:m,onExplainRejected:h})}function g2(e){if(e.trim()===``)return{ok:!1};try{return{ok:!0,value:JSON.parse(e)}}catch{return{ok:!1}}}function _2(e){let t={};for(let[n,r]of Object.entries(e)){if(!r.enabled)continue;let e=g2(r.text);e.ok&&(t[n]=e.value)}return Object.keys(t).length===0?void 0:t}var v2=YO(e=>({entries:{},setEnabled:(t,n)=>{e(e=>({entries:{...e.entries,[t]:{text:e.entries[t]?.text??`null`,enabled:n}}}))},setText:(t,n)=>{e(e=>({entries:{...e.entries,[t]:{enabled:e.entries[t]?.enabled??!1,text:n}}}))}})),y2={hook:`hook`,captcha:`captcha solver`,access:`access plugin`};function b2({remote:e}){let t=v2(e=>e.entries),n=v2(e=>e.setEnabled),r=v2(e=>e.setText);return e.length===0?null:(0,I.jsxs)($w,{gap:1,mt:1,"data-testid":`hook-stubs`,children:[(0,I.jsx)(H,{fontSize:`xs`,children:`These call outside this machine: a sample run waits for them, and they may cost.`}),e.map(e=>{let i=t[e.name],a=e.kind===`hook`,o=i?.text??`null`,s=i?.enabled??!1,c=g2(o).ok;return(0,I.jsxs)(G,{gap:2,wrap:`wrap`,"data-testid":`remote-${e.name}`,children:[(0,I.jsx)(H,{fontSize:`xs`,children:`${y2[e.kind]} ${e.name} → ${e.label}`}),a&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(Ww,{size:`xs`,checked:s,onCheckedChange:t=>{n(e.name,t.checked===!0)},children:[(0,I.jsx)(Jw,{}),(0,I.jsx)(qw,{}),(0,I.jsx)(Gw,{children:`stub ${e.name}`})]}),(0,I.jsx)(DT,{size:`xs`,width:`220px`,fontFamily:`mono`,"aria-label":`stub value of ${e.name}`,"aria-invalid":!c,value:o,onChange:t=>{r(e.name,t.target.value)}}),!c&&(0,I.jsx)(H,{fontSize:`xs`,color:`red.fg`,children:`not JSON: the hook is called`})]})]},`${e.kind}:${e.name}`)})]})}var x2=/^[a-z0-9][a-z0-9-]*$/,S2=`https://example.com`;function C2(e){if(e.trim()!==``)try{let{protocol:t}=new URL(e.trim());return t===`http:`||t===`https:`?void 0:`use an http:// or https:// address`}catch{return`use a full address, like https://example.com/books`}}function w2(e,t,n=S2){return E2(e,t,{mode:`web`,start:[{url:n}],steps:[{type:`goto`,url:`{{start.url}}`},{type:`emit`}]})}function T2(e,t,n){return E2(e,t,{mode:`api`,start:[{url:n}],steps:[{type:`request`,id:`doc`,url:`{{start.url}}`}]})}function E2(e,t,n){let r=e.endsWith(`/`)?e.slice(0,-1):e;return{outputPath:`${r}/${t}.ocw-out.json`,output:{kind:`output`,id:t,version:1,fields:{}},inputPath:`${r}/${t}.ocw-in.json`,input:{kind:`input`,id:t,output:t,...n,mapping:{}}}}function D2(e){let t=e.replace(/\.[^.]+$/,``).toLowerCase().split(/[^a-z0-9]+/).filter(e=>e!==``).join(`-`);return t===``?`document`:t}function O2(e,t){let n=new Set(t);if(!n.has(e))return e;for(let t=2;;t+=1)if(!n.has(`${e}-${t}`))return`${e}-${t}`}function k2({folder:e,open:t,onClose:n,onCreated:r}){let[i,a]=(0,F.useState)(``),[o,s]=(0,F.useState)(``),[c,l]=(0,F.useState)(),u=rk(),d=i.length===0?void 0:A2(i),f=C2(o);function p(){n(),a(``),s(``),l(void 0)}async function m(){if(e===void 0||A2(i)!==void 0||C2(o)!==void 0)return;l(void 0);let t=w2(e,i,o.trim()===``?void 0:o.trim());try{await u.mutateAsync({path:t.outputPath,recipe:t.output}),await u.mutateAsync({path:t.inputPath,recipe:t.input}),r(i),p()}catch(e){l(e instanceof Error?e.message:String(e))}}return(0,I.jsx)(iT,{open:t,onOpenChange:e=>{e.open||p()},children:(0,I.jsxs)(T_,{children:[(0,I.jsx)(lT,{}),(0,I.jsx)(aT,{children:(0,I.jsxs)(oT,{children:[(0,I.jsxs)(dT,{display:`flex`,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,children:[(0,I.jsx)(sT,{children:`New recipe`}),(0,I.jsx)(cT,{asChild:!0,children:(0,I.jsx)(Xw,{size:`sm`,"aria-label":`Close`})})]}),(0,I.jsxs)(uT,{display:`flex`,flexDirection:`column`,gap:3,pb:4,children:[(0,I.jsxs)(xT,{invalid:d!==void 0,children:[(0,I.jsx)(ST,{children:`Recipe id`}),(0,I.jsx)(DT,{size:`sm`,placeholder:`books`,value:i,onChange:e=>{a(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&m()}}),d!==void 0&&(0,I.jsx)(wT,{children:d})]}),(0,I.jsxs)(xT,{invalid:f!==void 0,children:[(0,I.jsx)(ST,{children:`Start URL (optional)`}),(0,I.jsx)(DT,{size:`sm`,placeholder:`https://example.com/books`,value:o,onChange:e=>{s(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&m()}}),f!==void 0&&(0,I.jsx)(wT,{children:f})]}),(0,I.jsxs)(H,{fontSize:`xs`,color:`fg.muted`,children:[`Writes `,(0,I.jsxs)(H,{as:`span`,fontFamily:`mono`,children:[i||`<id>`,`.ocw-in.json`]}),` and`,` `,(0,I.jsxs)(H,{as:`span`,fontFamily:`mono`,children:[i||`<id>`,`.ocw-out.json`]})," into the open folder: a `web` recipe with one page and no fields mapped yet, ready to build out in the Steps tab."]}),c!==void 0&&(0,I.jsx)(H,{color:`fg.error`,fontSize:`sm`,children:c}),(0,I.jsx)(Rw,{size:`sm`,colorPalette:`blue`,alignSelf:`flex-end`,onClick:()=>{m()},disabled:e===void 0||i.length===0||d!==void 0||f!==void 0||u.isPending,loading:u.isPending,children:`Create`})]})]})})]})})}function A2(e){return x2.test(e)?void 0:`lowercase letters, digits and hyphens, starting with a letter or digit`}function j2(e){return[...e.dataTransfer.types].includes(`Files`)}function M2(e){j2(e)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`)}function N2({onFile:e,children:t,...n}){let[r,i]=(0,F.useState)(0),a=r>0;function o(e){j2(e)&&(e.preventDefault(),i(e=>e+1))}function s(e){j2(e)&&i(e=>Math.max(0,e-1))}function c(t){if(!j2(t))return;t.preventDefault(),i(0);let n=t.dataTransfer.files[0];n!==void 0&&e(n)}return(0,I.jsxs)(L,{position:`relative`,"data-testid":`document-drop-zone`,onDragEnter:o,onDragOver:M2,onDragLeave:s,onDrop:c,...n,children:[t,a&&(0,I.jsx)(L,{role:`status`,position:`absolute`,inset:0,zIndex:`overlay`,display:`flex`,alignItems:`center`,justifyContent:`center`,bg:`blue.subtle/80`,borderWidth:`3px`,borderStyle:`dashed`,borderColor:`blue.solid`,pointerEvents:`none`,children:(0,I.jsx)(H,{fontSize:`lg`,fontWeight:`semibold`,color:`blue.fg`,children:`Drop to load this file`})})]})}function P2(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function F2(e){let t=Array.isArray(e.steps)?e.steps[0]:void 0;return e.mode===`api`&&P2(t)&&t.type===`request`&&t.url===`{{start.url}}`}function I2(e,t){if(!P2(e)||e.kind!==`input`||!Array.isArray(e.start))return{kind:`new`};let[n,...r]=e.start;if(!P2(n)||!(t.kind===`document`?F2(e):e.mode===`web`))return{kind:`new`};let i=typeof n.url==`string`?n.url:void 0;return{kind:`replace`,recipe:{...e,start:[{...n,url:t.url},...r]},previous:i}}function L2(e){if(e!==void 0)try{return JSON.parse(e)}catch{return}}function R2(e,t){return e.kind===`document`?t:e.url}function z2(){let e=jE(),t=rk();return async(n,r,i)=>{let{openFolder:a,selectedRecipeId:o}=K.getState(),s=a===void 0?void 0:e.getQueryData(HO(a))?.recipes.find(e=>e.id===o),c=I2(L2(s?.text),n);if(s!==void 0&&c.kind===`replace`)return await t.mutateAsync({path:s.file,recipe:c.recipe}),`Loaded ${R2(n,r)} into “${s.id??s.file}”${c.previous===void 0?``:`, replacing ${c.previous}`}.`;if(await i(),s!==void 0)return`“${s.id??s.file}” reads ${n.kind===`document`?`a web page`:`a document`}, so ${R2(n,r)} started a new recipe instead. “${s.id??s.file}” is unchanged.`}}function B2(){let e=BO(),t=rk(),n=K(e=>e.commitFolder),r=K(e=>e.selectRecipe);return async(i,a,o)=>{let s=(await e.openWorkspace(i)).recipes.map(e=>e.id).filter(e=>e!==void 0),c=O2(D2(a),s),l=T2(i,c,o);await t.mutateAsync({path:l.outputPath,recipe:l.output}),await t.mutateAsync({path:l.inputPath,recipe:l.input}),K.getState().openFolder!==i&&n(i),r(c)}}function V2(){let e=ik(),t=B2(),n=z2(),r=K(e=>e.folder),i=K(e=>e.openFolder),[a,o]=(0,F.useState)(),[s,c]=(0,F.useState)(!1),[l,u]=(0,F.useState)();async function d(a){let s=(i??r).trim();if(s===``){o(`Type a workspace folder in the toolbar first, then drop the file again: that is where the copy and the recipe go.`);return}o(void 0),u(void 0),c(!0);try{let{url:r}=await e.mutateAsync({folder:s,name:a.name,bytes:await H2(a)});u(await n({kind:`document`,url:r},a.name,async()=>{await t(s,a.name,r)}))}catch(e){o(e instanceof Error?e.message:String(e))}finally{c(!1)}}return{importFile:d,pending:s,error:a,notice:l}}function H2(e){return new Promise((t,n)=>{let r=new FileReader;r.addEventListener(`error`,()=>{n(r.error??Error(`could not read ${e.name}`))}),r.addEventListener(`load`,()=>{let e=String(r.result);t(e.slice(e.indexOf(`,`)+1))}),r.readAsDataURL(e)})}function U2(e){return e.slice(Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`))+1)}function W2(){let e=BO(),t=K(e=>e.commitFolder),n=K(e=>e.selectRecipe),r=B2(),[i,a]=(0,F.useState)();return(0,F.useEffect)(()=>{let i=e.initialOpen;if(i===void 0)return;let o=()=>{let e=new URLSearchParams(globalThis.location.search);e.delete(`open`),globalThis.history.replaceState({},``,`${globalThis.location.pathname}?${e.toString()}`)};(async()=>{try{let a=await e.openPath(i,e.initialFolder);a.kind===`document`?await r(a.folder,U2(a.path),a.url):(t(a.folder),a.kind===`recipe`&&a.recipeId!==void 0&&n(a.recipeId))}catch(e){a(e instanceof Error?e.message:String(e))}finally{o()}})()},[]),i}function G2({open:e,onClose:t,onLoad:n}){let[r,i]=(0,F.useState)(``),a=r.trim()===``?void 0:C2(r),o=r.trim()!==``&&a===void 0;function s(){i(``),t()}function c(){o&&(n(r.trim()),s())}return(0,I.jsx)(iT,{open:e,onOpenChange:e=>{e.open||s()},children:(0,I.jsxs)(T_,{children:[(0,I.jsx)(lT,{}),(0,I.jsx)(aT,{children:(0,I.jsxs)(oT,{children:[(0,I.jsxs)(dT,{display:`flex`,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,children:[(0,I.jsx)(sT,{children:`Load a web page`}),(0,I.jsx)(cT,{asChild:!0,children:(0,I.jsx)(Xw,{size:`sm`,"aria-label":`Close`})})]}),(0,I.jsxs)(uT,{display:`flex`,flexDirection:`column`,gap:3,pb:4,children:[(0,I.jsxs)(xT,{invalid:a!==void 0,children:[(0,I.jsx)(ST,{children:`Page address`}),(0,I.jsx)(DT,{size:`sm`,placeholder:`https://example.com/books`,value:r,onChange:e=>{i(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&c()}}),a!==void 0&&(0,I.jsx)(wT,{children:a}),(0,I.jsx)(CT,{children:`Becomes the open recipe's start page, or a new recipe when none reads a web page.`})]}),(0,I.jsx)(Rw,{size:`sm`,colorPalette:`blue`,alignSelf:`flex-end`,disabled:!o,onClick:c,children:`Load`})]})]})})]})})}function K2(){let e=BO(),t=rk(),n=z2(),r=K(e=>e.folder),i=K(e=>e.openFolder),a=K(e=>e.commitFolder),o=K(e=>e.selectRecipe),[s,c]=(0,F.useState)(!1),[l,u]=(0,F.useState)(),[d,f]=(0,F.useState)();async function p(n,r){let i=(await e.openWorkspace(n)).recipes.map(e=>e.id).filter(e=>e!==void 0),s=O2(D2(new URL(r).hostname),i),c=w2(n,s,r);await t.mutateAsync({path:c.outputPath,recipe:c.output}),await t.mutateAsync({path:c.inputPath,recipe:c.input}),K.getState().openFolder!==n&&a(n),o(s)}async function m(e){let t=(i??r).trim();if(t===``){u(`Open a workspace folder first (Recipe ▾ → Open folder…): that is where the recipe is written.`);return}u(void 0),f(void 0),c(!0);try{let r=e.trim();f(await n({kind:`url`,url:r},r,async()=>{await p(t,r)}))}catch(e){u(e instanceof Error?e.message:String(e))}finally{c(!1)}}return{loadUrl:m,pending:s,error:l,notice:d}}function q2(){let e=globalThis.opencrawDesktop;return typeof e?.chooseFolder==`function`?{chooseFolder:e.chooseFolder}:void 0}function J2({hooks:e}){return e===void 0?null:(0,I.jsxs)(L,{px:4,py:1,bg:`orange.subtle`,color:`orange.fg`,fontSize:`sm`,"data-testid":`hooks-bar`,children:[`Hooks loaded from ${e.source} (runs as your code): ${e.names.length===0?`none exported`:e.names.join(`, `)}`,e.remote!==void 0&&(0,I.jsx)(b2,{remote:e.remote})]})}function Y2(){let e=BO(),t=K(e=>e.commitFolder),[n,r]=(0,F.useState)(!1),[i,a]=(0,F.useState)();async function o(){a(void 0),r(!0);try{let n=await e.chooseFolder();return n===void 0?`cancelled`:(t(n),`picked`)}catch(e){return a(e instanceof Error?e.message:String(e)),`unavailable`}finally{r(!1)}}return{browse:o,pending:n,error:i}}function X2({label:e,title:t,disabled:n,loading:r,items:i}){let[a,o]=(0,F.useState)(!1),s=(0,F.useRef)(null);return(0,F.useEffect)(()=>{if(!a)return;let e=e=>{if(e instanceof KeyboardEvent){e.key===`Escape`&&o(!1);return}s.current!==null&&!s.current.contains(e.target)&&o(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,e)}},[a]),(0,I.jsxs)(L,{ref:s,position:`relative`,flexShrink:0,children:[(0,I.jsx)(Rw,{size:`sm`,variant:`outline`,maxW:`16em`,title:t,disabled:n,loading:r,"aria-haspopup":`menu`,"aria-expanded":a,onClick:()=>{o(e=>!e)},children:e}),a&&(0,I.jsx)(L,{role:`menu`,position:`absolute`,top:`100%`,left:0,mt:1,zIndex:`dropdown`,minW:`14em`,py:1,bg:`bg`,borderWidth:`1px`,borderRadius:`md`,boxShadow:`md`,children:i.map(e=>(0,I.jsxs)(L,{children:[e.divider===!0&&(0,I.jsx)(L,{borderTopWidth:`1px`,my:1}),e.heading!==void 0&&(0,I.jsx)(L,{px:3,py:1,fontSize:`xs`,color:`fg.muted`,children:e.heading}),(0,I.jsx)(L,{as:`button`,role:`menuitem`,display:`block`,w:`full`,textAlign:`left`,px:3,py:1,fontSize:`sm`,cursor:e.disabled===!0?`not-allowed`:`pointer`,opacity:e.disabled===!0?.5:1,_hover:e.disabled===!0?void 0:{bg:`bg.muted`},"aria-disabled":e.disabled===!0,onClick:()=>{e.disabled!==!0&&(o(!1),e.onSelect())},children:e.label})]},e.label))})]})}function Z2({loading:e,onLoadDocument:t,onLoadUrl:n}){return(0,I.jsx)(X2,{label:`Load ▾`,title:`Bring in the document or page the recipe reads (a file can also be dropped anywhere)`,disabled:e,loading:e,items:[{label:`Document…`,onSelect:t},{label:`Web page (URL)…`,onSelect:n}]})}function Q2({open:e,onClose:t,folder:n,onFolderChange:r,onOpen:i,onBrowse:a,browsing:o}){function s(){n.trim()!==``&&(i(),t())}return(0,I.jsx)(iT,{open:e,onOpenChange:e=>{e.open||t()},children:(0,I.jsxs)(T_,{children:[(0,I.jsx)(lT,{}),(0,I.jsx)(aT,{children:(0,I.jsxs)(oT,{children:[(0,I.jsxs)(dT,{display:`flex`,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,children:[(0,I.jsx)(sT,{children:`Open folder`}),(0,I.jsx)(cT,{asChild:!0,children:(0,I.jsx)(Xw,{size:`sm`,"aria-label":`Close`})})]}),(0,I.jsxs)(uT,{display:`flex`,flexDirection:`column`,gap:3,pb:4,children:[(0,I.jsx)(DT,{size:`sm`,placeholder:`recipe folder`,value:n,onChange:e=>{r(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&s()}}),(0,I.jsxs)(H,{fontSize:`xs`,color:`fg.muted`,children:[`A folder of `,(0,I.jsx)(H,{as:`span`,fontFamily:`mono`,children:`.ocw-in.json`}),` and `,(0,I.jsx)(H,{as:`span`,fontFamily:`mono`,children:`.ocw-out.json`}),` recipes, or an empty one to start in.`]}),(0,I.jsxs)(G,{justifyContent:`flex-end`,children:[a!==void 0&&(0,I.jsx)(Rw,{size:`sm`,variant:`outline`,onClick:a,disabled:o,loading:o,title:`Pick the folder in the operating system dialog`,children:`Browse…`}),(0,I.jsx)(Rw,{size:`sm`,colorPalette:`blue`,onClick:s,disabled:n.trim()===``,children:`Open`})]})]})]})})]})})}function $2({inputs:e,selectedRecipeId:t,hasFolder:n,onSelectRecipe:r,onNewRecipe:i,onOpenFolder:a}){let o=e.length===0?[{label:n?`No recipes in this folder`:`Open a folder first`,onSelect:()=>{},disabled:!0,heading:`Open recipe`}]:e.map((e,n)=>{let i=e.id??e.file;return{label:i===t?`✓ ${i}`:i,onSelect:()=>{r(i)},...n===0&&{heading:`Open recipe`}}});return(0,I.jsx)(X2,{label:t===void 0?`Recipe ▾`:`Recipe: ${t} ▾`,title:`Open, create or switch the recipe being edited`,items:[...o,{label:`New recipe…`,onSelect:i,disabled:!n,divider:!0},{label:`Open folder…`,onSelect:a}]})}function e4(){let e=$D()>0;return(0,I.jsx)(H,{role:`status`,fontSize:`sm`,color:`fg.muted`,flexShrink:0,children:e?`Saving…`:`All changes saved`})}var t4=`.pdf,.xlsx,.xlsm,.xls,.csv,.tsv,.pptx,.docx,.md,.markdown,.html,.htm,.json,.jsonl,.yaml,.yml,.xml`;function n4(e){return/[^/\\]+(?=[/\\]*$)/u.exec(e)?.[0]??``}function r4({folder:e,onFolderChange:t,onOpen:n,onChooseFolder:r,onBrowse:i,browsing:a,openFolder:o,inputs:s,selectedRecipeId:c,onSelectRecipe:l,onRecipeCreated:u,onImportFile:d,onLoadUrl:f,importing:p,running:m,onRunSample:h,onStop:g}){let _=(0,F.useRef)(null),[v,y]=(0,F.useState)(!1),[b,x]=(0,F.useState)(!1),[S,C]=(0,F.useState)(!1);return(0,I.jsxs)(G,{gap:2,p:2,borderBottomWidth:`1px`,wrap:`wrap`,children:[(0,I.jsx)(H,{fontWeight:`semibold`,flexShrink:0,children:`OpenCraw Studio`}),(0,I.jsx)($2,{inputs:s,selectedRecipeId:c,hasFolder:o!==void 0,onSelectRecipe:l,onNewRecipe:()=>{y(!0)},onOpenFolder:()=>{r===void 0?i===void 0?C(!0):i().then(e=>{e===`unavailable`&&C(!0)}):r()}}),(0,I.jsx)(Z2,{loading:p,onLoadDocument:()=>{_.current?.click()},onLoadUrl:()=>{x(!0)}}),(0,I.jsx)(`input`,{ref:_,type:`file`,accept:t4,"aria-label":`Load document`,hidden:!0,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t!==void 0&&d(t)}}),o!==void 0&&(0,I.jsx)(H,{fontSize:`sm`,color:`fg.muted`,truncate:!0,maxW:`14em`,title:o,children:n4(o)}),(0,I.jsx)(e4,{}),(0,I.jsxs)(G,{gap:2,flexShrink:0,ml:`auto`,children:[(0,I.jsx)(Rw,{size:`sm`,colorPalette:`blue`,onClick:h,disabled:c===void 0||m,loading:m,children:`Run sample`}),(0,I.jsx)(Rw,{size:`sm`,variant:`outline`,onClick:g,disabled:!m,children:`Stop`})]}),(0,I.jsx)(k2,{folder:o,open:v,onClose:()=>{y(!1)},onCreated:u}),(0,I.jsx)(G2,{open:b,onClose:()=>{x(!1)},onLoad:f}),(0,I.jsx)(Q2,{open:S,onClose:()=>{C(!1)},folder:e,onFolderChange:t,onOpen:n,onBrowse:i===void 0?void 0:()=>{i()},browsing:a})]})}function i4(){let[e]=(0,F.useState)(()=>VO());return(0,I.jsx)(ME,{client:e,children:(0,I.jsx)(tn,{value:Cw,children:(0,I.jsx)(a4,{})})})}function a4(){let e=BO();ck();let t=K(e=>e.folder),n=K(e=>e.openFolder),r=K(e=>e.selectedRecipeId),i=K(e=>e.editorTab),a=K(e=>e.setFolder),o=K(e=>e.commitFolder),s=K(e=>e.selectRecipe),c=K(e=>e.setEditorTab),l=K(e=>e.hoveredStepId),u=K(e=>e.setHoveredStepId),d=UO(n),f=nk(),p=tk(),m=QO(e=>e.running),h=QO(e=>e.records),g=QO(e=>e.rejected),_=QO(e=>e.traceLines),v=QO(e=>e.error),y=ok(),b=v2(e=>e.entries),x=sk(),S=rk(),C=ak(),w=fk(),T=V2(),E=K2(),D=Y2(),ee=W2();(0,F.useEffect)(()=>{e.initialFolder!==void 0&&o(e.initialFolder)},[]),(0,F.useEffect)(()=>{if(r!==void 0||d.data===void 0)return;let e=d.data.recipes.find(e=>e.kind===`input`);e?.id!==void 0&&s(e.id)},[d.data,r,s]);let O=(0,F.useMemo)(()=>{if(p!==void 0&&p.kind===`input`)try{let e=JSON.parse(p.text).output;return d.data?.recipes.find(t=>t.kind===`output`&&t.id===e)}catch{return}},[p,d.data]),k=(0,F.useMemo)(()=>{if(p===void 0||p.kind!==`input`)return{};try{let e=JSON.parse(p.text).mapping;return e===void 0?{}:z0(e)}catch{return{}}},[p]),A=Object.keys(k).find(e=>k[e]===l&&l!==void 0),te=(0,F.useMemo)(()=>q2(),[]),ne=te===void 0?void 0:()=>{te.chooseFolder()},re=e=>{w.mutate(e)},j=ee??T.error??E.error??D.error??o4(d.error)??v,ie=T.notice??E.notice;return(0,I.jsx)(DA.Provider,{value:d.data?.hooks?.names,children:(0,I.jsxs)(N2,{onFile:e=>{T.importFile(e)},h:`100vh`,display:`flex`,flexDirection:`column`,children:[(0,I.jsx)(r4,{folder:t,onFolderChange:a,onOpen:()=>{o(t)},onChooseFolder:ne,onBrowse:D.browse,browsing:D.pending,openFolder:n,inputs:f,selectedRecipeId:r,onSelectRecipe:s,onRecipeCreated:s,onImportFile:e=>{T.importFile(e)},onLoadUrl:e=>{E.loadUrl(e)},importing:T.pending||E.pending,running:m,onRunSample:()=>{r!==void 0&&y.mutate({recipeId:r,stubs:_2(b)})},onStop:()=>{x.mutate()}}),(0,I.jsx)(J2,{hooks:d.data?.hooks}),ie!==void 0&&j===void 0&&(0,I.jsx)(L,{role:`status`,px:4,py:1,bg:`blue.subtle`,color:`blue.fg`,fontSize:`sm`,children:ie}),j!==void 0&&(0,I.jsx)(L,{px:4,py:1,bg:`red.subtle`,color:`red.fg`,fontSize:`sm`,children:j}),(0,I.jsxs)($T,{orientation:`vertical`,panels:[{id:`workspace`,minSize:20},{id:`preview`,minSize:10}],defaultSize:[70,30],flex:`1`,minH:`0`,children:[(0,I.jsx)(eE,{id:`workspace`,overflow:`hidden`,children:(0,I.jsxs)($T,{panels:[{id:`content`,minSize:20},{id:`editor`,minSize:20}],h:`full`,children:[(0,I.jsx)(eE,{id:`content`,overflow:`auto`,children:(0,I.jsx)(wF,{recipe:p,onSaveOutline:async(e,t)=>{await C.mutateAsync({path:e,outline:t})},onSaveRecipe:async(e,t)=>{await S.mutateAsync({path:e,recipe:t})}})}),(0,I.jsx)(rE,{id:`content:editor`}),(0,I.jsxs)(eE,{id:`editor`,overflow:`hidden`,display:`flex`,flexDirection:`column`,children:[(0,I.jsxs)(G,{gap:1,px:2,pt:2,borderBottomWidth:`1px`,flexShrink:0,children:[(0,I.jsx)(l4,{label:`Steps`,active:i===`steps`,onClick:()=>{c(`steps`)}}),(0,I.jsx)(l4,{label:`Record`,active:i===`record`,onClick:()=>{c(`record`)},switchOnDrag:!0}),(0,I.jsx)(l4,{label:`JSON`,active:i===`json`,onClick:()=>{c(`json`)}})]}),(0,I.jsxs)(L,{flex:`1`,minH:`0`,overflow:`auto`,children:[i===`steps`&&(0,I.jsx)(FM,{recipe:p,onSaveOutline:async(e,t)=>{await C.mutateAsync({path:e,outline:t})}}),i===`record`&&(0,I.jsx)(p2,{inputRecipe:p,outputRecipe:O,records:h,rejected:g,onSaveInput:async(e,t)=>{await S.mutateAsync({path:e,recipe:t})},onSaveOutput:async(e,t)=>{await S.mutateAsync({path:e,recipe:t})},onSaveOutline:async(e,t)=>{await C.mutateAsync({path:e,outline:t})},onExplainMissing:r===void 0?void 0:(e,t)=>{re({kind:`missing`,recipeId:r,recordIndex:e,field:t})},onExplainRejected:r===void 0?void 0:e=>{re({kind:`rejected`,recipeId:r,rejectedIndex:e})}}),i===`json`&&(0,I.jsx)(f0,{recipe:p,onSave:async(e,t)=>{await S.mutateAsync({path:e,recipe:t})}})]})]})]})}),(0,I.jsx)(rE,{id:`workspace:preview`}),(0,I.jsx)(eE,{id:`preview`,overflow:`hidden`,borderTopWidth:`1px`,children:(0,I.jsx)(F0,{records:h,traceLines:_,rejected:g,onExplainMissing:r===void 0?void 0:(e,t)=>{re({kind:`missing`,recipeId:r,recordIndex:e,field:t})},onExplainRejected:r===void 0?void 0:e=>{re({kind:`rejected`,recipeId:r,rejectedIndex:e})},whyLoading:w.isPending,whyView:w.data,whyError:o4(w.error),highlightedField:A,onHoverField:e=>{u(e===void 0?void 0:k[e])}})})]})]})})}function o4(e){if(e!=null)return e instanceof Error?e.message:String(e)}function s4(e){let t=new Set(e.dataTransfer.types);return t.has(`application/x-opencraw-pill`)||t.has(`application/x-opencraw-card`)}var c4=450;function l4({label:e,active:t,onClick:n,switchOnDrag:r=!1}){let i=(0,F.useRef)(void 0),a=()=>{i.current!==void 0&&clearTimeout(i.current),i.current=void 0},o=e=>{r&&!t&&s4(e)&&(e.preventDefault(),i.current??=setTimeout(()=>{i.current=void 0,n()},c4))};return(0,I.jsx)(H,{as:`button`,px:3,py:1,fontSize:`sm`,fontWeight:t?`semibold`:`normal`,color:t?`fg`:`fg.muted`,borderBottomWidth:`2px`,borderColor:t?`colorPalette.solid`:`transparent`,colorPalette:`blue`,cursor:`pointer`,onClick:n,onDragEnter:o,onDragOver:o,onDragLeave:a,onDrop:a,children:e})}tt.createRoot(document.getElementById(`root`)).render((0,I.jsx)(F.StrictMode,{children:(0,I.jsx)(i4,{})}));export{jP as t};
|