@samva/vite 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,32 @@
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 O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(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 P(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,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+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+M(a,u),c+=P(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+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(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 F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(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 L=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 R(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,L)}catch(e){L(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function z(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 R(z.bind(null,e))}var B={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=B,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=z,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=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=R,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,O());else{var t=n(l);t!==null&&j(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&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(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,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),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,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),P=Symbol.for(`react.consumer`),F=Symbol.for(`react.context`),I=Symbol.for(`react.forward_ref`),L=Symbol.for(`react.suspense`),R=Symbol.for(`react.suspense_list`),z=Symbol.for(`react.memo`),B=Symbol.for(`react.lazy`),V=Symbol.for(`react.activity`),ee=Symbol.for(`react.legacy_hidden`),te=Symbol.for(`react.memo_cache_sentinel`),ne=Symbol.for(`react.view_transition`),H=Symbol.for(`react.recoverable`),re=Symbol.iterator;function ie(e){return typeof e!=`object`||!e?null:(e=re&&e[re]||e[`@@iterator`],typeof e==`function`?e:null)}var ae=Symbol.for(`react.client.reference`);function oe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case L:return`Suspense`;case R:return`SuspenseList`;case V:return`Activity`;case ne:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case F:return e.displayName||`Context`;case P:return(e._context.displayName||`Context`)+`.Consumer`;case I:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case z:return t=e.displayName||null,t===null?oe(e.type)||`Memo`:t;case B:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}var se=Array.isArray,U=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},le=[],ue=-1;function de(e){return{current:e}}function fe(e){0>ue||(e.current=le[ue],le[ue]=null,ue--)}function pe(e,t){ue++,le[ue]=e.current,e.current=t}var me=de(null),he=de(null),ge=de(null),_e=de(null);function ve(e,t){switch(pe(ge,t),pe(he,e),pe(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?G(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=G(t),e=yp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}fe(me),pe(me,e)}function ye(){fe(me),fe(he),fe(ge)}function be(e){var t=e.memoizedState;t!==null&&(hh._currentValue=t.memoizedState,pe(_e,e)),t=me.current;var n=yp(t,e.type);t!==n&&(pe(he,e),pe(me,n))}function xe(e){he.current===e&&(fe(me),fe(he)),_e.current===e&&(fe(_e),hh._currentValue=ce)}var Se,Ce;function we(e){if(Se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Se=t&&t[1]||``,Ce=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+Se+e+Ce}var Te=!1;function Ee(e,t){if(!e||Te)return``;Te=!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{Te=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?we(n):``}function De(e,t){switch(e.tag){case 26:case 27:case 5:return we(e.type);case 16:return we(`Lazy`);case 13:return e.child!==t&&t!==null?we(`Suspense Fallback`):we(`Suspense`);case 19:return we(`SuspenseList`);case 0:case 15:return Ee(e.type,!1);case 11:return Ee(e.type.render,!1);case 1:return Ee(e.type,!0);case 31:return we(`Activity`);case 30:return we(`ViewTransition`);default:return``}}function Oe(e){try{var t=``,n=null;do t+=De(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var ke=Object.prototype.hasOwnProperty,Ae=t.unstable_scheduleCallback,je=t.unstable_cancelCallback,Me=t.unstable_shouldYield,Ne=t.unstable_requestPaint,Pe=t.unstable_now,Fe=t.unstable_getCurrentPriorityLevel,Ie=t.unstable_ImmediatePriority,Le=t.unstable_UserBlockingPriority,Re=t.unstable_NormalPriority,ze=t.unstable_LowPriority,Be=t.unstable_IdlePriority,Ve=t.log,He=t.unstable_setDisableYieldValue,Ue=null,We=null;function Ge(e){if(typeof Ve==`function`&&He(e),We&&typeof We.setStrictMode==`function`)try{We.setStrictMode(Ue,e)}catch{}}var Ke=Math.clz32?Math.clz32:Ye,qe=Math.log,Je=Math.LN2;function Ye(e){return e>>>=0,e===0?32:31-(qe(e)/Je|0)|0}var Xe=256,Ze=262144,Qe=4194304;function $e(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 et(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=$e(n))):i=$e(o):i=$e(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=$e(n))):i=$e(o)):i=$e(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 tt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function nt(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-Ke(n),i=1<<r;t|=e[r],n&=~i}return t}function rt(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 it(){var e=Qe;return Qe<<=1,!(Qe&62914560)&&(Qe=4194304),e}function at(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ot(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function st(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-Ke(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&&ct(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ct(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ke(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function lt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ke(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ut(e,t){var n=t&-t;return n=n&42?1:dt(n),(n&(e.suspendedLanes|t))===0?n:0}function dt(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 ft(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function pt(){var e=W.p;return e===0?(e=window.event,e===void 0?32:jh(e.type)):e}function mt(e,t){var n=W.p;try{return W.p=e,t()}finally{W.p=n}}var ht=Math.random().toString(36).slice(2),gt=`__reactFiber$`+ht,_t=`__reactProps$`+ht,vt=`__reactContainer$`+ht,yt=`__reactEvents$`+ht,bt=`__reactListeners$`+ht,xt=`__reactHandles$`+ht,St=`__reactResources$`+ht,Ct=`__reactMarker$`+ht,wt=`__reactLoad$`+ht;function Tt(e){delete e[gt],delete e[_t],delete e[bt],delete e[xt]}function Et(e){var t;if(t=e[gt])return t;for(var n=e.parentNode;n;){if(t=n[vt]||n[gt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=bm(e);e!==null;){if(n=e[gt])return n;e=bm(e)}return t}e=n,n=e.parentNode}return null}function Dt(e){if(e=e[gt]||e[vt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ot(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function kt(e){var t=e[St];return t||=e[St]={hoistableStyles:new Map,hoistableScripts:new Map},t}function At(e){e[Ct]=!0}function jt(e){e[wt]=void 0}var Mt=new Set,Nt={};function Pt(e,t){Ft(e,t),Ft(e+`Capture`,t)}function Ft(e,t){for(Nt[e]=t,e=0;e<t.length;e++)Mt.add(t[e])}var It=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]*$`),Lt={},Rt={};function zt(e){return ke.call(Rt,e)?!0:ke.call(Lt,e)?!1:It.test(e)?Rt[e]=!0:(Lt[e]=!0,!1)}var Bt=!1;function Vt(){var e=Bt;return Bt=!1,e}function Ht(e,t,n){if(zt(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 Ut(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 Wt(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 Gt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Kt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function qt(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 Jt(e){if(!e._valueTracker){var t=Kt(e)?`checked`:`value`;e._valueTracker=qt(e,t,``+e[t])}}function Yt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Kt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Xt=/[\n"\\]/g;function Zt(e){return e.replace(Xt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Qt(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=``+Gt(t)):e.value!==``+Gt(t)&&(e.value=``+Gt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):en(e,Gt(n)):o===`number`&&e.value==t?en(e,Gt(e.value)):en(e,Gt(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=``+Gt(s):e.removeAttribute(`name`)}function $t(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)){Jt(e);return}n=n==null?``:``+Gt(n),t=t==null?n:``+Gt(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),Jt(e)}function en(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function tn(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=``+Gt(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 nn(e,t,n){if(t!=null&&(t=``+Gt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Gt(n)}function rn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(se(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Gt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Jt(e)}function an(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var on=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 sn(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||on.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function cn(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]=``,Bt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(sn(e,a,r),Bt=!0)}else for(var o in t)t.hasOwnProperty(o)&&sn(e,o,t[o])}function ln(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 un=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`]]),dn=/^[\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 fn(e){return dn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function pn(){}var mn=null;function hn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gn=null,_n=null;function vn(e){var t=Dt(e);if(t&&(e=t.stateNode)){var n=e[_t]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Qt(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="`+Zt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[_t]||null;if(!a)throw Error(i(90));Qt(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&&Yt(r)}break a;case`textarea`:nn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&tn(e,!!n.multiple,t,!1)}}}var yn=!1;function bn(e,t,n){if(yn)return e(t,n);yn=!0;try{return e(t)}finally{if(yn=!1,(gn!==null||_n!==null)&&(Gd(),gn&&(t=gn,e=_n,_n=gn=null,vn(t),e)))for(t=0;t<e.length;t++)vn(e[t])}}function xn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[_t]||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 Sn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),Cn=!1;if(Sn)try{var wn={};Object.defineProperty(wn,"passive",{get:function(){Cn=!0}}),window.addEventListener(`test`,wn,wn),window.removeEventListener(`test`,wn,wn)}catch{Cn=!1}var Tn=null,En=null,Dn=null;function On(){if(Dn)return Dn;var e,t=En,n=t.length,r,i=`value`in Tn?Tn.value:Tn.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 Dn=i.slice(e,1<r?1-r:void 0)}function kn(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 An(){return!0}function jn(){return!1}function Mn(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)?An:jn,this.isPropagationStopped=jn,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=An)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=An)},persist:function(){},isPersistent:An}),t}var Nn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pn=Mn(Nn),Fn=D({},Nn,{view:0,detail:0}),In=Mn(Fn),Ln,Rn,zn,Bn=D({},Fn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zn,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!==zn&&(zn&&e.type===`mousemove`?(Ln=e.screenX-zn.screenX,Rn=e.screenY-zn.screenY):Rn=Ln=0,zn=e),Ln)},movementY:function(e){return`movementY`in e?e.movementY:Rn}}),Vn=Mn(Bn),Hn=Mn(D({},Bn,{dataTransfer:0})),Un=Mn(D({},Fn,{relatedTarget:0})),Wn=Mn(D({},Nn,{animationName:0,elapsedTime:0,pseudoElement:0})),Gn=Mn(D({},Nn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Kn=Mn(D({},Nn,{data:0})),qn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Jn={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`},Yn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Xn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yn[e])?!!t[e]:!1}function Zn(){return Xn}var Qn=Mn(D({},Fn,{key:function(e){if(e.key){var t=qn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=kn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Jn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zn,charCode:function(e){return e.type===`keypress`?kn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?kn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),$n=Mn(D({},Bn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),er=Mn(D({},Nn,{submitter:0})),tr=Mn(D({},Fn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zn})),nr=Mn(D({},Nn,{propertyName:0,elapsedTime:0,pseudoElement:0})),rr=Mn(D({},Bn,{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})),ir=Mn(D({},Nn,{newState:0,oldState:0,source:0})),ar=[9,13,27,32],or=Sn&&`CompositionEvent`in window,sr=null;Sn&&`documentMode`in document&&(sr=document.documentMode);var cr=Sn&&`TextEvent`in window&&!sr,lr=Sn&&(!or||sr&&8<sr&&11>=sr),ur=` `,dr=!1;function fr(e,t){switch(e){case`keyup`:return ar.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function pr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var mr=!1;function hr(e,t){switch(e){case`compositionend`:return pr(t);case`keypress`:return t.which===32?(dr=!0,ur):null;case`textInput`:return e=t.data,e===ur&&dr?null:e;default:return null}}function gr(e,t){if(mr)return e===`compositionend`||!or&&fr(e,t)?(e=On(),Dn=En=Tn=null,mr=!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 lr&&t.locale!==`ko`?null:t.data;default:return null}}var _r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function vr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!_r[e.type]:t===`textarea`}function yr(e,t,n,r){gn?_n?_n.push(r):_n=[r]:gn=r,t=np(t,`onChange`),0<t.length&&(n=new Pn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var br=null,xr=null;function Sr(e){Jf(e,0)}function Cr(e){if(Yt(Ot(e)))return e}function wr(e,t){if(e===`change`)return t}var Tr=!1;if(Sn){var Er;if(Sn){var Dr=`oninput`in document;if(!Dr){var Or=document.createElement(`div`);Or.setAttribute(`oninput`,`return;`),Dr=typeof Or.oninput==`function`}Er=Dr}else Er=!1;Tr=Er&&(!document.documentMode||9<document.documentMode)}function kr(){br&&(br.detachEvent(`onpropertychange`,Ar),xr=br=null)}function Ar(e){if(e.propertyName===`value`&&Cr(xr)){var t=[];yr(t,xr,e,hn(e)),bn(Sr,t)}}function jr(e,t,n){e===`focusin`?(kr(),br=t,xr=n,br.attachEvent(`onpropertychange`,Ar)):e===`focusout`&&kr()}function Mr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Cr(xr)}function Nr(e,t){if(e===`click`)return Cr(t)}function Pr(e,t){if(e===`input`||e===`change`)return Cr(t)}function Fr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Ir=typeof Object.is==`function`?Object.is:Fr;function Lr(e,t){if(Ir(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(!ke.call(t,i)||!Ir(e[i],t[i]))return!1}return!0}function Rr(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 zr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Br(e,t){var n=zr(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=zr(n)}}function Vr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Vr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rr(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=Rr(e.document)}return t}function Ur(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 Wr=Sn&&`documentMode`in document&&11>=document.documentMode,Gr=null,Kr=null,qr=null,Jr=!1;function Yr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Jr||Gr==null||Gr!==Rr(r)||(r=Gr,`selectionStart`in r&&Ur(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}),qr&&Lr(qr,r)||(qr=r,r=np(Kr,`onSelect`),0<r.length&&(t=new Pn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Gr)))}function Xr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Zr={animationend:Xr(`Animation`,`AnimationEnd`),animationiteration:Xr(`Animation`,`AnimationIteration`),animationstart:Xr(`Animation`,`AnimationStart`),transitionrun:Xr(`Transition`,`TransitionRun`),transitionstart:Xr(`Transition`,`TransitionStart`),transitioncancel:Xr(`Transition`,`TransitionCancel`),transitionend:Xr(`Transition`,`TransitionEnd`)},Qr={},$r={};Sn&&($r=document.createElement(`div`).style,`AnimationEvent`in window||(delete Zr.animationend.animation,delete Zr.animationiteration.animation,delete Zr.animationstart.animation),`TransitionEvent`in window||delete Zr.transitionend.transition);function ei(e){if(Qr[e])return Qr[e];if(!Zr[e])return e;var t=Zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in $r)return Qr[e]=t[n];return e}var ti=ei(`animationend`),ni=ei(`animationiteration`),ri=ei(`animationstart`),ii=ei(`transitionrun`),ai=ei(`transitionstart`),oi=ei(`transitioncancel`),si=ei(`transitionend`),ci=new Map,li=`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(` `);li.push(`scrollEnd`);function ui(e,t){ci.set(e,t),Pt(t,[e])}var di=0;function fi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Ed.identifierPrefix;var n=di++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function pi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Pd;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 mi(e,t){return e=pi(e),t=pi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var hi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&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)},gi=[],_i=0,vi=0;function yi(){for(var e=_i,t=vi=_i=0;t<e;){var n=gi[t];gi[t++]=null;var r=gi[t];gi[t++]=null;var i=gi[t];gi[t++]=null;var a=gi[t];if(gi[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&&Ci(n,i,a)}}function bi(e,t,n,r){gi[_i++]=e,gi[_i++]=t,gi[_i++]=n,gi[_i++]=r,vi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function xi(e,t,n,r){return bi(e,t,n,r),wi(e)}function Si(e,t){return bi(e,null,null,t),wi(e)}function Ci(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-Ke(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function wi(e){if(50<Fd)throw Fd=0,Id=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ti={};function Ei(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 Di(e,t,n,r){return new Ei(e,t,n,r)}function Oi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ki(e,t){var n=e.alternate;return n===null?(n=Di(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 Ai(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 ji(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Oi(r)&&(s=1);else if(typeof r==`string`)s=th(e,n,me.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case V:return e=Di(31,n,t,a),e.elementType=V,e.lanes=o,e;case j:return Mi(n.children,a,o,t);case M:s=8,a|=24;break;case N:return e=Di(12,n,t,a|2),e.elementType=N,e.lanes=o,e;case L:return e=Di(13,n,t,a),e.elementType=L,e.lanes=o,e;case R:return e=Di(19,n,t,a),e.elementType=R,e.lanes=o,e;case ee:case ne:return e=a|32,e=Di(30,n,t,e),e.elementType=ne,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:s=10;break a;case P:s=9;break a;case I:s=11;break a;case z:s=14;break a;case B:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Di(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Mi(e,t,n,r){return e=Di(7,e,r,t),e.lanes=n,e}function Ni(e,t,n){return e=Di(6,e,null,t),e.lanes=n,e}function Pi(e){var t=Di(18,null,null,0);return t.stateNode=e,t}function Fi(e,t,n){return t=Di(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ii=new WeakMap;function Li(e,t){if(typeof e==`object`&&e){var n=Ii.get(e);return n===void 0?(t={value:e,source:t,stack:Oe(t)},Ii.set(e,t),t):n}return{value:e,source:t,stack:Oe(t)}}var Ri=[],zi=0,Bi=null,Vi=0,Hi=[],Ui=0,Wi=null,Gi=1,Ki=``;function qi(e,t){Ri[zi++]=Vi,Ri[zi++]=Bi,Bi=e,Vi=t}function Ji(e,t,n){Hi[Ui++]=Gi,Hi[Ui++]=Ki,Hi[Ui++]=Wi,Wi=e;var r=Gi;e=Ki;var i=32-Ke(r)-1;r&=~(1<<i),n+=1;var a=32-Ke(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Gi=1<<32-Ke(t)+i|n<<i|r,Ki=a+e}else Gi=1<<a|n<<i|r,Ki=e}function Yi(e){e.return!==null&&(qi(e,1),Ji(e,1,0))}function Xi(e){for(;e===Bi;)Bi=Ri[--zi],Ri[zi]=null,Vi=Ri[--zi],Ri[zi]=null;for(;e===Wi;)Wi=Hi[--Ui],Hi[Ui]=null,Ki=Hi[--Ui],Hi[Ui]=null,Gi=Hi[--Ui],Hi[Ui]=null}function Zi(e,t){Hi[Ui++]=Gi,Hi[Ui++]=Ki,Hi[Ui++]=Wi,Gi=t.id,Ki=t.overflow,Wi=e}var Qi=null,$i=null,ea=!1,ta=null,na=!1,ra=Error(i(519));function ia(e){throw ua(Li(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ra}function aa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[gt]=e,t[_t]=r,n){case`dialog`:Yf(`cancel`,t),Yf(`close`,t);break;case`iframe`:case`object`:case`embed`:Yf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Kf.length;n++)Yf(Kf[n],t);break;case`source`:Yf(`error`,t);break;case`img`:case`image`:case`link`:Yf(`error`,t),Yf(`load`,t);break;case`details`:Yf(`toggle`,t);break;case`input`:Yf(`invalid`,t),$t(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Yf(`invalid`,t);break;case`textarea`:Yf(`invalid`,t),rn(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||cp(t.textContent,n)?(r.popover!=null&&(Yf(`beforetoggle`,t),Yf(`toggle`,t)),r.onScroll!=null&&Yf(`scroll`,t),r.onScrollEnd!=null&&Yf(`scrollend`,t),r.onClick!=null&&(t.onclick=pn),t=!0):t=!1,t||ia(e,!0)}function oa(e){for(Qi=e.return;Qi;)switch(Qi.tag){case 5:case 31:case 13:na=!1;return;case 27:case 3:na=!0;return;default:Qi=Qi.return}}function sa(e){if(e!==Qi)return!1;if(!ea)return oa(e),ea=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||xp(e.type,e.memoizedProps)),n=!n),n&&$i&&ia(e),oa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));$i=ym(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));$i=ym(e)}else t===27?(t=$i,Ap(e.type)?(e=vm,vm=null,$i=e):$i=t):$i=Qi?_m(e.stateNode.nextSibling):null;return!0}function ca(){$i=Qi=null,ea=!1}function la(){var e=ta;return e!==null&&(vd===null?vd=e:vd.push.apply(vd,e),ta=null),e}function ua(e){ta===null?ta=[e]:ta.push(e)}var da=de(null),fa=null,pa=null;function ma(e,t,n){pe(da,t._currentValue),t._currentValue=n}function ha(e){e._currentValue=da.current,fe(da)}function ga(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 _a(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),ga(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),ga(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),ga(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 va(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;Ir(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===_e.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[hh]:e.push(hh))}a=a.return}return e!==null&&_a(t,e,n,r),t.flags|=262144,e!==null}function ya(e){for(e=e.firstContext;e!==null;){if(!Ir(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ba(e){fa=e,pa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xa(e){return Ca(fa,e)}function Sa(e,t){return fa===null&&ba(e),Ca(e,t)}function Ca(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},pa===null){if(e===null)throw Error(i(308));pa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else pa=pa.next=t;return n}var wa=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()})}},Ta=t.unstable_scheduleCallback,Ea=t.unstable_NormalPriority,Da={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Oa(){return{controller:new wa,data:new Map,refCount:0}}function ka(e){e.refCount--,e.refCount===0&&Ta(Ea,function(){e.controller.abort()})}function Aa(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 ja=null;function Ma(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Na=null,Pa=0,Fa=0,Ia=null;function La(e,t){if(Na===null){var n=Na=[];Pa=0,Fa=Vf(),Ia={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Pa++,t.then(Ra,Ra),t}function Ra(){if(--Pa===0&&(ja=null,Na!==null)){Ia!==null&&(Ia.status=`fulfilled`);var e=Na;Na=null,Fa=0,Ia=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function za(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 Ba=U.S;U.S=function(e,t){if(xd=Pe(),typeof t==`object`&&t&&typeof t.then==`function`&&La(e,t),ja!==null)for(var n=Df;n!==null;)Aa(n,ja),n=n.next;if(n=e.types,n!==null){for(var r=Df;r!==null;)Aa(r,n),r=r.next;if(Fa!==0){r=ja,r===null&&(r=ja=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ba!==null&&Ba(e,t)};var Va=de(null);function Ha(){var e=Va.current;return e===null?nd.pooledCache:e}function Ua(e,t){t===null?pe(Va,Va.current):pe(Va,t.pool)}function Wa(){var e=Ha();return e===null?null:{parent:Da._currentValue,pool:e}}var Ga=Error(i(460)),Ka=Error(i(474)),qa=Error(i(542)),Ja={then:function(){}};function Ya(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Xa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(pn,pn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,eo(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(pn,pn);else{if(e=nd,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,eo(e),e}throw Qa=t,Ga}}function Za(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Qa=e,Ga):e}}var Qa=null;function $a(){if(Qa===null)throw Error(i(459));var e=Qa;return Qa=null,e}function eo(e){if(e===Ga||e===qa)throw Error(i(483))}var to=null,no=0;function ro(e){var t=no;return no+=1,to===null&&(to=[]),Xa(to,e,t)}function io(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ao(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function oo(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=ki(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=Ni(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===j?(e=d(e,t,n.props.children,r,n.key),io(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===B&&Za(i)===t.type)?(t=a(t,n.props),io(t,n),t.return=e,t):(t=ji(n.type,n.key,n.props,null,e.mode,r),io(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=Fi(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=Mi(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=Ni(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=ji(t.type,t.key,t.props,null,e.mode,n),io(n,t),n.return=e,n;case A:return t=Fi(t,e.mode,n),t.return=e,t;case B:return t=Za(t),f(e,t,n)}if(se(t)||ie(t))return t=Mi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ro(t),n);if(t.$$typeof===F)return f(e,Sa(e,t),n);ao(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 k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case B:return n=Za(n),p(e,t,n,r)}if(se(n)||ie(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ro(n),r);if(n.$$typeof===F)return p(e,t,Sa(e,n),r);ao(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 k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case B:return r=Za(r),m(e,t,n,r,i)}if(se(r)||ie(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ro(r),i);if(r.$$typeof===F)return m(e,t,n,Sa(t,r),i);ao(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),ea&&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 ea&&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)}),ea&&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),ea&&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 ea&&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)}),ea&&qi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),io(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===B&&Za(l)===r.type){n(e,r.sibling),c=a(r,o.props),io(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Mi(o.props.children,e.mode,c,o.key),io(c,o),c.return=e,e=c):(c=ji(o.type,o.key,o.props,null,e.mode,c),io(c,o),c.return=e,e=c)}return s(e);case A: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=Fi(o,e.mode,c),c.return=e,e=c}return s(e);case B:return o=Za(o),_(e,r,o,c)}if(se(o))return h(e,r,o,c);if(ie(o)){if(l=ie(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,ro(o),c);if(o.$$typeof===F)return _(e,r,Sa(e,o),c);ao(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=Ni(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{no=0;var i=_(e,t,n,r);return to=null,i}catch(t){if(t===Ga||t===qa)throw t;var a=Di(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var so=oo(!0),co=oo(!1),lo=!1;function uo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fo(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 po(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function mo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,td&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=wi(e),Ci(e,null,n),t}return bi(e,r,t,n),wi(e)}function ho(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,lt(e,n)}}function go(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 _o=!1;function vo(){if(_o){var e=Ia;if(e!==null)throw e}}function yo(e,t,n,r){_o=!1;var i=e.updateQueue;lo=!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?(id&f)===f:(r&f)===f){f!==0&&f===Fa&&(_o=!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:lo=!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),fd|=o,e.lanes=o,e.memoizedState=d}}function bo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function xo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)bo(n[e],t)}var So=de(null),Co=de(0);function wo(e,t){e=ud,pe(Co,e),pe(So,t),ud=e|t.baseLanes}function To(){pe(Co,ud),pe(So,So.current)}function Eo(){ud=Co.current,fe(So),fe(Co)}var Do=de(null),Oo=null;function ko(e){var t=e.alternate;pe(Po,Po.current&1),pe(Do,e),Oo===null&&(t===null||So.current!==null||t.memoizedState!==null)&&(Oo=e)}function Ao(e){pe(Po,Po.current),pe(Do,e),Oo===null&&(Oo=e)}function jo(e){e.tag===22?(pe(Po,Po.current),pe(Do,e),Oo===null&&(Oo=e)):Mo()}function Mo(){pe(Po,Po.current),pe(Do,Do.current)}function No(e){fe(Do),Oo===e&&(Oo=null),fe(Po)}var Po=de(0);function Fo(e,t){pe(Do,Do.current),pe(Po,t)}function Io(e){fe(Po),fe(Do),Oo===e&&(Oo=null)}function Lo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||mm(n)||hm(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 Ro=0,zo=null,Bo=null,Vo=null,Ho=!1,Uo=!1,Wo=!1,Go=0,Ko=0,qo=null,Jo=0;function Yo(){throw Error(i(321))}function Xo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ir(e[n],t[n]))return!1;return!0}function Zo(e,t,n,r,i,a){return Ro=a,zo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?mc:hc,Wo=!1,a=n(r,i),Wo=!1,Uo&&(a=$o(t,n,r,i)),Qo(e),a}function Qo(e){U.H=pc;var t=Bo!==null&&Bo.next!==null;if(Ro=0,Vo=Bo=zo=null,Ho=!1,Ko=0,qo=null,t)throw Error(i(300));e===null||Mc||(e=e.dependencies,e!==null&&ya(e)&&(Mc=!0))}function $o(e,t,n,r){zo=e;var a=0;do{if(Uo&&(qo=null),Ko=0,Uo=!1,25<=a)throw Error(i(301));if(a+=1,Vo=Bo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}U.H=gc,o=t(n,r)}while(Uo);return o}function es(){var e=U.H,t=e.useState()[0];return t=typeof t.then==`function`?ss(t):t,e=e.useState()[0],(Bo===null?null:Bo.memoizedState)!==e&&(zo.flags|=1024),t}function ts(){var e=Go!==0;return Go=0,e}function ns(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function rs(e){if(Ho){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ho=!1}Ro=0,Vo=Bo=zo=null,Uo=!1,Ko=Go=0,qo=null}function is(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vo===null?zo.memoizedState=Vo=e:Vo=Vo.next=e,Vo}function as(){if(Bo===null){var e=zo.alternate;e=e===null?null:e.memoizedState}else e=Bo.next;var t=Vo===null?zo.memoizedState:Vo.next;if(t!==null)Vo=t,Bo=e;else{if(e===null)throw zo.alternate===null?Error(i(467)):Error(i(310));Bo=e,e={memoizedState:Bo.memoizedState,baseState:Bo.baseState,baseQueue:Bo.baseQueue,queue:Bo.queue,next:null},Vo===null?zo.memoizedState=Vo=e:Vo=Vo.next=e}return Vo}function os(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ss(e){var t=Ko;return Ko+=1,qo===null&&(qo=[]),e=Xa(qo,e,t),t=zo,(Vo===null?t.memoizedState:Vo.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?mc:hc),e}function cs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ss(e);if(e.$$typeof===H)return;if(e.$$typeof===F)return xa(e)}throw Error(i(438,String(e)))}function ls(e){var t=null,n=zo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=zo.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=os(),zo.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]=te;return t.index++,n}function us(e,t){return typeof t==`function`?t(e):t}function ds(e){return fs(as(),Bo,e)}function fs(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?(Ro&f)===f:(id&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===Fa&&(d=!0);else if((Ro&p)===p){u=u.next,p===Fa&&(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,zo.lanes|=p,fd|=p;f=u.action,Wo&&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,zo.lanes|=f,fd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Ir(o,e.memoizedState)&&(Mc=!0,d&&(n=Ia,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 ps(e){var t=as(),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);Ir(o,t.memoizedState)||(Mc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ms(e,t,n){var r=zo,a=as(),o=ea;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Ir((Bo||a).memoizedState,n);if(s&&(a.memoizedState=n,Mc=!0),a=a.queue,zs(_s.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Vo!==null&&!!(Vo.memoizedState.tag&1),Ps(e?9:8,{destroy:void 0},gs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,nd===null)throw Error(i(349));o||Ro&127||hs(r,t,n)}return n}function hs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=zo.updateQueue,t===null?(t=os(),zo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function gs(e,t,n,r){t.value=n,t.getSnapshot=r,vs(t)&&ys(e)}function _s(e,t,n){return n(function(){vs(t)&&ys(e)})}function vs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ir(e,n)}catch{return!0}}function ys(e){var t=Si(e,2);t!==null&&Bd(t,e,2)}function bs(e){var t=is();if(typeof e==`function`){var n=e;if(e=n(),Wo){Ge(!0);try{n()}finally{Ge(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:us,lastRenderedState:e},t}function xs(e,t,n,r){return e.baseState=n,fs(e,Bo,typeof r==`function`?r:us)}function Ss(e,t,n,r,a){if(uc(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)}};U.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Cs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Cs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=U.T,o={};o.types=a===null?null:a.types,U.T=o;try{var s=n(i,r),c=U.S;c!==null&&c(o,s),ws(e,t,s)}catch(n){Es(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),U.T=a}}else try{a=n(i,r),ws(e,t,a)}catch(n){Es(e,t,n)}}function ws(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ts(e,t,n)},function(n){return Es(e,t,n)}):Ts(e,t,n)}function Ts(e,t,n){t.status=`fulfilled`,t.value=n,Ds(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Cs(e,n)))}function Es(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ds(t),t=t.next;while(t!==r)}e.action=null}function Ds(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Os(e,t){return t}function ks(e,t){if(ea){var n=nd.formState;if(n!==null){a:{var r=zo;if(ea){if($i){b:{for(var i=$i,a=na;i.nodeType!==8;){if(!a){i=null;break b}if(i=_m(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){$i=_m(i.nextSibling),r=i.data===`F!`;break a}}ia(r)}r=!1}r&&(t=n[0])}}return n=is(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:t},n.queue=r,n=sc.bind(null,zo,r),r.dispatch=n,r=bs(!1),a=lc.bind(null,zo,!1,r.queue),r=is(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ss.bind(null,zo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function As(e){return js(as(),Bo,e)}function js(e,t,n){if(t=fs(e,t,Os)[0],e=ds(us)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ss(t)}catch(e){throw e===Ga?qa:e}else r=t;t=as();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(zo.flags|=2048,Ps(9,{destroy:void 0},Ms.bind(null,i,n),null)),[r,a,e]}function Ms(e,t){e.action=t}function Ns(e){var t=as(),n=Bo;if(n!==null)return js(t,n,e);as(),t=t.memoizedState,n=as();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ps(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=zo.updateQueue,t===null&&(t=os(),zo.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 Fs(){return as().memoizedState}function Is(e,t,n,r){var i=is();zo.flags|=e,i.memoizedState=Ps(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ls(e,t,n,r){var i=as();r=r===void 0?null:r;var a=i.memoizedState.inst;Bo!==null&&r!==null&&Xo(r,Bo.memoizedState.deps)?i.memoizedState=Ps(t,a,n,r):(zo.flags|=e,i.memoizedState=Ps(1|t,a,n,r))}function Rs(e,t){Is(8390656,8,e,t)}function zs(e,t){Ls(2048,8,e,t)}function Bs(e){zo.flags|=4;var t=zo.updateQueue;if(t===null)t=os(),zo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Vs(e){var t=as().memoizedState;return Bs({ref:t,nextImpl:e}),function(){if(td&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Hs(e,t){return Ls(4,2,e,t)}function Us(e,t){return Ls(4,4,e,t)}function Ws(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 Gs(e,t,n){n=n==null?null:n.concat([e]),Ls(4,4,Ws.bind(null,t,e),n)}function Ks(){}function qs(e,t){var n=as();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Xo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Js(e,t){var n=as();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Xo(t,r[1]))return r[0];if(r=e(),Wo){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[r,t],r}function Ys(e,t,n){return n===void 0||Ro&1073741824&&!(id&261930)?e.memoizedState=t:(e.memoizedState=n,e=Rd(),zo.lanes|=e,fd|=e,n)}function Xs(e,t,n,r){return Ir(n,t)?n:So.current===null?!(Ro&106)||Ro&1073741824&&!(id&261930)?(Mc=!0,e.memoizedState=n):(e=Rd(),zo.lanes|=e,fd|=e,t):(e=Ys(e,n,r),Ir(e,t)||(Mc=!0),e)}function Zs(e,t,n,r,i){var a=W.p;W.p=a!==0&&8>a?a:8;var o=U.T,s={};s.types=o===null?null:o.types,U.T=s,lc(e,!1,t,n);try{var c=i(),l=U.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?cc(e,t,za(c,r),Ld(e)):cc(e,t,r,Ld(e))}catch(n){cc(e,t,{then:function(){},status:`rejected`,reason:n},Ld())}finally{W.p=a,o!==null&&s.types!==null&&(o.types=s.types),U.T=o}}function Qs(){}function $s(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ec(e).queue;Zs(e,a,t,ce,n===null?Qs:function(){return tc(e),n(r)})}function ec(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:us,lastRenderedState:ce},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:us,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function tc(e){var t=ec(e);t.next===null&&(t=e.alternate.memoizedState),cc(e,t.next.queue,{},Ld())}function nc(){return xa(hh)}function rc(){return as().memoizedState}function ic(){return as().memoizedState}function ac(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ld();e=po(n);var r=mo(t,e,n);r!==null&&(Bd(r,t,n),ho(r,t,n)),t={cache:Oa()},e.payload=t;return}t=t.return}}function oc(e,t,n){var r=Ld();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},uc(e)?dc(t,n):(n=xi(e,t,n,r),n!==null&&(Bd(n,e,r),fc(n,t,r)))}function sc(e,t,n){cc(e,t,n,Ld())}function cc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(uc(e))dc(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,Ir(s,o))return bi(e,t,i,0),nd===null&&yi(),!1}catch{}if(n=xi(e,t,i,r),n!==null)return Bd(n,e,r),fc(n,t,r),!0}return!1}function lc(e,t,n,r){if(r={lane:2,revertLane:Vf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},uc(e)){if(t)throw Error(i(479))}else t=xi(e,n,r,2),t!==null&&Bd(t,e,2)}function uc(e){var t=e.alternate;return e===zo||t!==null&&t===zo}function dc(e,t){Uo=Ho=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function fc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lt(e,n)}}var pc={readContext:xa,use:cs,useCallback:Yo,useContext:Yo,useEffect:Yo,useImperativeHandle:Yo,useLayoutEffect:Yo,useInsertionEffect:Yo,useMemo:Yo,useReducer:Yo,useRef:Yo,useState:Yo,useDebugValue:Yo,useDeferredValue:Yo,useTransition:Yo,useSyncExternalStore:Yo,useId:Yo,useHostTransitionStatus:Yo,useFormState:Yo,useActionState:Yo,useOptimistic:Yo,useMemoCache:Yo,useCacheRefresh:Yo,useEffectEvent:Yo},mc={readContext:xa,use:cs,useCallback:function(e,t){return is().memoizedState=[e,t===void 0?null:t],e},useContext:xa,useEffect:Rs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Is(4194308,4,Ws.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Is(4194308,4,e,t)},useInsertionEffect:function(e,t){Is(4,2,e,t)},useMemo:function(e,t){var n=is();t=t===void 0?null:t;var r=e();if(Wo){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=is();if(n!==void 0){var i=n(t);if(Wo){Ge(!0);try{n(t)}finally{Ge(!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=oc.bind(null,zo,e),[r.memoizedState,e]},useRef:function(e){var t=is();return e={current:e},t.memoizedState=e},useState:function(e){e=bs(e);var t=e.queue,n=sc.bind(null,zo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ks,useDeferredValue:function(e,t){return Ys(is(),e,t)},useTransition:function(){var e=bs(!1);return e=Zs.bind(null,zo,e.queue,!0,!1),is().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=zo,a=is();if(ea){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),nd===null)throw Error(i(349));id&127||hs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Rs(_s.bind(null,r,o,e),[e]),r.flags|=2048,Ps(9,{destroy:void 0},gs.bind(null,r,o,n,t),null),n},useId:function(){var e=is(),t=nd.identifierPrefix;if(ea){var n=Ki,r=Gi;n=(r&~(1<<32-Ke(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Go++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Jo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:nc,useFormState:ks,useActionState:ks,useOptimistic:function(e){var t=is();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=lc.bind(null,zo,!0,n),n.dispatch=t,[e,t]},useMemoCache:ls,useCacheRefresh:function(){return is().memoizedState=ac.bind(null,zo)},useEffectEvent:function(e){var t=is(),n={impl:e};return t.memoizedState=n,function(){if(td&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},hc={readContext:xa,use:cs,useCallback:qs,useContext:xa,useEffect:zs,useImperativeHandle:Gs,useInsertionEffect:Hs,useLayoutEffect:Us,useMemo:Js,useReducer:ds,useRef:Fs,useState:function(){return ds(us)},useDebugValue:Ks,useDeferredValue:function(e,t){return Xs(as(),Bo.memoizedState,e,t)},useTransition:function(){var e=ds(us)[0],t=as().memoizedState;return[typeof e==`boolean`?e:ss(e),t]},useSyncExternalStore:ms,useId:rc,useHostTransitionStatus:nc,useFormState:As,useActionState:As,useOptimistic:function(e,t){return xs(as(),Bo,e,t)},useMemoCache:ls,useCacheRefresh:ic,useEffectEvent:Vs},gc={readContext:xa,use:cs,useCallback:qs,useContext:xa,useEffect:zs,useImperativeHandle:Gs,useInsertionEffect:Hs,useLayoutEffect:Us,useMemo:Js,useReducer:ps,useRef:Fs,useState:function(){return ps(us)},useDebugValue:Ks,useDeferredValue:function(e,t){var n=as();return Bo===null?Ys(n,e,t):Xs(n,Bo.memoizedState,e,t)},useTransition:function(){var e=ps(us)[0],t=as().memoizedState;return[typeof e==`boolean`?e:ss(e),t]},useSyncExternalStore:ms,useId:rc,useHostTransitionStatus:nc,useFormState:Ns,useActionState:Ns,useOptimistic:function(e,t){var n=as();return Bo===null?(n.baseState=e,[e,n.queue.dispatch]):xs(n,Bo,e,t)},useMemoCache:ls,useCacheRefresh:ic,useEffectEvent:Vs};function _c(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 vc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ld(),i=po(r);i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Bd(t,e,r),ho(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ld(),i=po(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=mo(e,i,r),t!==null&&(Bd(t,e,r),ho(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ld(),r=po(n);r.tag=2,t!=null&&(r.callback=t),t=mo(e,r,n),t!==null&&(Bd(t,e,n),ho(t,e,n))}};function yc(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?!Lr(n,r)||!Lr(i,a):!0}function bc(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&&vc.enqueueReplaceState(t,t.state,null)}function xc(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 Sc(e){hi(e)}function Cc(e){console.error(e)}function wc(e){hi(e)}function Tc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ec(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 Dc(e,t,n){return n=po(n),n.tag=3,n.payload={element:null},n.callback=function(){Tc(e,t)},n}function Oc(e){return e=po(e),e.tag=3,e}function kc(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(){Ec(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ec(t,n,r),typeof i!=`function`&&(wd===null?wd=new Set([this]):wd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Ac(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&va(t,n,a,!0),n=Do.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Oo===null?Qd():n.alternate===null&&dd===0&&(dd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ja?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),xf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ja?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)),xf(e,r,a)),!1}throw Error(i(435,n.tag))}return xf(e,r,a),Qd(),!1}if(ea)return t=Do.current,t===null?(r!==ra&&(t=Error(i(423),{cause:r}),ua(Li(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Li(r,n),a=Dc(e.stateNode,r,a),go(e,a),dd!==4&&(dd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ra&&(e=Error(i(422),{cause:r}),ua(Li(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Li(o,n),_d===null?_d=[o]:_d.push(o),dd!==4&&(dd=2),t===null)return!0;r=Li(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Dc(n.stateNode,r,e),go(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`&&(wd===null||!wd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Oc(a),kc(a,e,n,r),go(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var jc=Error(i(461)),Mc=!1;function Nc(e,t,n,r){t.child=e===null?co(t,null,n,r):so(t,e.child,n,r)}function Pc(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 ba(t),r=Zo(e,t,n,o,a,i),s=ts(),e!==null&&!Mc?(ns(e,t,i),cl(e,t,i)):(ea&&s&&Yi(t),t.flags|=1,Nc(e,t,r,i),t.child)}function Fc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Oi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Ic(e,t,a,r,i)):(e=ji(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ll(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Lr:n,n(o,r)&&e.ref===t.ref)return cl(e,t,i)}return t.flags|=1,e=ki(a,r),e.ref=t.ref,e.return=t,t.child=e}function Ic(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Lr(a,r)&&e.ref===t.ref){if(Mc=!1,t.pendingProps=r=a,ll(e,i))e.flags&131072&&(Mc=!0);else return t.lanes=e.lanes,cl(e,t,i)}}return Wc(e,t,n,r,i)}function Lc(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 zc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ua(t,a===null?null:a.cachePool),a===null?To():wo(t,a),jo(t);else return r=t.lanes=536870912,zc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ua(t,null),To(),Mo()):(Ua(t,a.cachePool),wo(t,a),Mo(),t.memoizedState=null);return Nc(e,t,i,n),t.child}function Rc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function zc(e,t,n,r,i){var a=Ha();return a=a===null?null:{parent:Da._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ua(t,null),To(),jo(t),e!==null&&va(e,t,r,!0),t.childLanes=i,null}function Bc(e,t){return t=$c({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Vc(e,t,n){return so(t,e.child,null,n),e=Bc(t,t.pendingProps),e.flags|=2,No(t),t.memoizedState=null,e}function Hc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(ea){if(r.mode===`hidden`)return e=Bc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Rc(null,e);if(Ao(t),(e=$i)?(e=pm(e,na),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wi===null?null:{id:Gi,overflow:Ki},retryLane:536870912,hydrationErrors:null},n=Pi(e),n.return=t,t.child=n,Qi=t,$i=null)):e=null,e===null)throw ia(t);return t.lanes=536870912,null}return Bc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Ao(t),a){if(t.flags&256)t.flags&=-257,t=Vc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Mc||va(e,t,n,!1),a=(n&e.childLanes)!==0,Mc||a){if(So.current===null){if(r=nd,r!==null&&(s=ut(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Si(e,s),Bd(r,e,s),jc;Qd()}t=Vc(e,t,n)}else e=o.treeContext,$i=_m(s.nextSibling),Qi=t,ea=!0,ta=null,na=!1,e!==null&&Zi(t,e),t=Bc(t,r),t.flags|=134221824;return t}return e=ki(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Uc(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 Wc(e,t,n,r,i){return ba(t),n=Zo(e,t,n,r,void 0,i),r=ts(),e!==null&&!Mc?(ns(e,t,i),cl(e,t,i)):(ea&&r&&Yi(t),t.flags|=1,Nc(e,t,n,i),t.child)}function Gc(e,t,n,r,i,a){return ba(t),t.updateQueue=null,n=$o(t,r,n,i),Qo(e),r=ts(),e!==null&&!Mc?(ns(e,t,a),cl(e,t,a)):(ea&&r&&Yi(t),t.flags|=1,Nc(e,t,n,a),t.child)}function Kc(e,t,n,r,i){if(ba(t),t.stateNode===null){var a=Ti,o=n.contextType;typeof o==`object`&&o&&(a=xa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=vc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},uo(t),o=n.contextType,a.context=typeof o==`object`&&o?xa(o):Ti,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(_c(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&&vc.enqueueReplaceState(a,a.state,null),yo(t,r,a,i),vo(),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=xc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ti,typeof u==`object`&&u&&(o=xa(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)&&bc(t,a,r,o),lo=!1;var f=t.memoizedState;a.state=f,yo(t,r,a,i),vo(),l=t.memoizedState,s||f!==l||lo?(typeof d==`function`&&(_c(t,n,d,r),l=t.memoizedState),(c=lo||yc(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,fo(e,t),o=t.memoizedProps,u=xc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ti,typeof l==`object`&&l&&(c=xa(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)&&bc(t,a,r,c),lo=!1,f=t.memoizedState,a.state=f,yo(t,r,a,i),vo();var p=t.memoizedState;o!==d||f!==p||lo||e!==null&&e.dependencies!==null&&ya(e.dependencies)?(typeof s==`function`&&(_c(t,n,s,r),p=t.memoizedState),(u=lo||yc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ya(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,Uc(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=so(t,e.child,null,i),t.child=so(t,null,n,i)):Nc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=cl(e,t,i),e}function qc(e,t,n,r){return ca(),t.flags|=256,Nc(e,t,n,r),t.child}var Jc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Yc(e){return{baseLanes:e,cachePool:Wa()}}function Xc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=hd),e}function Zc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Po.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(ea){if(i?ko(t):Mo(),(e=$i)?(e=pm(e,na),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wi===null?null:{id:Gi,overflow:Ki},retryLane:536870912,hydrationErrors:null},n=Pi(e),n.return=t,t.child=n,Qi=t,$i=null)):e=null,e===null)throw ia(t);return t.lanes=hm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Mo(),i=t.mode,a=$c({mode:`hidden`,children:a},i),r=Mi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Yc(n),r.childLanes=Xc(e,o,n),t.memoizedState=Jc,Rc(null,r)):(ko(t),Qc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return tl(e,t,a,o,r,c,s,n)}return i?(Mo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=ki(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Mi(i,a,n,null),i.flags|=2):i=ki(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Rc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Yc(n):(a=i.cachePool,a===null?a=Wa():(s=Da._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Xc(e,o,n),t.memoizedState=Jc,Rc(e.child,r)):(ko(t),n=e.child,e=n.sibling,n=ki(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 Qc(e,t){return t=$c({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function $c(e,t){return e=Di(22,e,null,t),e.lanes=0,e}function el(e,t,n){return so(t,e.child,null,n),e=Qc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function tl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(ko(t),t.flags&=-257,el(e,t,c)):t.memoizedState===null?(Mo(),o=a.fallback,s=t.mode,a=$c({mode:`visible`,children:a.children},s),o=Mi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,so(t,e.child,null,c),a=t.child,a.memoizedState=Yc(c),a.childLanes=Xc(e,r,c),t.memoizedState=Jc,Rc(null,a)):(Mo(),t.child=e.child,t.flags|=128,null);if(ko(t),hm(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,ua({value:a,source:null,stack:null})),el(e,t,c)}if(Mc||va(e,t,c,!1),r=(c&e.childLanes)!==0,Mc||r){if(So.current!==null)return el(e,t,c);if(r=nd,r!==null&&(a=ut(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Si(e,a),Bd(r,e,a),jc;return mm(o)||Qd(),el(e,t,c)}return mm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,$i=_m(o.nextSibling),Qi=t,ea=!0,ta=null,na=!1,e!==null&&Zi(t,e),t=Qc(t,a.children),t.flags|=134221824,t)}function nl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ga(e.return,t,n)}function rl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Lo(n)===null&&(t=e),e=e.sibling}return t}function il(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 al(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 ol(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Po.current;if(t.flags&128)return Fo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Fo(t,o),i===`backwards`&&e!==null?(al(e),Nc(e,t,r,n),al(e)):Nc(e,t,r,n),r=ea?Vi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&nl(e,n,t);else if(e.tag===19)nl(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=rl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,al(t)),il(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&&Lo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}il(t,!0,n,null,a,r);break;case`together`:il(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=rl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),il(t,!1,i,n,a,r)}return t.child}function sl(e,t,n){var r=t.pendingProps;return ma(t,t.type,r.value),Nc(e,t,r.children,n),t.child}function cl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),fd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(va(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=ki(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ki(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ll(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ya(e)))}function ul(e,t,n){switch(t.tag){case 3:ve(t,t.stateNode.containerInfo),ma(t,Da,e.memoizedState.cache),ca();break;case 27:case 5:be(t);break;case 4:ve(t,t.stateNode.containerInfo);break;case 10:ma(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ao(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return ko(t),t.flags|=128,null;r=va(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Zc(e,t,n):(ko(t),e=cl(e,t,n),e===null?null:e.sibling)}ko(t);break;case 19:if(t.flags&128)return ol(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(va(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return ol(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Fo(t,Po.current),r)break;return null;case 22:return t.lanes=0,Lc(e,t,n,t.pendingProps);case 24:ma(t,Da,e.memoizedState.cache)}return cl(e,t,n)}function dl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Mc=!0;else{if(!ll(e,n)&&!(t.flags&128))return Mc=!1,ul(e,t,n);Mc=!!(e.flags&131072)}}else Mc=!1,ea&&t.flags&1048576&&Ji(t,Vi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Za(t.elementType),t.type=e,typeof e==`function`)Oi(e)?(r=xc(e,r),t.tag=1,t=Kc(null,t,e,r,n)):(t.tag=0,t=Wc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===I){t.tag=11,t=Pc(null,t,e,r,n);break a}if(a===z){t.tag=14,t=Fc(null,t,e,r,n);break a}if(a===F){t.tag=10,t.type=e,t=sl(null,t,n);break a}}throw t=oe(e)||e,Error(i(306,t,``))}}return t;case 0:return Wc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=xc(r,t.pendingProps),Kc(e,t,r,a,n);case 3:a:{if(ve(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,fo(e,t),yo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ma(t,Da,r),r!==o.cache&&_a(t,[Da],n,!0),vo(),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=qc(e,t,r,n);break a}if(r!==a){a=Li(Error(i(424)),t),ua(a),t=qc(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($i=_m(e.firstChild),Qi=t,ea=!0,ta=null,na=!0,n=co(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ca(),r===a){t=cl(e,t,n);break a}Nc(e,t,r,n)}t=t.child}return t;case 26:return Uc(e,t),e===null?(n=Vm(t.type,null,t.pendingProps,null))?t.memoizedState=n:ea||(t.stateNode=bp(t.type,t.pendingProps,ge.current,t)):t.memoizedState=Vm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return be(t),e===null&&ea&&(r=t.stateNode=Cm(t.type,t.pendingProps,ge.current),Qi=t,na=!0,a=$i,Ap(t.type)?(vm=a,$i=_m(r.firstChild)):$i=a),Nc(e,t,t.pendingProps.children,n),Uc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ea&&((a=r=$i)&&(r=dm(r,t.type,t.pendingProps,na),r===null?a=!1:(t.stateNode=r,Qi=t,$i=_m(r.firstChild),na=!1,a=!0)),a||ia(t)),be(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,xp(a,o)?r=null:s!==null&&xp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Zo(e,t,es,null,null,n),hh._currentValue=a),Uc(e,t),Nc(e,t,r,n),t.child;case 6:return e===null&&ea&&((e=n=$i)&&(n=fm(n,t.pendingProps,na),n===null?e=!1:(t.stateNode=n,Qi=t,$i=null,e=!0)),e||ia(t)),null;case 13:return Zc(e,t,n);case 4:return ve(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=so(t,null,r,n):Nc(e,t,r,n),t.child;case 11:return Pc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Uc(e,t),Nc(e,t,r,n),t.child;case 8:return Nc(e,t,t.pendingProps.children,n),t.child;case 12:return Nc(e,t,t.pendingProps.children,n),t.child;case 10:return sl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ba(t),a=xa(a),r=r(a),t.flags|=1,Nc(e,t,r,n),t.child;case 14:return Fc(e,t,t.type,t.pendingProps,n);case 15:return Ic(e,t,t.type,t.pendingProps,n);case 19:return ol(e,t,n);case 31:return Hc(e,t,n);case 22:return Lc(e,t,n,t.pendingProps);case 24:return ba(t),r=xa(Da),e===null?(a=Ha(),a===null&&(a=nd,o=Oa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},uo(t),ma(t,Da,a)):((e.lanes&n)!==0&&(fo(e,t),yo(t,null,null,n),vo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ma(t,Da,r),r!==a.cache&&_a(t,[Da],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ma(t,Da,r))),Nc(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:ea&&Yi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Uc(e,t),Nc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function fl(e){e.flags|=4}function pl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?nh(t,r):nh(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(Yd())e.flags|=8192;else throw Qa=Ja,Ka}}else e.flags&=-16777217}function ml(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!rh(t)){if(Yd())e.flags|=8192;else throw Qa=Ja,Ka}}function hl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:it(),e.lanes|=t,gd|=t)}function gl(e,t){if(!ea)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 _l(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 vl(e,t,n){var r=t.pendingProps;switch(Xi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _l(t),null;case 1:return _l(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ha(Da),ye(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(sa(t)?fl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,la())),_l(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(fl(t),o===null?(_l(t),pl(t,a,null,r,n)):(_l(t),ml(t,o))):o?o===e.memoizedState?(_l(t),t.flags&=-16777217):(fl(t),_l(t),ml(t,o)):(e=e.memoizedProps,e!==r&&fl(t),_l(t),pl(t,a,e,r,n)),null;case 27:if(xe(t),n=ge.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&fl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return _l(t),t.subtreeFlags&=-33554433,null}e=me.current,sa(t)?aa(t,e):(e=Cm(a,r,n),t.stateNode=e,fl(t))}return _l(t),t.subtreeFlags&=-33554433,null;case 5:if(xe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&fl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return _l(t),t.subtreeFlags&=-33554433,null}if(o=me.current,sa(t))aa(t,o);else{var s=vp(ge.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[gt]=t,o[_t]=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(dp(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&&fl(t)}}return _l(t),t.subtreeFlags&=-33554433,pl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&fl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ge.current,sa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Qi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[gt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||cp(e.nodeValue,n)),e||ia(t,!0)}else e=vp(e).createTextNode(r),e[gt]=t,t.stateNode=e}return _l(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=sa(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[gt]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;_l(t),e=!1}else n=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(No(t),t):(No(t),null);if(t.flags&128)throw Error(i(558))}return _l(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=sa(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[gt]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;_l(t),a=!1}else a=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(No(t),t):(No(t),null)}return No(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),hl(t,t.updateQueue),_l(t),null);case 4:return ye(),e===null&&Qf(t.stateNode.containerInfo),t.flags|=67108864,_l(t),null;case 10:return ha(t.type),_l(t),null;case 19:if(Io(t),r=t.memoizedState,r===null)return _l(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)gl(r,!1);else{if(dd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Lo(e),o!==null){for(t.flags|=128,gl(r,!1),e=o.updateQueue,t.updateQueue=e,hl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ai(n,e),n=n.sibling;return Fo(t,Po.current&1|2),ea&&qi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Pe()>Sd&&(t.flags|=128,a=!0,gl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Lo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,hl(t,e),gl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!ea)return _l(t),null}else 2*Pe()-r.renderingStartTime>Sd&&n!==536870912&&(t.flags|=128,a=!0,gl(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=Pe(),e.sibling=null,o=Po.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||ea?Fo(t,o):(n=o,pe(Do,t),pe(Po,n),Oo===null&&(Oo=t)),ea&&qi(t,r.treeForkCount),e}return _l(t),null;case 22:case 23:return No(t),Eo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(_l(t),t.subtreeFlags&6&&(t.flags|=8192)):_l(t),n=t.updateQueue,n!==null&&hl(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&&fe(Va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ha(Da),_l(t),null;case 25:return null;case 30:return t.flags|=33554432,_l(t),null}throw Error(i(156,t.tag))}function yl(e,t){switch(Xi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ha(Da),ye(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xe(t),null;case 31:if(t.memoizedState!==null){if(No(t),t.alternate===null)throw Error(i(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(No(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Io(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 ye(),null;case 10:return ha(t.type),null;case 22:case 23:return No(t),Eo(),e!==null&&fe(Va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ha(Da),null;case 25:return null;default:return null}}function bl(e,t){switch(Xi(t),t.tag){case 3:ha(Da),ye();break;case 26:case 27:case 5:xe(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&No(t);break;case 13:No(t);break;case 19:Io(t);break;case 10:ha(t.type);break;case 22:case 23:No(t),Eo(),e!==null&&fe(Va);break;case 24:ha(Da)}}function xl(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){bf(t,t.return,e)}}function Sl(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){bf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){bf(t,t.return,e)}}function Cl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{xo(t,n)}catch(t){bf(e,e.return,t)}}}function wl(e,t,n){n.props=xc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){bf(e,t,n)}}function Tl(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=fi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Hp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Up(e);h(e.child,!1,om,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){bf(e,t,n)}}function El(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){bf(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){bf(e,t,n)}else n.current=null}}function Dl(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++)cm(e.stateNode,t[n])}function Ol(e){for(var t=e.return;t!==null&&(jl(t)&&cm(e.stateNode,t.stateNode),!Al(t));)t=t.return}function kl(e){for(var t=e.return;t!==null&&(jl(t)&&lm(e.stateNode,t.stateNode),!Al(t));)t=t.return}function Al(e){return e.tag===5||e.tag===3||e.tag===27}function jl(e){return e&&e.tag===7&&e.stateNode!==null}function Ml(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){bf(e,e.return,t)}}function Nl(e,t,n){try{var r=e.stateNode;pp(r,e.type,n,t),r[_t]=t}catch(t){bf(e,e.return,t)}}function Pl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ap(e.type)||e.tag===4}function Fl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Pl(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&&Ap(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 Il(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=pn)),Dl(e,r),Bt=!0;else if(i!==4&&(i===27&&(Dl(e,r),r=null,Ap(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Il(e,t,n,r),e=e.sibling;e!==null;)Il(e,t,n,r),e=e.sibling}function Ll(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Dl(e,r),Bt=!0;else if(i!==4&&(i===27&&(Dl(e,r),r=null,Ap(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ll(e,t,n,r),e=e.sibling;e!==null;)Ll(e,t,n,r),e=e.sibling}function Rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);dp(t,r,n),t[gt]=e,t[_t]=n}catch(t){bf(e,e.return,t)}}var zl=!1,Bl=null;function Vl(e){(e.tag===30||e.subtreeFlags&33554432)&&(zl=!0)}var Hl=null;function Ul(){var e=Hl;return Hl=null,e}var Wl=0;function Gl(e,t,n,r,i){return Wl=0,Kl(e.child,t,n,r,i)}function Kl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Ip(o);r.push(s),s.view&&(a=!0)}else a||Ip(o).view&&(a=!0);zl=!0,Np(o,Wl===0?t:t+`_`+Wl,n),Wl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Kl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function ql(e,t){for(;e!==null;)e.tag===5?Pp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||ql(e.child,t)),e=e.sibling}function Jl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Jl(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=mi(t.default,t.share),t!==`none`&&(Gl(e,n,t,null,!1)||ql(e.child,!1))}e=e.sibling}}function Yl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=fi(r,n),a=mi(r.default,n.paired?r.share:r.enter);a===`none`?Jl(e):Gl(e,i,a,null,!1)?(Jl(e),n.paired||t||zd(e,r.onEnter)):ql(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Yl(e,t),e=e.sibling;else Jl(e)}function Xl(e){if(Bl!==null&&Bl.size!==0){var t=Bl;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=mi(n.default,n.share);if(a!==`none`&&(Gl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,zd(e,n.onShare)):ql(e.child,!1)),t.delete(r),t.size===0)break}}}Xl(e)}e=e.sibling}}}function Zl(e){if(e.tag===30){var t=e.memoizedProps,n=fi(t,e.stateNode),r=Bl===null?void 0:Bl.get(n),i=mi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Gl(e,n,i,null,!1)?r===void 0?zd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Bl.delete(n),zd(e,t.onShare)):ql(e.child,!1)),Bl!==null&&Xl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e),e=e.sibling;else Bl!==null&&Xl(e)}function Ql(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=fi(t,e.stateNode);t=mi(t.default,t.update),e.flags&=-5,t!==`none`&&Gl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Ql(e);e=e.sibling}}function $l(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,ql(e.child,!1))}$l(e)}e=e.sibling}}function eu(e){if(e.tag===30)e.stateNode.paired=null,ql(e.child,!1),$l(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)eu(e),e=e.sibling;else $l(e)}function tu(e){for(e=e.child;e!==null;)e.tag===30?ql(e.child,!1):e.subtreeFlags&33554432&&tu(e),e=e.sibling}function nu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Wl<a.length){var l=a[Wl],u=Ip(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&&Np(c,Wl===0?n:n+`_`+Wl,i),s&&e.flags&4||(Hl===null&&(Hl=[]),Hl.push(c,Wl===0?r:r+`_`+Wl,t.memoizedProps)),Wl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:nu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function ru(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=fi(n,r),a=mi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Lp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Wl=0,i=nu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||zd(e,n.onUpdate))}else e.subtreeFlags&33554432&&ru(e,t);e=e.sibling}}var iu=!1,au=!1,ou=!1,su=!1,cu=typeof WeakSet==`function`?WeakSet:Set,lu=null,uu=!1,du=!1,fu=!1,pu=!1;function mu(e,t,n){if(e=e.containerInfo,gp=wh,e=Hr(e),Ur(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(_p={focusedElem:e,selectionRange:r},wh=!1,n=(n&335544064)===n,lu=t,t=n?9270:1024;lu!==null;){if(e=lu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Zl(r[a]);if(e.alternate===null&&e.flags&2)n&&Vl(e),hu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Zl(r),hu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Vl(e),hu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,lu=r):(n&&Ql(e),hu(n))}}Bl=null}function hu(e){for(;lu!==null;){var t=lu,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=xc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){bf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)um(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:um(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=fi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=mi(a.default,a.update),a!==`none`&&Gl(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,lu=r;break}lu=t.return}}function gu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Iu(e,n),r&4&&xl(5,n);break;case 1:if(Iu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){bf(n,n.return,e)}else{var i=xc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){bf(n,n.return,e)}}}r&64&&Cl(n),r&512&&Tl(n,n.return);break;case 3:if(Iu(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{xo(e,t)}catch(e){bf(n,n.return,e)}}break;case 27:t===null&&r&4&&Rl(n);case 26:case 5:Iu(e,n),t===null&&r&4&&Ml(n),r&512&&Tl(n,n.return);break;case 12:Iu(e,n);break;case 31:Iu(e,n),r&4&&Tu(e,n);break;case 13:Iu(e,n),r&4&&Eu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=wf.bind(null,n),gm(e,n))));break;case 22:if(r=n.memoizedState!==null||iu,!r){var a=t!==null&&t.memoizedState!==null||au;t=iu,i=au,iu=r,(au=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Ru(e,n,r)):Iu(e,n),iu=t,au=i}break;case 30:Iu(e,n),r&512&&Tl(n,n.return);break;case 7:r&512&&Tl(n,n.return);default:Iu(e,n)}}function _u(e,t){for(e=e.child;e!==null;)vu(e,t),e=e.sibling}function vu(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){bf(e,e.return,t)}yu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Bt=!0}catch(t){bf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Mp(s,!0):Mp(e.stateNode,!1)}catch(t){bf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&_u(e,t);break;default:_u(e,t)}}function yu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:vu(n,r);break a;case 22:n.memoizedState===null&&yu(n,r);break a;default:yu(n,r)}}e=e.sibling}}function bu(e){var t=e.alternate;t!==null&&(e.alternate=null,bu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Tt(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 xu=null,Su=!1;function Cu(e,t,n){for(n=n.child;n!==null;)wu(e,t,n),n=n.sibling}function wu(e,t,n){if(We&&typeof We.onCommitFiberUnmount==`function`)try{We.onCommitFiberUnmount(Ue,n)}catch{}switch(n.tag){case 26:au||El(n,t),Cu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!au&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:au||El(n,t),kl(n);var r=xu,i=Su;Ap(n.type)&&(xu=n.stateNode,Su=!1),Cu(e,t,n),wm(n.stateNode,n.type,n.memoizedProps),xu=r,Su=i;break;case 5:au||El(n,t),kl(n);case 6:if(n.tag===6&&kl(n),r=xu,i=Su,xu=null,Cu(e,t,n),xu=r,Su=i,xu!==null){if(Su)try{(xu.nodeType===9?xu.body:xu.nodeName===`HTML`?xu.ownerDocument.body:xu).removeChild(n.stateNode),Bt=!0}catch(e){bf(n,t,e)}else try{xu.removeChild(n.stateNode),Bt=!0}catch(e){bf(n,t,e)}}break;case 18:xu!==null&&(Su?(e=xu,jp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Xh(e)):jp(xu,n.stateNode));break;case 4:r=xu,i=Su,xu=n.stateNode.containerInfo,Su=!0,Cu(e,t,n),xu=r,Su=i;break;case 0:case 11:case 14:case 15:Sl(2,n,t),au||Sl(4,n,t),Cu(e,t,n);break;case 1:au||(El(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&wl(n,t,r)),Cu(e,t,n);break;case 21:Cu(e,t,n);break;case 22:au=(r=au)||n.memoizedState!==null,Cu(e,t,n),au=r;break;case 30:El(n,t),Cu(e,t,n);break;case 7:au||El(n,t),Cu(e,t,n);break;default:Cu(e,t,n)}}function Tu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Xh(e)}catch(e){bf(t,t.return,e)}}}function Eu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Xh(e)}catch(e){bf(t,t.return,e)}}function Du(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new cu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new cu),t;default:throw Error(i(435,e.tag))}}function Ou(e,t){var n=Du(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Tf.bind(null,e,t);t.then(r,r)}})}function ku(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(Ap(l.type)){xu=l.stateNode,Su=!1;break a}break;case 5:xu=l.stateNode,Su=!1;break a;case 3:case 4:xu=l.stateNode.containerInfo,Su=!0;break a}l=l.return}if(xu===null)throw Error(i(160));wu(s,c,o),xu=null,Su=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ju(t,e,n),t=t.sibling}var Au=null;function ju(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}ku(t,e,n),Mu(e),a&4&&(Sl(3,e,e.return),xl(3,e),Sl(5,e,e.return));break;case 1:ku(t,e,n),Mu(e),a&512&&(au||r===null||El(r,r.return)),a&64&&iu&&(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=Au,ku(t,e,n),Mu(e),a&512&&(au||r===null||El(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(iu)e.stateNode=bp(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[Ct]||r[gt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),dp(r,t,n),r[gt]=e,At(r),t=r;break a;case`link`:if(o=$m(`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),dp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=$m(`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),dp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[gt]=e,At(r),t=r}e.stateNode=t}}else iu||eh(o,e.type,e.stateNode)}else e.stateNode=Jm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Nl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||au||t.parentNode.removeChild(t)):a.count--,n===null?iu||eh(o,e.type,e.stateNode):Jm(o,n,e.memoizedProps))}break;case 27:ku(t,e,n),Mu(e),a&512&&(au||r===null||El(r,r.return)),r!==null&&a&4&&Nl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=ou,ou=!1,ku(t,e,n),ou=o,Mu(e),a&512&&(au||r===null||El(r,r.return)),e.flags&32){t=e.stateNode;try{an(t,``),Bt=!0}catch(t){bf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Nl(e,t,r===null?t:r.memoizedProps)),a&1024&&(su=!0);break;case 6:if(ku(t,e,n),Mu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Bt=!0}catch(t){bf(e,e.return,t)}}break;case 3:if(Bt=!1,Qm=null,o=Au,Au=Om(t.containerInfo),ku(t,e,n),Au=o,Mu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Xh(t.containerInfo)}catch(t){bf(e,e.return,t)}su&&(su=!1,Nu(e)),Bt=!1;break;case 4:a=ou,ou=iu,r=Vt(),o=Au,Au=Om(e.stateNode.containerInfo),ku(t,e,n),Mu(e),Au=o,Bt&&du&&(fu=!0),Bt=r,ou=a;break;case 12:ku(t,e,n),Mu(e);break;case 31:ku(t,e,n),Mu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ou(e,t)));break;case 13:ku(t,e,n),Mu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(bd=Pe()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ou(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=iu,l=au,u=ou;iu=c||o,ou=u||o,au=l||s,ku(t,e,n),au=l,ou=u,iu=c,Mu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||iu||au||(t=s||au,n=iu,r=au,iu=o||iu,au=t,Lu(e,2),iu=n,au=r),!o&&ou||_u(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Ou(e,n))));break;case 19:ku(t,e,n),Mu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ou(e,t)));break;case 30:a&512&&(au||r===null||El(r,r.return)),a=Vt(),o=du,s=(n&335544064)===n,c=e.memoizedProps,du=s&&mi(c.default,c.update)!==`none`,ku(t,e,n),Mu(e),s&&r!==null&&Bt&&(e.flags|=4),du=o,Bt=a;break;case 21:break;case 7:a&512&&(au||r===null||El(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:ku(t,e,n),Mu(e)}}function Mu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Pl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(jl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Al(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Ll(e,Fl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(an(l,``),n.flags&=-33),Ll(e,Fl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Il(e,Fl(e),u,s);break;default:throw Error(i(161))}}catch(t){bf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Nu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Nu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,wh=!0,t.reset(),wh=!1),e=e.sibling}}function Pu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Fu(t,e),t=t.sibling;else ru(t,!1)}function Fu(e,t){var n=e.alternate;if(n===null)Yl(e,!1);else switch(e.tag){case 3:if(pu=uu=!1,Ul(),Pu(t,e),!uu&&!fu){if(e=Hl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Pp(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`})),pu=!0}Hl=null;break;case 5:Pu(t,e);break;case 4:r=uu,uu=!1,Pu(t,e),uu&&(fu=!0),uu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Pu(t,e):Yl(e,!1));break;case 30:r=uu,i=Ul(),uu=!1,Pu(t,e),uu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=fi(a,o),o=fi(n.memoizedProps,o);var s=mi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Wl=0,t=nu(e,n,t,o,s,a,!0),Wl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(zd(e,e.memoizedProps.onUpdate),Hl=i):i!==null&&(i.push.apply(i,Hl),Hl=i),uu=e.flags&32?!0:r;break;default:Pu(t,e)}}function Iu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)gu(e,t.alternate,t),t=t.sibling}function Lu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Sl(4,n,n.return),Lu(n,r);break;case 1:El(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&wl(n,n.return,i),Lu(n,r);break;case 27:r&2&&wm(n.stateNode,n.type,n.memoizedProps);case 5:El(n,n.return),n.tag!==5&&n.tag!==27||kl(n),Lu(n,r);break;case 6:kl(n);break;case 26:El(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||au||i.parentNode.removeChild(i),Lu(n,r);break;case 22:n.memoizedState===null&&Lu(n,r);break;case 30:El(n,n.return),Lu(n,r);break;case 7:El(n,n.return);default:Lu(n,r)}e=e.sibling}}function Ru(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:Ru(i,a,n),xl(4,a);break;case 1:if(Ru(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){bf(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++)bo(l[i],c)}catch(e){bf(r,r.return,e)}}s&&o&64&&Cl(a),Tl(a,a.return);break;case 27:n&2&&Rl(a);case 5:a.tag!==5&&a.tag!==27||Ol(a),Ru(i,a,n),s&&r===null&&o&4&&Ml(a),Tl(a,a.return);break;case 6:Ol(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||iu||eh(Om(c.ownerDocument),a.type,c),Ru(i,a,n),s&&r===null&&o&4&&Ml(a),Tl(a,a.return);break;case 12:Ru(i,a,n);break;case 31:Ru(i,a,n),s&&o&4&&Tu(i,a);break;case 13:Ru(i,a,n),s&&o&4&&Eu(i,a);break;case 22:a.memoizedState===null&&Ru(i,a,n),Tl(a,a.return);break;case 30:Ru(i,a,n),Tl(a,a.return);break;case 7:Tl(a,a.return);default:Ru(i,a,n)}t=t.sibling}}function zu(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&&ka(n))}function Bu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ka(e))}function Vu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Hu(e,t,n,r),t=t.sibling;else i&&tu(t)}function Hu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&eu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Vu(e,t,n,r),a&2048&&xl(9,t);break;case 1:Vu(e,t,n,r);break;case 3:Vu(e,t,n,r),i&&pu&&(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&&ka(a)));break;case 12:if(a&2048){Vu(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){bf(t,t.return,e)}}else Vu(e,t,n,r);break;case 31:Vu(e,t,n,r);break;case 13:Vu(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&&eu(t),o._visibility&2?Vu(e,t,n,r):(o._visibility|=2,Uu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&eu(s),o._visibility&2?Vu(e,t,n,r):Wu(e,t)),a&2048&&zu(s,t);break;case 24:Vu(e,t,n,r),a&2048&&Bu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(ql(a.child,!0),ql(t.child,!0))),Vu(e,t,n,r);break;default:Vu(e,t,n,r)}}function Uu(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:Uu(a,o,s,c,i),xl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Uu(a,o,s,c,i)):u._visibility&2?Uu(a,o,s,c,i):Wu(a,o),i&&l&2048&&zu(o.alternate,o);break;case 24:Uu(a,o,s,c,i),i&&l&2048&&Bu(o.alternate,o);break;default:Uu(a,o,s,c,i)}t=t.sibling}}function Wu(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:Wu(n,r),i&2048&&zu(r.alternate,r);break;case 24:Wu(n,r),i&2048&&Bu(r.alternate,r);break;default:Wu(n,r)}t=t.sibling}}var Gu=8192;function Ku(e,t,n){if(e.subtreeFlags&Gu)for(e=e.child;e!==null;)qu(e,t,n),e=e.sibling}function qu(e,t,n){switch(e.tag){case 26:Ku(e,t,n),e.flags&Gu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&ah(n,e)):oh(n,Au,e.memoizedState,e.memoizedProps));break;case 5:Ku(e,t,n),e.flags&Gu&&(e=e.stateNode,(t&335544128)===t&&ah(n,e));break;case 3:case 4:var r=Au;Au=Om(e.stateNode.containerInfo),Ku(e,t,n),Au=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Gu,Gu=16777216,Ku(e,t,n),Gu=r):Ku(e,t,n));break;case 30:if((e.flags&Gu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Bl===null&&(Bl=new Map),Bl.set(r,i)}Ku(e,t,n);break;default:Ku(e,t,n)}}function Ju(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 Yu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];lu=r,Qu(r,e)}Ju(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Xu(e),e=e.sibling}function Xu(e){switch(e.tag){case 0:case 11:case 15:Yu(e),e.flags&2048&&Sl(9,e,e.return);break;case 3:Yu(e);break;case 12:Yu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Zu(e)):Yu(e);break;default:Yu(e)}}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];lu=r,Qu(r,e)}Ju(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Sl(8,t,t.return),Zu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Zu(t));break;default:Zu(t)}e=e.sibling}}function Qu(e,t){for(;lu!==null;){var n=lu;switch(n.tag){case 0:case 11:case 15:Sl(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:ka(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,lu=r;else a:for(n=e;lu!==null;){r=lu;var i=r.sibling,a=r.return;if(bu(r),r===n){lu=null;break a}if(i!==null){i.return=a,lu=i;break a}lu=a}}}var $u={getCacheForType:function(e){var t=xa(Da),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return xa(Da).controller.signal}},ed=typeof WeakMap==`function`?WeakMap:Map,td=0,nd=null,rd=null,id=0,ad=0,od=null,sd=!1,cd=!1,ld=!1,ud=0,dd=0,fd=0,pd=0,md=0,hd=0,gd=0,_d=null,vd=null,yd=!1,bd=0,xd=0,Sd=1/0,Cd=null,wd=null,Td=0,Ed=null,Dd=null,Od=0,kd=0,Ad=null,jd=null,Md=null,Nd=null,Pd=null,Fd=0,Id=null;function Ld(){return td&2&&id!==0?id&-id:U.T===null?pt():Vf()}function Rd(){if(hd===0){if(!(id&536870912)||ea){var e=Ze;Ze<<=1,!(Ze&3932160)&&(Ze=262144),hd=e}else hd=536870912}return e=Do.current,e!==null&&(e.flags|=32),hd}function zd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Hp(fi(e.memoizedProps,n))),Nd===null&&(Nd=[]),Nd.push(t.bind(null,r))}}function Bd(e,t,n){(e===nd&&(ad===2||ad===9)||e.cancelPendingCommit!==null)&&(qd(e,0),Wd(e,id,hd,!1)),ot(e,n),(!(td&2)||e!==nd)&&(e===nd&&(!(td&2)&&(pd|=n),dd===4&&Wd(e,id,hd,!1)),Nf(e))}function Vd(e,t,n){if(td&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||tt(e,t),a=r?tf(e,t):$d(e,t,!0),o=r;do{if(a===0){cd&&!r&&Wd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Ud(n)){a=$d(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=_d;var l=c.current.memoizedState.isDehydrated;if(l&&(qd(c,s).flags|=256),s=$d(c,s,!1),s!==2&&s!==6){if(ld&&!l){c.errorRecoveryDisabledLanes|=o,pd|=o,a=4;break a}o=vd,vd=a,o!==null&&(vd===null?vd=o:vd.push.apply(vd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){qd(e,0),Wd(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:Wd(r,t,hd,!sd);break a;case 2:vd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=bd+300-Pe(),10<a)){if(Wd(r,t,hd,!sd),et(r,0,!0)!==0)break a;Od=t,r.timeoutHandle=wp(Hd.bind(null,r,n,vd,Cd,yd,t,hd,pd,gd,sd,o,`Throttled`,-0,0),a);break a}Hd(r,n,vd,Cd,yd,t,hd,pd,gd,sd,o,null,-0,0)}break}while(1);Nf(e)}function Hd(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:pn},Bl=null,qu(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=uh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?bd-Pe():(a&4194048)===a?xd-Pe():0,m=ch(d,m),m!==null)){Od=a,e.cancelPendingCommit=m(lf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Wd(e,a,o,!l);return}lf(e,t,a,n,r,i,o,s,c,l,u,d)}function Ud(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(!Ir(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 Wd(e,t,n,r){t=nt(e,t),t&=~md,t&=~pd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ke(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ct(e,n,t)}function Gd(){return td&6?!0:(Pf(0,!1),!1)}function Kd(){if(rd!==null){if(ad===0)var e=rd.return;else e=rd,pa=fa=null,rs(e),to=null,no=0,e=rd;for(;e!==null;)bl(e.alternate,e),e=e.return;rd=null}}function qd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Tp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Od=0,Kd(),nd=e,rd=n=ki(e.current,null),id=t,ad=0,od=null,sd=!1,cd=tt(e,t),ld=!1,gd=hd=md=pd=fd=dd=0,vd=_d=null,yd=!1,ud=nt(e,t),yi(),n}function Jd(e,t){zo=null,U.H=pc,t===Ga||t===qa?(t=$a(),ad=3):t===Ka?(t=$a(),ad=4):ad=t===jc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,od=t,rd===null&&(dd=1,Tc(e,Li(t,e.current)))}function Yd(){var e=Do.current;return e===null?!0:(id&4194048)===id?Oo===null:(id&62914560)===id||id&536870912?e===Oo:!1}function Xd(){var e=U.H;return U.H=pc,e===null?pc:e}function Zd(){var e=U.A;return U.A=$u,e}function Qd(){dd=4,sd||(id&4194048)!==id&&Do.current!==null||(cd=!0),!(fd&134217727)&&!(pd&134217727)||nd===null||Wd(nd,id,hd,!1)}function $d(e,t,n){var r=td;td|=2;var i=Xd(),a=Zd();(nd!==e||id!==t)&&(Cd=null,qd(e,t)),t=!1;var o=dd;a:do try{if(ad!==0&&rd!==null){var s=rd,c=od;switch(ad){case 8:Kd(),o=6;break a;case 3:case 2:case 9:case 6:Do.current===null&&(t=!0);var l=ad;if(ad=0,od=null,of(e,s,c,l),n&&cd){o=0;break a}break;default:l=ad,ad=0,od=null,of(e,s,c,l)}}ef(),o=dd;break}catch(t){Jd(e,t)}while(1);return t&&e.shellSuspendCounter++,pa=fa=null,td=r,U.H=i,U.A=a,rd===null&&(nd=null,id=0,yi()),o}function ef(){for(;rd!==null;)rf(rd)}function tf(e,t){var n=td;td|=2;var r=Xd(),a=Zd();nd!==e||id!==t?(Cd=null,Sd=Pe()+500,qd(e,t)):cd=tt(e,t);a:do try{if(ad!==0&&rd!==null){t=rd;var o=od;b:switch(ad){case 1:ad=0,od=null,of(e,t,o,1);break;case 2:case 9:if(Ya(o)){ad=0,od=null,af(t);break}t=function(){ad!==2&&ad!==9||nd!==e||(ad=7),Nf(e)},o.then(t,t);break a;case 3:ad=7;break a;case 4:ad=5;break a;case 7:Ya(o)?(ad=0,od=null,af(t)):(ad=0,od=null,of(e,t,o,7));break;case 5:var s=null;switch(rd.tag){case 26:s=rd.memoizedState;case 5:case 27:var c=rd;if(s?rh(s):c.stateNode.complete){ad=0,od=null;var l=c.sibling;if(l!==null)rd=l;else{var u=c.return;u===null?rd=null:(rd=u,sf(u))}break b}}ad=0,od=null,of(e,t,o,5);break;case 6:ad=0,od=null,of(e,t,o,6);break;case 8:Kd(),dd=6;break a;default:throw Error(i(462))}}nf();break}catch(t){Jd(e,t)}while(1);return pa=fa=null,U.H=r,U.A=a,td=n,rd===null?(nd=null,id=0,yi(),dd):0}function nf(){for(;rd!==null&&!Me();)rf(rd)}function rf(e){var t=dl(e.alternate,e,ud);e.memoizedProps=e.pendingProps,t===null?sf(e):rd=t}function af(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Gc(n,t,t.pendingProps,t.type,void 0,id);break;case 11:t=Gc(n,t,t.pendingProps,t.type.render,t.ref,id);break;case 5:rs(t);var r=t;r===Qi&&(ea?(oa(r),r.tag===5&&r.stateNode!=null&&($i=r.stateNode)):(oa(r),ea=!0));default:bl(n,t),t=rd=Ai(t,ud),t=dl(n,t,ud)}e.memoizedProps=e.pendingProps,t===null?sf(e):rd=t}function of(e,t,n,r){pa=fa=null,rs(t),to=null,no=0;var i=t.return;try{if(Ac(e,i,t,n,id)){dd=1,Tc(e,Li(n,e.current)),rd=null;return}}catch(t){if(i!==null)throw rd=i,t;dd=1,Tc(e,Li(n,e.current)),rd=null;return}t.flags&32768?(ea||r===1?e=!0:cd||id&536870912?e=!1:(sd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Do.current,r!==null&&r.tag===13&&(r.flags|=16384))),cf(t,e)):sf(t)}function sf(e){var t=e;do{if(t.flags&32768){cf(t,sd);return}e=t.return;var n=vl(t.alternate,t,ud);if(n!==null){rd=n;return}if(t=t.sibling,t!==null){rd=t;return}rd=t=e}while(t!==null);dd===0&&(dd=5)}function cf(e,t){do{var n=yl(e.alternate,e);if(n!==null){n.flags&=32767,rd=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){rd=e;return}rd=e=n}while(e!==null);dd=6,rd=null}function lf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do _f();while(Td!==0);if(td&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===nd&&(rd=nd=null,id=0),Dd=t,Ed=e,Od=n,Ad=a,jd=r,uf(e,t,n,s,c,l,f)}}function uf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(kd=s,s|=vi,st(e,n,s,r,i,a),Nd=null,(n&335544064)===n?(Pd=Ma(e),r=10262):(Pd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Ef(Re,function(){return vf(),null})):(e.callbackNode=null,e.callbackPriority=0),zl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=U.T,U.T=null,i=W.p,W.p=2,a=td,td|=4;try{mu(e,t,n)}finally{td=a,W.p=i,U.T=r}}Td=1,zl?Md=Bp(o,e.containerInfo,Pd,pf,mf,ff,hf,vf,df,null,null):(pf(),mf(),hf())}function df(e){if(Td!==0){var t=Ed.onRecoverableError;t(e,{componentStack:null})}}function ff(){Td===3&&(Td=0,Fu(Dd,Ed),Td=4)}function pf(){if(Td===1){Td=0;var e=Ed,t=Dd,n=Od,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=U.T,U.T=null;var i=W.p;W.p=2;var a=td;td|=4;try{du=fu=!1,ju(t,e,n),n=_p;var o=Hr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Vr(s.ownerDocument.documentElement,s)){if(c!==null&&Ur(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 _=Br(s,h),v=Br(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}}wh=!!gp,_p=gp=null}finally{td=a,W.p=i,U.T=r}}e.current=t,Td=2}}function mf(){if(Td===2){Td=0;var e=Ed,t=Dd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=U.T,U.T=null;var r=W.p;W.p=2;var i=td;td|=4;try{gu(e,t.alternate,t)}finally{td=i,W.p=r,U.T=n}}Td=3}}function hf(){if(Td===4||Td===3){Td=0;var e=Md;Md=null,Ne();var t=Ed,n=Dd,r=Od,i=jd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Td=5:(Td=0,Dd=Ed=null,gf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(wd=null),ft(r),n=n.stateNode,We&&typeof We.onCommitFiberRoot==`function`)try{We.onCommitFiberRoot(Ue,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=U.T,a=W.p,W.p=2,U.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{U.T=n,W.p=a}}if(i=Nd,o=Pd,Pd=null,i!==null&&(Nd=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);Od&3&&_f(),Nf(t),a=t.pendingLanes,r&261930&&a&42?t===Id?Fd++:(Fd=0,Id=t):(Fd=0,Id=null),Pf(0,!1)}}function gf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ka(t)))}function _f(){return Md!==null&&(Md.skipTransition(),Md=null),pf(),mf(),hf(),vf()}function vf(){if(Td!==5)return!1;var e=Ed,t=kd;kd=0;var n=ft(Od),r=U.T,a=W.p;try{W.p=32>n?32:n,U.T=null,n=Ad,Ad=null;var o=Ed,s=Od;if(Td=0,Dd=Ed=null,Od=0,td&6)throw Error(i(331));var c=td;if(td|=4,Xu(o.current),Hu(o,o.current,s,n),td=c,Pf(0,!1),We&&typeof We.onPostCommitFiberRoot==`function`)try{We.onPostCommitFiberRoot(Ue,o)}catch{}return!0}finally{W.p=a,U.T=r,gf(e,t)}}function yf(e,t,n){t=Li(n,t),t=Dc(e.stateNode,t,2),e=mo(e,t,2),e!==null&&(ot(e,2),Nf(e))}function bf(e,t,n){if(e.tag===3)yf(e,e,n);else for(;t!==null;){if(t.tag===3){yf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(wd===null||!wd.has(r))){e=Li(n,e),n=Oc(2),r=mo(t,n,2),r!==null&&(kc(n,r,t,e),ot(r,2),Nf(r));break}}t=t.return}}function xf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ed;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)||(ld=!0,i.add(n),e=Sf.bind(null,e,t,n),t.then(e,e))}function Sf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,nd===e&&(id&n)===n&&(dd===4||dd===3&&(id&62914560)===id&&300>Pe()-bd?td&2?md|=n:qd(e,0):md|=n,gd===id&&(gd=0)),Nf(e)}function Cf(e,t){t===0&&(t=it()),e=Si(e,t),e!==null&&(ot(e,t),Nf(e))}function wf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Cf(e,n)}function Tf(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),Cf(e,n)}function Ef(e,t){return Ae(e,t)}var Df=null,Of=null,kf=!1,Af=!1,jf=!1,Mf=0;function Nf(e){e!==Of&&e.next===null&&(Of===null?Df=Of=e:Of=Of.next=e),Af=!0,kf||(kf=!0,Bf())}function Pf(e,t){if(!jf&&Af){jf=!0;do for(var n=!1,r=Df;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-Ke(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,zf(r,a))}else a=id,a=et(r,r===nd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||tt(r,a)||(n=!0,zf(r,a))}r=r.next}while(n);jf=!1}}function Ff(){If()}function If(){Af=kf=!1;var e=0;Mf!==0&&Cp()&&(e=Mf);for(var t=Pe(),n=null,r=Df;r!==null;){var i=r.next,a=Lf(r,t);a===0?(r.next=null,n===null?Df=i:n.next=i,i===null&&(Of=n)):(n=r,(e!==0||a&3)&&(Af=!0)),r=i}Td!==0&&Td!==5||Pf(e,!1),Mf!==0&&(Mf=0)}function Lf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ke(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=rt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=nd,n=id,n=et(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(ad===2||ad===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&je(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||tt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&je(r),ft(n)){case 2:case 8:n=Le;break;case 32:n=Re;break;case 268435456:n=Be;break;default:n=Re}return r=Rf.bind(null,e),n=Ae(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&je(r),e.callbackPriority=2,e.callbackNode=null,2}function Rf(e,t){if(Td!==0&&Td!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(_f()&&e.callbackNode!==n)return null;var r=id;return r=et(e,e===nd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Vd(e,r,t),Lf(e,Pe()),e.callbackNode!=null&&e.callbackNode===n?Rf.bind(null,e):null)}function zf(e,t){if(_f())return null;Vd(e,t,!0)}function Bf(){Op(function(){td&6?Ae(Ie,Ff):If()})}function Vf(){if(Mf===0){var e=Fa;e===0&&(e=Xe,Xe<<=1,!(Xe&261888)&&(Xe=256)),Mf=e}return Mf}function Hf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:fn(e)}function Uf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Hf((i[_t]||null).action),o=r.submitter;o&&(t=(t=o[_t]||null)?Hf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Pn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Mf!==0){var e=new FormData(i,o);$s(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),$s(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Wf=0;Wf<li.length;Wf++){var Gf=li[Wf];ui(Gf.toLowerCase(),`on`+(Gf[0].toUpperCase()+Gf.slice(1)))}ui(ti,`onAnimationEnd`),ui(ni,`onAnimationIteration`),ui(ri,`onAnimationStart`),ui(`dblclick`,`onDoubleClick`),ui(`focusin`,`onFocus`),ui(`focusout`,`onBlur`),ui(ii,`onTransitionRun`),ui(ai,`onTransitionStart`),ui(oi,`onTransitionCancel`),ui(si,`onTransitionEnd`),Ft(`onMouseEnter`,[`mouseout`,`mouseover`]),Ft(`onMouseLeave`,[`mouseout`,`mouseover`]),Ft(`onPointerEnter`,[`pointerout`,`pointerover`]),Ft(`onPointerLeave`,[`pointerout`,`pointerover`]),Pt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Pt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Pt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Pt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Pt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Pt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Kf=`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(` `),qf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Kf));function Jf(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){hi(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){hi(e)}i.currentTarget=null,a=c}}}}function Yf(e,t){var n=t[yt];n===void 0&&(n=t[yt]=new Set);var r=e+`__bubble`;n.has(r)||($f(t,e,2,!1),n.add(r))}function Xf(e,t,n){var r=0;t&&(r|=4),$f(n,e,r,t)}var Zf=`_reactListening`+Math.random().toString(36).slice(2);function Qf(e){if(!e[Zf]){e[Zf]=!0,Mt.forEach(function(t){t!==`selectionchange`&&(qf.has(t)||Xf(t,!1,e),Xf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Zf]||(t[Zf]=!0,Xf(`selectionchange`,!1,t))}}function $f(e,t,n,r){switch(jh(t)){case 2:var i=Th;break;case 8:i=Eh;break;default:i=Dh}n=i.bind(null,t,n,e),i=void 0,!Cn||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 ep(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=Et(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}bn(function(){var r=a,i=hn(n),s=[];a:{var c=ci.get(e);if(c!==void 0){var l=Pn,u=e;switch(e){case`keypress`:if(kn(n)===0)break a;case`keydown`:case`keyup`:l=Qn;break;case`focusin`:u=`focus`,l=Un;break;case`focusout`:u=`blur`,l=Un;break;case`beforeblur`:case`afterblur`:l=Un;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=Vn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Hn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=tr;break;case ti:case ni:case ri:l=Wn;break;case si:l=nr;break;case`scroll`:case`scrollend`:l=In;break;case`wheel`:l=rr;break;case`copy`:case`cut`:case`paste`:l=Gn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=$n;break;case`submit`:l=er;break;case`toggle`:case`beforetoggle`:l=ir}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=xn(m,p),g!=null&&d.push(tp(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!==mn&&(u=n.relatedTarget||n.fromElement)&&(Et(u)||u[vt]))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?Et(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=Vn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=$n,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Ot(c),h=l==null?u:Ot(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Et(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,rp):null,c!==null&&ip(s,u,c,d,!1),l!==null&&f!==null&&ip(s,f,l,d,!0)))}a:{if(c=r?Ot(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=wr;else if(vr(c)){if(Tr)_=Pr;else{_=Mr;var v=jr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&ln(r.elementType)&&(_=wr):_=Nr;if(_&&=_(e,r)){yr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Ot(r):window,e){case`focusin`:(vr(v)||v.contentEditable===`true`)&&(Gr=v,Kr=r,qr=null);break;case`focusout`:qr=Kr=Gr=null;break;case`mousedown`:Jr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Jr=!1,Yr(s,n,i);break;case`selectionchange`:if(Wr)break;case`keydown`:case`keyup`:Yr(s,n,i)}var y;if(or)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 mr?fr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(lr&&n.locale!==`ko`&&(mr||b!==`onCompositionStart`?b===`onCompositionEnd`&&mr&&(y=On()):(Tn=i,En=`value`in Tn?Tn.value:Tn.textContent,mr=!0)),v=np(r,b),0<v.length&&(b=new Kn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=pr(n),y!==null&&(b.data=y)))),(y=cr?hr(e,n):gr(e,n))&&(b=np(r,`onBeforeInput`),0<b.length&&(v=new Kn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Uf(s,e,r,n,i)}Jf(s,t)})}function tp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function np(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=xn(e,n),i!=null&&r.unshift(tp(e,i,a)),i=xn(e,t),i!=null&&r.push(tp(e,i,a))),e.tag===3)return r;e=e.return}return[]}function rp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ip(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=xn(n,a),l!=null&&o.unshift(tp(n,l,c))):i||(l=xn(n,a),l!=null&&o.push(tp(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ap=/\r\n?/g,op=/\u0000|\uFFFD/g;function sp(e){return(typeof e==`string`?e:``+e).replace(ap,`
9
+ `).replace(op,``)}function cp(e,t){return t=sp(t),sp(e)===t}function lp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||an(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&an(e,``+r);else return;break;case`className`:Ut(e,`class`,r);break;case`tabIndex`:Ut(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ut(e,n,r);break;case`style`:cn(e,r,o);return;case`data`:if(t!==`object`){Ut(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=fn(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`&&lp(e,t,`name`,a.name,a,null),lp(e,t,`formEncType`,a.formEncType,a,null),lp(e,t,`formMethod`,a.formMethod,a,null),lp(e,t,`formTarget`,a.formTarget,a,null)):(lp(e,t,`encType`,a.encType,a,null),lp(e,t,`method`,a.method,a,null),lp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=fn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=pn);return;case`onScroll`:r!=null&&Yf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Yf(`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=fn(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`:Yf(`beforetoggle`,e),Yf(`toggle`,e),Ht(e,`popover`,r);break;case`xlinkActuate`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ht(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=un.get(n)||n,Ht(e,n,r);else return}Bt=!0}function up(e,t,n,r,a,o){switch(n){case`style`:cn(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`)an(e,r);else if(typeof r==`number`||typeof r==`bigint`)an(e,``+r);else return;break;case`onScroll`:r!=null&&Yf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Yf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=pn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Nt.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[_t]||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}Bt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ht(e,n,r)}return}Bt=!0}function dp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Yf(`error`,e),Yf(`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:lp(e,t,o,s,n,null)}}a&&lp(e,t,`srcSet`,n.srcSet,n,null),r&&lp(e,t,`src`,n.src,n,null);return;case`input`:Yf(`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:lp(e,t,r,d,n,null)}}$t(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Yf(`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:lp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&tn(e,!!r,n,!0):tn(e,!!r,t,!1);return;case`textarea`:for(s in Yf(`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:lp(e,t,s,c,n,null)}rn(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:lp(e,t,l,r,n,null)}return;case`dialog`:Yf(`beforetoggle`,e),Yf(`toggle`,e),Yf(`cancel`,e),Yf(`close`,e);break;case`iframe`:case`object`:Yf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Kf.length;r++)Yf(Kf[r],e);break;case`image`:Yf(`error`,e),Yf(`load`,e);break;case`details`:Yf(`toggle`,e);break;case`embed`:case`source`:case`link`:Yf(`error`,e),Yf(`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:lp(e,t,u,r,n,null)}return;default:if(ln(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&up(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&lp(e,t,c,r,n,null))}var fp={};function pp(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)||lp(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&&(Bt=!0),o=m;break;case`name`:m!==f&&(Bt=!0),a=m;break;case`checked`:m!==f&&(Bt=!0),u=m;break;case`defaultChecked`:m!==f&&(Bt=!0),d=m;break;case`value`:m!==f&&(Bt=!0),s=m;break;case`defaultValue`:m!==f&&(Bt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&lp(e,t,p,m,r,f)}}Qt(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)||lp(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&&(Bt=!0),p=o;break;case`defaultValue`:o!==l&&(Bt=!0),c=o;break;case`multiple`:o!==l&&(Bt=!0),s=o;default:o!==l&&lp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?tn(e,!!n,n?[]:``,!1):tn(e,!!n,t,!0)):tn(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:lp(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&&(Bt=!0),p=a;break;case`defaultValue`:a!==o&&(Bt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&lp(e,t,s,a,r,o)}nn(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:lp(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&&(Bt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:lp(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)&&lp(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:lp(e,t,u,p,r,m)}return;default:if(ln(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&up(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||up(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&lp(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||lp(e,t,f,p,r,m)}function mp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function hp(){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&&mp(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&&mp(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 gp=null,_p=null;function vp(e){return e.nodeType===9?e:e.ownerDocument}function G(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 yp(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 bp(e,t,n,r){return n=vp(n).createElement(e),n[gt]=r,n[_t]=t,dp(n,e,t),At(n),n}function xp(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 Sp=null;function Cp(){var e=window.event;return e&&e.type===`popstate`?e!==Sp&&(Sp=e,!0):(Sp=null,!1)}var wp=typeof setTimeout==`function`?setTimeout:void 0,Tp=typeof clearTimeout==`function`?clearTimeout:void 0,Ep=typeof Promise==`function`?Promise:void 0,Dp=typeof requestAnimationFrame==`function`?requestAnimationFrame:wp,Op=typeof queueMicrotask==`function`?queueMicrotask:Ep===void 0?wp:function(e){return Ep.resolve(null).then(e).catch(kp)};function kp(e){setTimeout(function(){throw e})}function Ap(e){return e===`head`}function jp(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),Xh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Tm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Tm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Tm(e.ownerDocument.body)}n=i}while(n);Xh(t)}function Mp(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 Np(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 Pp(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 Fp(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 Ip(e){return Fp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Lp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Fp(t,n,e)}function Rp(e){return e.documentElement.clientHeight}function zp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Bp(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`&&(Rp(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+=ih(f),u>sh){s.length=o;break}f=new Promise(zp.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 Vp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Vp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Vp.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},Vp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Hp(e){return{name:e,group:new Vp(`group`,e),imagePair:new Vp(`image-pair`,e),old:new Vp(`old`,e),new:new Vp(`new`,e)}}function Up(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Up.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(Jp(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=Kp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Wp,e,s,r)}this._eventListeners=a}};function Wp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Up.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Jp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Kp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Gp,e,n,i),r.splice(t,1),a!==null&&a()}};function Gp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Kp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function qp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Jp(e,t,n,r){if(e.length===0)return-1;r=qp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&qp(a.optionsOrUseCapture)===r)return i}return-1}Up.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,Kp(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,Kp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Up.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Yp,e,void 0,void 0)};function Yp(e,t){return e.tag!==6&&(e=b(e),xm(e,t))}Up.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Xp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Yp(t[n],e);n--);};function Xp(e,t){return t.push(e),!1}Up.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=vp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Zp,e,void 0,void 0))};function Zp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Up.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Qp,e,void 0,void 0)};function Qp(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}Up.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,$p,e,void 0,void 0);for(var n=t=0;n<em.length;n++){var r=em[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):em[t++]=r}em.length=t}};function $p(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var em=[],tm=!1;function nm(e,t,n){em.push({fragmentInstance:e,observer:t,instance:n}),tm||(tm=!0,Sm(function(){tm=!1;var e=em;em=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Up.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,rm,e,void 0,void 0),e};function rm(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}Up.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Up.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Xp,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||im(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function im(e,t,n,r,i){var a=Et(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 am(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)}Up.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,Xp,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),am(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),am(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function om(e,t){return e=b(e),sm(e,t),!1}function sm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function cm(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,Kp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<em.length;i++){var a=em[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(em[r++]=a)}em.length=r,n.observe(e)}),sm(e,t))}function lm(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,Kp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?nm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function um(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`:um(n),Tt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function dm(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[Ct])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=_m(e.nextSibling),e===null)break}return null}function fm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=_m(e.nextSibling),e===null))return null;return e}function pm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=_m(e.nextSibling),e===null))return null;return e}function mm(e){return e.data===`$?`||e.data===`$~`}function hm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function gm(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 _m(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 vm=null;function ym(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return _m(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function bm(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 xm(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 Sm(e){Dp(function(){Dp(function(t){return e(t)})})}function Cm(e,t,n){switch(t=vp(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 wm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&lp(e,t,r,null,fp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===pn&&(e.onclick=null),Tt(e)}function Tm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Tt(e)}var Em=new Map,Dm=new Set;function Om(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 km=W.d;W.d={f:Am,r:jm,D:Pm,C:Fm,L:Im,m:Lm,X:zm,S:Rm,M:Bm};function Am(){var e=km.f(),t=Gd();return e||t}function jm(e){var t=Dt(e);t!==null&&t.tag===5&&t.type===`form`?tc(t):km.r(e)}var Mm=typeof document>`u`?null:document;function Nm(e,t,n){var r=Mm;if(r&&typeof t==`string`&&t){var i=Zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Dm.has(i)||(Dm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),dp(t,`link`,e),At(t),r.head.appendChild(t)))}}function Pm(e){km.D(e),Nm(`dns-prefetch`,e,null)}function Fm(e,t){km.C(e,t),Nm(`preconnect`,e,t)}function Im(e,t,n){km.L(e,t,n);var r=Mm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Zt(n.imageSizes)+`"]`)):i+=`[href="`+Zt(e)+`"]`;var a=i;switch(t){case`style`:a=Hm(e);break;case`script`:a=Km(e)}if(!(Em.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Em.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Um(a))||t===`script`&&r.querySelector(qm(a))))){var o=r.createElement(`link`);dp(o,`link`,e),t===`style`&&(o[wt]=!0,o.onload=o.onerror=function(){jt(o)}),At(o),r.head.appendChild(o)}}}function Lm(e,t){km.m(e,t);var n=Mm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Zt(r)+`"][href="`+Zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Km(e)}if(!Em.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Em.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(qm(a)))return}r=n.createElement(`link`),dp(r,`link`,e),At(r),n.head.appendChild(r)}}}function Rm(e,t,n){km.S(e,t,n);var r=Mm;if(r&&e){var i=kt(r).hoistableStyles,a=Hm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Um(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Em.get(a))&&Xm(e,n);var c=o=r.createElement(`link`);At(c),dp(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,Ym(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function zm(e,t){km.X(e,t);var n=Mm;if(n&&e){var r=kt(n).hoistableScripts,i=Km(e),a=r.get(i);a||(a=n.querySelector(qm(i)),a||(e=D({src:e,async:!0},t),(t=Em.get(i))&&Zm(e,t),a=n.createElement(`script`),At(a),dp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bm(e,t){km.M(e,t);var n=Mm;if(n&&e){var r=kt(n).hoistableScripts,i=Km(e),a=r.get(i);a||(a=n.querySelector(qm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Em.get(i))&&Zm(e,t),a=n.createElement(`script`),At(a),dp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vm(e,t,n,r){var a=(a=ge.current)?Om(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=Hm(n.href),t=kt(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=Hm(n.href);var o=kt(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(Um(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Em.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},Em.set(e,o)),Gm(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=Km(n),t=kt(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 Hm(e){return`href="`+Zt(e)+`"`}function Um(e){return`link[rel="stylesheet"][`+e+`]`}function Wm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Gm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[wt]){r.loading=1;return}}else t=e.createElement(`link`),t[wt]=!0,t.onload=t.onerror=jt.bind(null,t),dp(t,`link`,n),At(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 Km(e){return`[src="`+Zt(e)+`"]`}function qm(e){return`script[async]`+e}function Jm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Zt(n.href)+`"]`);if(r)return t.instance=r,At(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`),At(r),dp(r,`style`,a),Ym(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Hm(n.href);var o=e.querySelector(Um(a));if(o)return t.state.loading|=4,t.instance=o,At(o),o;r=Wm(n),(a=Em.get(a))&&Xm(r,a),o=(e.ownerDocument||e).createElement(`link`),At(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),dp(o,`link`,r),t.state.loading|=4,Ym(o,n.precedence,e),t.instance=o;case`script`:return o=Km(n.src),(a=e.querySelector(qm(o)))?(t.instance=a,At(a),a):(r=n,(a=Em.get(o))&&(r=D({},n),Zm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),At(a),dp(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,Ym(r,n.precedence,e));return t.instance}function Ym(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 Xm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Zm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Qm=null;function $m(e,t,n){if(Qm===null){var r=new Map,i=Qm=new Map;i.set(n,r)}else i=Qm,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[Ct]||a[gt]||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 eh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function th(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 nh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function rh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ih(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ah(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=ih(t),e.suspenseyImages.push(t)),e=dh.bind(e),t.decode().then(e,e))}function oh(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=Hm(r.href),a=t.querySelector(Um(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=uh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,At(a);return}a=t.ownerDocument||t,r=Wm(r),(i=Em.get(i))&&Xm(r,i),a=a.createElement(`link`),At(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),dp(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=uh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var sh=0;function ch(e,t){return e.stylesheets&&e.count===0&&ph(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ph(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&sh===0&&(sh=62500*hp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ph(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>sh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function lh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ph(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function uh(){this.count--,lh(this)}function dh(){this.imgCount--,lh(this)}var fh=null;function ph(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,fh=new Map,t.forEach(mh,e),fh=null,uh.call(e))}function mh(e,t){if(!(t.state.loading&4)){var n=fh.get(e);if(n)var r=n.get(null);else{n=new Map,fh.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=uh.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 hh={$$typeof:F,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function gh(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=at(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=at(0),this.hiddenUpdates=at(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 _h(e,t,n,r,i,a,o,s,c,l,u,d){return e=new gh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Di(3,null,null,t),e.current=a,a.stateNode=e,t=Oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},uo(a),e}function vh(e){return e?(e=Ti,e):Ti}function yh(e,t,n,r,i,a){i=vh(i),r.context===null?r.context=i:r.pendingContext=i,r=po(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=mo(e,r,t),n!==null&&(Bd(n,e,t),ho(n,e,t))}function bh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function xh(e,t){bh(e,t),(e=e.alternate)&&bh(e,t)}function Sh(e){if(e.tag===13||e.tag===31){var t=Si(e,67108864);t!==null&&Bd(t,e,67108864),xh(e,67108864)}}function Ch(e){if(e.tag===13||e.tag===31){var t=Ld();t=dt(t);var n=Si(e,t);n!==null&&Bd(n,e,t),xh(e,t)}}var wh=!0;function Th(e,t,n,r){var i=U.T;U.T=null;var a=W.p;try{W.p=2,Dh(e,t,n,r)}finally{W.p=a,U.T=i}}function Eh(e,t,n,r){var i=U.T;U.T=null;var a=W.p;try{W.p=8,Dh(e,t,n,r)}finally{W.p=a,U.T=i}}function Dh(e,t,n,r){if(wh){var i=Oh(r);if(i===null)ep(e,t,r,kh,n),Bh(e,r);else if(Hh(i,e,t,n,r))r.stopPropagation();else if(Bh(e,r),t&4&&-1<zh.indexOf(e)){for(;i!==null;){var a=Dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=$e(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ke(o);s.entanglements[1]|=c,o&=~c}Nf(a),!(td&6)&&(Sd=Pe()+500,Pf(0,!1))}}break;case 31:case 13:s=Si(a,2),s!==null&&Bd(s,a,2),Gd(),xh(a,2)}if(a=Oh(r),a===null&&ep(e,t,r,kh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else ep(e,t,r,null,n)}}function Oh(e){return e=hn(e),Ah(e)}var kh=null;function Ah(e){if(kh=null,e=Et(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 kh=e,null}function jh(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(Fe()){case Ie:return 2;case Le:return 8;case Re:case ze:return 32;case Be:return 268435456;default:return 32}default:return 32}}var Mh=!1,Nh=null,Ph=null,Fh=null,Ih=new Map,Lh=new Map,Rh=[],zh=`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 Bh(e,t){switch(e){case`focusin`:case`focusout`:Nh=null;break;case`dragenter`:case`dragleave`:Ph=null;break;case`mouseover`:case`mouseout`:Fh=null;break;case`pointerover`:case`pointerout`:Ih.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Lh.delete(t.pointerId)}}function Vh(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=Dt(t),t!==null&&Sh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Hh(e,t,n,r,i){switch(t){case`focusin`:return Nh=Vh(Nh,e,t,n,r,i),!0;case`dragenter`:return Ph=Vh(Ph,e,t,n,r,i),!0;case`mouseover`:return Fh=Vh(Fh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ih.set(a,Vh(Ih.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Lh.set(a,Vh(Lh.get(a)||null,e,t,n,r,i)),!0}return!1}function Uh(e){var t=Et(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,mt(e.priority,function(){Ch(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,mt(e.priority,function(){Ch(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 Wh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Oh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);mn=r,n.target.dispatchEvent(r),mn=null}else return t=Dt(n),t!==null&&Sh(t),e.blockedOn=n,!1;t.shift()}return!0}function Gh(e,t,n){Wh(e)&&n.delete(t)}function Kh(){Mh=!1,Nh!==null&&Wh(Nh)&&(Nh=null),Ph!==null&&Wh(Ph)&&(Ph=null),Fh!==null&&Wh(Fh)&&(Fh=null),Ih.forEach(Gh),Lh.forEach(Gh)}function qh(e,n){e.blockedOn===n&&(e.blockedOn=null,Mh||(Mh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Kh)))}var Jh=null;function Yh(e){Jh!==e&&(Jh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Jh===e&&(Jh=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(Ah(r||n)===null)continue;break}var a=Dt(n);a!==null&&(e.splice(t,3),t-=3,$s(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Xh(e){function t(t){return qh(t,e)}Nh!==null&&qh(Nh,e),Ph!==null&&qh(Ph,e),Fh!==null&&qh(Fh,e),Ih.forEach(t),Lh.forEach(t);for(var n=0;n<Rh.length;n++){var r=Rh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Rh.length&&(n=Rh[0],n.blockedOn===null);)Uh(n),n.blockedOn===null&&Rh.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[_t]||null;if(typeof a==`function`)o||Yh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[_t]||null)s=o.formAction;else if(Ah(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Yh(n)}}}function Zh(){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 Qh(e){this._internalRoot=e}$h.prototype.render=Qh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;yh(n,Ld(),e,t,null,null)},$h.prototype.unmount=Qh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;yh(e.current,2,null,e,null,null),Gd(),t[vt]=null}};function $h(e){this._internalRoot=e}$h.prototype.unstable_scheduleHydration=function(e){if(e){var t=pt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rh.length&&t!==0&&t<Rh[n].priority;n++);Rh.splice(n,0,e),n===0&&Uh(e)}};var eg=n.version;if(eg!==`19.3.0`)throw Error(i(527,eg,`19.3.0`));W.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 tg={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:U,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var ng=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ng.isDisabled&&ng.supportsFiber)try{Ue=ng.inject(tg),We=ng}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Sc,s=Cc,c=wc;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=_h(e,1,!1,null,null,n,r,null,o,s,c,Zh),e[vt]=t.current,Qf(e),new Qh(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()})),_=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),v=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),y=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},b={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},x={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`currentColor`},S={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`currentColor`},C={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};function w(e){switch(e){case`outline`:return b;case`fill`:return x;case`glyph-duo`:return S;case`outline-duo`:return C;default:return b}}var T=c(u(),1),E=(0,T.forwardRef)(({color:e=`currentColor`,secondaryColor:t=`currentColor`,size:n=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:a=``,children:o,iconNode:s,variant:c=`outline`,sourceSize:l=24,...u},d)=>{let f=w(c),p=c===`outline`||c===`outline-duo`,m=c===`fill`||c===`glyph-duo`,h=`0 0 ${l} ${l}`,g=s.map(([n,r],i)=>{let a={...r};return a.fill&&a.fill!==`none`&&(a[`data-color`]===`color-2`&&t?a.fill=t:(!a[`data-color`]||a[`data-color`]===`color-1`)&&(a.fill=e)),a.stroke&&a.stroke!==`none`&&(a.stroke=a[`data-color`]===`color-2`&&t?t:e),(0,T.createElement)(n,{...a,key:i})});return(0,T.createElement)(`svg`,{ref:d,...f,viewBox:h,width:n,height:n,...p&&{stroke:e,strokeWidth:i?Number(r)*l/Number(n):r},...m&&{fill:e},className:v(`nucleo`,a),...!o&&!y(u)&&{"aria-hidden":`true`},...u},[...g,...Array.isArray(o)?o:o?[o]:[]])});E.displayName=`NucleoIcon`;var D=(e,t,n)=>{let r=(0,T.forwardRef)(({className:r,...i},a)=>(0,T.createElement)(E,{ref:a,iconNode:t,variant:n.variant,sourceSize:n.sourceSize,className:v(`nucleo-${_(n.componentName)}`,`nucleo-${e}`,r),...i}));return r.displayName=n.componentName,r},O=D(`arrow-left`,[[`line`,{x1:`2.75`,y1:`9`,x2:`15.25`,y2:`9`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`polyline`,{points:`7 13.25 2.75 9 7 4.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`arrow-left`,componentName:`ArrowLeft`,collection:`ui`,variant:`outline`,category:`arrows`,sourceSize:18,filePath:`ui/outline/arrows/18px_arrow-left.svg`}),k=D(`arrows-expand`,[[`polyline`,{points:`7 2.75 2.75 2.75 2.75 7`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`2.75`,y1:`2.75`,x2:`7`,y2:`7`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`polyline`,{points:`11 15.25 15.25 15.25 15.25 11`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`15.25`,y1:`15.25`,x2:`11`,y2:`11`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`polyline`,{points:`11 2.75 15.25 2.75 15.25 7`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`15.25`,y1:`2.75`,x2:`11`,y2:`7`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`polyline`,{points:`7 15.25 2.75 15.25 2.75 11`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`2.75`,y1:`15.25`,x2:`7`,y2:`11`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}]],{name:`arrows-expand`,componentName:`ArrowsExpand`,collection:`ui`,variant:`outline`,category:`arrows`,sourceSize:18,filePath:`ui/outline/arrows/18px_arrows-expand.svg`}),A=D(`arrows-to-center`,[[`circle`,{cx:`9`,cy:`9`,r:`2.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`polyline`,{points:`5.75 2.25 5.75 5.75 2.25 5.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`5.75`,y1:`5.75`,x2:`2.5`,y2:`2.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`polyline`,{points:`15.75 5.75 12.25 5.75 12.25 2.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`12.25`,y1:`5.75`,x2:`15.5`,y2:`2.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`polyline`,{points:`12.25 15.75 12.25 12.25 15.75 12.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`12.25`,y1:`12.25`,x2:`15.5`,y2:`15.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`polyline`,{points:`2.25 12.25 5.75 12.25 5.75 15.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`5.75`,y1:`12.25`,x2:`2.5`,y2:`15.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`arrows-to-center`,componentName:`ArrowsToCenter`,collection:`ui`,variant:`outline`,category:`arrows`,sourceSize:18,filePath:`ui/outline/arrows/18px_arrows-to-center.svg`}),j=D(`bullet-list`,[[`path`,{d:`M8.75 11.25H15.75`,stroke:`black`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`}],[`path`,{d:`M8.75 14.75H15.75`,stroke:`black`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`}],[`path`,{d:`M8.75 4.25H15.75`,stroke:`black`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`}],[`path`,{d:`M8.75 7.75H15.75`,stroke:`black`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`}],[`path`,{d:`M4 5.75C4.9665 5.75 5.75 4.966 5.75 4C5.75 3.034 4.9665 2.25 4 2.25C3.0335 2.25 2.25 3.034 2.25 4C2.25 4.966 3.0335 5.75 4 5.75Z`,stroke:`#000`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"data-color":`color-2`,fill:`none`}],[`path`,{d:`M4 12.75C4.9665 12.75 5.75 11.966 5.75 11C5.75 10.034 4.9665 9.25 4 9.25C3.0335 9.25 2.25 10.034 2.25 11C2.25 11.966 3.0335 12.75 4 12.75Z`,stroke:`#000`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"data-color":`color-2`,fill:`none`}]],{name:`bullet-list`,componentName:`BulletList`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_bullet-list.svg`}),M=D(`button-cursor`,[[`path`,{d:`m16.25,9.5v3c0,1.5188-1.2312,2.75-2.75,2.75H4.5c-1.5188,0-2.75-1.2312-2.75-2.75v-3`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`path`,{d:`m8.1263,7.2324l5.94-2.1704c.2503-.0914.243-.4479-.0107-.5291l-2.7185-.8699-.8699-2.7185c-.0812-.2538-.4377-.261-.5291-.0107l-2.1704,5.94c-.0816.2235.1352.4404.3587.3587Z`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`path`,{d:`m4.7712,6.75h-.2712c-1.5188,0-2.75,1.2312-2.75,2.75s1.2312,2.75,2.75,2.75h9c1.5188,0,2.75-1.2312,2.75-2.75,0-.7036-.272-1.3384-.7067-1.8247`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`button-cursor`,componentName:`ButtonCursor`,collection:`ui`,variant:`outline`,category:`design-development`,sourceSize:18,filePath:`ui/outline/design-development/18px_button-cursor.svg`}),N=D(`chat-bubble`,[[`path`,{d:`M13.75,2.75H4.25c-1.105,0-2,.895-2,2v11.5l3.75-3h7.75c1.105,0,2-.895,2-2V4.75c0-1.105-.895-2-2-2Z`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`chat-bubble`,componentName:`ChatBubble`,collection:`ui`,variant:`outline`,category:`communication`,sourceSize:18,filePath:`ui/outline/communication/18px_chat-bubble.svg`}),P=D(`chevron-down`,[[`polyline`,{points:`15.25 6.5 9 12.75 2.75 6.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`chevron-down`,componentName:`ChevronDown`,collection:`ui`,variant:`outline`,category:`arrows`,sourceSize:18,filePath:`ui/outline/arrows/18px_chevron-down.svg`}),F=D(`chevron-left`,[[`polyline`,{points:`11.5 15.25 5.25 9 11.5 2.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`chevron-left`,componentName:`ChevronLeft`,collection:`ui`,variant:`outline`,category:`arrows`,sourceSize:18,filePath:`ui/outline/arrows/18px_chevron-left.svg`}),I=D(`chevron-right`,[[`polyline`,{points:`6.5 2.75 12.75 9 6.5 15.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`chevron-right`,componentName:`ChevronRight`,collection:`ui`,variant:`outline`,category:`arrows`,sourceSize:18,filePath:`ui/outline/arrows/18px_chevron-right.svg`}),L=D(`chevron-up`,[[`polyline`,{points:`2.75 11.5 9 5.25 15.25 11.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`chevron-up`,componentName:`ChevronUp`,collection:`ui`,variant:`outline`,category:`arrows`,sourceSize:18,filePath:`ui/outline/arrows/18px_chevron-up.svg`}),R=D(`circle-check`,[[`circle`,{cx:`9`,cy:`9`,r:`7.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`polyline`,{points:`5.75 9.25 8 11.75 12.25 6.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}]],{name:`circle-check`,componentName:`CircleCheck`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_circle-check.svg`}),z=D(`clock`,[[`circle`,{cx:`9`,cy:`9`,r:`7.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`polyline`,{points:`9 4.75 9 9 12.25 11.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}]],{name:`clock`,componentName:`Clock`,collection:`ui`,variant:`outline`,category:`time`,sourceSize:18,filePath:`ui/outline/time/18px_clock.svg`}),B=D(`divider-y`,[[`path`,{d:`m2.75,2.25v1.5c0,1.105.895,2,2,2h8.5c1.105,0,2-.895,2-2v-1.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`path`,{d:`m2.75,15.75v-1.5c0-1.105.895-2,2-2h8.5c1.105,0,2,.895,2,2v1.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`16`,y1:`9`,x2:`2`,y2:`9`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}]],{name:`divider-y`,componentName:`DividerY`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_divider-y.svg`}),V=D(`download`,[[`path`,{d:`M12 6.25H12.335C13.3 6.25 14.127 6.939 14.302 7.888L15.315 13.388C15.541 14.617 14.598 15.75 13.348 15.75H4.65199C3.40199 15.75 2.45899 14.617 2.68499 13.388L3.69799 7.888C3.87299 6.939 4.69999 6.25 5.66499 6.25H5.99999`,stroke:`black`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`}],[`path`,{d:`M12 9.5L9 12.5L6 9.5`,stroke:`#000`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"data-color":`color-2`,fill:`none`}],[`path`,{d:`M9 12.5V1.25`,stroke:`#000`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"data-color":`color-2`,fill:`none`}]],{name:`download`,componentName:`Download`,collection:`ui`,variant:`outline`,category:`arrows`,sourceSize:18,filePath:`ui/outline/arrows/18px_download.svg`}),ee=D(`envelope`,[[`path`,{d:`M1.75,5.75l6.767,3.733c.301,.166,.665,.166,.966,0l6.767-3.733`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`rect`,{x:`1.75`,y:`3.25`,width:`14.5`,height:`11.5`,rx:`2`,ry:`2`,transform:`translate(18 18) rotate(180)`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`envelope`,componentName:`Envelope`,collection:`ui`,variant:`outline`,category:`communication`,sourceSize:18,filePath:`ui/outline/communication/18px_envelope.svg`}),te=D(`eye`,[[`path`,{d:`M9 11.75C10.5188 11.75 11.75 10.5188 11.75 9C11.75 7.48122 10.5188 6.25 9 6.25C7.48122 6.25 6.25 7.48122 6.25 9C6.25 10.5188 7.48122 11.75 9 11.75Z`,stroke:`#000`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"data-color":`color-2`,fill:`none`}],[`path`,{d:`M15.9557 7.88669C16.3481 8.57939 16.3481 9.42049 15.9557 10.1132C15.0087 11.7849 12.7944 14.4999 9 14.4999C5.2056 14.4999 2.9912 11.7849 2.0443 10.1132C1.6519 9.42049 1.6519 8.57939 2.0443 7.88669C2.9913 6.21499 5.2056 3.5 9 3.5C12.7944 3.5 15.0088 6.21499 15.9557 7.88669Z`,stroke:`black`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`}]],{name:`eye`,componentName:`Eye`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_eye.svg`}),ne=D(`files`,[[`path`,{d:`M5.25,13.25h-1c-1.105,0-2-.895-2-2V3.25c0-1.105,.895-2,2-2h5c1.105,0,2,.895,2,2v1.052`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`path`,{d:`M5.25,14.25V6.25c0-1.105,.895-2,2-2h4.086c.265,0,.52,.105,.707,.293l2.914,2.914c.188,.188,.293,.442,.293,.707v6.086c0,1.105-.895,2-2,2H7.25c-1.105,0-2-.895-2-2Z`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`path`,{d:`M15.25,8.25h-3c-.552,0-1-.448-1-1v-3`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`files`,componentName:`Files`,collection:`ui`,variant:`outline`,category:`files`,sourceSize:18,filePath:`ui/outline/files/18px_files.svg`}),H=D(`frame`,[[`line`,{x1:`4.75`,y1:`2.25`,x2:`4.75`,y2:`.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`13.25`,y1:`2.25`,x2:`13.25`,y2:`.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`4.75`,y1:`17.25`,x2:`4.75`,y2:`15.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`13.25`,y1:`17.25`,x2:`13.25`,y2:`15.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`15.75`,y1:`4.75`,x2:`17.25`,y2:`4.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`15.75`,y1:`13.25`,x2:`17.25`,y2:`13.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`.75`,y1:`4.75`,x2:`2.25`,y2:`4.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`.75`,y1:`13.25`,x2:`2.25`,y2:`13.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`rect`,{x:`4.75`,y:`4.75`,width:`8.5`,height:`8.5`,rx:`2`,ry:`2`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`frame`,componentName:`Frame`,collection:`ui`,variant:`outline`,category:`design-development`,sourceSize:18,filePath:`ui/outline/design-development/18px_frame.svg`}),re=D(`grid-layout-rows`,[[`rect`,{x:`2.75`,y:`2.75`,width:`12.5`,height:`4.5`,rx:`1.5`,ry:`1.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`rect`,{x:`2.75`,y:`10.75`,width:`12.5`,height:`4.5`,rx:`1.5`,ry:`1.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}]],{name:`grid-layout-rows`,componentName:`GridLayoutRows`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_grid-layout-rows.svg`}),ie=D(`heading-1`,[[`line`,{x1:`2.75`,y1:`4.75`,x2:`2.75`,y2:`13.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`8.75`,y1:`4.75`,x2:`8.75`,y2:`13.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`2.75`,y1:`9`,x2:`8.75`,y2:`9`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`path`,{d:`M14.75,13.25V4.75s-.974,1.713-3.04,2.108`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}]],{name:`heading-1`,componentName:`Heading1`,collection:`ui`,variant:`outline`,category:`editing`,sourceSize:18,filePath:`ui/outline/editing/18px_heading-1.svg`}),ae=D(`image`,[[`path`,{d:`M3.762,14.989l6.074-6.075c.781-.781,2.047-.781,2.828,0l2.586,2.586`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`rect`,{x:`2.75`,y:`2.75`,width:`12.5`,height:`12.5`,rx:`2`,ry:`2`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`circle`,{cx:`6.25`,cy:`7.25`,r:`1.25`,fill:`#000`,"data-color":`color-2`,"data-stroke":`none`}]],{name:`image`,componentName:`Image`,collection:`ui`,variant:`outline`,category:`editing`,sourceSize:18,filePath:`ui/outline/editing/18px_image.svg`}),oe=D(`layers`,[[`path`,{d:`M2.58,6.149L8.385,1.949c.367-.266,.864-.266,1.231,0l5.805,4.2c.579,.419,.579,1.282,0,1.701l-5.805,4.2c-.367,.266-.864,.266-1.231,0L2.58,7.851c-.579-.419-.579-1.282,0-1.701Z`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`path`,{d:`M15.746,10.533c.217,.439,.109,1.003-.326,1.317l-5.805,4.2c-.184,.133-.4,.199-.615,.199-.216,0-.432-.066-.615-.199L2.58,11.851c-.434-.314-.543-.878-.326-1.317`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}]],{name:`layers`,componentName:`Layers`,collection:`ui`,variant:`outline`,category:`design-development`,sourceSize:18,filePath:`ui/outline/design-development/18px_layers.svg`}),se=D(`loader`,[[`line`,{x1:`9`,y1:`1.75`,x2:`9`,y2:`4.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`14.127`,y1:`3.873`,x2:`12.359`,y2:`5.641`,fill:`none`,opacity:`.88`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`16.25`,y1:`9`,x2:`13.75`,y2:`9`,fill:`none`,opacity:`.75`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`14.127`,y1:`14.127`,x2:`12.359`,y2:`12.359`,fill:`none`,opacity:`.63`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`9`,y1:`16.25`,x2:`9`,y2:`13.75`,fill:`none`,opacity:`.5`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`3.873`,y1:`14.127`,x2:`5.641`,y2:`12.359`,fill:`none`,opacity:`.38`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`1.75`,y1:`9`,x2:`4.25`,y2:`9`,fill:`none`,opacity:`.25`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`3.873`,y1:`3.873`,x2:`5.641`,y2:`5.641`,fill:`none`,opacity:`.13`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`loader`,componentName:`Loader`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_loader.svg`}),U=D(`message`,[[`path`,{d:`M14.25,2.25H3.75c-1.105,0-2,.896-2,2v7c0,1.104,.895,2,2,2h2v3l3.75-3h4.75c1.105,0,2-.896,2-2V4.25c0-1.104-.895-2-2-2Z`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`message`,componentName:`Message`,collection:`ui`,variant:`outline`,category:`communication`,sourceSize:18,filePath:`ui/outline/communication/18px_message.svg`}),W=D(`mobile`,[[`path`,{d:`M10.5 2H7.5V2.75H10.5V2Z`,stroke:`#000`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"data-color":`color-2`,fill:`none`}],[`path`,{d:`M12.25 1.75H5.75C4.6454 1.75 3.75 2.6454 3.75 3.75V14.25C3.75 15.3546 4.6454 16.25 5.75 16.25H12.25C13.3546 16.25 14.25 15.3546 14.25 14.25V3.75C14.25 2.6454 13.3546 1.75 12.25 1.75Z`,stroke:`black`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`}]],{name:`mobile`,componentName:`Mobile`,collection:`ui`,variant:`outline`,category:`technology-devices`,sourceSize:18,filePath:`ui/outline/technology-devices/18px_mobile.svg`}),ce=D(`monitor`,[[`path`,{d:`M5.75 15.75C6.508 15.511 7.628 15.25 9 15.25C9.795 15.25 10.941 15.338 12.25 15.75`,stroke:`#000`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"data-color":`color-2`,fill:`none`}],[`path`,{d:`M9 12.75V15.25`,stroke:`#000`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"data-color":`color-2`,fill:`none`}],[`path`,{d:`M14.25 2.75H3.75C2.64543 2.75 1.75 3.64543 1.75 4.75V10.75C1.75 11.8546 2.64543 12.75 3.75 12.75H14.25C15.3546 12.75 16.25 11.8546 16.25 10.75V4.75C16.25 3.64543 15.3546 2.75 14.25 2.75Z`,stroke:`black`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`}]],{name:`monitor`,componentName:`Monitor`,collection:`ui`,variant:`outline`,category:`technology-devices`,sourceSize:18,filePath:`ui/outline/technology-devices/18px_monitor.svg`}),le=D(`moon`,[[`path`,{d:`M13,11.75c-3.452,0-6.25-2.798-6.25-6.25,0-1.352,.433-2.599,1.162-3.622-3.364,.628-5.912,3.575-5.912,7.122,0,4.004,3.246,7.25,7.25,7.25,3.372,0,6.198-2.306,7.009-5.424-.95,.583-2.063,.924-3.259,.924Z`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`moon`,componentName:`Moon`,collection:`ui`,variant:`outline`,category:`weather`,sourceSize:18,filePath:`ui/outline/weather/18px_moon.svg`}),ue=D(`paper-plane`,[[`path`,{d:`M5.75,10.022v4.246c0,.409,.464,.645,.794,.404l.74-.539`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`15.58`,y1:`2.569`,x2:`5.75`,y2:`10.022`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`path`,{d:`M2.883,6.935L15.182,2.542c.363-.13,.73,.183,.66,.562l-2.196,11.86c-.067,.363-.492,.531-.789,.311L2.754,7.807c-.322-.238-.248-.738,.129-.873Z`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`paper-plane`,componentName:`PaperPlane`,collection:`ui`,variant:`outline`,category:`communication`,sourceSize:18,filePath:`ui/outline/communication/18px_paper-plane.svg`}),de=D(`paragraph`,[[`path`,{d:`M11.067,3.317c0-1.141-.925-2.067-2.067-2.067s-2.067,.925-2.067,2.067,.517,1.55,2.067,2.583c1.359,.906,3.1,2.067,3.1,3.617,0,1.712-1.388,2.583-3.1,2.583`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`path`,{d:`M6.933,14.683c0,1.141,.925,2.067,2.067,2.067s2.067-.925,2.067-2.067-.707-1.677-2.067-2.583c-1.55-1.033-3.1-2.067-3.1-3.617,0-1.712,1.388-2.583,3.1-2.583`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}]],{name:`paragraph`,componentName:`Paragraph`,collection:`ui`,variant:`outline`,category:`editing`,sourceSize:18,filePath:`ui/outline/editing/18px_paragraph.svg`}),fe=D(`sidebar-left`,[[`line`,{x1:`6.25`,y1:`2.75`,x2:`6.25`,y2:`15.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`rect`,{x:`1.75`,y:`2.75`,width:`14.5`,height:`12.5`,rx:`2`,ry:`2`,transform:`translate(18 18) rotate(180)`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`sidebar-left`,componentName:`SidebarLeft`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_sidebar-left.svg`}),pe=D(`sidebar-left-hide`,[[`line`,{x1:`6.25`,y1:`2.75`,x2:`6.25`,y2:`15.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`polyline`,{points:`12.25 6.5 9.75 9 12.25 11.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`rect`,{x:`1.75`,y:`2.75`,width:`14.5`,height:`12.5`,rx:`2`,ry:`2`,transform:`translate(18 18) rotate(180)`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`sidebar-left-hide`,componentName:`SidebarLeftHide`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_sidebar-left-hide.svg`}),me=D(`sidebar-right`,[[`line`,{x1:`11.75`,y1:`2.75`,x2:`11.75`,y2:`15.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`rect`,{x:`1.75`,y:`2.75`,width:`14.5`,height:`12.5`,rx:`2`,ry:`2`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`sidebar-right`,componentName:`SidebarRight`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_sidebar-right.svg`}),he=D(`sidebar-right-hide`,[[`line`,{x1:`11.75`,y1:`2.75`,x2:`11.75`,y2:`15.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`polyline`,{points:`5.75 6.5 8.25 9 5.75 11.5`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`rect`,{x:`1.75`,y:`2.75`,width:`14.5`,height:`12.5`,rx:`2`,ry:`2`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`sidebar-right-hide`,componentName:`SidebarRightHide`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_sidebar-right-hide.svg`}),ge=D(`sliders`,[[`line`,{x1:`13.25`,y1:`5.25`,x2:`16.25`,y2:`5.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`1.75`,y1:`5.25`,x2:`8.75`,y2:`5.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`circle`,{cx:`11`,cy:`5.25`,r:`2.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`4.75`,y1:`12.75`,x2:`1.75`,y2:`12.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`16.25`,y1:`12.75`,x2:`9.25`,y2:`12.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`circle`,{cx:`7`,cy:`12.75`,r:`2.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}]],{name:`sliders`,componentName:`Sliders`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_sliders.svg`}),_e=D(`sparkle`,[[`path`,{d:`M6.65802 4.02597L5.39502 3.60495L4.97402 2.34195C4.83702 1.93395 4.16202 1.93395 4.02502 2.34195L3.60402 3.60495L2.34102 4.02597C2.13702 4.09397 1.99902 4.28497 1.99902 4.49997C1.99902 4.71497 2.13702 4.90597 2.34102 4.97397L3.60402 5.39499L4.02502 6.65799C4.09302 6.86199 4.28502 6.99997 4.50002 6.99997C4.71502 6.99997 4.90602 6.86199 4.97502 6.65799L5.39602 5.39499L6.65902 4.97397C6.86302 4.90597 7.00102 4.71497 7.00102 4.49997C7.00102 4.28497 6.86202 4.09397 6.65802 4.02597Z`,fill:`#000`,"data-color":`color-2`,"data-stroke":`none`}],[`path`,{d:`M15.658 13.026L14.395 12.605L13.974 11.3419C13.837 10.9339 13.162 10.9339 13.025 11.3419L12.604 12.605L11.341 13.026C11.137 13.094 10.999 13.285 10.999 13.5C10.999 13.715 11.137 13.906 11.341 13.974L12.604 14.395L13.025 15.658C13.093 15.862 13.285 16 13.5 16C13.715 16 13.906 15.862 13.975 15.658L14.396 14.395L15.659 13.974C15.863 13.906 16.001 13.715 16.001 13.5C16.001 13.285 15.862 13.094 15.658 13.026Z`,fill:`#000`,"data-color":`color-2`,"data-stroke":`none`}],[`path`,{d:`M6 8.75L6.671 11.329L9.25 12L6.671 12.671L6 15.25L5.329 12.671L2.75 12L5.329 11.329L6 8.75Z`,fill:`black`,stroke:`black`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}],[`path`,{d:`M12 2.75L12.671 5.32898L15.25 6L12.671 6.67102L12 9.25L11.329 6.67102L8.75 6L11.329 5.32898L12 2.75Z`,fill:`black`,stroke:`black`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}]],{name:`sparkle`,componentName:`Sparkle`,collection:`ui`,variant:`outline`,category:`editing`,sourceSize:18,filePath:`ui/outline/editing/18px_sparkle.svg`}),ve=D(`sun`,[[`line`,{x1:`9`,y1:`1.25`,x2:`9`,y2:`2.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`14.48`,y1:`3.52`,x2:`13.773`,y2:`4.227`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`16.75`,y1:`9`,x2:`15.75`,y2:`9`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`14.48`,y1:`14.48`,x2:`13.773`,y2:`13.773`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`9`,y1:`16.75`,x2:`9`,y2:`15.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`3.52`,y1:`14.48`,x2:`4.227`,y2:`13.773`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`1.25`,y1:`9`,x2:`2.25`,y2:`9`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`3.52`,y1:`3.52`,x2:`4.227`,y2:`4.227`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`circle`,{cx:`9`,cy:`9`,r:`4.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`sun`,componentName:`Sun`,collection:`ui`,variant:`outline`,category:`weather`,sourceSize:18,filePath:`ui/outline/weather/18px_sun.svg`}),ye=D(`text-columns`,[[`line`,{x1:`2.25`,y1:`10.75`,x2:`7.5`,y2:`10.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`2.25`,y1:`14.25`,x2:`7.5`,y2:`14.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`2.25`,y1:`7.25`,x2:`7.5`,y2:`7.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`2.25`,y1:`3.75`,x2:`7.5`,y2:`3.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}],[`line`,{x1:`10.5`,y1:`10.75`,x2:`15.75`,y2:`10.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`10.5`,y1:`14.25`,x2:`15.75`,y2:`14.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`10.5`,y1:`7.25`,x2:`15.75`,y2:`7.25`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`10.5`,y1:`3.75`,x2:`15.75`,y2:`3.75`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}]],{name:`text-columns`,componentName:`TextColumns`,collection:`ui`,variant:`outline`,category:`editing`,sourceSize:18,filePath:`ui/outline/editing/18px_text-columns.svg`}),be=D(`xmark`,[[`line`,{x1:`14`,y1:`4`,x2:`4`,y2:`14`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,"data-color":`color-2`}],[`line`,{x1:`4`,y1:`4`,x2:`14`,y2:`14`,fill:`none`,stroke:`#000`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}]],{name:`xmark`,componentName:`Xmark`,collection:`ui`,variant:`outline`,category:`ui-layout`,sourceSize:18,filePath:`ui/outline/ui-layout/18px_xmark.svg`}),xe=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let e=0,r=t.length;e<r;e++)n=t[e](n);return n}}},Se={pipe(){return xe(this,arguments)}},Ce=function(){function e(){}return e.prototype=Se,e}(),we=function(e,t){if(typeof e==`function`)return function(){return e(arguments)?t.apply(this,arguments):e=>t(e,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(e,n){return arguments.length>=2?t(e,n):function(n){return t(n,e)}};case 3:return function(e,n,r){return arguments.length>=3?t(e,n,r):function(r){return t(r,e,n)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let n=arguments;return function(e){return t(e,...n)}}}},Te=e=>e,Ee=e=>()=>e,De=Ee(!0),Oe=Ee(void 0),ke=Oe;function Ae(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}function je(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),t.set(i,i),i}}var Me=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete(`stack`);let n=Object.getPrototypeOf(e),r=n;for(;r!==null&&r!==Object.prototype;){let e=Reflect.ownKeys(r);for(let n=0;n<e.length;n++)t.add(e[n]);r=Object.getPrototypeOf(r)}return t.has(`constructor`)&&typeof e.constructor==`function`&&n===e.constructor.prototype&&t.delete(`constructor`),t},Ne=new WeakSet;function Pe(e){return typeof e==`string`}function Fe(e){return typeof e==`number`}function Ie(e){return typeof e==`boolean`}function Le(e){return typeof e==`symbol`}function Re(e){return Pe(e)||Fe(e)||Le(e)}function ze(e){return typeof e==`function`}function Be(e){return e!=null}function Ve(e){return!0}function He(e){return typeof e==`object`&&!!e||ze(e)}var Ue=we(2,(e,t)=>He(e)&&t in e),We=`~effect/Hash`,Ge=e=>{switch(typeof e){case`number`:return Xe(e);case`bigint`:return Ze(e.toString(10));case`string`:return Ze(e);case`undefined`:return Ze(`undefined`);case`function`:case`object`:if(e===null)return Ze(`null`);if(e instanceof Date)return Number.isNaN(e.getTime())?Ze(`Invalid Date`):Ze(e.toISOString());if(e instanceof RegExp)return Ze(e.toString());{if(Ne.has(e))return Ke(e);if(at.has(e))return at.get(e);let t=st(e,()=>Ye(e)?e[We]():typeof e==`function`?Ke(e):e instanceof DataView?tt(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)):Array.isArray(e)||ArrayBuffer.isView(e)?tt(e):e instanceof Map?nt(e):e instanceof Set?rt(e):$e(e));return at.set(e,t),t}default:return Ze(String(e))}},Ke=e=>(it.has(e)||it.set(e,Xe(Math.floor(Math.random()*(2**53-1)))),it.get(e)),qe=we(2,(e,t)=>e*53^t),Je=e=>e&3221225471|e>>>1&1073741824,Ye=e=>Ue(e,We),Xe=e=>{if(e!==e||e===1/0||e===-1/0)return Ze(String(e));let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return Je(t)},Ze=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return Je(t)},Qe=(e,t)=>{let n=12289;for(let r of t)n^=qe(Ge(r),Ge(e[r]));return Je(n)},$e=e=>Qe(e,Me(e)),et=(e,t)=>n=>{let r=e;for(let e of n)r^=t(e);return Je(r)},tt=et(6151,Ge),nt=et(Ze(`Map`),([e,t])=>qe(Ge(e),Ge(t))),rt=et(Ze(`Set`),Ge),it=new WeakMap,at=new WeakMap,ot=new WeakSet;function st(e,t){if(ot.has(e))return Ze(`[Circular]`);ot.add(e);let n=t();return ot.delete(e),n}var ct=`~effect/Equal`;function lt(){return arguments.length===1?e=>ut(e,arguments[0]):ut(arguments[0],arguments[1])}function ut(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=typeof e;return n===typeof t?n===`number`&&e!==e&&t!==t?!0:n!==`object`&&n!==`function`||Ne.has(e)||Ne.has(t)?!1:ht(e,t,mt):!1}function dt(e,t,n){let r=ft.has(e),i=pt.has(t);if(r&&i)return!0;if(r||i)return!1;ft.add(e),pt.add(t);let a=n();return ft.delete(e),pt.delete(t),a}var ft=new WeakSet,pt=new WeakSet;function mt(e,t){if(Ge(e)!==Ge(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let n=e.getTime(),r=t.getTime();return n===r||Number.isNaN(n)&&Number.isNaN(r)}if(e instanceof RegExp)return t instanceof RegExp&&e.toString()===t.toString();let n=wt(e),r=wt(t);if(n!==r)return!1;let i=n&&r;return typeof e==`function`&&!i?!1:dt(e,t,()=>{if(i)return e[ct](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:_t(e,t);if(ArrayBuffer.isView(e)){let n=e instanceof DataView;if(!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView)return!1;if(n){let n=t;return vt(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(n.buffer,n.byteOffset,n.byteLength))}return vt(e,t)}return e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:xt(e,t):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:Ct(e,t):yt(e,t)})}function ht(e,t,n){let r=gt.get(e);if(!r)r=new WeakMap,gt.set(e,r);else if(r.has(t))return r.get(t);let i=n(e,t);r.set(t,i);let a=gt.get(t);return a||(a=new WeakMap,gt.set(t,a)),a.set(e,i),i}var gt=new WeakMap;function _t(e,t){for(let n=0;n<e.length;n++)if(!ut(e[n],t[n]))return!1;return!0}function vt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function yt(e,t){let n=Me(e),r=Me(t);if(n.size!==r.size)return!1;for(let i of n)if(!r.has(i)||!ut(e[i],t[i]))return!1;return!0}function bt(e,t){return function(n,r){let i=Array.from(r);for(let[r,a]of n){let n=!1;for(let o=0;o<i.length;o++){let[s,c]=i[o];if(e(r,s)&&t(a,c)){i[o]=i[i.length-1],i.pop(),n=!0;break}}if(!n)return!1}return!0}}var xt=bt(ut,ut);function St(e){return function(t,n){let r=Array.from(n);for(let n of t){let t=!1;for(let i=0;i<r.length;i++){let a=r[i];if(e(n,a)){r[i]=r[r.length-1],r.pop(),t=!0;break}}if(!t)return!1}return!0}}var Ct=St(ut),wt=e=>Ue(e,ct),Tt=e=>(t,n)=>t===n||e(t,n),Et=e=>e.length>0,Dt=e=>e>0?Math.floor(e):0;function Ot(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function kt(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&Ot(e,n,t[n])}var At=Symbol.for(`~effect/Redactable`),jt=e=>Ue(e,At);function Mt(e){return jt(e)?Nt(e):e}function Nt(e){return e[At](globalThis[`~effect/Fiber/currentFiber`]?.context??It)}var Pt=`~effect/Fiber/currentFiber`,Ft=new Map,It={"~effect/Context":{},base:Ft,depth:0,mapUnsafe:Ft,pipe(){return xe(this,arguments)}};function Lt(e,t){let n=t?.space??0,r=new WeakSet,i=n?typeof n==`number`?` `.repeat(n):n:``,a=e=>i.repeat(e),o=(e,t)=>{let n=e?.constructor;return n&&n!==Object.prototype.constructor&&n.name?`${n.name}(${t})`:t},s=e=>{try{return Reflect.ownKeys(e)}catch{return[`[ownKeys threw]`]}};function c(e,t=0){try{return l(e,t)}catch{return(typeof e==`object`&&e||typeof e==`function`)&&r.delete(e),`[inspection threw]`}}function l(e,n=0){if(typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`||e==null||typeof e==`boolean`||typeof e==`symbol`)return String(e);if(typeof e==`bigint`)return String(e)+`n`;if(typeof e==`object`||typeof e==`function`){if(r.has(e))return Rt;r.add(e);let l;if(At in e)l=c(Nt(e),n);else if(Array.isArray(e))l=!i||e.length<=1?`[${e.map(e=>c(e,n)).join(`,`)}]`:`[\n${a(n+1)}${e.map(e=>c(e,n+1)).join(`,
10
+ `+a(n+1))}\n${a(n)}]`;else if(e instanceof Date)l=Bt(e);else if(!t?.ignoreToString&&Ue(e,`toString`)&&typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=Vt(e);l=e instanceof Error&&e.cause!==void 0?`${t} (cause: ${c(e.cause,n)})`:t}else if(Symbol.iterator in e)l=`${e.constructor.name}(${c(Array.from(e),n)})`;else{let t=s(e);if(!i||t.length<=1){let r=`{${t.map(t=>`${zt(t)}:${c(Ht(e,t),n)}`).join(`,`)}}`;l=o(e,r)}else{let r=`{\n${t.map(t=>`${a(n+1)}${zt(t)}: ${c(Ht(e,t),n+1)}`).join(`,
11
+ `)}\n${a(n)}}`;l=o(e,r)}}return r.delete(e),l}return String(e)}return c(e,0)}var Rt=`[Circular]`;function zt(e){return typeof e==`string`?JSON.stringify(e):String(e)}function Bt(e){try{return e.toISOString()}catch{return`Invalid Date`}}function Vt(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}function Ht(e,t){try{return e[t]}catch{return`[property access threw]`}}var Ut=Symbol.for(`nodejs.util.inspect.custom`),Wt=e=>{try{return e=Mt(e),Ue(e,`toJSON`)&&ze(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(Wt):e}catch{return`[toJSON threw]`}},Gt={toJSON(){return Wt(this)},[Ut](){return this.toJSON()},toString(){return Lt(this.toJSON())}},Kt=()=>Error.stackTraceLimit,qt=class e{called=!1;self;constructor(e){this.self=e}next(e){return this.called?{value:e,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new e(this.self)}},Jt=(()=>{let e=`~effect/Utils/internal`,t={[e]:e=>e()},n={[e]:e=>{try{return e()}finally{}}};return Kt()!==0&&t[e](()=>Error().stack)?.includes(e)===!0?t[e]:n[e]})(),Yt=`~effect/Effect`,Xt=`~effect/Exit`,Zt={_A:Te,_E:Te,_R:Te},Qt=`${Yt}/identifier`,$t=`${Yt}/args`,en=`${Yt}/evaluate`,tn=`${Yt}/successCont`,nn=`${Yt}/failureCont`,rn=`${Yt}/ensureCont`,an=Symbol.for(`effect/Effect/Yield`),on={pipe(){return xe(this,arguments)},toJSON(){return{...this}},toString(){return Lt(this.toJSON(),{ignoreToString:!0,space:2})},[Ut](){return this.toJSON()}},sn={[Yt]:Zt,...on,[Symbol.iterator](){return new qt(this)},toJSON(){return{_id:`Effect`,op:this[Qt],...$t in this?{args:this[$t]}:void 0}}},cn=e=>Ue(e,Yt),ln=e=>Ue(e,Xt),un=`~effect/Cause`,dn=`~effect/Cause/Reason`,fn=e=>Ue(e,un),pn=class{constructor(e){this[un]=un,this.reasons=e}pipe(){return xe(this,arguments)}toJSON(){return{_id:`Cause`,failures:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${Lt(this.reasons)})`}[Ut](){return this.toJSON()}[ct](e){return fn(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>lt(t,e.reasons[n]))}[We](){return tt(this.reasons)}},mn=new WeakMap,hn=class{[dn];annotations;_tag;constructor(e,t,n){if(this[dn]=dn,this._tag=e,t!==gn&&typeof n==`object`&&n&&t.size>0){let e=mn.get(n);e&&(t=new Map([...e,...t])),mn.set(n,t)}this.annotations=t}annotate(e,t){if(e.mapUnsafe.size===0)return this;let n=new Map(this.annotations);e.mapUnsafe.forEach((e,r)=>{t?.overwrite!==!0&&n.has(r)||n.set(r,e)});let r=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return r.annotations=n,r}pipe(){return xe(this,arguments)}toString(){return Lt(this)}[Ut](){return this.toString()}},gn=new Map,_n=class extends hn{constructor(e,t=gn){super(`Fail`,t,e),this.error=e}toString(){return`Fail(${Lt(this.error)})`}toJSON(){return{_tag:`Fail`,error:this.error}}[ct](e){return Cn(e)&&lt(this.error,e.error)&&lt(this.annotations,e.annotations)}[We](){return qe(Ze(this._tag))(qe(Ge(this.error))(Ge(this.annotations)))}},vn=e=>new pn(e),yn=e=>new pn([new _n(e)]),bn=class extends hn{constructor(e,t=gn){super(`Die`,t,e),this.defect=e}toString(){return`Die(${Lt(this.defect)})`}toJSON(){return{_tag:`Die`,defect:this.defect}}[ct](e){return wn(e)&&lt(this.defect,e.defect)&&lt(this.annotations,e.annotations)}[We](){return qe(Ze(this._tag))(qe(Ge(this.defect))(Ge(this.annotations)))}},xn=e=>new pn([new bn(e)]),Sn=we(e=>fn(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new pn(e.reasons.map(e=>e.annotate(t,n)))),Cn=e=>e._tag===`Fail`,wn=e=>e._tag===`Die`,Tn=e=>e._tag===`Interrupt`;function En(e){return Fn(`Effect.evaluate: Not implemented`)}var Dn=e=>({...sn,[Qt]:e.op,[en]:e[en]??En,[tn]:e[tn],[nn]:e[nn],[rn]:e[rn]}),On=e=>{let t=Dn(e),n=function(e){this[$t]=e};return n.prototype=t,function(e){return new n(e)}},kn=e=>{let t={[Xt]:Xt,_tag:e.op,get[e.prop](){return this[$t]},...Dn(e),toString(){return`${e.op}(${Lt(this[$t])})`},toJSON(){return{_id:`Exit`,_tag:e.op,[e.prop]:this[$t]}},[ct](e){return ln(e)&&e._tag===this._tag&&lt(this[$t],e[$t])},[We](){return qe(Ze(e.op),Ge(this[$t]))}},n=function(e){this[$t]=e};return n.prototype=t,function(e){return new n(e)}},An=kn({op:`Success`,prop:`value`,[en](e){let t=e.getCont(tn);return t?t[tn](this[$t],e,this):e.yieldWith(this)}}),jn={key:`effect/Cause/StackTrace`},Mn={key:`effect/Cause/InterruptorStackTrace`},Nn=kn({op:`Failure`,prop:`cause`,[en](e){let t=this[$t],n=!1;e.cache.stackFrame&&(t=Sn(t,{mapUnsafe:new Map([[jn.key,e.cache.stackFrame]])}),n=!0);let r=e.getCont(nn);for(;e.interruptible&&e._interruptedCause&&r;)r=e.getCont(nn);return r?r[nn](t,e,n?void 0:this):e.yieldWith(n?Nn(t):this)}}),Pn=e=>Nn(yn(e)),Fn=e=>Nn(xn(e)),In=On({op:`WithFiber`,[en](e){return this[$t](e)}}),Ln=function(){class e extends globalThis.Error{}let t=Dn({op:`YieldableError`,[en](){return Pn(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),Rn=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return class extends Ln{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(kt(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}(),zn=e=>{class t extends Rn{_tag=e}return t.prototype.name=e,t},Bn=`~effect/Cause/Done`,Vn=e=>Ue(e,Bn),Hn={[Bn]:Bn,_tag:`Done`,value:void 0},Un=e=>e===void 0?Hn:{[Bn]:Bn,_tag:`Done`,value:e},Wn=Pn(Hn),Gn=e=>e===void 0?Wn:Pn(Un(e)),Kn=`~effect/Option`,qn={[Kn]:{_A:e=>e},...on,[Symbol.iterator](){return new qt(this)}},Jn=Object.defineProperty(Object.assign(Object.create(qn),{_tag:`Some`,_op:`Some`,[ct](e){return Zn(e)&&$n(e)&&lt(this.value,e.value)},[We](){return qe(Ge(this._tag))(Ge(this.value))},toString(){return`some(${Lt(this.value)})`},toJSON(){return{_id:`Option`,_tag:this._tag,value:Wt(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),Yn=Ge(`None`),Xn=Object.assign(Object.create(qn),{_tag:`None`,_op:`None`,valueOrUndefined:void 0,[ct](e){return Zn(e)&&Qn(e)},[We](){return Yn},toString(){return`none()`},toJSON(){return{_id:`Option`,_tag:this._tag}}}),Zn=e=>Ue(e,Kn),Qn=e=>e._tag===`None`,$n=e=>e._tag===`Some`,er=Object.create(Xn),tr=function(e){this.value=e};tr.prototype=Jn;var nr=e=>new tr(e),rr=`~effect/Result`,ir={[rr]:{_A:e=>e,_E:e=>e},...on,[Symbol.iterator](){return new qt(this)}},ar=Object.assign(Object.create(ir),{_tag:`Success`,_op:`Success`,[ct](e){return sr(e)&&lr(e)&&lt(this.success,e.success)},[We](){return qe(Ge(this._tag))(Ge(this.success))},toString(){return`success(${Lt(this.success)})`},toJSON(){return{_id:`Result`,_tag:this._tag,value:Wt(this.success)}}}),or=Object.assign(Object.create(ir),{_tag:`Failure`,_op:`Failure`,[ct](e){return sr(e)&&cr(e)&&lt(this.failure,e.failure)},[We](){return qe(Ge(this._tag))(Ge(this.failure))},toString(){return`failure(${Lt(this.failure)})`},toJSON(){return{_id:`Result`,_tag:this._tag,failure:Wt(this.failure)}}}),sr=e=>Ue(e,rr),cr=e=>e._tag===`Failure`,lr=e=>e._tag===`Success`,ur=function(e){this.failure=e};ur.prototype=or;var dr=e=>new ur(e),fr=function(e){this.success=e};fr.prototype=ar;var pr=e=>new fr(e);function mr(e){return(t,n)=>t===n?0:e(t,n)}var hr=mr((e,t)=>globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:e<t?-1:1),gr=e=>we(2,(t,n)=>e(t,n)===-1),_r=e=>we(2,(t,n)=>e(t,n)===1),vr=e=>we(2,(t,n)=>e(t,n)!==1),yr=e=>we(2,(t,n)=>e(t,n)!==-1),br=()=>er,xr=nr,Sr=Qn,Cr=$n,wr=we(2,(e,{onNone:t,onSome:n})=>Sr(e)?t():n(e.value)),Tr=e=>(...t)=>{try{return xr(e(...t))}catch{return br()}},Er=pr,Dr=dr,Or=cr,kr=globalThis.Array,Ar=we(2,(e,t)=>[...e,t]);kr.isArray;var jr=Et,Mr=Et,Nr=()=>[],Pr=we(2,(e,t)=>e.map(t)),Fr=`~effect/BigDecimal`,Ir={[Fr]:Fr,[We](){let e=Wr(this);return qe(Ge(e.value),Xe(e.scale))},[ct](e){return Lr(e)&&$r(this,e)},toString(){return`BigDecimal(${ei(this)})`},toJSON(){return{_id:`BigDecimal`,value:String(this.value),scale:this.scale}},[Ut](){return this.toJSON()},pipe(){return xe(this,arguments)}},Lr=e=>Ue(e,Fr),Rr=(e,t)=>{if(!Number.isSafeInteger(t))throw RangeError(`Scale must be a safe integer, got ${t}`);let n=Object.create(Ir);return n.value=e,n.scale=t,n},zr=(e,t)=>{if(e!==Br&&e%Hr===Br)throw RangeError(`Value must be normalized`);let n=Rr(e,t);return n.normalized=n,n},Br=BigInt(0),Vr=BigInt(1),Hr=BigInt(10),Ur=zr(Br,0),Wr=e=>{if(e.normalized===void 0){if(e.value===Br)e.normalized=Ur;else{let t=`${e.value}`,n=0;for(let e=t.length-1;e>=0&&t[e]===`0`;e--)n++;n===0&&(e.normalized=e),e.normalized=zr(BigInt(t.substring(0,t.length-n)),e.scale-n)}}return e.normalized},Gr=100,Kr=[Vr],qr=(e,t)=>e===t?0:e<t?-1:1,Jr=(e,t)=>{let n=`${e.value<Br?-e.value:e.value}`,r=`${t.value<Br?-t.value:t.value}`,i=BigInt(n.length-r.length)-BigInt(e.scale)+BigInt(t.scale);if(i!==Br)return i<Br?-1:1;let a=Math.max(n.length,r.length);for(let e=0;e<a;e++){let t=e<n.length?n.charCodeAt(e):48,i=e<r.length?r.charCodeAt(e):48;if(t!==i)return t<i?-1:1}return 0},Yr=(e,t)=>{if(e.scale===t.scale)return qr(e.value,t.value);let n=Xr(e),r=Xr(t);if(n!==r)return n<r?-1:1;if(n===0)return 0;let i=e.scale-t.scale,a=Math.abs(i);if(a>Gr)return n===-1?Jr(t,e):Jr(e,t);let o=Kr[a]??=Hr**BigInt(a);return i>0?qr(e.value,t.value*o):qr(e.value*o,t.value)},Xr=e=>e.value===Br?0:e.value<Br?-1:1,Zr=e=>e.value<Br?Rr(-e.value,e.scale):e,Qr=Tt((e,t)=>Yr(e,t)===0),$r=we(2,(e,t)=>Qr(e,t)),ei=e=>{let t=Wr(e);if(Math.abs(t.scale)>=16)return ti(t);let n=t.value<Br,r=n?`${t.value}`.substring(1):`${t.value}`,i,a;if(t.scale>=r.length)i=`0`,a=`0`.repeat(t.scale-r.length)+r;else{let e=r.length-t.scale;if(e>r.length){let t=e-r.length;i=`${r}${`0`.repeat(t)}`,a=``}else a=r.slice(e),i=r.slice(0,e)}let o=a===``?i:`${i}.${a}`;return n?`-${o}`:o},ti=e=>{if(ni(e))return`0e+0`;let t=Wr(e),n=`${Zr(t).value}`,r=n.slice(0,1),i=n.slice(1),a=`${ri(t)?`-`:``}${r}`;i!==``&&(a+=`.${i}`);let o=i.length-t.scale;return`${a}e${o>=0?`+`:``}${o}`},ni=e=>e.value===Br,ri=e=>e.value<Br,ii=e=>Dn({op:e.label,[en]:e.evaluate}),ai=`~effect/Context/Service`,oi=function(){function e(){}let t=e;Object.setPrototypeOf(t,si);let n=(e,n)=>(t.key=e,n?.defaultValue&&(t[li]=li,t.defaultValue=n.defaultValue),n?.make&&(t.make=n.make),n?.fiberCached&&ci.add(e),t);return arguments.length>0?n(arguments[0],arguments[1]):n},si={[ai]:ai,...ii({label:`Service`,evaluate(e){return An(Ai(e.context,this))}}),toJSON(){return{_id:`Service`,key:this.key}},of(e){return e},context(e){return Ei(this,e)},use(e){return In(t=>e(Ai(t.context,this)))},useSync(e){return In(t=>An(e(Ai(t.context,this))))}},ci=new Set,li=`~effect/Context/Reference`,ui=`~effect/Context`,di=8,fi=8,pi=(e,t,n,r)=>{let i=Object.create(bi);return i.cacheRoot=e??i,i.base=t,i.overlay=n,i.depth=r,i._flat=void 0,i.baseHits=0,i},mi=(e,t)=>{t&&(mi(e,t.parent),e.set(t.key,t.value))},hi=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return mi(t,e.overlay),e._flat=t},gi=(e,t)=>{let n=new Map(e.mapUnsafe);return t(n),yi(n)},_i=Symbol(),vi=(e,t)=>{let n=e;for(let e=n.overlay;e;e=e.parent)if(e.key===t)return e.value;let r=n.base.get(t);return r===void 0&&!n.base.has(t)?_i:(n.overlay&&++n.baseHits>=fi&&(n.base=hi(n),n.overlay=void 0,n.depth=0),r)},yi=e=>pi(void 0,e,void 0,0),bi={get mapUnsafe(){return hi(this)},...on,[ui]:{_Services:e=>e},toJSON(){return{_id:`Context`,services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[ct](e){if(!Si(e))return!1;let t=this.mapUnsafe,n=e.mapUnsafe;if(t.size!==n.size)return!1;for(let[e,r]of t)if(!n.has(e)||!lt(r,n.get(e)))return!1;return!0},[We](){return Xe(this.mapUnsafe.size)}},xi=(e,t)=>e.cacheRoot===t.cacheRoot,Si=e=>Ue(e,ui),Ci=e=>!!e[li],wi=()=>Ti,Ti=yi(new Map),Ei=(e,t)=>yi(new Map([[e.key,t]])),Di=we(3,(e,t,n)=>Oi(e,t.key,n)),Oi=(e,t,n)=>{let r=e,i=ci.has(t)?void 0:r.cacheRoot;if(r.depth>=di){let e=new Map(r.mapUnsafe);return e.set(t,n),pi(i,e,void 0,0)}return pi(i,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)},ki=(e,t)=>{let n=vi(e,t);return n===_i?void 0:n},Ai=we(2,(e,t)=>{let n=vi(e,t.key);if(n===_i){if(Ci(t))return Mi(t);throw Ni(t)}return n}),ji=`~effect/Context/defaultValue`,Mi=e=>ji in e?e[ji]:e[ji]=e.defaultValue(),Ni=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:``}`);if(t.stack){let e=t.stack.split(`
12
+ `);e.splice(1,3),t.stack=e.join(`
13
+ `)}return t},Pi=we(2,(e,t)=>e.mapUnsafe.size===0?t:t.mapUnsafe.size===0?e:gi(e,e=>t.mapUnsafe.forEach((t,n)=>e.set(n,t)))),Fi=oi,Ii=`~effect/Duration`,Li=BigInt(0),Ri=BigInt(1),zi=BigInt(2),Bi=BigInt(10),Vi=BigInt(1e3),Hi=e=>BigInt(e<0?Math.ceil(e-.5):Math.floor(e+.5)),Ui=e=>Hi(e*1e6),Wi=(e,t)=>{let n=e.indexOf(`.`);if(n===-1)return BigInt(e)*t;let r=e[0]===`-`,i=e.slice(n+1),a=Bi**BigInt(i.length),o=(BigInt(e.slice(+!!r,n))*a+BigInt(i))*t,s=o/a+(o%a*zi>=a?Ri:Li);return r?-s:s},Gi=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,Ki=e=>{switch(typeof e){case`number`:return ia(e);case`bigint`:return ra(e);case`string`:{if(e===`Infinity`)return ta;if(e===`-Infinity`)return na;let t=Gi.exec(e);if(!t)break;let[n,r,i]=t;if(i===`nano`||i===`nanos`)return ra(Wi(r,Ri));if(i===`micro`||i===`micros`)return ra(Wi(r,Vi));let a=Number(r);switch(i){case`milli`:case`millis`:return ia(a);case`second`:case`seconds`:return aa(a);case`minute`:case`minutes`:return oa(a);case`hour`:case`hours`:return sa(a);case`day`:case`days`:return ca(a);case`week`:case`weeks`:return la(a)}break}case`object`:{if(e===null)break;if(Ii in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(Fe)?qi(e):Number.isNaN(e[0])||Number.isNaN(e[1])?ea:e[0]===-1/0||e[1]===-1/0?na:e[0]===1/0||e[1]===1/0?ta:Qi(Hi(e[0]*1e9+e[1]));let t=e,n=0;return t.weeks&&(n+=t.weeks*6048e5),t.days&&(n+=t.days*864e5),t.hours&&(n+=t.hours*36e5),t.minutes&&(n+=t.minutes*6e4),t.seconds&&(n+=t.seconds*1e3),t.milliseconds&&(n+=t.milliseconds),!t.microseconds&&!t.nanoseconds?Qi(n):Qi(Hi(n*1e6+(t.microseconds??0)*1e3+(t.nanoseconds??0)))}}return qi(e)},qi=e=>{throw Error(`Invalid Input: ${e}`)},Ji={_tag:`Millis`,millis:0},Yi={_tag:`Infinity`},Xi={_tag:`NegativeInfinity`},Zi={[Ii]:Ii,[We](){switch(this.value._tag){case`Millis`:{let e=this.value.millis*1e6;return Number.isFinite(e)?Ge(Hi(e)):Xe(this.value.millis)}case`Nanos`:return Ge(this.value.nanos);default:return $e(this.value)}},[ct](e){return $i(e)&&pa(this,e)},toString(){switch(this.value._tag){case`Infinity`:return`Infinity`;case`NegativeInfinity`:return`-Infinity`;case`Nanos`:return`${this.value.nanos} nanos`;case`Millis`:return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case`Millis`:return{_id:`Duration`,_tag:`Millis`,millis:this.value.millis};case`Nanos`:return{_id:`Duration`,_tag:`Nanos`,nanos:String(this.value.nanos)};case`Infinity`:return{_id:`Duration`,_tag:`Infinity`};case`NegativeInfinity`:return{_id:`Duration`,_tag:`NegativeInfinity`}}},[Ut](){return this.toJSON()},pipe(){return xe(this,arguments)}},Qi=e=>{let t=Object.create(Zi);return t.value=typeof e==`number`?isNaN(e)||e===0||Object.is(e,-0)?Ji:Number.isFinite(e)?Number.isInteger(e)?{_tag:`Millis`,millis:e}:{_tag:`Nanos`,nanos:Ui(e)}:e>0?Yi:Xi:e===Li?Ji:{_tag:`Nanos`,nanos:e},t},$i=e=>Ue(e,Ii),ea=Qi(0),ta=Qi(1/0),na=Qi(-1/0),ra=e=>Qi(e),ia=e=>Qi(e),aa=e=>Qi(e*1e3),oa=e=>Qi(e*6e4),sa=e=>Qi(e*36e5),ca=e=>Qi(e*864e5),la=e=>Qi(e*6048e5),ua=e=>{let t=Ki(e);switch(t.value._tag){case`Infinity`:case`NegativeInfinity`:throw Error(`Cannot convert infinite duration to nanos`);case`Nanos`:return t.value.nanos;case`Millis`:return Ui(t.value.millis)}},da=we(3,(e,t,n)=>e.value._tag===`Infinity`||e.value._tag===`NegativeInfinity`||t.value._tag===`Infinity`||t.value._tag===`NegativeInfinity`?n.onInfinity(e,t):e.value._tag===`Millis`?t.value._tag===`Millis`?n.onMillis(e.value.millis,t.value.millis):n.onNanos(ua(e),t.value.nanos):n.onNanos(e.value.nanos,ua(t))),fa=(e,t)=>da(e,t,{onMillis:(e,t)=>e===t,onNanos:(e,t)=>e===t,onInfinity:(e,t)=>e.value._tag===t.value._tag}),pa=we(2,(e,t)=>fa(e,t)),ma=Fi(`effect/Scheduler`,{fiberCached:!0,defaultValue:()=>new ya}),ha=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},ga=`setImmediate`in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},_a=e=>{try{return ga(e)}catch{return ha(e)}},va=class{buckets=[];scheduleTask(e,t){let n=this.buckets,r=n.length,i,a=0;for(;a<r&&!(n[a][0]>t);a++)i=n[a];i&&i[0]===t?i[1].push(e):a===r?n.push([t,[e]]):n.splice(a,0,[t,[e]])}drain(){let e=this.buckets;return this.buckets=[],e}},ya=class{executionMode;setImmediate;constructor(e=`async`,t){this.executionMode=e,this.setImmediate=t??(e===`sync`?ha:_a)}shouldYield(e){return e.currentOpCount>=e.cache.maxOpsBeforeYield}makeDispatcher(){return new ba(this.setImmediate)}},ba=class{tasks=new va;running=void 0;setImmediate;constructor(e=_a){this.setImmediate=e}scheduleTask(e,t){this.tasks.scheduleTask(e,t),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let e=this.tasks.drain();for(let t=0;t<e.length;t++){let n=e[t][1];for(let e=0;e<n.length;e++)n[e]()}}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}},xa=Fi(`effect/Scheduler/MaxOpsBeforeYield`,{fiberCached:!0,defaultValue:()=>2048}),Sa=Fi(`effect/Scheduler/PreventSchedulerYield`,{fiberCached:!0,defaultValue:()=>!1}),Ca=`effect/Tracer/ParentSpan`,wa=`effect/Tracer`,Ta=`effect/Metric/FiberRuntimeMetrics`,Ea=Fi(`effect/References/CurrentStackFrame`,{fiberCached:!0,defaultValue:Oe}),Da=Fi(`effect/References/TracerEnabled`,{fiberCached:!0,defaultValue:De}),Oa=Fi(`effect/References/CurrentLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),ka=Fi(`effect/References/MinimumLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),Aa=class extends hn{constructor(e,t=gn){super(`Interrupt`,t,`Interrupted`),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:`Interrupt`,fiberId:this.fiberId}}[ct](e){return Tn(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[We](){return qe(Ze(`${this._tag}:${this.fiberId}`))(Ke(this.annotations))}},ja=e=>new pn([new Aa(e)]),Ma=e=>{for(let t=0;t<e.reasons.length;t++){let n=e.reasons[t];if(n._tag===`Fail`)return Er(n.error)}return Dr(e)},Na=e=>e.reasons.some(Tn),Pa=(e,t)=>{let n=new Map,r=[];for(let i of e.concat(t)){let e=Ge(i),t=n.get(e);if(t===void 0)n.set(e,[i]);else if(t.some(e=>lt(e,i)))continue;else t.push(i);r.push(i)}return r},Fa=we(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new pn(Pa(e.reasons,t.reasons));return lt(e,n)?e:n}),Ia=we(2,(e,t)=>{let n=!1,r=e.reasons.map(e=>Cn(e)?(n=!0,new _n(t(e.error),e.annotations)):e);return n?vn(r):e}),La=e=>{let t={Fail:[],Die:[],Interrupt:[]};for(let n=0;n<e.reasons.length;n++)t[e.reasons[n]._tag].push(e.reasons[n]);return t},Ra=e=>{let t=La(e);return t.Fail.length>0?t.Fail[0].error:t.Die.length>0?t.Die[0].defect:t.Interrupt.length>0?new globalThis.Error(`All fibers interrupted without error`):new globalThis.Error(`Empty cause`)},za=`~effect/Fiber`,Ba={_A:Te,_E:Te},Va={id:0},Ha=()=>globalThis[Pt],Ua=class{constructor(e,t=!0){this[za]=Ba,this.setContext(e),this.id=++Va.id,this.currentOpCount=0,this.interruptible=t,this._stack=[],this._observers=void 0,this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this._parent=void 0,this.cache.runtimeMetrics?.recordFiberStart(this.context)}[za];id;interruptible;currentOpCount;_stack;_observers;_exit;_children;_interruptedCause;_yielded;_running;_deferredInterrupt;_parent;context;cache;_dispatcher=void 0;get currentDispatcher(){return this._dispatcher??=this.cache.scheduler.makeDispatcher()}getRef(e){return Ai(this.context,e)}addObserver(e){return this._exit?(e(this._exit),ke):(this._observers===void 0?this._observers=[e]:this._observers.push(e),()=>{if(this._exit||this._observers===void 0)return;let t=this._observers.indexOf(e);t>=0&&this._observers.splice(t,1)})}interruptUnsafe(e,t){if(this._exit)return;let n=ja(e);this.cache.stackFrame&&(n=Sn(n,Ei(jn,this.cache.stackFrame))),t&&(n=Sn(n,t)),this._interruptedCause=this._interruptedCause?Fa(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(eo(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(e){if(this._exit)return;if(this._yielded!==void 0){let e=this._yielded;this._yielded=void 0,e()}let t=this.runLoop(e);if(t===an)return;let n=Ka.interruptChildren&&Ka.interruptChildren(this);if(n!==void 0)return this.evaluate(Oo(n,()=>t));if(this._exit=t,this.cache.runtimeMetrics?.recordFiberEnd(this.context,this._exit),this._parent&&=(this._parent._children?.delete(this),void 0),this._observers!==void 0){let e=this._observers;this._observers=void 0;for(let n=0;n<e.length;n++)e[n](t)}this._stack.length=0,this._children=void 0,this.context=wi()}runLoop(e){let t=globalThis[Pt];globalThis[Pt]=this;let n=this._running;this._running=!0;let r=!1,i=e;this.currentOpCount=0;try{for(;;){this._deferredInterrupt&&(this._deferredInterrupt=!1,i=eo(this._interruptedCause)),this.currentOpCount++;let e=this.cache;if(!r&&!e.preventYield&&e.scheduler.shouldYield(this)){r=!0;let e=i;i=Oo(io,()=>e)}if(i=e.tracerContext?e.tracerContext(i,this):i[en](this),i===an){let e=this._yielded;if(Xt in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return an}}}catch(e){return Ue(i,en)?this.runLoop(Fn(e)):Fn(`Fiber.runLoop: Not a valid effect: ${String(i)}`)}finally{this._running=n,globalThis[Pt]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,Ga;for(;;){let t=this._stack.pop();if(!t)return;let n=t[rn];if(n!==void 0){let r=n.call(t,this);if(r)return r[e]=r,r}if(t[e])return t}}yieldWith(e){return this._yielded=e,an}children(){return this._children??=new Set}pipe(){return xe(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&xi(t,e))return;let n=e.cacheRoot,r=n._fiberCache??=Wa(e);this.cache!==void 0&&this.cache.scheduler!==r.scheduler&&(this._dispatcher=void 0),this.cache=r}get currentSpanLocal(){let e=this.cache.span;return e?._tag===`Span`?e:void 0}},Wa=e=>{let t=ki(e,wa);return{scheduler:Ai(e,ma),tracer:t,tracerContext:t?t.context:void 0,tracerEnabled:Ai(e,Da),span:ki(e,Ca),logLevel:Ai(e,Oa),minimumLogLevel:Ai(e,ka),stackFrame:Ai(e,Ea),runtimeMetrics:ki(e,Ta),maxOpsBeforeYield:Ai(e,xa),preventYield:Ai(e,Sa)}},Ga={[tn](e,t){return eo(t._interruptedCause)},[nn](e,t){return eo(t._interruptedCause)}},Ka={interruptChildren:void 0},qa=e=>{if(!e.cache.stackFrame)return;let t=new Map;return t.set(Mn.key,e.cache.stackFrame),yi(t)},Ja=e=>{let t=e;return t._exit?$a(t._exit):fo(n=>t._exit?n($a(t._exit)):no(e.addObserver(e=>n($a(e)))))},Ya=e=>fo(t=>{let n=e[Symbol.iterator](),r=[],i;function a(){let e=n.next();for(;!e.done;){if(e.value._exit){r.push(e.value._exit),e=n.next();continue}i=e.value.addObserver(e=>{r.push(e),a()});return}t($a(r))}return a(),no(()=>i?.())}),Xa=e=>In(t=>Za(e,t.id)),Za=we(e=>Ue(e[0],za),(e,t,n)=>In(r=>{let i=qa(r);return i=i&&n?Pi(i,n):i??n,e.interruptUnsafe(t,i),Do(Ja(e))})),Qa=e=>In(t=>{let n=qa(t),r=Nr();for(let i of e)i.interruptUnsafe(t.id,n),r.push(i);return Do(Ya(r))}),$a=An,eo=Nn,to=Pn,no=On({op:`Sync`,[en](e){let t=this[$t](),n=e.getCont(tn);return n?n[tn](t,e):e.yieldWith(An(t))}}),ro=On({op:`Suspend`,[en](e){return this[$t]()}}),io=On({op:`Yield`,[en](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(Fo)},this[$t]??0),e.yieldWith(()=>{t=!0})}})(0),ao=e=>ro(()=>eo(Jt(e))),oo=e=>Fn(e),so=$a(void 0),co=e=>{let t=typeof e==`function`?e:e.try,n=typeof e==`function`?e=>new Ns(e,`An error occurred in Effect.tryPromise`):e.catch;return lo(function(e,r){let i=t=>{try{e(to(Jt(()=>n(t))))}catch(t){e(oo(t))}};try{Jt(()=>t(r)).then(t=>e($a(t)),i)}catch(e){i(e)}},t.length!==0)},lo=function(){let e=Dn({op:`Async`,[en](e){let t=Jt(()=>this.register.bind(e.cache.scheduler)),n=!1,r=!1,i=this.withSignal?new AbortController:void 0,a=t(t=>{n||(n=!0,r?e.evaluate(t):r=t)},i?.signal);return r===!1?(r=!0,e._yielded=()=>{n=!0},i===void 0&&a===void 0||e._stack.push(uo(()=>(n=!0,i?.abort(),a??Fo))),an):r}}),t=function(e,t){this.register=e,this.withSignal=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),uo=On({op:`AsyncFinalizer`,[rn](e){e.interruptible&&(e.interruptible=!1,e._stack.push(gs))},[nn](e,t){return Na(e)?Oo(this[$t](),()=>eo(e)):eo(e)}}),fo=e=>lo(e,e.length>=2),po=(...e)=>{if(e.length===1){let t=e[0];return ro(()=>vo(t()))}let[t,n]=e;return ro(()=>vo(n.call(t.self)))},mo=(e,...t)=>{let n=t.length===0?function(){return ro(()=>vo(e.apply(this,arguments)))}:function(){let n=ro(()=>vo(e.apply(this,arguments)));for(let e=0;e<t.length;e++)n=t[e](n,...arguments);return n};return ho(e.length,n)},ho=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),go=(e,...t)=>ho(e.length,t.length===0?function(){return _o(()=>e.apply(this,arguments))}:function(){let n=_o(()=>e.apply(this,arguments));for(let e of t)n=e(n,...arguments);return n}),_o=e=>{try{let t=e(),n;for(;;){let r=t.next(n);if(r.done)return $a(r.value);let i=r.value;if(i&&i._tag===`Success`){n=i.value;continue}if(i&&i._tag===`Failure`)return r.value;{let n=!0;return ro(()=>n?(n=!1,Oo(r.value,e=>vo(t,e))):ro(()=>vo(e())))}}}catch(e){return oo(e)}},vo=function(){let e=Dn({op:`Iterator`,[tn](e,t){let n=this.iterator;for(;;){let r=n.next(e);if(r.done)return $a(r.value);if(!ko(r.value))return t._stack.push(this),r.value;if(r.value._tag===`Failure`)return r.value;e=r.value.value}},[en](e){return this[tn](this.initial,e)}}),t=function(e,t){this.iterator=e,this.initial=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),yo=function(e){return e._stack.push(this),this[$t]},bo=Dn({op:`OnSuccess`,[en]:yo}),xo=function(e,t){this[$t]=e,this[tn]=t};xo.prototype=bo;var So=function(e,t,n){this[$t]=e,this[tn]=t,this.payload=n};So.prototype=bo;var Co=function(){return this.payload},wo=function(e){let t=this.payload;return $a(Jt(()=>t(e)))},To=function(e){let t=this.payload;return Jt(()=>t(e))},Eo=we(2,(e,t)=>new So(e,cn(t)?Co:To,t)),Do=e=>new So(e,Co,Fo),Oo=we(2,(e,t)=>new xo(e,t.length===1?t:e=>t(e))),ko=e=>e[Xt]!==void 0,Ao=we(2,(e,t)=>ko(e)?e._tag===`Success`?t(e.value):e:Oo(e,t)),jo=we(2,(e,t)=>new So(e,wo,t)),Mo=we(2,(e,t)=>ko(e)?Io(e,t):jo(e,t)),No=e=>e._tag===`Success`,Po=e=>e._tag===`Failure`,Fo=An(void 0),Io=we(2,(e,t)=>e._tag===`Success`?An(t(e.value)):e),Lo=e=>{let t=[];for(let n of e)n._tag===`Failure`&&t.push(...n.cause.reasons);return t.length===0?Fo:Nn(vn(t))},Ro=we(2,(e,t)=>In(n=>{let r=n.context,i=t(r);return r===i?e:(n.setContext(i),ps(e,()=>{n.setContext(r)}))})),zo=e=>In(t=>e(t.context)),Bo=we(2,(e,t)=>ko(e)?e:Ro(e,Pi(t))),Vo=function(){return arguments.length===1?we(2,(e,t)=>Ho(e,arguments[0],t)):we(3,(e,t,n)=>Ho(e,t,n)).apply(this,arguments)},Ho=(e,t,n)=>Ro(e,Di(t,n)),Uo=we(e=>cn(e[0]),(e,t)=>_s({while:De,body:Ee(t?.disableYield?e:Oo(e,e=>io)),step:ke})),Wo=we(2,(e,t)=>new Ko(e,t.length===1?t:e=>t(e))),Go=Dn({op:`OnFailure`,[en]:yo}),Ko=function(e,t){this[$t]=e,this[nn]=t};Ko.prototype=Go;var qo=we(3,(e,t,n)=>Wo(e,e=>{let r=t(e);return Or(r)?eo(r.failure):Jt(()=>n(r.success,e))})),Jo=we(3,(e,t,n)=>Wo(e,e=>{let r=t(e);return Or(r)?eo(e):Eo(Jt(()=>n(r.success,e)),eo(e))})),Yo=we(2,(e,t)=>Jo(e,Ma,e=>t(e))),Xo=e=>ko(e)?An(e):Zo(e),Zo=On({op:`Exit`,[en](e){return e._stack.push(this),this[$t]},[tn](e,t,n){return $a(n??An(e))},[nn](e,t,n){return $a(n??Nn(e))}}),Qo=`~effect/Scope`,$o=`~effect/Scope/Closeable`,es=oi(`effect/Scope`),ts=(e,t)=>ro(()=>ns(e,t)??so),ns=(e,t)=>{if(e.state._tag===`Closed`)return;let n={_tag:`Closed`,exit:t};if(e.state._tag===`Empty`){e.state=n;return}let r=e.state;if(e.state=n,r.finalizer!==void 0)return r.finalizer(t);let i=r.finalizers;if(i!==void 0&&i.size!==0)return i.size===1?i.values().next().value(t):is(e,i,t)},rs=(e,t)=>No(e)?t:Wo(t,t=>eo(Fa(e.cause,t))),is=mo(function*(e,t,n){let r=[],i=[],a=Array.from(t.values()),o=Ha();for(let t=a.length-1;t>=0;t--){let s=a[t];e.strategy===`sequential`?r.push(yield*Xo(s(n))):i.push(Ss(o,s(n),!0,!0,`inherit`))}return i.length>0&&(r=yield*Ya(i)),yield*Lo(r)}),as=(e,t)=>ro(()=>e.state._tag===`Closed`?t(e.state.exit):(os(e,{},t),so)),os=(e,t,n)=>{if(e.state._tag===`Empty`)e.state={_tag:`Open`,finalizerKey:t,finalizer:n,finalizers:void 0};else if(e.state._tag===`Open`){let r=e.state;r.finalizer===void 0?r.finalizers===void 0?(r.finalizerKey=t,r.finalizer=n):r.finalizers.set(t,n):(r.finalizers=new Map([[r.finalizerKey,r.finalizer]]),r.finalizerKey=void 0,r.finalizer=void 0,r.finalizers.set(t,n))}},ss=(e=`sequential`)=>({[$o]:$o,[Qo]:Qo,strategy:e,state:cs}),cs={_tag:`Empty`},ls=e=>no(()=>ss(e)),us=es,ds=Vo(es),fs=e=>Oo(us,t=>zo(n=>as(t,t=>Bo(e(t),n)))),ps=function(){let e=Dn({op:`OnExit`,[en](e){return e._stack.push(this),this.effect},[rn](e){e.interruptible&&this.interruptible!==!0&&(e._stack.push(gs),e.interruptible=!1)},[tn](e,t,n){n??=An(e);let r=this.onExit(n);return r?Oo(r,e=>n):n},[nn](e,t,n){n??=Nn(e);let r=this.onExit(n);return r?Oo(rs(n,r),e=>n):n}}),t=function(e,t,n){this.effect=e,this.onExit=t,this.interruptible=n};return t.prototype=e,function(e,n,r){return new t(e,n,r)}}(),ms=we(2,ps),hs=e=>In(t=>t.interruptible?(t.interruptible=!1,t._stack.push(gs),e):e),gs=On({op:`SetInterruptible`,[rn](e){if(e.interruptible=this[$t],e._interruptedCause&&e.interruptible)return()=>eo(e._interruptedCause)}})(!0),_s=On({op:`While`,[tn](e,t){return this[$t].step(e),this[$t].while()?(t._stack.push(this),this[$t].body()):Fo},[en](e){return this[$t].while()?(e._stack.push(this),this[$t].body()):Fo}}),vs=e=>e===`unbounded`?1/0:Math.max(1,e??1),ys=()=>e=>{let t=e.onItem,n=e.step,r=(e,i,a=0,o=i.length)=>{for(;a<o;a++){let s=i[a],c=t(e,s,a);if(!ko(c))return Oo(Xo(c),t=>n(e,s,t,a)??r(e,i,a+1,o)??so);let l=n(e,s,c,a);if(l)return l._tag===`Failure`?l:void 0}};return r},bs=e=>{let t=e.onItem,n=e.step;return(e,r,i)=>{let a=0,o=i.end??r.length,s=i.concurrency,c=!1,l,u,d,f=!1,p,m,h=e=>{let t=Fn(e);return p=t,c=!0,f=!0,u&&u.size>0?Oo(hs(Qa(Array.from(u))),()=>t):t},g=()=>{let i=!1;for(;!p&&a<o;a++){let o=r[a],_=m??t(e,o,a);if(ko(_)){if(p=n(e,o,_,a),p)break}else if(l){m=void 0;let t=Ss(l,_,!0,!0,`inherit`);if(t._exit){if(p=n(e,o,t._exit,a),p)break;continue}u.add(t);let r=a;if(t.addObserver(a=>{u.delete(t);try{if(p){if(!f&&a._tag===`Failure`)for(let e of a.cause.reasons)if(e._tag===`Interrupt`)continue;else p._tag===`Failure`?p.cause.reasons.push(e):p=Nn(vn([e]))}else{let t=n(e,o,a,r);t&&(p=t._tag===`Failure`?Nn(vn(t.cause.reasons.slice())):t,g())}if(i){let e=g();e&&d(e)}else c&&u.size===0&&d(p??so)}catch(e){d(h(e))}}),u.size<s)continue;i=!0,a++;return}else return fo(e=>{l=Ha(),u=new Set,m=_,d=e;let t;try{t=g()}catch(t){return e(h(t))}return t?e(t):ro(()=>(p=Fo,f=!0,u?Qa(u):so))})}if(c=!0,p){if(u&&u.size>0){let e=qa(l);u.forEach(t=>t.interruptUnsafe(l.id,e));return}if(d||p._tag===`Failure`)return p}else if(d){if(u)u.size===0&&d(so);else return Fo}};return g()}},xs=()=>e=>bs(e),Ss=(e,t,n=!1,r=!1,i=!1)=>{let a=e,o=i===`inherit`?a.interruptible:!i,s=new Ua(a.context,o);return n?s.evaluate(t):a.currentDispatcher.scheduleTask(()=>s.evaluate(t),0),!r&&!s._exit&&(a.children().add(s),s._parent=a),s},Cs=e=>(t,n)=>{let r=new Ua(n?.scheduler?Di(e,ma,n.scheduler):e,n?.uninterruptible!==!0);if(r.evaluate(t),r._exit)return r;if(n?.signal){if(n.signal.aborted)r.interruptUnsafe();else{let e=()=>r.interruptUnsafe();n.signal.addEventListener(`abort`,e,{once:!0}),r.addObserver(()=>n.signal.removeEventListener(`abort`,e))}}return n?.onFiberStart&&n.onFiberStart(r),r},ws=Cs(wi()),Ts=e=>{let t=Cs(e);return(e,n)=>{let r=t(e,n);return new Promise(e=>{r.addObserver(t=>e(t))})}},Es=(e=>{let t=Ts(e);return(e,n)=>t(e,n).then(e=>{if(e._tag===`Failure`)throw Ra(e.cause);return e.value})})(wi()),Ds=(e=>{let t=Cs(e);return e=>{if(ko(e))return e;let n=new ya(`sync`),r=t(e,{scheduler:n});return r._dispatcher?.flush(),r._exit??Fn(new js(r))}})(wi()),Os=`~effect/Cause/IllegalArgumentError`,ks=class extends zn(`IllegalArgumentError`){[Os]=Os;constructor(e){super({message:e})}},As=`~effect/Cause/AsyncFiberError`,js=class extends zn(`AsyncFiberError`){[As]=As;constructor(e){super({message:`An asynchronous Effect was executed with Effect.runSync`,fiber:e})}},Ms=`~effect/Cause/UnknownError`,Ns=class extends zn(`UnknownError`){[Ms]=Ms;constructor(e,t){super({message:t,cause:e})}},Ps={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};Ps.gray,Ps.blue,Ps.green,Ps.yellow,Ps.red,Ps.bgBrightRed,Ps.black;var Fs=Cn,Is=vn,Ls=xn,Rs=Ia,zs=Vn,Bs=Gn,Vs=ks,Hs=An,Us=Nn,Ws=Pn,Gs=Fo,Ks=No,qs=Po,Js=ls,Ys=ss,Xs=ds,Zs=ts,Qs=`~effect/DateTime`,$s=`~effect/DateTime/TimeZone`,ec={[Qs]:Qs,pipe(){return xe(this,arguments)},[Ut](){return this.toString()},toJSON(){return dc(this).toJSON()}},tc={...ec,_tag:`Utc`,[We](){return Xe(this.epochMilliseconds)},[ct](e){return rc(e)&&e._tag===`Utc`&&this.epochMilliseconds===e.epochMilliseconds},toString(){return`DateTime.Utc(${dc(this).toJSON()})`}};({...ec});var nc={[$s]:$s,[Ut](){return this.toString()}};({...nc}),{...nc};var rc=e=>Ue(e,Qs),ic=e=>e._tag===`Utc`,ac=e=>{let t=Object.create(tc);return t.epochMilliseconds=e,Object.defineProperty(t,"partsUtc",{value:void 0,enumerable:!1,writable:!0}),t},oc=e=>{let t=e.getTime();if(Number.isNaN(t))throw new Vs(`Invalid date`);return ac(t)},sc=e=>{if(rc(e))return e;if(e instanceof Date)return oc(e);if(typeof e==`object`){if(`epochMilliseconds`in e)return oc(new Date(e.epochMilliseconds));let t=new Date(0);return pc(t,e),oc(t)}return typeof e==`string`&&!cc(e)?oc(new Date(e+`Z`)):oc(new Date(e))},cc=e=>/Z|GMT|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(e),lc=Tr(sc),uc=e=>ac(e.epochMilliseconds),dc=e=>new Date(e.epochMilliseconds),fc=e=>e.epochMilliseconds,pc=(e,t)=>{if((t.year!==void 0||t.month!==void 0||t.day!==void 0)&&e.setUTCFullYear(t.year??e.getUTCFullYear(),t.month===void 0?e.getUTCMonth():t.month-1,t.day??e.getUTCDate()),t.weekDay!==void 0){let n=t.weekDay-e.getUTCDay();e.setUTCDate(e.getUTCDate()+n)}t.hour!==void 0&&e.setUTCHours(t.hour),t.minute!==void 0&&e.setUTCMinutes(t.minute),t.second!==void 0&&e.setUTCSeconds(t.second),t.millisecond!==void 0&&e.setUTCMilliseconds(t.millisecond)},mc=e=>dc(e).toISOString(),hc=we(2,(e,t)=>qo(e,yc,e=>t(e))),gc=e=>e.reasons.some(_c),_c=e=>e._tag===`Fail`&&zs(e.error),vc=e=>{let t,n=!1;for(let r of e.reasons)_c(r)?t??=r.error:r._tag!==`Interrupt`&&(n=!0);return t===void 0?Dr(e):n?Dr(Is(e.reasons.filter(e=>!_c(e)))):Er(t)},yc=e=>{let t=vc(e);return Or(t)?t:Er(t.success.value)},bc=_s,xc=co,Sc=$a,Cc=ro,wc=no,Tc=so,Ec=fo,Dc=po,Oc=to,kc=eo,Ac=ao,jc=oo,Mc=Oo,Nc=Eo,Pc=Xo,Fc=jo,Ic=Wo,Lc=Yo,Rc=fs,zc=ms,Bc=Uo,Vc=ws,Hc=Es,Uc=Ds,Wc=Mo,Gc=Ao,Kc=go,qc=`~structural`,Jc=`~sentinels`,Yc=`~constructor`,Xc=Symbol(),Zc=Hs,Qc=Zc(Xc),$c=Zc(Xc),el=e=>e===Xc?br():xr(e),tl=e=>e._tag===`None`?Qc:Zc(e.value),nl=`~effect/SchemaIssue/Issue`;function rl(e){return Ue(e,nl)&&e[nl]===nl}var il=class{[nl]=nl;constructor(e,t){t?.reportInput===!0&&e!==Xc&&(this.input=e)}},al=class extends il{_tag=`Filter`;filter;issue;constructor(e,t,n,r){super(n,r),this.filter=e,this.issue=t}},ol=class extends il{_tag=`Encoding`;ast;issue;constructor(e,t,n,r){super(n,r),this.ast=e,this.issue=t}},sl=class extends il{_tag=`Pointer`;path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},cl=class extends il{_tag=`MissingKey`;annotations;constructor(e){super(),this.annotations=e}},ll=class extends il{_tag=`UnexpectedKey`;ast;constructor(e,t,n){super(t,n),this.ast=e}},ul=class extends il{_tag=`Composite`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},dl=class extends il{_tag=`InvalidType`;ast;constructor(e,t,n){super(t,n),this.ast=e}},fl=class extends il{_tag=`InvalidValue`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}},pl=class extends il{_tag=`Forbidden`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}},ml=class extends il{_tag=`AnyOf`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},hl=class extends il{_tag=`OneOf`;ast;successes;constructor(e,t,n,r){super(n,r),this.ast=e,this.successes=t}};function gl(e,t,n){if(rl(e))return e;if(typeof e==`string`)return new fl({message:e},t,n);let r=typeof e.issue==`string`?new fl({message:e.issue},t,n):e.issue;return new sl(e.path,r)}function _l(e,t,n){if(e!==void 0)return typeof e==`boolean`?e?void 0:new fl(void 0,t,n):gl(e,t,n)}function vl(e,t,n,r){return Array.isArray(t)?Mr(t)?t.length===1?gl(t[0],n,r):new ul(e,Pr(t,e=>gl(e,n,r)),n,r):void 0:_l(t,n,r)}function yl(e){let t;for(let n of e.reasons){if(!Fs(n)||!rl(n.error))return;t??=n.error}return t}function bl(e,t){let n=yl(e);if(n===void 0)throw Error(t,{cause:e});return n}var xl=rc,Sl=ic,Cl=sc,wl=lc,Tl=uc,El=fc,Dl=mc,Ol=e=>Object.assign(Object.create(Se),e);function kl(e){return Il((t,n)=>Oc(e(t,n)))}function Al(e){return kl((t,n)=>{let r={message:e(t)};return Cr(t)?new pl(r,t.value,n):new pl(r)})}var jl=Al(()=>`Encoding is not supported`),Ml=Ol({_tag:`Passthrough`});function Nl(){return Ml}function Pl(e){return Ol({_tag:`Transform`,transform:e})}function Fl(e){return Ol({_tag:`TransformEffect`,transform:e})}function Il(e){return Ol({_tag:`TransformOptionalEffect`,transform:e})}function Ll(){return Pl(globalThis.String)}function Rl(){return Pl(globalThis.Number)}function zl(){return Pl(e=>new globalThis.Date(e))}var Bl=class extends Ce{_tag=`Middleware`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new Bl(this.encode,this.decode)}},Vl=`~effect/SchemaTransformation/Transformation`,Hl=class extends Ce{[Vl]=Vl;_tag=`Transformation`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new Hl(this.encode,this.decode)}};function Ul(e){return Ue(e,Vl)&&e[Vl]===Vl}var Wl=e=>Ul(e)?e:new Hl(e.decode,e.encode);function Gl(e){return new Hl(Fl(e.decode),Fl(e.encode))}var Kl=new Hl(Nl(),Nl());function ql(){return Kl}var Jl=new Hl(Rl(),Ll()),Yl=new Hl(zl(),Pl(Bt));function Xl(e){return t=>t._tag===e}var Zl=Xl(`Declaration`),Ql=Xl(`Never`),$l=Xl(`Literal`),eu=Xl(`UniqueSymbol`),tu=Xl(`Arrays`),nu=Xl(`Objects`),ru=Xl(`Suspend`),iu=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},au={},ou=class{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,n=void 0,r=void 0){this.isOptional=e,this.isMutable=t,this.constructorDefault=n,this.annotations=r}},su=`~effect/Schema`,cu=class{[su]=su;annotations;checks;encoding;context;constructor(e=void 0,t=void 0,n=void 0,r=void 0){this.annotations=e,this.checks=t,this.encoding=n,this.context=r}toString(){return`<${this._tag}>`}},lu=class extends cu{_tag=`Declaration`;typeParameters;run;encodingChecks;encodingRun;constructor(e,t,n,r,i,a,o,s){super(n,r,i,a),this.typeParameters=e,this.run=t,this.encodingChecks=o,this.encodingRun=s}getParser(){let e;return(t,n)=>t===Xc?Qc:(e??=this.run(this.typeParameters))(t,this,n)}_rebuild(e,t,n,r,i){let a=Td(this.typeParameters,e);return a===this.typeParameters&&t===this.checks&&n===this.encodingChecks&&r===this.run&&i===this.encodingRun?this:new lu(a,r,this.annotations,t,void 0,this.context,n,i)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks,this.run,this.encodingRun)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks,this.encodingRun??this.run,this.run)}getExpected(){let e=this.annotations?.expected;return typeof e==`string`?e:`<Declaration>`}},uu=new class extends cu{_tag=`Null`;getParser(){return Hd(this,null)}getExpected(){return`null`}},du=class extends cu{_tag=`Undefined`;getParser(){return Hd(this,void 0)}toCodecJson(){return md(this,[fu])}getExpected(){return`undefined`}},fu=new iu(uu,new Hl(Pl(()=>void 0),Pl(()=>null))),pu=new du,mu=new class extends cu{_tag=`Unknown`;getParser(){return Ud(this,Ve)}getExpected(){return`unknown`}},hu=class extends cu{_tag=`Literal`;literal;constructor(e,t,n,r,i){if(super(t,n,r,i),typeof e==`number`&&!globalThis.Number.isFinite(e))throw Error(`A numeric literal must be finite, got ${Lt(e)}`);this.literal=e}getParser(){return Hd(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==`bigint`?gu(this):this}toCodecStringTree(){return typeof this.literal==`string`?this:gu(this)}getExpected(){return typeof this.literal==`string`?JSON.stringify(this.literal):globalThis.String(this.literal)}};function gu(e){let t=globalThis.String(e.literal);return md(e,[new iu(new hu(t),new Hl(Pl(()=>e.literal),Pl(()=>t)))])}var _u=new class extends cu{_tag=`String`;getParser(){return Ud(this,Pe)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&Zd(n,e,void 0,this,t)?void 0:e}getExpected(){return`string`}},vu=class extends cu{_tag=`Number`;getParser(){return Ud(this,Fe)}matchKey(e,t){return this._match(Kd,e,t)}matchPart(e,t){return this._match(Gd,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);return n.disableChecks||!this.checks?r:Zd(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){return this.checks&&(yu(this.checks,`effect/schema/isFinite`)||yu(this.checks,`effect/schema/isInt`))?this:md(this,[ld])}toCodecStringTree(){return this.toCodecJson()===this?md(this,[Yd]):md(this,[Xd])}getExpected(){return`number`}};function yu(e,t){return e.some(e=>e.annotations?.representation?.id===t||e._tag===`FilterGroup`&&yu(e.checks,t))}var bu=new vu,xu=new class extends cu{_tag=`Boolean`;getParser(){return Ud(this,Ie)}getExpected(){return`boolean`}},Su=class extends cu{_tag=`Arrays`;isMutable;elements;rest;encodingChecks;constructor(e,t,n,r,i,a,o,s){super(r,i,a,o),this.isMutable=e,this.elements=t,this.rest=n,this.encodingChecks=s;let c=!1;for(let e=0;e<t.length;e++)if(Pd(t[e]))c=!0;else if(c)throw Error(`A required element cannot follow an optional element. ts(1257)`);if(c&&n.length>1)throw Error(`A required element cannot follow an optional element. ts(1257)`);for(let e=1;e<n.length;e++)if(Pd(n[e]))throw Error(`An optional element cannot follow a rest element. ts(1266)`)}getParser(e,t=e){let n=this,r,i,a=n.elements.length,o=Math.max(0,n.rest.length-1);function s(e,t){return t<a?r[t]:t>=e?i[t-e+1]:i[0]}return Kc(function*(e,c){if(e===Xc)return Xc;if(!Array.isArray(e))return yield*Oc(new dl(n,e,c));r||(r=n.elements.map(e=>({ast:e,parser:t(e)})),i=n.rest.map(e=>({ast:e,parser:t(e)})));let l=e.length,u={ast:n,getParser:s,input:e,len:l,tailThreshold:Math.max(a,l-o),output:new globalThis.Array(l),issues:void 0,options:c},d=n.rest.length===0?a:Math.max(l,a+o),f=c.concurrency===void 0?1:vs(c.concurrency),p=f===1?Tu(u,e,0,d):Eu(u,e,{concurrency:f,end:d});if(p&&(yield*p),n.rest.length===0&&l>a)for(let t=a;t<=l-1;t++){let r=new ll(n,e[t],c),i=new sl([t],r);if(c.errors===`all`)u.issues?u.issues.push(i):u.issues=[i];else return yield*Oc(new ul(n,[i],e,c))}return u.issues?yield*Oc(new ul(n,u.issues,e,c)):u.output})}_rebuild(e,t,n){let r=Td(this.elements,e),i=Td(this.rest,e);return r===this.elements&&i===this.rest&&t===this.checks&&n===this.encodingChecks?this:new Su(this.isMutable,r,i,this.annotations,t,void 0,this.context,n)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){return`array`}};function Cu(e,t,n,r){if(n._tag===`Failure`)return Du(e,e.ast,r,n);let i=n===$c?t:n[$t];if(i!==Xc)e.output[r]=i;else{let t=e.getParser(e.tailThreshold,r);if(Pd(t.ast))return;let n=new sl([r],new cl(t.ast.context?.annotations));if(e.options.errors===`all`)e.issues?e.issues.push(n):e.issues=[n];else return Ws(new ul(e.ast,[n],e.input,e.options))}}var wu={onItem(e,t,n){let r=n<e.len?t:Xc;return e.getParser(e.tailThreshold,n).parser(r,e.options)},step:Cu},Tu=ys()(wu),Eu=xs()(wu),Du=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let i=yl(r.cause);if(i===void 0)return Us(Rs(r.cause,r=>new ul(t,[new sl([n],r)],e.input,e.options)));let a=new sl([n],i);if(e.options.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return Ws(new ul(t,[a],e.input,e.options))},Ou=`[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?`;function ku(e,t,n=au){let r,i;function a(t){switch(t._tag){case`String`:case`TemplateLiteral`:return(r??=Object.keys(e)).filter(e=>t.matchPart(e,n)!==void 0);case`Number`:return(r??=Object.keys(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Symbol`:return(i??=Object.getOwnPropertySymbols(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Union`:return[...new Set(t.types.flatMap(a))];default:return[]}}return a(Wd(Rd(t)))}var Au=class{name;type;constructor(e,t){this.name=e,this.type=t}};function ju(e){switch(e._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return e.types.every(ju);default:return!1}}function Mu(e){let t=gd(e);switch(t._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return t.types.every(Mu);default:return!1}}function Nu(e){return ju(e)&&Mu(e)}var Pu=class{parameter;type;constructor(e,t){if(!Nu(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,Pd(t)&&!Vd(t))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}},Fu=class extends cu{_tag=`Objects`;propertySignatures;indexSignatures;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=o;let s=new Set,c=[];for(let t of e){let e=t.name;s.has(e)?c.push(e):s.add(e)}if(c.length>0)throw Error(`Duplicate identifiers: ${JSON.stringify(c)}. ts(2300)`)}getParser(e,t=e){let n=this,r=[];for(let e of n.propertySignatures)r.push(typeof e.name==`number`?globalThis.String(e.name):e.name);let i=r.length,a=n.indexSignatures.length,o=i&&a?new Set(r):void 0;if(!i&&!a)return Ud(n,Be);let s,c,l=(e,t,r,a,s)=>{if(s._tag===`Failure`)return Du(e,n,t,s)??Gs;let c=s===$c?a:s[$t];if(r!==Xc&&c!==Xc){if(i&&(o.has(t)||o.has(typeof r==`number`?globalThis.String(r):r)))return Gs;Ot(e.out,r,c)}return Gs},u=(e,t,r,i)=>{if(!i){let n=r.parserKey(t,e.options);if(!ko(n))return Mc(Pc(n),n=>u(e,t,r,n));i=n}if(i._tag===`Failure`)return Du(e,n,t,i)??Gs;let a=i===$c?t:i[$t],o=e.input[t],s=r.parserValue(o,e.options);return ko(s)?l(e,t,a,o,s):Mc(Pc(s),n=>l(e,t,a,o,n))},d=(e,t,n)=>{let r=e.input[t],i=n.parserValue(r,e.options);return ko(i)?l(e,t,t,r,i):Mc(Pc(i),n=>l(e,t,t,r,n))},f=a?xs()({onItem:(e,[t,n])=>n.is.parameter===_u?d(e,t,n):u(e,t,n),step:(e,t,n)=>n._tag===`Failure`?n:void 0}):void 0,p=()=>(s||(s=n.propertySignatures.map(e=>({parser:t(e.type),name:e.name,type:e.type})),c=a?n.indexSignatures.map(n=>({is:n,parserKey:e(Wd(n.parameter)),parserValue:t(n.type)})):void 0),s),m=Kc(function*(e,t){if(e===Xc)return Xc;if(typeof e!=`object`||!e||Array.isArray(e))return yield*Oc(new dl(n,e,t));p();let l=e,m={},h={ast:n,input:l,out:m,issues:void 0,options:t},g=t.errors===`all`,_=t.onExcessProperty===`error`,v=t.concurrency===void 0?1:vs(t.concurrency),y=a&&_?n.indexSignatures.map(e=>ku(l,e.parameter,t)):void 0;if(_){o??=new Set(r);let i=y?new Set(o):o;if(y)for(let e of y)for(let t of e)i.add(t);let a=Reflect.ownKeys(l);for(let r=0;r<a.length;r++){let o=a[r];if(!i.has(o)){let r=new ll(n,l[o],t),i=new sl([o],r);if(g){h.issues?h.issues.push(i):h.issues=[i];continue}return yield*Oc(new ul(n,[i],e,t))}}}if(i){let e=v===1?Ru(h,s):zu(h,s,{concurrency:v});e&&(yield*e)}if(a&&v===1)for(let e=0;e<a;e++){let n=c[e],r=n.is.parameter===_u?d:u,i=y?.[e]??(n.is.parameter===_u?Object.keys(l):ku(l,n.is.parameter,t));for(let e=0;e<i.length;e++){let t=r(h,i[e],n);if(!ko(t))yield*t;else if(t._tag===`Failure`)return yield*t}}else if(f){let e=Nr();for(let n=0;n<a;n++){let r=c[n],i=y?.[n]??(r.is.parameter===_u?Object.keys(l):ku(l,r.is.parameter,t));for(let t=0;t<i.length;t++)e.push([i[t],r])}let n=f(h,e,{concurrency:v});n&&(yield*n)}return h.issues?yield*Oc(new ul(n,h.issues,e,t)):m});if(a)return m;let h=(e,t,n)=>{let r=s[t];return Mc(Pc(n),n=>{let i=Iu(e,r,n);if(i)return i;let a=()=>Zc(e.out),o=Ru(e,s.slice(t+1));return o?Gc(o,a):a()})};return(e,t)=>{if(e===Xc)return Qc;if(t.errors===`all`||t.onExcessProperty!==void 0||t.concurrency!==void 0&&vs(t.concurrency)!==1)return m(e,t);if(typeof e!=`object`||!e||Array.isArray(e))return Oc(new dl(n,e,t));let r=p(),i=e,a={},o={ast:n,input:i,out:a,issues:void 0,options:t};try{for(let e=0;e<r.length;e++){let n=r[e],s=n.name,c=Yu(i,s),l=c?i[s]:Xc,u=n.parser(l,t);if(!ko(u))return h(o,e,u);if(u===$c){c&&Ot(a,s,l);continue}let d=Iu(o,n,u);if(d)return d}}catch(e){return jc(e)}return Zc(a)}}_rebuild(e,t,n,r){let i=Td(this.propertySignatures,t=>{let n=e(t.type);return n===t.type?t:new Au(t.name,n)}),a=Td(this.indexSignatures,n=>{let r=t(n.parameter),i=e(n.type);return r===n.parameter&&i===n.type?n:new Pu(r,i)});return i===this.propertySignatures&&a===this.indexSignatures&&n===this.checks&&r===this.encodingChecks?this:new Fu(i,a,this.annotations,n,void 0,this.context,r)}flip(e){return this._rebuild(e,e,this.encodingChecks,this.checks)}recur(e,t=e){return this._rebuild(e,t,this.checks,this.encodingChecks)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?`object | array`:`object`}};function Iu(e,t,n){if(n._tag===`Failure`)return Du(e,e.ast,t.name,n);if(n===$c)return;let r=n[$t];if(r!==Xc){Ot(e.out,t.name,r);return}if(delete e.out[t.name],!Pd(t.type)){let n=new sl([t.name],new cl(t.type.context?.annotations));if(e.options.errors===`all`){e.issues?e.issues.push(n):e.issues=[n];return}return Ws(new ul(e.ast,[n],e.input,e.options))}}var Lu={onItem(e,t){if(!Yu(e.input,t.name))return t.parser(Xc,e.options);let n=e.input[t.name];return Ot(e.out,t.name,n),t.parser(n,e.options)},step:Iu},Ru=ys()(Lu),zu=xs()(Lu);function Bu(e,t){return e?t?[...e,...t]:e:t}function Vu(e,t,n){return new Fu(Reflect.ownKeys(e).map(t=>new Au(t,e[t].ast)),[],n,t)}function Hu(e){return e.ast}function Uu(e,t,n){return new $u(e.map(Hu),t,void 0,n)}var Wu=je(e=>{for(;;){if(ru(e))return mu;let t=e.encoding;if(!t)return e.recur?.(Wu,Te)??e;if(t.some(e=>e.transformation._tag===`Middleware`&&e.transformation.decode!==Te))return mu;e=t[t.length-1].to}});function Gu(e){switch(e._tag){case`Null`:return[`null`];case`Undefined`:return[`undefined`];case`String`:case`TemplateLiteral`:return[`string`];case`Number`:return[`number`];case`Boolean`:return[`boolean`];case`Symbol`:case`UniqueSymbol`:return[`symbol`];case`BigInt`:return[`bigint`];case`Arrays`:return[`array`];case`ObjectKeyword`:return[`object`,`array`,`function`];case`Objects`:return e.propertySignatures.length||e.indexSignatures.length?[`object`]:[`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`];case`Enum`:return Array.from(new Set(e.enums.map(([,e])=>typeof e)));case`Literal`:return[typeof e.literal];case`Union`:return Array.from(new Set(e.types.flatMap(Gu)));default:return[`null`,`undefined`,`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`]}}function Ku(e){switch(e._tag){default:return[];case`Declaration`:{let t=e.annotations?.[Jc];return Array.isArray(t)?t:[]}case`Objects`:return e.propertySignatures.flatMap(e=>{let t=e.type;if(!Pd(t)){if($l(t))return[{key:e.name,literal:t.literal}];if(eu(t))return[{key:e.name,literal:t.symbol}]}return[]});case`Arrays`:return e.elements.flatMap((e,t)=>{if(!Pd(e)){if($l(e))return[{key:t,literal:e.literal}];if(eu(e))return[{key:t,literal:e.symbol}]}return[]});case`Union`:{if(e.types.length===0)return[];let t=e.types.map(e=>Ku(Wu(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case`Suspend`:return Ku(e.thunk())}}var qu=new WeakMap,Ju=Object.freeze([]),Yu=(e,t)=>t===`__proto__`?Object.hasOwn(e,t):t in e;function Xu(e){let t=qu.get(e);if(t)return t;let n,r=0,i,a,o=!0;for(let t=0;t<e.length;t++){let s=e[t],c=Wu(s);if(Ql(c))continue;if(o){if($l(c)||eu(c)){a??=new Map;let e=$l(c)?c.literal:c.symbol,t=a.get(e);t||a.set(e,t=[]),t.push(s)}else o=!1}let l=Ku(c);if(l.length){n??=new Map,r++;for(let{key:e,literal:r}of l){let i=n.get(e);i||n.set(e,i=[new Map,new Set]),i[1].add(t);let a=i[0].get(r);a||i[0].set(r,a=new Set),a.add(t)}}else{i??={};let e=Gu(c);for(let n of e)(i[n]??=[]).push(t)}}if(o&&a)a.forEach(Object.freeze),t=e=>a.get(e)??Ju;else if(n?.size===1&&!i){let[r,[i]]=n.entries().next().value,a=i;for(let[t,n]of i)a.set(t,Object.freeze(Array.from(n,t=>e[t])));t=(t,n)=>{if(He(t)){let i=Yu(t,r)?t[r]:void 0;if(i!==void 0)return a.get(i)??Ju;if(n)return e}return Ju}}else if(n){let a;for(let e of n)(!a||e[1][0].size>a[1][0].size)&&e[1][1].size===r&&(a=e);t=(t,r)=>{let o=i?.[t===null?`null`:Array.isArray(t)?`array`:typeof t]??Ju;if(!He(t))return o.map(t=>e[t]);let s=new Set(o),c;if(a){let[n,[i]]=a,l=Yu(t,n),u=l?t[n]:void 0;if(l&&(!r||u!==void 0)){let t=i.get(u);if(!t)return o.map(t=>e[t]);for(let e of t)s.add(e);c=n}}if(c===void 0)for(let[e,[i,a]]of n){let n=Yu(t,e),o=n?t[e]:void 0;if(n&&(!r||o!==void 0)){let e=i.get(o);if(e)for(let t of e)s.add(t)}else if(r)for(let e of a)s.add(e)}for(let[e,[i,a]]of n){if(e===c)continue;let n=Yu(t,e),o=n?t[e]:void 0;if(n&&(!r||o!==void 0)){let e=i.get(o);for(let t of s)a.has(t)&&!e?.has(t)&&s.delete(t)}}return Array.from(s).sort((e,t)=>e-t).map(t=>e[t])}}else t=t=>(i?.[t===null?`null`:Array.isArray(t)?`array`:typeof t]??Ju).map(t=>e[t]).filter(Zu(t));return qu.set(e,t),t}function Zu(e){return t=>{let n=Wu(t);return n._tag===`Literal`?n.literal===e:n._tag!==`UniqueSymbol`||n.symbol===e}}function Qu(e,t,n=!1){return Xu(t)(e,n)}var $u=class extends cu{_tag=`Union`;types;options;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.types=e,this.options=t,this.encodingChecks=o}getParser(e,t){let n=this;return(r,i)=>{if(r===Xc)return Qc;let a=Qu(r,n.types,t!==void 0);if(a.length===0)return Oc(new ml(n,[],r,i));if(a.length===1){let t=e(a[0])(r,i);return t._tag===`Success`?t:ko(t)?ed(n,t.cause,r,i):Ic(t,e=>ed(n,e,r,i))}let o={ast:n,compile:e,input:r,out:void 0,successes:n.options?.mode===`oneOf`?[]:void 0,issues:void 0,options:i},s=td(o,a);return s?Gc(s,e=>o.out===$c?Sc(r):o.out?o.out:Oc(new ml(n,o.issues??[],r,i))):o.out?o.out:Oc(new ml(n,o.issues??[],r,i))}}_rebuild(e,t,n){let r=Td(this.types,e);return r===this.types&&t===this.checks&&n===this.encodingChecks?this:new $u(r,this.options,this.annotations,t,void 0,this.context,n)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}matchPart(e,t){for(let n of this.types){let r=n.matchPart(e,t);if(r!==void 0)return r}}getExpected(e){let t=this.annotations?.expected;if(typeof t==`string`)return t;if(this.types.length===0)return`never`;let n=this.types.map(t=>{let n=Rd(t);switch(n._tag){case`Arrays`:{let t=n.elements.filter($l);if(t.length>0)return`${rd(n.isMutable)}[ ${t.map(t=>e(t)+id(t.context?.isOptional)).join(`, `)}, ... ]`;break}case`Objects`:{let t=n.propertySignatures.filter(e=>$l(e.type));if(t.length>0)return`{ ${t.map(t=>`${rd(t.type.context?.isMutable)}${zt(t.name)}${id(t.type.context?.isOptional)}: ${e(t.type)}`).join(`, `)}, ... }`;break}}return e(n)});return Array.from(new Set(n)).join(` | `)}};function ed(e,t,n,r){let i=yl(t);return i?Ws(new ml(e,[i],n,r)):Us(t)}var td=ys()({onItem(e,t){return e.compile(t)(e.input,e.options)},step(e,t,n){if(n._tag===`Failure`){let t=yl(n.cause);if(t===void 0)return n;e.issues?e.issues.push(t):e.issues=[t]}else{if(e.out&&e.successes)return e.successes.push(t),Ws(new hl(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(t);else return Gs}}}),nd=new $u([new hu(`Infinity`),new hu(`-Infinity`),new hu(`NaN`)]);function rd(e){return e?``:`readonly `}function id(e){return e?`?`:``}var ad=class extends Ce{_tag=`Filter`;run;annotations;aborted;constructor(e,t=void 0,n=!1){super(),this.run=e,this.annotations=t,this.aborted=n}annotate(e){return new ad(this.run,{...this.annotations,...e},this.aborted)}abort(){return new ad(this.run,this.annotations,!0)}and(e,t){return new od([this,e],t)}},od=class extends Ce{_tag=`FilterGroup`;checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(e){return new od(this.checks,{...this.annotations,...e})}and(e,t){return new od([this,e],t)}};function sd(e,t,n=!1){return new ad((t,n,r)=>vl(n,e(t,n,r),t,r),t,n)}function cd(e){return sd(e=>globalThis.Number.isFinite(e),{expected:`a finite number`,representation:{id:`effect/schema/isFinite`,payload:null},toJsonSchema:()=>({type:`number`}),toCode:()=>({runtime:`Schema.isFinite()`}),arbitraryConstraint:{number:`finite`},...e})}var ld=new iu(new $u([yd(bu,[cd()]),nd]),new Hl(Rl(),Pl(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function ud(e,t){let n=e.source,r=new globalThis.RegExp(n,e.flags);return sd(e=>(r.lastIndex=0,r.test(e)),{expected:`a string matching the RegExp ${n}`,representation:{id:`effect/schema/isPattern`,payload:{source:n,flags:e.flags}},toJsonSchema:()=>({pattern:n}),arbitraryConstraint:{patterns:[{source:e.source,flags:e.flags}]},...t})}function dd(e,t){let n=Object.getOwnPropertyDescriptors(e);return t(n),Object.create(Object.getPrototypeOf(e),n)}var fd=new WeakMap;function pd(e){return fd.get(e)??e}function md(e,t){return e.encoding===t?e:dd(e,e=>{e.encoding.value=t})}function hd(e,t){if(e.context===t)return e;let n=pd(e);if(n.context===t)return n;let r=dd(e,e=>{e.context.value=t});return fd.set(r,n),r}function gd(e){return e.encoding?gd(e.encoding[e.encoding.length-1].to):e}function _d(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return vd(e,Ar(e.checks.slice(0,-1),n.annotate(t)))}return dd(e,e=>{e.annotations.value={...e.annotations.value,...t}})}function vd(e,t){if(e._tag===`Suspend`&&t)throw Error(`Cannot add checks to Suspend`);return e.checks===t?e:dd(e,e=>{e.checks.value=t})}function yd(e,t){return vd(e,Bu(e.checks,t))}function bd(e,t){let n=t(e.to);return n===e.to?e:new iu(n,e.transformation)}function xd(e,t){let n=e,r=n[n.length-1],i=bd(r,t);return i===r?e:Ar(e.slice(0,e.length-1),i)}function Sd(e){return t=>t.encoding?md(t,xd(t.encoding,e)):t}function Cd(e,t){function n(r){if(r.encoding){let e=r.encoding[r.encoding.length-1];return t?.stopAt?.(e)?r:md(r,xd(r.encoding,n))}return e(r)}return je(n)}function wd(e,t,n){let r=new iu(e,t);return md(n,n.encoding?[...n.encoding,r]:[r])}function Td(e,t){let n=!1,r=Array(e.length);for(let i=0;i<e.length;i++){let a=e[i],o=t(a);o!==a&&(n=!0),r[i]=o}return n?r:e}function Ed(e,t){return hd(e,e.context?new ou(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new ou(!1,!1,void 0,t))}var Dd=je(e=>Od(hd(e,e.context?e.context.isOptional===!1?new ou(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new ou(!0,!1)))),Od=Sd(Dd),kd=Ae(e=>Dd(new $u([e,pu])));function Ad(e,t){return hd(e,e.context?new ou(e.context.isOptional,e.context.isMutable,t,e.context.annotations):new ou(!1,!1,t))}function jd(e,t,n){return wd(e,n,t)}function Md(e){let t=[],n=[];function r(e){switch(e._tag){case`Literal`:Re(e.literal)&&t.push(e.literal);return;case`UniqueSymbol`:t.push(e.symbol);return;case`Never`:return;case`Union`:for(let t=0;t<e.types.length;t++)r(e.types[t]);return;default:n.push(e)}}return r(e),{literals:t,parameters:n}}function Nd(e,t){let{literals:n,parameters:r}=Md(e);return new Fu(n.map(e=>new Au(e,t)),r.map(e=>new Pu(e,t)))}function Pd(e){return e.context?.isOptional??!1}function Fd(e){return e.annotations?.[`~structural`]===!0||e._tag===`FilterGroup`&&e.checks.every(Fd)}function Id(e){function t(e){return Fd(e)?[e]:e._tag===`FilterGroup`?e.checks.flatMap(t):[]}let n=e.flatMap(t);return jr(n)?n:void 0}var Ld=je(e=>{if(e.encoding)return Ld(md(e,void 0));let t=e,n=t.recur?.(Ld)??t,r=n.encodingChecks;if(r){let t=n===e?r:tu(n)||nu(n)||Zl(n)&&n.typeParameters.length>0?Id(r):void 0;return dd(n,e=>{e.encodingChecks.value=void 0,e.checks.value=Bu(n.checks,t)})}return n}),Rd=je(e=>Ld(Bd(e)));function zd(e,t){let n=t,r=n.length,i=n[r-1],a=[new iu(Bd(md(e,void 0)),n[0].transformation.flip())];for(let e=1;e<r;e++)a.unshift(new iu(Bd(n[e-1].to),n[e].transformation.flip()));let o=Bd(i.to);return o.encoding?md(o,[...o.encoding,...a]):md(o,a)}var Bd=Ae(e=>{if(e.encoding)return zd(e,e.encoding);let t=e;return t.flip?.(Bd)??t.recur?.(Bd)??t});function Vd(e){switch(e._tag){case`Undefined`:return!0;case`Union`:return e.types.some(Vd);default:return!1}}function Hd(e,t){let n=t===0?$c:Zc(t);return(r,i)=>r===Xc?Qc:r===t?n:Oc(new dl(e,r,i))}function Ud(e,t){return(n,r)=>n===Xc?Qc:t(n)?$c:Oc(new dl(e,n,r))}var Wd=Cd(e=>{switch(e._tag){default:return e;case`Number`:return e.toCodecStringTree();case`Union`:return e.recur(Wd)}}),Gd=new globalThis.RegExp(`^${Ou}$`),Kd=new globalThis.RegExp(`^(?:${Ou}|Infinity|-Infinity|NaN)$`);function qd(e){return ud(Gd,{expected:`a string representing a finite number`,representation:{id:`effect/schema/isStringFinite`,payload:null},toJsonSchema:()=>({pattern:Gd.source}),...e})}var Jd=yd(_u,[qd()]),Yd=new iu(Jd,Jl),Xd=new iu(new $u([Jd,nd]),Jl);function Zd(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a];if(o._tag===`FilterGroup`){if(n=Zd(o.checks,t,n,r,i),n&&(i.errors!==`all`||n[n.length-1].filter.aborted))return n}else{let e=o.run(t,r,i);if(e){let r=new al(o,e,t,i);if(n?n.push(r):n=[r],i.errors!==`all`||o.aborted)return n}}}return n}function Qd(e){if(!Zl(e))return;let t=e.annotations?.[Yc];return ze(t)?t(e.typeParameters):void 0}var $d=Xa,ef=Symbol.for(`effect/MutableList/Empty`),tf=()=>({head:void 0,tail:void 0,length:0}),nf=()=>({array:[],mutable:!0,offset:0,next:void 0}),rf=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=nf(),e.tail=e.tail.next):e.head=e.tail=nf(),e.tail.array.push(t),e.length++},af=e=>{e.head=e.tail=void 0,e.length=0},of=(e,t)=>{if(t=Dt(t),t<=0||!e.head)return[];if(t=Math.min(t,e.length),t===e.length&&e.head?.offset===0&&!e.head.next){let t=e.head.array;return af(e),t}let n=Array(t),r=0,i=e.head;for(;i;){for(;i.offset<i.array.length;)if(n[r++]=i.array[i.offset],i.mutable&&(i.array[i.offset]=void 0),i.offset++,r===t)return e.head=i,e.length-=t,e.length===0&&af(e),n;i=i.next}return af(e),n},sf=e=>{if(!e.head)return ef;let t=e.head.array[e.head.offset];return e.head.mutable&&(e.head.array[e.head.offset]=void 0),e.head.offset++,e.length--,e.head.offset===e.head.array.length&&(e.head.next?e.head=e.head.next:af(e)),t},cf=`~effect/Queue`,lf=`~effect/Queue/Enqueue`,uf=`~effect/Queue/Dequeue`,df={_A:Te,_E:Te},ff={[cf]:df,[lf]:df,[uf]:df,...on,toJSON(){return{_id:`effect/Queue`,state:this.state._tag,size:vf(this)}}},pf=e=>In(t=>{let n=Object.create(ff);return n.dispatcher=t.currentDispatcher,n.capacity=e?.capacity??1/0,n.strategy=e?.strategy??`suspend`,n.messages=tf(),n.scheduleRunning=!1,n.state={_tag:`Open`,takers:new Set,offers:new Set,awaiters:new Set},$a(n)}),mf=()=>pf(),hf=(e,t)=>e.state._tag===`Open`?e.messages.length>=e.capacity?e.strategy===`sliding`?(sf(e.messages),rf(e.messages,t),!0):e.capacity<=0&&e.state.takers.size>0&&(rf(e.messages,t),bf(e),!0):(rf(e.messages,t),xf(e),!0):!1,gf=e=>_f(e,1,1/0),_f=(e,t,n)=>(t=Dt(t),n=Dt(n),ro(()=>Sf(e,t,n)??Eo(Tf(e),_f(e,1,n)))),vf=e=>e.state._tag===`Done`?0:e.messages.length,yf=An(!0),bf=e=>{if(e.state._tag!==`Done`&&e.state.takers.size!==0){for(let t of e.state.takers)if(e.state.takers.delete(t),t(Fo),e.messages.length===0)break}},xf=e=>{e.scheduleRunning||e.state._tag===`Done`||e.state.takers.size===0||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>{e.scheduleRunning=!1,bf(e)},0))},Sf=(e,t,n)=>{if(e.state._tag===`Done`)return e.state.exit;if(n<=0||t<=0)return An([]);if(e.capacity<=0&&e.messages.length===0&&e.state.offers.size>0){let t=[Cf(e.state.offers)];return wf(e),An(t)}if(t=Math.min(t,e.capacity||1),t<=e.messages.length){let t=of(e.messages,n);return wf(e),An(t)}},Cf=e=>{let t=e.values().next().value;if(t._tag===`Single`)return e.delete(t),t.resume(yf),t.message;let n=t.remaining[t.offset++];return t.offset===t.remaining.length&&(e.delete(t),t.resume(An([]))),n},wf=e=>{if(e.state._tag===`Done`)return gc(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag===`Closing`&&e.messages.length===0&&(Ef(e,e.state.exit),gc(e.state.exit.cause));for(let t of e.state.offers){let n=e.capacity-e.messages.length;if(n<=0)break;if(t._tag===`Single`)rf(e.messages,t.message),e.state.offers.delete(t),t.resume(yf);else{for(;t.offset<t.remaining.length;t.offset++){if(n===0)return!1;rf(e.messages,t.remaining[t.offset]),n--}e.state.offers.delete(t),t.resume(An([]))}}return!1},Tf=e=>fo(t=>e.state._tag===`Done`?t(e.state.exit):(e.state.takers.add(t),no(()=>{e.state._tag!==`Done`&&e.state.takers.delete(t)}))),Ef=(e,t)=>{if(e.state._tag===`Done`)return;let n=e.state;e.state={_tag:`Done`,exit:t};for(let e of n.takers)e(t);n.takers.clear();for(let e of n.awaiters)e(t);n.awaiters.clear()},Df={"~effect/Channel":{_Env:Te,_InErr:Te,_InElem:Te,_OutErr:Te,_OutElem:Te},pipe(){return xe(this,arguments)}},Of=e=>{let t=Object.create(Df);return t.transform=(t,n)=>Ic(e(t,n),e=>Sc(kc(e))),t},kf=e=>Of((t,n)=>e),Af=e=>e.transform,jf=e=>kf(Sc(gf(e))),Mf=(e,t,n)=>Cc(()=>{let r=Ys();return hc(Mc(Af(e)(Bs(),r),t),n||Sc).pipe(zc(e=>Zs(r,e)))}),Nf=we(2,(e,t)=>Mf(e,e=>Bc(Mc(e,t),{disableYield:!0}))),Pf=(e,t,n)=>e===$c?n(t):Gc(e,n);function Ff(e){if(e._tag===`Middleware`)return(t,n,r)=>If(t===$c?e.decode(Zc(el(n)),r):e.decode(Wc(t,el),r));let t=e.decode;switch(t._tag){case`Passthrough`:return(e,t)=>e===$c?Zc(t):e;case`Transform`:{let e=e=>e===Xc?Qc:Zc(t.transform(e));return(t,n)=>Pf(t,n,e)}case`TransformOptional`:{let e=e=>tl(t.transform(el(e)));return(t,n)=>Pf(t,n,e)}case`TransformEffect`:return(e,n,r)=>Pf(e,n,e=>e===Xc?Qc:t.transform(e,r));case`TransformOptionalEffect`:return(e,n,r)=>Pf(e,n,e=>If(t.transform(el(e),r)))}}var If=e=>Gc(e,tl),Lf=(e,t,n,r)=>Ic(r,r=>Ac(()=>Rs(r,r=>new ol(e,r,t,n))));function Rf(e,t){let n=Ff(e.link.transformation),r;return(i,a)=>{if(i===Xc)return Qc;if(e.isConstructed(i))return $c;let o=(r??=t(e.link.to))(i,a);return n(o,i,a)}}function zf(e,t){let n=e.context.constructorDefault;return(r,i)=>{if(r!==Xc&&r!==void 0)return t(r,i);let a=n;if(ko(a)&&a._tag===`Success`){let e=t(a[$t],i);return e===$c?a:e}return Gc(Lf(e,r,i,a),e=>{let n=t(e,i);return n===$c?Zc(e):n})}}function Bf(e,t){let n=t(e);return e.context?.constructorDefault===void 0?n:zf(e,n)}function Vf(e,t,n,r,i){if(e._tag===`Declaration`)for(let n of e.typeParameters)t(n);let a=n?Qd(e):void 0,o=a?Rf(a,t):r??e.getParser(t,n),s=e.checks,c=e.encoding,l=c?.map(e=>Ff(e.transformation)),u=e.encodingChecks;if(!c&&!s&&!u)return o;let d,f=(t,n)=>{let r=o(t,n);if(u&&!n.disableChecks){if(ko(r)){if(r._tag===`Success`){let i=r===$c?t:r[$t];if(t!==Xc&&i!==Xc){let i=Zd(u,t,void 0,e,n);i&&(r=Oc(new ul(e,i,t,n)))}}}else r=Mc(r,r=>{if(t!==Xc&&r!==Xc){let r=Zd(u,t,void 0,e,n);if(r)return Oc(new ul(e,r,t,n))}return Sc(r)})}if(s&&!n.disableChecks){if(ko(r)){if(r._tag===`Success`){let i=r===$c?t:r[$t];if(i===Xc)return r;let a=Zd(s,i,void 0,e,n);a&&(r=Oc(new ul(e,a,i,n)))}}else r=Mc(r,t=>{if(t!==Xc){let r=Zd(s,t,void 0,e,n);if(r)return Oc(new ul(e,r,t,n))}return Sc(t)})}return r},p=i===void 0?f:i(f);return c?(n,r)=>{let i=d??=c.map(e=>t(e.to)),a=n,o=i[i.length-1](n,r);for(let e=c.length-1;e>=0;e--)if(o=l[e](o,a,r),e!==0){let t=i[e-1];o._tag===`Success`?(a=o[$t],o=t(a,r)):o=Gc(o,e=>{let n=t(e,r);return n===$c?Zc(e):n})}if(o._tag===`Success`){let e=o[$t],t=p(e,r);return t===$c?o:t}return o=Lf(e,n,r,o),Gc(o,e=>{let t=p(e,r);return t===$c?Zc(e):t})}:p}var Hf=Symbol(),Uf=new WeakMap,Wf=e=>Jf(e).parser,Gf=e=>Jf(e).makeEffect,Kf=e=>Bf(e,Gf),qf=class{ast;constructor(e){this.ast=e}get decodeEffect(){return this.cachedDecodeEffect??=Vf(this.ast,Wf)}get parser(){return this.decodeEffect}get makeEffect(){return this.cachedMakeEffect??=Vf(this.ast,Gf,Kf)}};function Jf(e){let t=Uf.get(e);if(t!==void 0)return t;let n=new qf(e);return Uf.set(e,n),n}function Yf(e){let t=e.ast,n;return(e,r)=>(n??=ep(rp,Ld(t)))(e,r?.disableChecks?r?.parseOptions?{...r.parseOptions,disableChecks:!0}:{disableChecks:!0}:r?.parseOptions)}function Xf(e){let t=Yf(e);return(e,n)=>{let r=Uc(t(e,n));return Ks(r)?xr(r.value):(bl(r.cause,`Option adapter can only return none for schema issues`),br())}}function Zf(e){return np(Ld(e.ast))}var Qf=e=>e===Xc?Oc(new fl):Sc(e);function $f(e,t){return e===$c?Sc(t):ko(e)?e[$t]===Xc?Qf(Xc):e:Gc(e,Qf)}function ep(e,t){let n;return(r,i)=>{let a=(n??=e(t))(r,i??au);return a===$c?Sc(r):ko(a)?a[$t]===Xc?Qf(Xc):a:Gc(a,Qf)}}function tp(e,t){let n=Uc(e);if(Ks(n))return n.value;let r=bl(n.cause,t);throw Error(`Schema validation failed`,{cause:r})}function np(e){let t,n;return(r,i)=>{t??=Jf(e);let a=i?.disableChecks?i.parseOptions?{...i.parseOptions,disableChecks:!0}:{disableChecks:!0}:i?.parseOptions??au,o=t.make;if(o!==void 0&&r!==Xc){let e;try{e=o(r,a)}catch(e){throw bl(Ls(e),`Constructor adapter can only throw schema issues`),e}if(e!==Hf&&e!==Xc)return e}return tp($f((n??=t.makeEffect)(r,a),r),`Constructor adapter can only throw schema issues`)}}var rp=e=>Jf(e).makeEffect,ip=`~effect/Schema/Schema`,ap={[ip]:ip,pipe(){return xe(this,arguments)},annotate(e){return this.rebuild(_d(this.ast,e))},annotateKey(e){return this.rebuild(Ed(this.ast,e))},check(...e){return this.rebuild(yd(this.ast,e))}};function op(e,t){function n(){}let r=Object.setPrototypeOf(n,ap);return t&&(Object.hasOwn(t,`name`)||Object.hasOwn(t,`length`)||Object.hasOwn(t,`__proto__`))?Object.defineProperties(r,Object.getOwnPropertyDescriptors({...t})):Object.assign(r,t),r.ast=e,r.rebuild=e=>op(e,t),r.makeEffect=Yf(r),r.make=Zf(r),r.makeOption=Xf(r),r}var sp=e=>e;({...Gt}),{...Gt},{...on};var cp=ip;function lp(){return(e,t,n)=>dp(new lu(e.map(Hu),e=>t(e.map(e=>dp(e))),n))}function up(e,t){return lp()([],()=>(t,n,r)=>e(t)?Sc(t):Oc(new dl(n,t,r)),t)}var dp=op;function fp(e){return Ue(e,cp)&&e[cp]===cp}var pp=sp(e=>dp(Dd(e.ast),{schema:e})),mp=sp(e=>{let t=kp(e);return dp(kd(e.ast),{schema:t})});function hp(e){let t=dp(new hu(e),{literal:e,transform(n){return t.pipe(Ap(hp(n),{decode:Pl(()=>n),encode:Pl(()=>e)}))}});return t}var gp=dp(mu),_p=dp(uu),vp=dp(pu),G=dp(_u),yp=dp(bu),bp=dp(xu);function xp(e,t){return dp(e,{fields:t,mapFields(e,t){let n=e(this.fields);return xp(Vu(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function Sp(e){return xp(Vu(e,void 0),e)}function Cp(e,t){return dp(Nd(e.ast,t.ast),{key:e,value:t})}var wp=sp(e=>dp(new Su(!1,[],[e.ast]),{value:e}));function Tp(e,t){return dp(e,{members:t,mapMembers(e,t){let n=e(this.members);return Tp(Uu(n,this.ast.options,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function Ep(e,t){return Tp(Uu(e,t,void 0),e)}function Dp(e){let t=e.map(hp);return dp(Uu(t,void 0,void 0),{literals:e,members:t,mapMembers(e){return Ep(e(this.members))},pick(e){return Dp(e)},transform(e){return Ep(t.map((t,n)=>t.transform(e[n])))}})}var Op=sp(e=>Ep([e,_p])),kp=sp(e=>Ep([e,vp]));function Ap(e,t){return n=>dp(jd(n.ast,e.ast,t?Wl(t):ql()),{from:n,to:e})}function jp(){return(e,t)=>Fp()(e,{decode:t,encode:jl})}function Mp(e){return t=>dp(Ad(t.ast,e),{schema:t})}function Np(e){return hp(e).pipe(Mp(Sc(e)))}function Pp(e,t){return Sp({_tag:Np(e),...t})}function Fp(){return(e,t)=>new iu(e.ast,Wl(t))}var Ip=sd;function Lp(e){let t=yr(e.order),n=e.formatter??Lt;return(r,i)=>Ip(e=>t(e,r),{expected:`a value greater than or equal to ${n(r)}`,arbitraryConstraint:{order:e.order,minimum:r},...e.annotate?.(r),...i})}function Rp(e){let t=yr(e.order),n=_r(e.order),r=vr(e.order),i=gr(e.order),a=e.formatter??Lt;return(o,s)=>{let c=o.exclusiveMinimum?n:t,l=o.exclusiveMaximum?i:r;return Ip(e=>c(e,o.minimum)&&l(e,o.maximum),{expected:`a value between ${a(o.minimum)}${o.exclusiveMinimum?` (excluded)`:``} and ${a(o.maximum)}${o.exclusiveMaximum?` (excluded)`:``}`,arbitraryConstraint:{order:e.order,minimum:o.minimum,maximum:o.maximum,...o.exclusiveMinimum&&{exclusiveMinimum:!0},...o.exclusiveMaximum&&{exclusiveMaximum:!0}},...e.annotate?.(o),...s})}}function zp(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${Lt(e)}`);return e}var Bp=Lp({order:hr,annotate:e=>({representation:{id:`effect/schema/isGreaterThanOrEqualTo`,payload:{minimum:zp(e)}},toJsonSchema:()=>({minimum:e}),toCode:()=>({runtime:`Schema.isGreaterThanOrEqualTo(${Lt(e)})`})})}),Vp=Rp({order:hr,annotate:e=>{let t=e.exclusiveMinimum?!0:void 0,n=e.exclusiveMaximum?!0:void 0;return{representation:{id:`effect/schema/isBetween`,payload:{minimum:zp(e.minimum),maximum:zp(e.maximum),...t&&{exclusiveMinimum:t},...n&&{exclusiveMaximum:n}}},toJsonSchema:()=>({[t?`exclusiveMinimum`:`minimum`]:e.minimum,[n?`exclusiveMaximum`:`maximum`]:e.maximum}),toCode:()=>({runtime:`Schema.isBetween({ minimum: ${Lt(e.minimum)}, maximum: ${Lt(e.maximum)}, exclusiveMinimum: ${Lt(t)}, exclusiveMaximum: ${Lt(n)} })`})}}});function Hp(e){return Ip(e=>globalThis.Number.isSafeInteger(e),{expected:`an integer`,representation:{id:`effect/schema/isInt`,payload:null},toJsonSchema:()=>({type:`integer`}),toCode:()=>({runtime:`Schema.isInt()`}),arbitraryConstraint:{number:`integer`},...e})}var Up=yp.check(Hp());function Wp(e,t){return e=Math.max(0,Math.floor(e)),Ip(t=>t.length>=e,{expected:`a value with a length of at least ${e}`,representation:{id:`effect/schema/isMinLength`,payload:{minLength:e}},toJsonSchema:({type:t})=>t===`array`?{minItems:e}:{minLength:e},toCode:()=>({runtime:`Schema.isMinLength(${e})`}),[qc]:!0,arbitraryConstraint:{minLength:e},...t})}globalThis.RegExp,globalThis.URL;var Gp=G.annotate({expected:`a string that will be decoded as a Date`}),Kp=up(e=>e instanceof globalThis.Date&&!globalThis.Number.isNaN(e.getTime()),{representation:{id:`effect/schema/Date`,payload:null},toCode:()=>({runtime:`Schema.Date`,Type:`globalThis.Date`}),expected:`a valid Date`,toCodecJson:()=>Fp()(Gp,Yl)}),qp=Gp.pipe(Ap(Kp,Yl));globalThis.File,globalThis.FormData,globalThis.URLSearchParams,globalThis.Uint8Array;var Jp=Gl({decode:(e,t)=>wr(wl(e),{onNone:()=>Oc(new fl({expected:`a valid UTC DateTime string`},e,t)),onSome:e=>Sc(Tl(e))}),encode:e=>Sc(Dl(e))}),Yp=-864e13,Xp=864e13;function Zp(e,t,n){let r=Math.max(t,e?.minimum===void 0?t:e.minimum.epochMilliseconds+ +(e.exclusiveMinimum===!0)),i=Math.min(n,e?.maximum===void 0?n:e.maximum.epochMilliseconds-+(e.exclusiveMaximum===!0));return r<=i?[r,i]:[t,n]}function Qp(e,t){return Up.check(Vp({minimum:e,maximum:t}))}var $p=up(e=>xl(e)&&Sl(e),{representation:{id:`effect/schema/DateTimeUtc`,payload:null},toCode:()=>({runtime:`Schema.DateTimeUtc`,Type:`DateTime.Utc`,importDeclarations:[`import * as DateTime from "effect/DateTime"`]}),expected:`DateTime.Utc`,toCodecArbitrary:({constraint:e})=>{let[t,n]=Zp(e,Yp,Xp);return jp()(Qp(t,n),Pl(Cl))},toCodecJson:()=>Fp()(G,Jp),toFormatter:()=>e=>e.toString()}),em=G.annotate({expected:`a string that will be decoded as a DateTime.Utc`}).pipe(Ap($p,Jp)),tm=globalThis.Symbol.for(`immer-draftable`),nm={};function rm(e,t,n,r,i){let a=om(n,t,r),o=am(t),s=class extends e{constructor(...[e,t]){let r=t?.[`~payload`],i=r?.token===nm?r.value:n.make(e??{},t);super(i,{...t,disableChecks:!0,"~payload":{token:nm,value:i}})}static[cp]=cp;get[o](){return o}static[tm]=!0;static identifier=t;static fields=n.fields;static get ast(){return a(this).ast}static pipe(){return xe(this,arguments)}static rebuild(e){return a(this).rebuild(e)}static make(e,t){return Zf(a(this))(e??{},t)}static makeOption(e,t){return Xf(a(this))(e??{},t)}static makeEffect(e,t){return a(this).makeEffect(e??{},t)}static annotate(e){return this.rebuild(_d(this.ast,e))}static annotateKey(e){return this.rebuild(Ed(this.ast,e))}static check(...e){return this.rebuild(yd(this.ast,e))}static extend(e){return(t,r)=>{let a=sm(t)?t:Sp(t),o={...n.fields,...a.fields},s=Vu(o,n.ast.checks,{identifier:e});return rm(this,e,xp(yd(s,a.ast.checks),o),r,i)}}static mapFields(e,t){return n.mapFields(e,t)}};return i!==void 0&&Object.assign(s.prototype,i(t)),s}function im(e){return new Hl(Pl(t=>new e(t,{"~payload":{token:nm,value:t}})),Nl())}function am(e){return`~effect/Schema/Class/${e}`}function om(e,t,n){let r;return i=>{if(r!==void 0)return r;let a=am(t),o=e=>e instanceof i||Ue(e,a),s=im(i);return r=Ap(dp(new lu([e.ast],()=>(e,t,n)=>o(e)?Sc(e):Oc(new dl(t,e,n)),{identifier:t,[Yc]:([e])=>({isConstructed:o,link:new iu(e,s)}),toCodec:([e])=>new iu(e.ast,s),toEquivalence:([e])=>e,toFormatter:([e])=>t=>`${i.identifier}(${e(t)})`,[Jc]:Ku(e.ast),...n})),s)(e)}}function sm(e){return fp(e)}var cm=e=>(t,n)=>rm(Rn,e,sm(t)?t:Sp(t),n,e=>({name:e})),lm=e=>(t,n,r)=>{let i=sm(n)?n.mapFields(e=>({_tag:Np(t),...e}),{unsafePreserveChecks:!0}):Pp(t,n);return cm(e??t)(i,r)},um=`~effect/Stream`,dm={_R:Te,_E:Te,_A:Te},fm=function(e){this.channel=e};fm.prototype={[um]:dm,pipe(){return xe(this,arguments)}};var pm=e=>new fm(e),mm=e=>pm(jf(e)),hm=we(2,(e,t)=>Nf(e.channel,e=>{let n=0;return bc({while:()=>n<e.length,body:()=>t(e[n++]),step:ke})})),gm=g(),_m=(e,t)=>e.status===`ready`?{status:`ready`,api:t(e.api)}:e,vm=e=>({open:async(t,n,r)=>{let i=await Hc(Js()),a=await Hc(Xs(e.open,i).pipe(zc(e=>qs(e)?Zs(i,e):Tc))),o=!1,s=hm(a.changes,e=>wc(()=>{o||t(e)})),c=Vc((n?s.pipe(Lc(e=>wc(()=>{o||n(e)}))):s).pipe(Nc(wc(()=>{!o&&r&&r()})),zc(e=>Zs(i,e))));return{initial:a.initial,close:()=>{o=!0,Vc($d(c))}}}});function ym(e){let t=e.telemetry,n={contractVersion:e.contractVersion,sourceAccess:e.sourceAccess,metadataAccess:e.metadataAccess,send:e.send&&_m(e.send,e=>({sendTest:t=>Hc(e.sendTest(t)),send:t=>Hc(e.send(t)),testRecipient:e.testRecipient})),assets:e.assets&&_m(e.assets,e=>({uploadImage:t=>Hc(e.uploadImage(t)),fonts:{catalog:()=>Hc(e.fonts.catalog)}})),fixtures:e.fixtures&&_m(e.fixtures,e=>({view:t=>Hc(e.view(t))})),lifecycle:e.lifecycle&&_m(e.lifecycle,e=>({inspect:()=>Hc(e.inspect),publish:t=>Hc(e.publish(t)),restore:t=>Hc(e.restore(t)),resolveConflict:t=>Hc(e.resolveConflict(t)),updateFile:t=>Hc(e.updateFile(t))})),telemetry:t&&(e=>{Vc(t(e))})};return e.access===`readonly`?{...n,access:`readonly`,document:vm(e.document)}:{...n,access:`editable`,document:vm(e.document),writer:{save:t=>Hc(e.writer.save(t))}}}function bm(e,t){return e===2?((...e)=>e.length>=2?t(e[0],e[1]):n=>t(n,e[0])):e===3?((...e)=>e.length>=3?t(e[0],e[1],e[2]):n=>t(n,e[0],e[1])):e===4?((...e)=>e.length>=4?t(e[0],e[1],e[2],e[3]):n=>t(n,e[0],e[1],e[2])):((...n)=>n.length>=e?t(...n):e=>t(e,...n))}var xm=e=>e instanceof Error?{name:e.name,message:e.message,stack:e.stack}:e,Sm=class e extends Error{_tag=`Panic`;static is(t){return t instanceof e}constructor(e){if(super(e.message,e.cause===void 0?void 0:{cause:e.cause}),Object.assign(this,e),Object.setPrototypeOf(this,new.target.prototype),this.name=`Panic`,e.cause instanceof Error&&e.cause.stack){let t=e.cause.stack.replace(/\n/g,`
14
+ `);this.stack=`${this.stack}\nCaused by: ${t}`}}toJSON(){return{...this,_tag:this._tag,name:this.name,message:this.message,cause:xm(this.cause),stack:this.stack}}*[Symbol.iterator](){return yield*Am(this),Cm(`Unreachable: Err yielded in Panic but generator continued`,this)}},Cm=(e,t)=>{throw new Sm({message:e,cause:t})},wm=(e,t)=>{try{return e()}catch(e){throw Cm(t,e)}},Tm=async(e,t)=>{try{return await e()}catch(e){throw Cm(t,e)}},Em=class e{status=`ok`;constructor(e){this.value=e}isOk(){return!0}isErr(){return!1}map(t){return wm(()=>new e(t(this.value)),`map callback threw`)}mapError(e){return this}tryRecover(e){return this}tryRecoverAsync(e){return Promise.resolve(this)}andThen(e){return wm(()=>e(this.value),`andThen callback threw`)}andThenAsync(e){return Tm(()=>e(this.value),`andThenAsync callback threw`)}match(e){return wm(()=>e.ok(this.value),`match ok handler threw`)}unwrap(e){return this.value}unwrapOr(e){return this.value}tap(e){return wm(()=>(e(this.value),this),`tap callback threw`)}tapAsync(e){return Tm(async()=>(await e(this.value),this),`tapAsync callback threw`)}tapError(e){return this}tapErrorAsync(e){return Promise.resolve(this)}tapBoth(e){return wm(()=>(e.ok(this.value),this),`tapBoth ok callback threw`)}tapBothAsync(e){return Tm(async()=>(await e.ok(this.value),this),`tapBothAsync ok callback threw`)}*[Symbol.iterator](){return this.value}},Dm=class e{status=`error`;constructor(e){this.error=e}isOk(){return!1}isErr(){return!0}map(e){return this}mapError(t){return wm(()=>new e(t(this.error)),`mapError callback threw`)}tryRecover(e){return wm(()=>e(this.error),`tryRecover callback threw`)}tryRecoverAsync(e){return Tm(()=>e(this.error),`tryRecoverAsync callback threw`)}andThen(e){return this}andThenAsync(e){return Promise.resolve(this)}match(e){return wm(()=>e.err(this.error),`match err handler threw`)}unwrap(e){return Cm(e??`Unwrap called on Err: ${String(this.error)}`,this.error)}unwrapOr(e){return e}tap(e){return this}tapError(e){return wm(()=>(e(this.error),this),`tapError callback threw`)}tapAsync(e){return Promise.resolve(this)}tapErrorAsync(e){return Tm(async()=>(await e(this.error),this),`tapErrorAsync callback threw`)}tapBoth(e){return wm(()=>(e.err(this.error),this),`tapBoth err callback threw`)}tapBothAsync(e){return Tm(async()=>(await e.err(this.error),this),`tapBothAsync err callback threw`)}*[Symbol.iterator](){return yield this,Cm(`Unreachable: Err yielded in Result.gen but generator continued`,this.error)}};function Om(e){return new Em(e)}var km=e=>e.status===`ok`,Am=e=>new Dm(e),jm=e=>e.status===`error`,Mm=e=>e instanceof Error?{name:e.name,message:e.message,stack:e.stack}:e,Nm=e=>e instanceof Error&&`_tag`in e&&typeof e._tag==`string`&&`toJSON`in e&&typeof e.toJSON==`function`,Pm=e=>{class t extends Error{_tag=e;constructor(t){let n=t&&`message`in t&&typeof t.message==`string`?t.message:void 0,r=t&&`cause`in t?t.cause:void 0;if(super(n,r===void 0?void 0:{cause:r}),t&&Object.assign(this,t),Object.setPrototypeOf(this,new.target.prototype),this.name=e,r instanceof Error&&r.stack){let e=r.stack.replace(/\n/g,`
15
+ `);this.stack=`${this.stack}\nCaused by: ${e}`}}toJSON(){return{...this,_tag:this._tag,name:this.name,message:this.message,cause:Mm(this.cause),stack:this.stack}}match(e){return Fm(this,e)}*[Symbol.iterator](){return yield*Am(this),Cm(`Unreachable: Err yielded in TaggedError but generator continued`,this)}static is(e){return e instanceof this}}return t};Pm.is=Nm;var Fm=bm(2,(e,t)=>{let n=t[e._tag];try{return n(e)}catch(e){return Cm(`matchError handler threw`,e)}}),Im=class extends Pm(`UnhandledException`){constructor(e){let t=e.cause instanceof Error?`Unhandled exception: ${e.cause.message}`:`Unhandled exception: ${String(e.cause)}`;super({message:t,cause:e.cause})}},Lm=class extends Pm(`ResultDeserializationError`){constructor(e){super({message:e.issues?`Failed to deserialize Result payload`:`Failed to deserialize value as Result: expected { status: "ok", value } or { status: "error", error }`,value:e.value,issues:e.issues})}},Rm=class extends Pm(`ResultSerializationError`){constructor(e){super({message:`Failed to serialize Result payload`,value:e.value,issues:e.issues})}},zm=(e,t)=>{try{return e()}catch(e){throw Cm(t,e)}},Bm=(e,t)=>{let n=t=>{if(typeof e==`function`)try{return Om(e(t))}catch(e){return Am(new Im({cause:e}))}try{return Om(e.try(t))}catch(t){try{return Am(e.catch(t))}catch(e){throw Cm(`Result.try catch handler threw`,e)}}},r=t?.retry?.times??0,i=1,a=n({attempt:i});for(let e=0;e<r&&a.status===`error`;e++)i++,a=n({attempt:i});return a},Vm=async(e,t)=>{let n=async t=>{if(typeof e==`function`)try{return Om(await e(t))}catch(e){return Am(new Im({cause:e}))}try{return Om(await e.try(t))}catch(t){try{return Am(await e.catch(t))}catch(e){throw Cm(`Result.tryPromise catch handler threw`,e)}}},r=t?.retry;if(!r)return n({attempt:1,signal:t?.signal});let i=(e,t,n)=>{switch(t){case`constant`:return e;case`linear`:return e*(n+1);case`exponential`:return e*2**n}},a=r.jitter??!1;if(typeof a==`number`&&(!Number.isFinite(a)||a<0||a>1))throw Cm(`Result.tryPromise retry jitter must be a finite number between 0 and 1`);let o=a===!0?1:a===!1?0:a,s=e=>o===0?e:e*(1-o+Math.random()*o),c=(e,t)=>new Promise(n=>{if(t?.aborted){n(!1);return}let r=()=>{clearTimeout(i),n(!1)},i=setTimeout(()=>{t?.removeEventListener(`abort`,r),n(!0)},e);t?.addEventListener(`abort`,r,{once:!0})}),l={attempt:1,signal:t.signal},u=await n(l),d=r.shouldRetry??(()=>!0);for(let e=0;e<r.times&&!(u.status!==`error`||l.signal?.aborted);e++){let a=u.error;if(!zm(()=>d(a,l),`shouldRetry predicate threw`))break;let o;if(typeof r.delayMs==`function`){let e=r.delayMs;o=zm(()=>e(a,l),`Result.tryPromise delayMs callback threw`)}else{if(r.backoff===void 0)throw Cm(`Result.tryPromise static retry delay requires backoff`);o=s(i(r.delayMs,r.backoff,e))}if(!await c(o,l.signal)||l.signal?.aborted)break;l={attempt:l.attempt+1,signal:t.signal},u=await n(l)}return u},Hm=bm(2,(e,t)=>e.map(t)),Um=bm(2,(e,t)=>e.mapError(t)),Wm=bm(2,(e,t)=>e.tryRecover(t)),Gm=bm(2,(e,t)=>e.andThen(t)),Km=bm(2,(e,t)=>e.tryRecoverAsync(t)),qm=bm(2,(e,t)=>e.andThenAsync(t)),Jm=bm(2,(e,t)=>e.match(t)),Ym=bm(2,(e,t)=>e.tap(t)),Xm=bm(2,(e,t)=>e.tapAsync(t)),Zm=bm(2,(e,t)=>e.tapError(t)),Qm=bm(2,(e,t)=>e.tapErrorAsync(t)),$m=bm(2,(e,t)=>e.tapBoth(t)),eh=bm(2,(e,t)=>e.tapBothAsync(t)),th=(e,t)=>e.unwrap(t);function nh(e){if(!(typeof e==`object`&&e&&`status`in e&&(e.status===`ok`||e.status===`error`)))return Cm(`Result.gen body must return Result.ok() or Result.err(), got: `+(e===null?`null`:typeof e==`object`?JSON.stringify(e):String(e)))}var rh=bm(2,(e,t)=>e.unwrapOr(t)),ih=((e,t)=>{let n=e.call(t);if(Symbol.asyncIterator in n)return(async()=>{let e=n,t;try{t=await e.next()}catch(e){throw Cm(`generator body threw`,e)}if(nh(t.value),!t.done)try{await e.return?.(void 0)}catch(e){throw Cm(`generator cleanup threw`,e)}return t.value})();let r=n,i;try{i=r.next()}catch(e){throw Cm(`generator body threw`,e)}if(nh(i.value),!i.done)try{r.return?.(void 0)}catch(e){throw Cm(`generator cleanup threw`,e)}return i.value});async function*ah(e){return yield*await e}function oh(e){return typeof e==`object`&&!!e&&`status`in e&&(e.status===`ok`||e.status===`error`)}var sh=e=>typeof e==`object`&&!!e&&`then`in e&&typeof e.then==`function`,ch=(e,t)=>zm(e,t),lh=(e,t,n)=>sh(e)?Promise.resolve(e).catch(e=>{throw Cm(t,e)}).then(n):n(e),uh=(e,t)=>`issues`in e&&e.issues?Am(t(e.issues)):Om(e.value),dh=(e,t)=>lh(ch(()=>e[`~standard`].validate(t),`Result.codec serialize schema threw`),`Result.codec serialize schema threw`,e=>uh(e,e=>new Rm({value:t,issues:e}))),fh=(e,t)=>lh(ch(()=>e[`~standard`].validate(t),`Result.codec deserialize schema threw`),`Result.codec deserialize schema threw`,e=>uh(e,e=>new Lm({value:t,issues:e}))),ph=(e,t)=>sh(e)?Promise.resolve(e).then(e=>e.unwrap(t)):e.unwrap(t),mh=e=>{let t=e=>e.status===`ok`?Om(e.value):Lm.is(e.error)?e.unwrap(`Result.codec deserializeUnsafe failed`):Am(e.error);return sh(e)?Promise.resolve(e).then(t):t(e)},hh=e=>{let t=e=>e.status===`error`?Am(e.error):Om({status:`ok`,value:e.value}),n=e=>e.status===`error`?Am(e.error):Om({status:`error`,error:e.value});function r(r){if(r.status===`ok`){let n=dh(e.serialize.ok,r.value);return sh(n)?Promise.resolve(n).then(t):t(n)}let i=dh(e.serialize.err,r.error);return sh(i)?Promise.resolve(i).then(n):n(i)}let i=e=>e.status===`error`?Am(e.error):Om(e.value),a=e=>e.status===`error`?Am(e.error):Am(e.value);function o(t){if(!oh(t))return Am(new Lm({value:t}));if(t.status===`ok`){let n=fh(e.deserialize.ok,t.value);return sh(n)?Promise.resolve(n).then(i):i(n)}let n=fh(e.deserialize.err,t.error);return sh(n)?Promise.resolve(n).then(a):a(n)}function s(e){return ph(r(e),`Result.codec serializeUnsafe failed`)}function c(e){return mh(o(e))}return{serialize:r,serializeUnsafe:s,deserialize:o,deserializeUnsafe:c}},gh=async(e,t)=>{try{return await Promise.all(e)}catch(e){return Cm(t,e)}},_h=e=>{let t=[];for(let n of e){if(n.status===`error`)return n;t.push(n.value)}return Om(t)},vh=async e=>_h(await gh(e,`Result.allAsync input promise rejected`)),yh=e=>{let t=[],n=[];for(let r of e)r.status===`ok`?t.push(r.value):n.push(r.error);return[t,n]},bh={ok:Om,isOk:km,err:Am,isError:jm,try:Bm,tryPromise:Vm,map:Hm,mapError:Um,tryRecover:Wm,andThen:Gm,tryRecoverAsync:Km,andThenAsync:qm,match:Jm,tap:Ym,tapAsync:Xm,tapError:Zm,tapErrorAsync:Qm,tapBoth:$m,tapBothAsync:eh,unwrap:th,unwrapOr:rh,gen:ih,await:ah,codec:hh,all:_h,allAsync:vh,partition:yh,partitionAsync:async e=>yh(await gh(e,`Result.partitionAsync input promise rejected`)),flatten:e=>e.status===`ok`?e.value:e},xh=e=>e.map(e=>e.message).join(`
16
+ `),Sh=class extends Pm(`SmlParseError`){constructor(e){super({diagnostics:e.diagnostics,message:xh(e.diagnostics)})}},Ch=class extends Pm(`SmlCompileError`){constructor(e){super({diagnostics:e.diagnostics,message:xh(e.diagnostics)})}},wh=e=>{let t=[0];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);(r===10||r===13&&e.charCodeAt(n+1)!==10||r===8232||r===8233)&&t.push(n+1)}return t},Th={maxCharacters:5e5,maxUtf8Bytes:1048576,maxDepth:64,maxNodes:25e3},Eh=9,Dh=10,Oh=13,kh=32,Ah=33,jh=39,Mh=40,Nh=41,Ph=45,Fh=46,Ih=60,Lh=61,Rh=62,zh=95,Bh=48,Vh=57,Hh=65,Uh=90,Wh=97,Gh=122,Kh=e=>e===kh||e===Eh||e===Dh||e===Oh,qh=e=>e>=Bh&&e<=Vh,Jh=e=>e>=Hh&&e<=Uh||e>=Wh&&e<=Gh,Yh=e=>Jh(e)||e===zh,Xh=e=>Yh(e)||qh(e),Zh=[`and`,`or`,`not`],Qh=e=>Zh.includes(e),$h=(e,t)=>{let n=[],r=0,i=e.length,a=(e,n,r,i)=>bh.err({diagnostic:{code:e,message:n,span:{start:t+r,end:t+i}}});for(;r<i;){let o=e.charCodeAt(r);if(Kh(o)){r++;continue}let s=r;if(o===Mh){r++,n.push({kind:`lparen`,text:`(`,span:{start:t+s,end:t+r}});continue}if(o===Nh){r++,n.push({kind:`rparen`,text:`)`,span:{start:t+s,end:t+r}});continue}if(o===Lh||o===Ah){if(e.charCodeAt(r+1)===Lh){r+=2,n.push({kind:`op`,text:o===Lh?`==`:`!=`,span:{start:t+s,end:t+r}});continue}return a(`predicate-invalid-operator`,`unexpected ${String.fromCharCode(o)} — ${o===Lh?`write == to compare`:`write != to compare`}`,s,s+1)}if(o===Rh||o===Ih){r++,e.charCodeAt(r)===Lh&&r++,n.push({kind:`op`,text:e.slice(s,r),span:{start:t+s,end:t+r}});continue}if(o===jh){r++;let o=r;for(;r<i&&e.charCodeAt(r)!==jh;)r++;if(r>=i)return a(`predicate-unterminated-string`,`unterminated string — add a closing '`,s,i);let c=e.slice(o,r);if(r++,c.includes(`--`))return a(`predicate-string-double-dash`,`string literals cannot contain -- (predicates are embedded in HTML comment markers)`,s,r);n.push({kind:`string`,text:e.slice(s,r),string:c,span:{start:t+s,end:t+r}});continue}if(qh(o)||o===Ph&&qh(e.charCodeAt(r+1))){for(r++;r<i&&qh(e.charCodeAt(r));)r++;if(e.charCodeAt(r)===Fh&&qh(e.charCodeAt(r+1)))for(r++;r<i&&qh(e.charCodeAt(r));)r++;let o=e.slice(s,r),c=Number.parseFloat(o);if(!Number.isFinite(c))return a(`predicate-number-out-of-range`,`number literal is outside the finite numeric range`,s,r);n.push({kind:`number`,text:o,number:c,span:{start:t+s,end:t+r}});continue}if(Yh(o)){for(r++;r<i&&Xh(e.charCodeAt(r));)r++;if(e.charCodeAt(r)===Fh)return a(`predicate-path-not-supported`,`unexpected . after "${e.slice(s,r)}" — predicates use flat variable names, not paths`,s,r+1);n.push({kind:`name`,text:e.slice(s,r),span:{start:t+s,end:t+r}});continue}return o===Fh?a(`predicate-path-not-supported`,`unexpected . — predicates use flat variable names, not paths`,s,s+1):a(`predicate-unexpected-character`,`unexpected character ${JSON.stringify(String.fromCharCode(o))} in predicate`,s,s+1)}return n.push({kind:`eof`,text:``,span:{start:t+i,end:t+i}}),bh.ok(n)},eg=[`==`,`!=`,`>`,`>=`,`<`,`<=`],tg=(e,t=0)=>{if(e.length>Th.maxCharacters)return bh.err([{code:`predicate-character-limit`,message:`predicate exceeds the ${Th.maxCharacters} character limit`,span:{start:t,end:t+e.length}}]);if(new TextEncoder().encode(e).byteLength>Th.maxUtf8Bytes)return bh.err([{code:`predicate-byte-limit`,message:`predicate exceeds the ${Th.maxUtf8Bytes} byte UTF-8 limit`,span:{start:t,end:t+e.length}}]);let n=$h(e,t);if(bh.isError(n))return bh.err([n.error.diagnostic]);let r=n.value,i=0,a,o=0,s=(e,t,n)=>(a??={code:e,message:t,span:n},null),c=()=>r[i],l=()=>r[i++],u=(e,t)=>e.kind===`name`&&e.text===t,d=e=>(o+=1,o>Th.maxNodes?s(`predicate-node-limit`,`predicate exceeds the ${Th.maxNodes} node limit`,e.span):e),f=e=>{let t=l();if(t.kind===`lparen`){if(e>=Th.maxDepth)return s(`predicate-depth-limit`,`predicate nesting exceeds the maximum depth of ${Th.maxDepth}`,t.span);let n=h(e+1);if(n===null)return null;let r=l();return r.kind===`rparen`?n:s(`predicate-missing-paren`,`missing ) — close the group`,r.span)}if(t.kind===`name`){if(Qh(t.text))return s(`predicate-unexpected-token`,`unexpected "${t.text}" — expected a variable name, comparison, or ( group )`,t.span);let e=c();if(e.kind!==`op`)return d({kind:`name`,name:t.text,span:t.span});l();let n=eg.find(t=>t===e.text);if(n===void 0)return s(`predicate-invalid-operator`,`unknown operator ${e.text} — use ==, !=, >, >=, <, or <=`,e.span);let r=l();return r.kind===`string`?d({kind:`comparison`,name:t.text,op:n,literal:{kind:`string`,value:r.string},span:{start:t.span.start,end:r.span.end}}):r.kind===`number`?d({kind:`comparison`,name:t.text,op:n,literal:{kind:`number`,value:r.number},span:{start:t.span.start,end:r.span.end}}):s(`predicate-expected-literal`,`expected a literal after ${n} — write ${t.text} ${n} 'value' or ${t.text} ${n} 5`,r.span)}return t.kind===`eof`?s(`predicate-unexpected-end`,`unexpected end of predicate — expected a variable name, comparison, or ( group )`,t.span):s(`predicate-unexpected-token`,`unexpected ${t.text} — comparisons put the variable first: name == 'value'`,t.span)},p=e=>{let t=c();if(u(t,`not`)){l();let n=f(e);return n===null?null:d({kind:`not`,operand:n,span:{start:t.span.start,end:n.span.end}})}return f(e)},m=e=>{let t=p(e);for(;t!==null&&u(c(),`and`);){l();let n=p(e);if(n===null)return null;t=d({kind:`and`,left:t,right:n,span:{start:t.span.start,end:n.span.end}})}return t},h=e=>{let t=m(e);for(;t!==null&&u(c(),`or`);){l();let n=m(e);if(n===null)return null;t=d({kind:`or`,left:t,right:n,span:{start:t.span.start,end:n.span.end}})}return t};if(e.trim().length===0)return bh.err([{code:`predicate-empty`,message:`empty predicate — write e.g. plan == 'pro'`,span:{start:t,end:t+e.length}}]);let g=h(0);if(g!==null&&a===void 0){let e=c();e.kind!==`eof`&&s(`predicate-trailing-input`,`unexpected ${JSON.stringify(e.text)} after the predicate — join clauses with "and" or "or"`,e.span)}return g===null||a!==void 0?bh.err([a??{code:`predicate-parse-failed`,message:`predicate parse failed`,span:{start:t,end:t+e.length}}]):bh.ok(g)},ng=e=>typeof e==`number`?e:typeof e==`string`&&e.trim()!==``?Number(e):NaN,rg=(e,t,n)=>{switch(e){case`==`:return t===n;case`!=`:return t!==n;case`>`:return t>n;case`>=`:return t>=n;case`<`:return t<n;case`<=`:return t<=n}},ig=(e,t)=>{let n=t[e.name];if(n==null)return!1;if(e.literal.kind===`number`){let t=ng(n);return!Number.isNaN(t)&&rg(e.op,t,e.literal.value)}if(e.op===`==`||e.op===`!=`)return typeof n==`string`?e.op===`==`?n===e.literal.value:n!==e.literal.value:!1;let r=ng(n),i=ng(e.literal.value);return Number.isNaN(r)||Number.isNaN(i)?!1:rg(e.op,r,i)},ag=(e,t)=>{let n=[{kind:`node`,node:e}],r=[];for(;n.length>0;){let e=n.pop();if(e.kind===`not`){r.push(!r.pop());continue}if(e.kind===`and`||e.kind===`or`){let t=r.pop();e.kind===`and`&&!t||e.kind===`or`&&t?r.push(t):n.push({kind:`node`,node:e.right});continue}let i=e.node;switch(i.kind){case`or`:case`and`:n.push({kind:i.kind,right:i.right},{kind:`node`,node:i.left});break;case`not`:n.push({kind:`not`},{kind:`node`,node:i.operand});break;case`comparison`:r.push(ig(i,t));break;case`name`:{let e=t[i.name];r.push(e!=null&&e!==``);break}}}return r[0]},og=e=>{switch(e.kind){case`or`:return 1;case`and`:return 2;case`not`:return 3;case`comparison`:case`name`:return 4}},sg=e=>{if(e.kind===`number`){if(Number.isFinite(e.value))return String(e.value);throw TypeError(`Number ${String(e.value)} cannot be represented in a predicate: number literals must be finite`)}if(e.value.includes(`'`)||e.value.includes(`--`))throw TypeError(`String ${JSON.stringify(e.value)} cannot be represented in a predicate: string literals cannot contain ' or --`);return`'${e.value}'`},cg=e=>{let t=[{kind:`node`,node:e,minPrecedence:0}],n=[];for(;t.length>0;){let e=t.pop();if(e.kind===`text`){n.push(e.value);continue}let{node:r,minPrecedence:i}=e,a=og(r)<i;switch(a&&t.push({kind:`text`,value:`)`}),r.kind){case`or`:case`and`:{let e=r.kind===`or`?` or `:` and `,n=r.kind===`or`?1:2;t.push({kind:`node`,node:r.right,minPrecedence:n},{kind:`text`,value:e},{kind:`node`,node:r.left,minPrecedence:n});break}case`not`:t.push({kind:`node`,node:r.operand,minPrecedence:4},{kind:`text`,value:`not `});break;case`comparison`:t.push({kind:`text`,value:`${r.name} ${r.op} ${sg(r.literal)}`});break;case`name`:t.push({kind:`text`,value:r.name})}a&&n.push(`(`)}return n.join(``)},lg=e=>{let t=new Set,n=[e];for(;n.length>0;){let e=n.pop();switch(e.kind){case`or`:case`and`:n.push(e.right,e.left);break;case`not`:n.push(e.operand);break;case`comparison`:case`name`:t.add(e.name)}}return t},ug=[`Email`,`Subject`,`Preview`,`Container`,`Section`,`Row`,`Column`,`Heading`,`Text`,`Button`,`Image`,`Divider`,`Spacer`,`List`,`ListItem`,`If`,`Else`],dg=[`strong`,`em`,`a`],fg=[`Source`],pg=[`Sms`,`WhatsApp`,`Header`,`Body`,`Footer`,`Buttons`],mg=[...ug,...dg,...fg,...pg];Object.freeze(Object.fromEntries(mg.map(e=>[`${e[0].toUpperCase()}${e.slice(1)}`,e])));var hg={Email:`email`,Sms:`sms`,WhatsApp:`whatsapp`},gg=Object.keys(hg),_g=e=>e in hg,vg=(e,t)=>e.attributes.find(e=>e.name===t)?.value,yg=(e,t)=>{let n=vg(e,t);return n?.kind===`string`?n.value:void 0},bg=e=>{let t=new Set,n=/\$\{\s*\/?([\w.]+)\s*\}|\{\{\s*([\w.]+)\s*\}\}/g,r=e=>{if(e.kind===`interpolation`){t.add(e.name);return}if(e.kind!==`text`){for(let r of e.attributes)if(r.value.kind===`string`){if(e.tag===`If`&&r.name===`test`){let e=tg(r.value.value);if(bh.isOk(e))for(let n of lg(e.value))t.add(n);continue}for(let e of r.value.value.matchAll(n)){let n=e[1]??e[2];n!==void 0&&t.add(n)}}for(let t of e.children)r(t)}};return r(e.root),t},xg=9,Sg=10,Cg=13,wg=32,Tg=33,Eg=34,Dg=35,Og=36,kg=38,Ag=39,jg=47,Mg=59,Ng=60,Pg=61,Fg=62,Ig=123,Lg=125,Rg=46,zg=95,Bg=48,Vg=57,Hg=65,Ug=88,Wg=90,Gg=97,Kg=120,qg=122,Jg={EndOfFile:0,LessThan:1,LessThanSlash:2,GreaterThan:3,SlashGreaterThan:4,Identifier:5,Equals:6,String:7,OpenBrace:8,CloseBrace:9,Number:10,Text:11,Interpolation:12,Unknown:13},Yg=e=>e===wg||e===xg||e===Sg||e===Cg,Xg=e=>e>=Bg&&e<=Vg,Zg=e=>e>=Hg&&e<=Wg||e>=Gg&&e<=qg,Qg=e=>Zg(e)||Xg(e)||e===zg||e===Rg,$g={amp:`&`,lt:`<`,gt:`>`,quot:`"`,apos:`'`,nbsp:`\xA0`},e_=(e,t)=>{let n=Number.parseInt(e,t);return Number.isFinite(n)&&n<=1114111?n:void 0},t_=(e,t)=>{let n=t+1;if(e.charCodeAt(n)===Dg){n++;let t=e.charCodeAt(n),r=t===Kg||t===Ug;r&&n++;let i=n;for(;n<e.length;){let t=e.charCodeAt(n);if(!(Xg(t)||r&&(t>=97&&t<=102||t>=65&&t<=70)))break;n++}return n===i||e_(e.slice(i,n),r?16:10)===void 0?-1:e.charCodeAt(n)===Mg?n+1:-1}let r=n;for(;n<e.length&&Zg(e.charCodeAt(n));)n++;let i=e.slice(r,n);return Object.hasOwn($g,i)&&e.charCodeAt(n)===Mg?n+1:-1},n_=e=>{if(!e.includes(`&`))return e;let t=``,n=0;for(;n<e.length;){let r=e.indexOf(`&`,n);if(r===-1){t+=e.slice(n);break}t+=e.slice(n,r);let i=e.indexOf(`;`,r);if(i===-1){t+=e.slice(r);break}let a=e.slice(r+1,i);if(a.startsWith(`#x`)||a.startsWith(`#X`)){let n=e_(a.slice(2),16);t+=n===void 0?e.slice(r,i+1):String.fromCodePoint(n)}else if(a.startsWith(`#`)){let n=e_(a.slice(1),10);t+=n===void 0?e.slice(r,i+1):String.fromCodePoint(n)}else t+=Object.hasOwn($g,a)?$g[a]:e.slice(r,i+1);n=i+1}return t},r_=e=>{let t=0,n=e.length,r=(e,n,r)=>({kind:e,start:n,end:t,...r}),i=(e,i,a)=>(t===e&&(t=Math.min(e+1,n)),r(Jg.Unknown,e,{error:{code:i,message:a}})),a=(a,o)=>{for(t=a+2;t<n&&Yg(e.charCodeAt(t));)t++;o===`dollar`&&e.charCodeAt(t)===jg&&t++;let s=t;for(;t<n&&Qg(e.charCodeAt(t));)t++;let c=e.slice(s,t);for(;t<n&&Yg(e.charCodeAt(t));)t++;let l=o===`curly`?e.charCodeAt(t)===Lg&&e.charCodeAt(t+1)===Lg:e.charCodeAt(t)===Lg;return c.length===0||!l?(t=a,i(a,`invalid-interpolation`,`malformed interpolation — write ${o===`curly`?`{{variableName}}`:"${variableName}"} using letters, digits, underscore, or dot`)):(t+=o===`curly`?2:1,r(Jg.Interpolation,a,{name:c,syntax:o}))};return{position:()=>t,scanTextToken:()=>{let o=t;if(t>=n)return r(Jg.EndOfFile,o);let s=e.charCodeAt(t);if(s===Ng){let n=e.charCodeAt(t+1);return n===jg?(t+=2,r(Jg.LessThanSlash,o)):Zg(n)?(t+=1,r(Jg.LessThan,o)):n===Tg?i(o,`comment-not-supported`,e.startsWith(`<!--`,t)?`comments are not part of SML — remove the <!-- ... --> block`:`unexpected <! — SML has no doctype or declaration syntax; remove it`):i(o,`stray-angle-bracket`,`stray < in text — escape it as &lt;`)}if(s===Ig&&e.charCodeAt(t+1)===Ig)return a(o,`curly`);if(s===Og&&e.charCodeAt(t+1)===Ig)return a(o,`dollar`);for(;t<n;){let n=e.charCodeAt(t);if(n===Ng||n===Ig&&e.charCodeAt(t+1)===Ig||n===Og&&e.charCodeAt(t+1)===Ig)break;if(n===kg){let n=t_(e,t);if(n===-1)return t>o?r(Jg.Text,o):i(o,`bare-ampersand`,`bare & in text — escape it as &amp; (or use a supported entity like &lt;)`);t=n;continue}t++}return r(Jg.Text,o)},scanTagToken:()=>{for(;t<n&&Yg(e.charCodeAt(t));)t++;let a=t;if(t>=n)return r(Jg.EndOfFile,a);let o=e.charCodeAt(t);switch(o){case Fg:return t++,r(Jg.GreaterThan,a);case jg:return e.charCodeAt(t+1)===Fg?(t+=2,r(Jg.SlashGreaterThan,a)):i(a,`unexpected-character`,`unexpected / inside tag — write /> to self-close`);case Pg:return t++,r(Jg.Equals,a);case Ig:return t++,r(Jg.OpenBrace,a);case Lg:return t++,r(Jg.CloseBrace,a);case Eg:case Ag:for(t++;t<n;){let n=e.charCodeAt(t);if(n===o)break;if(n===kg){let n=t_(e,t);if(n===-1)return i(t,`bare-ampersand`,`bare & in attribute value — escape it as &amp;`);t=n;continue}if(n===Ng||n===Sg)break;t++}if(e.charCodeAt(t)!==o){let e=String.fromCharCode(o);return{kind:Jg.Unknown,start:a,end:t,error:{code:`unterminated-string`,message:`unterminated attribute value — add a closing ${e}`}}}return t++,r(Jg.String,a);default:if(Zg(o)){for(t++;t<n;){let n=e.charCodeAt(t);if(!Zg(n)&&!Xg(n))break;t++}return r(Jg.Identifier,a)}if(Xg(o)){for(t++;t<n&&Xg(e.charCodeAt(t));)t++;return r(Jg.Number,a)}return i(a,`unexpected-character`,`unexpected character ${JSON.stringify(String.fromCharCode(o))} inside tag`)}},getText:t=>e.slice(t.start,t.end),getTextValue:t=>n_(e.slice(t.start,t.end)),getStringValue:t=>n_(e.slice(t.start+1,t.end-1))}},i_=(e,t,n)=>bh.err(new Sh({diagnostics:[{code:e,message:t,span:{start:0,end:n}}]})),a_=[`transactional`,`promotional`,`service_implicit`],o_=[`marketing`,`utility`,`authentication`],s_=[`text`,`image`,`video`,`document`],c_=[`quick-reply`,`url`,`phone`,`copy-code`],l_={backgroundImage:{type:`string`},backgroundPosition:{type:`string`,values:[`center`,`top`,`bottom`]},backgroundSize:{type:`string`,values:[`cover`,`contain`,`auto`]}},u_={Email:{attributes:{lang:{type:`string`},dir:{type:`string`},width:{type:`number`,min:1,max:1e4},class:{type:`string`}},content:`email`},Subject:{attributes:{},content:`preview`},Preview:{attributes:{},content:`preview`},Container:{attributes:{class:{type:`string`},...l_},content:`block`},Section:{attributes:{class:{type:`string`},...l_},content:`block`},Row:{attributes:{class:{type:`string`}},content:`columns`},Column:{attributes:{class:{type:`string`},width:{type:`string`},valign:{type:`string`,values:[`top`,`middle`,`bottom`]}},content:`block`},Heading:{attributes:{level:{type:`number`,min:1,max:6},class:{type:`string`}},content:`inline`},Text:{attributes:{class:{type:`string`}},content:`inline`},Button:{attributes:{href:{type:`string`,required:!0},class:{type:`string`}},content:`inline-nolink`},Image:{attributes:{src:{type:`string`,required:!0},alt:{type:`string`},width:{type:`number`,min:0,max:1e4},height:{type:`number`,min:0,max:1e4},class:{type:`string`}},content:`image`},Source:{attributes:{scheme:{type:`string`,required:!0,values:[`dark`]},src:{type:`string`,required:!0}},content:`void`},Divider:{attributes:{class:{type:`string`}},content:`void`},Spacer:{attributes:{height:{type:`number`,required:!0,min:1,max:2e3}},content:`void`},List:{attributes:{type:{type:`string`,values:[`unordered`,`ordered`]},class:{type:`string`}},content:`list`},ListItem:{attributes:{class:{type:`string`}},content:`inline`},If:{attributes:{test:{type:`string`,required:!0}},content:`if`},Else:{attributes:{},content:`block`},a:{attributes:{href:{type:`string`,required:!0},class:{type:`string`}},content:`inline-nolink`},strong:{attributes:{},content:`inline-nolink`},em:{attributes:{},content:`inline-nolink`}},d_={email:u_,sms:{Sms:{attributes:{category:{type:`string`,values:a_}},content:`verbatim`},If:{attributes:{test:{type:`string`,required:!0}},content:`verbatim-if`},Else:{attributes:{},content:`verbatim`}},whatsapp:{WhatsApp:{attributes:{name:{type:`string`},language:{type:`string`},category:{type:`string`,required:!0,values:o_}},content:`whatsapp`},Header:{attributes:{type:{type:`string`,values:s_}},content:`verbatim`},Body:{attributes:{},content:`verbatim`},Footer:{attributes:{},content:`verbatim`},Buttons:{attributes:{},content:`buttons`},Button:{attributes:{type:{type:`string`,required:!0,values:c_},url:{type:`string`},phone:{type:`string`}},content:`verbatim`},If:{attributes:{test:{type:`string`,required:!0}},content:`verbatim-if`},Else:{attributes:{},content:`verbatim`}}},f_={label:{type:`string`},hidden:{type:`string`,values:[`true`]}},p_=new Set([`Container`,`Section`,`Row`,`Column`,`Heading`,`Text`,`Button`,`Image`,`Divider`,`Spacer`,`List`,`ListItem`,`If`,`Else`]),m_=e=>Object.hasOwn(f_,e)?f_[e]:void 0,h_=[`Container`,`Section`,`Row`,`Heading`,`Text`,`Button`,`Image`,`Divider`,`Spacer`,`List`,`If`],g_=[`Subject`,`Preview`],__=e=>{switch(e){case`email`:return[...g_,...h_];case`block`:return h_;case`columns`:return[`Column`];case`list`:return[`ListItem`];case`image`:return[`Source`];case`if`:return[...h_,`Else`];case`inline`:return[`strong`,`em`,`a`];case`inline-nolink`:return[`strong`,`em`];case`whatsapp`:return[`Header`,`Body`,`Footer`,`Buttons`];case`buttons`:return[`Button`];case`verbatim`:return[`If`];case`verbatim-if`:return[`If`,`Else`];case`preview`:case`void`:return[]}},v_=e=>e===`inline`||e===`inline-nolink`||e===`preview`,y_=e=>e===`verbatim`||e===`verbatim-if`,b_=e=>v_(e)||y_(e),x_=e=>e.map(e=>`<${e}>`).join(`, `),S_={list:`ListItem`,whatsapp:`Body`,buttons:`Button`},C_=e=>{if(e.length>Th.maxCharacters)return i_(`source-character-limit`,`SML source exceeds the ${Th.maxCharacters} character limit (${e.length} characters)`,e.length);let t=new TextEncoder().encode(e).byteLength;if(t>Th.maxUtf8Bytes)return i_(`source-byte-limit`,`SML source exceeds the ${Th.maxUtf8Bytes} byte UTF-8 limit (${t} bytes)`,e.length);let n=r_(e),r,i=0,a=null,o=u_,s=(e,t,n)=>(r??={code:e,message:t,span:n},null),c=e=>{let t=e.error??{code:`unexpected-token`,message:`unexpected ${JSON.stringify(n.getText(e))}`};return s(t.code,t.message,{start:e.start,end:e.end})},l=e=>{let t=i+1;return t>Th.maxNodes?(s(`node-limit`,`SML document exceeds the ${Th.maxNodes} node limit (${t} nodes)`,e),!1):(i=t,!0)},u=(e,t,r,i)=>{let a={start:i.start,end:i.end};if(n.scanTagToken().kind!==Jg.Equals)return s(`missing-attribute-value`,`attribute "${t}" needs a value — write ${t}=${r.type===`number`?`{${r.min??1}}`:`"..."`}`,a);let o=n.scanTagToken();if(o.kind===Jg.Unknown)return c(o);if(o.kind===Jg.Identifier||o.kind===Jg.Number){let e=n.getText(o),i=r.type===`number`?`${t}={${e}}`:`${t}="${e}"`;return s(`unquoted-attribute`,`attribute values must be quoted — write ${i}`,{start:o.start,end:o.end})}if(o.kind===Jg.OpenBrace){let i=n.scanTagToken();if(i.kind!==Jg.Number)return s(`invalid-attribute-value`,`expected a number inside braces — write ${t}={16}`,{start:i.start,end:i.end});let a=n.scanTagToken();return a.kind===Jg.CloseBrace?r.type===`number`?{value:{kind:`number`,value:Number.parseInt(n.getText(i),10)},valueSpan:{start:i.start,end:i.end}}:s(`invalid-attribute-value`,`"${t}" on <${e}> is a string attribute — write ${t}="..."`,{start:o.start,end:a.end}):s(`invalid-attribute-value`,`missing } after ${t}={${n.getText(i)}`,{start:a.start,end:a.end})}if(o.kind!==Jg.String)return s(`missing-attribute-value`,`attribute "${t}" needs a value — write ${t}=${r.type===`number`?`{16}`:`"..."`}`,{start:o.start,end:o.end});let l=n.getStringValue(o),u={start:o.start+1,end:o.end-1};return r.type===`number`?/^\d+$/.test(l)?{value:{kind:`number`,value:Number.parseInt(l,10)},valueSpan:u}:s(`invalid-attribute-value`,`"${t}" on <${e}> must be a number — write ${t}={16}`,u):r.values!==void 0&&!r.values.includes(l)?s(`invalid-attribute-value`,`"${t}" on <${e}> must be one of ${r.values.map(e=>`"${e}"`).join(`, `)}`,u):{value:{kind:`string`,value:l},valueSpan:u}},d=(e,t,n,r)=>{if(r.value.kind!==`number`)return!0;let{value:i}=r.value;return n.min!==void 0&&i<n.min?(s(`invalid-attribute-value`,`"${t}" on <${e}> must be at least ${n.min}`,r.valueSpan),!1):n.max!==void 0&&i>n.max?(s(`invalid-attribute-value`,`"${t}" on <${e}> must be at most ${n.max}`,r.valueSpan),!1):!0},f=(e,t)=>{if(t>Th.maxDepth)return s(`depth-limit`,`SML nesting exceeds the maximum depth of ${Th.maxDepth} (observed ${t})`,{start:e.start,end:e.end});let r=n.scanTagToken();if(r.kind!==Jg.Identifier)return r.kind===Jg.Unknown?c(r):s(`unknown-tag`,`expected a tag name after <`,{start:r.start,end:r.end});let i=n.getText(r);if(a===null){if(!_g(i))return s(`invalid-root`,`the document root must be ${gg.map(e=>`<${e}>`).join(`, `)} — the root tag declares the channel`,{start:r.start,end:r.end});a=hg[i],o=d_[a]}let p=mg.find(e=>e===i),m=p===void 0?void 0:o[p];if(p===void 0||m===void 0){let e=Object.keys(o),t=e.find(e=>e.toLowerCase()===i.toLowerCase()),n=t===void 0?p===void 0?`${a} tags are ${x_(e)}`:`<${p}> is not part of ${a} documents; ${a} tags are ${x_(e)}`:`did you mean <${t}>?`;return s(`unknown-tag`,`unknown tag <${i}> — ${n}`,{start:r.start,end:r.end})}if(!l({start:e.start,end:r.end}))return null;let h={kind:`element`,id:``,tag:p,attributes:[],children:[],span:{start:e.start,end:e.end}},g=!1;for(;;){let t=n.scanTagToken();if(t.kind===Jg.Identifier){let e=n.getText(t),r=a===`email`&&p_.has(p),i=m.attributes[e]??(r?m_(e):void 0);if(i===void 0){let n=[...Object.keys(m.attributes),...r?Object.keys(f_):[]],i=n.length===0?`<${p}> takes no attributes`:`<${p}> accepts ${n.map(e=>`"${e}"`).join(`, `)}`;return s(`unknown-attribute`,`unknown attribute "${e}" on <${p}> — ${i}`,{start:t.start,end:t.end})}if(h.attributes.some(t=>t.name===e))return s(`duplicate-attribute`,`duplicate attribute "${e}" on <${p}> — remove one`,{start:t.start,end:t.end});let o=u(p,e,i,t);if(o===null)return null;let c={name:e,value:o.value,span:{start:t.start,end:o.valueSpan.end+1},valueSpan:o.valueSpan};if(!d(p,e,i,c))return null;h.attributes.push(c);continue}if(t.kind===Jg.SlashGreaterThan){g=!0,h.span.end=t.end;break}if(t.kind===Jg.GreaterThan){h.span.end=t.end;break}return t.kind===Jg.EndOfFile?s(`unclosed-tag`,`unclosed <${p}> — add </${p}>`,{start:e.start,end:r.end}):c(t)}for(let[t,n]of Object.entries(m.attributes))if(n.required===!0&&!h.attributes.some(e=>e.name===t)){let r=n.type===`number`?`${t}={16}`:p===`If`?`test="plan == 'pro'"`:`${t}="..."`;return s(`missing-attribute`,`<${p}> requires the "${t}" attribute — add ${r}`,{start:e.start,end:h.span.end})}if(p===`If`){let e=h.attributes.findIndex(e=>e.name===`test`),t=h.attributes[e];if(t.value.kind===`string`){let n=tg(t.value.value,t.valueSpan.start);if(bh.isError(n)){let e=n.error[0];return s(e.code,e.message,e.span)}h.attributes[e]={...t,value:{kind:`string`,value:cg(n.value)}}}}if(m.content===`void`&&!g)return s(`void-needs-self-close`,`<${p}> is self-closing — write <${p} ... />`,{start:e.start,end:h.span.end});if(g)return m.content===`whatsapp`?s(`whatsapp-missing-body`,`<WhatsApp> requires a <Body> component — add <Body>...</Body>`,h.span):h;let _=m.content;for(;;){let i=n.scanTextToken();if(i.kind===Jg.EndOfFile)return s(`unclosed-tag`,`unclosed <${p}> — add </${p}>`,{start:e.start,end:r.end});if(i.kind===Jg.Unknown)return c(i);let a=e=>{if(_===`image`)return`${e} is not allowed directly inside <${p}> — <${p}> may contain only ${x_(__(_))}`;let t=S_[_]??`Text`;return`${e} is not allowed directly inside <${p}> — wrap it in <${t}>`},o=_===`verbatim-if`&&h.children.some(e=>e.kind===`element`&&e.tag===`Else`);if(i.kind===Jg.Text){let e=n.getTextValue(i);if(b_(_)){if(o)return s(`else-not-last`,`content after <Else> — move it inside <Else> or above it`,{start:i.start,end:i.end});if(!l({start:i.start,end:i.end}))return null;h.children.push({kind:`text`,id:``,value:e,span:{start:i.start,end:i.end}})}else if(e.trim().length>0)return s(`invalid-child`,a(`text`),{start:i.start,end:i.end});continue}if(i.kind===Jg.Interpolation){if(!b_(_))return s(`invalid-child`,a(`{{${i.name}}}`),{start:i.start,end:i.end});if(o)return s(`else-not-last`,`content after <Else> — move it inside <Else> or above it`,{start:i.start,end:i.end});if(!l({start:i.start,end:i.end}))return null;h.children.push({kind:`interpolation`,id:``,name:i.name,syntax:i.syntax,span:{start:i.start,end:i.end}});continue}if(i.kind===Jg.LessThanSlash){let e=n.scanTagToken();if(e.kind!==Jg.Identifier||n.getText(e)!==p){let t=e.kind===Jg.Identifier?`</${n.getText(e)}>`:`</>`;return s(`mismatched-close-tag`,`expected </${p}> but found ${t} — close <${p}> first`,{start:i.start,end:e.end})}let t=n.scanTagToken();if(t.kind!==Jg.GreaterThan)return s(`mismatched-close-tag`,`expected > to finish </${p}>`,{start:t.start,end:t.end});h.span.end=t.end;break}let u=__(_),d=f(i,t+1);if(d===null)return null;if(!u.includes(d.tag)){let e=d.tag===`Else`?`<Else> is only valid as the last child of <If> — wrap this branch in <If>`:v_(_)?d.tag===`a`?`<a> is not allowed inside <${p}> — links cannot nest inside links or buttons`:`<${d.tag}> is not allowed inside <${p}> — only text, {{variables}}${u.length>0?`, and ${x_(u)}`:``} may appear here`:`<${d.tag}> is not allowed inside <${p}> — <${p}> may contain only ${x_(u)}`;return s(`invalid-child`,e,d.span)}if(_===`email`&&g_.includes(d.tag)){if(h.children.some(e=>e.kind===`element`&&e.tag===d.tag))return s(`${d.tag.toLowerCase()}-duplicate`,`<Email> allows at most one <${d.tag}> — merge them`,d.span);if(h.children.some(e=>e.kind===`element`&&!g_.includes(e.tag)))return s(`${d.tag.toLowerCase()}-position`,`<${d.tag}> must appear before the body blocks in <Email> — move it above the other blocks`,d.span)}if((_===`if`||_===`verbatim-if`)&&h.children.some(e=>e.kind===`element`&&e.tag===`Else`))return s(d.tag===`Else`?`duplicate-else`:`else-not-last`,d.tag===`Else`?`only one <Else> is allowed inside <If> — merge the branches`:`<Else> must be the last child of <If> — move <${d.tag}> above it`,d.span);if(_===`whatsapp`){let e={Header:0,Body:1,Footer:2,Buttons:3},t=e[d.tag];for(let n of h.children)if(n.kind===`element`){if(n.tag===d.tag)return s(`whatsapp-duplicate-component`,`<WhatsApp> allows at most one <${d.tag}> — merge them`,d.span);if(e[n.tag]>t)return s(`whatsapp-component-order`,`<${d.tag}> must come before <${n.tag}> — WhatsApp components are Header?, Body, Footer?, Buttons? in that order`,d.span)}}if(_===`image`){let e=d.attributes.find(e=>e.name===`scheme`);if(e?.value.kind===`string`&&h.children.some(t=>t.kind===`element`&&t.tag===`Source`&&t.attributes.some(t=>t.name===`scheme`&&t.value.kind===`string`&&t.value.value===e.value.value)))return s(`duplicate-source`,`<Image> allows one <Source scheme="${e.value.value}">; remove the duplicate`,d.span)}h.children.push(d)}return _===`whatsapp`&&!h.children.some(e=>e.kind===`element`&&e.tag===`Body`)?s(`whatsapp-missing-body`,`<WhatsApp> requires a <Body> component — add <Body>...</Body>`,h.span):(v_(_)&&w_(h),h)},p=()=>{for(;;){let e=n.scanTextToken();if(e.kind!==Jg.Text||n.getTextValue(e).trim().length!==0)return e}},m=p();m.kind===Jg.Unknown?c(m):m.kind!==Jg.LessThan&&s(`invalid-root`,`the document must start with a channel root element: ${gg.map(e=>`<${e}>`).join(`, `)}`,{start:m.start,end:m.end});let h=null;if(r===void 0&&(h=f(m,1)),h!==null){let e=p();e.kind!==Jg.EndOfFile&&(s(`multiple-roots`,`content after </${h.tag}> — a document has exactly one root element`,{start:e.start,end:e.end}),h=null)}return h===null||r!==void 0?bh.err(new Sh({diagnostics:[r??{code:`parse-failed`,message:`parse failed`,span:{start:0,end:0}}]})):(T_(h),bh.ok({kind:`document`,root:h}))},w_=e=>{for(let t of e.children)t.kind===`text`&&(t.value=t.value.replace(/\s+/g,` `));let t=e.children[0];t?.kind===`text`&&(t.value=t.value.replace(/^ /,``));let n=e.children[e.children.length-1];n?.kind===`text`&&(n.value=n.value.replace(/ $/,``)),e.children=e.children.filter(e=>e.kind!==`text`||e.value.length>0)},T_=e=>{let t=0,n=[e];for(;n.length>0;){let e=n.pop();if(e.id=`n${t}`,t++,e.kind===`element`)for(let t=e.children.length-1;t>=0;t--)n.push(e.children[t])}},E_=(e,t)=>t===`literal`?e.syntax===`curly`?`{{${e.name}}}`:`\${${e.name}}`:`x`.repeat(t.worstCaseChars),D_=e=>{let t=e.children.find(e=>e.kind===`element`&&e.tag===`Else`);return{then:e.children.filter(e=>e.kind!==`element`||e.tag!==`Else`),otherwise:t?.children??[]}},O_=e=>{let t=``;for(let n of e){if(n.kind===`text`){t+=n.value;continue}if(n.kind===`interpolation`){t+=E_(n,`literal`);continue}let e=yg(n,`test`)??``,{then:r,otherwise:i}=D_(n);t+=`<!--sml:if:${n.id} ${e}-->${O_(r)}`,i.length>0&&(t+=`<!--sml:else:${n.id}-->${O_(i)}`),t+=`<!--sml:endif:${n.id}-->`}return t},k_=256,A_=(e,t)=>{let n=[``],r=e=>{if(e.length===1){n=n.map(t=>t+e[0]);return}let t=[];for(let r of n){for(let n of e)if(t.push(r+n),t.length>=k_)break;if(t.length>=k_)break}n=t};for(let i of e){if(i.kind===`text`){r([i.value]);continue}if(i.kind===`interpolation`){r([E_(i,t)]);continue}let{then:e,otherwise:a}=D_(i),o=A_(e,t).map(e=>e.trim()),s=A_(a,t).map(e=>e.trim()),c=[...new Set([...o,...s])];r(n.length*c.length>k_?[o[0]??``]:c)}return[...new Set(n)]},j_=(e,t)=>{let n=``;for(let r of e)r.kind===`text`?n+=r.value:r.kind===`interpolation`?n+=E_(r,t):n+=j_(D_(r).then,t).trim();return n},M_=`0.1.0`,N_=new Set([`[`,`]`,`{`,`}`,`\\`,`~`,`|`,`€`,`^`,`\f`]),P_=/^[@£$¥èéùìòÇ\nØø\rÅåΔ_ΦΓΛΩΠΨΣΘΞÆæßÉ !"#¤%&'()*+,\-./:;<=>?¡0-9ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüà]*$/,F_=e=>{for(let t of e)if(!N_.has(t)&&!P_.test(t))return!0;return!1},I_=e=>{if(F_(e)){let t=[...e].length,n=t<=70?1:Math.ceil(t/67);return{encoding:`ucs2`,characterCount:e.length,segmentCount:n}}let t=0;for(let n of e)t+=N_.has(n)?2:1;let n=t<=160?1:Math.ceil(t/153);return{encoding:`gsm7`,characterCount:e.length,segmentCount:n}},L_=/\b(stop|unsubscribe|opt[\s-]?out|cancel|quit)\b/i,R_=e=>L_.test(e),z_={worstCaseChars:16},B_=e=>{let t=O_(e.children),n=yg(e,`category`),r=e.children.some(e=>e.kind===`element`&&e.tag===`If`),i=A_(e.children,z_).map(I_),a=i.some(e=>e.encoding===`ucs2`)?`ucs2`:`gsm7`,o=I_(j_(e.children,z_)).segmentCount,s=Math.max(o,...i.map(e=>e.segmentCount)),c=[],l=(t,n)=>{c.push({code:t,message:n,span:e.span})};a===`ucs2`&&l(`sms-ucs2`,`sms uses non-GSM characters (UCS-2); each segment holds 70 characters instead of 160`),s>1&&l(`sms-multi-segment`,`sms spans ${s} segments (variables counted at 16 characters); each segment is billed separately`),s>10&&l(`sms-segment-limit`,`sms exceeds 10 segments and may be rejected by carriers`);let u=j_(e.children,`literal`);return u.trim().length>0&&!R_(u)&&l(`sms-opt-out`,`sms should include opt-out instructions (e.g. "Reply STOP to unsubscribe")`),{channel:`sms`,category:n,body:t,encoding:a,estimatedSegments:o,maxSegments:r?s:void 0,warnings:c,compilerVersion:M_}},V_=/\$\{\s*\/?([\w.]+)\s*\}|\{\{\s*([\w.]+)\s*\}\}/g,H_=e=>{let t=new Set;for(let n of e.matchAll(V_)){let e=n[1]??n[2];e!==void 0&&e!==``&&t.add(e)}return t},U_={URL:2,PHONE_NUMBER:1,QUICK_REPLY:10,total:10},W_=60,G_=60,K_=1024,q_=25,J_=/\{\{\s*(\d+)\s*\}\}/,Y_=/\{\{\s*([A-Za-z_][\w.]*)\s*\}\}/,X_=`literal`,Z_=e=>Math.max(0,...A_(e.children,X_).map(e=>e.length)),Q_=(e,t)=>e.children.find(e=>e.kind===`element`&&e.tag===t),$_=e=>{let t=new Set;for(let n of e)for(let e of H_(n))t.add(e);return t.size===0?void 0:[...t].sort()},ev=e=>{let t=[],n=[],r=Q_(e,`Header`),i=Q_(e,`Body`),a=Q_(e,`Footer`),o=Q_(e,`Buttons`),s=r===void 0?void 0:yg(r,`type`)??`text`,c=r===void 0?void 0:O_(r.children),l=O_(i.children),u=a===void 0?void 0:O_(a.children);r!==void 0&&s===`text`&&Z_(r)>W_&&n.push({code:`whatsapp-header-length`,message:`whatsapp header should stay under ${W_} characters`,span:r.span}),Z_(i)>K_&&n.push({code:`whatsapp-body-length`,message:`whatsapp body should stay under ${K_} characters`,span:i.span}),a!==void 0&&Z_(a)>G_&&n.push({code:`whatsapp-footer-length`,message:`whatsapp footer should stay under ${G_} characters`,span:a.span});let d=o===void 0?[]:o.children.filter(e=>e.kind===`element`&&e.tag===`Button`),f=[];for(let e of d){let r=yg(e,`type`),i=O_(e.children),a=yg(e,`url`),o=yg(e,`phone`);if(a!==void 0&&r!==`url`){t.push({code:`whatsapp-button-url`,message:`url is only valid on <Button type="url"> — remove it or change the type`,span:e.span});continue}if(o!==void 0&&r!==`phone`){t.push({code:`whatsapp-button-phone`,message:`phone is only valid on <Button type="phone"> — remove it or change the type`,span:e.span});continue}switch(r!==`copy-code`&&Z_(e)>q_&&n.push({code:`whatsapp-button-text-length`,message:`whatsapp button text should stay under ${q_} characters`,span:e.span}),r){case`quick-reply`:f.push({type:`QUICK_REPLY`,text:i});break;case`url`:if(a===void 0){t.push({code:`whatsapp-button-url`,message:`<Button type="url"> requires a url attribute — add url="https://..."`,span:e.span});break}f.push({type:`URL`,text:i,url:a});break;case`phone`:if(o===void 0){t.push({code:`whatsapp-button-phone`,message:`<Button type="phone"> requires a phone attribute — add phone="+15551234567"`,span:e.span});break}f.push({type:`PHONE_NUMBER`,text:i,phone_number:o});break;case`copy-code`:f.push({type:`COPY_CODE`,example:i})}}let p=o?.span??e.span,m=e=>f.filter(t=>t.type===e).length;m(`URL`)>U_.URL&&t.push({code:`whatsapp-button-limit`,message:`whatsapp allows at most ${U_.URL} URL buttons`,span:p}),m(`PHONE_NUMBER`)>U_.PHONE_NUMBER&&t.push({code:`whatsapp-button-limit`,message:`whatsapp allows at most ${U_.PHONE_NUMBER} phone-number button`,span:p}),m(`QUICK_REPLY`)>U_.QUICK_REPLY&&t.push({code:`whatsapp-button-limit`,message:`whatsapp allows at most ${U_.QUICK_REPLY} quick-reply buttons`,span:p}),d.length>U_.total&&t.push({code:`whatsapp-button-limit`,message:`whatsapp allows at most ${U_.total} buttons total`,span:p});let h=[c??``,l,u??``,...f.map(e=>e.type===`URL`?e.url:``)],g=h.some(e=>J_.test(e)),_=h.some(e=>Y_.test(e));return g&&_&&n.push({code:`whatsapp-mixed-placeholders`,message:`whatsapp mixes positional {{1}} and named {{var}} placeholders; Meta requires one style`,span:e.span}),t.length>0?bh.err(new Ch({diagnostics:t})):bh.ok({channel:`whatsapp`,name:yg(e,`name`),language:yg(e,`language`),category:yg(e,`category`),headerType:s,headerMediaType:s===void 0||s===`text`?void 0:s,headerContent:c,bodyContent:l,footerContent:u,buttons:f,examples:{header:$_([c??``]),body:$_([l]),footer:$_([u??``]),buttons:$_(f.map(e=>e.type===`URL`?`${e.text} ${e.url}`:e.type===`COPY_CODE`?e.example:e.text))},warnings:n,compilerVersion:M_})},tv=e=>{switch(e.root.tag){case`Sms`:return bh.ok(B_(e.root));case`WhatsApp`:return ev(e.root);default:return bh.err(new Ch({diagnostics:[{code:`email-requires-object-template`,message:`Email templates must default-export defineEmail with an input schema and fixtures.`,span:e.root.span}]}))}},nv=e=>{let t=C_(e);return bh.isError(t)?bh.err(t.error):tv(t.value)},rv=100,iv=` `,av=e=>e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`).replaceAll(`{`,`&#123;`),ov=e=>e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`"`,`&quot;`),sv=e=>e.value.kind===`number`?`${e.name}={${e.value.value}}`:`${e.name}="${ov(e.value.value)}"`,cv=e=>e.syntax===`curly`?`{{${e.name}}}`:`\${${e.name}}`,lv=e=>{let t=``;for(let n of e)if(n.kind===`text`)t+=av(n.value);else if(n.kind===`interpolation`)t+=cv(n);else{let e=n.attributes.map(e=>` ${sv(e)}`).join(``);t+=n.children.length===0?`<${n.tag}${e} />`:`<${n.tag}${e}>${lv(n.children)}</${n.tag}>`}return t},uv=e=>e.tag===`Text`||e.tag===`Heading`||e.tag===`Button`||e.tag===`Subject`||e.tag===`Preview`||e.tag===`ListItem`||e.tag===`a`||e.tag===`strong`||e.tag===`em`,dv=e=>{let t=[],n=!1,r=e=>{e.length!==0&&(n&&t.length>0?t[t.length-1]+=e:t.push(e),n=!0)},i=()=>{n=!1},a=e=>{for(let t of e)if(t.kind===`text`)av(t.value).split(` `).forEach((e,t)=>{t>0&&i(),r(e)});else if(t.kind===`interpolation`)r(cv(t));else{let e=t.attributes.map(e=>` ${sv(e)}`).join(``);t.children.length===0?r(`<${t.tag}${e} />`):(r(`<${t.tag}${e}>`),a(t.children),r(`</${t.tag}>`))}};return a(e),t},fv=(e,t)=>{let n=dv(e),r=[],i=null;for(let e of n)i===null?i=`${t}${e}`:i.length+1+e.length<=rv?i+=` ${e}`:(r.push(i),i=`${t}${e}`);return i!==null&&r.push(i),r.join(`
17
+ `)},pv=(e,t,n)=>{let r=e.attributes.map(e=>` ${sv(e)}`).join(``),i=`${t}<${e.tag}${r}${n?` />`:`>`}`;if(i.length<=rv||e.attributes.length===0)return i;let a=[`${t}<${e.tag}`];for(let n of e.attributes)a.push(`${t}${iv}${sv(n)}`);return a.push(`${t}${n?`/>`:`>`}`),a.join(`
18
+ `)},mv=e=>{let t=``;for(let n of e)n.kind===`text`?t+=av(n.value):n.kind===`interpolation`?t+=cv(n):t+=hv(n);return t},hv=e=>{let t=e.attributes.map(e=>` ${sv(e)}`).join(``);return e.children.length===0?`<${e.tag}${t} />`:`<${e.tag}${t}>${mv(e.children)}</${e.tag}>`},gv=(e,t)=>{if(e.children.length===0)return pv(e,t,!0);let n=e.attributes.map(e=>` ${sv(e)}`).join(``);return`${t}<${e.tag}${n}>${mv(e.children)}</${e.tag}>`},_v=(e,t)=>e.tag===`Sms`||e.tag===`Header`||e.tag===`Body`||e.tag===`Footer`||t&&e.tag===`Button`,vv=(e,t,n=!1)=>{let r=iv.repeat(t);if(_v(e,n))return gv(e,r);if(e.children.length===0)return pv(e,r,!0);if(uv(e)&&!n){let t=lv(e.children),n=pv(e,r,!1),i=`${n}${t}</${e.tag}>`;return!n.includes(`
19
+ `)&&i.length<=rv?i:`${n}\n${fv(e.children,r+iv)}\n${r}</${e.tag}>`}let i=n||e.tag===`WhatsApp`;return`${pv(e,r,!1)}\n${e.children.map(e=>e.kind===`element`?vv(e,t+1,i):e.kind===`text`?`${r}${iv}${av(e.value)}`:`${r}${iv}${cv(e)}`).join(`
20
+ `)}\n${r}</${e.tag}>`},yv=e=>`${vv(e.root,0)}\n`,bv=e=>{let t=nv(e);return bh.isError(t)?{ok:!1,diagnostics:t.error.diagnostics,message:t.error.diagnostics.map(e=>e.message).join(`
21
+ `)}:{ok:!0,artifact:t.value}},xv={start:0,end:0},Sv=0,Cv=()=>`editor-${++Sv}`,wv=e=>{let t=``;for(let n of e)n.kind===`text`?t+=n.value:n.kind===`interpolation`&&(t+=n.syntax===`curly`?`{{${n.name}}}`:`\${${n.name}}`);return t},Tv=e=>{let t=e.attributes.find(e=>e.name===`test`)?.value,n=t?.kind===`string`?t.value:``,r=wv(e.children.filter(e=>e.kind!==`element`)).trim(),i=r.length>40?`${r.slice(0,40)}…`:r,a=e.tag===`If`?`If ${n}`:e.tag;return i.length>0?`${a}: “${i}”`:a},Ev=e=>{let t=[],n=[],r=()=>{t.push({kind:`text`,text:wv(n)}),n=[]};for(let i of e)i.kind===`element`?(r(),t.push({kind:`locked`,node:i,summary:Tv(i)})):n.push(i);return r(),t},Dv=(e,t,n)=>e.map((e,r)=>r===t&&e.kind===`text`?{kind:`text`,text:n}:e),Ov=e=>{let t=[],n=0,r=new RegExp(V_.source,`g`);for(let i of e.matchAll(r)){let r=i.index;r>n&&t.push({kind:`text`,id:Cv(),value:e.slice(n,r),span:xv});let a=i[1],o=i[2],s=a||o;s!==void 0&&s!==``&&t.push({kind:`interpolation`,id:Cv(),name:s,syntax:a?`dollar`:`curly`,span:xv}),n=r+i[0].length}return n<e.length&&t.push({kind:`text`,id:Cv(),value:e.slice(n),span:xv}),t},kv=e=>e.flatMap(e=>e.kind===`locked`?[e.node]:Ov(e.text)),Av=e=>e.some(e=>e.kind===`element`),jv=e=>({kind:`string`,value:e}),Mv=(e,t,n)=>{let r=e.attributes.filter(e=>e.name!==t);return n!==void 0&&n!==``&&r.push({name:t,value:jv(n),span:xv,valueSpan:xv}),{...e,attributes:r}},Nv=(e,t,n)=>{let r={kind:`element`,id:Cv(),tag:e,attributes:[],children:[...n],span:xv};for(let[e,n]of t)r=Mv(r,e,n);return r},Pv=(e,t)=>({...e,children:[...t]}),Fv=[{value:`transactional`,label:`Transactional`},{value:`promotional`,label:`Promotional`},{value:`service_implicit`,label:`Service (implicit opt-in)`}],Iv=(e,t)=>{let n=C_(e);if(bh.isError(n))return{errors:n.error.diagnostics,compiled:null,model:null};let r=n.value.root;if(r.tag!==`Sms`)return{errors:[],compiled:null,model:null};let i={root:r,category:yg(r,`category`),segments:Ev(r.children),variables:[...bg(n.value)].sort()},a=t??bv(e);return a.ok?{errors:[],compiled:a.artifact.channel===`sms`?a.artifact:null,model:i}:{errors:a.diagnostics,compiled:null,model:i}},Lv=(e,t)=>Iv(e,t),Rv=e=>yv({kind:`document`,root:Pv(Mv(e.root,`category`,e.category),kv(e.segments))}),zv=[{value:`marketing`,label:`Marketing`},{value:`utility`,label:`Utility`},{value:`authentication`,label:`Authentication`}],Bv=[{value:`text`,label:`Text`},{value:`image`,label:`Image`},{value:`video`,label:`Video`},{value:`document`,label:`Document`}],Vv=[{value:`quick-reply`,label:`Quick reply`},{value:`url`,label:`URL`},{value:`phone`,label:`Phone number`},{value:`copy-code`,label:`Copy code`}],Hv=e=>{let t=``;for(let n of e)n.kind===`text`?t+=n.value:n.kind===`interpolation`&&(t+=n.syntax===`curly`?`{{${n.name}}}`:`\${${n.name}}`);return t},Uv=(e,t)=>e.children.find(e=>e.kind===`element`&&e.tag===t),Wv=e=>e===void 0?{kind:`absent`}:Av(e.children)?{kind:`locked`,node:e,summary:Tv(e)}:{kind:`editable`,node:e,text:Hv(e.children)},Gv=e=>e.tag!==`Button`||Av(e.children)?{kind:`locked`,node:e,summary:Tv(e)}:{kind:`editable`,node:e,type:yg(e,`type`)??`quick-reply`,text:Hv(e.children),url:yg(e,`url`),phone:yg(e,`phone`)},Kv=(e,t)=>{let n=C_(e);if(bh.isError(n))return{errors:n.error.diagnostics,compiled:null,model:null};let r=n.value.root;if(r.tag!==`WhatsApp`)return{errors:[],compiled:null,model:null};let i=Uv(r,`Header`),a=Uv(r,`Body`);if(a===void 0)return{errors:[],compiled:null,model:null};let o=Uv(r,`Footer`),s=Uv(r,`Buttons`),c=s?.children.filter(e=>e.kind===`element`)??[],l={root:r,name:yg(r,`name`)??``,language:yg(r,`language`)??``,category:yg(r,`category`)??`utility`,headerType:i===void 0?`text`:yg(i,`type`)??`text`,header:Wv(i),bodyNode:a,body:Ev(a.children),footer:Wv(o),buttonsNode:s,buttons:c.map(Gv),variables:[...bg(n.value)].sort()},u=t??bv(e);return u.ok?{errors:[],compiled:u.artifact.channel===`whatsapp`?u.artifact:null,model:l}:{errors:u.diagnostics,compiled:null,model:l}},qv=(e,t)=>Kv(e,t),Jv=(e,t,n)=>{let r=e.node??Nv(t,[],[]);return Pv(t===`Header`?Mv(r,`type`,n===`text`?void 0:n):r,Ov(e.text))},Yv=e=>e.kind===`locked`?e.node:Pv(Mv(Mv(Mv(e.node??Nv(`Button`,[],[]),`type`,e.type),`url`,e.type===`url`?e.url:void 0),`phone`,e.type===`phone`?e.phone:void 0),Ov(e.text)),Xv=e=>{let t=Mv(e.root,`name`,e.name);t=Mv(t,`language`,e.language),t=Mv(t,`category`,e.category);let n=e.header.kind===`absent`?void 0:e.header.kind===`locked`?e.header.node:Jv(e.header,`Header`,e.headerType),r=Pv(e.bodyNode,kv(e.body)),i=e.footer.kind===`absent`?void 0:e.footer.kind===`locked`?e.footer.node:Jv(e.footer,`Footer`),a=e.buttons.length===0?void 0:Pv(e.buttonsNode??Nv(`Buttons`,[],[]),e.buttons.map(Yv)),o=new Map([[`Header`,n],[`Body`,r],[`Footer`,i],[`Buttons`,a]]),s=new Set,c=[];for(let e of t.children){if(e.kind!==`element`||!o.has(e.tag)){c.push(e);continue}if(s.has(e.tag)){c.push(e);continue}s.add(e.tag);let t=o.get(e.tag);t!==void 0&&c.push(t)}for(let e of[`Header`,`Body`,`Footer`,`Buttons`]){if(s.has(e))continue;let t=o.get(e);t!==void 0&&c.push(t)}return yv({kind:`document`,root:Pv(t,c)})},Zv=e=>e===`url`?{kind:`editable`,type:e,text:`Visit site`,url:`https://`,phone:void 0}:e===`phone`?{kind:`editable`,type:e,text:`Call us`,url:void 0,phone:`+1`}:e===`copy-code`?{kind:`editable`,type:e,text:`{{code}}`,url:void 0,phone:void 0}:{kind:`editable`,type:e,text:`Reply`,url:void 0,phone:void 0},Qv=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},$v=(e=>e?Qv(e):Qv),ey=e=>e;function ty(e,t=ey){let n=T.useSyncExternalStore(e.subscribe,T.useCallback(()=>t(e.getState()),[e,t]),T.useCallback(()=>t(e.getInitialState()),[e,t]));return T.useDebugValue(n),n}var ny=e=>typeof e==`object`&&!!e&&!Array.isArray(e),ry=class{constructor(e,t,n){this.line=void 0,this.column=void 0,n!==void 0&&(this.index=void 0),this.line=e,this.column=t,n!==void 0&&(this.index=n)}},iy=class{start;end;filename;identifierName;constructor(e,t){this.start=e,this.end=t}};function ay(e,t){let{line:n,column:r,index:i}=e;return new ry(n,r+t,i+t)}var oy=`BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED`,sy={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:oy},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:oy}},cy={ArrayPattern:`array destructuring pattern`,AssignmentExpression:`assignment expression`,AssignmentPattern:`assignment expression`,ArrowFunctionExpression:`arrow function expression`,ConditionalExpression:`conditional expression`,CatchClause:`catch clause`,ForOfStatement:`for-of statement`,ForInStatement:`for-in statement`,ForStatement:`for-loop`,FormalParameters:`function parameter list`,Identifier:`identifier`,ImportSpecifier:`import specifier`,ImportDefaultSpecifier:`import default specifier`,ImportNamespaceSpecifier:`import namespace specifier`,ObjectPattern:`object destructuring pattern`,ParenthesizedExpression:`parenthesized expression`,RestElement:`rest element`,UpdateExpression:{true:`prefix operation`,false:`postfix operation`},VariableDeclarator:`variable declaration`,YieldExpression:`yield expression`},ly=e=>e.type===`UpdateExpression`?cy.UpdateExpression[`${e.prefix}`]:cy[e.type],uy={AccessorIsGenerator:({kind:e})=>`A ${e}ter cannot be a generator.`,ArgumentsInClass:`'arguments' is only allowed in functions and class methods.`,AsyncFunctionInSingleStatementContext:`Async functions can only be declared at the top level or inside a block.`,AwaitBindingIdentifier:`Can not use 'await' as identifier inside an async function.`,AwaitBindingIdentifierInStaticBlock:`Can not use 'await' as identifier inside a static block.`,AwaitExpressionFormalParameter:`'await' is not allowed in async function parameters.`,AwaitUsingNotInAsyncContext:`'await using' is only allowed within async functions and at the top levels of modules.`,AwaitNotInAsyncContext:`'await' is only allowed within async functions and at the top levels of modules.`,BadGetterArity:`A 'get' accessor must not have any formal parameters.`,BadSetterArity:`A 'set' accessor must have exactly one formal parameter.`,BadSetterRestParameter:`A 'set' accessor function argument must not be a rest parameter.`,ConstructorClassField:`Classes may not have a field named 'constructor'.`,ConstructorClassPrivateField:`Classes may not have a private field named '#constructor'.`,ConstructorIsAccessor:`Class constructor may not be an accessor.`,ConstructorIsAsync:`Constructor can't be an async function.`,ConstructorIsGenerator:`Constructor can't be a generator.`,DeclarationMissingInitializer:({kind:e})=>`Missing initializer in ${e} declaration.`,DecoratorArgumentsOutsideParentheses:`Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.`,DecoratorsBeforeAfterExport:`Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.`,DecoratorConstructor:`Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?`,DecoratorSemicolon:`Decorators must not be followed by a semicolon.`,DecoratorStaticBlock:`Decorators can't be used with a static block.`,DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:`Deleting a private field is not allowed.`,DestructureNamedImport:`ES2015 named imports do not destructure. Use another statement for destructuring after the import.`,DuplicateConstructor:`Duplicate constructor in the same class.`,DuplicateDefaultExport:`Only one default export allowed per module.`,DuplicateExport:({exportName:e})=>`\`${e}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:`Redefinition of __proto__ property.`,DuplicateRegExpFlags:`Duplicate regular expression flag.`,ElementAfterRest:`Rest element must be last element.`,EscapedCharNotAnIdentifier:`Invalid Unicode escape.`,ExportBindingIsString:({localName:e,exportName:t})=>`A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${e}' as '${t}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:`'from' is not allowed as an identifier after 'export default'.`,ForInOfLoopInitializer:({type:e})=>`'${e===`ForInStatement`?`for-in`:`for-of`}' loop variable declaration may not have an initializer.`,ForInUsing:`For-in loop may not start with 'using' declaration.`,ForOfAsync:`The left-hand side of a for-of loop may not be 'async'.`,ForOfLet:`The left-hand side of a for-of loop may not start with 'let'.`,GeneratorInSingleStatementContext:`Generators can only be declared at the top level or inside a block.`,IllegalBreakContinue:({type:e})=>`Unsyntactic ${e===`BreakStatement`?`break`:`continue`}.`,IllegalLanguageModeDirective:`Illegal 'use strict' directive in function with non-simple parameter list.`,IllegalReturn:`'return' outside of function.`,ImportBindingIsString:({importName:e})=>`A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${e}" as foo }\`?`,ImportCallArity:({phase:e})=>`\`import${e?`.${e}`:``}()\` requires exactly one or two arguments.`,ImportCallNotNewExpression:({phase:e})=>`Cannot use new with import${e?`.${e}`:``}().`,ImportCallSpreadArgument:({phase:e})=>`\`...\` is not allowed in \`import${e?`.${e}`:``}()\`.`,IncompatibleRegExpUVFlags:`The 'u' and 'v' regular expression flags cannot be enabled at the same time.`,InvalidBigIntLiteral:`Invalid BigIntLiteral.`,InvalidCodePoint:`Code point out of bounds.`,InvalidCoverDiscardElement:`'void' must be followed by an expression when not used in a binding position.`,InvalidCoverInitializedName:`Invalid shorthand property initializer.`,InvalidDigit:({radix:e})=>`Expected number in radix ${e}.`,InvalidEscapeSequence:`Bad character escape sequence.`,InvalidEscapeSequenceTemplate:`Invalid escape sequence in template.`,InvalidEscapedReservedWord:({reservedWord:e})=>`Escape sequence in keyword ${e}.`,InvalidIdentifier:({identifierName:e})=>`Invalid identifier ${e}.`,InvalidLhs:({ancestor:e})=>`Invalid left-hand side in ${ly(e)}.`,InvalidLhsBinding:({ancestor:e})=>`Binding invalid left-hand side in ${ly(e)}.`,InvalidLhsOptionalChaining:({ancestor:e})=>`Invalid optional chaining in the left-hand side of ${ly(e)}.`,InvalidNumber:`Invalid number.`,InvalidOrMissingExponent:`Floating-point numbers require a valid exponent after the 'e'.`,InvalidOrUnexpectedToken:({unexpected:e})=>`Unexpected character '${e}'.`,InvalidParenthesizedAssignment:`Invalid parenthesized assignment pattern.`,InvalidPrivateFieldResolution:({identifierName:e})=>`Private name #${e} is not defined.`,InvalidPropertyBindingPattern:`Binding member expression.`,InvalidRestAssignmentPattern:`Invalid rest operator's argument.`,LabelRedeclaration:({labelName:e})=>`Label '${e}' is already declared.`,LetInLexicalBinding:`'let' is disallowed as a lexically bound name.`,LineTerminatorBeforeArrow:`No line break is allowed before '=>'.`,MalformedRegExpFlags:`Invalid regular expression flag.`,MissingClassName:`A class name is required.`,MissingEqInAssignment:`Only '=' operator can be used for specifying default value.`,MissingSemicolon:`Missing semicolon.`,MissingPlugin:({missingPlugin:e})=>`This experimental syntax requires enabling the parser plugin: ${e.map(e=>JSON.stringify(e)).join(`, `)}.`,MissingOneOfPlugins:({missingPlugin:e})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${e.map(e=>JSON.stringify(e)).join(`, `)}.`,MissingUnicodeEscape:`Expecting Unicode escape sequence \\uXXXX.`,MixingCoalesceWithLogical:`Nullish coalescing operator(??) requires parens when mixing with logical operators.`,ModuleAttributeInvalidValue:`Only string literals are allowed as module attribute values.`,ModuleAttributesWithDuplicateKeys:({key:e})=>`Duplicate key "${e}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:e})=>`An export name cannot include a lone surrogate, found '\\u${e.toString(16)}'.`,ModuleExportUndefined:({localName:e})=>`Export '${e}' is not defined.`,MultipleDefaultsInSwitch:`Multiple default clauses.`,NewlineAfterThrow:`Illegal newline after throw.`,NoCatchOrFinally:`Missing catch or finally clause.`,NumberIdentifier:`Identifier directly after number.`,NumericSeparatorInEscapeSequence:`Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.`,ObsoleteAwaitStar:`'await*' has been removed from the async functions proposal. Use Promise.all() instead.`,OptionalChainingNoNew:`Constructors in/after an Optional Chain are not allowed.`,OptionalChainingNoTemplate:`Tagged Template Literals are not allowed in optionalChain.`,OverrideOnConstructor:`'override' modifier cannot appear on a constructor declaration.`,ParamDupe:`Argument name clash.`,PatternHasAccessor:`Object pattern can't contain getter or setter.`,PatternHasMethod:`Object pattern can't contain methods.`,PrivateInExpectedIn:({identifierName:e})=>`Private names are only allowed in property accesses (\`obj.#${e}\`) or in \`in\` expressions (\`#${e} in obj\`).`,PrivateNameRedeclaration:({identifierName:e})=>`Duplicate private name #${e}.`,RestTrailingComma:`Unexpected trailing comma after rest element.`,SloppyFunction:`In non-strict mode code, functions can only be declared at top level or inside a block.`,SloppyFunctionAnnexB:`In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.`,SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:`Classes may not have static property named prototype.`,SuperCallNotNewExpression:`Cannot use new with super(...).`,SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:`Private fields can't be accessed on super.`,TrailingDecorator:`Decorators must be attached to a class element.`,UnexpectedArgumentPlaceholder:`Unexpected argument placeholder.`,UnexpectedDigitAfterHash:`Unexpected digit after hash token.`,UnexpectedImportExport:`'import' and 'export' may only appear at the top level.`,UnexpectedKeyword:({keyword:e})=>`Unexpected keyword '${e}'.`,UnexpectedLeadingDecorator:`Leading decorators must be attached to a class declaration.`,UnexpectedLexicalDeclaration:`Lexical declaration cannot appear in a single-statement context.`,UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:`A numeric separator is only allowed between two digits.`,UnexpectedPrivateField:`Unexpected private name.`,UnexpectedReservedWord:({reservedWord:e})=>`Unexpected reserved word '${e}'.`,UnexpectedSuper:`'super' is only allowed in object methods and classes.`,UnexpectedToken:({expected:e,unexpected:t})=>`Unexpected token${t?` '${t}'.`:``}${e?`, expected "${e}"`:``}`,UnexpectedTokenUnaryExponentiation:`Illegal expression. Wrap left hand side or entire exponentiation in parentheses.`,UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnexpectedVoidPattern:`Unexpected void binding.`,UnsupportedDecoratorExport:`A decorated export must export a class declaration.`,UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:e,onlyValidPropertyName:t})=>`The only valid meta property for ${e} is ${e}.${t}.`,UnsupportedParameterDecorator:`Decorators cannot be used to decorate parameters.`,UnsupportedPropertyDecorator:`Decorators cannot be used to decorate object literal properties.`,UnsupportedSuper:`'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).`,UnterminatedComment:`Unterminated comment.`,UnterminatedRegExp:`Unterminated regular expression.`,UnterminatedString:`Unterminated string constant.`,UnterminatedTemplate:`Unterminated template.`,UsingDeclarationExport:`Using declaration cannot be exported.`,UsingDeclarationHasBindingPattern:`Using declaration cannot have destructuring patterns.`,VarRedeclaration:({identifierName:e})=>`Identifier '${e}' has already been declared.`,VoidPatternCatchClauseParam:"A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.",VoidPatternInitializer:`A void binding may not have an initializer.`,YieldBindingIdentifier:`Can not use 'yield' as identifier inside a generator.`,YieldInParameter:`Yield expression is not allowed in formal parameters.`,YieldNotInGeneratorFunction:`'yield' is only allowed within generator functions.`,ZeroDigitNumericSeparator:`Numeric separator can not be used after leading 0.`},dy={StrictDelete:`Deleting local variable in strict mode.`,StrictEvalArguments:({referenceName:e})=>`Assigning to '${e}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:e})=>`Binding '${e}' in strict mode.`,StrictFunction:`In strict mode code, functions can only be declared at top level or inside a block.`,StrictNumericEscape:`The only valid numeric escape in strict mode is '\\0'.`,StrictOctalLiteral:`Legacy octal literals are not allowed in strict mode.`,StrictWith:`'with' in strict mode.`},fy={ParseExpressionEmptyInput:`Unexpected parseExpression() input: The input is empty or contains only comments.`,ParseExpressionExpectsEOF:({unexpected:e})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(e)}\`.`},py=new Set([`ArrowFunctionExpression`,`AssignmentExpression`,`ConditionalExpression`,`YieldExpression`]),my={PipeTopicRequiresHackPipes:'Topic references are only supported when using the `"proposal": "hack"` version of the pipeline proposal.',PipeTopicUnbound:`Topic reference is unbound; it must be inside a pipe body.`,PipeTopicUnconfiguredToken:({token:e})=>`Invalid topic token ${e}. In order to use ${e} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${e}" }.`,PipeTopicUnused:`Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.`,PipeUnparenthesizedBody:({type:e})=>`Hack-style pipe body cannot be an unparenthesized ${ly({type:e})}; please wrap it in parentheses.`,PipelineUnparenthesized:`Cannot mix binary operator with solo-await F#-style pipeline. Please wrap the pipeline in parentheses.`},hy={UnsupportedBind:`Binding should be performed on object property.`,UnsupportedBindRHS:`The right-hand side of binding can not be super or import.`};function gy(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!0,value:n})}function _y({toMessage:e,code:t,reasonCode:n,syntaxPlugin:r}){let i=n===`MissingPlugin`||n===`MissingOneOfPlugins`;return function a(o,s,c){let l=SyntaxError();return l.code=t,l.reasonCode=n,l.loc=o,l.pos=s,l.syntaxPlugin=r,i&&(l.missingPlugin=c.missingPlugin),gy(l,`clone`,function(e={}){let{line:t,column:n,index:r=s}=e.loc??o;return a(new ry(t,n),r,{...c,...e.details})}),gy(l,`details`,c),Object.defineProperty(l,"message",{configurable:!0,get(){let t=`${e(c)} (${o.line}:${o.column})`;return this.message=t,t},set(e){Object.defineProperty(this,"message",{value:e,writable:!0})}}),l}}function vy(e,t){if(Array.isArray(e))return t=>vy(t,e[0]);let n={};for(let r of Object.keys(e)){let i=e[r],{message:a,...o}=typeof i==`string`?{message:()=>i}:typeof i==`function`?{message:i}:i;n[r]=_y({code:`BABEL_PARSER_SYNTAX_ERROR`,reasonCode:r,toMessage:typeof a==`string`?()=>a:a,...t?{syntaxPlugin:t}:{},...o})}return n}var K={...vy(sy),...vy(uy),...vy(dy),...vy(fy),...vy`pipelineOperator`(my),...vy`functionBind`(hy)};function yy(){return{sourceType:`script`,sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:void 0,ranges:!1,locations:!0,tokens:!1,createImportExpressions:!0,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function by(e){let t=yy();if(e==null)return t;if(e.annexB!=null&&e.annexB!==!1)throw Error("The `annexB` option can only be set to `false`.");for(let n of Object.keys(t))e[n]!=null&&(t[n]=e[n]);if(t.startLine===1)e.startIndex==null&&t.startColumn>0?t.startIndex=t.startColumn:e.startColumn==null&&t.startIndex>0&&(t.startColumn=t.startIndex);else if(e.startColumn==null||e.startIndex==null)throw Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");if(t.sourceType===`commonjs`){if(e.allowAwaitOutsideFunction!=null)throw Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`.");if(e.allowReturnOutsideFunction!=null)throw Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`.");if(e.allowNewTargetOutsideFunction!=null)throw Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`.")}return t}function xy(e){let{start:t,end:n}=e.loc;return e.loc.start=new ry(t.line,t.column),e.loc.end=new ry(n.line,n.column),e}var Sy=e=>class extends e{createPosition(e){return new ry(e.line,e.column)}parse(){let e=super.parse();return this.optionFlags&512&&(e.tokens=e.tokens.map(xy)),xy(e)}parseRegExpLiteral({pattern:e,flags:t}){let n=null;try{n=new RegExp(e,t)}catch{}let r=this.estreeParseLiteral(n);return r.regex={pattern:e,flags:t},r}parseBigIntLiteral(e){let t;try{t=BigInt(e)}catch{t=null}let n=this.estreeParseLiteral(t);return n.bigint=n.value===null?e:String(n.value),n}estreeParseLiteral(e){return this.parseLiteral(e,`Literal`)}parseStringLiteral(e){return this.estreeParseLiteral(e)}parseNumericLiteral(e){return this.estreeParseLiteral(e)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(e){return this.estreeParseLiteral(e)}estreeParseChainExpression(e,t){let n=this.startNodeAtNode(e);return n.expression=e,this.finishNodeAtNode(n,`ChainExpression`,t)}directiveToStmt(e){let t=e.value;delete e.value,this.castNodeTo(t,`Literal`),t.raw=t.extra.raw,t.value=t.extra.expressionValue;let n=this.castNodeTo(e,`ExpressionStatement`);return n.expression=t,n.directive=t.extra.rawValue,delete t.extra,n}fillOptionalPropertiesForTSESLint(e){}cloneEstreeStringLiteral(e){let{start:t,end:n,loc:r,range:i,raw:a,value:o}=e,s=Object.create(e.constructor.prototype);return s.type=`Literal`,s.start=t,s.end=n,s.loc=r,s.range=i,s.raw=a,s.value=o,s}initFunction(e,t){super.initFunction(e,t),e.expression=!1}checkDeclaration(e){e!=null&&this.isObjectProperty(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}getObjectOrClassMethodParams(e){return e.value.params}isValidDirective(e){return e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&!e.expression.extra?.parenthesized}parseBlockBody(e,t,n,r,i){super.parseBlockBody(e,t,n,r,i),e.body=e.directives.map(e=>this.directiveToStmt(e)).concat(e.body),delete e.directives}parsePrivateName(){let e=super.parsePrivateName();return this.convertPrivateNameToPrivateIdentifier(e)}convertPrivateNameToPrivateIdentifier(e){let t=super.getPrivateNameSV(e);return delete e.id,e.name=t,this.castNodeTo(e,`PrivateIdentifier`)}isPrivateName(e){return e.type===`PrivateIdentifier`}getPrivateNameSV(e){return e.name}parseLiteral(e,t){let n=super.parseLiteral(e,t);return n.raw=n.extra.raw,delete n.extra,n}parseFunctionBody(e,t,n=!1){super.parseFunctionBody(e,t,n),e.expression=e.body.type!==`BlockStatement`}parseMethod(e,t,n,r,i,a,o=!1){let s=this.startNode();s.kind=e.kind,s=super.parseMethod(s,t,n,r,i,a,o),delete s.kind;let{typeParameters:c}=e;return c&&(delete e.typeParameters,s.typeParameters=c,this.resetStartLocationFromNode(s,c)),e.value=this.castNodeTo(s,this.hasPlugin(`typescript`)&&!s.body?`TSEmptyBodyFunctionExpression`:`FunctionExpression`),a===`ClassPrivateMethod`&&(e.computed=!1),this.hasPlugin(`typescript`)&&e.abstract?(delete e.abstract,this.finishNode(e,`TSAbstractMethodDefinition`)):a===`ObjectMethod`?(e.kind===`method`&&(e.kind=`init`),e.shorthand=!1,this.finishNode(e,`Property`)):this.finishNode(e,`MethodDefinition`)}nameIsConstructor(e){return e.type===`Literal`?e.value===`constructor`:super.nameIsConstructor(e)}parseClassProperty(...e){let t=super.parseClassProperty(...e);return t.abstract&&this.hasPlugin(`typescript`)?(delete t.abstract,this.castNodeTo(t,`TSAbstractPropertyDefinition`)):this.castNodeTo(t,`PropertyDefinition`),t}parseClassPrivateProperty(...e){let t=super.parseClassPrivateProperty(...e);return t.abstract&&this.hasPlugin(`typescript`)?this.castNodeTo(t,`TSAbstractPropertyDefinition`):this.castNodeTo(t,`PropertyDefinition`),t.computed=!1,t}parseClassAccessorProperty(e){let t=super.parseClassAccessorProperty(e);return t.abstract&&this.hasPlugin(`typescript`)?(delete t.abstract,this.castNodeTo(t,`TSAbstractAccessorProperty`)):this.castNodeTo(t,`AccessorProperty`),t}parseObjectProperty(e,t,n,r){let i=super.parseObjectProperty(e,t,n,r);return i&&(i.kind=`init`,this.castNodeTo(i,`Property`)),i}finishObjectProperty(e){return e.kind=`init`,this.finishNode(e,`Property`)}isValidLVal(e,t,n,r){return e===`Property`?`value`:super.isValidLVal(e,t,n,r)}isAssignable(e,t){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,t):super.isAssignable(e,t)}toAssignable(e,t=!1){if(e!=null&&this.isObjectProperty(e)){let{key:n,value:r}=e;this.isPrivateName(n)&&this.classScope.usePrivateName(this.getPrivateNameSV(n),n.start),this.toAssignable(r,t)}else super.toAssignable(e,t)}toAssignableObjectExpressionProp(e,t,n){e.type===`Property`&&(e.kind===`get`||e.kind===`set`)?this.raise(K.PatternHasAccessor,e.key):e.type===`Property`&&e.method?this.raise(K.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,t,n)}finishCallExpression(e,t){let n=super.finishCallExpression(e,t);return n.callee.type===`Import`?(this.castNodeTo(n,`ImportExpression`),n.source=n.arguments[0],n.options=n.arguments[1]??null,delete n.arguments,delete n.callee):n.type===`OptionalCallExpression`?this.castNodeTo(n,`CallExpression`):n.optional=!1,n}parseExport(e,t){let n=this.state.lastTokStartLoc,r=super.parseExport(e,t);switch(r.type){case`ExportAllDeclaration`:r.exported=null;break;case`ExportNamedDeclaration`:r.specifiers.length===1&&r.specifiers[0].type===`ExportNamespaceSpecifier`&&(this.castNodeTo(r,`ExportAllDeclaration`),r.exported=r.specifiers[0].exported,delete r.specifiers);case`ExportDefaultDeclaration`:{let{declaration:e}=r;e?.type===`ClassDeclaration`&&e.decorators?.length>0&&e.start===r.start&&this.resetStartLocation(r,n)}}return r}stopParseSubscript(e,t){let n=super.stopParseSubscript(e,t);return t.optionalChainMember?this.estreeParseChainExpression(n,e):n}parseMember(e,t,n,r,i){let a=super.parseMember(e,t,n,r,i);return a.type===`OptionalMemberExpression`?this.castNodeTo(a,`MemberExpression`):a.optional=!1,a}isOptionalMemberExpression(e){return e.type===`ChainExpression`?e.expression.type===`MemberExpression`:super.isOptionalMemberExpression(e)}hasPropertyAsPrivateName(e){return e.type===`ChainExpression`&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return e.type===`Property`&&e.kind===`init`&&!e.method}isObjectMethod(e){return e.type===`Property`&&(e.method||e.kind===`get`||e.kind===`set`)}castNodeTo(e,t){let n=super.castNodeTo(e,t);return this.fillOptionalPropertiesForTSESLint(n),n}cloneIdentifier(e){let t=super.cloneIdentifier(e);return this.fillOptionalPropertiesForTSESLint(t),t}cloneStringLiteral(e){return e.type===`Literal`?this.cloneEstreeStringLiteral(e):super.cloneStringLiteral(e)}finishNodeAt(e,t,n){return xy(super.finishNodeAt(e,t,n))}finishNodeAtNode(e,t,n){return xy(super.finishNodeAtNode(e,t,n))}finishNode(e,t){let n=super.finishNode(e,t);return this.fillOptionalPropertiesForTSESLint(n),n}resetStartLocation(e,t){super.resetStartLocation(e,t),xy(e)}resetEndLocation(e,t=this.state.lastTokEndLoc){super.resetEndLocation(e,t),xy(e)}},Cy=!0,q=!0,wy=!0,Ty=!0,Ey=!0,Dy=!0,Oy=class{label;keyword;beforeExpr;startsExpr;rightAssociative;isLoop;isAssign;prefix;postfix;binop;constructor(e,t={}){this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.rightAssociative=!!t.rightAssociative,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop==null?null:t.binop}},ky=new Map;function Ay(e,t={}){t.keyword=e;let n=zy(e,t);return ky.set(e,n),n}function jy(e,t){return zy(e,{beforeExpr:Cy,binop:t})}var My=-1,Ny=[],Py=[],Fy=[],Iy=[],Ly=[],Ry=[];function zy(e,t={}){return++My,Py.push(e),Fy.push(t.binop??-1),Iy.push(t.beforeExpr??!1),Ly.push(t.startsExpr??!1),Ry.push(t.prefix??!1),Ny.push(new Oy(e,t)),My}function By(e,t={}){return++My,ky.set(e,My),Py.push(e),Fy.push(t.binop??-1),Iy.push(t.beforeExpr??!1),Ly.push(t.startsExpr??!1),Ry.push(t.prefix??!1),Ny.push(new Oy(`name`,t)),My}var Vy={bracketL:zy(`[`,{beforeExpr:Cy,startsExpr:q}),bracketR:zy(`]`),braceL:zy(`{`,{beforeExpr:Cy,startsExpr:q}),braceBarL:zy(`{|`,{beforeExpr:Cy,startsExpr:q}),braceR:zy(`}`),braceBarR:zy(`|}`),parenL:zy(`(`,{beforeExpr:Cy,startsExpr:q}),parenR:zy(`)`),comma:zy(`,`,{beforeExpr:Cy}),semi:zy(`;`,{beforeExpr:Cy}),colon:zy(`:`,{beforeExpr:Cy}),doubleColon:zy(`::`,{beforeExpr:Cy}),dot:zy(`.`),question:zy(`?`,{beforeExpr:Cy}),questionDot:zy(`?.`),arrow:zy(`=>`,{beforeExpr:Cy}),template:zy(`template`),ellipsis:zy(`...`,{beforeExpr:Cy}),backQuote:zy("`",{startsExpr:q}),dollarBraceL:zy("${",{beforeExpr:Cy,startsExpr:q}),templateTail:zy("...`",{startsExpr:q}),templateNonTail:zy("...${",{beforeExpr:Cy,startsExpr:q}),at:zy(`@`),hash:zy(`#`,{startsExpr:q}),interpreterDirective:zy(`#!...`),eq:zy(`=`,{beforeExpr:Cy,isAssign:Ty}),assign:zy(`_=`,{beforeExpr:Cy,isAssign:Ty}),slashAssign:zy(`_=`,{beforeExpr:Cy,isAssign:Ty}),xorAssign:zy(`_=`,{beforeExpr:Cy,isAssign:Ty}),moduloAssign:zy(`_=`,{beforeExpr:Cy,isAssign:Ty}),incDec:zy(`++/--`,{prefix:Ey,postfix:Dy,startsExpr:q}),bang:zy(`!`,{beforeExpr:Cy,prefix:Ey,startsExpr:q}),tilde:zy(`~`,{beforeExpr:Cy,prefix:Ey,startsExpr:q}),doubleCaret:zy(`^^`,{startsExpr:q}),doubleAt:zy(`@@`,{startsExpr:q}),pipeline:jy(`|>`,0),nullishCoalescing:jy(`??`,1),logicalOR:jy(`||`,1),logicalAND:jy(`&&`,2),bitwiseOR:jy(`|`,3),bitwiseXOR:jy(`^`,4),bitwiseAND:jy(`&`,5),equality:jy(`==/!=/===/!==`,6),lt:jy(`</>/<=/>=`,7),gt:jy(`</>/<=/>=`,7),relational:jy(`</>/<=/>=`,7),bitShift:jy(`<</>>/>>>`,8),bitShiftL:jy(`<</>>/>>>`,8),bitShiftR:jy(`<</>>/>>>`,8),plusMin:zy(`+/-`,{beforeExpr:Cy,binop:9,prefix:Ey,startsExpr:q}),modulo:zy(`%`,{binop:10,startsExpr:q}),star:zy(`*`,{binop:10}),slash:jy(`/`,10),exponent:zy(`**`,{beforeExpr:Cy,binop:11,rightAssociative:!0}),_in:Ay(`in`,{beforeExpr:Cy,binop:7}),_instanceof:Ay(`instanceof`,{beforeExpr:Cy,binop:7}),_break:Ay(`break`),_case:Ay(`case`,{beforeExpr:Cy}),_catch:Ay(`catch`),_continue:Ay(`continue`),_debugger:Ay(`debugger`),_default:Ay(`default`,{beforeExpr:Cy}),_else:Ay(`else`,{beforeExpr:Cy}),_finally:Ay(`finally`),_function:Ay(`function`,{startsExpr:q}),_if:Ay(`if`),_return:Ay(`return`,{beforeExpr:Cy}),_switch:Ay(`switch`),_throw:Ay(`throw`,{beforeExpr:Cy,prefix:Ey,startsExpr:q}),_try:Ay(`try`),_var:Ay(`var`),_const:Ay(`const`),_with:Ay(`with`),_new:Ay(`new`,{beforeExpr:Cy,startsExpr:q}),_this:Ay(`this`,{startsExpr:q}),_super:Ay(`super`,{startsExpr:q}),_class:Ay(`class`,{startsExpr:q}),_extends:Ay(`extends`,{beforeExpr:Cy}),_export:Ay(`export`),_import:Ay(`import`,{startsExpr:q}),_null:Ay(`null`,{startsExpr:q}),_true:Ay(`true`,{startsExpr:q}),_false:Ay(`false`,{startsExpr:q}),_typeof:Ay(`typeof`,{beforeExpr:Cy,prefix:Ey,startsExpr:q}),_void:Ay(`void`,{beforeExpr:Cy,prefix:Ey,startsExpr:q}),_delete:Ay(`delete`,{beforeExpr:Cy,prefix:Ey,startsExpr:q}),_do:Ay(`do`,{isLoop:wy,beforeExpr:Cy}),_for:Ay(`for`,{isLoop:wy}),_while:Ay(`while`,{isLoop:wy}),_as:By(`as`,{startsExpr:q}),_assert:By(`assert`,{startsExpr:q}),_async:By(`async`,{startsExpr:q}),_await:By(`await`,{startsExpr:q}),_defer:By(`defer`,{startsExpr:q}),_from:By(`from`,{startsExpr:q}),_get:By(`get`,{startsExpr:q}),_let:By(`let`,{startsExpr:q}),_meta:By(`meta`,{startsExpr:q}),_of:By(`of`,{startsExpr:q}),_sent:By(`sent`,{startsExpr:q}),_set:By(`set`,{startsExpr:q}),_source:By(`source`,{startsExpr:q}),_static:By(`static`,{startsExpr:q}),_using:By(`using`,{startsExpr:q}),_yield:By(`yield`,{startsExpr:q}),_asserts:By(`asserts`,{startsExpr:q}),_checks:By(`checks`,{startsExpr:q}),_exports:By(`exports`,{startsExpr:q}),_global:By(`global`,{startsExpr:q}),_implements:By(`implements`,{startsExpr:q}),_intrinsic:By(`intrinsic`,{startsExpr:q}),_infer:By(`infer`,{startsExpr:q}),_is:By(`is`,{startsExpr:q}),_mixins:By(`mixins`,{startsExpr:q}),_proto:By(`proto`,{startsExpr:q}),_require:By(`require`,{startsExpr:q}),_satisfies:By(`satisfies`,{startsExpr:q}),_keyof:By(`keyof`,{startsExpr:q}),_readonly:By(`readonly`,{startsExpr:q}),_unique:By(`unique`,{startsExpr:q}),_abstract:By(`abstract`,{startsExpr:q}),_declare:By(`declare`,{startsExpr:q}),_enum:By(`enum`,{startsExpr:q}),_module:By(`module`,{startsExpr:q}),_namespace:By(`namespace`,{startsExpr:q}),_interface:By(`interface`,{startsExpr:q}),_type:By(`type`,{startsExpr:q}),_opaque:By(`opaque`,{startsExpr:q}),name:zy(`name`,{startsExpr:q}),placeholder:zy(`%%`,{startsExpr:q}),string:zy(`string`,{startsExpr:q}),num:zy(`num`,{startsExpr:q}),bigint:zy(`bigint`,{startsExpr:q}),regexp:zy(`regexp`,{startsExpr:q}),privateName:zy(`#name`,{startsExpr:q}),eof:zy(`eof`),jsxName:zy(`jsxName`),jsxText:zy(`jsxText`,{beforeExpr:Cy}),jsxTagStart:zy(`jsxTagStart`,{startsExpr:q}),jsxTagEnd:zy(`jsxTagEnd`)};function Hy(e){return e>=89&&e<=129}function Uy(e){return e<=88}function Wy(e){return e>=54&&e<=129}function Gy(e){return e>=54&&e<=132}function Ky(e){return Iy[e]}function qy(e){return Ly[e]}function Jy(e){return e>=25&&e<=29}function Yy(e){return e>=125&&e<=127}function Xy(e){return e>=86&&e<=88}function Zy(e){return e>=54&&e<=88}function Qy(e){return e>=35&&e<=55}function $y(e){return e===30}function eb(e){return Ry[e]}function tb(e){return e>=117&&e<=119}function nb(e){return e>=120&&e<=126}function rb(e){return Py[e]}function ib(e){return Fy[e]}function ab(e){return e===53}function ob(e){return e>=20&&e<=21}function sb(e){return Ny[e]}var cb=class{constructor(e,t){this.token=e,this.preserveSpace=!!t}token;preserveSpace},lb={brace:new cb(`{`),j_oTag:new cb(`<tag`),j_cTag:new cb(`</tag`),j_expr:new cb(`<tag>...</tag>`,!0)},ub=/[\p{ID_Start}\u0558\u058b\u058c\u088f\u0c5c\u0cdc\u208f\u209d-\u209f\ua7ce\ua7cf\ua7d2\ua7d4\ua7dd\ua7e2\ua7f1\uab6c\uab6d]/u,db=/[\p{ID_Continue}\u0558\u058b\u058c\u088f\u0c5c\u0cdc\u208f\u209d-\u209f\ua7ce\ua7cf\ua7d2\ua7d4\ua7dd\ua7e2\ua7f1\uab6c\uab6d\u05c8\u05c9\u0b53\u0b54\u1acf-\u1af0]/u,fb=[1979,4,385,25,1388,2,18,21,3100,0,678,43,22,0,1662,0,6,10,209,310,18458,24,3,24,287,4,6146,7,1239,4,47,23,96,114,14,913,15,50,8017,5,64,0,9534,0,2169,5,7,86,15,6,55,50,1729,30,2,2,2,1,2,6,3,4,10,1,53307,5,223,0,5764,11,21763,4297,39815,11327],pb=[3787,4,33,11,3173,7,633,9,7,0,45879,1,296,2,9,1,3,0,33,1,5218,0,3,0,8,1,6,0];function mb(e,t){let n=65536;for(let r=0,i=t.length;r<i;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function hb(e){return e<65?e===36:e<=90?!0:e<97?e===95:e<=122?!0:e<=65535?e>=170&&ub.test(String.fromCharCode(e)):!isNaN(e)&&e<=1114111&&(ub.test(String.fromCodePoint(e))||mb(e,fb))}function gb(e){return e<48?e===36:e<58?!0:e<65?!1:e<=90?!0:e<97?e===95:e<=122?!0:e<=65535?e>=170&&db.test(String.fromCharCode(e)):!isNaN(e)&&e<=1114111&&(db.test(String.fromCodePoint(e))||mb(e,fb)||mb(e,pb))}var _b={keyword:`break.case.catch.continue.debugger.default.do.else.finally.for.function.if.return.switch.throw.try.var.const.while.with.new.this.super.class.extends.export.import.null.true.false.in.instanceof.typeof.void.delete`.split(`.`),strict:[`implements`,`interface`,`let`,`package`,`private`,`protected`,`public`,`static`,`yield`],strictBind:[`eval`,`arguments`]},vb=new Set(_b.keyword),yb=new Set(_b.strict),bb=new Set(_b.strictBind);function xb(e,t){return t&&e===`await`||e===`enum`}function Sb(e,t){return xb(e,t)||yb.has(e)}function Cb(e){return bb.has(e)}function wb(e,t){return Sb(e,t)||Cb(e)}function Tb(e){return vb.has(e)}function Eb(e,t,n){return e===64&&t===64&&hb(n)}var Db=new Set(`break.case.catch.continue.debugger.default.do.else.finally.for.function.if.return.switch.throw.try.var.const.while.with.new.this.super.class.extends.export.import.null.true.false.in.instanceof.typeof.void.delete.implements.interface.let.package.private.protected.public.static.yield.eval.arguments.enum.await`.split(`.`));function Ob(e){return Db.has(e)}var kb=class{flags=0;names=new Map;firstLexicalName=``;constructor(e){this.flags=e}},Ab=class{parser;scopeStack=[];inModule;undefinedExports=new Map;constructor(e,t){this.parser=e,this.inModule=t}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get allowNewTarget(){return(this.currentThisScopeFlags()&512)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let e=this.currentThisScopeFlags();return(e&64)>0&&!(e&2)}get inStaticBlock(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(t&128)return!0;if(t&3779)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get inBareCaseStatement(){return(this.currentScope().flags&256)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(e){return new kb(e)}enter(e){this.scopeStack.push(this.createScope(e))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(e){return!!(e.flags&130||!this.parser.inModule&&e.flags&1)}declareName(e,t,n){let r=this.currentScope();if(t&8||t&16){this.checkRedeclarationInScope(r,e,t,n);let i=r.names.get(e)||0;t&16?i|=4:(r.firstLexicalName||(r.firstLexicalName=e),i|=2),r.names.set(e,i),t&8&&this.maybeExportDefined(r,e)}else if(t&4)for(let i=this.scopeStack.length-1;i>=0&&(r=this.scopeStack[i],this.checkRedeclarationInScope(r,e,t,n),r.names.set(e,(r.names.get(e)||0)|1),this.maybeExportDefined(r,e),!(r.flags&3715));--i);this.parser.inModule&&r.flags&1&&this.undefinedExports.delete(e)}maybeExportDefined(e,t){this.parser.inModule&&e.flags&1&&this.undefinedExports.delete(t)}checkRedeclarationInScope(e,t,n,r){this.isRedeclaredInScope(e,t,n)&&this.parser.raise(K.VarRedeclaration,r,{identifierName:t})}isRedeclaredInScope(e,t,n){if(!(n&1))return!1;if(n&8)return e.names.has(t);let r=e.names.get(t)||0;return n&16?(r&2)>0||!this.treatFunctionsAsVarInScope(e)&&(r&1)>0:(r&2)>0&&!(e.flags&8&&e.firstLexicalName===t)||!this.treatFunctionsAsVarInScope(e)&&(r&4)>0}checkLocalExport(e){let{name:t}=e;this.scopeStack[0].names.has(t)||this.undefinedExports.set(t,e.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(t&3715)return t}}currentThisScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(t&3779&&!(t&4))return t}}},jb=class extends kb{declareFunctions=new Set},Mb=class extends Ab{createScope(e){return new jb(e)}declareName(e,t,n){let r=this.currentScope();if(t&2048){this.checkRedeclarationInScope(r,e,t,n),this.maybeExportDefined(r,e),r.declareFunctions.add(e);return}super.declareName(e,t,n)}isRedeclaredInScope(e,t,n){if(super.isRedeclaredInScope(e,t,n))return!0;if(n&2048&&!e.declareFunctions.has(t)){let n=e.names.get(t);return(n&4)>0||(n&2)>0}return!1}checkLocalExport(e){this.scopeStack[0].declareFunctions.has(e.name)||super.checkLocalExport(e)}},Nb=new Set([`_`,`any`,`bool`,`boolean`,`empty`,`extends`,`false`,`interface`,`mixed`,`null`,`number`,`static`,`string`,`true`,`typeof`,`void`]),Pb=vy`flow`({AmbiguousConditionalArrow:`Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.`,AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:e})=>`Cannot overwrite reserved type ${e}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:e,enumName:t})=>`Boolean enum members need to be initialized. Use either \`${e} = true,\` or \`${e} = false,\` in enum \`${t}\`.`,EnumDuplicateMemberName:({memberName:e,enumName:t})=>`Enum member names need to be unique, but the name \`${e}\` has already been used before in enum \`${t}\`.`,EnumInconsistentMemberValues:({enumName:e})=>`Enum \`${e}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:e,enumName:t})=>`Enum type \`${e}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:e})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${e}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:e,memberName:t,explicitType:n})=>`Enum \`${e}\` has type \`${n}\`, so the initializer of \`${t}\` needs to be a ${n} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:e,memberName:t})=>`Symbol enum members cannot be initialized. Use \`${t},\` in enum \`${e}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:e,memberName:t})=>`The enum member initializer for \`${t}\` needs to be a literal (either a boolean, number, or string) in enum \`${e}\`.`,EnumInvalidMemberName:({enumName:e,memberName:t,suggestion:n})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${t}\`, consider using \`${n}\`, in enum \`${e}\`.`,EnumNumberMemberNotInitialized:({enumName:e,memberName:t})=>`Number enum members need to be initialized, e.g. \`${t} = 1\` in enum \`${e}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:e})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${e}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:`Explicit inexact syntax cannot appear inside an explicit exact object type.`,InexactInsideNonObject:`Explicit inexact syntax cannot appear in class or interface definitions.`,InexactVariance:`Explicit inexact syntax cannot have variance.`,InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:`Type parameter declaration needs a default, since a preceding type parameter declaration has a default.`,NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:`Cannot have a flow comment inside another flow comment.`,PatternIsOptional:{message:`A binding pattern parameter cannot be optional in an implementation signature.`},SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:`Spread properties cannot have variance.`,ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:`The type cast expression is expected to be wrapped with parenthesis.`,UnexpectedExplicitInexactInObject:`Explicit inexact syntax must appear at the end of an inexact object.`,UnexpectedReservedType:({reservedType:e})=>`Unexpected reserved type ${e}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:`Spread operator cannot appear in class or interface definitions.`,UnexpectedSubtractionOperand:`Unexpected token, expected "number" or "bigint".`,UnexpectedTokenAfterTypeParameter:`Expected an arrow function after this type parameter declaration.`,UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:e,suggestion:t})=>`\`declare export ${e}\` is not supported. Use \`${t}\` instead.`,UnsupportedStatementInDeclareModule:`Only declares and type imports are allowed inside declare module.`,UnterminatedFlowComment:`Unterminated flow-comment.`});function Fb(e){return e.type===`DeclareExportAllDeclaration`||e.type===`DeclareExportDeclaration`&&(!e.declaration||e.declaration.type!==`TypeAlias`&&e.declaration.type!==`InterfaceDeclaration`)}function Ib(e){return e.importKind===`type`||e.importKind===`typeof`}var Lb={const:`declare export var`,let:`declare export var`,type:`export type`,interface:`export interface`};function Rb(e,t){let n=[],r=[];for(let i=0;i<e.length;i++)(t(e[i],i,e)?n:r).push(e[i]);return[n,r]}var zb=/\*?\s*@((?:no)?flow)\b/,Bb=e=>class extends e{flowPragma=void 0;getScopeHandler(){return Mb}shouldParseTypes(){return this.getPluginOption(`flow`,`all`)||this.flowPragma===`flow`}finishToken(e,t){e!==130&&e!==9&&e!==24&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,t)}addComment(e){if(this.flowPragma===void 0){let t=zb.exec(e.value);if(t){if(t[1]===`flow`)this.flowPragma=`flow`;else if(t[1]===`noflow`)this.flowPragma=`noflow`;else throw Error(`Unexpected flow pragma`)}}super.addComment(e)}flowParseTypeInitialiser(e){let t=this.state.inType;this.state.inType=!0,this.expect(e||10);let n=this.flowParseType();return this.state.inType=t,n}flowParsePredicate(){let e=this.startNode(),t=this.state.startLoc;return this.next(),this.expectContextual(106),this.state.lastTokStartLoc.index>t.index+1&&this.raise(Pb.UnexpectedSpaceBetweenModuloChecks,t),this.eat(6)?(e.value=super.parseExpression(),this.expect(7),this.finishNode(e,`DeclaredPredicate`)):this.finishNode(e,`InferredPredicate`)}flowParseTypeAndPredicateInitialiser(e){let t=this.state.inType;this.state.inType=!0,this.expect(10);let n=null,r=null;return e&&this.match(50)?(this.state.inType=t,r=this.flowParsePredicate()):(n=this.flowParseType(),this.state.inType=t,this.match(50)&&(r=this.flowParsePredicate())),[n,r]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,`DeclareClass`)}flowParseDeclareFunction(e){this.next();let t=e.id=this.parseIdentifier(),n=this.startNode(),r=this.startNode();n.typeParameters=this.match(43)?this.flowParseTypeParameterDeclaration():null,this.expect(6);let i=this.flowParseFunctionTypeParams();return n.params=i.params,n.rest=i.rest,n.this=i._this,this.expect(7),[n.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(!1),r.typeAnnotation=this.finishNode(n,`FunctionTypeAnnotation`),t.typeAnnotation=this.finishNode(r,`TypeAnnotation`),this.resetEndLocation(t),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.start),this.finishNode(e,`DeclareFunction`)}flowParseDeclare(e,t){if(this.match(76))return this.flowParseDeclareClass(e);if(this.match(64))return this.flowParseDeclareFunction(e);if(this.match(70))return this.flowParseDeclareVariable(e);if(this.eatContextual(123))return this.match(12)?this.flowParseDeclareModuleExports(e):(t&&this.raise(Pb.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(126))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(127))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(125))return this.flowParseDeclareInterface(e);if(this.match(78))return this.flowParseDeclareExportDeclaration(e,t);throw this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(),this.scope.declareName(e.id.name,5,e.id.start),this.semicolon(),this.finishNode(e,`DeclareVariable`)}flowParseDeclareModule(e){this.scope.enter(0),e.id=this.match(130)?super.parseExprAtom():this.parseIdentifier();let t=this.startNode(),n=t.body=[];for(this.expect(2);!this.match(4);){let e=this.startNode();this.match(79)?(this.next(),!this.isContextual(126)&&!this.match(83)&&this.raise(Pb.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),n.push(super.parseImport(e))):(this.expectContextual(121,Pb.UnsupportedStatementInDeclareModule),n.push(this.flowParseDeclare(e,!0)))}this.scope.exit(),this.expect(4),e.body=this.finishNode(t,`BlockStatement`);let r=null,i=!1;return n.forEach(e=>{Fb(e)?(r===`CommonJS`&&this.raise(Pb.AmbiguousDeclareModuleKind,e),r=`ES`):e.type===`DeclareModuleExports`&&(i&&this.raise(Pb.DuplicateDeclareModuleExports,e),r===`ES`&&this.raise(Pb.AmbiguousDeclareModuleKind,e),r=`CommonJS`,i=!0)}),e.kind=r||`CommonJS`,this.finishNode(e,`DeclareModule`)}flowParseDeclareExportDeclaration(e,t){if(this.expect(78),this.eat(61))return this.match(64)||this.match(76)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,`DeclareExportDeclaration`);if(this.match(71)||this.isLet()||(this.isContextual(126)||this.isContextual(125))&&!t){let e=this.state.value;throw this.raise(Pb.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:e,suggestion:Lb[e]})}if(this.match(70)||this.match(64)||this.match(76)||this.isContextual(127))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,`DeclareExportDeclaration`);if(this.match(51)||this.match(2)||this.isContextual(125)||this.isContextual(126)||this.isContextual(127)){let t=this.parseExport(e,null);return t.type===`ExportNamedDeclaration`?(t.default=!1,delete t.exportKind,this.castNodeTo(t,`DeclareExportDeclaration`)):this.castNodeTo(t,`DeclareExportAllDeclaration`)}throw this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(107),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,`DeclareModuleExports`)}flowParseDeclareTypeAlias(e){this.next();let t=this.flowParseTypeAlias(e);return this.castNodeTo(t,`DeclareTypeAlias`),t}flowParseDeclareOpaqueType(e){return this.next(),this.flowParseOpaqueType(e,!0)}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,`DeclareInterface`)}flowParseInterfaceish(e,t){if(e.id=this.flowParseRestrictedIdentifier(!t,!0),this.scope.declareName(e.id.name,t?17:8201,e.id.start),e.typeParameters=this.match(43)?this.flowParseTypeParameterDeclaration():null,e.extends=[],this.eat(77))do e.extends.push(this.flowParseInterfaceExtends());while(!t&&this.eat(8));if(t){let t=[],n=[];if(this.eatContextual(113))do n.push(this.flowParseInterfaceExtends());while(this.eat(8));if(this.eatContextual(109))do t.push(this.flowParseClassImplements());while(this.eat(8));e.implements=t,e.mixins=n}e.body=this.flowParseObjectType({allowStatic:t,allowExact:!1,allowSpread:!1,allowProto:t,allowInexact:!1})}flowParseInterfaceExtends(){let e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),e.typeParameters=this.match(43)?this.flowParseTypeParameterInstantiation():null,this.finishNode(e,`InterfaceExtends`)}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,`InterfaceDeclaration`)}checkNotUnderscore(e){e===`_`&&this.raise(Pb.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,t,n){Nb.has(e)&&this.raise(n?Pb.AssignReservedType:Pb.UnexpectedReservedType,t,{reservedType:e})}flowParseRestrictedIdentifierName(e,t){return this.checkReservedType(this.state.value,this.state.startLoc,t),this.parseIdentifierName(e)}flowParseRestrictedIdentifier(e,t){let n=this.startNode(),r=this.flowParseRestrictedIdentifierName(e,t);return this.createIdentifier(n,r)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.start),e.typeParameters=this.match(43)?this.flowParseTypeParameterDeclaration():null,e.right=this.flowParseTypeInitialiser(25),this.semicolon(),this.finishNode(e,`TypeAlias`)}flowParseOpaqueType(e,t){return this.expectContextual(126),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.start),e.typeParameters=this.match(43)?this.flowParseTypeParameterDeclaration():null,e.supertype=null,this.match(10)&&(e.supertype=this.flowParseTypeInitialiser(10)),e.impltype=null,t||(e.impltype=this.flowParseTypeInitialiser(25)),this.semicolon(),this.finishNode(e,t?`DeclareOpaqueType`:`OpaqueType`)}flowParseTypeParameterBound(){if(this.match(10)||this.isContextual(77)){let e=this.startNode();return this.next(),e.typeAnnotation=this.flowParseType(),this.finishNode(e,`TypeAnnotation`)}}flowParseTypeParameter(e=!1){let t=this.state.startLoc,n=this.startNode(),r=this.flowParseVariance();return n.name=this.flowParseRestrictedIdentifierName(),n.variance=r,n.bound=this.flowParseTypeParameterBound(),this.match(25)?(this.eat(25),n.default=this.flowParseType()):e&&this.raise(Pb.MissingTypeParamDefault,t),this.finishNode(n,`TypeParameter`)}flowParseTypeParameterDeclaration(){let e=this.state.inType,t=this.startNode();t.params=[],this.state.inType=!0,this.match(43)||this.match(138)?this.next():this.unexpected();let n=!1;do{let e=this.flowParseTypeParameter(n);t.params.push(e),e.default&&(n=!0),this.match(44)||this.expect(8)}while(!this.match(44));return this.expect(44),this.state.inType=e,this.finishNode(t,`TypeParameterDeclaration`)}flowInTopLevelContext(e){if(this.curContext()!==lb.brace){let t=this.state.context;this.state.context=[t[0]];try{return e()}finally{this.state.context=t}}else return e()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===43)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let e=this.startNode(),t=this.state.inType;return this.state.inType=!0,e.params=[],this.flowInTopLevelContext(()=>{this.expect(43);let t=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(44);)e.params.push(this.flowParseType()),this.match(44)||this.expect(8);this.state.noAnonFunctionType=t}),this.state.inType=t,!this.state.inType&&this.curContext()===lb.brace&&this.reScan_lt_gt(),this.expect(44),this.finishNode(e,`TypeParameterInstantiation`)}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==43)return null;let e=this.startNode(),t=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(43);!this.match(44);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(44)||this.expect(8);return this.expect(44),this.state.inType=t,this.finishNode(e,`TypeParameterInstantiation`)}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(125),e.extends=[],this.eat(77))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(8));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,`InterfaceTypeAnnotation`)}flowParseObjectPropertyKey(){return this.match(131)||this.match(130)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,t,n){return e.static=t,this.lookahead().type===10?(e.id=this.parseIdentifier(!0),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(1),e.value=this.flowParseTypeInitialiser(),e.variance=n,this.finishNode(e,`ObjectTypeIndexer`)}flowParseObjectTypeInternalSlot(e,t){return e.static=t,e.id=this.parseIdentifier(!0),this.expect(1),this.expect(1),this.match(43)||this.match(6)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAtNode(e))):(e.method=!1,this.eat(13)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,`ObjectTypeInternalSlot`)}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(43)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(6),this.match(74)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(7)||this.expect(8));!this.match(7)&&!this.match(17);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(7)||this.expect(8);return this.eat(17)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(7),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,`FunctionTypeAnnotation`)}flowParseObjectTypeCallProperty(e,t){let n=this.startNode();return e.static=t,e.value=this.flowParseObjectTypeMethodish(n),this.finishNode(e,`ObjectTypeCallProperty`)}flowParseObjectType({allowStatic:e,allowExact:t,allowSpread:n,allowProto:r,allowInexact:i}){let a=this.state.inType;this.state.inType=!0;let o=this.startNode();o.callProperties=[],o.properties=[],o.indexers=[],o.internalSlots=[];let s,c,l=!1;for(t&&this.match(3)?(this.expect(3),s=5,c=!0):(this.expect(2),s=4,c=!1),o.exact=c;!this.match(s);){let t=!1,a=null,s=null,u=this.startNode();if(r&&this.isContextual(114)){let t=this.lookahead();t.type!==10&&t.type!==13&&(this.next(),a=this.state.startLoc,e=!1)}if(e&&this.isContextual(102)){let e=this.lookahead();e.type!==10&&e.type!==13&&(this.next(),t=!0)}let d=this.flowParseVariance();if(this.eat(0))a!=null&&this.unexpected(a),this.eat(0)?(d&&this.unexpected(d.start),o.internalSlots.push(this.flowParseObjectTypeInternalSlot(u,t))):o.indexers.push(this.flowParseObjectTypeIndexer(u,t,d));else if(this.match(6)||this.match(43))a!=null&&this.unexpected(a),d&&this.unexpected(d.start),o.callProperties.push(this.flowParseObjectTypeCallProperty(u,t));else{let e=`init`;(this.isContextual(95)||this.isContextual(100))&&Gy(this.lookahead().type)&&(e=this.state.value,this.next());let r=this.flowParseObjectTypeProperty(u,t,a,d,e,n,i??!c);r===null?(l=!0,s=this.state.lastTokStartLoc):o.properties.push(r)}this.flowObjectTypeSemicolon(),s&&!this.match(4)&&!this.match(5)&&this.raise(Pb.UnexpectedExplicitInexactInObject,s)}this.expect(s),n&&(o.inexact=l);let u=this.finishNode(o,`ObjectTypeAnnotation`);return this.state.inType=a,u}flowParseObjectTypeProperty(e,t,n,r,i,a,o){if(this.eat(17))return this.match(8)||this.match(9)||this.match(4)||this.match(5)?(a?o||this.raise(Pb.InexactInsideExact,this.state.lastTokStartLoc):this.raise(Pb.InexactInsideNonObject,this.state.lastTokStartLoc),r&&this.raise(Pb.InexactVariance,r),null):(a||this.raise(Pb.UnexpectedSpreadType,this.state.lastTokStartLoc),n!=null&&this.unexpected(n),r&&this.raise(Pb.SpreadVariance,r),e.argument=this.flowParseType(),this.finishNode(e,`ObjectTypeSpreadProperty`));{e.key=this.flowParseObjectPropertyKey(),e.static=t,e.proto=n!=null,e.kind=i;let o=!1;return this.match(43)||this.match(6)?(e.method=!0,n!=null&&this.unexpected(n),r&&this.unexpected(r.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAtNode(e)),i===`get`||i===`set`?this.flowCheckGetterSetterParams(e):!t&&!a&&e.key.name===`constructor`&&e.value.this&&this.raise(Pb.ThisParamBannedInConstructor,e.value.this)):(i!==`init`&&this.unexpected(),e.method=!1,this.eat(13)&&(o=!0),e.value=this.flowParseTypeInitialiser(),e.variance=r),e.optional=o,this.finishNode(e,`ObjectTypeProperty`)}}flowCheckGetterSetterParams(e){let t=e.kind===`get`?0:1,n=e.value,r=n.params.length+ +!!n.rest;n.this&&this.raise(e.kind===`get`?Pb.GetterMayNotHaveThisParam:Pb.SetterMayNotHaveThisParam,n.this),r!==t&&this.raise(e.kind===`get`?K.BadGetterArity:K.BadSetterArity,e),e.kind===`set`&&n.rest&&this.raise(K.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(9)&&!this.eat(8)&&!this.match(4)&&!this.match(5)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,t){e??=this.state.startLoc;let n=t||this.flowParseRestrictedIdentifier(!0);for(;this.eat(12);){let t=this.startNodeAt(e);t.qualification=n,t.id=this.flowParseRestrictedIdentifier(!0),n=this.finishNode(t,`QualifiedTypeIdentifier`)}return n}flowParseGenericType(e,t){let n=this.startNodeAt(e);return n.typeParameters=null,n.id=this.flowParseQualifiedTypeIdentifier(e,t),this.match(43)&&(n.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(n,`GenericTypeAnnotation`)}flowParseTypeofType(){let e=this.startNode();return this.expect(83),e.argument=this.flowParsePrimaryType(),this.finishNode(e,`TypeofTypeAnnotation`)}flowParseTupleType(){let e=this.startNode();for(e.types=[],this.expect(0);this.state.pos<this.length&&!this.match(1)&&(e.types.push(this.flowParseType()),!this.match(1));)this.expect(8);return this.expect(1),this.finishNode(e,`TupleTypeAnnotation`)}flowParseFunctionTypeParam(e){let t=null,n=!1,r,i=this.startNode(),a=this.lookahead(),o=this.state.type===74;return a.type===10||a.type===13?(o&&!e&&this.raise(Pb.ThisParamMustBeFirst,i),t=this.parseIdentifier(o),this.eat(13)&&(n=!0,o&&this.raise(Pb.ThisParamMayNotBeOptional,i)),r=this.flowParseTypeInitialiser()):r=this.flowParseType(),i.name=t,i.optional=n,i.typeAnnotation=r,this.finishNode(i,`FunctionTypeParam`)}reinterpretTypeAsFunctionTypeParam(e){let t=this.startNodeAtNode(e);return t.name=null,t.optional=!1,t.typeAnnotation=e,this.finishNode(t,`FunctionTypeParam`)}flowParseFunctionTypeParams(e=[]){let t=null,n=null;for(this.match(74)&&(n=this.flowParseFunctionTypeParam(!0),n.name=null,this.match(7)||this.expect(8));!this.match(7)&&!this.match(17);)e.push(this.flowParseFunctionTypeParam(!1)),this.match(7)||this.expect(8);return this.eat(17)&&(t=this.flowParseFunctionTypeParam(!1)),{params:e,rest:t,_this:n}}flowIdentToTypeAnnotation(e,t,n){switch(n.name){case`any`:return this.finishNode(t,`AnyTypeAnnotation`);case`bool`:case`boolean`:return this.finishNode(t,`BooleanTypeAnnotation`);case`mixed`:return this.finishNode(t,`MixedTypeAnnotation`);case`empty`:return this.finishNode(t,`EmptyTypeAnnotation`);case`number`:return this.finishNode(t,`NumberTypeAnnotation`);case`string`:return this.finishNode(t,`StringTypeAnnotation`);case`symbol`:return this.finishNode(t,`SymbolTypeAnnotation`);default:return this.checkNotUnderscore(n.name),this.flowParseGenericType(e,n)}}flowParsePrimaryType(){let e=this.state.startLoc,t=this.startNode(),n,r,i=!1,a=this.state.noAnonFunctionType;switch(this.state.type){case 2:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 3:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,r=this.flowParseTupleType(),this.state.noAnonFunctionType=a,r;case 43:{let e=this.startNode();return e.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(6),n=this.flowParseFunctionTypeParams(),e.params=n.params,e.rest=n.rest,e.this=n._this,this.expect(7),this.expect(15),e.returnType=this.flowParseType(),this.finishNode(e,`FunctionTypeAnnotation`)}case 6:{let e=this.startNode();if(this.next(),!this.match(7)&&!this.match(17)){if(Hy(this.state.type)||this.match(74)){let e=this.lookahead().type;i=e!==13&&e!==10}else i=!0}if(i){if(this.state.noAnonFunctionType=!1,r=this.flowParseType(),this.state.noAnonFunctionType=a,this.state.noAnonFunctionType||!(this.match(8)||this.match(7)&&this.lookahead().type===15))return this.expect(7),r;this.eat(8)}return n=r?this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(r)]):this.flowParseFunctionTypeParams(),e.params=n.params,e.rest=n.rest,e.this=n._this,this.expect(7),this.expect(15),e.returnType=this.flowParseType(),e.typeParameters=null,this.finishNode(e,`FunctionTypeAnnotation`)}case 130:return this.parseLiteral(this.state.value,`StringLiteralTypeAnnotation`);case 81:case 82:return t.value=this.match(81),this.next(),this.finishNode(t,`BooleanLiteralTypeAnnotation`);case 49:if(this.state.value===`-`){if(this.next(),this.match(131))return this.parseLiteralAtNode(-this.state.value,`NumberLiteralTypeAnnotation`,t);if(this.match(132))return this.parseLiteralAtNode(-this.state.value,`BigIntLiteralTypeAnnotation`,t);throw this.raise(Pb.UnexpectedSubtractionOperand,this.state.startLoc)}throw this.unexpected();case 131:return this.parseLiteral(this.state.value,`NumberLiteralTypeAnnotation`);case 132:return this.parseLiteral(this.state.value,`BigIntLiteralTypeAnnotation`);case 84:return this.next(),this.finishNode(t,`VoidTypeAnnotation`);case 80:return this.next(),this.finishNode(t,`NullLiteralTypeAnnotation`);case 74:return this.next(),this.finishNode(t,`ThisTypeAnnotation`);case 51:return this.next(),this.finishNode(t,`ExistsTypeAnnotation`);case 83:return this.flowParseTypeofType();default:if(Zy(this.state.type)){let e=rb(this.state.type);return this.next(),super.createIdentifier(t,e)}if(Hy(this.state.type))return this.isContextual(125)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(e,t,this.parseIdentifier())}throw this.unexpected()}flowParsePostfixType(){let e=this.state.startLoc,t=this.flowParsePrimaryType(),n=!1;for(;(this.match(0)||this.match(14))&&!this.canInsertSemicolon();){let r=this.startNodeAt(e),i=this.eat(14);n||=i,this.expect(0),!i&&this.match(1)?(r.elementType=t,this.next(),t=this.finishNode(r,`ArrayTypeAnnotation`)):(r.objectType=t,r.indexType=this.flowParseType(),this.expect(1),n?(r.optional=i,t=this.finishNode(r,`OptionalIndexedAccessType`)):t=this.finishNode(r,`IndexedAccessType`))}return t}flowParsePrefixType(){let e=this.startNode();return this.eat(13)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,`NullableTypeAnnotation`)):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(15)){let t=this.startNodeAtNode(e);return t.params=[this.reinterpretTypeAsFunctionTypeParam(e)],t.rest=null,t.this=null,t.returnType=this.flowParseType(),t.typeParameters=null,this.finishNode(t,`FunctionTypeAnnotation`)}return e}flowParseIntersectionType(){let e=this.startNode();this.eat(41);let t=this.flowParseAnonFunctionWithoutParens();for(e.types=[t];this.eat(41);)e.types.push(this.flowParseAnonFunctionWithoutParens());return e.types.length===1?t:this.finishNode(e,`IntersectionTypeAnnotation`)}flowParseUnionType(){let e=this.startNode();this.eat(39);let t=this.flowParseIntersectionType();for(e.types=[t];this.eat(39);)e.types.push(this.flowParseIntersectionType());return e.types.length===1?t:this.finishNode(e,`UnionTypeAnnotation`)}flowParseType(){let e=this.state.inType;this.state.inType=!0;let t=this.flowParseUnionType();return this.state.inType=e,t}flowParseTypeOrImplicitInstantiation(){if(this.state.type===128&&this.state.value===`_`){let e=this.state.startLoc,t=this.parseIdentifier();return this.flowParseGenericType(e,t)}return this.flowParseType()}flowParseTypeAnnotation(){let e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,`TypeAnnotation`)}flowParseTypeAnnotatableIdentifier(){let e=this.startNode(),t=this.parseIdentifierName();return this.match(10)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),this.createIdentifier(e,t)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocationFromNode(e.expression,e.typeAnnotation),e.expression}flowParseVariance(){let e=null;return this.match(49)?(e=this.startNode(),this.state.value===`+`?e.kind=`plus`:e.kind=`minus`,this.next(),this.finishNode(e,`Variance`)):e}parseFunctionBody(e,t,n=!1){if(t){this.forwardNoArrowParamsConversionAt(e,()=>super.parseFunctionBody(e,!0,n));return}super.parseFunctionBody(e,!1,n)}parseFunctionBodyAndFinish(e,t,n=!1){if(this.match(10)){let n=this.startNode();t===`FunctionDeclaration`||t===`FunctionExpression`||t===`ArrowFunctionExpression`?[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(!0):n.typeAnnotation=this.flowParseTypeInitialiser(),e.returnType=n.typeAnnotation?this.finishNode(n,`TypeAnnotation`):null}return super.parseFunctionBodyAndFinish(e,t,n)}parseStatementLike(e){if(this.state.strict&&this.isContextual(125)){if(Wy(this.lookahead().type)){let e=this.startNode();return this.next(),this.flowParseInterface(e)}}else if(this.isContextual(122)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}let t=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(t)&&(this.flowPragma=null),t}parseExpressionStatement(e,t){if(t.type===`Identifier`){if(t.name===`declare`){if(this.match(76)||Hy(this.state.type)||this.match(64)||this.match(70)||this.match(78))return this.flowParseDeclare(e)}else if(Hy(this.state.type)){if(t.name===`interface`)return this.flowParseInterface(e);if(t.name===`type`)return this.flowParseTypeAlias(e);if(t.name===`opaque`)return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,t)}shouldParseExportDeclaration(){let{type:e}=this.state;return e===122||Yy(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return e===122||Yy(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(122)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,t,n){if(!this.match(13))return e;if(n!=null){let t=this.lookaheadCharCode();if(t===44||t===61||t===58||t===41)return this.setOptionalParametersError(n),e}this.expect(13);let r=this.state.clone(),i=this.state.noArrowAt,a=this.startNodeAt(t),{consequent:o,failed:s}=this.tryParseConditionalConsequent(),c=this.getArrowLikeExpressions(o),l=c[0],u=c[1];if(s||u.length>0){let e=[...i];if(u.length>0){this.state=r,this.state.noArrowAt=e;for(let t=0;t<u.length;t++)e.push(u[t].start);({consequent:o,failed:s}=this.tryParseConditionalConsequent()),[l]=this.getArrowLikeExpressions(o)}s&&l.length>1&&this.raise(Pb.AmbiguousConditionalArrow,r.startLoc),s&&l.length===1&&(this.state=r,e.push(l[0].start),this.state.noArrowAt=e,{consequent:o}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(o,!0),this.state.noArrowAt=i,this.expect(10),a.test=e,a.consequent=o,a.alternate=this.forwardNoArrowParamsConversionAt(a,()=>this.parseMaybeAssign()),this.finishNode(a,`ConditionalExpression`)}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let e=this.parseMaybeAssignAllowIn(),t=!this.match(10);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:t}}getArrowLikeExpressions(e,t){let n=[e],r=[];for(;n.length!==0;){let e=n.pop();e.type===`ArrowFunctionExpression`?(e.typeParameters||!e.returnType?this.finishArrowValidation(e):r.push(e),e.body.type!==`BlockStatement`&&n.push(e.body)):e.type===`ConditionalExpression`&&(n.push(e.consequent),n.push(e.alternate))}return t?(r.forEach(e=>this.finishArrowValidation(e)),[r,[]]):Rb(r,e=>e.params.every(e=>this.isAssignable(e,!0)))}finishArrowValidation(e){this.toAssignableList(e.params,e.extra?.trailingCommaLoc,!1),this.scope.enter(518),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,t){let n;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),n=t(),this.state.noArrowParamsConversionAt.pop()):n=t(),n}parseParenItem(e,t){let n=super.parseParenItem(e,t);if(this.eat(13)&&(n.optional=!0,this.resetEndLocation(e)),this.match(10)){let e=this.startNodeAt(t);return e.expression=n,e.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(e,`TypeCastExpression`)}return n}assertModuleNodeAllowed(e){e.type===`ImportDeclaration`&&(e.importKind===`type`||e.importKind===`typeof`)||e.type===`ExportNamedDeclaration`&&e.exportKind===`type`||e.type===`ExportAllDeclaration`&&e.exportKind===`type`||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(126)){e.exportKind=`type`;let t=this.startNode();return this.next(),this.match(2)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(t)}if(this.isContextual(127)){e.exportKind=`type`;let t=this.startNode();return this.next(),this.flowParseOpaqueType(t,!1)}if(this.isContextual(125)){e.exportKind=`type`;let t=this.startNode();return this.next(),this.flowParseInterface(t)}if(this.isContextual(122)){e.exportKind=`value`;let t=this.startNode();return this.next(),this.flowParseEnumDeclaration(t)}return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(126)&&this.lookahead().type===51?(e.exportKind=`type`,this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:t}=this.state,n=super.maybeParseExportNamespaceSpecifier(e);return n&&e.exportKind===`type`&&this.unexpected(t),n}parseClassId(e,t,n){if((!t||n)&&this.isContextual(109)){e.id=null;return}super.parseClassId(e,t,n),this.match(43)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,t,n){let{startLoc:r}=this.state;if(this.isContextual(121)){if(super.parseClassMemberFromModifier(e,t))return;t.declare=!0}super.parseClassMember(e,t,n),t.declare&&(t.type!==`ClassProperty`&&t.type!==`ClassPrivateProperty`&&t.type!==`PropertyDefinition`?this.raise(Pb.DeclareClassElement,r):t.value&&this.raise(Pb.DeclareClassFieldInitializer,t.value))}isIterator(e){return e===`iterator`||e===`asyncIterator`}readIterator(){let e=super.readWord1(),t=`@@`+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(K.InvalidIdentifier,this.state.curPosition(),{identifierName:t}),this.finishToken(128,t)}getTokenFromCode(e){let t=this.input.charCodeAt(this.state.pos+1);e===123&&t===124?this.finishOp(3,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?44:43,1):this.state.inType&&e===63?t===46?this.finishOp(14,2):this.finishOp(13,1):Eb(e,t,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,t){return e.type===`TypeCastExpression`?this.isAssignable(e.expression,t):super.isAssignable(e,t)}toAssignable(e,t=!1){!t&&e.type===`AssignmentExpression`&&e.left.type===`TypeCastExpression`&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,t)}toAssignableListItem(e,t,n){let r=e[t];r.type===`TypeCastExpression`&&(e[t]=this.typeCastToParameter(r)),super.toAssignableListItem(e,t,n)}toReferencedList(e,t){for(let n=0;n<e.length;n++){let r=e[n];r?.type===`TypeCastExpression`&&!r.extra?.parenthesized&&(e.length>1||!t)&&this.raise(Pb.TypeCastInPattern,r.typeAnnotation)}return e}parseArrayLike(e,t){let n=super.parseArrayLike(e,t);return n.type===`ArrayExpression`&&this.toReferencedList(n.elements),n}isValidLVal(e,t,n,r){return e===`TypeCastExpression`||super.isValidLVal(e,t,n,r)}parseClassProperty(e){return this.match(10)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(10)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(43)||super.isClassMethod()}isClassProperty(){return this.match(10)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(10)&&super.isNonstaticConstructor(e)}pushClassMethod(e,t,n,r,i,a){if(t.variance&&this.unexpected(t.variance.start),delete t.variance,this.match(43)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,t,n,r,i,a),t.params&&i){let e=t.params;e.length>0&&this.isThisParam(e[0])&&this.raise(Pb.ThisParamBannedInConstructor,t)}else if(t.type===`MethodDefinition`&&i&&t.value.params){let e=t.value.params;e.length>0&&this.isThisParam(e[0])&&this.raise(Pb.ThisParamBannedInConstructor,t)}}pushClassPrivateMethod(e,t,n,r){t.variance&&this.unexpected(t.variance.start),delete t.variance,this.match(43)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,t,n,r)}flowParseClassImplements(){let e=this.startNode();return e.id=this.flowParseRestrictedIdentifier(!0),e.typeParameters=this.match(43)?this.flowParseTypeParameterInstantiation():null,this.finishNode(e,`ClassImplements`)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&(this.match(43)||this.match(47))&&(e.superTypeArguments=this.flowParseTypeParameterInstantiationInExpression()),this.eatContextual(109)){let t=e.implements=[];do t.push(this.flowParseClassImplements());while(this.eat(8))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let t=this.getObjectOrClassMethodParams(e);if(t.length>0){let n=t[0];this.isThisParam(n)&&e.kind===`get`?this.raise(Pb.GetterMayNotHaveThisParam,n):this.isThisParam(n)&&this.raise(Pb.SetterMayNotHaveThisParam,n)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,t,n,r,i,a,o){e.variance&&this.unexpected(e.variance.start),delete e.variance;let s;this.match(43)&&!a&&(s=this.flowParseTypeParameterDeclaration(),this.match(6)||this.unexpected());let c=super.parseObjPropValue(e,t,n,r,i,a,o);return s&&((c.value||c).typeParameters=s),c}parseFunctionParamType(e){return this.eat(13)&&(e.type!==`Identifier`&&this.raise(Pb.PatternIsOptional,e),this.isThisParam(e)&&this.raise(Pb.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(10)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(Pb.ThisParamAnnotationRequired,e),this.match(25)&&this.isThisParam(e)&&this.raise(Pb.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,t){let n=super.parseMaybeDefault(e,t);return n.type===`AssignmentPattern`&&n.typeAnnotation&&n.right.start<n.typeAnnotation.start&&this.raise(Pb.TypeBeforeInitializer,n.typeAnnotation),n}parseImportSpecifierLocal(e,t,n){t.local=Ib(e)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(t,n))}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(126)){if(!e)return!0;let t=this.lookaheadCharCode();return t===123||t===42}return!e&&this.isContextual(83)}applyImportPhase(e,t,n,r){if(super.applyImportPhase(e,t,n,r),t){if(!n&&this.match(61))return;e.exportKind=n===`type`?n:`value`}else n===`type`&&this.match(51)&&this.unexpected(),e.importKind=n===`type`||n===`typeof`?n:`value`}parseImportSpecifier(e,t,n,r,i){let a=e.imported,o=null;a.type===`Identifier`&&(a.name===`type`?o=`type`:a.name===`typeof`&&(o=`typeof`));let s=!1;if(this.isContextual(89)&&!this.isLookaheadContextual(`as`)){let t=this.parseIdentifier(!0);o!==null&&!Wy(this.state.type)?(e.imported=t,e.importKind=o,e.local=this.cloneIdentifier(t)):(e.imported=a,e.importKind=null,e.local=this.parseIdentifier())}else{if(o!==null&&Wy(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=o;else{if(t)throw this.raise(K.ImportBindingIsString,e,{importName:a.value});e.imported=a,e.importKind=null}this.eatContextual(89)?e.local=this.parseIdentifier():(s=!0,e.local=this.cloneIdentifier(e.imported))}let c=Ib(e);return n&&c&&this.raise(Pb.ImportTypeShorthandOnlyInPureImport,e),(n||c)&&this.checkReservedType(e.local.name,e.local.start,!0),s&&!n&&!c&&this.checkReservedWord(e.local.name,e.start,!0,!0),this.finishImportSpecifier(e,`ImportSpecifier`)}parseBindingAtom(){switch(this.state.type){case 74:return this.parseIdentifier(!0);default:return super.parseBindingAtom()}}parseFunctionParams(e,t){let n=e.kind;n!==`get`&&n!==`set`&&this.match(43)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(e,t)}parseVarId(e,t){super.parseVarId(e,t),this.match(10)&&(e.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,t){if(this.match(10)){let t=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,e.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=t}return super.parseAsyncArrowFromCallExpression(e,t)}shouldParseAsyncArrow(){return this.match(10)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,t){let n=null,r;if(this.hasPlugin(`jsx`)&&(this.match(138)||this.match(43))){if(n=this.state.clone(),r=this.tryParse(()=>super.parseMaybeAssign(e,t),n),!r.error)return r.node;let{context:i}=this.state,a=i[i.length-1];(a===lb.j_oTag||a===lb.j_expr)&&i.pop()}if(r?.error||this.match(43)){n||=this.state.clone();let i,a=this.tryParse(n=>{i=this.flowParseTypeParameterDeclaration();let r=this.forwardNoArrowParamsConversionAt(i,()=>{let n=super.parseMaybeAssign(e,t);return this.resetStartLocationFromNode(n,i),n});r.extra?.parenthesized&&n();let a=this.maybeUnwrapTypeCastExpression(r);return a.type!==`ArrowFunctionExpression`&&n(),a.typeParameters=i,this.resetStartLocationFromNode(a,i),r},n),o=null;if(a.node&&this.maybeUnwrapTypeCastExpression(a.node).type===`ArrowFunctionExpression`){if(!a.error&&!a.aborted)return a.node.async&&this.raise(Pb.UnexpectedTypeParameterBeforeAsyncArrowFunction,i),a.node;o=a.node}if(r?.node)return this.state=r.failState,r.node;if(o)return this.state=a.failState,o;throw r?.thrown?r.error:a.thrown?a.error:this.raise(Pb.UnexpectedTokenAfterTypeParameter,i)}return super.parseMaybeAssign(e,t)}parseArrow(e){if(this.match(10)){let t=this.tryParse(()=>{let t=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let n=this.startNode();return[n.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(!0),this.state.noAnonFunctionType=t,this.canInsertSemicolon()&&this.unexpected(),this.match(15)||this.unexpected(),n});if(t.thrown)return null;t.error&&(this.state=t.failState),e.returnType=t.node.typeAnnotation?this.finishNode(t.node,`TypeAnnotation`):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(10)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,t){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?e.params=t:super.setArrowFunctionParameters(e,t)}checkParams(e,t,n,r=!0){if(!(n&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))){for(let t=0;t<e.params.length;t++)this.isThisParam(e.params[t])&&t>0&&this.raise(Pb.ThisParamMustBeFirst,e.params[t]);super.checkParams(e,t,n,r)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(e,t,n){if(e.type===`Identifier`&&e.name===`async`&&this.state.noArrowAt.includes(t.index)){this.next();let n=this.startNodeAt(t);n.callee=e,n.arguments=super.parseCallExpressionArguments(),e=this.finishNode(n,`CallExpression`)}else if(e.type===`Identifier`&&e.name===`async`&&this.match(43)){let r=this.state.clone(),i=this.tryParse(e=>this.parseAsyncArrowWithTypeParameters(t)||e(),r);if(!i.error&&!i.aborted)return i.node;let a=this.tryParse(()=>super.parseSubscripts(e,t,n),r);if(a.node&&!a.error)return a.node;if(i.node)return this.state=i.failState,i.node;if(a.node)return this.state=a.failState,a.node;throw i.error||a.error}return super.parseSubscripts(e,t,n)}parseSubscript(e,t,n,r){if(this.match(14)&&this.isLookaheadToken_lt()){if(r.optionalChainMember=!0,n)return r.stop=!0,e;this.next();let i=this.startNodeAt(t);return i.callee=e,i.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(6),i.arguments=this.parseCallExpressionArguments(),i.optional=!0,this.finishCallExpression(i,!0)}if(!n&&this.shouldParseTypes()&&(this.match(43)||this.match(47))){let n=this.startNodeAt(t);n.callee=e;let i=this.tryParse(()=>(n.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(6),n.arguments=super.parseCallExpressionArguments(),r.optionalChainMember&&(n.optional=!1),this.finishCallExpression(n,r.optionalChainMember)));if(i.node)return i.error&&(this.state=i.failState),i.node}return super.parseSubscript(e,t,n,r)}parseNewCallee(e){super.parseNewCallee(e);let t=null;this.shouldParseTypes()&&this.match(43)&&(t=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=t}parseAsyncArrowWithTypeParameters(e){let t=this.startNodeAt(e);if(this.parseFunctionParams(t,!1),this.parseArrow(t))return super.parseArrowExpression(t,void 0,!0)}readToken_mult_modulo(e){let t=this.input.charCodeAt(this.state.pos+1);if(e===42&&t===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){let t=this.input.charCodeAt(this.state.pos+1);if(e===124&&t===125){this.finishOp(5,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,t){let n=super.parseTopLevel(e,t);return this.state.hasFlowComment&&this.raise(Pb.UnterminatedFlowComment,this.state.curPosition()),n}skipBlockComment(){if(this.hasPlugin(`flowComments`)&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(Pb.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?`*-/`:`*/`)}skipFlowComment(){let{pos:e}=this.state,t=2;for(;[32,9].includes(this.input.charCodeAt(e+t));)t++;let n=this.input.charCodeAt(t+e),r=this.input.charCodeAt(t+e+1);return n===58&&r===58?t+2:this.input.slice(t+e,t+e+12)===`flow-include`?t+12:n===58&&r!==58&&t}hasFlowCommentCompletion(){if(this.input.indexOf(`*/`,this.state.pos)===-1)throw this.raise(K.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,t){this.raise(Pb.EnumBooleanMemberNotInitialized,e,t)}flowEnumErrorInvalidMemberInitializer(e,t){return this.raise(t.explicitType?t.explicitType===`symbol`?Pb.EnumInvalidMemberInitializerSymbolType:Pb.EnumInvalidMemberInitializerPrimaryType:Pb.EnumInvalidMemberInitializerUnknownType,e,t)}flowEnumErrorNumberMemberNotInitialized(e,t){this.raise(Pb.EnumNumberMemberNotInitialized,e,t)}flowEnumErrorStringMemberInconsistentlyInitialized(e,t){this.raise(Pb.EnumStringMemberInconsistentlyInitialized,e,t)}flowEnumMemberInit(){let e=this.state.startLoc,t=()=>this.match(8)||this.match(4);switch(this.state.type){case 131:{let e=this.parseNumericLiteral(this.state.value);if(t())return{type:`number`,loc:e.start,value:e};break}case 130:{let e=this.parseStringLiteral(this.state.value);if(t())return{type:`string`,loc:e.start,value:e};break}case 81:case 82:{let e=this.parseBooleanLiteral(this.match(81));if(t())return{type:`boolean`,loc:e.start,value:e}}}return{type:`invalid`,loc:e}}flowEnumMemberRaw(){let e=this.state.startLoc;return{id:this.parseIdentifier(!0),init:this.eat(25)?this.flowEnumMemberInit():{type:`none`,loc:e}}}flowEnumCheckExplicitTypeMismatch(e,t,n){let{explicitType:r}=t;r!==null&&r!==n&&this.flowEnumErrorInvalidMemberInitializer(e,t)}flowEnumMembers({enumName:e,explicitType:t}){let n=new Set,r={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},i=!1;for(;!this.match(4);){if(this.eat(17)){i=!0;break}let a=this.startNode(),{id:o,init:s}=this.flowEnumMemberRaw(),c=o.name;if(c===``)continue;/^[a-z]/.test(c)&&this.raise(Pb.EnumInvalidMemberName,o,{memberName:c,suggestion:c[0].toUpperCase()+c.slice(1),enumName:e}),n.has(c)&&this.raise(Pb.EnumDuplicateMemberName,o,{memberName:c,enumName:e}),n.add(c);let l={enumName:e,explicitType:t,memberName:c};switch(a.id=o,s.type){case`boolean`:this.flowEnumCheckExplicitTypeMismatch(s.loc,l,`boolean`),a.init=s.value,r.booleanMembers.push(this.finishNode(a,`EnumBooleanMember`));break;case`number`:this.flowEnumCheckExplicitTypeMismatch(s.loc,l,`number`),a.init=s.value,r.numberMembers.push(this.finishNode(a,`EnumNumberMember`));break;case`string`:this.flowEnumCheckExplicitTypeMismatch(s.loc,l,`string`),a.init=s.value,r.stringMembers.push(this.finishNode(a,`EnumStringMember`));break;case`invalid`:throw this.flowEnumErrorInvalidMemberInitializer(s.loc,l);case`none`:switch(t){case`boolean`:this.flowEnumErrorBooleanMemberNotInitialized(s.loc,l);break;case`number`:this.flowEnumErrorNumberMemberNotInitialized(s.loc,l);break;default:r.defaultedMembers.push(this.finishNode(a,`EnumDefaultedMember`))}}this.match(4)||this.expect(8)}return{members:r,hasUnknownMembers:i}}flowEnumStringMembers(e,t,{enumName:n}){if(e.length===0)return t;if(t.length===0)return e;if(t.length>e.length){for(let t of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(t,{enumName:n});return t}for(let e of t)this.flowEnumErrorStringMemberInconsistentlyInitialized(e,{enumName:n});return e}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(98))return null;if(!Hy(this.state.type))throw this.raise(Pb.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:t}=this.state;return this.next(),t!==`boolean`&&t!==`number`&&t!==`string`&&t!==`symbol`&&this.raise(Pb.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:t}),t}flowEnumBody(e,t){let n=t.name,r=t.start,i=this.flowEnumParseExplicitType({enumName:n});this.expect(2);let{members:a,hasUnknownMembers:o}=this.flowEnumMembers({enumName:n,explicitType:i});switch(e.hasUnknownMembers=o,i){case`boolean`:return e.explicitType=!0,e.members=a.booleanMembers,this.expect(4),this.finishNode(e,`EnumBooleanBody`);case`number`:return e.explicitType=!0,e.members=a.numberMembers,this.expect(4),this.finishNode(e,`EnumNumberBody`);case`string`:return e.explicitType=!0,e.members=this.flowEnumStringMembers(a.stringMembers,a.defaultedMembers,{enumName:n}),this.expect(4),this.finishNode(e,`EnumStringBody`);case`symbol`:return e.members=a.defaultedMembers,this.expect(4),this.finishNode(e,`EnumSymbolBody`);default:{let t=()=>(e.members=[],this.expect(4),this.finishNode(e,`EnumStringBody`));e.explicitType=!1;let i=a.booleanMembers.length,o=a.numberMembers.length,s=a.stringMembers.length,c=a.defaultedMembers.length;if(!i&&!o&&!s&&!c)return t();if(!i&&!o)return e.members=this.flowEnumStringMembers(a.stringMembers,a.defaultedMembers,{enumName:n}),this.expect(4),this.finishNode(e,`EnumStringBody`);if(!o&&!s&&i>=c){for(let e of a.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(e.start,{enumName:n,memberName:e.id.name});return e.members=a.booleanMembers,this.expect(4),this.finishNode(e,`EnumBooleanBody`)}if(!i&&!s&&o>=c){for(let e of a.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(e.start,{enumName:n,memberName:e.id.name});return e.members=a.numberMembers,this.expect(4),this.finishNode(e,`EnumNumberBody`)}return this.raise(Pb.EnumInconsistentMemberValues,r,{enumName:n}),t()}}}flowParseEnumDeclaration(e){let t=this.parseIdentifier();return e.id=t,e.body=this.flowEnumBody(this.startNode(),t),this.finishNode(e,`EnumDeclaration`)}jsxParseOpeningElementAfterName(e){return this.shouldParseTypes()&&(this.match(43)||this.match(47))&&(e.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(e)}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let t=this.input.charCodeAt(e+1);return t!==60&&t!==61}return!1}reScan_lt_gt(){let{type:e}=this.state;e===43?(--this.state.pos,this.readToken_lt()):e===44&&(--this.state.pos,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===47?(this.state.pos-=2,this.finishOp(43,1),43):e}maybeUnwrapTypeCastExpression(e){return e.type===`TypeCastExpression`?e.expression:e}},Vb={__proto__:null,quot:`"`,amp:`&`,apos:`'`,lt:`<`,gt:`>`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,fnof:`ƒ`,circ:`ˆ`,tilde:`˜`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,bull:`•`,hellip:`…`,permil:`‰`,prime:`′`,Prime:`″`,lsaquo:`‹`,rsaquo:`›`,oline:`‾`,frasl:`⁄`,euro:`€`,image:`ℑ`,weierp:`℘`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`},Hb=/\r\n|[\r\n\u2028\u2029]/g;function Ub(e){switch(e){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function Wb(e,t,n){for(let r=t;r<n;r++)if(Ub(e.charCodeAt(r)))return!0;return!1}var Gb=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Kb=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function qb(e){switch(e){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var Jb=vy`jsx`({AttributeIsEmpty:`JSX attributes must only be assigned a non-empty expression.`,MissingClosingTagElement:({openingTagName:e})=>`Expected corresponding JSX closing tag for <${e}>.`,MissingClosingTagFragment:`Expected corresponding JSX closing tag for <>.`,UnexpectedSequenceExpression:`Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?`,UnexpectedToken:({unexpected:e,HTMLEntity:t})=>`Unexpected token \`${e}\`. Did you mean \`${t}\` or \`{'${e}'}\`?`,UnsupportedJsxValue:`JSX value should be either an expression or a quoted JSX text.`,UnterminatedJsxContent:`Unterminated JSX contents.`,UnwrappedAdjacentJSXElements:`Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?`});function Yb(e){return e?e.type===`JSXOpeningFragment`||e.type===`JSXClosingFragment`:!1}function Xb(e){if(e.type===`JSXIdentifier`)return e.name;if(e.type===`JSXNamespacedName`)return e.namespace.name+`:`+e.name.name;if(e.type===`JSXMemberExpression`)return Xb(e.object)+`.`+Xb(e.property);throw Error(`Node had unexpected type: `+e.type)}var Zb=e=>class extends e{jsxReadToken(){let e=``,t=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(Jb.UnterminatedJsxContent,this.state.startLoc);let n=this.input.charCodeAt(this.state.pos);switch(n){case 60:case 123:if(this.state.pos===this.state.start){n===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(138)):super.getTokenFromCode(n);return}e+=this.input.slice(t,this.state.pos),this.finishToken(137,e);return;case 38:e+=this.input.slice(t,this.state.pos),e+=this.jsxReadEntity(),t=this.state.pos;break;case 62:case 125:this.raise(Jb.UnexpectedToken,this.state.curPosition(),{unexpected:this.input[this.state.pos],HTMLEntity:n===125?`&rbrace;`:`&gt;`});default:Ub(n)?(e+=this.input.slice(t,this.state.pos),e+=this.jsxReadNewLine(!0),t=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let t=this.input.charCodeAt(this.state.pos),n;return++this.state.pos,t===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,n=e?`
22
+ `:`\r
23
+ `):n=String.fromCharCode(t),++this.state.curLine,this.state.lineStart=this.state.pos,n}jsxReadString(e){let t=``,n=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(K.UnterminatedString,this.state.startLoc);let r=this.input.charCodeAt(this.state.pos);if(r===e)break;r===38?(t+=this.input.slice(n,this.state.pos),t+=this.jsxReadEntity(),n=this.state.pos):Ub(r)?(t+=this.input.slice(n,this.state.pos),t+=this.jsxReadNewLine(!1),n=this.state.pos):++this.state.pos}t+=this.input.slice(n,this.state.pos++),this.finishToken(130,t)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let e=10;this.codePointAtPos(this.state.pos)===120&&(e=16,++this.state.pos);let t=this.readInt(e,void 0,!1,`bail`);if(t!==null&&t<=1114111&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(t)}else{let t=0,n=!1;for(;t++<10&&this.state.pos<this.length&&!(n=this.codePointAtPos(this.state.pos)===59);)++this.state.pos;if(n){let t=Vb[this.input.slice(e,this.state.pos)];if(++this.state.pos,t)return t}}return this.state.pos=e,`&`}jsxReadWord(){let e,t=this.state.pos;do e=this.input.charCodeAt(++this.state.pos);while(gb(e)||e===45);this.finishToken(136,this.input.slice(t,this.state.pos))}jsxParseIdentifier(){let e=this.startNode();return this.match(136)?e.name=this.state.value:Zy(this.state.type)?e.name=rb(this.state.type):this.unexpected(),this.next(),this.finishNode(e,`JSXIdentifier`)}jsxParseNamespacedName(){let e=this.state.startLoc,t=this.jsxParseIdentifier();if(!this.eat(10))return t;let n=this.startNodeAt(e);return n.namespace=t,n.name=this.jsxParseIdentifier(),this.finishNode(n,`JSXNamespacedName`)}jsxParseElementName(){let e=this.state.startLoc,t=this.jsxParseNamespacedName();if(t.type===`JSXNamespacedName`)return t;for(;this.eat(12);){let n=this.startNodeAt(e);n.object=t,n.property=this.jsxParseIdentifier(),t=this.finishNode(n,`JSXMemberExpression`)}return t}jsxParseAttributeValue(){let e;switch(this.state.type){case 2:return e=this.startNode(),this.setContext(lb.brace),this.next(),e=this.jsxParseExpressionContainer(e,lb.j_oTag),e.expression.type===`JSXEmptyExpression`&&this.raise(Jb.AttributeIsEmpty,e),e;case 138:case 130:return this.parseExprAtom();default:throw this.raise(Jb.UnsupportedJsxValue,this.state.startLoc)}}jsxParseEmptyExpression(){let e=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(e,`JSXEmptyExpression`,this.state.startLoc)}jsxParseSpreadChild(e){return this.next(),e.expression=this.parseExpression(),this.setContext(lb.j_expr),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(e,`JSXSpreadChild`)}jsxParseExpressionContainer(e,t){if(this.match(4))e.expression=this.jsxParseEmptyExpression();else{let t=this.parseExpression();t.type===`SequenceExpression`&&!t.extra?.parenthesized&&this.raise(Jb.UnexpectedSequenceExpression,t.expressions[1]),e.expression=t}return this.setContext(t),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(e,`JSXExpressionContainer`)}jsxParseAttribute(){if(this.match(2)){let e=this.startNode();return this.setContext(lb.brace),this.next(),this.expect(17),e.argument=this.parseMaybeAssignAllowIn(),this.setContext(lb.j_oTag),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(e,`JSXSpreadAttribute`)}let e=this.startNode();return e.name=this.jsxParseNamespacedName(),e.value=this.eat(25)?this.jsxParseAttributeValue():null,this.finishNode(e,`JSXAttribute`)}jsxParseOpeningElementAt(e){if(this.eat(139)){let t=this.startNodeAt(e);return this.finishNode(t,`JSXOpeningFragment`)}let t=this.startNodeAt(e);return t.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(t)}jsxParseOpeningElementAfterName(e){let t=[];for(;!this.match(52)&&!this.match(139);)t.push(this.jsxParseAttribute());return e.attributes=t,e.selfClosing=this.eat(52),this.expect(139),this.finishNode(e,`JSXOpeningElement`)}jsxParseClosingElementAt(e){if(this.eat(139)){let t=this.startNodeAt(e);return this.finishNode(t,`JSXClosingFragment`)}let t=this.startNodeAt(e);return t.name=this.jsxParseElementName(),this.expect(139),this.finishNode(t,`JSXClosingElement`)}jsxParseElementAt(e){let t=this.startNodeAt(e),n=[],r=this.jsxParseOpeningElementAt(e),i=null;if(!r.selfClosing){contents:for(;;)switch(this.state.type){case 138:if(e=this.state.startLoc,this.next(),this.eat(52)){this.setLoc(e),i=this.jsxParseClosingElementAt(e);break contents}n.push(this.jsxParseElementAt(e));break;case 137:n.push(this.parseLiteral(this.state.value,`JSXText`));break;case 2:{let e=this.startNode();this.setContext(lb.brace),this.next(),this.match(17)?n.push(this.jsxParseSpreadChild(e)):n.push(this.jsxParseExpressionContainer(e,lb.j_expr));break}default:this.unexpected()}Yb(r)&&!Yb(i)&&i!==null?this.raise(Jb.MissingClosingTagFragment,i):(!Yb(r)&&Yb(i)||!Yb(r)&&!Yb(i)&&Xb(i.name)!==Xb(r.name))&&this.raise(Jb.MissingClosingTagElement,i,{openingTagName:Xb(r.name)})}if(Yb(r)?(t.openingFragment=r,t.closingFragment=i):(t.openingElement=r,t.closingElement=i),t.children=n,this.match(43))throw this.raise(Jb.UnwrappedAdjacentJSXElements,this.state.startLoc);return Yb(r)?this.finishNode(t,`JSXFragment`):this.finishNode(t,`JSXElement`)}jsxParseElement(){let e=this.state.startLoc;return this.next(),this.jsxParseElementAt(e)}setContext(e){let{context:t}=this.state;t[t.length-1]=e}parseExprAtom(e){return this.match(138)?this.jsxParseElement():this.match(43)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(138),this.jsxParseElement()):super.parseExprAtom(e)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(e){let t=this.curContext();if(t===lb.j_expr){this.jsxReadToken();return}if(t===lb.j_oTag||t===lb.j_cTag){if(hb(e)){this.jsxReadWord();return}if(e===62){++this.state.pos,this.finishToken(139);return}if((e===34||e===39)&&t===lb.j_oTag){this.jsxReadString(e);return}}if(e===60&&this.state.canStartJSXElement&&this.input.charCodeAt(this.state.pos+1)!==33){++this.state.pos,this.finishToken(138);return}super.getTokenFromCode(e)}updateContext(e){let{context:t,type:n}=this.state;if(n===52&&e===138)t.splice(-2,2,lb.j_cTag),this.state.canStartJSXElement=!1;else if(n===138)t.push(lb.j_oTag);else if(n===139){let n=t[t.length-1];n===lb.j_oTag&&e===52||n===lb.j_cTag?(t.pop(),this.state.canStartJSXElement=t[t.length-1]===lb.j_expr):(this.setContext(lb.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=Ky(n)}},Qb=class extends kb{tsNames=new Map},$b=class extends Ab{get inTSNamespace(){let e=this.scopeStack;return e.length>=2&&e[e.length-1].flags===0&&(e[e.length-2].flags&2048)>0}importsStack=[];createScope(e){return this.importsStack.push(new Set),new Qb(e)}enter(e){e&3072&&this.importsStack.push(new Set),super.enter(e)}exit(){let e=super.exit();return e&3072&&this.importsStack.pop(),e}hasImport(e,t){let n=this.importsStack.length;if(this.importsStack[n-1].has(e))return!0;if(!t&&n>1){for(let t=0;t<n-1;t++)if(this.importsStack[t].has(e))return!0}return!1}declareName(e,t,n){if(t&4096){this.hasImport(e,!0)&&this.parser.raise(K.VarRedeclaration,n,{identifierName:e}),this.importsStack[this.importsStack.length-1].add(e);return}let r=this.currentScope(),i=r.tsNames.get(e)||0;if(t&1024){this.maybeExportDefined(r,e),r.tsNames.set(e,i|16);return}super.declareName(e,t,n),t&2&&(t&1||(this.checkRedeclarationInScope(r,e,t,n),this.maybeExportDefined(r,e)),i|=1),t&256&&(i|=2),t&512&&(i|=4),t&128&&(i|=8),i&&r.tsNames.set(e,i)}isRedeclaredInScope(e,t,n){let r=e.tsNames.get(t);return(r&2)>0?n&256?(n&512)>0!=(r&4)>0:!0:n&128&&(r&8)>0?e.names.get(t)&2?!!(n&1):!1:n&2&&(r&1)>0?!0:super.isRedeclaredInScope(e,t,n)}checkLocalExport(e){let{name:t}=e;if(this.hasImport(t))return;let n=this.scopeStack.length;for(let e=n-1;e>=0;e--){let n=this.scopeStack[e].tsNames.get(t);if((n&1)>0||(n&16)>0)return}super.checkLocalExport(e)}},ex=class{sawUnambiguousESM=!1;ambiguousScriptDifferentAst=!1;sourceToOffsetPos(e){return e+this.startIndex}offsetToSourcePos(e){return e-this.startIndex}hasPlugin(e){if(typeof e==`string`)return this.plugins.has(e);{let[t,n]=e;if(!this.hasPlugin(t))return!1;let r=this.plugins.get(t);for(let e of Object.keys(n))if(r?.[e]!==n[e])return!1;return!0}}getPluginOption(e,t){return this.plugins.get(e)?.[t]}};function tx(e,t){e.trailingComments===void 0?e.trailingComments=t:e.trailingComments.unshift(...t)}function nx(e,t){e.leadingComments===void 0?e.leadingComments=t:e.leadingComments.unshift(...t)}function rx(e,t){e.innerComments===void 0?e.innerComments=t:e.innerComments.unshift(...t)}function ix(e,t,n){let r=null,i=t.length;for(;r===null&&i>0;)r=t[--i];r===null||r.start>n.start?rx(e,n.comments):tx(r,n.comments)}var ax=class extends ex{addComment(e){this.filename&&(e.loc.filename=this.filename);let{commentsLen:t}=this.state;this.comments.length!==t&&(this.comments.length=t),this.comments.push(e),this.state.commentsLen++}processComment(e){let{commentStack:t}=this.state,n=t.length;if(n===0)return;let r=n-1,i=t[r];i.start===e.end&&(i.leadingNode=e,r--);let a=e.start;for(;r>=0;r--){let n=t[r],i=n.end;if(i>a)n.containingNode=e,this.finalizeComment(n),t.splice(r,1);else{i===a&&(n.trailingNode=e);break}}}finalizeComment(e){let{comments:t}=e;if(e.leadingNode!==null||e.trailingNode!==null)e.leadingNode!==null&&tx(e.leadingNode,t),e.trailingNode!==null&&nx(e.trailingNode,t);else{let n=e.containingNode,r=e.start;if(this.input.charCodeAt(this.offsetToSourcePos(r)-1)===44)switch(n.type){case`ObjectExpression`:case`ObjectPattern`:ix(n,n.properties,e);break;case`CallExpression`:case`NewExpression`:case`OptionalCallExpression`:ix(n,n.arguments,e);break;case`ImportExpression`:ix(n,[n.source,n.options??null],e);break;case`FunctionDeclaration`:case`FunctionExpression`:case`ArrowFunctionExpression`:case`ObjectMethod`:case`ClassMethod`:case`ClassPrivateMethod`:case`TSTypeParameterDeclaration`:ix(n,n.params,e);break;case`ArrayExpression`:case`ArrayPattern`:ix(n,n.elements,e);break;case`ExportNamedDeclaration`:case`ImportDeclaration`:ix(n,n.specifiers,e);break;case`TSEnumBody`:ix(n,n.members,e);break;case`TSInterfaceBody`:ix(n,n.body,e);break;default:rx(n,t)}else rx(n,t)}}finalizeRemainingComments(){let{commentStack:e}=this.state;for(let t=e.length-1;t>=0;t--)this.finalizeComment(e[t]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(e){let{commentStack:t}=this.state,{length:n}=t;if(n===0)return;let r=t[n-1];r.leadingNode===e&&(r.leadingNode=null)}takeSurroundingComments(e,t,n){let{commentStack:r}=this.state,i=r.length;if(i===0)return;let a=i-1;for(;a>=0;a--){let i=r[a],o=i.end;if(i.start===n)i.leadingNode=e;else if(o===t)i.trailingNode=e;else if(o<t)break}}},ox=class e{flags=2048;get strict(){return(this.flags&1)>0}set strict(e){e?this.flags|=1:this.flags&=-2}startIndex;curLine;lineStart;startLoc;endLoc;init({strictMode:e,sourceType:t,startIndex:n,startLine:r,startColumn:i}){this.strict=e===!1?!1:e===!0||t===`module`,this.startIndex=n,this.curLine=r,this.lineStart=-i,this.startLoc=this.endLoc=new ry(r,i,n)}errors=[];noArrowAt=[];noArrowParamsConversionAt=[];get canStartArrow(){return(this.flags&2)>0}set canStartArrow(e){e?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(e){e?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(e){e?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(e){e?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(e){e?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(e){e?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(e){e?this.flags|=128:this.flags&=-129}get inConditionalConsequent(){return(this.flags&256)>0}set inConditionalConsequent(e){e?this.flags|=256:this.flags&=-257}get inHackPipelineBody(){return(this.flags&512)>0}set inHackPipelineBody(e){e?this.flags|=512:this.flags&=-513}get seenTopicReference(){return(this.flags&1024)>0}set seenTopicReference(e){e?this.flags|=1024:this.flags&=-1025}labels=[];commentsLen=0;commentStack=[];pos=0;type=135;value=null;start=0;end=0;lastTokEndLoc=null;lastTokStartLoc=null;context=[lb.brace];get canStartJSXElement(){return(this.flags&2048)>0}set canStartJSXElement(e){e?this.flags|=2048:this.flags&=-2049}get containsEsc(){return(this.flags&4096)>0}set containsEsc(e){e?this.flags|=4096:this.flags&=-4097}firstInvalidTemplateEscapePos=null;get hasTopLevelAwait(){return(this.flags&8192)>0}set hasTopLevelAwait(e){e?this.flags|=8192:this.flags&=-8193}strictErrors=new Map;tokensLength=0;curPosition(){return new ry(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let t=new e;return t.flags=this.flags,t.startIndex=this.startIndex,t.curLine=this.curLine,t.lineStart=this.lineStart,t.startLoc=this.startLoc,t.endLoc=this.endLoc,t.errors=this.errors.slice(),t.noArrowAt=this.noArrowAt.slice(),t.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),t.labels=this.labels.slice(),t.commentsLen=this.commentsLen,t.commentStack=this.commentStack.slice(),t.pos=this.pos,t.type=this.type,t.value=this.value,t.start=this.start,t.end=this.end,t.lastTokEndLoc=this.lastTokEndLoc,t.lastTokStartLoc=this.lastTokStartLoc,t.context=this.context.slice(),t.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,t.strictErrors=this.strictErrors,t.tokensLength=this.tokensLength,t}},sx=function(e){return e>=48&&e<=57},cx={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},lx={bin:e=>e===48||e===49,oct:e=>e>=48&&e<=55,dec:e=>e>=48&&e<=57,hex:e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102};function ux(e,t,n,r,i,a){let o=n,s=r,c=i,l=``,u=null,d=n,{length:f}=t;for(;;){if(n>=f){a.unterminated(o,s,c),l+=t.slice(d,n);break}let p=t.charCodeAt(n);if(dx(e,p,t,n)){l+=t.slice(d,n);break}if(p===92){l+=t.slice(d,n);let o=fx(t,n,r,i,e===`template`,a);o.ch===null&&!u?u={pos:n,lineStart:r,curLine:i}:l+=o.ch,{pos:n,lineStart:r,curLine:i}=o,d=n}else p===8232||p===8233?(++n,++i,r=n):p===10||p===13?e===`template`?(l+=t.slice(d,n)+`
24
+ `,++n,p===13&&t.charCodeAt(n)===10&&++n,++i,d=r=n):a.unterminated(o,s,c):++n}return{pos:n,str:l,firstInvalidLoc:u,lineStart:r,curLine:i}}function dx(e,t,n,r){return e===`template`?t===96||t===36&&n.charCodeAt(r+1)===123:t===(e===`double`?34:39)}function fx(e,t,n,r,i,a){let o=!i;t++;let s=e=>({pos:t,ch:e,lineStart:n,curLine:r}),c=e.charCodeAt(t++);switch(c){case 110:return s(`
25
+ `);case 114:return s(`\r`);case 120:{let i;return{code:i,pos:t}=px(e,t,n,r,2,!1,o,a),s(i===null?null:String.fromCharCode(i))}case 117:{let i;return{code:i,pos:t}=hx(e,t,n,r,o,a),s(i===null?null:String.fromCodePoint(i))}case 116:return s(` `);case 98:return s(`\b`);case 118:return s(`\v`);case 102:return s(`\f`);case 13:e.charCodeAt(t)===10&&++t;case 10:n=t,++r;case 8232:case 8233:return s(``);case 56:case 57:if(i)return s(null);a.strictNumericEscape(t-1,n,r);default:if(c>=48&&c<=55){let o=t-1,c=/^[0-7]+/.exec(e.slice(o,t+2))[0],l=parseInt(c,8);l>255&&(c=c.slice(0,-1),l=parseInt(c,8)),t+=c.length-1;let u=e.charCodeAt(t);if(c!==`0`||u===56||u===57){if(i)return s(null);a.strictNumericEscape(o,n,r)}return s(String.fromCharCode(l))}return s(String.fromCharCode(c))}}function px(e,t,n,r,i,a,o,s){let c=t,l;return{n:l,pos:t}=mx(e,t,n,r,16,i,a,!1,s,!o),l===null&&(o?s.invalidEscapeSequence(c,n,r):t=c-1),{code:l,pos:t}}function mx(e,t,n,r,i,a,o,s,c,l){let u=t,d=i===16?cx.hex:cx.decBinOct,f=i===16?lx.hex:i===10?lx.dec:i===8?lx.oct:lx.bin,p=!1,m=0;for(let u=0,h=a??1/0;u<h;++u){let a=e.charCodeAt(t),u;if(a===95&&s!==`bail`){let i=e.charCodeAt(t-1),a=e.charCodeAt(t+1);if(!s){if(l)return{n:null,pos:t};c.numericSeparatorInEscapeSequence(t,n,r)}else if(Number.isNaN(a)||!f(a)||d.has(i)||d.has(a)){if(l)return{n:null,pos:t};c.unexpectedNumericSeparator(t,n,r)}++t;continue}if(u=a>=97?a-97+10:a>=65?a-65+10:sx(a)?a-48:1/0,u>=i){if(u<=9){if(l)return{n:null,pos:t};c.invalidDigit(t,n,r,i),u=0}else if(o)u=0,p=!0;else break}++t,m=m*i+u}return t===u||a!=null&&t-u!==a||p?{n:null,pos:t}:{n:m,pos:t}}function hx(e,t,n,r,i,a){let o=e.charCodeAt(t),s;if(o===123){if(++t,{code:s,pos:t}=px(e,t,n,r,e.indexOf(`}`,t)-t,!0,i,a),++t,s!==null&&s>1114111){if(i)a.invalidCodePoint(t,n,r);else return{code:null,pos:t}}}else({code:s,pos:t}=px(e,t,n,r,4,!1,i,a));return{code:s,pos:t}}function gx(e,t,n){return new ry(n,e-t,e)}var _x=new Set([103,109,115,105,121,117,100,118]),vx=class{constructor(e){let t=e.startIndex||0;this.type=e.type,this.value=e.value,this.start=t+e.start,this.end=t+e.end,this.loc=new iy(e.startLoc,e.endLoc)}},yx,bx=class extends ax{isLookahead;tokens=[];constructor(e,t){super(),this.state=new ox,this.state.init(e),this.input=t,this.length=t.length,this.comments=[],this.isLookahead=!1,(!yx||yx.length<(this.length+1)*2)&&(yx=new Uint32Array((this.length+1)*2)),this.locData=yx}setLoc(e){let t=this.offsetToSourcePos(e.index);this.locData[t*2]=e.line,this.locData[t*2+1]=e.column}getLoc(e){let t=this.offsetToSourcePos(e);return new ry(this.locData[t*2],this.locData[t*2+1],e)}pushToken(e){this.tokens.length=this.state.tokensLength,this.tokens.push(e),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.optionFlags&512&&this.pushToken(new vx(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(e){return this.match(e)?(this.next(),!0):!1}match(e){return this.state.type===e}createLookaheadState(e){return{pos:e.pos,value:null,type:e.type,start:e.start,end:e.end,context:[this.curContext()],inType:e.inType,startLoc:e.startLoc,lastTokEndLoc:e.lastTokEndLoc,curLine:e.curLine,lineStart:e.lineStart,curPosition:e.curPosition}}lookahead(){let e=this.state;this.state=this.createLookaheadState(e),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let t=this.state;return this.state=e,t}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(e){return Gb.lastIndex=e,Gb.test(this.input)?Gb.lastIndex:e}lookaheadCharCode(){return this.lookaheadCharCodeSince(this.state.pos)}lookaheadCharCodeSince(e){return this.input.charCodeAt(this.nextTokenStartSince(e))}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(e){return Kb.lastIndex=e,Kb.test(this.input)?Kb.lastIndex:e}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(e){let t=this.input.charCodeAt(e);if((t&64512)==55296&&++e<this.input.length){let n=this.input.charCodeAt(e);(n&64512)==56320&&(t=65536+((t&1023)<<10)+(n&1023))}return t}setStrict(e){this.state.strict=e,e&&(this.state.strictErrors.forEach(([e,t])=>this.raise(e,t)),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(135);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(e){let t;this.isLookahead||(t=this.state.curPosition());let n=this.state.pos,r=this.input.indexOf(e,n+2);if(r===-1)throw this.raise(K.UnterminatedComment,this.state.curPosition());for(this.state.pos=r+e.length,Hb.lastIndex=n+2;Hb.test(this.input)&&Hb.lastIndex<=r;)++this.state.curLine,this.state.lineStart=Hb.lastIndex;if(this.isLookahead)return;let i={type:`CommentBlock`,value:this.input.slice(n+2,r),start:this.sourceToOffsetPos(n),end:this.sourceToOffsetPos(r+e.length),loc:new iy(t,this.state.curPosition())};return this.optionFlags&512&&this.pushToken(i),i}skipLineComment(e){let t=this.state.pos,n;this.isLookahead||(n=this.state.curPosition());let r=this.input.charCodeAt(this.state.pos+=e);if(this.state.pos<this.length)for(;!Ub(r)&&++this.state.pos<this.length;)r=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let i=this.state.pos,a={type:`CommentLine`,value:this.input.slice(t+e,i),start:this.sourceToOffsetPos(t),end:this.sourceToOffsetPos(i),loc:new iy(n,this.state.curPosition())};return this.optionFlags&512&&this.pushToken(a),a}skipSpace(){let e=this.state.pos,t=(this.optionFlags&8192)>0,n;loop:for(;this.state.pos<this.length;){let r=this.input.charCodeAt(this.state.pos);switch(r){case 32:case 160:case 9:++this.state.pos;break;case 13:this.input.charCodeAt(this.state.pos+1)===10&&++this.state.pos;case 10:case 8232:case 8233:++this.state.pos,++this.state.curLine,this.state.lineStart=this.state.pos;break;case 47:switch(this.input.charCodeAt(this.state.pos+1)){case 42:{let e=this.skipBlockComment(`*/`);e!==void 0&&(this.addComment(e),t&&(n??=[]).push(e));break}case 47:{let e=this.skipLineComment(2);e!==void 0&&(this.addComment(e),t&&(n??=[]).push(e));break}default:break loop}break;default:if(qb(r))++this.state.pos;else if(r===45&&!this.inModule&&this.optionFlags&16384){let r=this.state.pos;if(this.input.charCodeAt(r+1)===45&&this.input.charCodeAt(r+2)===62&&(e===0||this.state.lineStart>e)){let e=this.skipLineComment(3);e!==void 0&&(this.addComment(e),t&&(n??=[]).push(e))}else break loop}else if(r===60&&!this.inModule&&this.optionFlags&16384){let e=this.state.pos;if(this.input.charCodeAt(e+1)===33&&this.input.charCodeAt(e+2)===45&&this.input.charCodeAt(e+3)===45){let e=this.skipLineComment(4);e!==void 0&&(this.addComment(e),t&&(n??=[]).push(e))}else break loop}else break loop}}if(n?.length){let t=this.state.pos,r={start:this.sourceToOffsetPos(e),end:this.sourceToOffsetPos(t),comments:n,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(r)}}finishToken(e,t){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let n=this.state.type;this.state.type=e,this.state.value=t,this.isLookahead||this.updateContext(n)}replaceToken(e){this.state.type=e,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let e=this.state.pos+1,t=this.codePointAtPos(e);if(t>=48&&t<=57)throw this.raise(K.UnexpectedDigitAfterHash,this.state.curPosition());hb(t)?(++this.state.pos,this.finishToken(134,this.readWord1(t))):t===92?(++this.state.pos,this.finishToken(134,this.readWord1())):this.finishOp(23,1)}readToken_dot(){let e=this.input.charCodeAt(this.state.pos+1);if(e>=48&&e<=57){this.readNumber(!0);return}e===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(17)):(++this.state.pos,this.finishToken(12))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(27,2):this.finishOp(52,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let e=this.input.charCodeAt(this.state.pos+1);if(e!==33)return!1;let t=this.state.pos;for(this.state.pos+=1;!Ub(e)&&++this.state.pos<this.length;)e=this.input.charCodeAt(this.state.pos);let n=this.input.slice(t+2,this.state.pos);return this.finishToken(24,n),!0}readToken_mult_modulo(e){let t=e===42?51:50,n=1,r=this.input.charCodeAt(this.state.pos+1);e===42&&r===42&&(n++,r=this.input.charCodeAt(this.state.pos+2),t=53),r===61&&!this.state.inType&&(n++,t=e===37?29:26),this.finishOp(t,n)}readToken_pipe_amp(e){let t=this.input.charCodeAt(this.state.pos+1);if(t===e){this.input.charCodeAt(this.state.pos+2)===61?this.finishOp(26,3):this.finishOp(e===124?37:38,2);return}if(e===124&&t===62){this.finishOp(35,2);return}if(t===61){this.finishOp(26,2);return}this.finishOp(e===124?39:41,1)}readToken_caret(){let e=this.input.charCodeAt(this.state.pos+1);e===61&&!this.state.inType?this.finishOp(28,2):e===94&&this.hasPlugin([`pipelineOperator`,{proposal:`hack`,topicToken:`^^`}])?(this.finishOp(33,2),this.input.codePointAt(this.state.pos)===94&&this.unexpected()):this.finishOp(40,1)}readToken_atSign(){this.input.charCodeAt(this.state.pos+1)===64&&this.hasPlugin([`pipelineOperator`,{proposal:`hack`,topicToken:`@@`}])?this.finishOp(34,2):this.finishOp(22,1)}readToken_plus_min(e){let t=this.input.charCodeAt(this.state.pos+1);if(t===e){this.finishOp(30,2);return}t===61?this.finishOp(26,2):this.finishOp(49,1)}readToken_lt(){let{pos:e}=this.state,t=this.input.charCodeAt(e+1);if(t===60){if(this.input.charCodeAt(e+2)===61){this.finishOp(26,3);return}this.finishOp(47,2);return}if(t===61){this.finishOp(45,2);return}this.finishOp(43,1)}readToken_gt(){let{pos:e}=this.state,t=this.input.charCodeAt(e+1);if(t===62){let t=this.input.charCodeAt(e+2)===62?3:2;if(this.input.charCodeAt(e+t)===61){this.finishOp(26,t+1);return}this.finishOp(48,t);return}if(t===61){this.finishOp(45,2);return}this.finishOp(44,1)}readToken_eq_excl(e){let t=this.input.charCodeAt(this.state.pos+1);if(t===61){this.finishOp(42,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(e===61&&t===62){this.state.pos+=2,this.finishToken(15);return}this.finishOp(e===61?25:31,1)}readToken_question(){let e=this.input.charCodeAt(this.state.pos+1),t=this.input.charCodeAt(this.state.pos+2);e===63?t===61?this.finishOp(26,3):this.finishOp(36,2):e===46&&!(t>=48&&t<=57)?(this.state.pos+=2,this.finishToken(14)):(++this.state.pos,this.finishToken(13))}getTokenFromCode(e){switch(e){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(6);return;case 41:++this.state.pos,this.finishToken(7);return;case 59:++this.state.pos,this.finishToken(9);return;case 44:++this.state.pos,this.finishToken(8);return;case 91:++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(1);return;case 123:++this.state.pos,this.finishToken(2);return;case 125:++this.state.pos,this.finishToken(4);return;case 58:this.hasPlugin(`functionBind`)&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(11,2):(++this.state.pos,this.finishToken(10));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let e=this.input.charCodeAt(this.state.pos+1);if(e===120||e===88){this.readRadixNumber(16);return}if(e===111||e===79){this.readRadixNumber(8);return}if(e===98||e===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(e);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(e);return;case 124:case 38:this.readToken_pipe_amp(e);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(e);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(e);return;case 126:this.finishOp(32,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(hb(e)){this.readWord(e);return}}throw this.raise(K.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(e)})}finishOp(e,t){let n=this.input.slice(this.state.pos,this.state.pos+t);this.state.pos+=t,this.finishToken(e,n)}readRegexp(){let e=this.state.startLoc,t=this.state.start+1,n,r,{pos:i}=this.state;for(;;++i){if(i>=this.length)throw this.raise(K.UnterminatedRegExp,ay(e,1));let t=this.input.charCodeAt(i);if(Ub(t))throw this.raise(K.UnterminatedRegExp,ay(e,1));if(n)n=!1;else{if(t===91)r=!0;else if(t===93&&r)r=!1;else if(t===47&&!r)break;n=t===92}}let a=this.input.slice(t,i);++i;let o=``,s=()=>ay(e,i+2-t);for(;i<this.length;){let e=this.codePointAtPos(i),t=String.fromCharCode(e);if(_x.has(e))e===118?o.includes(`u`)&&this.raise(K.IncompatibleRegExpUVFlags,s()):e===117&&o.includes(`v`)&&this.raise(K.IncompatibleRegExpUVFlags,s()),o.includes(t)&&this.raise(K.DuplicateRegExpFlags,s());else if(gb(e)||e===92)this.raise(K.MalformedRegExpFlags,s());else break;++i,o+=t}this.state.pos=i,this.finishToken(133,{pattern:a,flags:o})}readInt(e,t,n=!1,r=!0){let{n:i,pos:a}=mx(this.input,this.state.pos,this.state.lineStart,this.state.curLine,e,t,n,r,this.errorHandlers_readInt,!1);return this.state.pos=a,i}readRadixNumber(e){let t=this.state.pos,n=this.state.curPosition(),r=!1;this.state.pos+=2;let i=this.readInt(e);if(i??this.raise(K.InvalidDigit,ay(n,2),{radix:e}),this.input.charCodeAt(this.state.pos)===110&&(++this.state.pos,r=!0),hb(this.codePointAtPos(this.state.pos)))throw this.raise(K.NumberIdentifier,this.state.curPosition());if(r){let e=this.input.slice(t,this.state.pos).replace(/[_n]/g,``);this.finishToken(132,e);return}this.finishToken(131,i)}readNumber(e){let t=this.state.pos,n=this.state.curPosition(),r=!1,i=!1,a=!1;!e&&this.readInt(10)===null&&this.raise(K.InvalidNumber,this.state.curPosition());let o=this.state.pos-t>=2&&this.input.charCodeAt(t)===48;if(o){let e=this.input.slice(t,this.state.pos);if(this.recordStrictModeErrors(K.StrictOctalLiteral,n),!this.state.strict){let t=e.indexOf(`_`);t>0&&this.raise(K.ZeroDigitNumericSeparator,ay(n,t))}a=o&&!/[89]/.test(e)}let s=this.input.charCodeAt(this.state.pos);s===46&&!a&&(++this.state.pos,this.readInt(10),r=!0,s=this.input.charCodeAt(this.state.pos)),(s===69||s===101)&&!a&&(s=this.input.charCodeAt(++this.state.pos),(s===43||s===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(K.InvalidOrMissingExponent,n),r=!0,s=this.input.charCodeAt(this.state.pos));let c=this.input.slice(t,this.state.pos).replaceAll(`_`,``);if(s===110&&((r||o)&&this.raise(K.InvalidBigIntLiteral,n),++this.state.pos,i=!0),hb(this.codePointAtPos(this.state.pos)))throw this.raise(K.NumberIdentifier,this.state.curPosition());if(i){this.finishToken(132,c);return}let l=a?parseInt(c,8):parseFloat(c);this.finishToken(131,l)}readCodePoint(e){let{code:t,pos:n}=hx(this.input,this.state.pos,this.state.lineStart,this.state.curLine,e,this.errorHandlers_readCodePoint);return this.state.pos=n,t}readString(e){let{str:t,pos:n,curLine:r,lineStart:i}=ux(e===34?`double`:`single`,this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=n+1,this.state.lineStart=i,this.state.curLine=r,this.finishToken(130,t)}readTemplateContinuation(){this.match(4)||this.unexpected(null,4),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let e=this.input[this.state.pos],{str:t,firstInvalidLoc:n,pos:r,curLine:i,lineStart:a}=ux(`template`,this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=r+1,this.state.lineStart=a,this.state.curLine=i,n&&(this.state.firstInvalidTemplateEscapePos=new ry(n.curLine,n.pos-n.lineStart,this.sourceToOffsetPos(n.pos))),this.input.codePointAt(r)===96?this.finishToken(20,n?null:e+t+"`"):(this.state.pos++,this.finishToken(21,n?null:e+t+"${"))}recordStrictModeErrors(e,t){let n=t.index;this.state.strict&&!this.state.strictErrors.has(n)?this.raise(e,t):this.state.strictErrors.set(n,[e,t])}readWord1(e){this.state.containsEsc=!1;let t=``,n=this.state.pos,r=this.state.pos;for(e!==void 0&&(this.state.pos+=e<=65535?1:2);this.state.pos<this.length;){let e=this.codePointAtPos(this.state.pos);if(gb(e))this.state.pos+=e<=65535?1:2;else if(e===92){this.state.containsEsc=!0,t+=this.input.slice(r,this.state.pos);let e=this.state.curPosition(),i=this.state.pos===n?hb:gb;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(K.MissingUnicodeEscape,this.state.curPosition()),r=this.state.pos-1;continue}++this.state.pos;let a=this.readCodePoint(!0);a!==null&&(i(a)||this.raise(K.EscapedCharNotAnIdentifier,e),t+=String.fromCodePoint(a)),r=this.state.pos}else break}return t+this.input.slice(r,this.state.pos)}readWord(e){let t=this.readWord1(e),n=ky.get(t);n===void 0?this.finishToken(128,t):this.finishToken(n,rb(n))}checkKeywordEscapes(){let{type:e}=this.state;Zy(e)&&this.state.containsEsc&&this.raise(K.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:rb(e)})}raise(e,t,n={}){let r=t instanceof ry?t:typeof t==`number`?this.getLoc(t):this.optionFlags&256?t.loc.start:this.getLoc(t.start),i=e(r,t instanceof ry?r.index:typeof t==`number`?t:t.start,n);if(!(this.optionFlags&4096))throw i;return this.isLookahead||this.state.errors.push(i),i}raiseOverwrite(e,t,n={}){let r=t instanceof ry?t:this.optionFlags&256?t.loc.start:this.getLoc(t.start),i=t instanceof ry?r.index:t.start,a=this.state.errors;for(let t=a.length-1;t>=0;t--){let o=a[t];if(o.pos===i)return a[t]=e(r,i,n);if(o.pos<i)break}return this.raise(e,r,n)}updateContext(e){}unexpected(e,t){throw this.raise(K.UnexpectedToken,e??this.state.startLoc,{expected:t?rb(t):null})}expectPlugin(e,t){if(this.hasPlugin(e))return!0;throw this.raise(K.MissingPlugin,t??this.state.startLoc,{missingPlugin:[e]})}expectOnePlugin(e){if(!e.some(e=>this.hasPlugin(e)))throw this.raise(K.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:e})}errorBuilder(e){return(t,n,r)=>{this.raise(e,gx(t,n,r))}}errorHandlers_readInt={invalidDigit:(e,t,n,r)=>{this.raise(K.InvalidDigit,gx(e,t,n),{radix:r})},numericSeparatorInEscapeSequence:this.errorBuilder(K.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(K.UnexpectedNumericSeparator)};errorHandlers_readCodePoint={...this.errorHandlers_readInt,invalidEscapeSequence:this.errorBuilder(K.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(K.InvalidCodePoint)};errorHandlers_readStringContents_string={...this.errorHandlers_readCodePoint,strictNumericEscape:(e,t,n)=>{this.recordStrictModeErrors(K.StrictNumericEscape,gx(e,t,n))},unterminated:(e,t,n)=>{throw this.raise(K.UnterminatedString,gx(e-1,t,n))}};errorHandlers_readStringContents_template={...this.errorHandlers_readCodePoint,strictNumericEscape:this.errorBuilder(K.StrictNumericEscape),unterminated:(e,t,n)=>{throw this.raise(K.UnterminatedTemplate,gx(e,t,n))}}},xx=class{privateNames=new Set;loneAccessors=new Map;undefinedPrivateNames=new Map},Sx=class{parser;stack=[];constructor(e){this.parser=e}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new xx)}exit(){let e=this.stack.pop(),t=this.current();for(let[n,r]of Array.from(e.undefinedPrivateNames))t?t.undefinedPrivateNames.has(n)||t.undefinedPrivateNames.set(n,r):this.parser.raise(K.InvalidPrivateFieldResolution,r,{identifierName:n})}declarePrivateName(e,t,n){let{privateNames:r,loneAccessors:i,undefinedPrivateNames:a}=this.current(),o=r.has(e);if(t&3){let n=o&&i.get(e);if(n){let r=n&4,a=t&4;o=(n&3)==(t&3)||r!==a,o||i.delete(e)}else o||i.set(e,t)}o&&this.parser.raise(K.PrivateNameRedeclaration,n,{identifierName:e}),r.add(e),a.delete(e)}usePrivateName(e,t){let n;for(n of this.stack)if(n.privateNames.has(e))return;n?n.undefinedPrivateNames.set(e,t):this.parser.raise(K.InvalidPrivateFieldResolution,t,{identifierName:e})}},Cx=class{constructor(e=0){this.type=e}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},wx=class extends Cx{declarationErrors=new Map;constructor(e){super(e)}recordDeclarationError(e,t){this.declarationErrors.set(t,e)}clearDeclarationError(e){this.declarationErrors.delete(e)}iterateErrors(e){this.declarationErrors.forEach(e)}},Tx=class{parser;stack=[new Cx];constructor(e){this.parser=e}enter(e){this.stack.push(e)}exit(){this.stack.pop()}recordParameterInitializerError(e,t){let{stack:n}=this,r=n.length-1,i=n[r];for(;!i.isCertainlyParameterDeclaration();){if(i.canBeArrowParameterDeclaration())i.recordDeclarationError(e,t);else return;i=n[--r]}this.parser.raise(e,t)}recordArrowParameterBindingError(e,t){let{stack:n}=this,r=n[n.length-1],i=t.start;if(r.isCertainlyParameterDeclaration())this.parser.raise(e,i);else if(r.canBeArrowParameterDeclaration())r.recordDeclarationError(e,i);else return}recordAsyncArrowParametersError(e){let{stack:t}=this,n=t.length-1,r=t[n];for(;r.canBeArrowParameterDeclaration();)r.type===2&&r.recordDeclarationError(K.AwaitBindingIdentifier,e),r=t[--n]}validateAsPattern(){let{stack:e}=this,t=e[e.length-1];t.canBeArrowParameterDeclaration()&&t.iterateErrors((t,n)=>{this.parser.raise(t,n);let r=e.length-2,i=e[r];for(;i.canBeArrowParameterDeclaration();)i.clearDeclarationError(n),i=e[--r]})}};function Ex(){return new Cx(3)}function Dx(){return new wx(1)}function Ox(){return new wx(2)}function kx(){return new Cx}var Ax=class{stacks=[];enter(e){this.stacks.push(e)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}get inFSharpPipelineDirectBody(){return!(this.currentFlags()&16)}};function jx(e,t){return(e?2:0)|!!t}var Mx=class extends bx{addExtra(e,t,n,r=!0){if(!e)return;let{extra:i}=e;i??(i={},e.extra=i),r?i[t]=n:Object.defineProperty(i,t,{enumerable:r,value:n})}isContextual(e){return this.state.type===e&&!this.state.containsEsc}isUnparsedContextual(e,t){if(this.input.startsWith(t,e)){let n=this.input.charCodeAt(e+t.length);return!(gb(n)||(n&64512)==55296)}return!1}isLookaheadContextual(e){let t=this.nextTokenStart();return this.isUnparsedContextual(t,e)}eatContextual(e){return this.isContextual(e)?(this.next(),!0):!1}expectContextual(e,t){if(!this.eatContextual(e)){if(t!=null)throw this.raise(t,this.state.startLoc);this.unexpected(null,e)}}canInsertSemicolon(){return this.match(135)||this.match(4)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return Wb(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return Wb(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(9)||this.canInsertSemicolon()}semicolon(e=!0){(e?this.isLineTerminator():this.eat(9))||this.raise(K.MissingSemicolon,this.state.lastTokEndLoc)}expect(e,t){this.eat(e)||this.unexpected(t,e)}tryParse(e,t=this.state.clone()){let n={node:null};try{let r=e((e=null)=>{throw n.node=e,n});if(this.state.errors.length>t.errors.length){let e=this.state;return this.state=t,this.state.tokensLength=e.tokensLength,{node:r,error:e.errors[t.errors.length],thrown:!1,aborted:!1,failState:e}}return{node:r,error:null,thrown:!1,aborted:!1,failState:null}}catch(e){let r=this.state;if(this.state=t,e instanceof SyntaxError)return{node:null,error:e,thrown:!0,aborted:!1,failState:r};if(e===n)return{node:n.node,error:null,thrown:!1,aborted:!0,failState:r};throw e}}checkExpressionErrors(e,t){if(!e)return!1;let{shorthandAssignLoc:n,doubleProtoLoc:r,privateKeyLoc:i,optionalParametersLoc:a,voidPatternLoc:o}=e,s=!!n||!!r||!!a||!!i||!!o;if(!t)return s;n!=null&&this.raise(K.InvalidCoverInitializedName,n),r!=null&&this.raise(K.DuplicateProto,r),i!=null&&this.raise(K.UnexpectedPrivateField,i),a!=null&&this.unexpected(a),o!=null&&this.raise(K.InvalidCoverDiscardElement,o)}isLiteralPropertyName(){return Gy(this.state.type)}isPrivateName(e){return e.type===`PrivateName`}getPrivateNameSV(e){return e.id.name}hasPropertyAsPrivateName(e){return(e.type===`MemberExpression`||e.type===`OptionalMemberExpression`)&&this.isPrivateName(e.property)}isObjectProperty(e){return e.type===`ObjectProperty`}isObjectMethod(e){return e.type===`ObjectMethod`}initializeScopes(e=this.options.sourceType===`module`){let t=this.state.labels;this.state.labels=[];let n=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let r=this.inModule;this.inModule=e;let i=this.scope,a=this.getScopeHandler();this.scope=new a(this,e);let o=this.prodParam;this.prodParam=new Ax;let s=this.classScope;this.classScope=new Sx(this);let c=this.expressionScope;return this.expressionScope=new Tx(this),()=>{this.state.labels=t,this.exportedIdentifiers=n,this.inModule=r,this.scope=i,this.prodParam=o,this.classScope=s,this.expressionScope=c}}enterInitialScopes(){let e=0;(this.inModule||this.optionFlags&1)&&(e|=2),this.optionFlags&32&&(e|=1);let t=!this.inModule&&this.options.sourceType===`commonjs`;(t||this.optionFlags&2)&&(e|=4),this.prodParam.enter(e);let n=t?514:1;this.optionFlags&4&&(n|=512),this.optionFlags&16&&(n|=48),this.scope.enter(n)}checkDestructuringPrivate(e){let{privateKeyLoc:t}=e;t!==null&&this.expectPlugin(`destructuringPrivate`,t)}},Nx=class{shorthandAssignLoc=null;doubleProtoLoc=null;privateKeyLoc=null;optionalParametersLoc=null;voidPatternLoc=null},Px=class{constructor(e,t,n,r){this.start=n,this.end=0,r!==void 0&&(this.loc=new iy(r)),e&128&&(this.range=[n,0]),r!==void 0&&t&&(this.loc.filename=t)}type=``},Fx=Px.prototype,Ix=class extends Mx{createPosition(e){return e}startNode(){let{startLoc:e}=this.state;return this.setLoc(e),this.startNodeAt(e)}startNodeAt(e){let{optionFlags:t,filename:n}=this;return t&256?new Px(t,n,e.index,this.createPosition(e)):new Px(t,n,e.index)}startNodeAtNode(e){let{optionFlags:t,filename:n}=this;return t&256?new Px(t,n,e.start,e.loc.start):new Px(t,n,e.start)}finishNode(e,t){return this.finishNodeAt(e,t,this.state.lastTokEndLoc)}finishNodeAt(e,t,n){e.type=t,e.end=n.index;let{optionFlags:r}=this;return r&256&&(e.loc.end=this.createPosition(n)),r&128&&(e.range[1]=n.index),r&8192&&this.processComment(e),e}finishNodeAtNode(e,t,n){e.type=t,e.end=n.end;let{optionFlags:r}=this;return r&256&&(e.loc.end=n.loc.end),r&128&&(e.range[1]=e.end),r&8192&&this.processComment(e),e}resetStartLocation(e,t){e.start=t.index;let{optionFlags:n}=this;n&256&&(e.loc.start=this.createPosition(t)),n&128&&(e.range[0]=t.index)}resetEndLocation(e,t=this.state.lastTokEndLoc){e.end=t.index;let{optionFlags:n}=this;n&256&&(e.loc.end=this.createPosition(t)),n&128&&(e.range[1]=t.index)}resetStartLocationFromNode(e,t){e.start=t.start;let{optionFlags:n}=this;n&256&&(e.loc.start=t.loc.start),n&128&&(e.range[0]=t.start)}resetEndLocationFromNode(e,t){e.end=t.end;let{optionFlags:n}=this;n&256&&(e.loc.end=t.loc.end),n&128&&(e.range[1]=t.end)}castNodeTo(e,t){return e.type=t,e}cloneIdentifier(e){let{type:t,start:n,end:r,loc:i,range:a,name:o}=e,s=Object.create(Fx);return s.type=t,s.start=n,s.end=r,s.loc=i,s.range=a,s.name=o,e.extra&&(s.extra=e.extra),s}cloneStringLiteral(e){let{type:t,start:n,end:r,loc:i,range:a,extra:o}=e,s=Object.create(Fx);return s.type=t,s.start=n,s.end=r,s.loc=i,s.range=a,s.extra=o,s.value=e.value,s}},Lx=e=>e.type===`ParenthesizedExpression`?Lx(e.expression):e,Rx=class extends Ix{toAssignable(e,t=!1){let n;switch((e.type===`ParenthesizedExpression`||e.extra?.parenthesized)&&(n=Lx(e),t?n.type===`Identifier`?this.expressionScope.recordArrowParameterBindingError(K.InvalidParenthesizedAssignment,e):n.type!==`CallExpression`&&n.type!==`MemberExpression`&&!this.isOptionalMemberExpression(n)&&this.raise(K.InvalidParenthesizedAssignment,e):this.raise(K.InvalidParenthesizedAssignment,e)),e.type){case`Identifier`:case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:case`VoidPattern`:break;case`ObjectExpression`:this.castNodeTo(e,`ObjectPattern`);for(let n=0,r=e.properties.length,i=r-1;n<r;n++){let r=e.properties[n],a=n===i;this.toAssignableObjectExpressionProp(r,a,t),a&&r.type===`RestElement`&&e.extra?.trailingCommaLoc&&this.raise(K.RestTrailingComma,e.extra.trailingCommaLoc)}break;case`ObjectProperty`:{let{key:n,value:r}=e;this.isPrivateName(n)&&this.classScope.usePrivateName(this.getPrivateNameSV(n),n.start),this.toAssignable(r,t);break}case`SpreadElement`:throw Error(`Internal @babel/parser error (this is a bug, please report it). SpreadElement should be converted by .toAssignable's caller.`);case`ArrayExpression`:this.castNodeTo(e,`ArrayPattern`),this.toAssignableList(e.elements,e.extra?.trailingCommaLoc,t);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(K.MissingEqInAssignment,this.optionFlags&256?e.left.loc.end:e.left),this.castNodeTo(e,`AssignmentPattern`),delete e.operator,e.left.type===`VoidPattern`&&this.raise(K.VoidPatternInitializer,e.left),this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(n,t)}}toAssignableObjectExpressionProp(e,t,n){if(e.type===`ObjectMethod`)this.raise(e.kind===`get`||e.kind===`set`?K.PatternHasAccessor:K.PatternHasMethod,e.key);else if(e.type===`SpreadElement`){this.castNodeTo(e,`RestElement`);let r=e.argument;this.checkToRestConversion(r,!1),this.toAssignable(r,n),t||this.raise(K.RestTrailingComma,e)}else this.toAssignable(e,n)}toAssignableList(e,t,n){let r=e.length-1;for(let i=0;i<=r;i++){let a=e[i];a&&(this.toAssignableListItem(e,i,n),a.type===`RestElement`&&(i<r?this.raise(K.RestTrailingComma,a):t&&this.raise(K.RestTrailingComma,t)))}}toAssignableListItem(e,t,n){let r=e[t];if(r.type===`SpreadElement`){this.castNodeTo(r,`RestElement`);let e=r.argument;this.checkToRestConversion(e,!0),this.toAssignable(e,n)}else this.toAssignable(r,n)}isAssignable(e,t){switch(e.type){case`Identifier`:case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:case`VoidPattern`:return!0;case`ObjectExpression`:{let t=e.properties.length-1;return e.properties.every((e,n)=>e.type!==`ObjectMethod`&&(n===t||e.type!==`SpreadElement`)&&this.isAssignable(e))}case`ObjectProperty`:return this.isAssignable(e.value);case`SpreadElement`:return this.isAssignable(e.argument);case`ArrayExpression`:return e.elements.every(e=>e===null||this.isAssignable(e));case`AssignmentExpression`:return e.operator===`=`;case`ParenthesizedExpression`:return this.isAssignable(e.expression);case`MemberExpression`:case`OptionalMemberExpression`:return!t;default:return!1}}toReferencedList(e,t){return e}parseSpread(e){let t=this.startNode();return this.next(),t.argument=this.parseMaybeAssignAllowIn(e),this.finishNode(t,`SpreadElement`)}parseRestBinding(){let e=this.startNode();this.next();let t=this.parseBindingAtom();return t.type===`VoidPattern`&&this.raise(K.UnexpectedVoidPattern,t),e.argument=t,this.finishNode(e,`RestElement`)}parseBindingAtom(){switch(this.state.type){case 0:{let e=this.startNode();return this.next(),e.elements=this.parseBindingList(1,93,1),this.finishNode(e,`ArrayPattern`)}case 2:return this.parseObjectLike(4,!0);case 84:return this.parseVoidPattern(null)}return this.parseIdentifier()}parseBindingList(e,t,n){let r=n&1,i=[],a=!0;for(;!this.eat(e);)if(a?a=!1:this.expect(8),r&&this.match(8))i.push(null);else if(this.eat(e))break;else if(this.match(17)){let r=this.parseRestBinding();if(n&2&&(r=this.parseFunctionParamType(r)),i.push(r),!this.checkCommaAfterRest(t)){this.expect(e);break}}else{let e=[];if(n&2)for(this.match(22)&&this.hasPlugin(`decorators`)&&this.raise(K.UnsupportedParameterDecorator,this.state.startLoc);this.match(22);)e.push(this.parseDecorator());i.push(this.parseBindingElement(n,e))}return i}parseBindingRestProperty(e){return this.next(),this.hasPlugin(`discardBinding`)&&this.match(84)?(e.argument=this.parseVoidPattern(null),this.raise(K.UnexpectedVoidPattern,e.argument)):e.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(e,`RestElement`)}parseBindingProperty(){let{type:e,startLoc:t}=this.state;if(e===17)return this.parseBindingRestProperty(this.startNode());let n=this.startNode();return e===134?(this.expectPlugin(`destructuringPrivate`,t),this.classScope.usePrivateName(this.state.value,t),n.key=this.parsePrivateName()):this.parsePropertyName(n),n.method=!1,this.parseObjPropValue(n,t,!1,!1,!0,!1)}parseBindingElement(e,t){let{startLoc:n}=this.state,r=this.parseMaybeDefault();return e&2&&this.parseFunctionParamType(r),t.length&&(r.decorators=t,this.resetStartLocationFromNode(r,t[0])),this.parseMaybeDefault(n,r)}parseFunctionParamType(e){return e}parseMaybeDefault(e,t){if(e??=this.state.startLoc,t??=this.parseBindingAtom(),!this.eat(25))return t;let n=this.startNodeAt(e);return t.type===`VoidPattern`&&this.raise(K.VoidPatternInitializer,t),n.left=t,n.right=this.parseMaybeAssignAllowIn(),this.finishNode(n,`AssignmentPattern`)}isValidLVal(e,t,n,r){switch(e){case`AssignmentPattern`:return`left`;case`RestElement`:return`argument`;case`ObjectProperty`:return`value`;case`ParenthesizedExpression`:return`expression`;case`ArrayPattern`:return`elements`;case`ObjectPattern`:return`properties`;case`VoidPattern`:return!0;case`CallExpression`:if(!t&&!this.state.strict&&this.optionFlags&16384)return!0}return!1}isOptionalMemberExpression(e){return e.type===`OptionalMemberExpression`}checkLVal(e,t,n=64,r=!1,i=!1,a=!1,o=!1){let s=e.type;if(this.isObjectMethod(e))return;let c=this.isOptionalMemberExpression(e);if(c||s===`MemberExpression`){c&&(this.expectPlugin(`optionalChainingAssign`,e.start),t.type!==`AssignmentExpression`&&this.raise(K.InvalidLhsOptionalChaining,e,{ancestor:t})),n!==64&&this.raise(K.InvalidPropertyBindingPattern,e);return}if(s===`Identifier`){this.checkIdentifier(e,n,i);let{name:t}=e;r&&(r.has(t)?this.raise(K.ParamDupe,e):r.add(t));return}s===`VoidPattern`&&t.type===`CatchClause`&&this.raise(K.VoidPatternCatchClauseParam,e);let l=Lx(e);o||=l.type===`CallExpression`&&(l.callee.type===`Import`||l.callee.type===`Super`);let u=this.isValidLVal(s,o,!(a||e.extra?.parenthesized)&&t.type===`AssignmentExpression`,n);if(u===!0)return;if(u===!1){let r=n===64?K.InvalidLhs:K.InvalidLhsBinding;this.raise(r,e,{ancestor:t});return}let d,f;typeof u==`string`?(d=u,f=s===`ParenthesizedExpression`):[d,f]=u;let p=s===`ArrayPattern`||s===`ObjectPattern`?{type:s}:t,m=e[d];if(Array.isArray(m))for(let e of m)e&&this.checkLVal(e,p,n,r,i,f,!0);else m&&this.checkLVal(m,p,n,r,i,f,o)}checkIdentifier(e,t,n=!1){this.state.strict&&(n?wb(e.name,this.inModule):Cb(e.name))&&(t===64?this.raise(K.StrictEvalArguments,e,{referenceName:e.name}):this.raise(K.StrictEvalArgumentsBinding,e,{bindingName:e.name})),t&8192&&e.name===`let`&&this.raise(K.LetInLexicalBinding,e),t&64||this.declareNameFromIdentifier(e,t)}declareNameFromIdentifier(e,t){this.scope.declareName(e.name,t,e.start)}checkToRestConversion(e,t){switch(e.type){case`ParenthesizedExpression`:this.checkToRestConversion(e.expression,t);break;case`Identifier`:case`MemberExpression`:break;case`ArrayExpression`:case`ObjectExpression`:if(t)break;default:this.raise(K.InvalidRestAssignmentPattern,e)}}checkCommaAfterRest(e){return this.match(8)?(this.raise(this.lookaheadCharCode()===e?K.RestTrailingComma:K.ElementAfterRest,this.state.startLoc),!0):!1}},zx=class extends Rx{checkProto(e,t,n){if(e.type===`SpreadElement`||this.isObjectMethod(e)||e.computed||e.shorthand)return t;let r=e.key;return(r.type===`Identifier`?r.name:r.value)===`__proto__`?(t&&(n?n.doubleProtoLoc===null&&(n.doubleProtoLoc=this.getLoc(r.start)):this.raise(K.DuplicateProto,r)),!0):t}shouldExitDescending(e){return e.type===`ArrowFunctionExpression`&&!e.extra?.parenthesized}getExpression(){if(this.enterInitialScopes(),this.nextToken(),this.match(135))throw this.raise(K.ParseExpressionEmptyInput,this.state.startLoc);let e=this.parseExpression();if(!this.match(135))throw this.raise(K.ParseExpressionExpectsEOF,this.state.startLoc,{unexpected:this.input.codePointAt(this.state.start)});return this.finalizeRemainingComments(),e.comments=this.comments,e.errors=this.state.errors,this.optionFlags&512&&(e.tokens=Wx(this.tokens)),e}parseExpression(e,t){return e?this.disallowInAnd(()=>this.parseExpressionBase(t)):this.allowInAnd(()=>this.parseExpressionBase(t))}parseExpressionBase(e){let t=this.state.startLoc,n=this.parseMaybeAssign(e);if(this.match(8)){let r=this.startNodeAt(t);for(r.expressions=[n];this.eat(8);)r.expressions.push(this.parseMaybeAssign(e));return this.toReferencedList(r.expressions),this.finishNode(r,`SequenceExpression`)}return n}parseMaybeAssignDisallowIn(e){return this.disallowInAnd(()=>this.parseMaybeAssign(e))}parseMaybeAssignAllowIn(e,t){return this.allowInAnd(()=>this.parseMaybeAssign(e,t))}setOptionalParametersError(e){e.optionalParametersLoc=this.state.startLoc}parseMaybeAssign(e,t){let n=this.state.startLoc,r=this.isContextual(104);if(r&&this.prodParam.hasYield){this.next();let e=this.parseYield(n);return t&&(e=this.parseParenItem(e,n)),e}let i;e?i=!1:(e=new Nx,i=!0),this.state.canStartArrow=!0;let a=this.parseMaybeConditional(e);if(t&&(a=this.parseParenItem(a,n)),Jy(this.state.type)){let t=this.startNodeAt(n),r=this.state.value;if(t.operator=r,this.match(25)){this.toAssignable(a,!0),t.left=a;let r=n.index;e.doubleProtoLoc!=null&&e.doubleProtoLoc.index>=r&&(e.doubleProtoLoc=null),e.shorthandAssignLoc!=null&&e.shorthandAssignLoc.index>=r&&(e.shorthandAssignLoc=null),e.privateKeyLoc!=null&&e.privateKeyLoc.index>=r&&(this.checkDestructuringPrivate(e),e.privateKeyLoc=null),e.voidPatternLoc!=null&&e.voidPatternLoc.index>=r&&(e.voidPatternLoc=null)}else t.left=a;return this.next(),t.right=this.parseMaybeAssign(),this.checkLVal(a,this.finishNode(t,`AssignmentExpression`),void 0,void 0,void 0,void 0,r===`||=`||r===`&&=`||r===`??=`),t}if(i&&this.checkExpressionErrors(e,!0),r){let{type:e}=this.state;if((this.hasPlugin(`v8intrinsic`)?qy(e):qy(e)&&!this.match(50))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(K.YieldNotInGeneratorFunction,n),this.parseYield(n)}return a}parseMaybeConditional(e){let t=this.state.startLoc,n=this.parseExprOps(e);return this.shouldExitDescending(n)?n:this.parseConditional(n,t,e)}parseConditional(e,t,n){if(this.eat(13)){let n=this.startNodeAt(t);return n.test=e,n.consequent=this.parseMaybeAssignAllowIn(),this.expect(10),n.alternate=this.parseMaybeAssign(),this.finishNode(n,`ConditionalExpression`)}return e}parseMaybeUnaryOrPrivate(e){return this.match(134)?this.parsePrivateName():this.parseMaybeUnary(e)}parseExprOps(e){let t=this.state.startLoc,n=this.parseMaybeUnaryOrPrivate(e);return this.shouldExitDescending(n)?n:(this.state.canStartArrow=!1,this.parseExprOp(n,t,-1))}parseExprOp(e,t,n){if(this.isPrivateName(e)){let r=this.getPrivateNameSV(e);(n>=ib(54)||!this.prodParam.hasIn||!this.match(54))&&this.raise(K.PrivateInExpectedIn,t,{identifierName:r}),this.classScope.usePrivateName(r,t)}let r=this.state.type;if(Qy(r)&&(this.prodParam.hasIn||!this.match(54))){let i=ib(r);if(i>n){if(r===35&&(this.expectPlugin(`pipelineOperator`),this.prodParam.inFSharpPipelineDirectBody))return e;let a=this.startNodeAt(t);a.left=e,a.operator=this.state.value;let o=r===37||r===38,s=r===36;s&&(i=ib(38)),this.next(),a.right=this.parseExprOpRightExpr(r,i);let c=this.finishNode(a,o||s?`LogicalExpression`:`BinaryExpression`),l=this.state.type;if(s&&(l===37||l===38)||o&&l===36)throw this.raise(K.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(c,t,n)}}return e}parseExprOpRightExpr(e,t){switch(e){case 35:switch(this.getPluginOption(`pipelineOperator`,`proposal`)){case`hack`:return this.withTopicBindingContext(()=>this.parseHackPipeBody());case`fsharp`:return this.parseFSharpPipelineBody(t)}default:return this.parseExprOpBaseRightExpr(e,t)}}parseExprOpBaseRightExpr(e,t){let n=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),n,ab(e)?t-1:t)}parseHackPipeBody(){let{startLoc:e}=this.state,t=this.parseMaybeAssign();return py.has(t.type)&&!t.extra?.parenthesized&&this.raise(K.PipeUnparenthesizedBody,e,{type:t.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(K.PipeTopicUnused,e),t}checkExponentialAfterUnary(e){this.match(53)&&this.raise(K.UnexpectedTokenUnaryExponentiation,e.argument)}parseMaybeUnary(e,t){let n=this.state.startLoc,r=this.isContextual(92);if(r&&this.recordAwaitIfAllowed()){this.next();let e=this.parseAwait(n);return t||this.checkExponentialAfterUnary(e),e}let i=this.match(30),a=this.startNode();if(eb(this.state.type)){a.operator=this.state.value,a.prefix=!0,this.state.canStartArrow=!1,this.match(68)&&this.expectPlugin(`throwExpressions`);let n=this.match(85);if(this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),this.state.strict&&n){let e=a.argument;e.type===`Identifier`?this.raise(K.StrictDelete,a):this.hasPropertyAsPrivateName(e)&&this.raise(K.DeletePrivateField,a)}if(!i)return t||this.checkExponentialAfterUnary(a),this.finishNode(a,`UnaryExpression`)}let o=this.parseUpdate(a,i,e);if(r){let{type:e}=this.state;if((this.hasPlugin(`v8intrinsic`)?qy(e):qy(e)&&!this.match(50))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(K.AwaitNotInAsyncContext,n),this.parseAwait(n)}return o}parseUpdate(e,t,n){if(t){let t=this.finishNode(e,`UpdateExpression`);return this.checkLVal(t.argument,t),t}let r=this.state.startLoc,i=this.parseExprSubscripts(n);if(this.checkExpressionErrors(n,!1))return i;for(;$y(this.state.type)&&!this.canInsertSemicolon();){let e=this.startNodeAt(r);e.operator=this.state.value,e.prefix=!1,e.argument=i,this.next(),this.checkLVal(i,i=this.finishNode(e,`UpdateExpression`))}return i}parseExprSubscripts(e){let t=this.state.startLoc;this.setLoc(t);let n=this.parseExprAtom(e);return this.shouldExitDescending(n)?n:this.parseSubscripts(n,t)}parseSubscripts(e,t,n){let r={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(e),stop:!1};do e=this.parseSubscript(e,t,n,r),r.maybeAsyncArrow=!1;while(!r.stop);return e}parseSubscript(e,t,n,r){let{type:i}=this.state;if(!n&&i===11)return this.parseBind(e,t,r);if(ob(i))return this.parseTaggedTemplateExpression(e,t,r);let a=!1;if(i===14){if(n&&(this.raise(K.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return this.stopParseSubscript(e,r);r.optionalChainMember=a=!0,this.next()}if(!n&&this.match(6))return this.parseCoverCallAndAsyncArrowHead(e,t,r,a);{let n=this.eat(0);return n||a||this.eat(12)?this.parseMember(e,t,r,n,a):this.stopParseSubscript(e,r)}}stopParseSubscript(e,t){return t.stop=!0,e}parseMember(e,t,n,r,i){let a=this.startNodeAt(t);return a.object=e,a.computed=r,r?(a.property=this.parseExpression(),this.expect(1)):this.match(134)?(e.type===`Super`&&this.raise(K.SuperPrivateField,t),this.classScope.usePrivateName(this.state.value,this.state.startLoc),a.property=this.parsePrivateName()):a.property=this.parseIdentifier(!0),n.optionalChainMember?(a.optional=i,this.finishNode(a,`OptionalMemberExpression`)):this.finishNode(a,`MemberExpression`)}parseBind(e,t,n){let r=this.startNodeAt(t);r.object=e,this.next();let i=this.parseNoCallExpr(e=>{throw this.raise(K.UnsupportedBindRHS,e)});if(i.type===`Super`||i.type===`Import`)throw this.raise(K.UnsupportedBindRHS,i);return r.callee=i,n.stop=!0,this.parseSubscripts(this.finishNode(r,`BindExpression`),t,!1)}parseCoverCallAndAsyncArrowHead(e,t,n,r){let i=null;this.next();let a=this.startNodeAt(t);a.callee=e;let{maybeAsyncArrow:o,optionalChainMember:s}=n;o&&(this.expressionScope.enter(Ox()),i=new Nx),s&&(a.optional=r),a.arguments=r?this.parseCallExpressionArguments():this.parseCallExpressionArguments(e.type!==`Super`,a,i);let c=this.finishCallExpression(a,s);return o&&this.shouldParseAsyncArrow()&&!r?(n.stop=!0,this.checkDestructuringPrivate(i),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),c=this.parseAsyncArrowFromCallExpression(this.startNodeAt(t),c)):(o&&(this.checkExpressionErrors(i,!0),this.expressionScope.exit()),this.toReferencedList(a.arguments)),c}parseTaggedTemplateExpression(e,t,n){let r=this.startNodeAt(t);return r.tag=e,r.quasi=this.parseTemplate(!0),n.optionalChainMember&&this.raise(K.OptionalChainingNoTemplate,t),this.finishNode(r,`TaggedTemplateExpression`)}atPossibleAsyncArrow(e){return e.type===`Identifier`&&e.name===`async`&&this.state.lastTokEndLoc.index===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.state.canStartArrow}finishCallExpression(e,t){if(e.callee.type===`Import`){if(e.arguments.length===0||e.arguments.length>2)this.raise(K.ImportCallArity,e);else for(let t of e.arguments)t.type===`SpreadElement`&&this.raise(K.ImportCallSpreadArgument,t)}return this.finishNode(e,t?`OptionalCallExpression`:`CallExpression`)}parseCallExpressionArguments(e,t,n){let r=[],i=!0;for(;!this.eat(7);){if(i)i=!1;else if(this.expect(8),this.match(7)){t&&this.addTrailingCommaExtraToNode(t),this.next();break}r.push(this.parseExprListItem(7,!1,n,e))}return r}shouldParseAsyncArrow(){return this.match(15)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(e,t){return this.resetPreviousNodeTrailingComments(t),this.expect(15),this.parseArrowExpression(e,t.arguments,!0,t.extra?.trailingCommaLoc),t.innerComments&&rx(e,t.innerComments),t.callee.trailingComments&&rx(e,t.callee.trailingComments),e}parseNoCallExpr(e){let t=this.state.startLoc,n=this.match(79),r=this.parseExprAtom();return n&&r.type===`ImportExpression`&&e(r),this.parseSubscripts(r,t,!0)}parseExprAtom(e){let t,n=null,{type:r}=this.state;switch(r){case 75:return this.parseSuper();case 79:return t=this.startNode(),this.next(),this.match(12)?this.parseImportMetaPropertyOrPhaseCall(t):this.match(6)?this.optionFlags&1024?this.parseImportCall(t):this.finishNode(t,`Import`):(this.raise(K.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(t,`Import`));case 74:return t=this.startNode(),this.next(),this.finishNode(t,`ThisExpression`);case 86:return this.parseDo(this.startNode(),!1);case 52:case 27:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 131:return this.parseNumericLiteral(this.state.value);case 132:return this.parseBigIntLiteral(this.state.value);case 130:return this.parseStringLiteral(this.state.value);case 80:return this.parseNullLiteral();case 81:return this.parseBooleanLiteral(!0);case 82:return this.parseBooleanLiteral(!1);case 6:return this.parseParenAndDistinguishExpression(this.state.canStartArrow);case 0:return this.parseArrayLike(1,e);case 2:return this.parseObjectLike(4,!1,e);case 64:return this.parseFunctionOrFunctionSent();case 22:n=this.parseDecorators();case 76:return this.parseClass(this.maybeTakeDecorators(n,this.startNode()),!1);case 73:return this.parseNewOrNewTarget();case 21:case 20:return this.parseTemplate(!1);case 11:{t=this.startNode(),this.next(),t.object=null;let e=t.callee=this.parseNoCallExpr(e=>{throw this.raise(K.UnsupportedBind,e)});if(e.type===`MemberExpression`)return this.finishNode(t,`BindExpression`);throw this.raise(K.UnsupportedBind,e)}case 134:return this.raise(K.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 29:return this.parseTopicReferenceThenEqualsSign(50,`%`);case 28:return this.parseTopicReferenceThenEqualsSign(40,`^`);case 33:case 34:return this.parseTopicReference(`hack`);case 40:case 50:case 23:{let e=this.getPluginOption(`pipelineOperator`,`proposal`);if(e)return this.parseTopicReference(e);throw this.unexpected()}case 43:{let e=this.input.codePointAt(this.nextTokenStart());throw hb(e)||e===62?this.expectOnePlugin([`jsx`,`flow`,`typescript`]):this.unexpected()}default:if(Hy(r)){if(this.isContextual(123)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let{canStartArrow:e,containsEsc:t}=this.state,n=this.parseIdentifier();if(!t&&n.name===`async`&&!this.canInsertSemicolon()){let{type:t}=this.state;if(t===64)return this.resetPreviousNodeTrailingComments(n),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(n));if(Hy(t))return e&&this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(n)):n;if(t===86)return this.resetPreviousNodeTrailingComments(n),this.parseDo(this.startNodeAtNode(n),!0)}return e&&this.match(15)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(n),[n],!1)):n}throw this.unexpected()}}parseTopicReferenceThenEqualsSign(e,t){let n=this.getPluginOption(`pipelineOperator`,`proposal`);if(n)return this.state.type=e,this.state.value=t,this.state.pos--,this.state.end--,this.state.endLoc=ay(this.state.endLoc,-1),this.parseTopicReference(n);throw this.unexpected()}parseTopicReference(e){let t=this.startNode(),n=this.state.startLoc,r=this.state.type;return this.next(),this.finishTopicReference(t,n,e,r)}finishTopicReference(e,t,n,r){if(this.testTopicReferenceConfiguration(n,t,r))return this.topicReferenceIsAllowedInCurrentContext()||this.raise(K.PipeTopicUnbound,t),this.registerTopicReference(),this.finishNode(e,`TopicReference`);throw this.raise(K.PipeTopicUnconfiguredToken,t,{token:rb(r)})}testTopicReferenceConfiguration(e,t,n){switch(e){case`hack`:return this.hasPlugin([`pipelineOperator`,{topicToken:rb(n)}]);default:throw this.raise(K.PipeTopicRequiresHackPipes,t)}}parseAsyncArrowUnaryFunction(e){this.prodParam.enter(jx(!0,this.prodParam.hasYield));let t=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(K.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(15),this.parseArrowExpression(e,t,!0)}parseDo(e,t){this.expectPlugin(`doExpressions`),t&&this.expectPlugin(`asyncDoExpressions`),e.async=t,this.next();let n=this.state.labels;return this.state.labels=[],t?(this.prodParam.enter(2),e.body=this.parseBlock(),this.prodParam.exit()):e.body=this.parseBlock(),this.state.labels=n,this.finishNode(e,`DoExpression`)}parseSuper(){let e=this.startNode();return this.next(),this.match(6)&&!this.scope.allowDirectSuper?this.raise(K.SuperNotAllowed,e):this.scope.allowSuper||this.raise(K.UnexpectedSuper,e),!this.match(6)&&!this.match(0)&&!this.match(12)&&this.raise(K.UnsupportedSuper,e),this.finishNode(e,`Super`)}parsePrivateName(){let e=this.startNode(),t=this.startNodeAt(ay(this.state.startLoc,1)),n=this.state.value;return this.next(),e.id=this.createIdentifier(t,n),this.finishNode(e,`PrivateName`)}parseFunctionOrFunctionSent(){let e=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(12)){let t=this.createIdentifier(this.startNodeAtNode(e),`function`);return this.next(),this.match(99)?this.expectPlugin(`functionSent`):this.hasPlugin(`functionSent`)||this.unexpected(),this.parseMetaProperty(e,t,`sent`)}return this.parseFunction(e)}parseMetaProperty(e,t,n){e.meta=t;let r=this.state.containsEsc;return e.property=this.parseIdentifier(!0),(e.property.name!==n||r)&&this.raise(K.UnsupportedMetaProperty,e.property,{target:t.name,onlyValidPropertyName:n}),this.finishNode(e,`MetaProperty`)}parseImportMetaPropertyOrPhaseCall(e){if(this.next(),this.isContextual(101)||this.isContextual(93)){let t=this.isContextual(101);return this.expectPlugin(t?`sourcePhaseImports`:`deferredImportEvaluation`),this.next(),e.phase=t?`source`:`defer`,this.parseImportCall(e)}{let t=this.createIdentifierAt(this.startNodeAtNode(e),`import`,this.state.lastTokStartLoc);return this.isContextual(97)&&(this.inModule||this.raise(K.ImportMetaOutsideModule,t),this.sawUnambiguousESM=!0),this.parseMetaProperty(e,t,`meta`)}}parseLiteralAtNode(e,t,n){return this.addExtra(n,`rawValue`,e),this.addExtra(n,`raw`,this.input.slice(this.offsetToSourcePos(n.start),this.state.end)),n.value=e,this.next(),this.finishNode(n,t)}parseLiteral(e,t){let n=this.startNode();return this.parseLiteralAtNode(e,t,n)}parseStringLiteral(e){return this.parseLiteral(e,`StringLiteral`)}parseNumericLiteral(e){return this.parseLiteral(e,`NumericLiteral`)}parseBigIntLiteral(e){let t;try{t=BigInt(e)}catch{t=null}return this.parseLiteral(t,`BigIntLiteral`)}parseRegExpLiteral(e){let t=this.startNode();return this.addExtra(t,`raw`,this.input.slice(this.offsetToSourcePos(t.start),this.state.end)),t.pattern=e.pattern,t.flags=e.flags,this.next(),this.finishNode(t,`RegExpLiteral`)}parseBooleanLiteral(e){let t=this.startNode();return t.value=e,this.next(),this.finishNode(t,`BooleanLiteral`)}parseNullLiteral(){let e=this.startNode();return this.next(),this.finishNode(e,`NullLiteral`)}parseParenAndDistinguishExpression(e){let t=this.state.startLoc,n;this.next(),this.expressionScope.enter(Dx());let r=this.state.startLoc,i=[],a=new Nx,o=!0,s,c;for(;!this.match(7);){if(o)o=!1;else if(this.expect(8,a.optionalParametersLoc===null?null:a.optionalParametersLoc),this.match(7)){c=this.state.startLoc;break}if(this.match(17)){let e=this.state.startLoc;if(s=this.state.startLoc,i.push(this.parseParenItem(this.parseRestBinding(),e)),!this.checkCommaAfterRest(41))break}else i.push(this.parseMaybeAssignAllowInOrVoidPattern(7,a,!0))}let l=this.state.lastTokEndLoc;this.expect(7);let u=this.startNodeAt(t);return e&&this.shouldParseArrow(i)&&(u=this.parseArrow(u))?(this.checkDestructuringPrivate(a),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(u,i,!1),u):(this.expressionScope.exit(),i.length||this.unexpected(this.state.lastTokStartLoc),c&&this.unexpected(c),s&&this.unexpected(s),this.checkExpressionErrors(a,!0),this.toReferencedList(i,!0),i.length>1?(n=this.startNodeAt(r),n.expressions=i,this.finishNode(n,`SequenceExpression`),this.resetEndLocation(n,l)):n=i[0],this.wrapParenthesis(t,n))}wrapParenthesis(e,t){if(!(this.optionFlags&2048))return this.addExtra(t,`parenthesized`,!0),this.addExtra(t,`parenStart`,e.index),this.takeSurroundingComments(t,e.index,this.state.lastTokEndLoc.index),t;let n=this.startNodeAt(e);return n.expression=t,this.finishNode(n,`ParenthesizedExpression`)}shouldParseArrow(e){return!this.canInsertSemicolon()}parseArrow(e){if(this.eat(15))return e}parseParenItem(e,t){return e}parseNewOrNewTarget(){let e=this.startNode();if(this.next(),this.match(12)){let t=this.createIdentifier(this.startNodeAtNode(e),`new`);this.next();let n=this.parseMetaProperty(e,t,`target`);return this.scope.allowNewTarget||this.raise(K.UnexpectedNewTarget,n),n}return this.parseNew(e)}parseNew(e){if(this.parseNewCallee(e),this.eat(6)){let t=this.parseExprList(7);this.toReferencedList(t),e.arguments=t}else e.arguments=[];return this.finishNode(e,`NewExpression`)}parseNewCallee(e){let t=this.parseNoCallExpr(e=>{this.raise(K.ImportCallNotNewExpression,e,e)});e.callee=t,t.type===`Import`&&this.raise(K.ImportCallNotNewExpression,t),t.type===`Super`&&this.raise(K.SuperCallNotNewExpression,t)}parseTemplateElement(e){let{start:t,startLoc:n,end:r,value:i}=this.state,a=t+1,o=this.startNodeAt(ay(n,1));i===null&&(e||this.raise(K.InvalidEscapeSequenceTemplate,ay(this.state.firstInvalidTemplateEscapePos,1)));let s=this.match(20),c=s?-1:-2,l=r+c;o.value={raw:this.input.slice(a,l).replace(/\r\n?/g,`
26
+ `),cooked:i===null?null:i.slice(1,c)},o.tail=s,this.next();let u=this.finishNode(o,`TemplateElement`);return this.resetEndLocation(u,ay(this.state.lastTokEndLoc,c)),u}parseTemplate(e){let t=this.startNode(),n=this.parseTemplateElement(e),r=[n],i=[];for(;!n.tail;)i.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),r.push(n=this.parseTemplateElement(e));return t.expressions=i,t.quasis=r,this.finishNode(t,`TemplateLiteral`)}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(e,t,n){let r=!1,i=!0,a=this.startNode();for(a.properties=[],this.next();!this.match(e);){if(i)i=!1;else if(this.expect(8),this.match(e)){this.addTrailingCommaExtraToNode(a);break}let o;t?o=this.parseBindingProperty():(o=this.parsePropertyDefinition(n),r=this.checkProto(o,r,n)),a.properties.push(o)}this.next();let o=t?`ObjectPattern`:`ObjectExpression`;return this.finishNode(a,o)}addTrailingCommaExtraToNode(e){this.addExtra(e,`trailingComma`,this.state.lastTokStartLoc.index),this.addExtra(e,`trailingCommaLoc`,this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(e){return!e.computed&&e.key.type===`Identifier`&&(this.isLiteralPropertyName()||this.match(0)||this.match(51))}parsePropertyDefinition(e){let t=[];if(this.match(22))for(this.hasPlugin(`decorators`)&&this.raise(K.UnsupportedPropertyDecorator,this.state.startLoc);this.match(22);)t.push(this.parseDecorator());let n=this.startNode(),r=!1,i=!1,a;if(this.match(17))return t.length&&this.unexpected(),this.parseSpread();t.length&&(n.decorators=t),n.method=!1,e&&(a=this.state.startLoc);let o=this.eat(51);this.parsePropertyNamePrefixOperator(n);let s=this.state.containsEsc;if(this.parsePropertyName(n,e),!o&&!s&&this.maybeAsyncOrAccessorProp(n)){let{key:e}=n,t=e.name;t===`async`&&!this.hasPrecedingLineBreak()&&(r=!0,this.resetPreviousNodeTrailingComments(e),o=this.eat(51),this.parsePropertyName(n)),(t===`get`||t===`set`)&&(i=!0,this.resetPreviousNodeTrailingComments(e),n.kind=t,this.match(51)&&(o=!0,this.raise(K.AccessorIsGenerator,this.state.curPosition(),{kind:t}),this.next()),this.parsePropertyName(n))}return this.parseObjPropValue(n,a,o,r,!1,i,e)}getGetterSetterExpectedParamCount(e){return e.kind===`get`?0:1}getObjectOrClassMethodParams(e){return e.params}checkGetterSetterParams(e){let t=this.getGetterSetterExpectedParamCount(e),n=this.getObjectOrClassMethodParams(e);n.length!==t&&this.raise(e.kind===`get`?K.BadGetterArity:K.BadSetterArity,e),e.kind===`set`&&n[n.length-1]?.type===`RestElement`&&this.raise(K.BadSetterRestParameter,e)}parseObjectMethod(e,t,n,r,i){if(i){let n=this.parseMethod(e,t,!1,!1,!1,`ObjectMethod`);return this.checkGetterSetterParams(n),n}if(n||t||this.match(6))return r&&this.unexpected(),e.kind=`method`,e.method=!0,this.parseMethod(e,t,n,!1,!1,`ObjectMethod`)}parseObjectProperty(e,t,n,r){if(e.shorthand=!1,this.eat(10))return e.value=n?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowInOrVoidPattern(4,r),this.finishObjectProperty(e);if(!e.computed&&e.key.type===`Identifier`){if(this.checkReservedWord(e.key.name,e.key.start,!0,!1),n)e.value=this.parseMaybeDefault(t,this.cloneIdentifier(e.key));else if(this.match(25)){let n=this.state.startLoc;r==null?this.raise(K.InvalidCoverInitializedName,n):r.shorthandAssignLoc===null&&(r.shorthandAssignLoc=n),e.value=this.parseMaybeDefault(t,this.cloneIdentifier(e.key))}else e.value=this.cloneIdentifier(e.key);return e.shorthand=!0,this.finishObjectProperty(e)}}finishObjectProperty(e){return this.finishNode(e,`ObjectProperty`)}parseObjPropValue(e,t,n,r,i,a,o){let s=this.parseObjectMethod(e,n,r,i,a)||this.parseObjectProperty(e,t,i,o);return s||this.unexpected(),s}parsePropertyName(e,t){if(this.eat(0))e.computed=!0,e.key=this.parseMaybeAssignAllowIn(),this.expect(1);else{let{type:n,value:r}=this.state,i;if(Wy(n))i=this.parseIdentifier(!0);else switch(n){case 131:i=this.parseNumericLiteral(r);break;case 130:i=this.parseStringLiteral(r);break;case 132:i=this.parseBigIntLiteral(r);break;case 134:{let e=this.state.startLoc;t==null?this.raise(K.UnexpectedPrivateField,e):t.privateKeyLoc===null&&(t.privateKeyLoc=e),i=this.parsePrivateName();break}default:throw this.unexpected()}e.key=i,n!==134&&(e.computed=!1)}}initFunction(e,t){e.id=null,e.generator=!1,e.async=t}parseMethod(e,t,n,r,i,a,o=!1){this.initFunction(e,n),e.generator=t,this.scope.enter(530|(o?576:0)|(i?32:0)),this.prodParam.enter(jx(n,e.generator)),this.parseFunctionParams(e,r);let s=this.parseFunctionBodyAndFinish(e,a,!0);return this.prodParam.exit(),this.scope.exit(),s}parseArrayLike(e,t){let n=this.startNode();return this.next(),n.elements=this.parseExprList(e,!0,t,n),this.finishNode(n,`ArrayExpression`)}parseArrowExpression(e,t,n,r){this.scope.enter(518);let i=jx(n,!1);return this.match(2)||(i|=this.prodParam.currentFlags()&24),this.prodParam.enter(i),this.initFunction(e,n),t&&this.setArrowFunctionParameters(e,t,r),this.parseFunctionBody(e,!0),this.prodParam.exit(),this.scope.exit(),this.finishNode(e,`ArrowFunctionExpression`)}setArrowFunctionParameters(e,t,n){this.toAssignableList(t,n,!1),e.params=t}parseFunctionBodyAndFinish(e,t,n=!1){return this.parseFunctionBody(e,!1,n),this.finishNode(e,t)}parseFunctionBody(e,t,n=!1){let r=t&&!this.match(2);if(this.expressionScope.enter(kx()),r)e.body=this.parseMaybeAssign(),this.checkParams(e,!1,t,!1);else{let r=this.state.strict,i=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),e.body=this.parseBlock(!0,!1,i=>{let a=!this.isSimpleParamList(e.params);i&&a&&this.raise(K.IllegalLanguageModeDirective,(e.kind===`method`||e.kind===`constructor`)&&e.key?this.optionFlags&256?e.key.loc.end:e.key:e);let o=!r&&this.state.strict;this.checkParams(e,!this.state.strict&&!t&&!n&&!a,t,o),this.state.strict&&e.id&&this.checkIdentifier(e.id,65,o)}),this.prodParam.exit(),this.state.labels=i}this.expressionScope.exit()}isSimpleParameter(e){return e.type===`Identifier`}isSimpleParamList(e){for(let t=0,n=e.length;t<n;t++)if(!this.isSimpleParameter(e[t]))return!1;return!0}checkParams(e,t,n,r=!0){let i=!t&&new Set,a={type:`FormalParameters`};for(let t of e.params)this.checkLVal(t,a,5,i,r)}parseExprList(e,t,n,r){let i=[],a=!0;for(;!this.eat(e);){if(a)a=!1;else if(this.expect(8),this.match(e)){r&&this.addTrailingCommaExtraToNode(r),this.next();break}i.push(this.parseExprListItem(e,t,n))}return i}parseExprListItem(e,t,n,r){let i;if(this.match(8))t||this.raise(K.UnexpectedToken,this.state.curPosition(),{unexpected:`,`}),i=null;else if(this.match(17)){let e=this.state.startLoc;i=this.parseParenItem(this.parseSpread(n),e)}else if(this.match(13)){this.expectPlugin(`partialApplication`),r||this.raise(K.UnexpectedArgumentPlaceholder,this.state.startLoc);let e=this.startNode();this.next(),i=this.finishNode(e,`ArgumentPlaceholder`)}else i=this.parseMaybeAssignAllowInOrVoidPattern(e,n,!0);return i}parseIdentifier(e){let t=this.startNode(),n=this.parseIdentifierName(e);return this.createIdentifier(t,n)}createIdentifier(e,t){return e.name=t,this.optionFlags&256&&(e.loc.identifierName=t),this.finishNode(e,`Identifier`)}createIdentifierAt(e,t,n){return e.name=t,this.optionFlags&256&&(e.loc.identifierName=t),this.finishNodeAt(e,`Identifier`,n)}parseIdentifierName(e){let t,{start:n,type:r}=this.state;Wy(r)?t=this.state.value:this.unexpected();let i=Uy(r);return e?i&&this.replaceToken(128):this.checkReservedWord(t,this.sourceToOffsetPos(n),i,!1),this.next(),t}checkReservedWord(e,t,n,r){if(!(e.length>10)&&Ob(e)){if(n&&Tb(e)){this.raise(K.UnexpectedKeyword,t,{keyword:e});return}if((this.state.strict?r?wb:Sb:xb)(e,this.inModule)){this.raise(K.UnexpectedReservedWord,t,{reservedWord:e});return}if(e===`yield`){if(this.prodParam.hasYield){this.raise(K.YieldBindingIdentifier,t);return}}else if(e===`await`){if(this.prodParam.hasAwait){this.raise(K.AwaitBindingIdentifier,t);return}if(this.scope.inStaticBlock){this.raise(K.AwaitBindingIdentifierInStaticBlock,t);return}this.expressionScope.recordAsyncArrowParametersError(t)}else if(e===`arguments`&&this.scope.inClassAndNotInNonArrowFunction){this.raise(K.ArgumentsInClass,t);return}}}recordAwaitIfAllowed(){let e=this.prodParam.hasAwait;return e&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),e}parseAwait(e,t){let n=e.index;this.setLoc(e);let r=this.startNodeAt(e);return this.expressionScope.recordParameterInitializerError(K.AwaitExpressionFormalParameter,n),this.eat(51)&&this.raise(K.ObsoleteAwaitStar,e),!this.scope.inFunction&&!(this.optionFlags&1)&&(this.isAmbiguousPrefixOrIdentifier()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),t||(r.argument=this.parseMaybeUnary(null,!0)),this.finishNode(r,`AwaitExpression`)}isAmbiguousPrefixOrIdentifier(){if(this.hasPrecedingLineBreak())return!0;let{type:e}=this.state;return e===49||e===6||e===0||ob(e)||e===98&&!this.state.containsEsc||e===133||e===52||this.hasPlugin(`v8intrinsic`)&&e===50}parseYield(e){this.setLoc(e);let t=this.startNodeAt(e);this.expressionScope.recordParameterInitializerError(K.YieldInParameter,e.index);let n=!1,r=null;if(!this.hasPrecedingLineBreak())switch(n=this.eat(51),this.state.type){case 9:case 135:case 4:case 7:case 1:case 5:case 10:case 8:if(!n)break;default:r=this.parseMaybeAssign()}return t.delegate=n,t.argument=r,this.finishNode(t,`YieldExpression`)}parseImportCall(e){this.next();let t=this.parseCallExpressionArguments();if(t.length===0||t.length>2)this.raise(K.ImportCallArity,e,e);else for(let n of t)n.type===`SpreadElement`&&this.raise(K.ImportCallSpreadArgument,n,e);return e.source=t[0],e.options=t[1]??null,this.finishNode(e,`ImportExpression`)}withTopicBindingContext(e){let t=this.state.inHackPipelineBody;this.state.inHackPipelineBody=!0;let n=this.state.seenTopicReference;this.state.seenTopicReference=!1;try{return e()}finally{this.state.inHackPipelineBody=t,this.state.seenTopicReference=n}}allowInAnd(e){let t=this.prodParam.currentFlags();if(24&~t){this.prodParam.enter(t|24);try{return e()}finally{this.prodParam.exit()}}return e()}disallowInAnd(e){let t=this.prodParam.currentFlags(),n=8&t,r=16&~t;if(n||r){this.prodParam.enter(t&-9|16);try{return e()}finally{this.prodParam.exit()}}return e()}registerTopicReference(){this.state.seenTopicReference=!0}topicReferenceIsAllowedInCurrentContext(){return this.state.inHackPipelineBody}topicReferenceWasUsedInCurrentContext(){return this.state.seenTopicReference}parseFSharpPipelineBody(e){let t=this.state.startLoc;this.prodParam.enter(this.prodParam.currentFlags()&-17);let n;if(this.isContextual(92)&&this.recordAwaitIfAllowed()){this.next(),n=this.parseAwait(t,!0);let e=this.state.type;Qy(e)&&e!==35&&(this.prodParam.hasIn||e!==54)&&this.raise(K.PipelineUnparenthesized,t)}else this.state.canStartArrow=!0,n=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),t,e);return this.prodParam.exit(),n}parseModuleExpression(){this.expectPlugin(`moduleBlocks`);let e=this.startNode();this.next(),this.match(2)||this.unexpected(null,2);let t=this.startNodeAt(this.state.endLoc);this.next();let n=this.initializeScopes(!0);this.enterInitialScopes();try{e.body=this.parseProgram(t,4,`module`)}finally{n()}return this.finishNode(e,`ModuleExpression`)}parseVoidPattern(e){this.expectPlugin(`discardBinding`);let t=this.startNode();return e!=null&&(e.voidPatternLoc=this.state.startLoc),this.next(),this.finishNode(t,`VoidPattern`)}parseMaybeAssignAllowInOrVoidPattern(e,t,n){if(t!=null&&this.match(84)){let n=this.lookaheadCharCode();if(n===44||n===(e===1?93:e===4?125:41)||n===61)return this.parseMaybeDefault(this.state.startLoc,this.parseVoidPattern(t))}return this.parseMaybeAssignAllowIn(t,n)}parsePropertyNamePrefixOperator(e){}},Bx={kind:1},Vx={kind:2},Hx=/[\uD800-\uDFFF]/u,Ux=/in(?:stanceof)?/y;function Wx(e){for(let t=0;t<e.length;t++){let n=e[t],{type:r}=n;typeof r==`number`&&(n.type=sb(r))}return e}var Gx=class extends zx{parseTopLevel(e,t){return e.program=this.parseProgram(t,135,this.options.sourceType===`module`?`module`:`script`),e.comments=this.comments,this.optionFlags&512&&(e.tokens=Wx(this.tokens)),this.finishNode(e,`File`)}parseProgram(e,t,n){if(e.sourceType=n,e.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(e,!0,!0,t),this.inModule){if(!(this.optionFlags&64)&&this.scope.undefinedExports.size>0)for(let[e,t]of Array.from(this.scope.undefinedExports))this.raise(K.ModuleExportUndefined,t,{localName:e});this.addExtra(e,`topLevelAwait`,this.state.hasTopLevelAwait)}let r;return r=t===135?this.finishNode(e,`Program`):this.finishNodeAt(e,`Program`,ay(this.state.startLoc,-1)),r}stmtToDirective(e){let t=this.castNodeTo(e,`Directive`),n=this.castNodeTo(e.expression,`DirectiveLiteral`),r=n.value,i=this.input.slice(this.offsetToSourcePos(n.start),this.offsetToSourcePos(n.end)),a=n.value=i.slice(1,-1);return this.addExtra(n,`raw`,i),this.addExtra(n,`rawValue`,a),this.addExtra(n,`expressionValue`,r),t.value=n,delete e.expression,t}parseInterpreterDirective(){if(!this.match(24))return null;let e=this.startNode();return e.value=this.state.value,this.next(),this.finishNode(e,`InterpreterDirective`)}isLet(){return this.isContextual(96)?this.hasFollowingBindingAtom():!1}isUsing(){return this.isContextual(103)?this.nextTokenIsIdentifierOnSameLine():!1}isForUsing(){if(!this.isContextual(103))return!1;let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);if(this.isUnparsedContextual(e,`of`)){let t=this.lookaheadCharCodeSince(e+2);if(t!==61&&t!==58&&t!==59)return!1}return!!(this.chStartsBindingIdentifier(t,e)||this.isUnparsedContextual(e,`void`))}nextTokenIsIdentifierOnSameLine(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return this.chStartsBindingIdentifier(t,e)}isAwaitUsing(){if(!this.isContextual(92))return!1;let e=this.nextTokenInLineStart();if(this.isUnparsedContextual(e,`using`)){e=this.nextTokenInLineStartSince(e+5);let t=this.codePointAtPos(e);if(this.chStartsBindingIdentifier(t,e))return!0}return!1}chStartsBindingIdentifier(e,t){if(hb(e)){if(Ux.lastIndex=t,Ux.test(this.input)){let e=this.codePointAtPos(Ux.lastIndex);if(!gb(e)&&e!==92)return!1}return!0}return e===92}chStartsBindingPattern(e){return e===91||e===123}hasFollowingBindingAtom(){let e=this.nextTokenStart(),t=this.codePointAtPos(e);return this.chStartsBindingPattern(t)||this.chStartsBindingIdentifier(t,e)}hasInLineFollowingBindingIdentifierOrBrace(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return t===123||this.chStartsBindingIdentifier(t,e)}allowsUsing(){return(this.scope.inModule||!this.scope.inTopLevel)&&!this.scope.inBareCaseStatement}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(e=!1){let t=0;return this.options.annexB&&!this.state.strict&&(t|=4,e&&(t|=8)),this.parseStatementLike(t)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(e){let t=null;return this.match(22)&&(t=this.parseDecorators(!0)),this.parseStatementContent(e,t)}parseStatementContent(e,t){let n=this.state.type,r=this.startNode(),i=!!(e&2),a=!!(e&4),o=e&1;switch(n){case 56:return this.parseBreakContinueStatement(r,!0);case 59:return this.parseBreakContinueStatement(r,!1);case 60:return this.parseDebuggerStatement(r);case 86:return this.parseDoWhileStatement(r);case 87:return this.parseForStatement(r);case 64:if(this.lookaheadCharCode()===46)break;return a||this.raise(this.state.strict?K.StrictFunction:this.options.annexB?K.SloppyFunctionAnnexB:K.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(r,!1,!i&&a);case 76:return i||this.unexpected(),this.parseClass(this.maybeTakeDecorators(t,r),!0);case 65:return this.parseIfStatement(r);case 66:return this.parseReturnStatement(r);case 67:return this.parseSwitchStatement(r);case 68:return this.parseThrowStatement(r);case 69:return this.parseTryStatement(r);case 92:if(this.isAwaitUsing())return this.allowsUsing()?i?this.recordAwaitIfAllowed()||this.raise(K.AwaitUsingNotInAsyncContext,r):this.raise(K.UnexpectedLexicalDeclaration,r):this.raise(K.UnexpectedUsingDeclaration,r),this.next(),this.parseVarStatement(r,`await using`);break;case 103:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.allowsUsing()?i||this.raise(K.UnexpectedLexicalDeclaration,this.state.startLoc):this.raise(K.UnexpectedUsingDeclaration,this.state.startLoc),this.parseVarStatement(r,`using`);case 96:{if(this.state.containsEsc)break;let e=this.nextTokenStart(),t=this.codePointAtPos(e);if(t!==91&&(!i&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(t,e)&&t!==123))break}case 71:i||this.raise(K.UnexpectedLexicalDeclaration,this.state.startLoc);case 70:{let e=this.state.value;return this.parseVarStatement(r,e)}case 88:return this.parseWhileStatement(r);case 72:return this.parseWithStatement(r);case 2:return this.parseBlock();case 9:return this.parseEmptyStatement(r);case 79:{let e=this.lookaheadCharCode();if(e===40||e===46)break}case 78:{!(this.optionFlags&8)&&!o&&this.raise(K.UnexpectedImportExport,this.state.startLoc),this.next();let e;return e=n===79?this.parseImport(r):this.parseExport(r,t),this.assertModuleNodeAllowed(e),e}default:if(this.isAsyncFunction())return i||this.raise(K.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(r,!0,!i&&a)}let s=this.state.value,c=this.parseExpression();return Hy(n)&&c.type===`Identifier`&&this.eat(10)?this.parseLabeledStatement(r,s,c,e):this.parseExpressionStatement(r,c)}assertModuleNodeAllowed(e){!(this.optionFlags&8)&&!this.inModule&&this.raise(K.ImportOutsideModule,e)}maybeTakeDecorators(e,t,n){return e&&(t.decorators?.length?(this.raise(K.DecoratorsBeforeAfterExport,t.decorators[0]),t.decorators.unshift(...e)):t.decorators=e,this.resetStartLocationFromNode(t,e[0]),n&&this.resetStartLocationFromNode(n,t)),t}canHaveLeadingDecorator(){return this.match(76)}parseDecorators(e){let t=[];do t.push(this.parseDecorator());while(this.match(22));if(this.match(78))e||this.unexpected();else if(!this.canHaveLeadingDecorator())throw this.raise(K.UnexpectedLeadingDecorator,this.state.startLoc);return t}parseDecorator(){this.expectOnePlugin([`decorators`,`decorators-legacy`]);let e=this.startNode();if(this.next(),this.hasPlugin(`decorators`)){let t=this.state.startLoc,n;if(this.match(6)){let t=this.state.startLoc;this.next(),n=this.parseExpression(),this.expect(7),n=this.wrapParenthesis(t,n);let r=this.state.startLoc;e.expression=this.parseMaybeDecoratorArguments(n,t),e.expression!==n&&this.raise(K.DecoratorArgumentsOutsideParentheses,r)}else{for(n=this.parseIdentifier(!1);this.eat(12);){let e=this.startNodeAt(t);e.object=n,this.match(134)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),e.property=this.parsePrivateName()):e.property=this.parseIdentifier(!0),e.computed=!1,n=this.finishNode(e,`MemberExpression`)}e.expression=this.parseMaybeDecoratorArguments(n,t)}}else this.state.canStartArrow=!1,e.expression=this.parseExprSubscripts();return this.finishNode(e,`Decorator`)}parseMaybeDecoratorArguments(e,t){if(this.eat(6)){let n=this.startNodeAt(t);return n.callee=e,n.arguments=this.parseCallExpressionArguments(),this.toReferencedList(n.arguments),this.finishNode(n,`CallExpression`)}return e}parseBreakContinueStatement(e,t){return this.next(),this.isLineTerminator()?e.label=null:(e.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(e,t),this.finishNode(e,t?`BreakStatement`:`ContinueStatement`)}verifyBreakContinue(e,t){let n=0;for(;n<this.state.labels.length;++n){let r=this.state.labels[n];if((e.label==null||r.name===e.label.name)&&(r.kind!=null&&(t||r.kind===1)||e.label&&t))break}if(n===this.state.labels.length){let n=t?`BreakStatement`:`ContinueStatement`;this.raise(K.IllegalBreakContinue,e,{type:n})}}parseDebuggerStatement(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)}parseHeaderExpression(){this.expect(6);let e=this.parseExpression();return this.expect(7),e}parseDoWhileStatement(e){return this.next(),this.state.labels.push(Bx),e.body=this.parseStatement(),this.state.labels.pop(),this.expect(88),e.test=this.parseHeaderExpression(),this.eat(9),this.finishNode(e,`DoWhileStatement`)}parseForStatement(e){this.next(),this.state.labels.push(Bx);let t=null;if(this.isContextual(92)&&this.recordAwaitIfAllowed()&&(t=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(6),this.match(9))return t!==null&&this.unexpected(t),this.parseFor(e,null);let n=this.isContextual(96);{let r=this.isAwaitUsing(),i=r||this.isForUsing(),a=n&&this.hasFollowingBindingAtom()||i;if(this.match(70)||this.match(71)||a){let n=this.startNode(),a;r?(a=`await using`,this.recordAwaitIfAllowed()||this.raise(K.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):a=this.state.value,this.next(),this.parseVar(n,!0,a);let o=this.finishNode(n,`VariableDeclaration`),s=this.match(54);return s&&i&&this.raise(K.ForInUsing,o),(s||this.isContextual(98))&&o.declarations.length===1?this.parseForX(e,o,t):(t!==null&&this.unexpected(t),this.parseFor(e,o))}}let r=this.isContextual(91),i=new Nx,a=this.parseExpression(!0,i),o=this.isContextual(98);if(o&&(n&&this.raise(K.ForOfLet,a),t===null&&r&&a.type===`Identifier`&&this.raise(K.ForOfAsync,a)),o||this.match(54)){this.checkDestructuringPrivate(i),this.toAssignable(a,!0);let n=o?`ForOfStatement`:`ForInStatement`;return this.checkLVal(a,{type:n}),this.parseForX(e,a,t)}return this.checkExpressionErrors(i,!0),t!==null&&this.unexpected(t),this.parseFor(e,a)}parseFunctionStatement(e,t,n){return this.next(),this.parseFunction(e,1|(n?2:0)|(t?8:0))}parseIfStatement(e){return this.next(),e.test=this.parseHeaderExpression(),e.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),e.alternate=this.eat(62)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(e,`IfStatement`)}parseReturnStatement(e){return this.prodParam.hasReturn||this.raise(K.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)}parseSwitchStatement(e){this.next(),e.discriminant=this.parseHeaderExpression();let t=e.cases=[];this.expect(2),this.state.labels.push(Vx),this.scope.enter(256);let n;for(let e;!this.match(4);)if(this.match(57)||this.match(61)){let r=this.match(57);n&&this.finishNode(n,`SwitchCase`),t.push(n=this.startNode()),n.consequent=[],this.next(),r?n.test=this.parseExpression():(e&&this.raise(K.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),e=!0,n.test=null),this.expect(10)}else n?n.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),n&&this.finishNode(n,`SwitchCase`),this.next(),this.state.labels.pop(),this.finishNode(e,`SwitchStatement`)}parseThrowStatement(e){return this.next(),this.hasPrecedingLineBreak()&&this.raise(K.NewlineAfterThrow,this.state.lastTokEndLoc),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)}parseCatchClauseParam(){let e=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&e.type===`Identifier`?8:0),this.checkLVal(e,{type:`CatchClause`},9),e}parseTryStatement(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.match(58)){let t=this.startNode();this.next(),this.match(6)?(this.expect(6),t.param=this.parseCatchClauseParam(),this.expect(7)):(t.param=null,this.scope.enter(0)),t.body=this.parseBlock(!1,!1),this.scope.exit(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(63)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(K.NoCatchOrFinally,e),this.finishNode(e,`TryStatement`)}parseVarStatement(e,t,n=!1){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)}parseWhileStatement(e){return this.next(),e.test=this.parseHeaderExpression(),this.state.labels.push(Bx),e.body=this.parseStatement(),this.state.labels.pop(),this.finishNode(e,`WhileStatement`)}parseWithStatement(e){return this.state.strict&&this.raise(K.StrictWith,this.state.startLoc),this.next(),e.object=this.parseHeaderExpression(),e.body=this.parseStatement(),this.finishNode(e,`WithStatement`)}parseEmptyStatement(e){return this.next(),this.finishNode(e,`EmptyStatement`)}parseLabeledStatement(e,t,n,r){for(let e of this.state.labels)e.name===t&&this.raise(K.LabelRedeclaration,n,{labelName:t});let i=Xy(this.state.type)?1:this.match(67)?2:null;for(let t=this.state.labels.length-1;t>=0;t--){let n=this.state.labels[t];if(n.statementStart===e.start)n.statementStart=this.sourceToOffsetPos(this.state.start),n.kind=i;else break}return this.state.labels.push({name:t,kind:i,statementStart:this.sourceToOffsetPos(this.state.start)}),e.body=r&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)}parseExpressionStatement(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)}parseBlock(e=!1,t=!0,n){let r=this.startNode();return e&&this.state.strictErrors.clear(),this.expect(2),t&&this.scope.enter(0),this.parseBlockBody(r,e,!1,4,n),t&&this.scope.exit(),this.finishNode(r,`BlockStatement`)}isValidDirective(e){return e.type===`ExpressionStatement`&&e.expression.type===`StringLiteral`&&!e.expression.extra.parenthesized}parseBlockBody(e,t,n,r,i){let a=e.body=[],o=e.directives=[];this.parseBlockOrModuleBlockBody(a,t?o:void 0,n,r,i)}parseBlockOrModuleBlockBody(e,t,n,r,i){let a=this.state.strict,o=!1,s=!1;for(;!this.match(r);){let r=n?this.parseModuleItem():this.parseStatementListItem();if(t&&!s){if(this.isValidDirective(r)){let e=this.stmtToDirective(r);t.push(e),!o&&e.value.value===`use strict`&&(o=!0,this.setStrict(!0));continue}s=!0,this.state.strictErrors.clear()}e.push(r)}i?.call(this,o),a||this.setStrict(!1),this.next()}parseFor(e,t){return e.init=t,this.semicolon(!1),e.test=this.match(9)?null:this.parseExpression(),this.semicolon(!1),e.update=this.match(7)?null:this.parseExpression(),this.expect(7),e.body=this.parseStatement(),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,`ForStatement`)}parseForX(e,t,n){let r=this.match(54);return this.next(),r?n!==null&&this.unexpected(n):e.await=n!==null,t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!r||!this.options.annexB||this.state.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(K.ForInOfLoopInitializer,t,{type:r?`ForInStatement`:`ForOfStatement`}),t.type===`AssignmentPattern`&&this.raise(K.InvalidLhs,t,{ancestor:{type:`ForStatement`}}),e.left=t,e.right=r?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(7),e.body=this.parseStatement(),this.scope.exit(),this.state.labels.pop(),this.finishNode(e,r?`ForInStatement`:`ForOfStatement`)}parseVar(e,t,n,r=!1){let i=e.declarations=[];for(e.kind=n;;){let e=this.startNode();if(this.parseVarId(e,n),e.init=this.eat(25)?t?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,e.init===null&&!r&&(e.id.type!==`Identifier`&&!(t&&(this.match(54)||this.isContextual(98)))?this.raise(K.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:`destructuring`}):(n===`const`||n===`using`||n===`await using`)&&!(this.match(54)||this.isContextual(98))&&this.raise(K.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:n})),i.push(this.finishNode(e,`VariableDeclarator`)),!this.eat(8))break}return e}parseVarId(e,t){let n=this.parseBindingAtom();t===`using`||t===`await using`?(n.type===`ArrayPattern`||n.type===`ObjectPattern`)&&this.raise(K.UsingDeclarationHasBindingPattern,n):n.type===`VoidPattern`&&this.raise(K.UnexpectedVoidPattern,n),this.checkLVal(n,{type:`VariableDeclarator`},t===`var`?5:8201),e.id=n}parseAsyncFunctionExpression(e){return this.parseFunction(e,8)}parseFunction(e,t=0){let n=t&2,r=!!(t&1),i=r&&!(t&4),a=!!(t&8);return this.initFunction(e,a),this.match(51)&&(n&&this.raise(K.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),e.generator=!0),r&&(e.id=this.parseFunctionId(i)),this.scope.enter(514),this.prodParam.enter(jx(a,e.generator)),r||(e.id=this.parseFunctionId()),this.parseFunctionParams(e,!1),this.parseFunctionBodyAndFinish(e,r?`FunctionDeclaration`:`FunctionExpression`),this.prodParam.exit(),this.scope.exit(),r&&!n&&this.registerFunctionStatementId(e),e}parseFunctionId(e){return e||Hy(this.state.type)?this.parseIdentifier():null}parseFunctionParams(e,t){this.expect(6),this.expressionScope.enter(Ex()),e.params=this.parseBindingList(7,41,2|(t?4:0)),this.expressionScope.exit()}registerFunctionStatementId(e){e.id&&this.scope.declareName(e.id.name,!this.options.annexB||this.state.strict||e.generator||e.async?this.scope.treatFunctionsAsVar?5:8201:17,e.id.start)}parseClass(e,t,n){this.next();let r=this.state.strict;return this.state.strict=!0,this.parseClassId(e,t,n),this.parseClassSuper(e),e.body=this.parseClassBody(!!e.superClass,r),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)}isClassProperty(){return this.match(25)||this.match(9)||this.match(4)}isClassMethod(){return this.match(6)}nameIsConstructor(e){return e.type===`Identifier`&&e.name===`constructor`||e.type===`StringLiteral`&&e.value===`constructor`}isNonstaticConstructor(e){return!e.computed&&!e.static&&this.nameIsConstructor(e.key)}parseClassBody(e,t){this.classScope.enter();let n={hadConstructor:!1,hadSuperClass:e},r=[],i=this.startNode();for(i.body=[],this.expect(2);!this.match(4);){if(this.eat(9)){if(r.length>0)throw this.raise(K.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(22)){r.push(this.parseDecorator());continue}let e=this.startNode();r.length&&(e.decorators=r,this.resetStartLocationFromNode(e,r[0]),r=[]),this.parseClassMember(i,e,n)}if(this.state.strict=t,this.next(),r.length)throw this.raise(K.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(i,`ClassBody`)}parseClassMemberFromModifier(e,t){let n=this.parseIdentifier(!0);if(this.isClassMethod()){let r=t;return r.kind=`method`,r.computed=!1,r.key=n,r.static=!1,this.pushClassMethod(e,r,!1,!1,!1,!1),!0}if(this.isClassProperty()){let r=t;return r.computed=!1,r.key=n,r.static=!1,e.body.push(this.parseClassProperty(r)),!0}return this.resetPreviousNodeTrailingComments(n),!1}parseClassMember(e,t,n){let r=this.isContextual(102);if(r){if(this.parseClassMemberFromModifier(e,t))return;if(this.eat(2)){this.parseClassStaticBlock(e,t);return}}this.parseClassMemberWithIsStatic(e,t,n,r)}parseClassMemberWithIsStatic(e,t,n,r){let i=t,a=t,o=t,s=t,c=t,l=i,u=i;if(t.static=r,this.parsePropertyNamePrefixOperator(t),this.eat(51)){l.kind=`method`;let t=this.match(134);if(this.parseClassElementName(l),this.parsePostMemberNameModifiers(l),t){this.pushClassPrivateMethod(e,a,!0,!1);return}this.isNonstaticConstructor(i)&&this.raise(K.ConstructorIsGenerator,i.key),this.pushClassMethod(e,i,!0,!1,!1,!1);return}let d=!this.state.containsEsc&&Hy(this.state.type),f=this.parseClassElementName(t),p=d?f.name:null,m=this.isPrivateName(f),h=this.state.startLoc;if(this.parsePostMemberNameModifiers(u),this.isClassMethod()){if(l.kind=`method`,m){this.pushClassPrivateMethod(e,a,!1,!1);return}let r=this.isNonstaticConstructor(i),o=!1;r&&(i.kind=`constructor`,i.decorators&&i.decorators.length>0&&this.raise(K.DecoratorConstructor,t),n.hadConstructor&&!this.hasPlugin(`typescript`)&&this.raise(K.DuplicateConstructor,f),r&&this.hasPlugin(`typescript`)&&t.override&&this.raise(K.OverrideOnConstructor,f),n.hadConstructor=!0,o=n.hadSuperClass),this.pushClassMethod(e,i,!1,!1,r,o)}else if(this.isClassProperty())m?this.pushClassPrivateProperty(e,s):this.pushClassProperty(e,o);else if(p===`async`&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(f);let t=this.eat(51);u.optional&&this.unexpected(h),l.kind=`method`;let n=this.match(134);this.parseClassElementName(l),this.parsePostMemberNameModifiers(u),n?this.pushClassPrivateMethod(e,a,t,!0):(this.isNonstaticConstructor(i)&&this.raise(K.ConstructorIsAsync,i.key),this.pushClassMethod(e,i,t,!0,!1,!1))}else if((p===`get`||p===`set`)&&!(this.match(51)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(f),l.kind=p;let t=this.match(134);this.parseClassElementName(i),t?this.pushClassPrivateMethod(e,a,!1,!1):(this.isNonstaticConstructor(i)&&this.raise(K.ConstructorIsAccessor,i.key),this.pushClassMethod(e,i,!1,!1,!1,!1)),this.checkGetterSetterParams(i)}else if(p===`accessor`&&!this.isLineTerminator()){this.expectPlugin(`decoratorAutoAccessors`),this.resetPreviousNodeTrailingComments(f);let t=this.match(134);this.parseClassElementName(o),this.pushClassAccessorProperty(e,c,t)}else this.isLineTerminator()?m?this.pushClassPrivateProperty(e,s):this.pushClassProperty(e,o):this.unexpected()}parseClassElementName(e){let{type:t,value:n}=this.state;if((t===128||t===130)&&e.static&&n===`prototype`&&this.raise(K.StaticPrototype,this.state.startLoc),t===134){n===`constructor`&&this.raise(K.ConstructorClassPrivateField,this.state.startLoc);let t=this.parsePrivateName();return e.key=t,t}return this.parsePropertyName(e),e.key}parseClassStaticBlock(e,t){this.scope.enter(720);let n=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let r=t.body=[];this.parseBlockOrModuleBlockBody(r,void 0,!1,4),this.prodParam.exit(),this.scope.exit(),this.state.labels=n,e.body.push(this.finishNode(t,`StaticBlock`)),t.decorators?.length&&this.raise(K.DecoratorStaticBlock,t)}pushClassProperty(e,t){!t.computed&&this.nameIsConstructor(t.key)&&this.raise(K.ConstructorClassField,t.key),e.body.push(this.parseClassProperty(t))}pushClassPrivateProperty(e,t){let n=this.parseClassPrivateProperty(t);e.body.push(n),this.classScope.declarePrivateName(this.getPrivateNameSV(n.key),0,n.key.start)}pushClassAccessorProperty(e,t,n){!n&&!t.computed&&this.nameIsConstructor(t.key)&&this.raise(K.ConstructorClassField,t.key);let r=this.parseClassAccessorProperty(t);e.body.push(r),n&&this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),0,r.key.start)}pushClassMethod(e,t,n,r,i,a){e.body.push(this.parseMethod(t,n,r,i,a,`ClassMethod`,!0))}pushClassPrivateMethod(e,t,n,r){let i=this.parseMethod(t,n,r,!1,!1,`ClassPrivateMethod`,!0);e.body.push(i);let a=i.kind===`get`?i.static?6:2:i.kind===`set`?i.static?5:1:0;this.declareClassPrivateMethodInScope(i,a)}declareClassPrivateMethodInScope(e,t){this.classScope.declarePrivateName(this.getPrivateNameSV(e.key),t,e.key.start)}parsePostMemberNameModifiers(e){}parseClassPrivateProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,`ClassPrivateProperty`)}parseClassProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,`ClassProperty`)}parseClassAccessorProperty(e){return this.parseInitializer(e),this.semicolon(),this.finishNode(e,`ClassAccessorProperty`)}parseInitializer(e){this.scope.enter(592),this.expressionScope.enter(kx()),this.prodParam.enter(0),e.value=this.eat(25)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(e,t,n,r=8331){if(Hy(this.state.type))e.id=this.parseIdentifier(),t&&this.declareNameFromIdentifier(e.id,r);else if(n||!t)e.id=null;else throw this.raise(K.MissingClassName,this.state.startLoc)}parseClassSuper(e){this.eat(77)?(this.state.canStartArrow=!1,e.superClass=this.parseExprSubscripts()):e.superClass=null}parseExport(e,t){let n=this.parseMaybeImportPhase(e,!0),r=this.maybeParseExportDefaultSpecifier(e,n),i=!r||this.eat(8),a=i&&this.eatExportStar(e),o=a&&this.maybeParseExportNamespaceSpecifier(e),s=i&&(!o||this.eat(8)),c=r||a;if(a&&!o){if(r&&this.unexpected(),t)throw this.raise(K.UnsupportedDecoratorExport,e);return this.parseExportFrom(e,!0),this.sawUnambiguousESM=!0,this.finishNode(e,`ExportAllDeclaration`)}let l=this.maybeParseExportNamedSpecifiers(e);r&&i&&!a&&!l&&this.unexpected(null,2),o&&s&&this.unexpected(null,94);let u;if(c||l){if(u=!1,t)throw this.raise(K.UnsupportedDecoratorExport,e);this.parseExportFrom(e,c)}else u=this.maybeParseExportDeclaration(e);if(c||l||u){let n=e;if(this.checkNamedExport(n,!!n.source),n.declaration?.type===`ClassDeclaration`)this.maybeTakeDecorators(t,n.declaration,n);else if(t)throw this.raise(K.UnsupportedDecoratorExport,e);return this.sawUnambiguousESM=!0,this.finishNode(n,`ExportNamedDeclaration`)}if(this.eat(61)){let n=e,r=this.parseExportDefaultExpression();if(n.declaration=r,r.type===`ClassDeclaration`)this.maybeTakeDecorators(t,r,n);else if(t)throw this.raise(K.UnsupportedDecoratorExport,e);return this.checkDuplicateExports(e,`default`),this.hasPlugin(`exportDefaultFrom`)&&r.type===`Identifier`&&r.name===`from`&&r.end-r.start===4&&!r.extra?.parenthesized&&this.raise(K.ExportDefaultFromAsIdentifier,r),this.sawUnambiguousESM=!0,this.finishNode(n,`ExportDefaultDeclaration`)}throw this.unexpected(null,2)}eatExportStar(e){return this.eat(51)}maybeParseExportDefaultSpecifier(e,t){if(t||this.isExportDefaultSpecifier()){this.expectPlugin(`exportDefaultFrom`,t?.start);let n=t||this.parseIdentifier(!0),r=this.startNodeAtNode(n);return r.exported=n,e.specifiers=[this.finishNode(r,`ExportDefaultSpecifier`)],!0}return!1}maybeParseExportNamespaceSpecifier(e){if(this.isContextual(89)){e.specifiers??=[];let t=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),t.exported=this.parseModuleExportName(),e.specifiers.push(this.finishNode(t,`ExportNamespaceSpecifier`)),!0}return!1}maybeParseExportNamedSpecifiers(e){if(this.match(2)){let t=e;t.specifiers||=[];let n=t.exportKind===`type`;return t.specifiers.push(...this.parseExportSpecifiers(n)),t.source=null,t.attributes=[],t.declaration=null,!0}return!1}maybeParseExportDeclaration(e){return this.shouldParseExportDeclaration()?(e.specifiers=[],e.source=null,e.attributes=[],e.declaration=this.parseExportDeclaration(e),!0):!1}isAsyncFunction(){if(!this.isContextual(91))return!1;let e=this.nextTokenInLineStart();return this.isUnparsedContextual(e,`function`)}parseExportDefaultExpression(){let e=this.startNode();if(this.match(64))return this.next(),this.parseFunction(e,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(e,13);if(this.match(76))return this.parseClass(e,!0,!0);if(this.match(22))return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(71)||this.match(70)||this.isLet()||this.isUsing()||this.isAwaitUsing())throw this.raise(K.UnsupportedDefaultExport,this.state.startLoc);let t=this.parseMaybeAssignAllowIn();return this.semicolon(),t}parseExportDeclaration(e){return this.match(76)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:e}=this.state;if(Hy(e)){if(e===91&&!this.state.containsEsc||e===96)return!1;if((e===126||e===125)&&!this.state.containsEsc){let e=this.nextTokenStart(),t=this.input.charCodeAt(e);if(t===123||this.chStartsBindingIdentifier(t,e)&&!this.input.startsWith(`from`,e))return this.expectOnePlugin([`flow`,`typescript`]),!1}}else if(!this.match(61))return!1;let t=this.nextTokenStart(),n=this.isUnparsedContextual(t,`from`);if(this.input.charCodeAt(t)===44||Hy(this.state.type)&&n)return!0;if(this.match(61)&&n){let e=this.input.charCodeAt(this.nextTokenStartSince(t+4));return e===34||e===39}return!1}parseExportFrom(e,t){this.eatContextual(94)?(e.source=this.parseImportSource(),this.maybeParseImportAttributes(e)):t&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:e}=this.state;return e===22&&(this.expectOnePlugin([`decorators`,`decorators-legacy`]),this.hasPlugin(`decorators`))?!0:this.isUsing()||this.isAwaitUsing()?(this.raise(K.UsingDeclarationExport,this.state.startLoc),!0):e===70||e===71||e===64||e===76||this.isLet()||this.isAsyncFunction()}checkNamedExport(e,t){if(e.specifiers?.length)for(let n of e.specifiers){let{exported:e}=n,r=e.type===`Identifier`?e.name:e.value;if(this.checkDuplicateExports(n,r),!t&&n.type===`ExportSpecifier`){let{local:e}=n;e.type===`Identifier`?(this.checkReservedWord(e.name,e.start,!0,!1),this.scope.checkLocalExport(e)):this.raise(K.ExportBindingIsString,n,{localName:e.value,exportName:r})}}else if(e.declaration){let t=e.declaration;if(t.type===`FunctionDeclaration`||t.type===`ClassDeclaration`){let{id:n}=t;if(!n)throw Error(`Assertion failure`);this.checkDuplicateExports(e,n.name)}else if(t.type===`VariableDeclaration`)for(let e of t.declarations)this.checkDeclaration(e.id)}}checkDeclaration(e){if(e.type===`Identifier`)this.checkDuplicateExports(e,e.name);else if(e.type===`ObjectPattern`)for(let t of e.properties)this.checkDeclaration(t);else if(e.type===`ArrayPattern`)for(let t of e.elements)t&&this.checkDeclaration(t);else e.type===`ObjectProperty`?this.checkDeclaration(e.value):e.type===`RestElement`?this.checkDeclaration(e.argument):e.type===`AssignmentPattern`&&this.checkDeclaration(e.left)}checkDuplicateExports(e,t){this.exportedIdentifiers.has(t)&&(t==="default"?this.raise(K.DuplicateDefaultExport,e):this.raise(K.DuplicateExport,e,{exportName:t})),this.exportedIdentifiers.add(t)}parseExportSpecifiers(e){let t=[],n=!0;for(this.expect(2);!this.eat(4);){if(n)n=!1;else if(this.expect(8),this.eat(4))break;let r=this.isContextual(126),i=this.match(130),a=this.startNode();a.local=this.parseModuleExportName(),t.push(this.parseExportSpecifier(a,i,e,r))}return t}parseExportSpecifier(e,t,n,r){return this.eatContextual(89)?e.exported=this.parseModuleExportName():t?e.exported=this.cloneStringLiteral(e.local):e.exported||=this.cloneIdentifier(e.local),this.finishNode(e,`ExportSpecifier`)}parseModuleExportName(){if(this.match(130)){let e=this.parseStringLiteral(this.state.value),t=Hx.exec(e.value);return t&&this.raise(K.ModuleExportNameHasLoneSurrogate,e,{surrogateCharCode:t[0].charCodeAt(0)}),e}return this.parseIdentifier(!0)}checkImportPhase(e){let{specifiers:t}=e,n=t.length===1?t[0].type:null;e.phase===`source`?n!==`ImportDefaultSpecifier`&&this.raise(K.SourcePhaseImportRequiresDefault,t[0]):e.phase===`defer`&&n!==`ImportNamespaceSpecifier`&&this.raise(K.DeferImportRequiresNamespace,t[0])}isPotentialImportPhase(e){return e?!1:this.isContextual(101)||this.isContextual(93)}applyImportPhase(e,t,n,r){t||(n===`source`?(this.expectPlugin(`sourcePhaseImports`,r),e.phase=`source`):n===`defer`?(this.expectPlugin(`deferredImportEvaluation`,r),e.phase=`defer`):this.hasPlugin(`sourcePhaseImports`)&&(e.phase=null))}parseMaybeImportPhase(e,t){if(!this.isPotentialImportPhase(t))return this.applyImportPhase(e,t,null),null;let n=this.startNode(),r=this.parseIdentifierName(!0),{type:i}=this.state;return(Wy(i)?i!==94||this.lookaheadCharCode()===102:i!==8)?(this.applyImportPhase(e,t,r,n.start),null):(this.applyImportPhase(e,t,null),this.createIdentifier(n,r))}isPrecedingIdImportPhase(e){let{type:t}=this.state;return Hy(t)?t!==94||this.lookaheadCharCode()===102:t!==8}parseImport(e){return this.match(130)?this.parseImportSourceAndAttributes(e):this.parseImportSpecifiersAndAfter(e,this.parseMaybeImportPhase(e,!1))}parseImportSpecifiersAndAfter(e,t){e.specifiers=[];let n=!this.maybeParseDefaultImportSpecifier(e,t)||this.eat(8),r=n&&this.maybeParseStarImportSpecifier(e);return n&&!r&&this.parseNamedImportSpecifiers(e),this.expectContextual(94),this.parseImportSourceAndAttributes(e)}parseImportSourceAndAttributes(e){return e.specifiers??=[],e.source=this.parseImportSource(),this.maybeParseImportAttributes(e),this.checkImportPhase(e),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(e,`ImportDeclaration`)}parseImportSource(){return this.match(130)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(e,t,n){t.local=this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(t,n))}finishImportSpecifier(e,t,n=8201){return this.checkLVal(e.local,{type:t},n),this.finishNode(e,t)}parseImportAttributes(){this.expect(2);let e=[],t=new Set;do{if(this.match(4))break;let n=this.startNode(),r=this.state.value;if(t.has(r)&&this.raise(K.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:r}),t.add(r),n.key=this.match(130)?this.parseStringLiteral(r):this.parseIdentifier(!0),this.expect(10),!this.match(130))throw this.raise(K.ModuleAttributeInvalidValue,this.state.startLoc);n.value=this.parseStringLiteral(this.state.value),e.push(this.finishNode(n,`ImportAttribute`))}while(this.eat(8));return this.expect(4),e}maybeParseImportAttributes(e){let t;if(this.match(72)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),t=this.parseImportAttributes()}else t=[];e.attributes=t}maybeParseDefaultImportSpecifier(e,t){if(t){let n=this.startNodeAtNode(t);return n.local=t,e.specifiers.push(this.finishImportSpecifier(n,`ImportDefaultSpecifier`)),!0}return Wy(this.state.type)?(this.parseImportSpecifierLocal(e,this.startNode(),`ImportDefaultSpecifier`),!0):!1}maybeParseStarImportSpecifier(e){if(this.match(51)){let t=this.startNode();return this.next(),this.expectContextual(89),this.parseImportSpecifierLocal(e,t,`ImportNamespaceSpecifier`),!0}return!1}parseNamedImportSpecifiers(e){let t=!0;for(this.expect(2);!this.eat(4);){if(t)t=!1;else{if(this.eat(10))throw this.raise(K.DestructureNamedImport,this.state.startLoc);if(this.expect(8),this.eat(4))break}let n=this.startNode(),r=this.match(130),i=this.isContextual(126);n.imported=this.parseModuleExportName();let a=this.parseImportSpecifier(n,r,e.importKind===`type`||e.importKind===`typeof`,i,void 0);e.specifiers.push(a)}}parseImportSpecifier(e,t,n,r,i){if(this.eatContextual(89))e.local=this.parseIdentifier();else{let{imported:n}=e;if(t)throw this.raise(K.ImportBindingIsString,e,{importName:n.value});this.checkReservedWord(n.name,e.start,!0,!0),e.local||=this.cloneIdentifier(n)}return this.finishImportSpecifier(e,`ImportSpecifier`,i)}isThisParam(e){return e.type===`Identifier`&&e.name===`this`}},Kx=/in(?:stanceof)?|as|satisfies/y;function qx(e){if(e==null)throw Error(`Unexpected ${e} value.`);return e}function Jx(e){if(!e)throw Error(`Assert fail`)}var J=vy`typescript`({AbstractMethodHasImplementation:({methodName:e})=>`Method '${e}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:e})=>`Property '${e}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:`An 'accessor' property cannot be declared optional.`,AccessorCannotDeclareThisParameter:`'get' and 'set' accessors cannot declare 'this' parameters.`,AccessorCannotHaveTypeParameters:`An accessor cannot have type parameters.`,ClassMethodHasDeclare:`Class methods cannot have the 'declare' modifier.`,ClassMethodHasReadonly:`Class methods cannot have the 'readonly' modifier.`,ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:`A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.`,ConstructorHasTypeParameters:`Type parameters cannot appear on a constructor declaration.`,DeclaratorDefiniteAssertionRequiresTypeAnnotation:`Declarations with definite assignment assertions must also have type annotations.`,DeclaratorDefiniteAssertionWithInitializer:`Declarations with initializers cannot also have definite assignment assertions.`,DeclareAccessor:({kind:e})=>`'declare' is not allowed in ${e}ters.`,DeclareClassFieldHasInitializer:`Initializers are not allowed in ambient contexts.`,DeclareFunctionHasImplementation:`An implementation cannot be declared in ambient contexts.`,DecoratorAbstractMethod:({kind:e})=>`Decorators can't be used with ${e.startsWith(`a`)?`an`:`a`} ${e}.`,DuplicateAccessibilityModifier:({modifier:e})=>`Accessibility modifier already seen: '${e}'.`,DuplicateModifier:({modifier:e})=>`Duplicate modifier: '${e}'.`,EmptyHeritageClauseType:({token:e})=>`'${e}' list cannot be empty.`,EmptyNamespaceName:`Namespace must be given a name.`,EmptyTypeArguments:`Type argument list cannot be empty.`,EmptyTypeParameters:`Type parameter list cannot be empty.`,ExpectedAmbientAfterExportDeclare:`'export declare' must be followed by an ambient declaration.`,ExportAssignmentInTSNamespace:`An export assignment cannot be used in a namespace.`,ExportInTSNamespace:`Export declarations are not permitted in a namespace.`,ImportAliasHasImportType:`An import alias can not use 'import type'.`,ImportInTSNamespace:`Import declarations in a namespace cannot reference a module.`,IncompatibleModifiers:({modifiers:e})=>`'${e[0]}' modifier cannot be used with '${e[1]}' modifier.`,IndexSignatureHasAbstract:`Index signatures cannot have the 'abstract' modifier.`,IndexSignatureHasAccessibility:({modifier:e})=>`Index signatures cannot have an accessibility modifier ('${e}').`,IndexSignatureHasDeclare:`Index signatures cannot have the 'declare' modifier.`,IndexSignatureHasOverride:`'override' modifier cannot appear on an index signature.`,IndexSignatureHasStatic:`Index signatures cannot have the 'static' modifier.`,InitializerNotAllowedInAmbientContext:`Initializers are not allowed in ambient contexts.`,InlineModuleDeclarationMustUseString:"`module ... {}` declarations must have a string name. Use `namespace ... {}` instead.",InvalidHeritageClauseType:({token:e})=>`'${e}' list can only include identifiers or qualified-names with optional type arguments.`,InvalidModifierOnAwaitUsingDeclaration:e=>`'${e}' modifier cannot appear on an await using declaration.`,InvalidModifierOnTypeMember:({modifier:e})=>`'${e}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:e})=>`'${e}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:e})=>`'${e}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifierOnUsingDeclaration:e=>`'${e}' modifier cannot appear on a using declaration.`,InvalidModifiersOrder:({orderedModifiers:e})=>`'${e[0]}' modifier must precede '${e[1]}' modifier.`,InvalidNamespaceName:e=>`Namespace name cannot be '${e}'.`,InvalidPropertyAccessAfterInstantiationExpression:`Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.`,InvalidTupleMemberLabel:`Tuple members must be labeled with a simple identifier.`,MissingInterfaceName:`'interface' declarations must be followed by an identifier.`,NamespaceExportInTSNamespace:`Global module exports may only appear at top level.`,NonAbstractClassHasAbstractMethod:`Abstract methods can only appear within an abstract class.`,NonClassMethodPropertyHasAbstractModifier:`'abstract' modifier can only appear on a class, method, or property declaration.`,OptionalTypeBeforeRequired:`A required element cannot follow an optional element.`,OverrideNotInSubClass:`This member cannot have an 'override' modifier because its containing class does not extend another class.`,PatternIsOptional:`A binding pattern parameter cannot be optional in an implementation signature.`,PrivateElementHasAbstract:`Private elements cannot have the 'abstract' modifier.`,PrivateElementHasAccessibility:({modifier:e})=>`Private elements cannot have an accessibility modifier ('${e}').`,ReadonlyForMethodSignature:`'readonly' modifier can only appear on a property declaration or index signature.`,ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:`A 'set' accessor cannot have an optional parameter.`,SetAccessorCannotHaveRestParameter:`A 'set' accessor cannot have rest parameter.`,SetAccessorCannotHaveReturnType:`A 'set' accessor cannot have a return type annotation.`,SingleTypeParameterWithoutTrailingComma:({typeParameterName:e})=>`Single type parameter ${e} should have a trailing comma. Example usage: <${e},>.`,StaticBlockCannotHaveModifier:`Static class blocks cannot have any modifier.`,TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:`A type-only import can specify a default import or named bindings, but not both.`,TypeModifierIsUsedInTypeExports:`The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.`,TypeModifierIsUsedInTypeImports:`The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.`,UnexpectedParameterInitializer:`A parameter initializer is only allowed in a function or constructor implementation.`,UnexpectedParameterModifier:`A parameter property is only allowed in a constructor implementation.`,UnexpectedReadonly:`'readonly' type modifier is only permitted on array and tuple literal types.`,UnexpectedTypeAnnotation:`Did not expect a type annotation here.`,UnexpectedTypeCastInParameter:`Unexpected type cast in parameter position.`,UnexpectedTypeDeclaration:e=>`'${e}' declarations can only be declared inside a block.`,UnsupportedImportTypeArgument:`Argument in a type import must be a string literal.`,UnsupportedParameterPropertyKind:`A parameter property may not be declared using a binding pattern.`,UnsupportedSignatureParameterKind:({type:e})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${e}.`,UsingDeclarationInAmbientContext:e=>`'${e}' declarations are not allowed in ambient contexts.`});function Yx(e){switch(e){case`any`:return`TSAnyKeyword`;case`boolean`:return`TSBooleanKeyword`;case`bigint`:return`TSBigIntKeyword`;case`never`:return`TSNeverKeyword`;case`number`:return`TSNumberKeyword`;case`object`:return`TSObjectKeyword`;case`string`:return`TSStringKeyword`;case`symbol`:return`TSSymbolKeyword`;case`undefined`:return`TSUndefinedKeyword`;case`unknown`:return`TSUnknownKeyword`;default:return}}function Xx(e){return e===`private`||e===`public`||e===`protected`}function Zx(e){return e===`in`||e===`out`}function Qx(e){if(e.extra?.parenthesized)return!1;switch(e.type){case`Identifier`:return!0;case`MemberExpression`:return!e.computed&&Qx(e.object);case`TSInstantiationExpression`:return Qx(e.expression);default:return!1}}var $x=lS([`declare`,`private`,`public`,`protected`,`override`,`abstract`,`readonly`,`static`],[`in`,`out`]),eS=lS([`readonly`],[`declare`,`abstract`,`private`,`protected`,`public`,`static`,`override`]),tS=lS([`public`,`private`,`protected`,`override`,`readonly`]),nS=lS([`private`,`public`,`protected`]),rS=e=>class extends e{getScopeHandler(){return $b}tsIsIdentifier(){return Hy(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(2)||this.match(51)||this.match(17)||this.match(134)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),!this.hasPrecedingLineBreak()&&this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(102)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,t,n){if(!Hy(this.state.type)&&this.state.type!==54&&this.state.type!==71)return;let r=this.state.value;if(e.has(r)){if(n&&this.match(102)||t&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return r}}tsParseModifiers(e,t=J.InvalidModifierOnTypeMember,n,r=!1){let i=(e,t,r,i)=>{t===r&&n[i]&&this.raise(J.InvalidModifiersOrder,e,{orderedModifiers:[r,i]})},a=(e,t,r,i)=>{(n[r]&&t===i||n[i]&&t===r)&&this.raise(J.IncompatibleModifiers,e,{modifiers:[r,i]})};for(;;){let{startLoc:o}=this.state,s=this.tsParseModifier(e,r,n.static);if(!s)break;Xx(s)?n.accessibility?this.raise(J.DuplicateAccessibilityModifier,o,{modifier:s}):(i(o,s,s,`override`),i(o,s,s,`static`),i(o,s,s,`readonly`),n.accessibility=s):Zx(s)?(n[s]&&this.raise(J.DuplicateModifier,o,{modifier:s}),n[s]=!0,i(o,s,`in`,`out`)):(Object.hasOwn(n,s)?this.raise(J.DuplicateModifier,o,{modifier:s}):(i(o,s,`static`,`readonly`),i(o,s,`static`,`override`),i(o,s,`override`,`readonly`),i(o,s,`abstract`,`override`),a(o,s,`declare`,`override`),a(o,s,`static`,`abstract`)),n[s]=!0),e.get(s)||this.raise(t,o,{modifier:s})}}tsIsListTerminator(e){switch(e){case`EnumMembers`:case`TypeMembers`:return this.match(4);case`HeritageClauseElement`:return this.match(2);case`TupleElementTypes`:return this.match(1);case`TypeParametersOrArguments`:return this.match(44)}}tsParseList(e,t){let n=[];for(;!this.tsIsListTerminator(e);)n.push(t());return n}tsParseDelimitedList(e,t,n){return qx(this.tsParseDelimitedListWorker(e,t,!0,n))}tsParseDelimitedListWorker(e,t,n,r){let i=[],a=-1;for(;!this.tsIsListTerminator(e);){a=-1;let r=t();if(r==null)return;if(i.push(r),this.eat(8)){a=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(e))break;n&&this.expect(8);return}return r&&(r.value=a),i}tsParseBracketedList(e,t,n,r,i){r||(n?this.expect(0):this.expect(43));let a=this.tsParseDelimitedList(e,t,i);return n?this.expect(1):this.expect(44),a}tsParseImportType(){let e=this.startNode();return this.expect(79),this.expect(6),this.match(130)?e.source=this.parseStringLiteral(this.state.value):(this.raise(J.UnsupportedImportTypeArgument,this.state.startLoc),e.source=this.tsParseNonConditionalType()),e.options=this.eat(8)?this.tsParseImportTypeOptions():null,this.expect(7),this.eat(12)&&(e.qualifier=this.tsParseEntityName(3)),this.match(43)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,`TSImportType`)}tsParseImportTypeOptions(){let e=this.startNode();this.expect(2);let t=this.startNode();return this.isContextual(72)?(t.method=!1,t.key=this.parseIdentifier(!0),t.computed=!1,t.shorthand=!1):this.unexpected(null,72),this.expect(10),t.value=this.tsParseImportTypeWithPropertyValue(),e.properties=[this.finishObjectProperty(t)],this.eat(8),this.expect(4),this.finishNode(e,`ObjectExpression`)}tsParseImportTypeWithPropertyValue(){let e=this.startNode(),t=[];for(this.expect(2);!this.match(4);){let e=this.state.type;Hy(e)||e===130?t.push(super.parsePropertyDefinition(null)):this.unexpected(),this.eat(8)}return e.properties=t,this.next(),this.finishNode(e,`ObjectExpression`)}tsParseEntityName(e){let t;if(e&1&&this.match(74)){if(e&2)t=this.parseIdentifier(!0);else{let e=this.startNode();this.next(),t=this.finishNode(e,`ThisExpression`)}}else t=this.parseIdentifier(!!(e&1));for(;this.eat(12);){let n=this.startNodeAtNode(t);n.left=t,n.right=this.parseIdentifier(!!(e&1)),t=this.finishNode(n,`TSQualifiedName`)}return t}tsParseTypeReference(){let e=this.startNode();return e.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(43)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,`TSTypeReference`)}tsParseThisTypePredicate(e){this.next();let t=this.startNodeAtNode(e);return t.parameterName=e,t.typeAnnotation=this.tsParseTypeAnnotation(!1),t.asserts=!1,this.finishNode(t,`TSTypePredicate`)}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,`TSThisType`)}tsParseTypeQuery(){let e=this.startNode();return this.expect(83),e.exprName=this.match(79)?this.tsParseImportType():this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(43)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,`TSTypeQuery`)}tsParseInOutModifiers=this.tsParseModifiers.bind(this,lS([`in`,`out`],[`const`,`public`,`private`,`protected`,`readonly`,`declare`,`abstract`,`override`]),J.InvalidModifierOnTypeParameter);tsParseConstModifier=this.tsParseModifiers.bind(this,lS([`const`],[`in`,`out`]),J.InvalidModifierOnTypeParameterPositions);tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,lS([`in`,`out`,`const`],[`public`,`private`,`protected`,`readonly`,`declare`,`abstract`,`override`]),J.InvalidModifierOnTypeParameter);tsParseTypeParameter(e){let t=this.startNode();return e(t),t.name=this.tsParseTypeParameterName(),t.constraint=this.tsEatThenParseType(77),t.default=this.tsEatThenParseType(25),this.finishNode(t,`TSTypeParameter`)}tsTryParseTypeParameters(e){if(this.match(43))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let t=this.startNode();this.match(43)||this.match(138)?this.next():this.unexpected();let n={value:-1};return t.params=this.tsParseBracketedList(`TypeParametersOrArguments`,this.tsParseTypeParameter.bind(this,e),!1,!0,n),t.params.length===0&&this.raise(J.EmptyTypeParameters,t),n.value!==-1&&this.addExtra(t,`trailingComma`,n.value),this.finishNode(t,`TSTypeParameterDeclaration`)}tsFillSignature(e,t){let n=e===15;t.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(6),t.params=this.tsParseBindingListForSignature(),(n||this.match(e))&&(t.returnType=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(7,41,2);for(let t of e){let{type:e}=t;(e===`AssignmentPattern`||e===`TSParameterProperty`)&&this.raise(J.UnsupportedSignatureParameterKind,t,{type:e})}return e}tsParseTypeMemberSemicolon(){!this.eat(8)&&!this.isLineTerminator()&&this.expect(9)}tsParseSignatureMember(e,t){return this.tsFillSignature(10,t),this.tsParseTypeMemberSemicolon(),this.finishNode(t,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),Hy(this.state.type)?(this.next(),this.match(10)):!1}tsTryParseIndexSignature(e){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let t=this.parseIdentifier();t.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(t),this.expect(1),e.parameters=[t];let n=this.tsTryParseTypeAnnotation();return n&&(e.typeAnnotation=n),this.tsParseTypeMemberSemicolon(),this.finishNode(e,`TSIndexSignature`)}tsParsePropertyOrMethodSignature(e,t){if(this.eat(13)&&(e.optional=!0),this.match(6)||this.match(43)){t&&this.raise(J.ReadonlyForMethodSignature,e);let n=e;if(n.kind&&this.match(43)&&this.raise(J.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(10,n),this.tsParseTypeMemberSemicolon(),n.kind===`get`)n.params.length>0&&(this.raise(K.BadGetterArity,this.state.curPosition()),this.isThisParam(n.params[0])&&this.raise(J.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(n.kind===`set`){if(n.params.length!==1)this.raise(K.BadSetterArity,this.state.curPosition());else{let e=n.params[0];this.isThisParam(e)&&this.raise(J.AccessorCannotDeclareThisParameter,this.state.curPosition()),e.type===`Identifier`&&e.optional&&this.raise(J.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),e.type===`RestElement`&&this.raise(J.SetAccessorCannotHaveRestParameter,this.state.curPosition())}n.returnType&&this.raise(J.SetAccessorCannotHaveReturnType,n.returnType)}else n.kind=`method`;return this.finishNode(n,`TSMethodSignature`)}{let n=e;t&&(n.readonly=!0);let r=this.tsTryParseTypeAnnotation();return r&&(n.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(n,`TSPropertySignature`)}}tsParseTypeMember(){let e=this.startNode();if(this.match(6)||this.match(43))return this.tsParseSignatureMember(`TSCallSignatureDeclaration`,e);if(this.match(73)){let t=this.startNode();return this.next(),this.match(6)||this.match(43)?this.tsParseSignatureMember(`TSConstructSignatureDeclaration`,e):(e.key=this.createIdentifier(t,`new`),this.tsParsePropertyOrMethodSignature(e,!1))}return this.tsParseModifiers(eS,void 0,e),this.tsTryParseIndexSignature(e)||(super.parsePropertyName(e),!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.tsTokenCanFollowModifier()&&(e.kind=e.key.name,super.parsePropertyName(e),!this.match(6)&&!this.match(43)&&this.unexpected(null,6)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,`TSTypeLiteral`)}tsParseObjectTypeMembers(){this.expect(2);let e=this.tsParseList(`TypeMembers`,this.tsParseTypeMember.bind(this));return this.expect(4),e}tsIsStartOfMappedType(){return this.next(),this.eat(49)?this.isContextual(118):(this.isContextual(118)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(54)))}tsParseMappedType(){let e=this.startNode();return this.expect(2),this.match(49)?(e.readonly=this.state.value,this.next(),this.expectContextual(118)):this.eatContextual(118)&&(e.readonly=!0),this.expect(0),e.key=this.tsParseTypeParameterName(),e.constraint=this.tsExpectThenParseType(54),e.nameType=this.eatContextual(89)?this.tsParseType():null,this.expect(1),this.match(49)?(e.optional=this.state.value,this.next(),this.expect(13)):this.eat(13)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(4),this.finishNode(e,`TSMappedType`)}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList(`TupleElementTypes`,this.tsParseTupleElementType.bind(this),!0,!1);let t=!1;return e.elementTypes.forEach(e=>{let{type:n}=e;t&&n!==`TSRestType`&&n!==`TSOptionalType`&&!(n===`TSNamedTupleMember`&&e.optional)&&this.raise(J.OptionalTypeBeforeRequired,e),t||=n===`TSNamedTupleMember`&&e.optional||n===`TSOptionalType`}),this.finishNode(e,`TSTupleType`)}tsParseTupleElementType(){let e=this.state.startLoc,t=this.eat(17),{startLoc:n}=this.state,r,i,a,o,s=Wy(this.state.type)?this.lookaheadCharCode():null;if(s===58)r=!0,a=!1,i=this.parseIdentifier(!0),this.expect(10),o=this.tsParseType();else if(s===63){a=!0;let e=this.state.value,t=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(r=!0,i=this.createIdentifier(this.startNodeAt(n),e),this.expect(13),this.expect(10),o=this.tsParseType()):(r=!1,o=t,this.expect(13))}else o=this.tsParseType(),a=this.eat(13),r=this.eat(10);if(r){let e;i?(e=this.startNodeAt(n),e.optional=a,e.label=i,e.elementType=o,this.eat(13)&&(e.optional=!0,this.raise(J.TupleOptionalAfterType,this.state.lastTokStartLoc))):(e=this.startNodeAt(n),e.optional=a,this.raise(J.InvalidTupleMemberLabel,o),e.label=o,e.elementType=this.tsParseType()),o=this.finishNode(e,`TSNamedTupleMember`)}else if(a){let e=this.startNodeAt(n);e.typeAnnotation=o,o=this.finishNode(e,`TSOptionalType`)}if(t){let t=this.startNodeAt(e);t.typeAnnotation=o,o=this.finishNode(t,`TSRestType`)}return o}tsParseParenthesizedType(){let e=this.startNode();return this.expect(6),e.typeAnnotation=this.tsParseType(),this.expect(7),this.finishNode(e,`TSParenthesizedType`)}tsParseFunctionOrConstructorType(e,t){let n=this.startNode();return e===`TSConstructorType`&&(n.abstract=!!t,t&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(15,n)),this.finishNode(n,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 131:case 132:case 130:case 81:case 82:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,`TSLiteralType`)}tsParseTemplateLiteralType(){let e=this.state.startLoc,t=this.parseTemplateElement(!1),n=[t];if(t.tail){let t=this.startNodeAt(e),r=this.startNodeAt(e);return r.expressions=[],r.quasis=n,t.literal=this.finishNode(r,`TemplateLiteral`),this.finishNode(t,`TSLiteralType`)}{let r=[];for(;!t.tail;)r.push(this.tsParseType()),this.readTemplateContinuation(),n.push(t=this.parseTemplateElement(!1));let i=this.startNodeAt(e);return i.types=r,i.quasis=n,this.finishNode(i,`TSTemplateLiteralType`)}}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(112)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 130:case 131:case 132:case 81:case 82:return this.tsParseLiteralTypeNode();case 49:if(this.state.value===`-`){let e=this.startNode(),t=this.lookahead();return t.type!==131&&t.type!==132&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,`TSLiteralType`)}break;case 74:return this.tsParseThisTypeOrThisTypePredicate();case 83:return this.tsParseTypeQuery();case 79:return this.tsParseImportType();case 2:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 6:if(!(this.optionFlags&2048)){let e=this.state.startLoc;this.next();let t=this.tsParseType();return this.expect(7),this.addExtra(t,`parenthesized`,!0),this.addExtra(t,`parenStart`,e.index),t}return this.tsParseParenthesizedType();case 21:case 20:return this.tsParseTemplateLiteralType();default:{let{type:e}=this.state;if(Hy(e)||e===84||e===80){let t=e===84?`TSVoidKeyword`:e===80?`TSNullKeyword`:Yx(this.state.value);if(t!==void 0&&this.lookaheadCharCode()!==46){let e=this.startNode();return this.next(),this.finishNode(e,t)}return this.tsParseTypeReference()}}}throw this.unexpected()}tsParseArrayTypeOrHigher(){let{startLoc:e}=this.state,t=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(1)){let n=this.startNodeAt(e);n.elementType=t,this.expect(1),t=this.finishNode(n,`TSArrayType`)}else{let n=this.startNodeAt(e);n.objectType=t,n.indexType=this.tsParseType(),this.expect(1),t=this.finishNode(n,`TSIndexedAccessType`)}return t}tsParseTypeOperator(){let e=this.startNode(),t=this.state.value;return this.next(),e.operator=t,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),t===`readonly`&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,`TSTypeOperator`)}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case`TSTupleType`:case`TSArrayType`:return;default:this.raise(J.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(111);let t=this.startNode();return t.name=this.tsParseTypeParameterName(),t.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(t,`TSTypeParameter`),this.finishNode(e,`TSInferType`)}tsParseConstraintForInferType(){if(this.eat(77)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(13))return e}}tsParseTypeOperatorOrHigher(){return tb(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(111)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,t,n){let r=this.startNode(),i=this.eat(n),a=[];do a.push(t());while(this.eat(n));return a.length===1&&!i?a[0]:(r.types=a,this.finishNode(r,e))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType(`TSIntersectionType`,this.tsParseTypeOperatorOrHigher.bind(this),41)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType(`TSUnionType`,this.tsParseIntersectionTypeOrHigher.bind(this),39)}tsIsStartOfFunctionType(){return this.match(43)?!0:this.match(6)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(Hy(this.state.type)||this.match(74))return this.next(),!0;if(this.match(2)){let{errors:e}=this.state,t=e.length;try{return this.parseObjectLike(4,!0),e.length===t}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,t=e.length;try{return super.parseBindingList(1,93,1),e.length===t}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(7)||this.match(17)||this.tsSkipParameterStart()&&(this.match(10)||this.match(8)||this.match(13)||this.match(25)||this.match(7)&&(this.next(),this.match(15))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let t=this.startNode();this.expect(e);let n=this.startNode(),r=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(r&&this.match(74)){let e=this.tsParseThisTypeOrThisTypePredicate();return e.type===`TSThisType`?(n.parameterName=e,n.asserts=!0,n.typeAnnotation=null,e=this.finishNode(n,`TSTypePredicate`)):(this.resetStartLocationFromNode(e,n),e.asserts=!0),t.typeAnnotation=e,this.finishNode(t,`TSTypeAnnotation`)}let i=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!i)return r?(n.parameterName=this.parseIdentifier(),n.asserts=r,n.typeAnnotation=null,t.typeAnnotation=this.finishNode(n,`TSTypePredicate`),this.finishNode(t,`TSTypeAnnotation`)):this.tsParseTypeAnnotation(!1,t);let a=this.tsParseTypeAnnotation(!1);return n.parameterName=i,n.typeAnnotation=a,n.asserts=r,t.typeAnnotation=this.finishNode(n,`TSTypePredicate`),this.finishNode(t,`TSTypeAnnotation`)})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(10))return this.tsParseTypeOrTypePredicateAnnotation(10)}tsTryParseTypeAnnotation(){if(this.match(10))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(10)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(112)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==105)return!1;let e=this.state.containsEsc;return this.next(),!Hy(this.state.type)&&!this.match(74)?!1:(e&&this.raise(K.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:`asserts`}),!0)}tsParseTypeAnnotation(e=!0,t=this.startNode()){return this.tsInType(()=>{e&&this.expect(10),t.typeAnnotation=this.tsParseType()}),this.finishNode(t,`TSTypeAnnotation`)}tsParseType(){Jx(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(77))return e;let t=this.startNodeAtNode(e);return t.checkType=e,t.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(13),t.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(10),t.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(t,`TSConditionalType`)}isAbstractConstructorSignature(){return this.isContextual(120)&&this.isLookaheadContextual(`new`)}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType(`TSFunctionType`):this.match(73)?this.tsParseFunctionOrConstructorType(`TSConstructorType`):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType(`TSConstructorType`,!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption(`typescript`,`disallowAmbiguousJSXLike`)&&this.raise(J.ReservedTypeAssertion,this.state.startLoc);let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(71)?this.tsParseTypeReference():this.tsParseType())),this.expect(44),e.expression=this.parseMaybeUnary(),this.finishNode(e,`TSTypeAssertion`)}tsParseHeritageClause(e){let t=this.state.startLoc,n=this.tsParseDelimitedList(`HeritageClauseElement`,()=>{let t=(this.state.canStartArrow=!1,super.parseExprSubscripts());Qx(t)||this.raise(J.InvalidHeritageClauseType,t.start,{token:e});let n=e===`extends`?`TSInterfaceHeritage`:`TSClassImplements`;if(t.type===`TSInstantiationExpression`)return t.type=n,t;let r=this.startNodeAtNode(t);return r.expression=t,(this.match(43)||this.match(47))&&(r.typeArguments=this.tsParseTypeArgumentsInExpression()),this.finishNode(r,n)});return n.length||this.raise(J.EmptyHeritageClauseType,t,{token:e}),n}tsParseInterfaceDeclaration(e,t={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(125),t.declare&&(e.declare=!0),Hy(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(J.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(77)&&(e.extends=this.tsParseHeritageClause(`extends`));let n=this.startNode();return n.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(n,`TSInterfaceBody`),this.finishNode(e,`TSInterfaceDeclaration`)}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,2),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(25),this.isContextual(110)&&this.lookaheadCharCode()!==46){let e=this.startNode();return this.next(),this.finishNode(e,`TSIntrinsicKeyword`)}return this.tsParseType()}),this.semicolon(),this.finishNode(e,`TSTypeAliasDeclaration`)}tsInTopLevelContext(e){if(this.curContext()!==lb.brace){let t=this.state.context;this.state.context=[t[0]];try{return e()}finally{this.state.context=t}}else return e()}tsInType(e){let t=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=t}}tsInDisallowConditionalTypesContext(e){let t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}tsInAllowConditionalTypesContext(e){let t=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=t}}tsEatThenParseType(e){if(this.match(e))return this.tsNextThenParseType()}tsExpectThenParseType(e){return this.tsInType(()=>(this.expect(e),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let e=this.startNode();return e.id=this.match(130)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(25)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,`TSEnumMember`)}tsParseEnumDeclaration(e,t={}){return t.const&&(e.const=!0),t.declare&&(e.declare=!0),this.expectContextual(122),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),e.body=this.tsParseEnumBody(),this.finishNode(e,`TSEnumDeclaration`)}tsParseEnumBody(){let e=this.startNode();return this.expect(2),e.members=this.tsParseDelimitedList(`EnumMembers`,this.tsParseEnumMember.bind(this)),this.expect(4),this.finishNode(e,`TSEnumBody`)}tsParseModuleBlock(e){let t=this.startNode();return e||this.scope.enter(0),this.expect(2),super.parseBlockOrModuleBlockBody(t.body=[],void 0,!0,4),e||this.scope.exit(),this.finishNode(t,`TSModuleBlock`)}tsParseNamespaceDeclaration(e){return e.id=this.tsParseEntityName(0),e.id.type===`Identifier`&&this.checkIdentifier(e.id,1024),this.scope.enter(2048),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(!1),this.prodParam.exit(),this.scope.exit(),this.finishNode(e,`TSModuleDeclaration`)}tsParseAmbientExternalModuleDeclaration(e){let t=this.isContextual(108);if(t)e.kind=`global`,e.id=this.parseIdentifier();else{e.kind=`module`;let{type:t,value:n}=this.state;t===130?e.id=super.parseStringLiteral(n):Hy(t)?(this.raise(J.InlineModuleDeclarationMustUseString,this.state.startLoc),e.id=this.tsParseEntityName(0)):t===2?this.raise(J.EmptyNamespaceName,this.state.startLoc):(this.raise(J.InvalidNamespaceName,this.state.startLoc,n),e.id=super.parseExprAtom())}return this.match(2)?(t||this.scope.enter(1024),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(t),this.prodParam.exit(),t||this.scope.exit()):this.semicolon(),this.finishNode(e,`TSModuleDeclaration`)}tsParseImportEqualsDeclaration(e,t){e.id=t||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(25);let n=this.tsParseModuleReference();return e.importKind===`type`&&n.type!==`TSExternalModuleReference`&&this.raise(J.ImportAliasHasImportType,n),e.moduleReference=n,this.semicolon(),this.finishNode(e,`TSImportEqualsDeclaration`)}tsIsExternalModuleReference(){return this.isContextual(115)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(115),this.expect(6),this.match(130)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(7),this.sawUnambiguousESM=!0,this.finishNode(e,`TSExternalModuleReference`)}tsLookAhead(e){let t=this.state.clone(),n=e();return this.state=t,n}tsTryParseAndCatch(e){let t=this.tryParse(t=>e()||t());if(!t.aborted&&t.node)return t.error&&(this.state=t.failState),t.node}tsTryParse(e){let t=this.state.clone(),n=e();if(n!==void 0&&n!==!1)return n;this.state=t}tsTryParseDeclare(e){if(this.isLineTerminator())return;let t=this.state.type;return this.tsInAmbientContext(()=>{switch(t){case 64:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 76:return e.declare=!0,this.parseClass(e,!0,!1);case 122:return this.tsParseEnumDeclaration(e,{declare:!0});case 108:return this.tsParseAmbientExternalModuleDeclaration(e);case 96:if(this.state.containsEsc)return;case 71:case 70:return!this.match(71)||!this.isLookaheadContextual(`enum`)?(e.declare=!0,this.parseVarStatement(e,this.state.value,!0)):(this.expect(71),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 103:if(this.isUsing())return this.raise(J.InvalidModifierOnUsingDeclaration,this.state.startLoc,`declare`),e.declare=!0,this.parseVarStatement(e,`using`,!0);break;case 92:if(this.isAwaitUsing())return this.raise(J.InvalidModifierOnAwaitUsingDeclaration,this.state.startLoc,`declare`),e.declare=!0,this.next(),this.parseVarStatement(e,`await using`,!0);break;case 125:{let t=this.tsParseInterfaceDeclaration(e,{declare:!0});if(t)return t}default:if(Hy(t))return this.tsParseDeclaration(e,this.state.type,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.type,!0,null)}tsParseDeclaration(e,t,n,r){switch(t){case 120:if(this.tsCheckLineTerminator(n)&&(this.match(76)||Hy(this.state.type)))return this.tsParseAbstractDeclaration(e,r);break;case 123:if(this.tsCheckLineTerminator(n))return this.tsParseAmbientExternalModuleDeclaration(e);break;case 124:if(this.tsCheckLineTerminator(n)&&Hy(this.state.type))return e.kind=`namespace`,this.tsParseNamespaceDeclaration(e);break;case 126:if(this.tsCheckLineTerminator(n)&&Hy(this.state.type))return this.tsParseTypeAliasDeclaration(e)}}tsCheckLineTerminator(e){return e?!this.hasFollowingLineBreak()&&(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e){if(!this.match(43))return;let t=this.tsTryParseAndCatch(()=>{let t=this.startNodeAt(e);return t.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(t),t.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(15),t});if(t)return super.parseArrowExpression(t,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===43)return this.tsParseTypeArguments()}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(43),this.tsParseDelimitedList(`TypeParametersOrArguments`,this.tsParseType.bind(this))))),e.params.length===0?this.raise(J.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===lb.brace&&this.reScan_lt_gt(),this.expect(44),this.finishNode(e,`TSTypeParameterInstantiation`)}tsIsDeclarationStart(){return nb(this.state.type)}isExportDefaultSpecifier(){return!this.tsIsDeclarationStart()&&super.isExportDefaultSpecifier()}parseBindingElement(e,t){let n=t.length?null:this.state.startLoc,r={};this.tsParseModifiers(tS,void 0,r);let i=r.accessibility,a=r.override,o=r.readonly;!(e&4)&&(i||o||a)&&this.raise(J.UnexpectedParameterModifier,n||t[0]);let s=this.state.startLoc,c=this.parseMaybeDefault(s);e&2&&this.parseFunctionParamType(c);let l=this.parseMaybeDefault(s,c);if(i||o||a){let e=n?this.startNodeAt(n):this.startNodeAtNode(t[0]);return t.length?e.decorators=t:this.setLoc(n),i&&(e.accessibility=i),o&&(e.readonly=o),a&&(e.override=a),l.type!==`Identifier`&&l.type!==`AssignmentPattern`&&this.raise(J.UnsupportedParameterPropertyKind,n||t[0]),e.parameter=l,this.finishNode(e,`TSParameterProperty`)}return t.length&&(c.decorators=t),l}isSimpleParameter(e){return e.type===`TSParameterProperty`&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let t of e.params)t.type!==`Identifier`&&t.optional&&!this.state.isAmbientContext&&this.raise(J.PatternIsOptional,t)}setArrowFunctionParameters(e,t,n){super.setArrowFunctionParameters(e,t,n),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,t,n=!1){this.match(10)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(10));let r=t===`FunctionDeclaration`?`TSDeclareFunction`:t===`ClassMethod`||t===`ClassPrivateMethod`?`TSDeclareMethod`:void 0;if(r&&!this.match(2)&&this.isLineTerminator()){if(r===`TSDeclareMethod`&&e.kind===`constructor`)for(let t of e.params)t.type===`TSParameterProperty`?this.raise(J.UnexpectedParameterModifier,t):t.type===`AssignmentPattern`&&this.raise(J.UnexpectedParameterInitializer,t);else for(let t of e.params)t.type===`AssignmentPattern`&&this.raise(J.UnexpectedParameterInitializer,t);return this.finishNode(e,r)}return r&&this.state.isAmbientContext&&(this.raise(J.DeclareFunctionHasImplementation,this.state.startLoc),r===`TSDeclareFunction`&&e.declare)?super.parseFunctionBodyAndFinish(e,r,n):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,t,n))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(e=>{e?.type===`TSTypeCastExpression`&&this.raise(J.UnexpectedTypeAnnotation,e.typeAnnotation)})}toReferencedList(e,t){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,t){let n=super.parseArrayLike(e,t);return n.type===`ArrayExpression`&&this.tsCheckForInvalidTypeCasts(n.elements),n}parseSubscript(e,t,n,r){if(!this.hasPrecedingLineBreak()&&this.match(31)){this.state.canStartJSXElement=!1,this.next();let n=this.startNodeAt(t);return n.expression=e,this.finishNode(n,`TSNonNullExpression`)}let i=!1;if(this.match(14)&&this.lookaheadCharCode()===60){if(n)return r.stop=!0,e;r.optionalChainMember=i=!0,this.next()}if(this.match(43)||this.match(47)){let a,o=this.tsTryParseAndCatch(()=>{if(!n&&this.atPossibleAsyncArrow(e)){let e=this.tsTryParseGenericAsyncArrowFunction(t);if(e)return r.stop=!0,e}let o=this.tsParseTypeArgumentsInExpression();if(!o)return;if(i&&!this.match(6)){a=this.state.curPosition();return}if(ob(this.state.type)){let n=super.parseTaggedTemplateExpression(e,t,r);return n.typeArguments=o,n}if(!n&&this.eat(6)){let n=this.startNodeAt(t);return n.callee=e,n.arguments=this.parseCallExpressionArguments(),this.tsCheckForInvalidTypeCasts(n.arguments),n.typeArguments=o,r.optionalChainMember&&(n.optional=i),this.finishCallExpression(n,r.optionalChainMember)}let s=this.state.type;if(s===44||s===48||s!==6&&s!==89&&s!==116&&qy(s)&&!this.hasPrecedingLineBreak())return;let c=this.startNodeAt(t);return c.expression=e,c.typeArguments=o,this.finishNode(c,`TSInstantiationExpression`)});if(a&&this.unexpected(a,6),o)return o.type===`TSInstantiationExpression`&&((this.match(12)||this.match(14)&&this.lookaheadCharCode()!==40)&&this.raise(J.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),!this.match(12)&&!this.match(14)&&(o.expression=super.stopParseSubscript(e,r))),o}return super.parseSubscript(e,t,n,r)}parseNewCallee(e){super.parseNewCallee(e);let{callee:t}=e;t.type===`TSInstantiationExpression`&&!t.extra?.parenthesized&&(e.typeArguments=t.typeArguments,e.callee=t.expression)}parseExprOp(e,t,n){let r;if(ib(54)>n&&!this.hasPrecedingLineBreak()&&(this.isContextual(89)||(r=this.isContextual(116)))){let i=this.startNodeAt(t);i.expression=e,i.typeAnnotation=this.tsInType(()=>(this.next(),this.match(71)?(r&&this.raise(K.UnexpectedKeyword,this.state.startLoc,{keyword:`const`}),this.tsParseTypeReference()):this.tsParseType()));let a=this.finishNode(i,r?`TSSatisfiesExpression`:`TSAsExpression`);return this.reScan_lt_gt(),this.parseExprOp(a,t,n)}return super.parseExprOp(e,t,n)}checkReservedWord(e,t,n,r){this.state.isAmbientContext||super.checkReservedWord(e,t,n,r)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(126)){let t=this.lookaheadCharCode();return e?t===123||t===42:t!==61}return!e&&this.isContextual(83)}applyImportPhase(e,t,n,r){super.applyImportPhase(e,t,n,r),t?e.exportKind=n===`type`?`type`:`value`:e.importKind=n===`type`||n===`typeof`?n:`value`}parseImport(e){if(this.match(130))return e.importKind=`value`,this.scope.inTSNamespace&&this.raise(J.ImportInTSNamespace,e),super.parseImport(e);let t;if(Hy(this.state.type)&&this.lookaheadCharCode()===61){e.importKind=`value`;let t=this.tsParseImportEqualsDeclaration(e);return this.scope.inTSNamespace&&t.moduleReference.type===`TSExternalModuleReference`&&this.raise(J.ImportInTSNamespace,e),t}if(this.isContextual(126)){let n=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.scope.inTSNamespace&&this.raise(J.ImportInTSNamespace,e),this.tsParseImportEqualsDeclaration(e,n);t=super.parseImportSpecifiersAndAfter(e,n)}else t=super.parseImport(e);return t.importKind===`type`&&t.specifiers.length>1&&t.specifiers[0].type===`ImportDefaultSpecifier`?this.raise(J.TypeImportCannotSpecifyDefaultAndNamed,t):this.scope.inTSNamespace&&this.raise(J.ImportInTSNamespace,t),t}parseExport(e,t){if(this.match(79)){let t=this.startNode();this.next();let n=null;this.isContextual(126)&&this.isPotentialImportPhase(!1)?n=this.parseMaybeImportPhase(t,!1):t.importKind=`value`;let r=this.tsParseImportEqualsDeclaration(t,n);return e.attributes=[],e.declaration=r,e.exportKind=`value`,e.source=null,e.specifiers=[],this.finishNode(e,`ExportNamedDeclaration`)}if(this.eat(25)){let t=e;return t.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.scope.inTSNamespace&&this.raise(J.ExportAssignmentInTSNamespace,t),this.finishNode(t,`TSExportAssignment`)}if(this.eatContextual(89)){let t=e;return this.expectContextual(124),t.id=this.parseIdentifier(),this.checkIdentifier(t.id,8201),this.semicolon(),this.scope.inTSNamespace&&this.raise(J.NamespaceExportInTSNamespace,t),this.finishNode(t,`TSNamespaceExportDeclaration`)}{let n=super.parseExport(e,t);return this.scope.inTSNamespace&&(n.type!==`ExportNamedDeclaration`||n.source||!n.declaration&&!this.state.isAmbientContext)&&this.raise(J.ExportInTSNamespace,n),n}}isAbstractClass(){return this.isContextual(120)&&this.isLookaheadContextual(`class`)}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(125)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,t,n=!1){let{isAmbientContext:r}=this.state,i=super.parseVarStatement(e,t,n||r);if(r&&!e.declare&&(t===`using`||t===`await using`))return this.raiseOverwrite(J.UsingDeclarationInAmbientContext,e,t),i;for(let e of i.declarations){let{id:n,init:i,definite:a}=e;a&&(i?this.raise(J.DeclaratorDefiniteAssertionWithInitializer,n):n.typeAnnotation||this.raise(J.DeclaratorDefiniteAssertionRequiresTypeAnnotation,n)),r&&i&&(t===`var`||t===`let`||n.typeAnnotation?this.raise(J.InitializerNotAllowedInAmbientContext,i):aS(i,this.hasPlugin(`estree`))||this.raise(J.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,i))}return i}parseStatementContent(e,t){let n=!!(e&2);if(!this.state.containsEsc)switch(this.state.type){case 71:if(this.isLookaheadContextual(`enum`)){let e=this.startNode();return this.next(),this.tsParseEnumDeclaration(e,{const:!0})}break;case 120:case 121:if(this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()){let e=this.state.type,n=this.startNode();this.next();let r=e===121?this.tsTryParseDeclare(n):this.tsParseAbstractDeclaration(n,t);return r?(e===121&&(r.declare=!0),r):(n.expression=this.createIdentifier(this.startNodeAtNode(n),e===121?`declare`:`abstract`),this.semicolon(!1),this.finishNode(n,`ExpressionStatement`))}break;case 122:return this.tsParseEnumDeclaration(this.startNode());case 108:if(this.lookaheadCharCode()===123){let e=this.startNode();return this.tsParseAmbientExternalModuleDeclaration(e)}break;case 125:{let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return n||this.raise(J.UnexpectedTypeDeclaration,e,`interface`),e;break}case 123:if(this.nextTokenIsStringLiteralOnSameLine()){let e=this.startNode();return this.next(),this.tsParseDeclaration(e,123,!1,t)}if(this.nextTokenIsIdentifierOnSameLine()){this.raise(J.InlineModuleDeclarationMustUseString,this.state.startLoc);let e=this.startNode();return this.next(),this.tsParseDeclaration(e,124,!1,t)}break;case 124:if(this.nextTokenIsIdentifierOnSameLine()){let e=this.startNode();return this.next(),this.tsParseDeclaration(e,124,!1,t)}break;case 126:if(this.nextTokenIsIdentifierOnSameLine()){let e=this.startNode();return n||this.raise(J.UnexpectedTypeDeclaration,e,`type`),this.next(),this.tsParseTypeAliasDeclaration(e)}}return super.parseStatementContent(e,t)}parseAccessModifier(){return this.tsParseModifier(nS)}tsHasSomeModifiers(e,t){return t.some(t=>Xx(t)?e.accessibility===t:!!e[t])}tsIsStartOfStaticBlocks(){return this.isContextual(102)&&this.lookaheadCharCode()===123}parseClassMember(e,t,n){this.tsParseModifiers($x,J.InvalidModifierOnTypeParameterPositions,t,!0);let r=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(t,[`declare`,`private`,`public`,`protected`,`override`,`abstract`,`readonly`,`static`])&&this.raise(J.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,t)):this.parseClassMemberWithIsStatic(e,t,n,!!t.static)};t.declare?this.tsInAmbientContext(r):r(),t.decorators&&t.decorators.length>0&&!this.hasPlugin(`decorators-legacy`)&&(t.type===`TSAbstractMethodDefinition`||t.type===`TSDeclareMethod`?this.raise(J.DecoratorAbstractMethod,t,{kind:`abstract method`}):(t.type===`ClassProperty`&&t.abstract||t.type===`ClassProperty`&&t.declare||t.type===`TSAbstractPropertyDefinition`||t.type===`PropertyDefinition`&&t.declare)&&this.raise(J.DecoratorAbstractMethod,t,{kind:t.declare?`declare field`:`abstract field`}))}parseClassMemberWithIsStatic(e,t,n,r){let i=this.tsTryParseIndexSignature(t);if(i){e.body.push(i),t.abstract&&this.raise(J.IndexSignatureHasAbstract,t),t.accessibility&&this.raise(J.IndexSignatureHasAccessibility,t,{modifier:t.accessibility}),t.declare&&this.raise(J.IndexSignatureHasDeclare,t),t.override&&this.raise(J.IndexSignatureHasOverride,t);return}!this.state.inAbstractClass&&t.abstract&&this.raise(J.NonAbstractClassHasAbstractMethod,t),t.override&&(n.hadSuperClass||this.raise(J.OverrideNotInSubClass,t)),super.parseClassMemberWithIsStatic(e,t,n,r)}parsePostMemberNameModifiers(e){this.eat(13)&&(e.optional=!0),e.readonly&&this.match(6)&&this.raise(J.ClassMethodHasReadonly,e),e.declare&&this.match(6)&&this.raise(J.ClassMethodHasDeclare,e)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,t,n){if(!this.match(13))return e;if(n!=null){let t=this.lookaheadCharCode();if(t===44||t===61||t===58||t===41)return this.setOptionalParametersError(n),e}this.next();let r=this.startNodeAt(t);r.test=e;let i=this.state.inConditionalConsequent;return this.state.inConditionalConsequent=!0,r.consequent=this.parseMaybeAssignAllowIn(),this.state.inConditionalConsequent=i,this.expect(10),r.alternate=this.parseMaybeAssign(),this.finishNode(r,`ConditionalExpression`)}parseParenItem(e,t){let n=super.parseParenItem(e,t);if(this.eat(13)&&(n.optional=!0,this.resetEndLocation(e)),this.match(10)){let n=this.startNodeAt(t);return n.expression=e,n.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(n,`TSTypeCastExpression`)}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(121))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let t=this.state.startLoc,n=this.eatContextual(121);if(n&&(this.isContextual(121)||!this.shouldParseExportDeclaration()))throw this.raise(J.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let r=Hy(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return r?((r.type===`TSInterfaceDeclaration`||r.type===`TSTypeAliasDeclaration`||n)&&(e.exportKind=`type`),n&&r.type!==`TSImportEqualsDeclaration`&&(this.resetStartLocation(r,t),r.declare=!0),r):null}parseClassId(e,t,n,r){if((!t||n)&&this.isContextual(109)){e.id=null;return}super.parseClassId(e,t,n,e.declare?1024:8331);let i=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);i&&(e.typeParameters=i)}parseClassPropertyAnnotation(e){e.optional||(this.eat(31)?e.definite=!0:this.eat(13)&&(e.optional=!0));let t=this.tsTryParseTypeAnnotation();t&&(e.typeAnnotation=t),e.definite&&(this.match(25)?this.raise(J.DeclaratorDefiniteAssertionWithInitializer,e):t||this.raise(J.DeclaratorDefiniteAssertionRequiresTypeAnnotation,e))}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&(!e.readonly||e.typeAnnotation)&&this.match(25)&&this.raise(J.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(25)){let{key:t}=e;this.raise(J.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:t.type===`Identifier`&&!e.computed?t.name:`[${this.input.slice(this.offsetToSourcePos(t.start),this.offsetToSourcePos(t.end))}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(J.PrivateElementHasAbstract,e),e.accessibility&&this.raise(J.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(J.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,t,n,r,i,a){let o=this.tsTryParseTypeParameters(this.tsParseConstModifier);o&&i&&this.raise(J.ConstructorHasTypeParameters,o);let{declare:s=!1,kind:c}=t;s&&(c===`get`||c===`set`)&&this.raise(J.DeclareAccessor,t,{kind:c}),o&&(t.typeParameters=o),super.pushClassMethod(e,t,n,r,i,a)}pushClassPrivateMethod(e,t,n,r){let i=this.tsTryParseTypeParameters(this.tsParseConstModifier);i&&(t.typeParameters=i),super.pushClassPrivateMethod(e,t,n,r)}declareClassPrivateMethodInScope(e,t){e.type!==`TSDeclareMethod`&&(e.type!==`MethodDefinition`||e.value.body!=null)&&super.declareClassPrivateMethodInScope(e,t)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass){if(e.superClass.type===`TSInstantiationExpression`){let t=e.superClass,n=t.expression;this.takeSurroundingComments(n,n.start,n.end);let r=t.typeArguments;this.takeSurroundingComments(r,r.start,r.end),e.superClass=n,e.superTypeArguments=r}else(this.match(43)||this.match(47))&&(e.superTypeArguments=this.tsParseTypeArgumentsInExpression())}this.eatContextual(109)&&(e.implements=this.tsParseHeritageClause(`implements`))}parseObjPropValue(e,t,n,r,i,a,o){let s=this.tsTryParseTypeParameters(this.tsParseConstModifier);return s&&(e.typeParameters=s),super.parseObjPropValue(e,t,n,r,i,a,o)}parseFunctionParams(e,t){let n=this.tsTryParseTypeParameters(this.tsParseConstModifier);n&&(e.typeParameters=n),super.parseFunctionParams(e,t)}parseVarId(e,t){super.parseVarId(e,t),e.id.type===`Identifier`&&!this.hasPrecedingLineBreak()&&this.eat(31)&&(e.definite=!0);let n=this.tsTryParseTypeAnnotation();n&&(e.id.typeAnnotation=n,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,t){return this.match(10)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,t)}parseMaybeAssign(e,t){let n,r,i;if(this.hasPlugin(`jsx`)&&(this.match(138)||this.match(43))){if(n=this.state.clone(),r=this.tryParse(()=>super.parseMaybeAssign(e,t),n),!r.error)return r.node;let{context:i}=this.state,a=i[i.length-1];(a===lb.j_oTag||a===lb.j_expr)&&i.pop()}if(!r?.error&&!this.match(43))return super.parseMaybeAssign(e,t);(!n||n===this.state)&&(n=this.state.clone());let a,o=this.tryParse(n=>{a=this.tsParseTypeParameters(this.tsParseConstModifier);let r=super.parseMaybeAssign(e,t);if((r.type!==`ArrowFunctionExpression`||r.extra?.parenthesized)&&n(),a?.params.length!==0&&this.resetStartLocationFromNode(r,a),r.typeParameters=a,this.hasPlugin(`jsx`)&&r.typeParameters.params.length===1&&!r.typeParameters.extra?.trailingComma){let e=r.typeParameters.params[0];e.constraint||this.raise(J.SingleTypeParameterWithoutTrailingComma,this.optionFlags&256?ay(e.loc.end,1):e,{typeParameterName:e.name.name})}return r},n);if(!o.error&&!o.aborted)return a&&this.reportReservedArrowTypeParam(a),o.node;if(!r&&(Jx(!this.hasPlugin(`jsx`)),i=this.tryParse(()=>super.parseMaybeAssign(e,t),n),!i.error))return i.node;if(r?.node)return this.state=r.failState,r.node;if(o.node)return this.state=o.failState,a&&this.reportReservedArrowTypeParam(a),o.node;if(i?.node)return this.state=i.failState,i.node;throw r?.error||o.error||i?.error}reportReservedArrowTypeParam(e){e.params.length===1&&!e.params[0].constraint&&!e.extra?.trailingComma&&this.getPluginOption(`typescript`,`disallowAmbiguousJSXLike`)&&this.raise(J.ReservedArrowTypeParam,e)}parseMaybeUnary(e,t){return!this.hasPlugin(`jsx`)&&this.match(43)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,t)}parseArrow(e){if(this.match(10)){let t=this.tryParse(e=>{let t=this.tsParseTypeOrTypePredicateAnnotation(10);return(this.canInsertSemicolon()||!this.match(15))&&e(),t});if(t.aborted)return;t.thrown||(t.error&&(this.state=t.failState),e.returnType=t.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(13)&&(e.optional=!0);let t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t),this.resetEndLocation(e),e}isAssignable(e,t){switch(e.type){case`TSTypeCastExpression`:return this.isAssignable(e.expression,t);case`TSParameterProperty`:return!0;default:return super.isAssignable(e,t)}}toAssignable(e,t=!1){switch(e.type){case`ParenthesizedExpression`:this.toAssignableParenthesizedExpression(e,t);break;case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSNonNullExpression`:case`TSTypeAssertion`:t?this.expressionScope.recordArrowParameterBindingError(J.UnexpectedTypeCastInParameter,e):this.raise(J.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,t);break;case`AssignmentExpression`:!t&&e.left.type===`TSTypeCastExpression`&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,t)}}toAssignableParenthesizedExpression(e,t){switch(e.expression.type){case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSNonNullExpression`:case`TSTypeAssertion`:case`ParenthesizedExpression`:this.toAssignable(e.expression,t);break;default:super.toAssignable(e,t)}}checkToRestConversion(e,t){switch(e.type){case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSTypeAssertion`:case`TSNonNullExpression`:this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,t)}}isValidLVal(e,t,n,r){switch(e){case`TSTypeCastExpression`:return!0;case`TSParameterProperty`:return`parameter`;case`TSNonNullExpression`:return`expression`;case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSTypeAssertion`:return(r!==64||!n)&&[`expression`,!0];default:return super.isValidLVal(e,t,n,r)}}parseBindingAtom(){return this.state.type===74?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e,t){if(this.match(43)||this.match(47)){let n=this.tsParseTypeArgumentsInExpression();if(this.match(6)){let r=super.parseMaybeDecoratorArguments(e,t);return r.typeArguments=n,r}this.unexpected(null,6)}return super.parseMaybeDecoratorArguments(e,t)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(8)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(43)||super.isClassMethod()}isClassProperty(){return this.match(31)||this.match(10)||super.isClassProperty()}parseMaybeDefault(e,t){let n=super.parseMaybeDefault(e,t);return n.type===`AssignmentPattern`&&n.typeAnnotation&&n.right.start<n.typeAnnotation.start&&this.raise(J.TypeAnnotationAfterAssign,n.typeAnnotation),n}getTokenFromCode(e){if(this.state.inType){if(e===62){this.finishOp(44,1);return}if(e===60){this.finishOp(43,1);return}}super.getTokenFromCode(e)}reScan_lt_gt(){let{type:e}=this.state;e===43?(--this.state.pos,this.readToken_lt()):e===44&&(--this.state.pos,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===47?(this.state.pos-=2,this.finishOp(43,1),43):e}toAssignableListItem(e,t,n){let r=e[t];r.type===`TSTypeCastExpression`&&(e[t]=this.typeCastToParameter(r)),super.toAssignableListItem(e,t,n)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocationFromNode(e.expression,e.typeAnnotation),e.expression}shouldParseArrow(e){return this.match(10)?e.every(e=>this.isAssignable(e,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(10)?!this.state.inConditionalConsequent:super.shouldParseAsyncArrow()}parseParenAndDistinguishExpression(e){let t=this.state.inConditionalConsequent;this.state.inConditionalConsequent=!1;let n=super.parseParenAndDistinguishExpression(e);return this.state.inConditionalConsequent=t,n}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(43)||this.match(47)){let t=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());t&&(e.typeArguments=t)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let t=super.getGetterSetterExpectedParamCount(e),n=this.getObjectOrClassMethodParams(e)[0];return n&&this.isThisParam(n)?t+1:t}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),t=this.tsTryParseTypeAnnotation();return t&&(e.typeAnnotation=t,this.resetEndLocation(e)),e}tsInAmbientContext(e){let{isAmbientContext:t,strict:n}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=t,this.state.strict=n}}parseClass(e,t,n){let r=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,t,n)}finally{this.state.inAbstractClass=r}}tsParseAbstractDeclaration(e,t){if(this.match(76))return e.abstract=!0,this.maybeTakeDecorators(t,this.parseClass(e,!0,!1));if(this.isContextual(125))return this.hasFollowingLineBreak()?null:(e.abstract=!0,this.raise(J.NonClassMethodPropertyHasAbstractModifier,e),this.tsParseInterfaceDeclaration(e));throw this.unexpected(null,76)}parseMethod(e,t,n,r,i,a,o){let s=super.parseMethod(e,t,n,r,i,a,o);if((s.abstract||s.type===`TSAbstractMethodDefinition`)&&(this.hasPlugin(`estree`)?s.value:s).body){let{key:e}=s;this.raise(J.AbstractMethodHasImplementation,s,{methodName:e.type===`Identifier`&&!s.computed?e.name:`[${this.input.slice(this.offsetToSourcePos(e.start),this.offsetToSourcePos(e.end))}]`})}return s}tsParseTypeParameterName(){return this.parseIdentifier()}shouldParseAsAmbientContext(){return!!this.getPluginOption(`typescript`,`dts`)}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(e,t,n,r){return!t&&r?(this.parseTypeOnlyExportSpecifier(e,n),this.finishNode(e,`ExportSpecifier`)):(e.exportKind=`value`,super.parseExportSpecifier(e,t,n,r))}parseImportSpecifier(e,t,n,r,i){return!t&&r?(this.parseTypeOnlyImportSpecifier(e,n),this.finishNode(e,`ImportSpecifier`)):(e.importKind=`value`,super.parseImportSpecifier(e,t,n,r,n?4098:4096))}parseTypeOnlyImportSpecifier(e,t){let n=e.imported,r=!1;if(this.isContextual(89)){let t=this.parseIdentifier();if(this.isContextual(89)){let i=this.parseIdentifier();Wy(this.state.type)?(r=!0,n=t,e.local=this.parseIdentifier()):e.local=i}else Wy(this.state.type)?e.local=this.parseIdentifier():(r=!0,n=t)}else Wy(this.state.type)&&(r=!0,n=this.parseIdentifier(!0),this.isContextual(89)||this.checkReservedWord(n.name,n.start,!0,!0));r&&t&&this.raise(J.TypeModifierIsUsedInTypeImports,e.imported),e.imported=n,e.importKind=r?`type`:`value`,this.checkIdentifier(e.local??=this.eatContextual(89)?this.parseIdentifier():this.cloneIdentifier(e.imported),r?4098:4096)}parseTypeOnlyExportSpecifier(e,t){let n=e.local,r=!1;if(this.isContextual(89)){let t=this.parseIdentifier();if(this.isContextual(89)){let n=this.parseIdentifier();Wy(this.state.type)?(r=!0,e.local=t,e.exported=this.parseModuleExportName()):e.exported=n}else Wy(this.state.type)?e.exported=this.parseModuleExportName():(r=!0,e.local=t)}else Wy(this.state.type)&&(r=!0,e.local=this.parseModuleExportName());r&&t&&this.raise(J.TypeModifierIsUsedInTypeExports,n),e.exportKind=r?`type`:`value`,e.exported??=this.eatContextual(89)?this.parseModuleExportName():this.cloneIdentifier(e.local)}fillOptionalPropertiesForTSESLint(e){switch(e.type){case`ImportDeclaration`:e.phase??=null;return;case`ExpressionStatement`:e.directive??=void 0;return;case`RestElement`:e.value=void 0;case`Identifier`:case`ArrayPattern`:case`AssignmentPattern`:case`ObjectPattern`:e.decorators??=[],e.optional??=!1,e.typeAnnotation??=void 0;return;case`TSParameterProperty`:e.accessibility??=void 0,e.decorators??=[],e.override??=!1,e.readonly??=!1,e.static??=!1;return;case`TSEmptyBodyFunctionExpression`:e.body=null;case`TSDeclareFunction`:case`FunctionDeclaration`:case`FunctionExpression`:case`ClassMethod`:case`ClassPrivateMethod`:e.declare??=!1,e.returnType??=void 0,e.typeParameters??=void 0;return;case`Property`:e.optional??=!1;return;case`TSMethodSignature`:case`TSPropertySignature`:e.optional??=!1;case`TSIndexSignature`:e.accessibility??=void 0,e.readonly??=!1,e.static??=!1;return;case`TSAbstractPropertyDefinition`:case`PropertyDefinition`:case`TSAbstractAccessorProperty`:case`AccessorProperty`:e.declare??=!1,e.definite??=!1,e.readonly??=!1,e.typeAnnotation??=void 0;case`TSAbstractMethodDefinition`:case`MethodDefinition`:e.accessibility??=void 0,e.decorators??=[],e.override??=!1,e.optional??=!1;return;case`ClassExpression`:e.id??=null;case`ClassDeclaration`:e.abstract??=!1,e.declare??=!1,e.decorators??=[],e.implements??=[],e.superTypeArguments??=void 0,e.typeParameters??=void 0;return;case`TSTypeAliasDeclaration`:case`VariableDeclaration`:e.declare??=!1;return;case`VariableDeclarator`:e.definite??=!1;return;case`TSEnumDeclaration`:e.const??=!1,e.declare??=!1;return;case`TSEnumMember`:e.computed??=!1;return;case`TSImportType`:e.qualifier??=null,e.options??=null,e.typeArguments??=null;return;case`TSInterfaceDeclaration`:e.declare??=!1,e.extends??=[];return;case`TSMappedType`:e.optional??=!1,e.readonly??=void 0;return;case`TSModuleDeclaration`:e.declare??=!1,e.global??=e.kind===`global`;return;case`TSTypeParameter`:e.const??=!1,e.in??=!1,e.out??=!1;return}}chStartsBindingIdentifierAndNotRelationalOperator(e,t){if(hb(e)){if(Kx.lastIndex=t,Kx.test(this.input)){let e=this.codePointAtPos(Kx.lastIndex);if(!gb(e)&&e!==92)return!1}return!0}return e===92}nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return this.chStartsBindingIdentifierAndNotRelationalOperator(t,e)}nextTokenIsStringLiteralOnSameLine(){let e=this.nextTokenInLineStart(),t=this.codePointAtPos(e);return t===34||t===39}};function iS(e){if(e.type!==`MemberExpression`)return!1;let{computed:t,property:n}=e;return t&&n.type!==`StringLiteral`&&(n.type!==`TemplateLiteral`||n.expressions.length>0)?!1:cS(e.object)}function aS(e,t){let{type:n}=e;if(e.extra?.parenthesized)return!1;if(t){if(n===`Literal`){let{value:t}=e;if(typeof t==`string`||typeof t==`boolean`)return!0}}else if(n===`StringLiteral`||n===`BooleanLiteral`)return!0;return!!(oS(e,t)||sS(e,t)||n===`TemplateLiteral`&&e.expressions.length===0||iS(e))}function oS(e,t){return t?e.type===`Literal`&&(typeof e.value==`number`||`bigint`in e):e.type===`NumericLiteral`||e.type===`BigIntLiteral`}function sS(e,t){if(e.type===`UnaryExpression`){let{operator:n,argument:r}=e;if(n===`-`&&oS(r,t))return!0}return!1}function cS(e){return e.type===`Identifier`?!0:e.type!==`MemberExpression`||e.computed?!1:cS(e.object)}function lS(e,t=[]){let n=new Map;for(let t of e)n.set(t,!0);for(let e of t)n.set(e,!1);return n}var uS=vy`placeholders`({ClassNameIsRequired:`A class name is required.`,UnexpectedSpace:`Unexpected space in placeholder.`}),dS=e=>class extends e{parsePlaceholder(e){if(this.match(129)){let t=this.startNode();return this.next(),this.assertNoSpace(),t.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(129),this.finishPlaceholder(t,e)}}finishPlaceholder(e,t){let n=e;return(!n.expectedNode||!n.type)&&(n=this.finishNode(n,`Placeholder`)),n.expectedNode=t,n}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(129,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder(`Expression`)||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder(`Identifier`)||super.parseIdentifier(e)}checkReservedWord(e,t,n,r){e!==void 0&&super.checkReservedWord(e,t,n,r)}cloneIdentifier(e){let t=super.cloneIdentifier(e);return t.type===`Placeholder`&&(t.expectedNode=e.expectedNode),t}cloneStringLiteral(e){return e.type===`Placeholder`?this.cloneIdentifier(e):super.cloneStringLiteral(e)}parseBindingAtom(){return this.parsePlaceholder(`Pattern`)||super.parseBindingAtom()}isValidLVal(e,t,n,r){return e===`Placeholder`||super.isValidLVal(e,t,n,r)}toAssignable(e,t){e&&e.type===`Placeholder`&&e.expectedNode===`Expression`?e.expectedNode=`Pattern`:super.toAssignable(e,t)}chStartsBindingIdentifier(e,t){if(super.chStartsBindingIdentifier(e,t))return!0;let n=this.nextTokenStart();return this.input.charCodeAt(n)===37&&this.input.charCodeAt(n+1)===37}verifyBreakContinue(e,t){e.label?.type!==`Placeholder`&&super.verifyBreakContinue(e,t)}parseExpressionStatement(e,t){if(t.type!==`Placeholder`||t.extra?.parenthesized)return super.parseExpressionStatement(e,t);if(this.match(10)){let n=e;return n.label=this.finishPlaceholder(t,`Identifier`),this.next(),n.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(n,`LabeledStatement`)}this.semicolon();let n=e;return n.name=t.name,this.finishPlaceholder(n,`Statement`)}parseBlock(e,t,n){return this.parsePlaceholder(`BlockStatement`)||super.parseBlock(e,t,n)}parseFunctionId(e){return this.parsePlaceholder(`Identifier`)||super.parseFunctionId(e)}parseClass(e,t,n){let r=t?`ClassDeclaration`:`ClassExpression`;this.next();let i=this.state.strict,a=this.parsePlaceholder(`Identifier`);if(a){if(this.match(77)||this.match(129)||this.match(2))e.id=a;else if(n||!t)return e.id=null,e.body=this.finishPlaceholder(a,`ClassBody`),this.finishNode(e,r);else throw this.raise(uS.ClassNameIsRequired,this.state.startLoc)}else this.parseClassId(e,t,n);return super.parseClassSuper(e),e.body=this.parsePlaceholder(`ClassBody`)||super.parseClassBody(!!e.superClass,i),this.finishNode(e,r)}parseExport(e,t){let n=this.parsePlaceholder(`Identifier`);if(!n)return super.parseExport(e,t);let r=e;if(!this.isContextual(94)&&!this.match(8))return r.specifiers=[],r.source=null,r.declaration=this.finishPlaceholder(n,`Declaration`),this.finishNode(r,`ExportNamedDeclaration`);this.expectPlugin(`exportDefaultFrom`);let i=this.startNode();return i.exported=n,r.specifiers=[this.finishNode(i,`ExportDefaultSpecifier`)],super.parseExport(r,t)}isExportDefaultSpecifier(){if(this.match(61)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,`from`)&&this.input.startsWith(rb(129),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,t){return e.specifiers?.length?!0:super.maybeParseExportDefaultSpecifier(e,t)}checkNamedExport(){}parseImport(e){let t=this.parsePlaceholder(`Identifier`);if(!t)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(94)&&!this.match(8))return e.source=this.finishPlaceholder(t,`StringLiteral`),this.semicolon(),this.finishNode(e,`ImportDeclaration`);let n=this.startNodeAtNode(t);return n.local=t,e.specifiers.push(this.finishNode(n,`ImportDefaultSpecifier`)),this.eat(8)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(94),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,`ImportDeclaration`)}parseImportSource(){return this.parsePlaceholder(`StringLiteral`)||super.parseImportSource()}assertNoSpace(){this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index)&&this.raise(uS.UnexpectedSpace,this.state.lastTokEndLoc)}},fS=e=>class extends e{parseV8Intrinsic(){if(this.match(50)){let e=this.state.startLoc,t=this.startNode();if(this.next(),Hy(this.state.type)){let e=this.parseIdentifierName(),n=this.createIdentifier(t,e);if(this.castNodeTo(n,`V8IntrinsicIdentifier`),this.match(6))return n}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}},pS=[`fsharp`,`hack`],mS=[`^^`,`@@`,`^`,`%`,`#`];function hS(e){if(e.has(`decorators`)&&e.has(`decorators-legacy`))throw Error(`Cannot use the decorators and decorators-legacy plugin together`);if(e.has(`flow`)&&e.has(`typescript`))throw Error(`Cannot combine flow and typescript plugins.`);if(e.has(`placeholders`)&&e.has(`v8intrinsic`))throw Error(`Cannot combine placeholders and v8intrinsic plugins.`);if(e.has(`pipelineOperator`)){let t=e.get(`pipelineOperator`).proposal;if(!pS.includes(t)){let e=pS.map(e=>`"${e}"`).join(`, `);throw Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${e}.`)}if(t===`hack`){if(e.has(`placeholders`))throw Error(`Cannot combine placeholders plugin and Hack-style pipes.`);if(e.has(`v8intrinsic`))throw Error(`Cannot combine v8intrinsic plugin and Hack-style pipes.`);let t=e.get(`pipelineOperator`).topicToken;if(!mS.includes(t)){let e=mS.map(e=>`"${e}"`).join(`, `);throw Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${e}.`)}}}if(e.has(`moduleAttributes`))throw Error("`moduleAttributes` has been removed in Babel 8, please migrate to import attributes instead.");if(e.has(`importAssertions`))throw Error("`importAssertions` has been removed in Babel 8, please use import attributes instead.");if(e.has(`deprecatedImportAssert`)?console.warn("`deprecatedImportAssert` has been removed in Babel 8, please use import attributes instead."):e.has(`importAttributes`)&&e.get(`importAttributes`).deprecatedAssertSyntax&&console.warn("The 'importAttributes' plugin has been removed in Babel 8. Please migrate any usage of `assert`-style attributes to `with`."),e.has(`recordAndTuple`))throw Error(`The 'recordAndTuple' plugin has been removed in Babel 8. Please remove it from your configuration.`);if(e.has(`asyncDoExpressions`)&&!e.has(`doExpressions`)){let e=Error(`'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.`);throw e.missingPlugins=`doExpressions`,e}if(e.has(`optionalChainingAssign`)&&e.get(`optionalChainingAssign`).version!==`2023-07`)throw Error(`The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.`);if(e.has(`discardBinding`)&&e.get(`discardBinding`).syntaxType!==`void`)throw Error(`The 'discardBinding' plugin requires a 'syntaxType' option. Currently the only supported value is 'void'.`);if(e.has(`decimal`))throw Error(`The 'decimal' plugin has been removed in Babel 8. Please remove it from your configuration.`);if(e.has(`importReflection`))throw Error(`The 'importReflection' plugin has been removed in Babel 8. Use 'sourcePhaseImports' instead, and replace 'import module' with 'import source' in your code.`)}var gS={estree:Sy,jsx:Zb,flow:Bb,typescript:rS,v8intrinsic:fS,placeholders:dS},_S=Object.keys(gS),vS=class extends Gx{constructor(e,t,n){let r=by(e);super(r,t),this.options=r,this.initializeScopes(),this.plugins=n,this.filename=r.sourceFilename,this.startIndex=r.startIndex;let i=0;r.allowAwaitOutsideFunction&&(i|=1),r.allowReturnOutsideFunction&&(i|=2),r.allowImportExportEverywhere&&(i|=8),r.allowSuperOutsideMethod&&(i|=16),r.allowUndeclaredExports&&(i|=64),r.allowNewTargetOutsideFunction&&(i|=4),r.allowYieldOutsideFunction&&(i|=32),r.ranges&&(i|=128),r.locations===!0&&(i|=256),r.tokens&&(i|=512),r.createImportExpressions&&(i|=1024),r.createParenthesizedExpressions&&(i|=2048),r.errorRecovery&&(i|=4096),r.attachComment&&(i|=8192),r.annexB&&(i|=16384),this.optionFlags=i}getScopeHandler(){return Ab}parse(){this.enterInitialScopes();let e=this.startNode(),t=this.startNode();this.nextToken(),e.errors=[];let n=this.parseTopLevel(e,t);return n.errors=this.state.errors,n.comments.length=this.state.commentsLen,n}};function yS(e,t){if(t?.sourceType===`unambiguous`){t={...t};try{t.sourceType=`module`;let n=xS(t,e),r=n.parse();if(n.sawUnambiguousESM)return r;if(n.ambiguousScriptDifferentAst)try{return t.sourceType=`script`,xS(t,e).parse()}catch{}else r.program.sourceType=`script`;return r}catch(n){try{return t.sourceType=`script`,xS(t,e).parse()}catch{}throw n}}return xS(t,e).parse()}function bS(e){let t={};for(let n of Object.keys(e))t[n]=sb(e[n]);return t}bS(Vy);function xS(e,t){let n=vS,r=new Map;if(e?.plugins){for(let t of e.plugins){let e,n;typeof t==`string`?e=t:[e,n]=t,r.has(e)||r.set(e,n||{})}hS(r),n=CS(r)}return new n(e,t,r)}var SS=new Map;function CS(e){let t=[];for(let n of _S)e.has(n)&&t.push(n);let n=t.join(`|`),r=SS.get(n);if(!r){r=vS;for(let e of t)r=gS[e](r);SS.set(n,r)}return r}var wS=e=>ny(e)&&`type`in e&&typeof e.type==`string`&&`start`in e&&typeof e.start==`number`&&`end`in e&&typeof e.end==`number`,TS=e=>Array.isArray(e)?e.filter(wS):[],ES=(e,t,n=null)=>{if(Array.isArray(e)){for(let r of e)ES(r,t,n);return}if(wS(e)){t(e,n);for(let[n,r]of Object.entries(e))n!==`loc`&&n!==`extra`&&n!==`comments`&&ES(r,t,e)}},DS=e=>{try{let t=yS(e,{sourceType:`module`,plugins:[`typescript`,`jsx`]});return wS(t)?t:null}catch{return null}},OS=e=>e.type===`Identifier`||e.type===`MemberExpression`&&e.computed===!1&&wS(e.object)&&OS(e.object),kS=(e,t,n,r)=>{let i=t.type===`JSXExpressionContainer`&&wS(t.expression)?t.expression:t,a=i.type===`StringLiteral`||i.type===`NumericLiteral`||i.type===`BooleanLiteral`||i.type===`JSXText`;return{name:e,literalType:i.type===`NumericLiteral`?`number`:i.type===`BooleanLiteral`?`boolean`:`string`,kind:a?`literal`:OS(i)?`binding`:`computed`,value:a&&(typeof i.value==`string`||typeof i.value==`number`||typeof i.value==`boolean`)?String(i.value):n.slice(i.start,i.end),start:t.start,end:t.end,syntax:r}},AS=(e,t,n)=>{if(t!==n.fileName)return null;let r=DS(e);if(r===null)return null;let i=wh(e),a=i[n.lineNumber-1];if(a===void 0||!Number.isInteger(n.columnNumber)||n.columnNumber<1)return null;let o=a+n.columnNumber-1;if(o>=(i[n.lineNumber]??e.length))return null;let s=null;return ES(r,(t,n)=>{if(t.type!==`JSXElement`||t.start!==o||!wS(t.openingElement))return;let r=t.openingElement,i=[];for(let t of TS(r.attributes))if(t.type===`JSXAttribute`&&wS(t.name)&&typeof t.name.name==`string`&&wS(t.value)){let n=t.value,r=n.type===`JSXExpressionContainer`&&wS(n.expression)?n.expression:null;if(t.name.name===`style`&&r?.type===`ObjectExpression`&&!TS(r.properties).some(e=>e.type===`SpreadElement`))for(let t of TS(r.properties)){if(t.type!==`ObjectProperty`||t.computed===!0||!wS(t.key)||!wS(t.value))continue;let n=t.key.type===`Identifier`?t.key.name:t.key.value;typeof n==`string`&&i.push(kS(`style.${n}`,t.value,e,`value`))}else i.push(kS(t.name.name,n,e,`attribute`))}let a=TS(t.children).filter(t=>t.type!==`JSXText`||e.slice(t.start,t.end).trim()!==``);a.length===1&&a[0]!==void 0&&a[0].type!==`JSXElement`&&a[0].type!==`JSXFragment`&&i.unshift(kS(`children`,a[0],e,`child`)),s={start:t.start,end:t.end,contentStart:r.selfClosing===!0?null:r.end,contentEnd:wS(t.closingElement)?t.closingElement.start:null,tag:wS(r.name)?e.slice(r.name.start,r.name.end):`element`,properties:i,attributeInsertion:r.end-(r.selfClosing===!0?2:1),hasSpread:TS(r.attributes).some(e=>e.type===`JSXSpreadAttribute`),structural:n?.type===`JSXElement`||n?.type===`JSXFragment`}}),s},jS=(e,t,n)=>{if(t.kind!==`literal`||t.literalType===`number`&&(n.trim()===``||!Number.isFinite(Number(n)))||t.literalType===`boolean`&&n!==`true`&&n!==`false`)return null;let r=t.literalType===`string`?JSON.stringify(n):t.literalType===`number`?String(Number(n)):n;return{start:t.start,end:t.end,before:e.slice(t.start,t.end),after:t.syntax===`child`||t.syntax===`attribute`&&t.literalType!==`string`?`{${r}}`:r}},MS=(e,t,n)=>({start:t.start,end:t.end,before:e.slice(t.start,t.end),after:t.syntax===`value`?n:`{${n}}`}),NS=(e,t)=>{let n=[...t].sort((e,t)=>t.start-e.start),r=e.length,i=e;for(let t of n){if(t.start<0||t.end<t.start||t.end>r||e.slice(t.start,t.end)!==t.before)return{ok:!1,reason:`Source changed at this target. Select it again before applying the edit.`};i=i.slice(0,t.start)+t.after+i.slice(t.end),r=t.start}return DS(i)===null?{ok:!1,reason:`This change is not valid TSX. Review it in Source.`}:{ok:!0,source:i}},PS=(e,t,n)=>{if(n.kind===`insert`)return t.contentEnd===null?null:[{start:t.contentEnd,end:t.contentEnd,before:``,after:n.tsx}];if(!t.structural)return null;let r={start:t.start,end:t.end,before:e.slice(t.start,t.end),after:``};if(n.kind===`delete`)return[r];let i=n.destination.contentEnd;return i===null||i>=t.start&&i<=t.end?null:[r,{start:i,end:i,before:``,after:r.before}]},FS=e=>{let t=DS(e);if(t===null)return[];let n=[];return ES(t,t=>{if(t.type!==`CallExpression`||!wS(t.callee)||t.callee.type!==`Identifier`||t.callee.name!==`defineEmail`)return;let r=TS(t.arguments)[0];if(r?.type!==`ObjectExpression`)return;let i=TS(r.properties).find(e=>e.type===`ObjectProperty`&&wS(e.key)&&e.key.name===`fixtures`&&e.computed!==!0);if(i!==void 0&&wS(i.value)&&i.value.type===`ObjectExpression`)for(let t of TS(i.value.properties)){if(t.type!==`ObjectProperty`||t.computed===!0||!wS(t.key)||!wS(t.value))continue;let r=t.key.type===`Identifier`?t.key.name:t.key.value;typeof r==`string`&&n.push({name:r,start:t.value.start,end:t.value.end,source:e.slice(t.value.start,t.value.end)})}}),n},IS=(e,t)=>e.hasSpread||e.properties.some(e=>e.name===`className`)?null:{start:e.attributeInsertion,end:e.attributeInsertion,before:``,after:` className=${JSON.stringify(t)}`},LS=`data-samva-instance`,RS=e=>`${e.fileName}:${e.lineNumber}:${e.columnNumber}`,zS=e=>`${e.tag}\u0000${e.origins.map(RS).join(`\0`)}`,BS=e=>{let t=e.origins[0];return`${e.tag}\u0000${t===void 0?``:RS(t)}`},VS=e=>new Map(e.map(e=>[e.instancePath,e])),HS=(e,t)=>{let n=zS(t);return e.filter(e=>zS(e)===n)},US=(e,t)=>{let n=BS(t);return e.filter(e=>BS(e)===n)},WS=new TextEncoder,GS=e=>WS.encode(e).byteLength,KS=`<!--sml:if:`,qS=`-->`,JS=e=>{let t=e.indexOf(KS);if(t===-1)return e;let n=e.indexOf(qS,t);if(n===-1)return e;let r=e.slice(t+11,n),i=r.indexOf(` `),a=i===-1?r:r.slice(0,i),o=`<!--sml:else:${a}-->`,s=`<!--sml:endif:${a}-->`,c=n+3,l=e.indexOf(s,c);if(l===-1)return e;let u=e.indexOf(o,c),d=u!==-1&&u<l?u:-1,f=JS(e.slice(c,d===-1?l:d)),p=d===-1?``:JS(e.slice(d+o.length,l)),m=GS(f)>=GS(p)?f:p,h=JS(e.slice(l+s.length));return e.slice(0,t)+m+h};function YS(e){return GS(JS(e))}var XS=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})),ZS=o(((e,t)=>{t.exports=XS()})),QS={};function $S(e,t){let n=T.useRef(QS);return n.current===QS&&(n.current=e(t)),n}var eC=[],tC=void 0;function nC(){return tC}function rC(e){eC.push(e)}function iC(e){let t=(t,n)=>{let r=$S(oC).current,i;try{tC=r;for(let e of eC)e.before(r);i=e(t,n);for(let e of eC)e.after(r);r.didInitialize=!0}finally{tC=void 0}return i};return t.displayName=e.displayName||e.name,t}function aC(e){return T.forwardRef(iC(e))}function oC(){return{didInitialize:!1}}function sC(){}var cC=Object.freeze([]),lC=Object.freeze({}),Y=typeof document<`u`?T.useLayoutEffect:()=>{};function uC(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var dC=uC(`https://base-ui.com/production-error`,`Base UI`),fC=T.createContext(void 0);function pC(e){let t=T.useContext(fC);if(t===void 0&&!e)throw Error(dC(72));return t}function mC(e){T.useEffect(e,cC)}var hC=0,gC=class e{static create(){return new e}currentId=hC;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=hC,t()},e)}isStarted(){return this.currentId!==hC}clear=()=>{this.currentId!==hC&&(clearTimeout(this.currentId),this.currentId=hC)};disposeEffect=()=>this.clear};function _C(){let e=$S(gC.create).current;return mC(e.disposeEffect),e}function vC(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:yC,platform:bC,maxTouchPoints:xC}=vC(),SC=yC.toLowerCase(),CC=bC.toLowerCase(),wC=/^i(os$|p)/.test(CC)||CC===`macintel`&&xC>1,TC=`android`,EC=CC===TC||SC.includes(TC),DC=!wC&&CC.startsWith(`mac`);CC.startsWith(`win`),!EC&&/^(linux|chrome os)/.test(CC);var OC=DC||wC,kC=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!kC&&SC.includes(`firefox`),!kC&&SC.includes(`chrom`);var AC=OC,jC=/jsdom|happydom/.test(SC);function MC(e){e.preventDefault(),e.stopPropagation()}function NC(e){return`nativeEvent`in e}function PC(e){return e.pointerType===``&&e.isTrusted?!0:EC&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function FC(e){return jC?!1:!EC&&e.width===0&&e.height===0||EC&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function IC(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function LC(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function RC(){return typeof window<`u`}function zC(e){return HC(e)?(e.nodeName||``).toLowerCase():`#document`}function BC(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function VC(e){return((HC(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function HC(e){return RC()?e instanceof Node||e instanceof BC(e).Node:!1}function UC(e){return RC()?e instanceof Element||e instanceof BC(e).Element:!1}function WC(e){return RC()?e instanceof HTMLElement||e instanceof BC(e).HTMLElement:!1}function GC(e){return!RC()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof BC(e).ShadowRoot}function KC(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=rw(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function qC(e){return/^(table|td|th)$/.test(zC(e))}function JC(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var YC=/transform|translate|scale|rotate|perspective|filter/,XC=/paint|layout|strict|content/,ZC=e=>!!e&&e!==`none`,QC;function $C(e){let t=UC(e)?rw(e):e;return ZC(t.transform)||ZC(t.translate)||ZC(t.scale)||ZC(t.rotate)||ZC(t.perspective)||!tw()&&(ZC(t.backdropFilter)||ZC(t.filter))||YC.test(t.willChange||``)||XC.test(t.contain||``)}function ew(e){let t=aw(e);for(;WC(t)&&!nw(t);){if($C(t))return t;if(JC(t))return null;t=aw(t)}return null}function tw(){return QC??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),QC}function nw(e){return/^(html|body|#document)$/.test(zC(e))}function rw(e){return BC(e).getComputedStyle(e)}function iw(e){return UC(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function aw(e){if(zC(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||GC(e)&&e.host||VC(e);return GC(t)?t.host:t}function ow(e){let t=aw(e);return nw(t)?(e.ownerDocument||e).body:WC(t)&&KC(t)?t:ow(t)}function sw(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ow(e),i=r===e.ownerDocument?.body,a=BC(r);if(i){let e=cw(a);return t.concat(a,a.visualViewport||[],KC(r)?r:[],e&&n?sw(e):[])}return t.concat(r,sw(r,[],n))}function cw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lw(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function X(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&GC(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function uw(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var dw=`data-base-ui-focusable`,fw=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,pw=`ArrowLeft`,mw=`ArrowRight`,hw=`ArrowUp`,gw=`ArrowDown`,_w=`data-starting-style`,vw=`data-ending-style`,yw={[_w]:``},bw={[vw]:``},xw={transitionStatus(e){return e===`starting`?yw:e===`ending`?bw:null}},Sw=`data-open`,Cw=`data-closed`,ww=`data-anchor-hidden`,Tw=`data-popup-open`,Ew=`data-pressed`,Dw={[Tw]:``},Ow={[Tw]:``,[Ew]:``},kw={[Sw]:``},Aw={[Cw]:``},jw={[ww]:``},Mw={open(e){return e?Dw:null}},Nw={open(e){return e?Ow:null}},Pw={open(e){return e?kw:Aw},anchorHidden(e){return e?jw:null}},Fw={...Pw,...xw},Iw=`data-trigger-disabled`;function Lw(e,t){if(!UC(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Iw);for(let[,e]of t.entries())if(X(e,n))return!e.hasAttribute(Iw);return!1}function Rw(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function zw(e){return e.matches(`html,body`)}function Bw(e){return WC(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Vw(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${fw}`)!=null}function Hw(e){return e?e.getAttribute(`role`)===`combobox`&&Bw(e):!1}function Uw(e){if(!e||jC)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Ww(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Gw(e,t){return t!=null&&!IC(t)?0:typeof e==`function`?e():e}function Kw(e,t,n){let r=Gw(e,n);return typeof r==`number`?r:r?.[t]}function qw(e){return typeof e==`function`?e():e}function Jw(e,t){return t||e===`click`||e===`mousedown`}function Yw(e){return e?.includes(`mouse`)&&e!==`mousedown`}var Xw=`none`,Zw=`trigger-press`,Qw=`trigger-hover`,$w=`trigger-focus`,eT=`outside-press`,tT=`item-press`,nT=`close-press`,rT=`focus-out`,iT=`escape-key`,aT=`close-watcher`,oT=`list-navigation`,sT=`cancel-open`,cT=`sibling-open`,lT=`disabled`,uT=`imperative-action`,dT=`swipe`,fT=`window-resize`;function pT(e,t,n,r){let i=!1,a=!1,o=r??lC;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var Z=ZS(),mT=T.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new gC,currentIdRef:{current:null},currentContextRef:{current:null}});function hT(e,t){e.current=t.current}function gT(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=T.useContext(mT),[f,p]=T.useState(!1),m=T.useRef(n);return Y(()=>{m.current=n},[n]),Y(()=>{function e(){l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current,d.clear()}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{(m.current||a.current!==t)&&d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),Y(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:Kw(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,pT(Xw))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),Y(()=>()=>{if(a.current===i){if(l.current=null,!m.current)return;a.current=null,hT(o,c),d.clear()}},[l,a,o,i,c,d]),T.useMemo(()=>({activeIdRef:a,hasProvider:u,delayRef:o,isInstantPhase:f}),[a,u,o,f])}function _T(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function vT(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function yT(e,t,n,r){let i=$S(xT).current;return ST(i,e,t,n,r)&&wT(i,[e,t,n,r]),i.callback}function bT(e){let t=$S(xT).current;return CT(t,e)&&wT(t,e),t.callback}function xT(){return{callback:null,cleanup:null,refs:[]}}function ST(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function CT(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function wT(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function TT(e){let t=$S(ET,e).current;return t.next=e,Y(t.effect),t}function ET(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var DT={...T},OT=DT.useInsertionEffect,kT=OT&&OT!==DT.useLayoutEffect?OT:e=>e();function Q(e){let t=$S(AT).current;return t.next=e,kT(t.effect),t.trampoline}function AT(){let e={next:void 0,callback:jT,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function jT(){}var MT=null;globalThis.requestAnimationFrame;var NT=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},PT=class e{static create(){return new e}static request(e){return NT.request(e)}static cancel(e){return NT.cancel(e)}currentId=MT;request(e){this.cancel(),this.currentId=NT.request(()=>{this.currentId=MT,e()})}cancel=()=>{this.currentId!==MT&&(NT.cancel(this.currentId),this.currentId=MT)};disposeEffect=()=>this.cancel};function FT(){let e=$S(PT.create).current;return mC(e.disposeEffect),e}function IT(e){return e?.ownerDocument||document}var LT={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},RT={...LT,position:`fixed`,top:0,left:0},zT={...LT,position:`absolute`},BT=T.forwardRef(function(e,t){let[n,r]=T.useState();Y(()=>{AC&&kC&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,Z.jsx)(`span`,{...e,ref:t,style:RT,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),VT=Math.min,HT=Math.max,UT=Math.round,WT=Math.floor,GT=e=>({x:e,y:e}),KT={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function qT(e,t,n){return HT(e,VT(t,n))}function JT(e,t){return typeof e==`function`?e(t):e}function YT(e){return e.split(`-`)[0]}function XT(e){return e.split(`-`)[1]}function ZT(e){return e===`x`?`y`:`x`}function QT(e){return e===`y`?`height`:`width`}function $T(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function eE(e){return ZT($T(e))}function tE(e,t,n){n===void 0&&(n=!1);let r=XT(e),i=eE(e),a=QT(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=uE(o)),[o,uE(o)]}function nE(e){let t=uE(e);return[rE(e),t,rE(t)]}function rE(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var iE=[`left`,`right`],aE=[`right`,`left`],oE=[`top`,`bottom`],sE=[`bottom`,`top`];function cE(e,t,n){switch(e){case`top`:case`bottom`:return n?t?aE:iE:t?iE:aE;case`left`:case`right`:return t?oE:sE;default:return[]}}function lE(e,t,n,r){let i=XT(e),a=cE(YT(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(rE)))),a}function uE(e){let t=YT(e);return KT[t]+e.slice(t.length)}function dE(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function fE(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:dE(e)}function pE(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 mE(e,t){return t<0||t>=e.length}function hE(e,t){return _E(e.current,{disabledIndices:t})}function gE(e,t){return _E(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function _E(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&vE(e,a,r));return a}function vE(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!bE(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function yE(e){return e.visibility===`hidden`||e.visibility===`collapse`}function bE(e,t=e?rw(e):null){return!e||!e.isConnected||!t||yE(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var xE=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function SE(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return GC(n)?n.host:null}function CE(e){for(let t of Array.from(e.children))if(zC(t)===`summary`)return t;return null}function wE(e,t){let n=CE(t);return!!n&&(e===n||X(n,e))}function TE(e){let t=e?zC(e):``;return e!=null&&e.matches(xE)&&(t!==`summary`||e.parentElement!=null&&zC(e.parentElement)===`details`&&CE(e.parentElement)===e)&&(t!==`details`||CE(e)==null)&&(t!==`input`||e.type!==`hidden`)}function EE(e){if(!TE(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=SE(t)){let n=t!==e,r=zC(t)===`slot`;if(t.hasAttribute(`inert`)||n&&zC(t)===`details`&&!t.open&&!wE(e,t)||t.hasAttribute(`hidden`)||!r&&!DE(t,n))return!1}return!0}function DE(e,t){let n=rw(e);return t?n.display!==`none`:bE(e,n)}function OE(e){let t=e.tabIndex;if(t<0){let t=zC(e);if(t===`details`||t===`audio`||t===`video`||WC(e)&&e.isContentEditable)return 0}return t}function kE(e){if(zC(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function AE(e,t){let n=kE(e);if(!n)return!0;let r=t.find(e=>{let t=kE(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=kE(e);return t?.name===n.name&&t.form===n.form})===n}function jE(e){if(WC(e)&&zC(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return WC(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function ME(e,t){jE(e).forEach(e=>{TE(e)&&t.push(e),ME(e,t)})}function NE(e,t,n){jE(e).forEach(e=>{WC(e)&&e.matches(t)&&n.push(e),NE(e,t,n)})}function PE(e){return EE(e)&&OE(e)>=0}function FE(e){let t=[];return ME(e,t),t.filter(EE)}function IE(e){let t=FE(e);return t.filter(e=>OE(e)>=0&&AE(e,t))}function LE(e,t){let n=IE(e),r=n.length;if(r===0)return;let i=lw(IT(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function RE(e){return LE(IT(e).body,1)||e}function zE(e){return LE(IT(e).body,-1)||e}function BE(e,t){if(!e)return null;let n=IE(IT(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function VE(e){return BE(e,1)}function HE(e){return BE(e,-1)}function UE(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!X(n,r)}function WE(e){IE(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function GE(e){let t=[];NE(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function KE(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...KE(e,t.id,n)])}function qE(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function JE(e){return`data-base-ui-${e}`}var YE=0;function XE(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(YE);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),sC;let o=requestAnimationFrame(a);return YE=o,()=>{YE===o&&(cancelAnimationFrame(o),YE=0)}}var ZE={inert:new WeakMap,"aria-hidden":new WeakMap},QE=`data-base-ui-inert`,$E={inert:new WeakSet,"aria-hidden":new WeakSet},eD=new WeakMap,tD=0;function nD(e){return $E[e]}function rD(e){return e?GC(e)?e.host:rD(e.parentNode):null}var iD=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=rD(t);return e.contains(n)?n:null}).filter(e=>e!=null),aD=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},oD=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{zC(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function sD(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=iD(t,e),l=i?oD(t,aD(c),new Set(c)):[],u=[],d=[];if(a){let e=ZE[a],n=nD(a);s=n,o=e;let r=iD(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);oD(t,aD(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(eD.get(e)||0)+1;eD.set(e,t),d.push(e),t===1&&e.setAttribute(QE,``)}),tD+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(eD.get(e)||0)-1;eD.set(e,t),t||e.removeAttribute(QE)}),--tD,tD||(ZE.inert=new WeakMap,ZE[`aria-hidden`]=new WeakMap,$E.inert=new WeakSet,$E[`aria-hidden`]=new WeakSet,eD=new WeakMap)}}function cD(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=IT(e[0]).body;return sD(e,a,n,r,{mark:i})}var lD=0;function uD(e,t=`mui`){let[n,r]=T.useState(e),i=e||n;return T.useEffect(()=>{n??(lD+=1,r(`${t}-${lD}`))},[n,t]),i}var dD=DT.useId;function fD(e,t){if(dD!==void 0){let n=dD();return e??(t?`${t}-${n}`:n)}return uD(e,t)}var pD=19;function mD(e){return pD>=e}function hD(e){if(!T.isValidElement(e))return null;let t=e,n=t.props;return(mD(19)?n?.ref:t.ref)??null}function gD(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function _D(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function vD(e,t){return typeof e==`function`?e(t):e}function yD(e,t){return typeof e==`function`?e(t):e}var bD={};function xD(e,t,n,r,i){if(!n&&!r&&!i&&!e)return CD(t);let a=CD(e);return t&&(a=wD(a,t)),n&&(a=wD(a,n)),r&&(a=wD(a,r)),i&&(a=wD(a,i)),a}function SD(e){if(e.length===0)return bD;if(e.length===1)return CD(e[0]);let t=CD(e[0]);for(let n=1;n<e.length;n+=1)t=wD(t,e[n]);return t}function CD(e){return OD(e)?{...kD(e,bD)}:TD(e)}function wD(e,t){return OD(t)?kD(t,e):ED(e,t)}function TD(e){let t={...e};for(let e in t){let n=t[e];DD(e,n)&&(t[e]=jD(n))}return t}function ED(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=gD(e.style,r);break;case`className`:e[n]=ND(e.className,r);break;default:e[n]=DD(n,r)?AD(e[n],r):r}}return e}function DD(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function OD(e){return typeof e==`function`}function kD(e,t){return OD(e)?e(t):e??bD}function AD(e,t){return t?e?(...n)=>{let r=n[0];if(PD(r)){let i=r;MD(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:jD(t):e}function jD(e){return e&&((...t)=>{let n=t[0];return PD(n)&&MD(n),e(...t)})}function MD(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function ND(e,t){return t?e?t+` `+e:t:e}function PD(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function FD(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=zD(r));let i=ID(t,n,r);if(n.enabled===!1)return null;let a=n.state??lC;return BD(e,r,i,a)}function ID(e,t,n){let{className:r,style:i}=e,{state:a=lC,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?vD(r,a):void 0,d=l?yD(i,a):void 0,f=l?_D(a,c):lC,p=l&&s?LD(s):void 0,m=l?gD(f,p)??{}:lC;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?bT([m.ref,hD(n),...o]):yT(m.ref,hD(n),o):yT(null,null)),l?(u!==void 0&&(m.className=ND(m.className,u)),d!==void 0&&(m.style=gD(m.style,d)),m):lC}function LD(e){return Array.isArray(e)?SD(e):xD(void 0,e)}var RD=Symbol.for(`react.lazy`);function zD(e){if(e?.$$typeof!==RD)return e;let t=T.Children.toArray(e)[0];return T.isValidElement(t)?t:e}function BD(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=xD(n,t.props);return e.ref=n.ref,T.cloneElement(t,e)}if(e&&typeof e==`string`)return VD(e,n);throw Error(dC(8))}function VD(e,t){return e===`button`?(0,T.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,T.createElement)(`img`,{alt:``,...t,key:t.key}):T.createElement(e,t)}var HD={style:{transition:`none`}},UD=`data-base-ui-click-trigger`,WD=`data-base-ui-swipe-ignore`,GD=`data-swipe-ignore`,KD=`[${WD}]`;`${GD}`;var qD={fallbackAxisSide:`none`},JD={fallbackAxisSide:`end`},YD={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},XD=c(m(),1),ZD=T.createContext(null),QD=()=>T.useContext(ZD),$D=JE(`portal`);function eO(e={}){let{ref:t,container:n,componentProps:r=lC,elementProps:i}=e,a=fD(),o=QD()?.portalNode,[s,c]=T.useState(null),[l,u]=T.useState(null),d=Q(e=>{e!==null&&u(e)}),f=T.useRef(null);Y(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(HC(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=FD(`div`,r,{ref:[t,d],props:[{id:a,[$D]:``},i]}),m=s&&p?XD.createPortal(p,s):null;return{node:l,nodeId:T.isValidElement(p)?p.props.id:void 0,subtree:m}}var tO=T.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=eO({container:o,ref:t,componentProps:e,elementProps:c}),f=T.useRef(null),p=T.useRef(null),m=T.useRef(null),h=T.useRef(null),[g,_]=T.useState(null),v=T.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;T.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&UE(e)&&(e.type===`focusin`?v.current&&=(GE(l),!1):(WE(l),v.current=!0))}return vT(_T(l,`focusin`,e,!0),_T(l,`focusout`,e,!0))},[l,y]),Y(()=>{l&&b===!0&&v.current&&(GE(l),v.current=!1)},[b,l]);let S=T.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,Z.jsxs)(T.Fragment,{children:[d,(0,Z.jsxs)(ZD.Provider,{value:S,children:[x&&l&&(0,Z.jsx)(BT,{"data-type":`outside`,ref:f,onFocus:e=>{UE(e,l)?m.current?.focus():zE(g?g.domReference:null)?.focus()}}),x&&l&&(0,Z.jsx)(`span`,{role:s,"aria-owns":u,style:YD}),l&&XD.createPortal(a,l),x&&l&&(0,Z.jsx)(BT,{"data-type":`outside`,ref:p,onFocus:e=>{UE(e,l)?h.current?.focus():(RE(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,pT(`focus-out`,e.nativeEvent)))}})]})]})});function nO(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var rO=class{nodesRef={current:[]};events=nO();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},iO=T.createContext(null),aO=T.createContext(null),oO=()=>T.useContext(iO)?.id||null,sO=e=>{let t=T.useContext(aO);return e??t};function cO(e){let t=fD(),n=sO(e),r=oO();return Y(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function lO(e){let{children:t,id:n}=e,r=oO();return(0,Z.jsx)(iO.Provider,{value:T.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function uO(e){let{children:t,externalTree:n}=e,r=$S(()=>n??new rO).current;return(0,Z.jsx)(aO.Provider,{value:r,children:t})}function dO(e){return e==null?e:`current`in e?e.current:e}function fO(e,t){let n=BC(uw(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var pO=20,mO=[];function hO(){mO=mO.filter(e=>e.deref()?.isConnected)}function gO(e){hO(),e&&zC(e)!==`body`&&(mO.push(new WeakRef(e)),mO.length>pO&&(mO=mO.slice(-20)))}function _O(){return hO(),mO[mO.length-1]?.deref()}function vO(e){return e?PE(e)?e:IE(e)[0]||e:null}function yO(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=FE(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return PE(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function bO(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:b}=h.context,x=Q(()=>b.current.floatingContext?.nodeId),S=i===!1,C=Hw(_)&&S,w=TT(i),E=TT(a),D=TT(l),O=TT(g),k=sO(p),A=QD(),j=T.useRef(!1),M=T.useRef(!1),N=T.useRef(!1),P=T.useRef(null),F=T.useRef(``),I=T.useRef(``),L=T.useRef(null),R=T.useRef(null),z=yT(L,f,A?.beforeInsideRef),B=yT(R,A?.afterInsideRef),V=_C(),ee=_C(),te=FT(),ne=A!=null,H=Ww(v),re=Q((e=H)=>e?IE(e):[]),ie=Q(()=>m?.().filter(e=>e!=null)??[]);T.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&X(H,lw(IT(H)))&&re().length===0&&!C&&MC(e)}return _T(IT(H),`keydown`,e)},[r,H,s,C,re]),T.useEffect(()=>{if(r||!g)return;let e=IT(H);function t(){N.current=!1}function n(e){let t=uw(e),n=ie(),r=X(v,t)||X(_,t)||X(A?.portalNode,t)||n.some(e=>e===t||X(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(M.current=!0,ee.start(0,()=>{M.current=!1}))}function i(){I.current=`keyboard`}return vT(_T(e,`pointerdown`,n,!0),_T(e,`pointerup`,t,!0),_T(e,`pointercancel`,t,!0),_T(e,`keydown`,i,!0),t)},[r,v,_,H,g,A,ee,ie]),T.useEffect(()=>{if(r||!c)return;let e=IT(H);function t(){M.current=!0,ee.start(0,()=>{M.current=!1})}function n(e){let t=uw(e);PE(t)&&(P.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=uw(t);s&&n==null&&i!=null&&X(v,i)&&gO(i),queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=ie(),f=n?.hasAttribute(JE(`focus-guard`))&&[L.current,R.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,dO(d),dO(u)].includes(n),p=!(X(_,n)||X(v,n)||X(n,v)||X(A?.portalNode,n)||l.some(e=>e===n||X(e,n))||c.hasMatchingElement(e=>X(e,n))||f||k&&(KE(k.nodesRef.current,a).find(e=>X(e.context?.elements.floating,n)||X(e.context?.elements.domReference,n))||qE(k.nodesRef.current,a).find(e=>[e.context?.elements.floating,Ww(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&H&&yO(H),o&&r!==_&&!bE(i)&&lw(e)===e.body){if(WC(H)&&(H.focus(),o===`popup`)){te.request(()=>{H.focus()});return}let e=re(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||H;WC(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!s)&&n&&p&&!M.current&&(C||n!==_O())&&(j.current=!0,h.setOpen(!1,pT(rT,t)))})}function a(){N.current||(b.current.insideReactTree=!0,V.start(0,()=>{b.current.insideReactTree=!1}))}let l=WC(_)?_:null;if(v||l)return vT(l&&_T(l,`focusout`,i),l&&_T(l,`pointerdown`,t),v&&_T(v,`focusin`,n),v&&_T(v,`focusout`,i),v&&A&&_T(v,`focusout`,a,!0))},[r,_,v,H,s,k,A,h,c,o,re,C,x,b,V,ee,te,u,d,ie]),T.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${JE(`portal`)}]`)||[]),t=(k?qE(k.nodesRef.current,x()):[]).find(e=>Hw(e.context?.elements.domReference||null))?.context?.elements.domReference,n=cD([v,...e,L.current,R.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...ie(),t,dO(d),dO(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),i=cD([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,A,C,k,x,u,d,ie]),Y(()=>{if(!g||r||!WC(H))return;F.current=``,I.current=``;let e=IT(H),t=lw(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||X(H,t))return;let i=null,a=()=>(i??=re(H),i[0]||H),o;o=r===!0||r===null?a():dO(r),o||=a();let s=X(H,lw(e));XE(o,{preventScroll:o===H,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=lw(e);return!(t!==o&&X(H,t))}})})},[r,g,H,re,w,D,O]),Y(()=>{if(r||!H)return;let e=IT(H),t=lw(e),n=D.current==null;gO(t);function i(e){if(e.open||(F.current=fO(e.nativeEvent,I.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(PC(e.nativeEvent)||FC(e.nativeEvent))j.current=!1;else{let e=!1;IT(H).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}y.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&zC(t)!==`body`?t:null,s=n?o||a:a||o;return s||=_O()||null,typeof i==`boolean`?s:dO(i)||s||null}return()=>{y.off(`openchange`,i);let t=lw(e),n=ie(),r=X(v,t)||n.some(e=>e===t||X(e,t))||k&&KE(k.nodesRef.current,x(),!1).some(e=>X(e.context?.elements.floating,t)),o=E.current,s=F.current,c=a(s);queueMicrotask(()=>{let n=vO(c),i=typeof o!=`boolean`;if(o&&!j.current&&WC(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,v,H,E,D,y,k,_,x,ie]),Y(()=>{if(!kC||g||!v)return;let e=lw(IT(v));WC(e)&&Bw(e)&&X(v,e)&&e.blur()},[g,v]),Y(()=>{if(!r&&A)return A.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,s,g,h,c,_]),Y(()=>{if(!r&&H)return yO(H),()=>{queueMicrotask(hO)}},[r,H]);let ae=!r&&(!s||!C)&&(ne||s);return(0,Z.jsxs)(T.Fragment,{children:[ae&&(0,Z.jsx)(BT,{"data-type":`inside`,ref:z,onFocus:e=>{if(s){let e=re();XE(e[e.length-1])}else A?.portalNode&&(j.current=!1,UE(e,A.portalNode)?RE(_)?.focus():dO(d??A.beforeOutsideRef)?.focus())}}),n,ae&&(0,Z.jsx)(BT,{"data-type":`inside`,ref:B,onFocus:e=>{s?XE(re()[0]):A?.portalNode&&(c&&(j.current=!0),UE(e,A.portalNode)?zE(_)?.focus():dO(u??A.afterOutsideRef)?.focus())}})]})}function xO(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Zw}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=T.useRef(void 0),f=FT(),p=_C(),m=T.useMemo(()=>{function e(e,t,n,r){let i=pT(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=IC(e.pointerType,!0)&&FC(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||IC(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=uw(o);if(Bw(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}IC(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return T.useMemo(()=>n?{reference:m}:lC,[n,m])}function SO(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function CO(e){return e!=null&&e.clientX!=null}function wO(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=T.useRef(!1),u=T.useRef(null),[d,f]=T.useState(),[p,m]=T.useState([]),h=Q(e=>{i.set(`positionReference`,e)}),g=Q((e,t,n)=>{l.current||(!c.current.openEvent||CO(c.current.openEvent))&&i.set(`positionReference`,SO(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),_=Q(e=>{a?u.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),v=IC(d)?o:a;T.useEffect(()=>{if(!n){h(s);return}if(!v)return;function e(){u.current?.(),u.current=null}let t=BC(o);function r(t){let n=uw(t);X(o,n)?e():g(t.clientX,t.clientY)}return!c.current.openEvent||CO(c.current.openEvent)?u.current=_T(t,`mousemove`,r):h(s),e},[v,n,o,c,s,i,g,h,p]),T.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),T.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),T.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let y=T.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return T.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function TO(){return!1}function EO(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function DO(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=TO,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f,events:p}=l.context,m=sO(c),h=Q(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=Q(()=>a),{escapeKey:y,outsidePress:b}=EO(s),x=T.useRef(!1),S=T.useRef(!1),C=T.useRef(!1),w=T.useRef(!1),E=T.useRef(!1),D=T.useRef(``),O=T.useRef(null),k=_C(),A=_C(),j=Q(()=>{A.clear(),f.current.insideReactTree=!1}),M=Q(e=>{let t=f.current.floatingContext?.nodeId;return(m?KE(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=Q(e=>Rw(e,l.select(`floatingElement`))||Rw(e,l.select(`domReferenceElement`))),P=Q(e=>{o()&&l.setOpen(!1,pT(Zw,e.nativeEvent))}),F=Q(e=>{if(!u||!n||!r||e.key!==`Escape`||E.current||!y&&M(`__escapeKeyBubbles`))return;let t=pT(iT,NC(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),I=Q(()=>{f.current.insideReactTree=!0,A.start(0,j)}),L=Q(e=>{if(!u||!n||e.button!==0)return;let t=uw(e.nativeEvent);X(l.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),R=Q(e=>{u&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});T.useEffect(()=>{function e(e){e.open||(w.current=!1)}return p.on(`openchange`,e),()=>{p.off(`openchange`,e)}},[p]),T.useEffect(()=>{if(!u||!n)return u||(w.current=!1),j;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;let e=new gC,t=new gC,i=IT(d);function a(){e.clear(),E.current=!0}function o(){e.start(kC?5:0,()=>{E.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function p(){let e=D.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function h(e){let t=p();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function T(e){let t=f.current.floatingContext?.nodeId,n=m&&KE(m.nodesRef.current,t).some(t=>Rw(e,t.context?.elements.floating));return N(e)||n}function A(e){if(h(e)){e.type!==`click`&&!N(e)&&(t.clear(),C.current=!1),j();return}if(f.current.insideReactTree){j();return}let n=uw(e),r=`[${JE(`inert`)}]`,i=UC(n)?n.getRootNode():null,a=Array.from((GC(i)?i:IT(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>X(e,n))))return;let s=UC(n)?n:null;for(;s&&!nw(s);){let e=aw(s);if(nw(e)||!UC(e))break;s=e}if(!(a.length&&UC(n)&&!zw(n)&&!X(n,l.select(`floatingElement`))&&a.every(e=>!X(s,e)))){if(WC(n)&&!(`touches`in e)){let t=nw(n),r=rw(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!T(e)){if(p()===`intentional`){if(e.detail!==0&&!PC(e)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}(typeof g!=`function`||g(e))&&(M(`__outsidePressBubbles`)||(l.setOpen(!1,pT(eT,e)),j()))}}}function P(e){p()===`sloppy`&&e.pointerType!==`touch`&&l.select(`open`)&&n&&!N(e)&&A(e)}function I(e){if(p()!==`sloppy`||!l.select(`open`)||!n||N(e))return;let t=e.touches[0];t&&(O.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},k.start(1e3,()=>{O.current&&(O.current.dismissOnTouchEnd=!1,O.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=uw(e);if(!n)return;let r=_T(n,e.type,()=>{t(e),r()})}function R(e){D.current=`touch`,L(e,I)}function z(e){k.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),D.current=e.pointerType),(e.type!==`mousedown`||!O.current||O.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):A(e)})}function B(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;if(c(),p()===`intentional`){if(e.type===`pointercancel`){n&&s();return}if(!T(e)){if(n){s();return}(typeof g!=`function`||g(e))&&(t.clear(),C.current=!0,j())}}}function V(e){if(p()!==`sloppy`||!O.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-O.current.startX),r=Math.abs(t.clientY-O.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(O.current.dismissOnTouchEnd=!0),i>10&&(A(e),k.clear(),O.current=null)}function ee(e){L(e,V)}function te(e){p()===`sloppy`&&O.current&&!N(e)&&(O.current.dismissOnTouchEnd&&A(e),k.clear(),O.current=null)}function ne(e){L(e,te)}let H=vT(r&&vT(_T(i,`keydown`,F),_T(i,`compositionstart`,a),_T(i,`compositionend`,o)),_&&vT(_T(i,`click`,z,!0),_T(i,`pointerdown`,z,!0),_T(i,`pointerup`,B,!0),_T(i,`pointercancel`,B,!0),_T(i,`mousedown`,z,!0),_T(i,`mouseup`,B,!0),_T(i,`touchstart`,R,{capture:!0,passive:!0}),_T(i,`touchmove`,ee,{capture:!0,passive:!0}),_T(i,`touchend`,ne,{capture:!0,passive:!0})));return()=>{H(),e.clear(),t.clear(),c(),C.current=!1,j()}},[f,d,r,_,g,u,n,y,b,F,j,v,M,N,m,l,k]);let z=T.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),B=T.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return T.useMemo(()=>n?{reference:z,floating:B,trigger:z}:{},[n,z,B])}function OO(e,t,n){let{reference:r,floating:i}=e,a=$T(t),o=eE(t),s=QT(o),c=YT(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=XT(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function kO(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}=JT(t,e),p=fE(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=pE(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=pE(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 AO=50,jO=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:kO},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=OO(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<AO&&(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}=OO(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},MO=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}=JT(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=YT(r),_=$T(o),v=YT(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[uE(o)]:nE(o)),x=p!==`none`;!d&&x&&b.push(...lE(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=tE(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`||_===$T(t)||T.every(e=>$T(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=$T(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{}}}},NO=new Set([`left`,`top`]);async function PO(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=YT(n),s=XT(n),c=$T(n)===`y`,l=NO.has(o)?-1:1,u=a&&c?-1:1,d=JT(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 FO=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 PO(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}}}}},IO=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}=JT(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=$T(i),p=ZT(f),m=u[p],h=u[f],g=(e,t)=>qT(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}}}}}},LO=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}=JT(e,t),u={x:n,y:r},d=$T(i),f=ZT(d),p=u[f],m=u[d],h=JT(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=NO.has(YT(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}}}},RO=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}=JT(e,t),c=await i.detectOverflow(t,s),l=YT(n),u=XT(n),d=$T(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=VT(p-c[m],g),y=VT(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*HT(c.left,c.right):S=p-2*HT(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 zO(e){let t=rw(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=WC(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=UT(n)!==a||UT(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function BO(e){return UC(e)?e:e.contextElement}function VO(e){let t=BO(e);if(!WC(t))return GT(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=zO(t),o=(a?UT(n.width):n.width)/r,s=(a?UT(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var HO=GT(0);function UO(e){let t=BC(e);return!tw()||!t.visualViewport?HO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function WO(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===BC(e)}function GO(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=BO(e),o=GT(1);t&&(r?UC(r)&&(o=VO(r)):o=VO(e));let s=WO(a,n,r)?UO(a):GT(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=BC(a),t=UC(r)?BC(r):r,n=e,i=cw(n);for(;i&&t!==n;){let e=VO(i),t=i.getBoundingClientRect(),r=rw(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=BC(i),i=cw(n)}}return pE({width:u,height:d,x:c,y:l})}function KO(e,t){let n=iw(e).scrollLeft;return t?t.left+n:GO(VC(e)).left+n}function qO(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-KO(e,n),y:n.top+t.scrollTop}}function JO(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=VC(r),s=t?JC(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=GT(1),u=GT(0),d=WC(r);if((d||!a)&&((zC(r)!==`body`||KC(o))&&(c=iw(r)),d)){let e=GO(r);l=VO(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?qO(o,c):GT(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 YO(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function XO(e){let t=iw(e),n=e.ownerDocument.body,r=HT(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=HT(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+KO(e),o=-t.scrollTop;return rw(n).direction===`rtl`&&(a+=HT(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ZO=25;function QO(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=BC(e),a=VC(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!tw()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(KO(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<=ZO&&(s-=o)}return{width:s,height:c,x:l,y:u}}function $O(e,t){let n=GO(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=VO(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ek(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=QO(e,n,t);else if(t===`document`)r=XO(VC(e));else if(UC(t))r=$O(t,n);else{let n=UO(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return pE(r)}function tk(e,t){let n=t.get(e);if(n)return n;let r=sw(e,[],!1).filter(e=>UC(e)&&zC(e)!==`body`),i=null,a=rw(e).position===`fixed`,o=a?aw(e):e;for(;UC(o)&&!nw(o);){let e=rw(o),t=$C(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=aw(o)}return t.set(e,r),r}function nk(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?JC(t)?[]:tk(t,this._c):[].concat(n),r],o=ek(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=ek(t,a[e],i);s=HT(n.top,s),c=VT(n.right,c),l=VT(n.bottom,l),u=HT(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function rk(e){let{width:t,height:n}=zO(e);return{width:t,height:n}}function ik(e,t,n){let r=WC(t),i=VC(t),a=n===`fixed`,o=GO(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=GT(0);if((r||!a)&&((zC(t)!==`body`||KC(i))&&(s=iw(t)),r)){let e=GO(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=KO(i));let l=i&&!r&&!a?qO(i,s):GT(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 ak(e){return rw(e).position===`static`}function ok(e,t){if(!WC(e)||rw(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return VC(e)===n&&(n=n.ownerDocument.body),n}function sk(e,t){let n=BC(e);if(JC(e))return n;if(!WC(e)){let t=aw(e);for(;t&&!nw(t);){if(UC(t)&&!ak(t))return t;t=aw(t)}return n}let r=ok(e,t);for(;r&&qC(r)&&ak(r);)r=ok(r,t);return r&&nw(r)&&ak(r)&&!$C(r)?n:r||ew(e)||n}var ck=async function(e){let t=this.getOffsetParent||sk,n=this.getDimensions,r=await n(e.floating);return{reference:ik(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function lk(e){return rw(e).direction===`rtl`}var uk={convertOffsetParentRelativeRectToViewportRelativeRect:JO,getDocumentElement:VC,getClippingRect:nk,getOffsetParent:sk,getElementRects:ck,getClientRects:YO,getDimensions:rk,getScale:VO,isElement:UC,isRTL:lk};function dk(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fk(e,t,n){let r=null,i,a=VC(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=WT(d),h=WT(a.clientWidth-(u+f)),g=WT(a.clientHeight-(d+p)),_=WT(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:HT(0,VT(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!dk(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=BC(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function pk(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=BO(e),u=i||a?[...l?sw(l):[],...t?sw(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?fk(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?GO(e):null;c&&g();function g(){let t=GO(e);h&&!dk(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 mk=FO,hk=IO,gk=MO,_k=RO,vk=LO,yk=(e,t,n)=>{let r=new Map,i=n??{},a={...uk,...i.platform,_c:r};return jO(e,t,{...i,platform:a})},bk=typeof document<`u`?T.useLayoutEffect:function(){};function xk(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!xk(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!xk(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Sk(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ck(e,t){let n=Sk(e);return Math.round(t*n)/n}function wk(e){let t=T.useRef(e);return bk(()=>{t.current=e}),t}function Tk(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=T.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=T.useState(r);xk(f,r)||p(r);let[m,h]=T.useState(null),[g,_]=T.useState(null),v=T.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=T.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=T.useRef(null),C=T.useRef(null),w=T.useRef(u),E=c!=null,D=wk(c),O=wk(i),k=wk(l),A=T.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),yk(S.current,C.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!xk(w.current,t)&&(w.current=t,XD.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);bk(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=T.useRef(!1);bk(()=>(j.current=!0,()=>{j.current=!1}),[]),bk(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(D.current)return D.current(b,x,A);A()}},[b,x,A,D,E]);let M=T.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),N=T.useMemo(()=>({reference:b,floating:x}),[b,x]),P=T.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Ck(N.floating,u.x),r=Ck(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Sk(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return T.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Ek=(e,t)=>{let n=mk(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dk=(e,t)=>{let n=hk(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ok=(e,t)=>({fn:vk(e).fn,options:[e,t]}),kk=(e,t)=>{let n=gk(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ak=(e,t)=>{let n=_k(e);return{name:n.name,fn:n.fn,options:[e,t]}},jk=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})),Mk=o(((e,t)=>{t.exports=jk()})),Nk=o((e=>{var t=u(),n=Mk();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}})),Pk=o(((e,t)=>{t.exports=Nk()})),Fk=Mk(),Ik=Pk(),Lk=mD(19)?Bk:Vk;function Rk(e,t,n,r,i){return Lk(e,t,n,r,i)}function zk(e,t,n,r,i){let a=T.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Fk.useSyncExternalStore)(e.subscribe,a,a)}rC({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Fk.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Bk(e,t,n,r,i){let a=nC();if(!a)return zk(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Vk(e,t,n,r,i){return(0,Ik.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Hk=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Rk(this,e,t,n,r)}},Uk=class extends Hk{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){T.useDebugValue(e);let n=this;Y(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;Y(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;Y(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){T.useDebugValue(e);let n=this,r=t!==void 0;Y(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return T.useDebugValue(e),Rk(this,this.selectors[e],t,n,r)}useContextCallback(e,t){T.useDebugValue(e);let n=Q(t??sC);this.context[e]=n}useStateSetter(e){let t=T.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Wk={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Gk=class extends Uk{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:nO(),nested:n,triggerElements:i},Wk),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&LC(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Kk(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=T.useRef(null);r===void 0&&f.current===null&&(f.current=new Gk({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),Y(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};UC(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function qk(e,t=!1,n=!1,r=!1){let[i,a]=T.useState(e&&t?`idle`:void 0),[o,s]=T.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),Y(()=>{if(!e&&o&&i!==`ending`&&n){let e=PT.request(()=>{a(`ending`)});return()=>{PT.cancel(e)}}},[e,o,i,n]),Y(()=>{if(!e||t)return;let n=PT.request(()=>{a(void 0)});return()=>{PT.cancel(n)}},[t,e]),Y(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=PT.request(()=>{a(`idle`)});return()=>{PT.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}var Jk=null;function Yk(e){if(!Jk){let e=[];Jk=e,queueMicrotask(()=>{Jk=null,XD.flushSync(()=>{for(let t of e)t()})})}Jk.push(e)}function Xk(e,t=!1,n=!1){let r=FT();return Q((i,a=null)=>{r.cancel();let o=dO(e);if(o==null)return;let s=o,c=()=>{if(!n){XD.flushSync(i);return}Yk(()=>{a?.aborted||i()})};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()},()=>{if(!a?.aborted){if(s.getAnimations().some(e=>e.pending||e.playState!==`finished`)){l();return}c()}})}if(t){let e=_w;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function Zk(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=Q(a),s=Xk(r,n,i);T.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var Qk={tabIndex:-1,[dw]:``};function $k(e){return t=>t!==`touch`||e.current}function eA(e,t=!1){let n=fD(),r=oO()!=null,i=$S(()=>e(n,r)).current;return Kk({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function tA({handle:e,store:t}){return Y(()=>e.attachStore(t),[e,t]),null}function nA(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function rA(e,t){let n=T.useRef(null);return Q(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),nA(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),nA(t))})}function iA(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s}}function aA(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function oA(e,t,n,r={}){let i=n.reason,a=i===Qw,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=aA(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=iA(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?XD.flushSync(l):l()}function sA(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=rA(e,n),o=Q(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e);return}if(a==null&&i){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=Q(e=>{a(e),e&&o(e)});return Y(()=>(s(t.current),()=>s(null)),[s,t,n,e]),Y(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function cA(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=T.useRef(null),i=e.useState(`open`);Y(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=pT(Xw);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function lA(e,t,n,r){let{mounted:i,setMounted:a,transitionStatus:o}=qk(e,!1,!1,r),s=t.useState(`preventUnmountingOnClose`),c=!e&&s;t.useSyncedValues({mounted:i,transitionStatus:o,preventUnmountingOnClose:c});let l=Q(()=>{a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Zk({enabled:i&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:o}}function uA(e,t){e.useSyncedValues(t),Y(()=>()=>{e.update({activeTriggerProps:lC,inactiveTriggerProps:lC,popupProps:lC})},[e])}function dA(e,t){Y(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),Y(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var fA=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function pA(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Gk({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:lC,inactiveTriggerProps:lC,popupProps:lC}}var mA=e=>e.triggerIdProp??e.activeTriggerId,hA=e=>e.openProp??e.open,gA=e=>(e.popupElement?.id??e.floatingId)||void 0;function _A(e,t){return t!==void 0&&hA(e)&&mA(e)===t}function vA(e,t){return _A(e,t)?!0:t!==void 0&&hA(e)&&mA(e)==null&&e.triggerCount===1}var yA={open:hA,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:mA,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:gA,isTriggerActive:(e,t)=>t!==void 0&&mA(e)===t,isOpenedByTrigger:(e,t)=>_A(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&mA(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>vA(e,t)?gA(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function bA(e){let t=T.useCallback(t=>e===void 0?sC:e.subscribeStore(t),[e]),n=T.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Fk.useSyncExternalStore)(t,n,()=>e?.serverStore)}function xA(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=fD(),a=oO()!=null,o=$S(()=>new Gk({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new fA,floatingId:i,syncOnly:!1,nested:a})).current;return Y(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=UC(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function SA(e){return CA(e,e.rootContext)}function CA(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=T.useState(null),[d,f]=T.useState(void 0),[p,m]=T.useState(void 0),h=T.useRef(null),g=sO(r),_=T.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),v=Tk({...e,elements:{..._,...l&&{reference:l}}}),y=UC(d)?d:null,b=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:y),t.useSyncedValue(`floatingElement`,b);let x=T.useCallback(e=>{let t=UC(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),v.refs.setReference(t)},[v.refs]),S=T.useCallback(e=>{(UC(e)||e===null)&&(h.current=e,f(e)),(UC(v.refs.reference.current)||v.refs.reference.current===null||e!==null&&!UC(e))&&v.refs.setReference(e)},[v.refs,f]),C=T.useCallback(e=>{m(e),v.refs.setFloating(e)},[v.refs]),w=T.useMemo(()=>({...v.refs,setReference:S,setFloating:C,setPositionReference:x,domReference:h}),[v.refs,S,C,x]),E=T.useMemo(()=>({...v.elements,domReference:o}),[v.elements,o]),D=T.useMemo(()=>({...v,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:w,elements:E,nodeId:n,rootStore:t}),[v,w,E,n,t,s,c]);return Y(()=>{o&&(h.current=o)},[o]),Y(()=>{t.context.dataRef.current.floatingContext=D;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=D)}),T.useMemo(()=>({...v,context:D,refs:w,elements:E,rootStore:t}),[v,w,E,D,t])}var wA=DC&&kC;function TA(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=T.useRef(!1),c=T.useRef(null),l=T.useRef(!0),u=_C();T.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=BC(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&WC(e)&&e===lw(IT(e))&&(s.current=!0,c.current=e)}function a(){l.current=!0}function o(){l.current=!1}return vT(_T(t,`blur`,r),wA&&_T(t,`keydown`,a,!0),wA&&_T(t,`pointerdown`,o,!0))},[i,n]),T.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);UC(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=T.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=uw(t.nativeEvent);if(UC(a)){if(wA&&!t.relatedTarget){if(!l.current&&!Bw(a))return}else if(!Uw(a))return}let o=Lw(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,pT($w,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,pT($w,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=UC(n)&&n.hasAttribute(JE(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=lw(IT(e));(n||t!==e)&&(X(o.current.floatingContext?.refs.floating.current,t)||X(e,t)||a||Lw(n??t,i.context.triggerElements)||i.setOpen(!1,pT($w,r)))})}}},[o,r,i,u]);return T.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var EA=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new gC,this.restTimeout=new gC,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},DA=new WeakMap;function OA(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&DA.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),DA.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function kA(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=DA.get(n);a&&a!==e&&OA(a),OA(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,DA.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function AA(e){let t=e.context.dataRef.current,n=$S(()=>t.hoverInteractionState??EA.create()).current;return t.hoverInteractionState||=n,mC(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function jA(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=sO(),d=oO(),f=AA(a),p=_C(),m=Q(()=>Jw(l.current.openEvent?.type,f.interactedInside)),h=Q(()=>Yw(l.current.openEvent?.type)),g=Q(()=>{OA(f)});Y(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),T.useEffect(()=>g,[g]),Y(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&UC(c)&&s){let e=c,t=s,n=IT(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return kA(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),T.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&KE(u.nodesRef.current,d).length>0)}function t(e){let t=Kw(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,pT(Qw,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=uw(e);if(!Vw(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(Lw(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&UC(o)&&KE(u.nodesRef.current,r,!1).some(e=>X(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),h()&&!m()&&t(n)}}function v(t){u&&d&&!e()&&p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,pT(Qw,t)),u.events.emit(`floating.closed`,t)})}let y=s;return vT(y&&_T(y,`mouseenter`,c),y&&_T(y,`mouseleave`,_),y&&_T(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var MA={current:null};function NA(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=MA,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,v=sO(l),y=AA(h),b=T.useRef(!1),x=TT(i),S=TT(r),C=TT(o),w=TT(n),E=TT(p),D=TT(f),O=Q(()=>Jw(g.current.openEvent?.type,y.interactedInside)),k=Q(()=>E.current?.()!==!1),A=Q((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!X(e,t);if(!UC(n))return!1;let i=n;return r.hasMatchingElement(e=>X(e,i))&&(!e||!X(e,i))}),j=Q(()=>{y.handler&&=(IT(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),M=Q(()=>{OA(y)});return u&&(y.handleCloseOptions=i?.__options),T.useEffect(()=>j,[j]),T.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===Qw,j(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,j]),T.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=Kw(S.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{h.setOpen(!1,pT(Qw,e)),v?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),h.setOpen(!1,pT(Qw,e)),v?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!UC(t))return;function r(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!IC(y.pointerType))return;let t=qw(C.current),n=Kw(S.current,`open`,y.pointerType),r=uw(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(UC(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(X(e,r)){s=e;break}}UC(i)&&UC(o)&&!h.context.triggerElements.hasElement(i)&&X(i,o)&&(s=o);let c=s!=null&&A(o,s,r),l=h.select(`open`),u=D.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&b.current,f=!c&&UC(s)&&UC(o)&&X(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){k()&&h.setOpen(!0,pT(Qw,e,s));return}p||(n?y.openChangeTimeout.start(n,()=>{g&&k()&&h.setOpen(!0,pT(Qw,e,s))}):g&&k()&&h.setOpen(!0,pT(Qw,e,s)))}function i(t){if(O()){M();return}j();let n=IT(h.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!Lw(t.relatedTarget,h.context.triggerElements)){if(x.current&&r){h.select(`open`)||y.openChangeTimeout.clear();let i=c.current;y.handler=x.current({...r,tree:v,x:t.clientX,y:t.clientY,onClose(){M(),j(),w.current&&!O()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,y.handler),y.handler(t);return}(y.pointerType!==`touch`||!X(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){X(t,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let l=m?_T(t,`mouseout`,o):void 0;return s?vT(_T(t,`mousemove`,r,{once:!0}),_T(t,`mouseenter`,r),_T(t,`mouseleave`,i),l):vT(_T(t,`mouseenter`,r),_T(t,`mouseleave`,i),l)},[j,M,g,S,h,n,x,y,u,A,O,a,s,C,c,v,w,d,D,k,m]),T.useMemo(()=>{if(!n)return;function e(e){y.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=A(r,n,e.target);if(a&&!IC(y.pointerType))return;if(i&&o&&y.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=y.handleCloseOptions?.getScope?.()??n.ownerDocument.body;kA(y,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=qw(C.current);if(i&&!o||s===0||!o&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;y.restTimeout.clear();function c(){if(y.restTimeoutPending=!1,O())return;let e=h.select(`open`);!y.blockMouseMove&&(!e||o)&&k()&&h.setOpen(!0,pT(Qw,t,n))}y.pointerType===`touch`?XD.flushSync(()=>{c()}):o&&i?c():(y.restTimeoutPending=!0,y.restTimeout.start(s,c))}}},[n,y,O,A,a,h,C,k])}var PA=`Escape`;function FA(e){return kC&&e.movementX===0&&e.movementY===0}function IA(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function LA(e,t){return IA(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function RA(e,t,n){return IA(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function zA(e,t,n){return IA(t,n?e===pw:e===mw,e===gw)}function BA(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===PA:IA(t,n?e===mw:e===pw,e===hw)}function VA(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,id:v,resetOnPointerLeave:y=!0,externalTree:b,grid:x}=t,S=x!=null,C=`rootStore`in e?e.rootStore:e,w=C.useState(`open`),E=C.useState(`floatingElement`),D=C.useState(`domReferenceElement`),O=C.context.dataRef,k=Ww(E),A=Hw(D),j=TT(k),M=oO(),N=sO(b),P=T.useRef(f),F=T.useRef(o??-1),I=T.useRef(null),L=T.useRef(!0),R=Q(e=>{i(F.current===-1?null:F.current,e)}),z=T.useRef(!!E),B=T.useRef(w),V=T.useRef(!1),ee=T.useRef(!1),te=T.useRef(null),ne=TT(h),H=TT(w),re=TT(o),ie=TT(y),ae=FT(),oe=FT(),se=Q(()=>{function e(e){d?N?.events.emit(`virtualfocus`,e):te.current=XE(e,{sync:V.current,preventScroll:!0})}let t=n.current[F.current],r=ee.current;t&&e(t),(V.current?e=>e():e=>ae.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),de&&(r||!L.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Y(()=>{O.current.orientation=g},[O,g]),Y(()=>{a&&(w&&E?(F.current=o??-1,P.current&&o!=null&&(ee.current=!0,R())):z.current&&(F.current=-1,R()))},[a,w,E,o,R]),Y(()=>{if(a){if(!w){V.current=!1;return}if(E){if(r==null){if(V.current=!1,re.current!=null)return;if(z.current&&(F.current=-1,se()),(!B.current||!z.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>oe.request(e):queueMicrotask)(t),e+=1):(F.current=I.current==null||RA(I.current,g,u)||l?hE(n):gE(n),I.current=null,R())};t()}}else mE(n.current,r)||(F.current=r,se(),ee.current=!1)}}},[a,w,E,r,re,l,n,g,u,R,se,oe]),Y(()=>{if(!a||E||!N||d||!z.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=lw(IT(D??t??null)),r=e.some(e=>e.context&&X(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[a,E,D,N,M,d]),Y(()=>{B.current=w,z.current=!!E}),Y(()=>{w||(I.current=null,P.current=f)},[w,f]);let U=r!=null,W=Q(e=>{if(!H.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,R(e))}),ce=Q(()=>_??N?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),le=Q(()=>hE(n,ne.current)),ue=Q(e=>{if(L.current=!1,V.current=!0,e.which===229||!H.current&&e.currentTarget===j.current)return;if(l&&BA(e.key,g,u,S)){LA(e.key,ce())||MC(e),C.setOpen(!1,pT(oT,e.nativeEvent)),WC(D)&&(d?N?.events.emit(`virtualfocus`,D):D.focus());return}let t=F.current,r=hE(n,h),i=gE(n,h);if(A||(e.key===`Home`&&(MC(e),F.current=r,R(e)),e.key===`End`&&(MC(e),F.current=i,R(e))),x!=null){let t=x(e,F.current,n,g,c,u,h,r,i);if(t!=null&&(F.current=t,R(e)),g===`both`)return}if(LA(e.key,g)){if(MC(e),w&&!d&&lw(e.currentTarget.ownerDocument)===e.currentTarget){F.current=RA(e.key,g,u)?r:i,R(e);return}RA(e.key,g,u)?c?t>=i?s&&t!==n.current.length?F.current=-1:(V.current=!1,F.current=r):F.current=_E(n.current,{startingIndex:t,disabledIndices:h}):F.current=Math.min(i,_E(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?F.current=n.current.length:(V.current=!1,F.current=i):F.current=_E(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):F.current=Math.max(r,_E(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),mE(n.current,F.current)&&(F.current=-1),R(e)}}),de=T.useMemo(()=>({onFocus(e){V.current=!0,W(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){FA(e)||(V.current=!0,ee.current=!1,p&&W(e))},onPointerLeave(e){if(!H.current||!L.current||e.pointerType===`touch`)return;V.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&ie.current&&(te.current?.(),te.current=null,F.current=-1,R(e),!d)){let e=j.current,t=lw(IT(e));e&&X(e,t)&&e.focus({preventScroll:!0})}}}),[W,H,j,p,n,R,ie,d]),fe=T.useMemo(()=>d&&w&&U&&{"aria-activedescendant":`${v}-${r}`},[d,w,U,v,r]),pe=T.useMemo(()=>({...A?{}:fe,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&w&&!d){let t=uw(e.nativeEvent);if(t&&!X(j.current,t))return;MC(e),C.setOpen(!1,pT(rT,e.nativeEvent)),WC(D)&&D.focus();return}ue(e)},onPointerMove(e){FA(e)||(L.current=!0)}}),[fe,ue,j,A,C,w,d,D]),me=T.useMemo(()=>{function e(e){C.setOpen(!0,pT(oT,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&PC(e.nativeEvent)&&(P.current=!d)}function n(e){P.current=f,f===`auto`&&FC(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(t){let n=C.select(`open`);L.current=!1;let r=t.key.startsWith(`Arrow`),i=zA(t.key,ce(),u),a=LA(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return ue(t);if(n||m||!r){if(o){let e=LA(t.key,ce());I.current=l&&e?null:t.key}if(l){i&&(MC(t),n?(F.current=le(),R(t)):e(t));return}a&&(re.current!=null&&(F.current=re.current),MC(t),!n&&m?e(t):ue(t),n&&R(t))}},onFocus(e){C.select(`open`)&&!d&&(F.current=-1,R(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[ue,f,le,l,R,C,m,g,ce,u,re,d]),he=T.useMemo(()=>({...fe,...me}),[fe,me]);return T.useMemo(()=>a?{reference:he,floating:pe,item:de,trigger:me}:{},[a,he,pe,me,de])}function HA(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=_C(),m=T.useRef(``),h=T.useRef(u??i??-1),g=T.useRef(null),_=Q(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!bE(n)||n?.matches(`:disabled`)?!1:o==null||!vE(cC,e,o)}function d(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&c(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(MC(e),s?.(!0)),m.current.length>0&&m.current[0]!==` `&&d(_,m.current)===-1&&e.key!==` `&&s?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(MC(e),s?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,s?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=d(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,s?.(!1)):(a?.(b),g.current=b)}),v=Q(e=>{let t=e.relatedTarget,n=d.select(`domReferenceElement`),r=d.select(`floatingElement`);X(n,t)||X(r,t)||(p.clear(),m.current=``,h.current=g.current,s?.(!1))});Y(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[f,u,p]);let y=T.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return T.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var UA=.1,WA=UA*UA,GA=.5;function KA(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function qA(e,t,n,r,i,a,o,s,c,l){let u=!1;return KA(e,t,n,r,i,a)&&(u=!u),KA(e,t,i,a,o,s)&&(u=!u),KA(e,t,o,s,c,l)&&(u=!u),KA(e,t,c,l,n,r)&&(u=!u),u}function JA(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function YA(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function XA(e={}){let{blockPointerEvents:t=!1}=e,n=new gC,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*WA;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=uw(r),g=r.type===`mouseleave`,_=X(u,h),v=X(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&UC(r.relatedTarget)&&X(u,r.relatedTarget))return;function y(){return!!(s&&KE(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=YA(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=YA(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=YA(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=YA(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!JA(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?GA/2:GA*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+GA+1,o=C||T?S.bottom-GA:S.top,s=C?T?S.bottom-GA:S.top:S.bottom-GA;M=qA(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?GA/2:GA*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-GA,o=C||T?S.top+GA:S.bottom,s=C?T?S.top+GA:S.bottom:S.top+GA;M=qA(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?GA/2:GA*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+GA+1,o=w||E?S.right-GA:S.left,s=w?E?S.right-GA:S.left:S.right-GA;M=qA(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?GA/2:GA*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-GA,o=w||E?S.left+GA:S.right,s=w?E?S.left+GA:S.right:S.left+GA;M=qA(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var ZA={...yA,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},QA=class extends Uk{constructor(e,t,n){let r=new fA;super($A(e,r,t,n),ej(r),ZA)}setOpen=(e,t)=>{oA(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,pT(Zw,e))}};function $A(e,t,n,r=!1){return{...pA(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function ej(e){return{popupRef:T.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var tj=iC(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=eA((e,t)=>new QA({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),cA(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=lA(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=T.useRef(null);Y(()=>{m&&t&&p.setOpen(!1,pT(lT))},[m,t,p]),Y(()=>{b===`ending`&&C===`none`||b!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[b,x,C,S,p]),Y(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),T.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,pT(uT))}),[y,p]);let E=h||_||!t&&a!==`none`;return(0,Z.jsxs)(fC.Provider,{value:p,children:[l&&(0,Z.jsx)(tA,{handle:l,store:p}),E&&(0,Z.jsx)(nj,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function nj({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=DO(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=wO(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=T.useMemo(()=>xD(a.reference,i.reference),[a.reference,i.reference]);return uA(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??lC}),null}function rj(e){return fD(e,`base-ui`)}var ij=T.createContext(void 0);function aj(){return T.useContext(ij)}var oj=`data-base-ui-tooltip-trigger`;function sj(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(UC(n))return n}}let t=e.target;return UC(t)?t:null}function cj(e){let t=e;for(;t;){let e=t.closest(`[${oj}]`);if(e)return e;let n=t.getRootNode();t=`host`in n&&UC(n.host)?n.host:null}return null}var lj=aC(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=pC(!0),m=bA(a)??p;if(!m)throw Error(dC(82));let h=rj(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=T.useRef(null),b=u??0,{registerTrigger:x,isMountedByThisTrigger:S}=sA(h,y,m,{payload:o,closeOnClick:l,closeDelay:b}),C=aj(),{activeIdRef:w,delayRef:E,isInstantPhase:D,hasProvider:O}=gT(v,{open:_}),k=AA(v);m.useSyncedValue(`isInstantPhase`,D);let A=m.useState(`disabled`),j=s??A,M=TT(j),N=m.useState(`trackCursorAxis`),P=m.useState(`disableHoverablePopup`),F=T.useRef(!1),I=_C(),L=T.useRef(void 0);function R(){return O&&w.current!=null?0:c??C??600}function z(e){let t=y.current;if(!t||!e)return!1;let n=cj(e);return n!==null&&n!==t&&X(t,n)}function B(e){let t=z(e);return F.current=t,t&&(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,I.clear()),t}let V=NA(v,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?XA():null,restMs:R,delay(){return u==null&&O?{close:Kw(E.current,`close`)}:{close:b}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),ee=TA(v,{enabled:!j}).reference,te=e=>{let t=F.current,n=sj(e),r=B(n),i=y.current,a=i&&n&&X(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,pT(Qw,e));return}if(t&&!r&&a&&!M.current&&!m.select(`open`)&&i&&IC(L.current)){let t=()=>{!F.current&&!M.current&&!m.select(`open`)&&m.setOpen(!0,pT(Qw,e,i))},n=R();n===0?(I.clear(),t()):I.start(n,t)}},ne=m.useState(`triggerProps`,S);return FD(`button`,e,{state:{open:_},ref:[t,x,y],props:[V,ee,S||N!==`none`?ne:void 0,{onMouseOver(e){te(e.nativeEvent)},onFocus(e){z(sj(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),L.current=void 0},onPointerEnter(e){L.current=e.pointerType},onPointerDown(e){L.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[Iw]:j?``:void 0,[oj]:j?void 0:``},f],stateAttributesMapping:Mw})}),uj=T.createContext(void 0);function dj(){let e=T.useContext(uj);if(e===void 0)throw Error(dC(70));return e}var fj=T.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=eO({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,Z.jsxs)(T.Fragment,{children:[l,c&&XD.createPortal(n,c)]})}),pj=T.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return pC().useState(`mounted`)||n?(0,Z.jsx)(uj.Provider,{value:n,children:(0,Z.jsx)(fj,{ref:t,...r})}):null}),mj=T.createContext(void 0);function hj(){let e=T.useContext(mj);if(e===void 0)throw Error(dC(71));return e}var gj=T.createContext(void 0);function _j(){return T.useContext(gj)?.direction??`ltr`}var vj=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,offsetParent:d=`real`}=JT(e,t)||{};if(l==null)return{};let f=fE(u),p={x:n,y:r},m=eE(i),h=QT(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=qT(k,j,A),N=!c.arrow&&XT(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),yj=(e,t)=>{let{name:n,fn:r}=vj(e);return{name:n,fn:r,options:[e,t]}},bj={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},xj={sideX:`left`,sideY:`top`},Sj=`--available-width`,Cj=`--available-height`,wj=`--anchor-width`,Tj=`--anchor-height`,Ej=`--transform-origin`,Dj=Sj,Oj=Cj;function kj(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Aj(e,t,n){let{rects:r,placement:i}=e;return{side:kj(t,YT(i),n),align:XT(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function jj(e){return Mj(e,SA)}function Mj(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,[C,w]=T.useState(null);!g&&C!==null&&w(null);let E=_.side||`flip`,D=_.align||`flip`,O=_.fallbackAxisSide||`end`,k=v?.crossAxis??!1,A=v?.rootBoundary,j=typeof n==`function`?n:void 0,M=Q(j),N=j?M:n,P=TT(n),F=TT(g),I=_j()===`rtl`,L=C||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":I?`left`:`right`,"inline-start":I?`right`:`left`}[i],R=o===`center`?L:`${L}-${o}`,z=l;typeof z==`number`?z={top:z,right:z,bottom:z,left:z}:z&&={top:z.top||0,right:z.right||0,bottom:z.bottom||0,left:z.left||0};let B=+(i===`bottom`),V=+(i===`top`),ee=+(i===`right`),te=+(i===`left`),ne={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:z},H=T.useRef(null),re=TT(a),ie=TT(s),ae=typeof a==`function`?0:a,oe=typeof s==`function`?0:s,se=[];p&&se.push(p),se.push(Ek(e=>{let t=Aj(e,i,I),n=typeof re.current==`function`?re.current(t):re.current,r=typeof ie.current==`function`?ie.current(t):ie.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ae,oe,I,i]));let U=D===`none`&&E!==`shift`,W=!U&&(u||k||E===`shift`),ce=E===`none`?null:kk({...ne,padding:{top:z.top+1+B,right:z.right+1+te,bottom:z.bottom+1+V,left:z.left+1+ee},mainAxis:!k&&E===`flip`,crossAxis:D===`flip`&&`alignment`,fallbackAxisSideDirection:O}),le=U?null:Dk({...ne,rootBoundary:A,mainAxis:D!==`none`,crossAxis:W,limiter:u||k?void 0:Ok(e=>{if(!H.current)return{};let{width:t,height:n}=H.current.getBoundingClientRect(),r=$T(YT(e.placement)),i=r===`y`?t:n,a=r===`y`?z.left+z.right:z.top+z.bottom;return{offset:i/2+a/2}})},[ne,u,k,A,z,D]);E===`shift`||D===`shift`||o===`center`?se.push(le,ce):se.push(ce,le),se.push(Ak({...ne,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!F.current)return;let i=e.style;i.setProperty(Dj,`${t}px`),i.setProperty(Oj,`${n}px`);let a=BC(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(wj,`${u}px`),i.setProperty(Tj,`${d}px`)}}),yj(e=>({element:H.current||IT(e.elements.floating).createElement(`div`),padding:H.current?d:0,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=YT(r),u=XT(r),d=$T(l)===`y`,f=H.current,p=typeof a==`function`?a(Aj(e,i,I)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return W&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(Ej,d?`${m} ${h}`:`${h} ${m}`),{}}},bj,b),Y(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let ue=T.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:de,elements:fe,x:pe,y:me,middlewareData:he,update:ge,placement:_e,context:ve,isPositioned:ye,floatingStyles:be}=t({rootContext:h,open:m?g:void 0,placement:R,middleware:se,strategy:r,whileElementsMounted:m?void 0:(...e)=>pk(...e,ue),nodeId:y,externalTree:S}),{sideX:xe,sideY:Se}=he.adaptiveOrigin||xj,Ce=ye?r:`fixed`,we=T.useMemo(()=>{let e;return e=ye?b?{position:Ce,[xe]:pe,[Se]:me}:{...be,position:Ce}:{position:Ce,top:0,left:0},e[Dj]=`100vw`,e[Oj]=`100vh`,ye||(e.opacity=0),e},[b,Ce,xe,pe,Se,me,be,ye]),Te=T.useRef(null);Y(()=>{if(!g)return;let e=P.current,t=typeof e==`function`?e():e,n=(Nj(t)?t.current:t)||null;n!==Te.current&&(de.setPositionReference(n),Te.current=n)},[g,de,N,P]),T.useEffect(()=>{if(!g)return;let e=P.current;typeof e!=`function`&&Nj(e)&&e.current!==Te.current&&(de.setPositionReference(e.current),Te.current=e.current)},[g,de,N,P]),T.useEffect(()=>{if(m&&g&&fe.reference&&fe.floating)return pk(fe.reference,fe.floating,ge,ue)},[m,g,fe,ge,ue]);let Ee=YT(_e),De=kj(i,Ee,I),Oe=XT(_e)||`center`,ke=!!he.hide?.referenceHidden;Y(()=>{x&&g&&ye&&Ee!==L&&w(Ee)},[x,g,ye,Ee,L]);let Ae=T.useMemo(()=>({position:`absolute`,top:he.arrow?.y,left:he.arrow?.x}),[he.arrow]),je=he.arrow?.centerOffset!==0;return T.useMemo(()=>({positionerStyles:we,arrowStyles:Ae,arrowRef:H,arrowUncentered:je,side:De,align:Oe,physicalSide:Ee,anchorHidden:ke,refs:de,context:ve,isPositioned:ye,update:ge}),[we,Ae,H,je,De,Oe,Ee,ke,de,ve,ye,ge])}function Nj(e){return e!=null&&`current`in e}function Pj(e){return e===`starting`?HD:lC}function Fj(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),FD(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Pj(r),i],stateAttributesMapping:Pw})}var Ij=T.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=JD,style:g,..._}=e,v=pC(),y=dj(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),E=v.useState(`instantType`),D=v.useState(`transitionStatus`),O=jj({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`adaptiveOrigin`)}),k=Fj(e,T.useMemo(()=>({open:b,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:S===`none`?E:`tracking-cursor`}),[b,O.side,O.align,O.anchorHidden,S,E]),{styles:O.positionerStyles,transitionStatus:D,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,Z.jsx)(mj.Provider,{value:O,children:k})}),Lj=T.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=pC(),{side:s,align:c}=hj(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);Zk({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),jA(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return FD(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[Qk,f,Pj(d),a],stateAttributesMapping:Fw})});function Rj(e){return mD(19)?e:e?`true`:void 0}function zj(e){let[t,n]=T.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function Bj(e){let t=T.useRef(!0);t.current&&(t.current=!1,e())}function Vj(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function Hj({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=T.useRef(e!==void 0),[a,o]=T.useState(t);return[i&&e!==void 0?e:a,T.useCallback(e=>{i||o(e)},[])]}var Uj=T.createContext(void 0),Wj=T.createContext(void 0),Gj=T.createContext(void 0);function Kj(){let e=T.useContext(Uj);if(e===void 0)throw Error(dC(60));return e}function qj(){let e=T.useContext(Wj);if(e===void 0)throw Error(dC(101));return e}function Jj(){let e=T.useContext(Gj);if(e===void 0)throw Error(dC(61));return e}var Yj=`data-valid`,Xj=`data-invalid`,Zj={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Qj={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},$j={valid(e){return e===null?null:e?{[Yj]:``}:{[Xj]:``}}},eM={invalid:void 0,name:void 0,validityData:{state:Zj,errors:[],error:``,value:``,initialValue:null},setValidityData:sC,disabled:void 0,setTouched:sC,setDirty:sC,setFilled:sC,setFocused:sC,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:Qj,registerFieldControl:sC,validation:{getValidationProps:(e,t=lC)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:sC,getInputControl:()=>null,commit:async()=>{},change:sC}},tM=T.createContext(eM);function nM(e=!0){let t=T.useContext(tM);if(t.setValidityData===sC&&!e)throw Error(dC(28));return t}function rM(e,t,n,r,i=!0,a){let{registerFieldControl:o}=nM(),s=$S(()=>Symbol());Y(()=>{let c=s.current;if(!i){o(c,void 0);return}o(c,{controlRef:e,getValue:r,id:t,name:a,value:n})},[e,i,r,t,a,o,s,n]),Y(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var iM=T.createContext({controlId:void 0,registerControlId:sC,resetControlId:sC,labelId:void 0,setLabelId:sC,messageIds:[],setMessageIds:sC,getDescriptionProps:e=>e});function aM(){return T.useContext(iM)}function oM(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=aM(),o=rj(),s=$S(()=>Symbol()),c=T.useRef(!1),l=T.useRef(!1),u=Q(()=>{c.current&&i!==sC&&(c.current=!1,i(s.current,void 0))});return Y(()=>{if(!n||i===sC){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}if(e===void 0){u();return}c.current=!0,i(s.current,e)},[t,n,i,a,o,s,u]),Y(()=>u,[u]),(n?r:void 0)??t??o}function sM(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var cM=(e,t)=>Object.is(e,t);function lM(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function uM(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!sM(e,t,(e,t)=>lM(e,t,n)):e!==t}function dM(e,t,n){return e?e.some(e=>e!==void 0&&lM(t,e,n)):!1}function fM(e,t,n){return e?e.findIndex(e=>e!==void 0&&lM(e,t,n)):-1}function pM(e,t){if(t!==cM)return n=>dM(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function mM(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(pM(t,n)):fM(e,t,n);return i===-1?null:i}function hM(e,t,n,r,i,a){return dM(r,t,i)?a!=null&&e>a&&dM(r,n[a],i)?a:e:e===a?mM(n,r,i,!0):a}function gM(e,t,n){return e.filter(e=>!lM(t,e,n))}function _M(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function vM(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function yM(e){return vM(e?.[0])}function bM(e){return yM(e)?e.flatMap(e=>e.items):e}function xM(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(yM(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function SM(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return _M(e)}function CM(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?_M(e.value):_M(e)}function wM(e,t,n){function r(){return SM(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=bM(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function TM(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,Z.jsx)(T.Fragment,{children:wM(r,t,n)},i)),e),[])}var EM={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:CM(t,r)!==``},hasNullItemLabel:(e,t)=>t?xM(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>lM(t,e,n)):lM(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows},DM=T.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:sC,validationMode:`onSubmit`,submitCountRef:{current:0}});function OM(){return T.useContext(DM)}function kM(e,t){let n=T.useRef(e),r=Q(t);Y(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function AM(e){let t=T.useRef(``),n=T.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:T.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function jM(e,t){let{onClick:n,onPointerDown:r}=AM(Q((n,r)=>{(typeof e==`function`?e():e)||t(r||(wC?`touch`:``))}));return T.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function MM(e){let[t,n]=T.useState(null),r=jM(e,n);return kM(e,t=>{t&&!e&&n(null)}),T.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function NM(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function PM(e,t){return Math.max(0,e-t)}function FM(e,t){if(t<=0)return 0;let n=NM(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function IM(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:v,multiple:y=!1,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S=cM,highlightItemOnHover:C=!0,children:w}=e,{clearErrors:E}=OM(),{setDirty:D,setTouched:O,setFocused:k,validityData:A,setFilled:j,name:M,disabled:N,validation:P,validationMode:F}=nM(),I=oM({id:t}),L=N||d,R=M??c,[z,B]=Hj({controlled:n,default:y?r??cC:r,name:`Select`,state:`value`}),[V,ee]=Hj({controlled:a,default:o,name:`Select`,state:`open`}),te=T.useRef([]),ne=T.useRef([]),H=T.useRef(null),re=T.useRef(null),ie=T.useRef(0),ae=T.useRef(null),oe=T.useRef([]),se=T.useRef(!1),U=T.useRef(null),W=T.useRef(null),ce=T.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),le=T.useRef(!1),ue=T.useRef(z),{mounted:de,setMounted:fe,transitionStatus:pe}=qk(V),{openMethod:me,triggerProps:he}=MM(V),ge=$S(()=>new Uk({id:I,labelId:void 0,modal:m,multiple:y,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,value:z,open:V,mounted:de,transitionStatus:pe,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:lC,triggerProps:lC,triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:sC,setOpen:sC,handleScrollArrowVisibility:sC,onOpenChangeComplete:sC,listRef:te,popupRef:H,scrollHandlerRef:re,scrollArrowsMountedCountRef:ie,valueRef:ae,valuesRef:oe,labelsRef:ne,typingRef:se,selectionRef:ce,firstItemTextRef:U,selectedItemTextRef:W,alignItemWithTriggerActiveRef:le,initialValueRef:ue},EM)).current,_e=ge.useState(`activeIndex`),ve=ge.useState(`selectedIndex`),ye=ge.useState(`triggerElement`),be=ge.useState(`positionerElement`),xe=zj(me),Se=me??xe,Ce=T.useMemo(()=>y?``:CM(z,x),[y,z,x]),we=T.useMemo(()=>y&&Array.isArray(z)?z.map(e=>CM(e,x)):CM(z,x),[y,z,x]);rM(TT(ye),I,z,Q(()=>we),!L,c);let Te=y?Array.isArray(z)&&z.length>0:z!=null&&Ce!==``;Y(()=>{j(Te)},[Te,j]),Y(function(){let e=mM(oe.current,z,S,y);e===null&&(W.current=null),!V&&ge.set(`selectedIndex`,e)},[y,V,z,S,ge]),kM(z,()=>{E(R),D(uM(z,A.initialValue,S)),P.change(z)});let Ee=Q((e,t)=>{s?.(e,t),!t.isCanceled&&(ee(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(O(!0),k(!1),F===`onBlur`&&P.commit(z)))}),De=Q(()=>{fe(!1),ge.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)});Zk({enabled:!h,open:V,ref:H,onComplete(){V||De()}}),T.useImperativeHandle(h,()=>({unmount:De}),[De]);let Oe=Q((e,t)=>{i?.(e,t),!t.isCanceled&&B(e)}),ke=Q(e=>{let t=PM(e.scrollHeight,e.clientHeight),n=FM(e.scrollTop,t),r=n>0,i=n<t;ge.set(`scrollUpArrowVisible`,r),ge.set(`scrollDownArrowVisible`,i)}),Ae=xA({open:V,onOpenChange:Ee,elements:{reference:ye,floating:be}}),je=xO(Ae,{enabled:!L,event:`mousedown`}),Me=DO(Ae),Ne=VA(Ae,{enabled:!L,listRef:te,activeIndex:_e,selectedIndex:ve,disabledIndices:cC,onNavigate(e){(e!==null||V)&&ge.set(`activeIndex`,e)},focusItemOnHover:C}),Pe=HA(Ae,{enabled:!L&&(V||!f&&!y),listRef:ne,activeIndex:_e,selectedIndex:ve,disabledIndices:e=>Vj(te.current[e]),onMatch(e){V?ge.set(`activeIndex`,e):Oe(oe.current[e],pT(Xw))},onTyping(e){se.current=e}}),Fe=T.useMemo(()=>xD(Pe.reference,Ne.reference,Me.reference,je.reference,he),[je.reference,Pe.reference,Ne.reference,Me.reference,he]),Ie=T.useMemo(()=>xD(Qk,Pe.floating,Ne.floating,Me.floating),[Pe.floating,Ne.floating,Me.floating]),Le=Ne.item??lC;ge.useContextCallback(`setValue`,Oe),ge.useContextCallback(`setOpen`,Ee),ge.useContextCallback(`handleScrollArrowVisibility`,ke),ge.useContextCallback(`onOpenChangeComplete`,_),Bj(()=>{ge.update({popupProps:Ie,triggerProps:Fe})}),ge.useSyncedValues({id:I,modal:m,multiple:y,value:z,open:V,mounted:de,transitionStatus:pe,popupProps:Ie,triggerProps:Fe,items:v,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,openMethod:Se});let Re=T.useMemo(()=>({disabled:L,readOnly:f,required:p,multiple:y,highlightItemOnHover:C,itemProps:Le}),[L,f,p,y,C,Le]),ze=yT(g,P.inputRef),Be=y?void 0:R,Ve=T.useMemo(()=>!y||!Array.isArray(z)||!R?null:z.map(e=>{let t=CM(e,x);return(0,Z.jsx)(`input`,{type:`hidden`,form:l,name:R,value:t,disabled:L},t)}),[y,z,l,R,x,L]);return(0,Z.jsxs)(Uj.Provider,{value:ge,children:[(0,Z.jsx)(Wj.Provider,{value:Re,children:(0,Z.jsx)(Gj.Provider,{value:Ae,children:w})}),(0,Z.jsx)(`input`,{...P.getValidationProps(L,{onFocus(){ge.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||L||f)return;let t=e.currentTarget.value,n=pT(Xw,e.nativeEvent);function r(){if(y)return;let e=t.toLowerCase(),r=oe.current.findIndex(t=>CM(t,x).toLowerCase()===e||SM(t,b).toLowerCase()===e);r===-1&&(r=oe.current.findIndex((t,n)=>{let r=ne.current[n];return r!=null&&r.toLowerCase()===e}));let i=oe.current[r];i!=null&&Oe(i,n)}ge.set(`forceMount`,!0),queueMicrotask(r)}}),id:I&&Be==null?`${I}-hidden-input`:void 0,form:l,name:Be,autoComplete:u,value:Ce,disabled:L,required:p&&!(y&&Te),readOnly:f,ref:ze,style:R?zT:RT,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Ve]})}function LM(e,t){return e??t}var RM=5;function zM(e,t){let n=BM(t);return e.clientX>=n.left-RM&&e.clientX<=n.right+RM&&e.clientY>=n.top-RM&&e.clientY<=n.bottom+RM}function BM(e){let t=e.getBoundingClientRect(),n=BC(e);if(jC)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}var VM=T.createContext(void 0);function HM(e=!1){let t=T.useContext(VM);if(t===void 0&&!e)throw Error(dC(16));return t}function UM(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:T.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function WM(e,t,{detail:n=0}={}){e.dispatchEvent(new(BC(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function GM(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=T.useRef(null),s=HM(!0),c=a??s!==void 0,{props:l}=UM({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=T.useCallback(()=>{let e=o.current;KM(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Y(u,[u]),{getButtonProps:T.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return xD({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(MD(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=KM(r),s=!i&&qM(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),WM(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),WM(r,e)))},onKeyUp(e){if(!t){if(MD(e),a?.(e),e.target===e.currentTarget&&i&&c&&KM(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),WM(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Q(e=>{o.current=e,u()})}}function KM(e){return WC(e)&&e.tagName===`BUTTON`}function qM(e){return WC(e)&&e.tagName===`A`&&!!e.href}var JM=`data-popup-side`,YM=400,XM={...Nw,...$j,popupSide:e=>e?{[JM]:e}:null,value:()=>null},ZM=T.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,setFocused:u,validationMode:d,validation:f,state:p,disabled:m}=nM(),{labelId:h}=aM(),g=Kj(),{readOnly:_,required:v,disabled:y}=qj(),b=m||y||a,x=g.useState(`open`),S=g.useState(`mounted`),C=g.useState(`value`),w=g.useState(`triggerProps`),E=g.useState(`positionerElement`),D=g.useState(`listElement`),O=g.useState(`popupSide`),k=g.useState(`id`),A=g.useState(`labelId`),j=g.useState(`hasSelectedValue`),M=S&&E?O:null,N=i??k,P=LM(h,A);oM({id:i});let F=TT(E),I=T.useRef(null),{getButtonProps:L,buttonRef:R}=GM({disabled:b,native:o}),z=g.useStateSetter(`triggerElement`),B=_C(),V=_C(),ee=_C();T.useEffect(()=>{if(x)return ee.start(YM,()=>{g.context.selectionRef.current.allowUnselectedMouseUp=!0,g.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{ee.clear()};g.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},V.clear()},[x,g,V,ee]);let te=xD(w,{id:N,role:`combobox`,"aria-expanded":x,"aria-haspopup":`listbox`,"aria-controls":x?D?.id??Ww(E)?.id:void 0,"aria-labelledby":P,"aria-readonly":_||void 0,"aria-required":v||void 0,tabIndex:b?-1:0,onFocus(e){u(!0),x&&g.context.alignItemWithTriggerActiveRef.current&&g.context.setOpen(!1,pT(Xw,e.nativeEvent)),B.start(0,()=>{g.set(`forceMount`,!0)})},onBlur(e){X(E,e.relatedTarget)||(l(!0),u(!1),d===`onBlur`&&f.commit(C))},onMouseDown(e){if(x)return;let t=IT(e.currentTarget);function n(e){if(!I.current)return;let t=e.target;X(I.current,t)||X(F.current,t)||zM(e,I.current)||g.context.setOpen(!1,pT(sT,e))}V.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,L),ne=f.getValidationProps(b,te);ne.role=`combobox`;let H={...p,open:x,disabled:b,value:C,readOnly:_,popupSide:M,placeholder:!j};return FD(`button`,e,{ref:[t,I,R,z],state:H,stateAttributesMapping:XM,props:ne})}),QM={value:()=>null},$M=T.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=Kj(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?TM(l,u,d):wM(l,u,d)),FD(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:QM})}),eN=T.forwardRef(function(e,t){let n=Kj(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,Z.jsx)(tO,{ref:t,...e}):null}),tN=T.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function nN(){return T.useContext(tN)}function rN(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Q(i),[,o]=T.useState(!1),s=$S(aN).current,c=$S(iN).current,l=T.useRef(0),u=T.useRef(!0),d=T.useRef(null),f=T.useRef(null),p=Q(()=>{u.current||(u.current=!0,o(e=>!e))}),m=Q((e,t)=>{c.set(e,t),p()}),h=Q(e=>{c.delete(e),p()}),g=Q(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!cN(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&lN(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=sN(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=Q(()=>{let[e,t]=oN(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});Y(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Y(()=>{u.current&&v()}),Y(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=Q(e=>(s.add(e),()=>{s.delete(e)})),b=T.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,Z.jsx)(tN.Provider,{value:b,children:t})}function iN(){return new Map}function aN(){return new Set}function oN(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>lN(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function sN(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function cN(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function lN(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var uN=T.createContext(void 0);function dN(){let e=T.useContext(uN);if(!e)throw Error(dC(59));return e}var fN=T.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,Z.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function pN(e,t){e&&Object.assign(e.style,t)}var mN={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},hN={},gN={},_N=``;function vN(e,t){return KC(e)?e:t}function yN(e,t,n){return/hidden|clip/.test(e.getComputedStyle(vN(t,n)).overflowY)}function bN(e){if(typeof document>`u`)return!1;let t=IT(e);return BC(t).innerWidth-t.documentElement.clientWidth>0}function xN(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=IT(e),n=t.documentElement,r=t.body,i=vN(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function SN(e){let t=IT(e),n=t.documentElement,r=t.body,i=vN(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function CN(e){let t=IT(e),n=t.documentElement,r=t.body,i=BC(n),a=0,o=0,s=!1,c=PT.create();if(kC&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,hN={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},_N=n.style.scrollBehavior,gN={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=vN(n,r);if(s=xN(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,hN),Object.assign(r.style,gN),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=_N)}function d(){u(),c.request(l)}l();let f=_T(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var wN=new class{lockCount=0;restore=null;timeoutLock=gC.create();timeoutUnlock=gC.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=IT(e),n=t.documentElement,r=t.body,i=BC(n);if(yN(i,n,r)){let t=new i.MutationObserver(()=>{yN(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=wC||!bN(e);this.restore=a?SN(e):CN(e)}};function TN(e=!0,t=null){Y(()=>{if(e)return wN.acquire(t)},[e,t])}var EN=20;function DN(e,t,n,r){let[i,a]=T.useState(!1);Y(()=>{if(!e||!t||n==null){a(!1);return}let r=IT(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-EN)},[e,t,n]),TN(e&&(!t||i),r)}var ON={position:`fixed`},kN=T.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=qD,style:_,...v}=e,y=Kj(),b=Jj(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`modal`),w=y.useState(`value`),E=y.useState(`openMethod`),D=y.useState(`positionerElement`),O=y.useState(`triggerElement`),k=y.useState(`isItemEqualToValue`),A=y.useState(`transitionStatus`),j=T.useRef(null),M=T.useRef(null),[N,P]=T.useState(h),F=S&&N&&E!==`touch`;!S&&N!==h&&P(h),T.useImperativeHandle(y.context.alignItemWithTriggerActiveRef,()=>F),DN((F||C)&&x,E===`touch`,D,O);let I=jj({anchor:n,floatingRootContext:b,positionMethod:a,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??F,collisionAvoidance:g,keepMounted:!0}),L=F?`none`:I.side,R=F?ON:I.positionerStyles,z={open:x,side:L,align:I.align,anchorHidden:I.anchorHidden};Y(()=>{y.set(`popupSide`,I.side)},[y,I.side]);let B=Fj(e,z,{styles:R,transitionStatus:A,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x}),V=T.useRef(0),ee=Q(e=>{if(y.context.valuesRef.current.length===0)return;let t=V.current;V.current=e.size;let n=pT(Xw);if(t!==0&&!y.state.multiple&&w!==null&&fM(y.context.valuesRef.current,w,k)===-1){let e=y.context.initialValueRef.current,t=e!=null&&fM(y.context.valuesRef.current,e,k)!==-1?e:null;y.context.setValue(t,n),t===null&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null)}if(t!==0&&y.state.multiple&&Array.isArray(w)){let e=w.filter(e=>fM(y.context.valuesRef.current,e,k)!==-1);e.length!==w.length&&(y.context.setValue(e,n),e.length===0&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null))}if(x&&F){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};pN(D,e),pN(y.context.popupRef.current,e)}}),te=T.useMemo(()=>({...I,side:L,alignItemWithTriggerActive:F,setControlledAlignItemWithTrigger:P,scrollUpArrowRef:j,scrollDownArrowRef:M}),[I,L,F,P]);return(0,Z.jsx)(rN,{elementsRef:y.context.listRef,labelsRef:y.context.labelsRef,onMapChange:ee,children:(0,Z.jsxs)(uN.Provider,{value:te,children:[S&&C&&(0,Z.jsx)(fN,{inert:Rj(!x),cutout:O}),B]})})}),AN=`base-ui-disable-scrollbar`,jN={className:AN,getElement(e){return(0,Z.jsx)(`style`,{nonce:e,href:AN,precedence:`base-ui:low`,children:`.${AN}{scrollbar-width:none}.${AN}::-webkit-scrollbar{display:none}`})}},MN=T.createContext(void 0);function NN(e){let t=T.useContext(MN);if(t===void 0&&!e)throw Error(dC(69));return t}var PN=`ArrowUp`,FN=`ArrowDown`,IN=`ArrowLeft`,LN=`ArrowRight`,RN=new Set([PN,FN,IN,LN,`Home`,`End`]),zN=[`Shift`,`Control`,`Alt`,`Meta`];function BN(e){return WC(e)&&e.tagName===`INPUT`}function VN(e){return!!(BN(e)&&e.selectionStart!=null||WC(e)&&e.tagName===`TEXTAREA`)}function HN(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=UN(e,t,`left`),a=WN(e),o=WN(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=UN(e,t,`top`),r=WN(e),i=WN(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function UN(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function WN(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var GN=T.createContext(void 0),KN={disableStyleElements:!1};function qN(){return T.useContext(GN)??KN}var JN=`--transform-origin`,YN={...Pw,...xw},XN=T.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=Kj(),{multiple:c,readOnly:l,highlightItemOnHover:u}=qj(),d=Jj(),{side:f,align:p,alignItemWithTriggerActive:m,isPositioned:h,setControlledAlignItemWithTrigger:g}=dN(),_=NN(!0)!=null,v=_j(),{nonce:y,disableStyleElements:b}=qN(),x=s.useState(`id`),S=s.useState(`open`),C=s.useState(`openMethod`),w=s.useState(`mounted`),E=s.useState(`popupProps`),D=s.useState(`transitionStatus`),O=s.useState(`triggerElement`),k=s.useState(`positionerElement`),A=s.useState(`listElement`),j=T.useRef(!1),M=T.useRef(!1),N=T.useRef({}),P=FT(),F=Q(e=>{if(!k||!s.context.popupRef.current||!M.current)return;let t=k.style.top===`0px`,n=k.style.bottom===`0px`;if(j.current||!m||!t&&!n){s.context.handleScrollArrowVisibility(e);return}let r=$N(k),i=eP(k.getBoundingClientRect().height,`y`,r),a=IT(k),o=BC(k),c=o.getComputedStyle(k),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=ZN(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,h=QN(e),g=null,_=e=>{k.style.height=`${e}px`},v=t?h-p:p,y=Math.min(i+v,f);if(v<=1){let n=NM(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?h:0,f-(i+n)<=1&&(j.current=!0),s.context.handleScrollArrowVisibility(e);return}f-y>1?g=t?1/0:0:n&&p<h&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=NM(g,0,QN(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(j.current=!0),s.context.handleScrollArrowVisibility(e)});T.useImperativeHandle(s.context.scrollHandlerRef,()=>F,[F]),Zk({open:S,ref:s.context.popupRef,onComplete(){S&&s.context.onOpenChangeComplete(!0)}});let I={open:S,transitionStatus:D,side:f,align:p};Y(()=>{k&&s.context.popupRef.current&&!Object.keys(N.current).length&&(N.current={top:k.style.top||`0`,left:k.style.left||`0`,right:k.style.right,height:k.style.height,bottom:k.style.bottom,minHeight:k.style.minHeight,maxHeight:k.style.maxHeight,marginTop:k.style.marginTop,marginBottom:k.style.marginBottom})},[s,k]),Y(()=>{S||m||(M.current=!1,j.current=!1,pN(k,N.current))},[S,m,k]),Y(()=>{let e=s.context.popupRef.current;if(!S||!O||!k||!e||m&&!h||s.state.transitionStatus===`ending`)return;if(M.current=!0,e.style.removeProperty(JN),!m){P.request(()=>s.context.handleScrollArrowVisibility(A||e));return}let t=rP(e);try{let t=s.context.selectedItemTextRef.current;t?.isConnected||(t=!s.select(`hasSelectedValue`)&&s.context.firstItemTextRef.current?.isConnected?s.context.firstItemTextRef.current:null);let n=s.context.valueRef.current,r=BC(k),i=r.getComputedStyle(k),a=r.getComputedStyle(e),o=IT(O),c=$N(O),l=tP(O.getBoundingClientRect(),c),d=tP(k.getBoundingClientRect(),c),f=l.height,p=A||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),_=parseFloat(i.marginTop)||10,y=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=ZN(a),S=o.documentElement.clientHeight-_-y,C=o.documentElement.clientWidth,w=S-l.bottom+f,T,E=v===`rtl`?l.right-d.width:l.left,D=0;if(t&&n){let e=tP(n.getBoundingClientRect(),c);T=tP(t.getBoundingClientRect(),c),E=d.left+(v===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;D=T.top-d.top+T.height/2-r}let M=w+D+y+h,P=Math.min(S,M),F=S-_-y,I=M-P,L=C-5;k.style.left=`${NM(E,5,L-d.width)}px`,k.style.height=`${P}px`,k.style.maxHeight=`none`,k.style.marginTop=`${_}px`,k.style.marginBottom=`${y}px`,e.style.height=`100%`;let R=QN(p),z=I>=R-1;z&&(P=Math.min(S,d.height)-(I-R));let B=l.top<20||l.bottom>S-20||Math.ceil(P)+1<Math.min(m,b),V=(r.visualViewport?.scale??1)!==1&&kC;if(B||V){pN(k,N.current),g(!1);return}let ee=Math.max(b,P);if(z){let e=Math.max(0,S-M);k.style.top=d.height>=F?`0`:`${e}px`,k.style.height=`${P}px`,p.scrollTop=QN(p)}else k.style.bottom=`0`,p.scrollTop=I;if(T){let t=d.top,n=d.height,r=T.top+T.height/2,i=NM(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(JN,`50% ${i}%`)}(ee===S||P>=x)&&(j.current=!0),s.context.handleScrollArrowVisibility(p),u&&s.state.selectedIndex===null&&s.state.activeIndex===null&&s.context.listRef.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,S,k,O,m,g,P,A,u,v,h]),T.useEffect(()=>{if(!m||!k||!S)return;let e=BC(k);function t(e){s.context.setOpen(!1,pT(fT,e))}return _T(e,`resize`,t)},[s,m,k,S]);let L={...A?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":c||void 0,"aria-readonly":l||void 0,id:`${x}-list`},onKeyDown(e){_&&RN.has(e.key)&&e.stopPropagation()},onScroll(e){A||F(e.currentTarget)},...m&&{style:A?{height:`100%`}:mN},className:!A&&m?jN.className:void 0},R=FD(`div`,e,{ref:[t,s.context.popupRef],state:I,stateAttributesMapping:YN,props:[E,L,Pj(D),o]});return(0,Z.jsxs)(T.Fragment,{children:[!b&&jN.getElement(y),(0,Z.jsx)(bO,{context:d,modal:!1,disabled:!w,openInteractionType:C,returnFocus:a,restoreFocus:!0,children:R})]})});function ZN(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function QN(e){return PM(e.scrollHeight,e.clientHeight)}function $N(e){return uk.getScale(e)}function eP(e,t,n){return e/n[t]}function tP(e,t){return pE({x:eP(e.x,`x`,t),y:eP(e.y,`y`,t),width:eP(e.width,`x`,t),height:eP(e.height,`y`,t)})}var nP=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function rP(e){let{style:t}=e,n={};for(let[e,r]of nP)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of nP){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}function iP(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=nN(),u=T.useRef(-1),[d,f]=T.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=T.useRef(null),h=T.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Y(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var aP=T.createContext(void 0);function oP(){let e=T.useContext(aP);if(!e)throw Error(dC(57));return e}var sP=T.memo(T.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=T.useRef(null),d=iP({guess:!0,label:o,textRef:u}),f=Kj(),{itemProps:p,multiple:m,disabled:h,readOnly:g}=qj(),_=h||s,v=f.useState(`isActive`,d.index),y=f.useState(`open`),b=f.useState(`isSelected`,a),x=f.useState(`isSelectedByFocus`,d.index),S=f.useState(`isItemEqualToValue`),C=d.index,w=T.useRef(null);Y(()=>{let e=f.context.valuesRef.current;return e[C]=a,()=>{delete e[C]}},[C,a,f]),Y(()=>{let e=f.state.value,t=f.state.selectedIndex,n=t,r;m&&Array.isArray(e)?(n=hM(C,a,f.context.valuesRef.current,e,S,t),r=n===C,C===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&lM(a,e,S),r&&(n=C)),f.set(`selectedIndex`,n),r&&u.current&&(f.context.selectedItemTextRef.current=u.current)},[C,m,S,f,a]);let E=T.useRef(`mouse`),D=T.useRef(!1),{getButtonProps:O,buttonRef:k}=GM({disabled:_,focusableWhenDisabled:!0,native:c,composite:!0}),A={disabled:_,selected:b,highlighted:v};function j(e){if(h||g)return;let t=f.state.value;if(m){let n=Array.isArray(t)?t:[],r=b?gM(n,a,S):[...n,a];f.context.setValue(r,pT(tT,e))}else f.context.setValue(a,pT(tT,e)),f.context.setOpen(!1,pT(tT,e))}function M(){f.context.selectionRef.current.dragY=0}let N={role:`option`,"aria-selected":b,tabIndex:y&&v?0:-1,onKeyDown(e){f.set(`activeIndex`,C),e.key===` `&&f.context.typingRef.current&&e.preventDefault()},onClick(e){let t=E.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&PC(e.nativeEvent)&&(n!==void 0||v),i=t&&!r&&!D.current;D.current=!1,!(_||i)&&j(e.nativeEvent)},onPointerEnter(e){E.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=f.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){E.current=e.pointerType,D.current=!0,M()},onMouseUp(){if(M(),_||E.current===`touch`||D.current)return;let e=!f.context.selectionRef.current.allowSelectedMouseUp&&b,t=!f.context.selectionRef.current.allowUnselectedMouseUp&&!b;e||t||(D.current=!0,w.current?.click(),D.current=!1)}},P=FD(`div`,e,{ref:[k,t,d.ref,w],state:A,props:[p,N,l,O]}),F=T.useMemo(()=>({selected:b,index:C,textRef:u,selectedByFocus:x}),[b,C,u,x]);return(0,Z.jsx)(aP.Provider,{value:F,children:P})})),cP=T.memo(T.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=oP(),a=Kj(),{render:o,className:s,style:c,...l}=e;return FD(`div`,e,{ref:[T.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]),t,r],props:l})})),lP=`<!--sml:if:`,uP=`-->`,dP=(e,t)=>{let n=[{cursor:0,end:e.length,trim:!1,chunks:[]}],r=e;for(;n.length>0;){let i=n.at(-1),a=e.indexOf(lP,i.cursor);if(a===-1||a>=i.end){i.chunks.push(e.slice(i.cursor,i.end));let t=i.trim?i.chunks.join(``).trim():i.chunks.join(``);n.pop();let a=n.at(-1);a===void 0?r=t:a.chunks.push(t);continue}let o=e.indexOf(uP,a);if(o===-1||o>=i.end){i.chunks.push(e.slice(i.cursor,i.end)),i.cursor=i.end;continue}let s=e.slice(a+11,o),c=s.indexOf(` `),l=c===-1?s:s.slice(0,c),u=c===-1?``:s.slice(c+1),d=`<!--sml:else:${l}-->`,f=`<!--sml:endif:${l}-->`,p=o+3,m=e.indexOf(f,p);if(m===-1||m+f.length>i.end){i.chunks.push(e.slice(i.cursor,i.end)),i.cursor=i.end;continue}let h=e.indexOf(d,p),g=h!==-1&&h<m?h:-1,_=tg(u),v=bh.isOk(_)&&ag(_.value,t),y=v?p:g===-1?m:g+d.length,b=v&&g!==-1?g:m;i.chunks.push(e.slice(i.cursor,a)),i.cursor=m+f.length,n.push({cursor:y,end:b,trim:!0,chunks:[]})}return r},fP=(e,t)=>e.includes(lP)?dP(e,t).replace(/\n{3,}/g,`
27
+
28
+ `):e,pP=e=>Symbol.iterator in e,mP=e=>`entries`in e,hP=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},gP=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function _P(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:pP(e)&&pP(t)?mP(e)&&mP(t)?hP(e,t):gP(e,t):hP({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function vP(e){let t=T.useRef(void 0);return n=>{let r=e(n);return _P(t.current,r)?t.current:t.current=r}}var yP=T.createContext(void 0);function bP(){return T.useContext(yP)}function xP(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=HM(),{ref:i,index:a}=iP(e),o=n===a,s=T.useRef(null),c=yT(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function SP(e){let{render:t,className:n,style:r,state:i=lC,props:a=cC,refs:o=cC,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=xP({metadata:s});return FD(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}var CP=T.forwardRef(function(e,t){let{className:n,defaultPressed:r=!1,disabled:i=!1,form:a,onPressedChange:o,pressed:s,render:c,type:l,value:u,nativeButton:d=!0,style:f,...p}=e,m=rj(u||void 0),h=bP(),g=h?.value??[],_=(i||h?.disabled)??!1,[v,y]=Hj({controlled:h?m!==void 0&&g.indexOf(m)>-1:s,default:r,name:`Toggle`,state:`pressed`}),{getButtonProps:b,buttonRef:x}=GM({disabled:_,native:d}),S={disabled:_,pressed:v},C=[x,t],w=[{"aria-pressed":v,onClick(e){let t=!v,n=pT(Xw,e.nativeEvent);o?.(t,n),!n.isCanceled&&(m&&h?.setGroupValue?.(m,t,n),!n.isCanceled&&y(t))}},p,b],E=FD(`button`,e,{enabled:!h,state:S,ref:C,props:w}),D=T.useMemo(()=>({disabled:_,focusableWhenDisabled:!1}),[_]);return h?(0,Z.jsx)(SP,{tag:`button`,render:c,className:n,style:f,metadata:D,state:S,refs:C,props:w}):E});function wP(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=cC}=e,[p,m]=T.useState(0),h=r!=null,g=T.useRef(null),_=yT(g,c),v=T.useRef([]),y=T.useRef(!1),b=T.useRef(null),x=o??p,S=Q((e,t=!1)=>{if(b.current=v.current[e]??null,(s??m)(e),t){let t=v.current[e];HN(g.current,t,a,n)}}),C=Q(e=>{if(e.size===0)return;if(y.current){let e=v.current,t=e.indexOf(b.current);if(t===-1){let t=e[x];!t||vE(e,x,d)?S(TP(e,d)):b.current=t}else t!==x&&S(t);return}y.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)S(i);else if(vE(t,x,d)){let e=_E(t,{disabledIndices:d});mE(t,e)||S(e)}HN(g.current,r,a,n)});Y(()=>{if(d==null||o!=null||!y.current)return;let e=v.current;if(vE(e,x,d)){let t=_E(e,{disabledIndices:d});mE(e,t)||S(t)}},[d,o,x,v,S]);let w=Q((e,t,n)=>i?i(e,t,n,v):n),E=Q(e=>{let o=e.key===`Home`||e.key===`End`;if(!RN.has(e.key)||!l&&o||EP(e,f)||!g.current)return;let s=a===`rtl`,c=s?IN:LN,p=s?LN:IN,m=n===`vertical`?FN:c,_=n===`vertical`?PN:p,y=uw(e.nativeEvent);if(y!=null&&VN(y)&&!Vj(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let b=x,C=hE(v,d),T=gE(v,d);r!=null&&(b=r({disabledIndices:d,elementsRef:v,event:e,highlightedIndex:x,loopFocus:t,maxIndex:T,minIndex:C,onLoop:w,orientation:n,rtl:s}));let E=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,D=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?b=C:e.key===`End`&&(b=T)),b===x&&(E||D)&&(t&&b===T&&E?(b=C,i&&(b=i(e,x,b,v))):t&&b===C&&D?(b=T,i&&(b=i(e,x,b,v))):b=_E(v.current,{startingIndex:b,decrement:D,disabledIndices:d})),b!==x&&!mE(v.current,b)&&(u&&e.stopPropagation(),(h||o||E||D)&&e.preventDefault(),S(b,!0),queueMicrotask(()=>{v.current[b]?.focus()}))});return{props:{ref:_,onFocus(e){let t=g.current,n=uw(e.nativeEvent);t&&n!=null&&VN(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:E},highlightedIndex:x,onHighlightedIndexChange:S,elementsRef:v,onMapChange:C,relayKeyboardEvent:E}}function TP(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!vE(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function EP(e,t){for(let n of zN)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function DP(e){let{render:t,className:n,style:r,refs:i=cC,props:a=cC,state:o=lC,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:b=!1,tag:x=`div`,...S}=e,{props:C,highlightedIndex:w,onHighlightedIndexChange:E,elementsRef:D,onMapChange:O,relayKeyboardEvent:k}=wP({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:_j(),disabledIndices:v,modifierKeys:y}),A=FD(x,e,{state:o,ref:i,props:[C,...a,S],stateAttributesMapping:s}),j=T.useMemo(()=>({highlightedIndex:w,onHighlightedIndexChange:E,highlightItemOnHover:b,relayKeyboardEvent:k}),[w,E,b,k]);return(0,Z.jsx)(VM.Provider,{value:j,children:(0,Z.jsx)(rN,{elementsRef:D,onMapChange:e=>{h?.(e),O(e)},children:A})})}var OP=T.createContext(void 0);function kP(){return T.useContext(OP)}var AP=T.forwardRef(function(e,t){let{defaultValue:n,disabled:r=!1,loopFocus:i=!0,onValueChange:a,orientation:o=`horizontal`,multiple:s=!1,value:c,className:l,render:u,style:d,...f}=e,p=NN(!0),m=kP(),h=n??cC,g=c!==void 0||n!==void 0,_=(p?.disabled??!1)||(m?.disabled??!1)||r,[v,y]=Hj({controlled:c,default:h,name:`ToggleGroup`,state:`value`}),b=Q((e,t,n)=>{let r;s?(r=v.slice(),t?r.push(e):r.splice(v.indexOf(e),1)):r=t?[e]:[],a?.(r,n),!n.isCanceled&&y(r)}),x={disabled:_,multiple:s,orientation:o},S=T.useMemo(()=>({disabled:_,setGroupValue:b,value:v,isValueInitialized:g}),[_,b,v,g]),C={role:`group`},w=FD(`div`,e,{enabled:!!p,state:x,ref:t,props:[C,f]});return(0,Z.jsx)(yP.Provider,{value:S,children:p?w:(0,Z.jsx)(DP,{render:u,className:l,style:d,state:x,refs:[t],props:[C,f],loopFocus:i,enableHomeAndEndKeys:!0,orientation:o})})}),jP=`bg-[var(--tactile-base,var(--primary))] text-primary-foreground shadow-[0_1px_2px_0_oklch(0_0_0/0.2),0_0_0_1px_color-mix(in_oklab,var(--tactile-base,var(--primary)),black_35%),inset_0_3px_5px_0_oklch(1_0_0/0.16),inset_0_0_0_1px_oklch(1_0_0/0.12),inset_0_-6px_10px_0_oklch(0_0_0/0.2)] hover:bg-[color-mix(in_oklab,var(--tactile-base,var(--primary)),white_8%)] aria-expanded:bg-[color-mix(in_oklab,var(--tactile-base,var(--primary)),white_8%)] data-popup-open:bg-[color-mix(in_oklab,var(--tactile-base,var(--primary)),white_8%)] active:translate-y-px active:shadow-[0_0_0_1px_color-mix(in_oklab,var(--tactile-base,var(--primary)),black_35%),inset_0_2px_4px_0_oklch(0_0_0/0.35)] disabled:shadow-none data-disabled:shadow-none dark:shadow-[0_1px_2px_0_oklch(0_0_0/0.35),0_0_0_1px_oklch(0_0_0/0.4),inset_0_3px_5px_0_oklch(0_0_0/0.1),inset_0_0_0_1px_oklch(1_0_0/0.25),inset_0_-6px_10px_0_oklch(1_0_0/0.22)] dark:hover:bg-[color-mix(in_oklab,var(--tactile-base,var(--primary)),black_8%)] dark:active:shadow-[0_0_0_1px_oklch(0_0_0/0.4),inset_0_2px_4px_0_oklch(0_0_0/0.25)]`,MP=`border border-input bg-[color-mix(in_oklab,var(--surface-inset)_55%,transparent)] dark:bg-input/20 shadow-[inset_0_1px_2px_0_oklch(0_0_0/0.05)] dark:shadow-[inset_0_1px_2px_0_oklch(0_0_0/0.35)]`,NP=`aria-pressed:bg-[color-mix(in_oklab,var(--accent),black_3%)] aria-pressed:shadow-[inset_0_1px_3px_0_oklch(0_0_0/0.12)] dark:aria-pressed:bg-[color-mix(in_oklab,var(--accent),white_12%)] dark:aria-pressed:shadow-[inset_0_1px_3px_0_oklch(0_0_0/0.45)]`,PP=[`data-[pressed]:border-border data-[pressed]:bg-background data-[pressed]:text-foreground data-[pressed]:shadow-[var(--shadow-md)]`,`data-active:border-border data-active:bg-background data-active:text-foreground data-active:shadow-[var(--shadow-md)]`,`aria-pressed:border-border aria-pressed:bg-background aria-pressed:text-foreground aria-pressed:shadow-[var(--shadow-md)]`].join(` `);function FP(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=FP(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function IP(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=FP(e))&&(r&&(r+=` `),r+=t);return r}var LP=T.createContext(void 0);function RP(){let e=T.useContext(LP);if(e===void 0)throw Error(dC(53));return e}function zP(e,t,n){if(!e)return 0;let r=getComputedStyle(e),i=`${t}${n===`x`?`Inline`:`Block`}`,a=parseFloat(r[`${i}Start`]);return n===`x`&&t===`margin`?a*2:a+parseFloat(r[`${i}End`])}var BP=`data-has-overflow-x`,VP=`data-has-overflow-y`,HP=`data-overflow-x-start`,UP=`data-overflow-x-end`,WP=`data-overflow-y-start`,GP=`data-overflow-y-end`,KP=e=>t=>t?{[e]:``}:null,qP={hasOverflowX:KP(BP),hasOverflowY:KP(VP),overflowXStart:KP(HP),overflowXEnd:KP(UP),overflowYStart:KP(WP),overflowYEnd:KP(GP),cornerHidden:()=>null},JP=`--scroll-area-corner-height`,YP=`--scroll-area-corner-width`,XP=`data-orientation`,ZP={x:0,y:0},QP={width:0,height:0},$P={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},eF={x:!0,y:!0,corner:!0},tF=T.forwardRef(function(e,t){let{render:n,className:r,overflowEdgeThreshold:i,style:a,...o}=e,{xStart:s,xEnd:c,yStart:l,yEnd:u}=nF(i),d=rj(),f=_C(),p=_C(),{nonce:m,disableStyleElements:h}=qN(),[g,_]=T.useState(!1),[v,y]=T.useState(!1),[b,x]=T.useState(!1),[S,C]=T.useState(!1),[w,E]=T.useState(!1),[D,O]=T.useState(QP),[k,A]=T.useState(QP),[j,M]=T.useState($P),[N,P]=T.useState(eF),F=T.useRef(null),I=T.useRef(null),L=T.useRef(null),R=T.useRef(null),z=T.useRef(null),B=T.useRef(null),V=T.useRef(null),ee=T.useRef(null),te=T.useRef(0),ne=T.useRef(0),H=T.useRef(0),re=T.useRef(0),ie=T.useRef(`vertical`),ae=T.useRef(ZP),oe=T.useRef(null);function se(e){let t=e?x:y,n=e?f:p;t(!0),n.start(500,()=>{t(!1)})}let U=Q(e=>{let t=e.x-ae.current.x,n=e.y-ae.current.y;ae.current=e,n!==0&&se(!0),t!==0&&se(!1)}),W=Q(()=>{let e=I.current;e&&oe.current===null&&(oe.current=e.style.scrollSnapType,e.style.scrollSnapType=`none`)}),ce=Q(e=>{if(e.button!==0||ee.current!==null&&(ie.current===`vertical`?z.current:B.current)?.hasPointerCapture(ee.current))return;ee.current=e.pointerId,te.current=e.clientY,ne.current=e.clientX,ie.current=e.currentTarget.getAttribute(XP);let t=I.current;t&&(H.current=t.scrollTop,re.current=t.scrollLeft,W()),(ie.current===`vertical`?z.current:B.current)?.setPointerCapture(e.pointerId)}),le=Q(e=>{if(e.pointerId!==ee.current)return;ee.current=null,(ie.current===`vertical`?x:y)(!1),oe.current!==null&&(I.current&&(I.current.style.scrollSnapType=oe.current),oe.current=null);let t=ie.current===`vertical`?z.current:B.current;t?.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId)}),ue=Q(e=>{if(e.pointerId!==ee.current)return;if(e.buttons%2==0){le(e);return}let t=I.current;if(!t)return;let n=ie.current===`vertical`,r=n?z.current:B.current,i=n?L.current:R.current;if(!r||!i)return;let a=n?`y`:`x`,o=zP(i,`padding`,a),s=zP(r,`margin`,a),c=n?r.offsetHeight:r.offsetWidth,l=(n?i.offsetHeight:i.offsetWidth)-c-o-s,u=n?e.clientY-te.current:e.clientX-ne.current,d=l<=0?0:u/l,f=n?t.scrollHeight:t.scrollWidth,p=n?t.clientHeight:t.clientWidth,m=(n?H.current:re.current)+d*(f-p);n?t.scrollTop=m:t.scrollLeft=m,e.preventDefault(),se(n)});function de(e){C(e.pointerType===`touch`)}function fe(e){if(de(e),e.pointerType!==`touch`){let t=X(F.current,e.target);_(t)}}let pe=T.useMemo(()=>({scrolling:v||b,hasOverflowX:!N.x,hasOverflowY:!N.y,overflowXStart:j.xStart,overflowXEnd:j.xEnd,overflowYStart:j.yStart,overflowYEnd:j.yEnd,cornerHidden:N.corner}),[v,b,N.x,N.y,N.corner,j]),me={role:`presentation`,onPointerEnter:fe,onPointerMove:fe,onPointerDown:de,onPointerLeave(){_(!1)},style:{position:`relative`,[JP]:`${D.height}px`,[YP]:`${D.width}px`}},he=FD(`div`,e,{state:pe,ref:[t,F],props:[me,o],stateAttributesMapping:qP}),ge=T.useMemo(()=>({handlePointerDown:ce,handlePointerMove:ue,handlePointerUp:le,handleScroll:U,disableViewportSnap:W,cornerSize:D,setCornerSize:O,thumbSize:k,setThumbSize:A,hasMeasuredScrollbar:w,setHasMeasuredScrollbar:E,touchModality:S,cornerRef:V,scrollingX:v,scrollingY:b,hovering:g,setHovering:_,viewportRef:I,scrollbarYRef:L,scrollbarXRef:R,thumbYRef:z,thumbXRef:B,rootId:d,hiddenState:N,setHiddenState:P,overflowEdges:j,setOverflowEdges:M,viewportState:pe,overflowEdgeThreshold:{xStart:s,xEnd:c,yStart:l,yEnd:u}}),[ce,ue,le,U,W,D,k,w,S,v,b,g,d,N,j,pe,s,c,l,u]);return(0,Z.jsxs)(LP.Provider,{value:ge,children:[!h&&jN.getElement(m),he]})});function nF(e){let t=typeof e==`number`?{xStart:e,xEnd:e,yStart:e,yEnd:e}:e;return{xStart:Math.max(0,t?.xStart||0),xEnd:Math.max(0,t?.xEnd||0),yStart:Math.max(0,t?.yStart||0),yEnd:Math.max(0,t?.yEnd||0)}}var rF=T.createContext(void 0),iF=`--scroll-area-overflow-x-start`,aF=`--scroll-area-overflow-x-end`,oF=`--scroll-area-overflow-y-start`,sF=`--scroll-area-overflow-y-end`,cF=`--scroll-area-thumb-height`,lF=`--scroll-area-thumb-width`,uF=[iF,aF,oF,sF],dF=!1;function fF(){dF||kC||(typeof CSS<`u`&&`registerProperty`in CSS&&uF.forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),dF=!0)}var pF=T.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{viewportRef:o,scrollbarYRef:s,scrollbarXRef:c,thumbYRef:l,thumbXRef:u,cornerRef:d,cornerSize:f,setCornerSize:p,setThumbSize:m,rootId:h,setHiddenState:g,hiddenState:_,setHasMeasuredScrollbar:v,handleScroll:y,touchModality:b,setHovering:x,setOverflowEdges:S,overflowEdgeThreshold:C,viewportState:w}=RP(),E=_j(),D=T.useRef(!0),O=T.useRef([NaN,NaN,NaN,NaN]),k=_C(),A=_C(),j=Q(()=>{let e=o.current,t=s.current,n=c.current,r=l.current,i=u.current,a=d.current;if(!e)return;let h=e.scrollHeight,_=e.scrollWidth,y=e.clientHeight,b=e.clientWidth,x=e.scrollTop,w=e.scrollLeft,T=O.current,D=Number.isNaN(T[0]);if(T[0]=y,T[1]=h,T[2]=b,T[3]=_,D&&v(!0),h===0||_===0)return;let k=mF(e),A=k.y,j=k.x,M=b/_,N=y/h,P=Math.max(0,_-b),F=Math.max(0,h-y),I=0,L=0;j||(I=FM(E===`rtl`?-w:w,P),L=P-I);let R=A?0:FM(x,F),z=A?0:F-R,B=j?0:b,V=A?0:y,ee=0,te=0;!j&&!A&&(ee=t?.offsetWidth||0,te=n?.offsetHeight||0);let ne=f.width===0&&f.height===0,H=ne?ee:0,re=ne?te:0,ie=zP(n,`padding`,`x`),ae=zP(t,`padding`,`y`),oe=zP(i,`margin`,`x`),se=zP(r,`margin`,`y`),U=B-ie-oe,W=V-ae-se,ce=n?Math.min(n.offsetWidth-H,U):U,le=t?Math.min(t.offsetHeight-re,W):W,ue=Math.max(16,ce*M),de=Math.max(16,le*N);if(m(e=>hF(e,{width:ue,height:de})),t&&r){let e=gF(r,cF,x,F,h,de,t.offsetHeight-de-ae-se);r.style.transform=`translate3d(0,${e}px,0)`}if(n&&i){let e=n.offsetWidth-ue-ie-oe,t=gF(i,lF,E===`rtl`?-w:w,P,_,ue,e);i.style.transform=`translate3d(${E===`rtl`?-t:t}px,0,0)`}let fe=[I,L,R,z];uF.forEach((t,n)=>{e.style.setProperty(t,`${fe[n]}px`)}),a&&p(e=>hF(e,{width:ee,height:te})),g(e=>hF(e,k));let pe={xStart:!j&&I>C.xStart,xEnd:!j&&L>C.xEnd,yStart:!A&&R>C.yStart,yEnd:!A&&z>C.yEnd};S(e=>hF(e,pe))});Y(()=>{fF()},[]),Y(()=>{queueMicrotask(j)},[j,_,E,C.xStart,C.xEnd,C.yStart,C.yEnd]),Y(()=>{o.current?.matches(`:hover`)&&x(!0)},[o,x]),Y(()=>{let e=o.current;if(typeof ResizeObserver>`u`||!e)return;let t=!1,n=new ResizeObserver(()=>{if(!t){t=!0;let n=O.current;if(n[0]===e.clientHeight&&n[1]===e.scrollHeight&&n[2]===e.clientWidth&&n[3]===e.scrollWidth)return}j()});return n.observe(e),A.start(0,()=>{let t=e.getAnimations({subtree:!0});t.length!==0&&Promise.allSettled(t.map(e=>e.finished)).then(j).catch(()=>{})}),()=>{n.disconnect(),A.clear()}},[j,o,A]);function M(){D.current=!1}let N={role:`presentation`,...h&&{"data-id":`${h}-viewport`},tabIndex:_.x&&_.y?-1:0,className:jN.className,style:{overflow:`scroll`},onScroll(){o.current&&(j(),(b||!D.current)&&y({x:o.current.scrollLeft,y:o.current.scrollTop}),k.start(100,()=>{D.current=!0}))},onWheel:M,onPointerMove:M,onPointerEnter:M,onKeyDown:M},P=FD(`div`,e,{ref:[t,o],state:w,props:[N,a],stateAttributesMapping:qP}),F=T.useMemo(()=>({computeThumbPosition:j}),[j]);return(0,Z.jsx)(rF.Provider,{value:F,children:P})});function mF(e){let t=e.clientHeight>=e.scrollHeight,n=e.clientWidth>=e.scrollWidth;return{y:t,x:n,corner:t||n}}function hF(e,t){for(let n in t)if(e[n]!==t[n])return t;return e}function gF(e,t,n,r,i,a,o){let s=NM(n,0,r),c=n-s,l=Math.max(16,a*i/(i+Math.abs(c)));return e.style.setProperty(t,c?`${l}px`:``),(r?s/r*o:0)+(c>0?a-l:0)}var _F=T.createContext(void 0);function vF(){let e=T.useContext(_F);if(e===void 0)throw Error(dC(54));return e}var yF=T.forwardRef(function(e,t){let{render:n,className:r,orientation:i=`vertical`,keepMounted:a=!1,style:o,...s}=e,{hovering:c,scrollingX:l,scrollingY:u,hiddenState:d,scrollbarYRef:f,scrollbarXRef:p,viewportRef:m,thumbYRef:h,thumbXRef:g,handlePointerDown:_,handlePointerUp:v,handleScroll:y,disableViewportSnap:b,rootId:x,thumbSize:S,hasMeasuredScrollbar:C,viewportState:w}=RP(),E=i===`vertical`,D={...w,hovering:c,scrolling:E?u:l,orientation:i},O=_j(),k=!C&&!a,A=E?d.y:d.x,j=a||!A;T.useEffect(()=>{if(!j)return;let e=m.current,t=E?f.current:p.current;if(!t)return;function n(t){if(!e||t.ctrlKey)return;let n=!E,r=n?`scrollLeft`:`scrollTop`,i=n?t.deltaX:t.deltaY;if(i===0)return;let a=n?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight,o=n&&O===`rtl`?-a:0,s=n&&O===`rtl`?0:a,c=e[r];c<=o&&i<0||c>=s&&i>0||(t.preventDefault(),e[r]=Math.min(s,Math.max(o,c+i)),y({x:e.scrollLeft,y:e.scrollTop}))}return _T(t,`wheel`,n,{passive:!1})},[O,y,E,p,f,j,m]);let M={...x&&{"data-id":`${x}-scrollbar`},"aria-hidden":!0,onPointerDown(e){if(e.button!==0)return;let t=uw(e.nativeEvent),n=E?h.current:g.current;if(n&&X(n,t))return;let r=m.current;if(!r)return;let i=E?f.current:p.current;if(!n||!i)return;let a=E?`y`:`x`,o=zP(n,`margin`,a),s=zP(i,`padding`,a),c=E?n.offsetHeight:n.offsetWidth,l=i.getBoundingClientRect(),u=E?e.clientY-l.top-c/2-s+o/2:e.clientX-l.left-c/2-s+o/2,d=E?r.scrollHeight:r.scrollWidth,v=E?r.clientHeight:r.clientWidth,x=(E?i.offsetHeight:i.offsetWidth)-c-s-o;if(x<=0)return;let S=u/x,C=d-v;b(),E?r.scrollTop=S*C:r.scrollLeft=O===`rtl`?-(1-S)*C:S*C,y({x:r.scrollLeft,y:r.scrollTop}),_(e)},onMouseDown(e){e.preventDefault()},onPointerUp:v,onPointerCancel:v,style:{position:`absolute`,touchAction:`none`,WebkitUserSelect:`none`,userSelect:`none`,visibility:k?`hidden`:void 0,...E?{top:0,bottom:`var(${JP})`,insetInlineEnd:0,[cF]:`${S.height}px`}:{insetInlineStart:0,insetInlineEnd:`var(${YP})`,bottom:0,[lF]:`${S.width}px`}}},N=FD(`div`,e,{ref:[t,E?f:p],state:D,props:[M,s],stateAttributesMapping:qP});return j?(0,Z.jsx)(_F.Provider,{value:i,children:N}):null}),bF=T.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{thumbYRef:o,thumbXRef:s,handlePointerDown:c,handlePointerMove:l,handlePointerUp:u,scrollingX:d,scrollingY:f,hasMeasuredScrollbar:p}=RP(),m=vF(),h=m===`vertical`;return FD(`div`,e,{ref:[t,h?o:s],state:{scrolling:h?f:d,orientation:m},props:[{onPointerDown:c,onPointerMove:l,onPointerUp:u,onPointerCancel:u,style:{visibility:p?void 0:`hidden`,...h?{height:`var(--scroll-area-thumb-height)`}:{width:`var(--scroll-area-thumb-width)`}}},a]})}),xF=T.createContext(void 0);function SF(e){let t=T.useContext(xF);if(!e&&t===void 0)throw Error(dC(27));return t}var CF=T.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=SF(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return FD(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:Fw,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),wF=T.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=SF(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=GM({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,pT(nT,e.nativeEvent))}return FD(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),TF=T.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=SF(),c=rj(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),FD(`p`,e,{ref:t,props:[{id:c},o]})}),EF=T.createContext(void 0);function DF(){let e=T.useContext(EF);if(e===void 0)throw Error(dC(26));return e}var OF=`--nested-dialogs`,kF=`data-nested-dialog-open`,AF={...Pw,...xw,nestedDialogOpen(e){return e?{[kF]:``}:null}},jF=T.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=SF(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);DF(),Zk({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?$k(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=FD(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...Qk,hidden:!m,onKeyDown(e){RN.has(e.key)&&e.stopPropagation()},style:{[OF]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:AF});return(0,Z.jsx)(bO,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),MF=T.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=SF(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,Z.jsx)(EF.Provider,{value:n,children:(0,Z.jsxs)(tO,{ref:t,...r,children:[a&&o===!0&&(0,Z.jsx)(fN,{ref:i.context.internalBackdropRef,inert:Rj(!s)}),e.children]})}):null});function NF({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),a=e.useState(`modal`),o=e.useState(`popupElement`),s=e.useState(`floatingRootContext`),[c,l]=T.useState(0),[u,d]=T.useState(0),f=c===0,p=DO(s,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:a===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=uw(t);if(f&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||X(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:f});return TN(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{l(e),d(t)}),Y(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(c+1,u+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,c,u,t]),uA(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:u}),null}var PF={...yA,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},FF=class extends Uk{constructor(e,t,n){let r=new fA,i=IF(e,r,t,n);super(i,LF(r),PF)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(iA(this.state,e,t.trigger)))}};function IF(e,t,n,r=!1){return{...pA(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function LF(e){return{popupRef:T.createRef(),backdropRef:T.createRef(),internalBackdropRef:T.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function RF(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=SF(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=eA((e,t)=>new FF({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`);dA(b,x),cA(b);let{forceUnmount:w}=lA(x,b);T.useImperativeHandle(l,()=>({unmount:w,close:()=>b.setOpen(!1,pT(uT))}),[w,b]);let E=x||S;return(0,Z.jsxs)(xF.Provider,{value:b,children:[u&&(0,Z.jsx)(tA,{handle:u,store:b}),E&&(0,Z.jsx)(NF,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:C}):n]})}var zF=iC(function(e){return RF(`dialog`,e)}),BF=T.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=DF(),c=SF(),l=c.useState(`open`),u=c.useState(`nested`),d=c.useState(`transitionStatus`),f=c.useState(`nestedOpenDialogCount`),p=c.useState(`mounted`),m=c.useStateSetter(`viewportElement`);return FD(`div`,e,{enabled:s||p,state:{open:l,nested:u,transitionStatus:d,nestedDialogOpen:f>0},ref:[t,m],stateAttributesMapping:AF,props:[{role:`presentation`,hidden:!p,style:{pointerEvents:l?void 0:`none`},children:a},o]})}),VF=T.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=SF(),c=rj(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),FD(`h2`,e,{ref:t,props:[{id:c},o]})}),HF=aC(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l,...u}=e,d=SF(!0),f=bA(l)??d;if(!f)throw Error(dC(79));let p=rj(s),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`triggerPopupId`,p),_=T.useRef(null),{registerTrigger:v,isMountedByThisTrigger:y}=sA(p,_,f,{payload:c}),{getButtonProps:b,buttonRef:x}=GM({disabled:a,native:o}),S=xO(m),C=jM(()=>f.select(`open`),e=>{f.set(`openMethod`,e)}),w={disabled:a,open:h},E=f.useState(`triggerProps`,y);return FD(`button`,e,{state:w,ref:[x,t,v,_],props:[S.reference,E,C,{[UD]:``,id:p,"aria-haspopup":`dialog`,"aria-expanded":h,"aria-controls":g},u,b],stateAttributesMapping:Mw})});function UF(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,disabled:i}=e,[a,o]=Hj({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=qk(a,!0,!0),u=rj(),[d,f]=T.useState(),p=d===null?void 0:d??u,m=Q(e=>{let t=!a,n=pT(Zw,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return T.useMemo(()=>({defaultPanelId:u,disabled:i,handleTrigger:m,mounted:s,open:a,panelId:p,setMounted:c,setOpen:o,setPanelIdState:f,transitionStatus:l}),[u,i,m,s,a,p,c,o,f,l])}var WF=T.createContext(void 0);function GF(){let e=T.useContext(WF);if(e===void 0)throw Error(dC(15));return e}var KF=`data-open`,qF=`data-closed`,JF=_w,YF=`data-panel-open`,XF={[KF]:``},ZF={[qF]:``},QF={open(e){return e?{[YF]:``}:null}},$F={open(e){return e?XF:ZF},...xw},eI=T.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=Q(o),d=UF({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=T.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=T.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=FD(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:$F});return(0,Z.jsx)(WF.Provider,{value:p,children:m})}),tI={...QF,...xw},nI=T.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=GF(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:d,...f}=e,{getButtonProps:p,buttonRef:m}=GM({disabled:c,focusableWhenDisabled:!0,native:u});return FD(`button`,e,{state:a,ref:[t,m],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},f,p],stateAttributesMapping:tI})}),rI={height:void 0,width:void 0};function iI(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,d=T.useRef(null),f=T.useRef(null),[p,m]=T.useState(rI),h=T.useRef(rI),g=T.useRef(!1),_=T.useRef(s),v=T.useRef(!1),[y,b]=T.useState(!1),x=T.useRef(null),S=yT(t,d),C=TT(s),w=Xk(d),E=!s&&!a,D=y?`idle`:u,O=s&&(_.current||v.current),k=!s&&a&&f.current===`css-animation`&&p.height===void 0&&p.width===void 0?h.current:p,A=n&&E&&f.current!==`css-animation`,j=Q((e,t=!0)=>{t&&(h.current=e),m(e)}),M=Q(()=>{x.current?.(),x.current=null}),N=Q(e=>{M(),x.current=()=>{x.current=null,e()}}),P=Q(()=>{s&&a&&f.current===`css-animation`&&(v.current=!0)});Y(()=>{y&&u!==`starting`&&b(!1)},[y,u]),T.useEffect(()=>()=>{P(),M()},[P,M]),Y(()=>{let e=d.current;if(!e)return;!s&&x.current&&M();let t=oI(e,O);if(f.current=t,s&&u===`idle`&&_.current&&t===`css-animation`){h.current=aI(e);return}if(s&&u===`starting`){let n=g.current;if(g.current=!1,t===`none`){j(aI(e)),b(!0);return}if(t===`css-transition`){let t=lI(e);if(j(aI(e)),!n)return t;let r=cI(e,`transition-duration`,`0s`);return N(r),b(!0),t}j(aI(e));let r=cI(e,`animation-name`,`none`);if(!n){r();return}let i=cI(e,`animation-duration`,`0s`);r(),N(i),b(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(_.current=!1,v.current=!1,t===`none`){j(rI,!1),c(!1);return}j(aI(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=aI(e);if(!(n.height>0||n.width>0)){c(!1);return}j(n),t===`css-animation`&&cI(e,`animation-name`,`none`)()},[a,s,M,j,c,N,O,u]),Zk({enabled:s&&a&&D===`idle`,open:!0,ref:d,onComplete(){s&&j(rI,!1)}}),T.useEffect(()=>{if(s||!a||D!==`ending`||!d.current)return;let e=new AbortController,t=-1;function n(){C.current||(c(!1),j(rI,!1))}return t=PT.request(()=>{w(n,e.signal)}),()=>{PT.cancel(t),e.abort()}},[C,a,s,D,w,j,c]),Y(()=>{let e=d.current;e&&n&&E&&e.setAttribute(`hidden`,`until-found`)},[E,n]),T.useEffect(function(){let e=d.current;if(!e)return;function t(e){let t=pT(Xw,e);o(!0,t),!t.isCanceled&&(g.current=!0,l(!0))}return _T(e,`beforematch`,t)},[o,l]);let F=i||n||a||s;return{height:k.height,props:{...A?{[JF]:``}:void 0,hidden:E,id:r},ref:S,shouldPreventOpenAnimation:O,shouldRender:F,transitionStatus:D,width:k.width}}function aI(e){return{height:e.scrollHeight,width:e.scrollWidth}}function oI(e,t){let n=BC(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&sI(n.animationDuration),i=sI(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function sI(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function cI(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===``){e.style.removeProperty(t);return}e.style.setProperty(t,r,i)}}function lI(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{if(n===``){e.style.removeProperty(t);return}e.style.setProperty(t,n)})}let r=PT.request(n);return()=>{PT.cancel(r),n()}}var uI=`--collapsible-panel-height`,dI=`--collapsible-panel-width`,fI=T.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{defaultPanelId:l,mounted:u,onOpenChange:d,open:f,setMounted:p,setPanelIdState:m,setOpen:h,state:g,transitionStatus:_}=GF(),v=r??!1,y=i??!1,b=o||void 0,x=b??l;Y(()=>(m(e=>b??(e===null?void 0:e)),()=>{m(e=>e===b?null:e)}),[b,m]);let{height:S,props:C,ref:w,shouldPreventOpenAnimation:T,shouldRender:E,transitionStatus:D,width:O}=iI({externalRef:t,hiddenUntilFound:v,id:x,keepMounted:y,mounted:u,onOpenChange:d,open:f,setMounted:p,setOpen:h,transitionStatus:_}),k={...g,transitionStatus:D},A=yD(s,k),j=FD(`div`,{...e,style:void 0},{state:k,ref:w,props:[C,{style:{[uI]:S===void 0?`auto`:`${S}px`,[dI]:O===void 0?`auto`:`${O}px`}},c,A?{style:A}:void 0,T?{style:{animationName:`none`}}:void 0],stateAttributesMapping:$F});return E?j:null}),pI=T.createContext(void 0);function mI(e=!0){let t=T.useContext(pI);if(t===void 0&&!e)throw Error(dC(25));return t}var hI=T.createContext(void 0);function gI(e){let t=T.useContext(hI);if(t===void 0&&!e)throw Error(dC(33));return t}var _I=T.createContext(void 0);function vI(e){let t=T.useContext(_I);if(t===void 0&&!e)throw Error(dC(36));return t}function yI(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=a.useState(`open`),d=mI(!0),f=d!==void 0;return T.useMemo(()=>({id:r,role:`menuitem`,tabIndex:u&&n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:tT})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||f&&!DC&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&c.type===`regular-item`&&WM(s.current,e,{detail:1})}}),[t,n,r,l,i,u,a,o,s,d,f,c])}var bI={type:`regular-item`};function xI(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=T.useRef(null),{getButtonProps:d,buttonRef:f}=GM({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=yI({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=T.useCallback(e=>xD(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=yT(u,f);return T.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var SI=T.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=iP({guess:!0,label:a}),f=gI(!0),p=rj(i),{store:m}=vI(),h=m.useState(`disabled`),g=s||h,_=m.useState(`isActive`,d.index),v=m.useState(`itemProps`),{getItemProps:y,itemRef:b}=xI({closeOnClick:c,disabled:g,highlighted:_,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:bI});return FD(`div`,e,{state:{disabled:g,highlighted:_},props:[v,u,y],ref:[b,t,d.ref]})}),CI=T.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=vI(),{side:c,align:l}=gI(),u=NN(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),v=s.useState(`lastOpenChangeReason`),y=s.useState(`rootId`),b=s.useState(`floatingRootContext`),x=s.useState(`floatingTreeRoot`),S=s.useState(`closeDelay`),C=s.useState(`hoverEnabled`),w=s.useState(`disabled`),E=s.useState(`openMethod`),D=_.type===`context-menu`;Zk({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),T.useEffect(()=>{function e(e){s.setOpen(!1,pT(e.reason,e.domEvent))}return x.events.on(`close`,e),()=>{x.events.off(`close`,e)}},[x.events,s]),jA(b,{enabled:C&&!w&&!D&&_.type!==`menubar`,closeDelay:S});let O=s.useStateSetter(`popupElement`),k=FD(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,O],stateAttributesMapping:Fw,props:[p,{onKeyDown(e){u&&RN.has(e.key)&&e.stopPropagation()}},Pj(f),o,{"data-rootownerid":y}]}),A=_.type===void 0||D;return(g||_.type===`menubar`&&v!==`outside-press`)&&(A=!0),(0,Z.jsx)(bO,{context:b,openInteractionType:E,modal:D,disabled:!m,returnFocus:a===void 0?A:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:x,previousFocusableElement:g,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:k})}),wI=T.createContext(void 0);function TI(){let e=T.useContext(wI);if(e===void 0)throw Error(dC(32));return e}var EI=T.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=vI();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,Z.jsx)(wI.Provider,{value:n,children:(0,Z.jsx)(tO,{ref:t,...r,portalOwnerRole:o})})}),DI=T.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=qD,style:g,..._}=e,{store:v}=vI(),y=TI(),b=mI(!0),x=v.useState(`parent`),S=v.useState(`floatingRootContext`),C=v.useState(`floatingTreeRoot`),w=v.useState(`mounted`),E=v.useState(`open`),D=v.useState(`modal`),O=v.useState(`openMethod`),k=v.useState(`activeTriggerElement`),A=v.useState(`transitionStatus`),j=v.useState(`positionerElement`),M=v.useState(`instantType`),N=v.useState(`adaptiveOrigin`),P=v.useState(`lastOpenChangeReason`),F=v.useState(`floatingNodeId`),I=v.useState(`floatingParentNodeId`),L=S.useState(`domReferenceElement`),R=T.useRef(null),z=Xk(j),B=n,V=c,ee=l,te=s,ne=h;x.type===`context-menu`&&(B=n??x.context?.anchor,te??=`start`,!o&&te!==`center`&&(ee=e.alignOffset??2,V=e.sideOffset??-5));let H=o,re=te;x.type===`menu`?(H??=`inline-end`,re??=`start`,ne=e.collisionAvoidance??JD):x.type===`menubar`&&(H??=x.context.orientation===`vertical`?`inline-end`:`bottom`,re??=`start`);let ie=x.type===`context-menu`,ae=jj({anchor:B,floatingRootContext:S,positionMethod:b?`fixed`:r,mounted:w,side:H,sideOffset:V,align:re,alignOffset:ee,arrowPadding:ie?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:F,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:ne,shift:ie?{crossAxis:!(`side`in ne&&ne.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:C,adaptiveOrigin:N});T.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===F&&v.set(`hoverEnabled`,!1),e.nodeId!==F&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,pT(cT)))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[v,C.events,F]),T.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,pT(t))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[C.events,v]);let oe=_C();T.useEffect(()=>{E||oe.clear()},[E,oe]),T.useEffect(()=>{function e(e){if(E&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&k&&k!==e.target){let e=v.select(`closeDelay`);e>0?oe.isStarted()||oe.start(e,()=>{v.setOpen(!1,pT(cT))}):v.setOpen(!1,pT(cT))}else oe.clear()}}return C.events.on(`itemhover`,e),()=>{C.events.off(`itemhover`,e)}},[C.events,E,k,v,oe]),T.useEffect(()=>{let e={open:E,nodeId:F,parentNodeId:I,reason:v.select(`lastOpenChangeReason`)};C.events.emit(`menuopenchange`,e)},[C.events,E,v,F,I]),Y(()=>{let e=L,t=R.current;if(e&&(R.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return z(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[L,z,v]);let se={open:E,side:ae.side,align:ae.align,anchorHidden:ae.anchorHidden,nested:x.type===`menu`,instant:M},U=x.type===`menubar`&&x.context.modal;DN(E&&(U||D&&P!==`trigger-hover`),O===`touch`,j,k);let W=Fj(e,se,{styles:ae.positionerStyles,transitionStatus:A,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!w,inert:!E}),ce=w&&x.type!==`menu`&&(x.type!==`menubar`&&D&&P!==`trigger-hover`||x.type===`menubar`&&x.context.modal),le=null;return x.type===`menubar`?le=x.context.contentElement:x.type===void 0&&(le=k),(0,Z.jsxs)(hI.Provider,{value:ae,children:[ce&&(0,Z.jsx)(fN,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:Rj(!E),cutout:le}),(0,Z.jsx)(lO,{id:F,children:(0,Z.jsx)(rN,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:W})})]})}),OI=T.createContext(null);function kI(e){let t=T.useContext(OI);if(t===null&&!e)throw Error(dC(5));return t}var AI={...yA,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},jI=class extends Uk{constructor(e,t,n=!1){let r=new fA,i=NI(r,t,n,e);super(i,MI(r),AI),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}unsubscribeParentListener=null};function MI(e){return{positionerRef:T.createRef(),popupRef:T.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:T.createRef(),beforeContentFocusGuardRef:T.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function NI(e,t,n=!1,r){return{...pA(e,t,n),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new rO,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:lC,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var PI=T.createContext(void 0);function FI(){return T.useContext(PI)}var II=iC(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=mI(!0),_=vI(!0),v=kI(!0),y=FI(),b=T.useMemo(()=>y&&_?{type:`menu`,store:_.store}:v?{type:`menubar`,context:v}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,v,y]),x=fD(),S=fD(),C=oO(),w=b.type===`menu`?b.store:void 0,E=(n??a)&&w?.state.transitionStatus===`starting`,D=$S(()=>E?w?.state.instantType:void 0).current,O=LI({open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:b,disabled:o,highlightItemOnHover:h,modal:b.type===void 0?s:void 0,rootId:x,instantType:D},S,C!=null);O.useControlledProp(`openProp`,n),O.useControlledProp(`triggerIdProp`,p),O.useContextCallback(`onOpenChangeComplete`,i);let k=O.useState(`floatingTreeRoot`),A=cO(k),j=O.useState(`open`),M=O.useState(`activeTriggerElement`),N=O.useState(`positionerElement`),P=O.useState(`hoverEnabled`),F=O.useState(`disabled`),I=O.useState(`lastOpenChangeReason`),L=O.useState(`parent`),R=O.useState(`activeIndex`),z=O.useState(`payload`),B=O.useState(`floatingParentNodeId`),V=T.useRef(null),ee=T.useRef(L.type!==`context-menu`),te=_C(),ne=T.useRef(!0),H=_C(),re=B!=null,{openMethod:ie,triggerProps:ae}=MM(j);O.useSyncedValues({disabled:o,highlightItemOnHover:h,modal:L.type===void 0?s:void 0,openMethod:ie,rootId:x}),cA(O);let{forceUnmount:oe,transitionStatus:se}=lA(j,O,()=>{O.set(`allowMouseEnter`,!1)},E),U=Xk(O.context.popupRef);T.useEffect(()=>{if(D===void 0)return;let e=()=>{O.state.instantType===D&&O.set(`instantType`,void 0)};if(!j){e();return}if(se!==void 0)return;if(O.context.popupRef.current==null){e();return}let t=new AbortController;return U(e,t.signal),()=>{t.abort()}},[D,j,se,U,O]),Y(()=>{g&&!_?O.update({parent:{type:`context-menu`,context:g},floatingNodeId:A,floatingParentNodeId:C}):_&&O.update({floatingNodeId:A,floatingParentNodeId:C})},[g,_,A,C,O]),T.useEffect(()=>{if(j||(V.current=null),L.type===`context-menu`){if(!j){te.clear(),ee.current=!1;return}te.start(500,()=>{ee.current=!0})}},[te,j,L.type]),Y(()=>{!j&&!P&&O.set(`hoverEnabled`,!0)},[j,P,O]);let W=Q((e,t)=>{let n=t.reason;if(!e&&!O.select(`open`)||j===e&&t.trigger===M&&I===n)return;let i=aA(t);if(!e&&t.trigger==null&&(t.trigger=M??void 0),r?.(e,t),t.isCanceled)return;O.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!ne.current)return;e&&n===`trigger-focus`?(ne.current=!1,H.start(300,()=>{ne.current=!0})):(ne.current=!0,H.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0,s=!e&&(n===`escape-key`||n==null);V.current=t.event;let c=iA(O.state,e,t.trigger,i());c.openChangeReason=n,c.instantType=L.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:o||s?o?`click`:`dismiss`:void 0,O.update(c)}),ce=Kk({popupStore:O,floatingRootContext:O.state.floatingRootContext,floatingId:S,nested:C!=null,onOpenChange:W}),le=ce.context.events;Y(()=>{let e=({open:e,eventDetails:t})=>W(e,t);return le.on(`setOpen`,e),()=>{le?.off(`setOpen`,e)}},[le,W]);let ue=T.useCallback(()=>{O.setOpen(!1,pT(uT))},[O]);T.useImperativeHandle(u,()=>({unmount:oe,close:ue}),[oe,ue]);let de;L.type===`context-menu`&&(de=L.context),T.useImperativeHandle(de?.positionerRef,()=>N,[N]),T.useImperativeHandle(de?.actionsRef,()=>({setOpen:W}),[W]);let fe=DO(ce,{enabled:!F,bubbles:{escapeKey:d&&L.type===`menu`},outsidePress(){return L.type!==`context-menu`||V.current?.type===`contextmenu`||ee.current},externalTree:re?k:void 0}),pe=_j(),me=T.useCallback(e=>{O.select(`activeIndex`)!==e&&O.set(`activeIndex`,e)},[O]),he=VA(ce,{enabled:!F,listRef:O.context.itemDomElements,activeIndex:R,nested:L.type!==void 0,loopFocus:c,orientation:l,parentOrientation:L.type===`menubar`?L.context.orientation:void 0,rtl:pe===`rtl`,disabledIndices:cC,onNavigate:me,openOnArrowKeyDown:L.type!==`context-menu`,externalTree:re?k:void 0,focusItemOnHover:h}),ge=T.useCallback(e=>{O.context.typingRef.current=e},[O]),_e=HA(ce,{enabled:!F,listRef:O.context.itemLabels,elementsRef:O.context.itemDomElements,activeIndex:R,resetMs:500,onMatch:e=>{j&&e!==R&&O.set(`activeIndex`,e)},onTyping:ge}),ve=T.useMemo(()=>{let e=xD(_e.reference,he.reference,fe.reference,{onMouseMove(){O.set(`allowMouseEnter`,!0)}},ae);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=j,e},[O,_e.reference,he.reference,fe.reference,ae,j]),ye=T.useMemo(()=>{let e=xD(he.trigger,fe.trigger,ae);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[he.trigger,fe.trigger,ae]);$S(()=>(O.update({inactiveTriggerProps:ye}),null)),uA(O,{floatingRootContext:ce,activeTriggerProps:ve,inactiveTriggerProps:ye,popupProps:T.useMemo(()=>xD(Qk,{id:S,role:`menu`,"aria-orientation":l===`horizontal`?`horizontal`:void 0,"aria-labelledby":M?.id,onMouseMove(){O.set(`allowMouseEnter`,!0),L.type===`menu`&&O.set(`hoverEnabled`,!1)},onClick(){O.select(`hoverEnabled`)&&O.set(`hoverEnabled`,!1)},onKeyDown(e){let t=O.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},_e.floating,he.floating,fe.floating),[M,S,l,L.type,O,_e.floating,he.floating,fe.floating]),itemProps:he.item??lC});let be=T.useMemo(()=>({store:O,parent:b}),[O,b]),xe=(0,Z.jsxs)(_I.Provider,{value:be,children:[f&&(0,Z.jsx)(tA,{handle:f,store:O}),typeof t==`function`?t({payload:z}):t]});return L.type===void 0||L.type===`context-menu`?(0,Z.jsx)(uO,{externalTree:k,children:xe}):xe});function LI(e,t,n){return $S(()=>new jI(e,t,n)).current}function RI(e){if(WC(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!nw(e))return RI(aw(e))}function zI(e,t){let n=T.useRef(null);function r(t){XD.flushSync(()=>{e.setOpen(!1,pT(rT,t.nativeEvent,t.currentTarget))}),HE(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&UE(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{XD.flushSync(()=>{e.setOpen(!1,pT(rT,n.nativeEvent,n.currentTarget))});let i=VE(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&X(r,i);){let e=i;if(i=RE(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function BI(e){let[t,n]=T.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=T.useRef(null),i=T.useRef(null),a=T.useRef(null),o=T.useRef(null),s=T.useRef(!0),c=T.useRef(null),l=fD(),u=T.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:a,backdropRef:r,internalBackdropRef:i,positionerRef:o,allowMouseUpTriggerRef:s,initialCursorPointRef:c,rootId:l}),[t,l]);return(0,Z.jsx)(pI.Provider,{value:u,children:(0,Z.jsx)(_I.Provider,{value:void 0,children:(0,Z.jsx)(II,{...e})})})}var VI=500,HI=T.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{setAnchor:o,actionsRef:s,internalBackdropRef:c,backdropRef:l,positionerRef:u,allowMouseUpTriggerRef:d,initialCursorPointRef:f,rootId:p}=mI(!1),{store:m}=vI(!1),h=m.useState(`open`),g=m.useState(`disabled`),_=T.useRef(null),v=T.useRef(null),y=_C(),b=_C(),x=T.useRef(!1),S=T.useRef(null);function C(e,t,n){let r=n.type.startsWith(`touch`);f.current={x:e,y:t},o({getBoundingClientRect(){return DOMRect.fromRect({width:r?10:0,height:r?10:0,x:e,y:t})}}),x.current=!1,s.current?.setOpen(!0,pT(Zw,n)),b.start(VI,()=>{x.current=!0})}function w(e){if(g)return;d.current=!0,MC(e),C(e.clientX,e.clientY,e.nativeEvent);let t=IT(_.current);S.current?.abort();let n=new AbortController;S.current=n,t.addEventListener(`mouseup`,e=>{if(d.current=!1,!x.current)return;b.clear(),x.current=!1;let t=uw(e);X(u.current,t)||p&&t&&RI(t)===p||s.current?.setOpen(!1,pT(sT,e))},{once:!0,signal:n.signal})}function E(){y.clear(),v.current=null}function D(e){if(g){E();return}if(d.current=!1,e.touches.length!==1){E();return}e.stopPropagation();let t=e.touches[0],n={x:t.clientX,y:t.clientY};v.current=n,y.start(VI,()=>{C(n.x,n.y,e.nativeEvent)})}function O(e){if(e.touches.length!==1){E();return}if(y.isStarted()&&v.current){let t=e.touches[0],n=Math.abs(t.clientX-v.current.x),r=Math.abs(t.clientY-v.current.y);(n>10||r>10)&&E()}}return T.useEffect(()=>()=>{S.current?.abort()},[]),T.useEffect(()=>{function e(e){if(g)return;let t=uw(e);(X(_.current,t)||X(c.current,t)||X(l.current,t))&&e.preventDefault()}return _T(IT(_.current),`contextmenu`,e)},[l,g,c]),FD(`div`,e,{state:{open:h},ref:[_,t],props:[{onContextMenu:w,onTouchStart:D,onTouchMove:O,onTouchEnd:E,onTouchCancel:E,style:{WebkitTouchCallout:`none`}},a],stateAttributesMapping:Nw})}),UI=DI,WI=`--nested-drawers`,GI=`--drawer-height`,KI=`--drawer-frontmost-height`,qI=`--drawer-swipe-movement-x`,JI=`--drawer-swipe-movement-y`,YI=`--drawer-snap-point-offset`,XI=`--drawer-swipe-strength`,ZI=`--drawer-swipe-progress`,QI=T.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=SF(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return FD(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:Fw,props:[{role:`presentation`,hidden:!u,style:{pointerEvents:c?void 0:`none`,userSelect:`none`,WebkitUserSelect:`none`,[ZI]:`0`,[XI]:`1`}},o],enabled:a||!l})}),$I=wF,eL=`data-drawer-content`,tL=TF,nL=T.createContext(void 0);function rL(){return T.useContext(nL)}var iL=`data-expanded`,aL=`data-nested-drawer-open`,oL=`data-nested-drawer-swiping`,sL=`data-swipe-dismiss`,cL=`data-swipe-direction`,lL=`data-swiping`,uL=T.createContext(void 0);function dL(e){let t=T.useContext(uL);if(e!==!0&&t===void 0)throw Error(dC(90));return t}function fL(e,t){let n=e+t;return n>=0?t:-Math.sqrt(-n)-e}function pL(e,t,n){if(!Number.isFinite(t)||t<=0)return null;if(typeof e==`number`)return Number.isFinite(e)?e<=1?NM(e,0,1)*t:e:null;let r=e.trim();if(r.endsWith(`px`)){let e=Number.parseFloat(r);return Number.isFinite(e)?e:null}if(r.endsWith(`rem`)){let e=Number.parseFloat(r);return Number.isFinite(e)?e*n:null}return null}function mL(e,t){let n=-1,r=1/0;for(let i=0;i<e.length;i+=1){let a=Math.abs(e[i]-t);a<r&&(r=a,n=i)}return n}function hL(){let e=SF(),{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:i}=dL(),a=e.useState(`viewportElement`),[o,s]=T.useState(0),[c,l]=T.useState(16),u=Q(()=>{let e=IT(a).documentElement;s(a?a.offsetHeight:e.clientHeight);let t=parseFloat(getComputedStyle(e).fontSize);Number.isFinite(t)&&l(t)});Y(()=>{if(u(),!a||typeof ResizeObserver!=`function`)return;let e=new ResizeObserver(u);return e.observe(a),()=>{e.disconnect()}},[u,a]);let d=T.useMemo(()=>{if(!t||t.length===0||o<=0||i<=0)return[];let e=Math.min(i,o),n=t.map(t=>{let n=pL(t,o,c);if(n===null)return null;let r=NM(n,0,e);return{value:t,height:r,offset:Math.max(0,i-r)}}).filter(e=>!!e);if(n.length<=1)return n;let r=[],a=[];for(let e=n.length-1;e>=0;--e){let t=n[e];a.some(e=>Math.abs(e-t.height)<=1)||(a.push(t.height),r.push(t))}return r.reverse(),r},[i,c,t,o]);return{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:i,viewportHeight:o,resolvedSnapPoints:d,activeSnapPointOffset:T.useMemo(()=>{if(n===null)return;let e=d.find(e=>Object.is(e.value,n));if(e)return e;let t=Math.min(i,o),r=pL(n,o,c);if(r===null)return;let a=NM(r,0,t);return d[mL(d.map(e=>e.height),a)]},[n,i,d,c,o])?.offset??null}}var gL=T.createContext(null);function _L(){return T.useContext(gL)}var vL=!1;function yL(){vL||=(typeof CSS<`u`&&`registerProperty`in CSS&&([qI,JI,YI].forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),[{name:ZI,initialValue:`0`},{name:XI,initialValue:`1`}].forEach(({name:e,initialValue:t})=>{try{CSS.registerProperty({name:e,syntax:`<number>`,inherits:!1,initialValue:t})}catch{}})),!0)}var bL={...Fw,expanded(e){return e?{[iL]:``}:null},nestedDrawerOpen(e){return e?{[aL]:``}:null},nestedDrawerSwiping(e){return e?{[oL]:``}:null},swipeDirection(e){return{[cL]:e}},swiping(e){return e?{[lL]:``}:null}},xL=T.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=SF(),l=c.context.popupRef,{swipeDirection:u,frontmostHeight:d,hasNestedDrawer:f,nestedSwiping:p,nestedSwipeProgressStore:m,onPopupHeightChange:h,notifyParentFrontmostHeight:g,notifyParentHasNestedDrawer:_}=dL(),v=c.useState(`descriptionElementId`),y=c.useState(`disablePointerDismissal`),b=c.useState(`floatingRootContext`),x=c.useState(`popupProps`),S=c.useState(`modal`),C=c.useState(`mounted`),w=c.useState(`nested`),E=c.useState(`nestedOpenDrawerCount`),D=c.useState(`transitionStatus`),O=c.useState(`open`),k=c.useState(`openMethod`),A=c.useState(`titleElementId`),j=c.useState(`role`),M=b.useState(`floatingId`),N=s.id??M,P=_L();DF();let{snapPoints:F,activeSnapPoint:I,activeSnapPointOffset:L}=hL(),R=E>0,z=P?.swiping??!1,B=P?.swipeStrength??null,[V,ee]=T.useState(0),te=T.useRef(0),ne=Q(()=>{let e=l.current;if(!e)return;let t=e.offsetHeight;if(te.current>0&&d>te.current&&t>te.current)return;if(te.current>0&&f){let e=te.current;ee(e),h(e);return}let n=t;n!==te.current&&(te.current=n,ee(n),h(n))});Y(()=>{if(!C){te.current=0,ee(0),h(0);return}let e=l.current;if(!e||(yL(),ne(),typeof ResizeObserver!=`function`))return;let t=new ResizeObserver(ne);return t.observe(e),()=>{t.disconnect()}},[ne,C,R,h,l]),Y(()=>{let e=()=>{let e=l.current;if(!e)return;let t=m.getSnapshot();t>0?e.style.setProperty(ZI,`${t}`):e.style.setProperty(ZI,`0`)};e();let t=m.subscribe(e),n=l.current;return()=>{t(),n&&n.style.setProperty(ZI,`0`)}},[m,l]),Y(()=>{if(O)return g?.(d),()=>{g?.(0)}},[d,O,g]),Y(()=>{if(_)return _(O||D===`ending`),()=>{_(!1)}},[_,O,D]),Zk({open:O,ref:l,onComplete(){O&&c.context.onOpenChangeComplete?.(!0)}});let H=o===void 0?l:o,re=c.useStateSetter(`popupElement`),ie={open:O,nested:w,transitionStatus:D,expanded:I===1,nestedDrawerOpen:R,nestedDrawerSwiping:p,swipeDirection:u,swiping:z},ae;V&&(f||D===`ending`)&&(ae=`${V}px`);let oe=F&&F.length>0&&(u===`down`||u===`up`),se=null;oe&&L!==null&&(se=u===`up`?-L:L);let U=P?P.getDragStyles():lC;if(oe&&u===`down`){let e=L??0,t=Number.parseFloat(String(U[JI]));U=z&&Number.isFinite(t)?{...U,transform:void 0,[JI]:`${fL(e,t)}px`}:{...U,transform:void 0}}let W=FD(`div`,e,{state:ie,props:[x,{id:N,"aria-labelledby":A,"aria-describedby":v,role:j,...Qk,hidden:!C,onKeyDown(e){RN.has(e.key)&&e.stopPropagation()},style:{...U,[ZI]:`0`,[WI]:E,[GI]:ae,[YI]:typeof se==`number`?`${se}px`:`0px`,[KI]:d?`${d}px`:void 0,[XI]:typeof B==`number`&&Number.isFinite(B)&&B>0?`${B}`:`1`}},s],ref:[t,l,re],stateAttributesMapping:bL});return(0,Z.jsx)(bO,{context:b,openInteractionType:k,disabled:!C,closeOnFocusOut:!y,initialFocus:H,returnFocus:a,modal:S!==!1,restoreFocus:`popup`,children:W})}),SL=MF,CL,wL;function TL(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null,swipeDirection:f=`down`,snapToSequentialPoints:p=!1,snapPoints:m,snapPoint:h,defaultSnapPoint:g,onSnapPointChange:_}=e,v=dL(!0),y=v?.onNestedSwipeProgressChange,b=v?.onNestedFrontmostHeightChange,x=v?.onNestedSwipingChange,S=v?.onNestedDrawerPresenceChange,[C,w]=T.useState(0),[E,D]=T.useState(0),[O,k]=T.useState(!1),[A,j]=T.useState(!1),[M]=T.useState(EL),N=g===void 0?m?.[0]??null:g,P=h!==void 0,[F,I]=Hj({controlled:h,default:N,name:`Drawer`,state:`snapPoint`}),L=T.useRef(!1),R=T.useRef(!1),z=Q((e,t)=>{let n=t??pT(`none`);_?.(e,n),!n.isCanceled&&I(e)}),B=T.useMemo(()=>P||!m||m.length===0?F:F===null||!m.some(e=>Object.is(e,F))?N:F,[F,P,N,m]),V=Q(e=>{w(e),!L.current&&e>0&&D(e)}),ee=Q(e=>{if(e>0){L.current=!0,D(e);return}L.current=!1,C>0&&D(C)}),te=Q(e=>{k(e)}),ne=Q(e=>{M.set(e),y?.(e)}),H=Q(e=>{j(e),x?.(e)}),re=Q((e,t)=>{i?.(e,t),!t.isCanceled&&!e&&m&&m.length>0&&z(N,pT(t.reason,t.event,t.trigger))}),ie=T.useMemo(()=>({swipeDirection:f,swipeAreaActiveRef:R,snapToSequentialPoints:p,snapPoints:m,activeSnapPoint:B,setActiveSnapPoint:z,frontmostHeight:E,popupHeight:C,hasNestedDrawer:O,nestedSwiping:A,nestedSwipeProgressStore:M,onNestedDrawerPresenceChange:te,onPopupHeightChange:V,onNestedFrontmostHeightChange:ee,onNestedSwipingChange:H,onNestedSwipeProgressChange:ne,notifyParentFrontmostHeight:b,notifyParentSwipingChange:x,notifyParentSwipeProgressChange:y,notifyParentHasNestedDrawer:S}),[B,E,O,A,M,S,y,x,b,te,ee,ne,H,V,C,z,m,p,R,f]),ae=RF(`drawer`,{open:n,defaultOpen:r,onOpenChange:re,onOpenChangeComplete:a,disablePointerDismissal:o,modal:s,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d,children:typeof t==`function`?e=>(0,Z.jsxs)(T.Fragment,{children:[CL||=(0,Z.jsx)(DL,{}),t(e)]}):(0,Z.jsxs)(T.Fragment,{children:[wL||=(0,Z.jsx)(DL,{}),t]})});return(0,Z.jsx)(uL.Provider,{value:ie,children:ae})}function EL(){let e=0,t=new Set;return{getSnapshot:()=>e,set(n){let r=Number.isFinite(n)?n:0;r!==e&&(e=r,t.forEach(e=>{e()}))},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}function DL(){let e=rL(),t=SF(!1),n=e?.setDrawerOpen,r=e?.removeDrawer,i=t.useState(`open`),a=t.useState(`nestedOpenDialogCount`),o=t.useState(`popupElement`),s=a===0;return Y(()=>{if(r)return()=>{r(t)}},[r,t]),Y(()=>{n?.(t,i)},[i,n,t]),T.useEffect(()=>{if(!i||!s||!EC)return;let e=BC(o).CloseWatcher;if(!e)return;function n(e){t.select(`open`)&&t.setOpen(!1,pT(aT,e))}let r=new e,a=_T(r,`close`,n);return()=>{a(),r.destroy()}},[t,s,i,o]),null}function OL(e,t=!1){let{overflowY:n}=rw(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}function kL(e,t=!1){let{overflowX:n}=rw(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientWidth>0:e.scrollWidth>e.clientWidth}function AL(e,t,n=!1){return t===`vertical`?OL(e,n):kL(e,n)}function jL(e,t,n){let r=e;for(;WC(r)&&r!==t&&!nw(r);){for(let e of n)if(AL(r,e))return!0;r=aw(r)}return!1}function ML(e,t,n=`vertical`,r=!1){let i=WC(e)?e:null;for(;WC(i)&&i!==t&&!nw(i);){if(AL(i,n,r))return i;i=aw(i)}return AL(t,n,r)?t:null}function NL(e,t,n){return typeof e?.elementFromPoint==`function`?e.elementFromPoint(t,n):null}function PL(e,t){let n=(t??BC(e).getComputedStyle(e)).transform,r=0,i=0,a=1;if(n&&n!==`none`){let e=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(r=t[4],i=t[5],a=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(r=t[12],i=t[13],a=t[0])}}return{x:r,y:i,scale:a}}var FL=40,IL=10,LL=1,RL=50,zL=16,BL=80,VL=`button,a,input,select,textarea,label,[role="button"]`;function HL(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function UL(e){return Number.isFinite(e)&&e>0?e:null}function WL(e,t){return`translate3d(${e.x}px,${e.y}px,0) scale(${t})`}function GL(e){return e%2==1}function KL(e,t,n){let r=e[n];if(typeof r==`function`)try{r.call(e,t)}catch(e){if(e&&typeof e==`object`&&`name`in e&&e.name===`NotFoundError`)return;throw e}}function qL(e){let{enabled:t,directions:n,elementRef:r,movementCssVars:i,canStart:a,ignoreSelectorWhenTouch:o=!0,ignoreScrollableAncestors:s=!1,swipeThreshold:c,onDismiss:l,onProgress:u,onCancel:d,onSwipeStart:f,onRelease:p,onSwipingChange:m,trackDrag:h=!0}=e,g=VL,_=n.length===1?n[0]:void 0,v=Math.max(0,typeof c==`number`?c:FL),y=n.includes(`left`),b=n.includes(`right`),x=n.includes(`up`),S=n.includes(`down`),C=y||b,w=x||S,E=T.useMemo(()=>{let e=[];return w&&e.push(`vertical`),C&&e.push(`horizontal`),e},[C,w]),[D,O]=T.useState(void 0),[k,A]=T.useState(!1),[j,M]=T.useState(!1),N=T.useRef({x:0,y:0}),P=T.useRef({x:0,y:0}),F=T.useRef(null),I=T.useRef({x:0,y:0,scale:1}),L=T.useRef(void 0),R=T.useRef(0),z=T.useRef(!1),B=T.useRef({x:0,y:0}),V=T.useRef(null),ee=T.useRef(!1),te=T.useRef(!1),ne=T.useRef(null),H=T.useRef(!1),re=T.useRef(!1),ie=T.useRef({width:0,height:0}),ae=T.useRef(0),oe=T.useRef(v),se=T.useRef(null),U=T.useRef(null),W=T.useRef(null),ce=T.useRef({x:0,y:0}),le=T.useRef(null),ue=T.useRef(!1),de=T.useRef(null),fe=Q(e=>{ue.current!==e&&(ue.current=e,A(e),m?.(e))});function pe(e){if(!e)return;let t=r.current,n=se.current;if(!t||!n)return;let i=n({element:t,direction:e});oe.current=Math.max(0,i)}let me=Q((e,t)=>{let n=Number.isFinite(e)?NM(e,0,1):0,r=n!==ae.current,i=!1;if(t){let e=le.current;i=!e||e.deltaX!==t.deltaX||e.deltaY!==t.deltaY||e.direction!==t.direction}(r||i)&&(ae.current=n,t?le.current=t:r&&(le.current=null),u?.(n,t))}),he=Q(e=>{let t=r.current;if(!h||!t){e||(de.current=null);return}let n=t.style,a=de.current;e?(a||(de.current=[n.transition,n.transform]),n.transition=`none`):a&&([n.transition,n.transform]=a,de.current=null);let o=P.current,s=I.current,c=o.x-s.x,l=o.y-s.y;e&&(n.transform=WL(o,s.scale)),n.setProperty(i.x,`${c}px`),n.setProperty(i.y,`${l}px`)});function ge(e,t){if(t===null)return;let n=W.current;if(n&&t>n.time){let r=Math.max(t-n.time,zL);ce.current={x:(e.x-n.x)/r,y:(e.y-n.y)/r}}W.current={x:e.x,y:e.y,time:t}}let _e=T.useCallback(()=>{O(void 0),fe(!1),M(!1),me(0),oe.current=v,se.current=null,N.current={x:0,y:0},P.current={x:0,y:0},I.current={x:0,y:0,scale:1},L.current=void 0,R.current=0,z.current=!1,B.current={x:0,y:0},V.current=null,ee.current=!1,F.current=null,te.current=!1,ne.current=null,H.current=!1,re.current=!1,ie.current={width:0,height:0},U.current=null,W.current=null,ce.current={x:0,y:0},le.current=null,he(!1)},[fe,v,he,me]);function ve(e){if(`touches`in e){let t=e.touches[0];return t?{x:t.clientX,y:t.clientY}:null}return{x:e.clientX,y:e.clientY}}function ye(e){return`touches`in e||e.pointerType===`touch`}function be(e,t){let n=r.current?.getRootNode();return NL(n,e.x,e.y)??uw(t)}function xe(e,t){let n=n=>{let r=ML(e,t,n),i=IT(r);return r===i.body||r===i.documentElement?null:r};return C&&!w?n(`horizontal`):w&&!C?n(`vertical`):n(`vertical`)??n(`horizontal`)}function Se(e,t,n){H.current=!1;let i=ye(e),a=be(t,e.nativeEvent),l=IT(r.current).body,u=i&&l?xe(a,l):null,d=n?.ignoreScrollableTarget??!1;if(u&&!d||(H.current=!!(u&&d),a&&a.closest(g)&&(!i||o)))return!1;let p=r.current;if(s&&p&&a&&E.length>0&&!(n?.ignoreScrollableAncestors??!1)&&jL(a,p,E))return!1;if(z.current=!1,L.current=void 0,R.current=0,N.current=t,U.current=UL(e.timeStamp),B.current=t,F.current=t,oe.current=v,se.current=typeof c==`function`?c:null,p){ie.current={width:p.offsetWidth,height:p.offsetHeight},pe(_);let t=PL(p);I.current=t,P.current={x:t.x,y:t.y},ge({x:t.x,y:t.y},U.current),`touches`in e||KL(p,e.pointerId,`setPointerCapture`)}return f?.(e.nativeEvent),fe(!0),V.current=null,ee.current=!0,me(0),he(!0),!0}function Ce(){we(),H.current=!1,F.current=null}function we(){te.current=!1,ne.current=null}function Te(e){if(Ce(),!ue.current)return;fe(!1),V.current=null;let t=I.current;P.current={x:t.x,y:t.y},O(void 0),re.current=!1,he(!1);let n=r.current;n&&KL(n,e.pointerId,`releasePointerCapture`),me(0,{deltaX:0,deltaY:0,direction:void 0}),d?.(e.nativeEvent)}function Ee(e,t){let n=e=>Math.sign(e)*Math.abs(e)**.5,r=(e,t,r)=>!t&&e<0||!r&&e>0?n(e):e;return{x:C?r(e,y,b):n(e),y:w?r(t,x,S):n(t)}}function De(e,t,n){let r=(e,t,n,r,i)=>e>0&&t<=0&&r||e<0&&t>=Math.max(0,n)&&i,i=Math.abs(t),a=Math.abs(n);return w&&n!==0&&(!C||a>=i)?r(n,e.scrollTop,e.scrollHeight-e.clientHeight,S,x):C&&t!==0&&(!w||i>a)?r(t,e.scrollLeft,e.scrollWidth-e.clientWidth,b,y):null}let Oe=Q(e=>{if(!t||e.defaultPrevented||e.nativeEvent.defaultPrevented||!(`touches`in e)&&e.button!==0)return;let n=ve(e);n&&(te.current=!0,ne.current=n,H.current=!1,re.current=!(`touches`in e),(!a||a(n,{nativeEvent:e.nativeEvent,direction:_}))&&Se(e,n)&&we())});function ke(e,n,r){if(!t||!ue.current)return;let i=uw(e.nativeEvent);if(ye(e)&&!H.current){let t=e.currentTarget;if(xe(i,t))return}if(`touches`in e||e.preventDefault(),ee.current&&(ee.current=!1,h)){N.current=n;let t=UL(e.timeStamp);t!==null&&(U.current=t)}let a=n.x,o=n.y,s=r.x,c=r.y;(c<0&&o>B.current.y||c>0&&o<B.current.y)&&(B.current={x:B.current.x,y:o}),(s<0&&a>B.current.x||s>0&&a<B.current.x)&&(B.current={x:a,y:B.current.y});let l=a-N.current.x,u=o-N.current.y,d=o-B.current.y,f=a-B.current.x,p=V.current;p===null&&C&&w&&Math.sqrt(l*l+u*u)>=LL&&(p=Math.abs(l)>Math.abs(u)?`horizontal`:`vertical`,V.current=p);let m;if(!L.current)p===`vertical`?u>0?m=`down`:u<0&&(m=`up`):p===`horizontal`?l>0?m=`right`:l<0&&(m=`left`):m=Math.abs(l)>=Math.abs(u)?l>0?`right`:`left`:u>0?`down`:`up`,m&&(m===`left`&&y||m===`right`&&b||m===`up`&&x||m===`down`&&S)&&(L.current=m,R.current=HL(m,l,u),O(m),pe(m));else{let e=L.current,t=HL(e,f,d);t>oe.current?(z.current=!1,O(e)):!(y&&b)&&!(x&&S)&&R.current-t>=IL&&(z.current=!0)}let g=Ee(l,u),v=I.current.x,T=I.current.y;p===`horizontal`?C&&(v+=g.x):(p===`vertical`||C&&(v+=g.x),w&&(T+=g.y));let E=P.current,D=v!==E.x||T!==E.y;P.current={x:v,y:T},D&&he(!0),ge({x:v,y:T},UL(e.timeStamp));let k=v-I.current.x,A=T-I.current.y,j={deltaX:k,deltaY:A,direction:L.current},M=0,F=_??L.current;if(F){let e=F===`left`||F===`right`?ie.current.width:ie.current.height,t=I.current.scale||1,n=HL(F,k,A);e>0&&t>0&&n>0&&(M=n/(e*t))}me(M,j)}let Ae=Q(e=>{if(!t)return;let i=P.current,a=I.current,o=i.x-a.x,s=i.y-a.y,c={deltaX:o,deltaY:s,direction:L.current};if(!ue.current){Ce(),me(0,c);return}fe(!1),V.current=null,Ce(),re.current=!1;let u=r.current;u&&(`touches`in e||KL(u,e.pointerId,`releasePointerCapture`));let d=o,f=s,m=U.current,h=UL(e.timeStamp),g=m!==null&&h!==null&&h>m?h-m:0,v=g>0?Math.max(g,RL):0,y=v>0?d/v:0,b=v>0?f/v:0,x=ce.current.x,S=ce.current.y,C=W.current;if(C&&h!==null&&h>=C.time){let e=h-C.time;if(e<=BL){let t=Math.max(e,zL),n=i.x-C.x,r=i.y-C.y,a=n/t,o=r/t;a!==0&&(x=a),o!==0&&(S=o)}else x=0,S=0}let w=p?.({event:e.nativeEvent,direction:L.current,deltaX:d,deltaY:f,velocityX:y,velocityY:b,releaseVelocityX:x,releaseVelocityY:S}),T=typeof w==`boolean`;if(z.current&&!T){P.current={x:a.x,y:a.y},O(void 0),he(!1),me(0,c);return}let E=!1,D;if(T)E=w,D=L.current??_;else for(let e of n)if(HL(e,d,f)>oe.current){E=!0,D=e;break}E&&D?(O(D),M(!0),he(!1),l?.(e.nativeEvent,{direction:D})):(P.current={x:a.x,y:a.y},O(void 0),he(!1),me(0,c))}),je=Q(e=>{let t=ve(e);if(!t)return;let n=!1;if(!(`touches`in e)){let t=GL(e.buttons);if(t&&(re.current=!0),e.buttons!==0&&!t){Te(e);return}if(e.buttons===0&&re.current){if(!ue.current){Ae(e);return}n=!0}}if(!k&&te.current){if(!ye(e)&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)){Ce();return}if(!a||a(t,{nativeEvent:e.nativeEvent,direction:_})){let n=ne.current,i=!1;if(ye(e)){let a=r.current;if(n&&a){let r=be(t,e.nativeEvent),o=IT(a).body,s=o?xe(r,o):null;if(s&&(X(a,s)||X(s,a))){let e=De(s,t.x-n.x,t.y-n.y);if(e===!1)return;e===!0&&(i=!0)}}}Se(e,t,{ignoreScrollableTarget:i,ignoreScrollableAncestors:i})&&(n&&i?(we(),N.current=n,B.current=n,F.current=n,ee.current=!1):(we(),H.current=!1))}}let i=F.current,o=i===null?{x:0,y:0}:{x:t.x-i.x,y:t.y-i.y};F.current=t,ke(e,t,o),n&&!(`touches`in e)&&Ae(e)}),Me=Q((e,t)=>{je({touches:e.touches,currentTarget:t,nativeEvent:e,defaultPrevented:e.defaultPrevented,timeStamp:e.timeStamp})}),Ne=T.useCallback(()=>{let e=ue.current,t=P.current,n=I.current,r=t.x-n.x,a=t.y-n.y;return!e&&r===0&&a===0&&!j?{[i.x]:`0px`,[i.y]:`0px`}:{transition:e?`none`:void 0,transform:e?WL(t,n.scale):void 0,[i.x]:`${r}px`,[i.y]:`${a}px`}},[j,i]);return{swiping:k,swipeDirection:D,dragDismissed:j,getPointerProps:T.useCallback(()=>t?{onPointerDown:Oe,onPointerMove:je,onPointerUp:Ae,onPointerCancel:Ae}:{},[t,Ae,je,Oe]),getTouchProps:T.useCallback(()=>t?{onTouchStart:Oe,onTouchMove:je,onTouchEnd:Ae,onTouchCancel:Ae}:{},[t,Ae,je,Oe]),moveNative:Me,getDragStyles:Ne,reset:_e}}var JL=VF,YL=`data-nested-dialog-open`,XL=T.createContext(void 0);function ZL(){return T.useContext(XL)}var QL=10,$L=.5,eR=.5,tR=300,nR=4,rR=.2,iR=4,aR=80,oR=360,sR=.1,cR=6,lR=2,uR=`[${eL}]`,dR=T.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=SF(),c=s.context.popupRef,l=s.context.backdropRef,{swipeDirection:u,notifyParentSwipingChange:d,notifyParentSwipeProgressChange:f,frontmostHeight:p,snapToSequentialPoints:m,swipeAreaActiveRef:h}=dL(),g=rL(),{snapPoints:_,resolvedSnapPoints:v,activeSnapPoint:y,activeSnapPointOffset:b,setActiveSnapPoint:x,popupHeight:S}=hL(),C=s.useState(`open`),w=s.useState(`mounted`),E=s.useState(`nested`),D=s.useState(`nestedOpenDrawerCount`),O=s.useState(`viewportElement`),k=s.useState(`popupElement`),A=g?.visualStateStore,j=D>0,M=u===`left`||u===`right`?`horizontal`:`vertical`,N=M===`vertical`,P=N?`horizontal`:`vertical`,[F,I]=T.useState(null),L=T.useRef(void 0),R=T.useRef(null),z=FT(),B=T.useRef(!1),V=T.useRef(!1),ee=T.useRef(``),te=T.useRef(!1),ne=T.useRef(!1),H=T.useRef(null),re=ZL(),ie=T.useMemo(()=>{if(!_||_.length<2||v.length<2||u!==`down`&&u!==`up`)return null;let e=v.map(e=>e.offset).sort((e,t)=>e-t),t=e[0];return{minOffset:t,range:e[1]-t}},[v,_,u]),ae=T.useMemo(()=>!ie||b===null?null:NM((b-ie.minOffset)/ie.range,0,1),[b,ie]),oe=T.useMemo(()=>_&&_.length>0&&(u===`down`||u===`up`)?u===`down`?[`down`,`up`]:[`up`,`down`]:[u],[_,u]),se=Q(e=>{c.current?.toggleAttribute(sL,e),l.current?.toggleAttribute(sL,e)}),U=Q(()=>{se(!1),c.current?.removeAttribute(vw),I(null)}),W=Q(()=>{V.current&&(V.current=!1,d?.(!1))}),ce=Q((e,t,n)=>{let r=C&&!E&&t,i=r?e:0,a=C&&t?e:0;n&&f&&(f(a),a<=0&&W()),A?.set({swipeProgress:i,frontmostHeight:i>0?p:0});let o=l.current;if(!o)return;let s=r&&i>0;o.style.setProperty(ZI,s?`${i}`:`0`),s&&p>0?o.style.setProperty(GI,`${p}px`):o.style.removeProperty(GI)});function le(e,t,n,r,i,a,o,s){let c=hR(e,t);if(c<=0)return null;let l=((t===`down`||t===`up`)&&_&&_.length>0?b??0:0)+HL(t,n,r),u=Math.max(0,c-l);if(u<=0)return null;let d=HL(t,o,s),f=Math.abs(d)>0?d:HL(t,i,a);return f<=rR?null:sR+(NM(u/NM(f,rR,iR),aR,oR)-aR)/280*.9}function ue(e){if(V.current||!e)return;let t=HL(e.direction??u,e.deltaX,e.deltaY);Math.abs(t)<QL||(V.current=!0,d?.(!0))}let de=qL({enabled:w&&!j,directions:oe,elementRef:s.context.popupRef,ignoreSelectorWhenTouch:!1,ignoreScrollableAncestors:!0,movementCssVars:{x:qI,y:JI},onSwipeStart(e){if(`touches`in e||e.pointerType===`touch`)return;let t=c.current,n=IT(t).getSelection?.();if(!n||n.isCollapsed)return;let r=UC(n.anchorNode)?n.anchorNode:n.anchorNode?.parentElement,i=UC(n.focusNode)?n.focusNode:n.focusNode?.parentElement;(X(t,r)||X(t,i))&&n.removeAllRanges()},onSwipingChange(e){B.current=e,fR(s.context.backdropRef.current,e),!e&&!f&&W()},swipeThreshold({element:e,direction:t}){return gR(e,t)},canStart(e,t){let n=s.context.popupRef.current;if(!n)return!1;let r=n.ownerDocument,i=NL(n.getRootNode(),e.x,e.y);if(!i||!X(n,i))return!1;let a=t.nativeEvent;return!((`touches`in a||a.pointerType===`touch`)&&bR(r,n))},onProgress(e,t){let n=B.current;n&&ue(t);let r=!!(_&&_.length>0);if(n&&u===`down`&&r&&t){let e=s.context.popupRef.current;e&&(e.style.removeProperty(`transform`),e.style.setProperty(JI,`${fL(b??0,t.deltaY)}px`))}let i=e;if(ie&&S>0){let e=b??ie.minOffset;n&&t&&Number.isFinite(t.deltaY)?i=(e=>NM((e-ie.minOffset)/ie.range,0,1))(NM(e+t.deltaY,0,S)):ae!==null&&(i=ae)}n||(f?.(0),W()),ce(i,!0,n)},onRelease({event:e,deltaX:t,deltaY:n,direction:r,velocityX:i,velocityY:a,releaseVelocityX:o,releaseVelocityY:c}){let l=s.context.popupRef.current;if(!l){U();return}let d=l;function f(e){W(),se(!0),d.style.removeProperty(`transition`),d.setAttribute(vw,``),XD.flushSync(()=>{I(le(d,e,t,n,i,a,o,c))})}if(!_||_.length===0){if(!r){U();return}let e=HL(r,t,n);if(e<=0)return U(),!1;if(HL(r,i,a)>=$L)return f(r),!0;let o=e>gR(d,r);return o?f(r):U(),o}if(u!==`down`&&u!==`up`){U();return}if(!S)return U(),!1;if(v.length===0){U();return}let p=u===`down`?n:-n,h=Math.sign(p),g=u===`down`?c:-c,C=u===`down`?a:-a,w=g;if(h!==0&&Math.abs(p)>=QL){let e=Math.sign(w);e!==0&&e!==h&&(w=C)}let T=b??0,E=NM(T+p,0,S),D=Math.abs(w)>=eR?NM(w,-4,nR)*tR:0,O=m?E:NM(E+D,0,S),k=pT(dT,e),A=()=>(ce(0,!0,!0),U(),!1),j=e=>(x(e.value,k),A()),M=e=>r?(x(null,k),k.isCanceled?A():(L.current=y,f(u),!0)):j(e);if(m){let e=[...v].sort((e,t)=>e.offset-t.offset),t=e.map(e=>e.offset),n=mL(t,T),r=e[mL(t,O)],i=Math.sign(w),a=h!==0&&i!==0&&i===h&&Math.abs(w)>=eR,o=O;if(a){let t=NM(n+h,0,e.length-1);if(t!==n){let n=e[t];(h>0?O<n.offset:O>n.offset)&&(r=n,o=n.offset)}else if(h>0)return M(r)}return Math.abs(o-S)<Math.abs(o-r.offset)?M(r):j(r)}let N=v[mL(v.map(e=>e.offset),O)];return w>=$L&&p>0||Math.abs(O-S)<Math.abs(O-N.offset)?M(N):j(N)},onDismiss(e){A?.set({swipeProgress:0,frontmostHeight:0});let t=s.context.backdropRef.current;t&&(t.style.setProperty(ZI,`0`),t.style.removeProperty(GI));let n=pT(dT,e);if(s.setOpen(!1,n),n.isCanceled){let t=L.current;t!==void 0&&x(t,pT(dT,e)),L.current=void 0,R.current?.(),U();return}if(s.select(`open`)){let t=e;z.request(()=>{if(s.select(`open`)){let e=L.current;e!==void 0&&x(e,pT(dT,t)),L.current=void 0,U(),R.current?.()}else L.current=void 0});return}L.current=void 0,se(!0)}}),fe=de.getPointerProps(),pe=de.getTouchProps(),{moveNative:me,reset:he}=de;R.current=he,T.useEffect(()=>{let e=O??k;if(!e)return;let t=e,n=IT(t);function r(e,r,i){let a=N?i.clientY-r.lastY:i.clientX-r.lastX;if(e.touches.length===2||bR(n,t)||!C||!w||j||wR(r,e,i,N))return;let o=r.scrollTarget;if(!o||o===n.documentElement||o===n.body){e.cancelable&&e.preventDefault(),e.stopPropagation(),me(e,t);return}if(!TR(o,M)){e.cancelable&&e.preventDefault(),e.stopPropagation();return}if(a!==0){let t=OR(o,M,u,a);r.allowSwipe?e.cancelable&&e.preventDefault():e.cancelable&&t?(r.allowSwipe=!0,e.preventDefault()):r.allowSwipe=!1}r.allowSwipe===!0&&(e.stopPropagation(),me(e,t))}function i(e){if(re?.onTouchMove(e),ne.current)return;let t=H.current,n=e.touches[0];n&&t&&(r(e,t,n),CR(t,n))}return _T(n,`touchmove`,i,{passive:!1,capture:!0})},[w,j,C,k,N,M,u,me,O,re]),Y(()=>{ie&&!de.swiping&&ce(!C||E?0:ae??0,!0,!1)},[ce,p,E,f,C,ae,ie,de.swiping,s,A]),Y(()=>{if(f)return C||f(0),()=>{f(0)}},[f,C]),Y(()=>{C&&(h.current||he(),U())},[U,C,he,h]),Y(()=>{let e=l.current;return()=>{A?.set({swipeProgress:0,frontmostHeight:0}),fR(e,!1);let t=l.current;t!==e&&fR(t,!1),W()}},[l,W,A]);let ge=T.useMemo(()=>({swiping:de.swiping,getDragStyles:de.getDragStyles,swipeStrength:F??null,setSwipeDismissed:se}),[se,de.getDragStyles,de.swiping,F]);function _e(e){ne.current=e,H.current=null}function ve(){_e(!1),ee.current=``,te.current=!1}function ye(e){return ee.current=``,e.pointerType!==`touch`}return(0,Z.jsx)(BF,{ref:t,className:r,style:i,render:n,...xD(o,{onPointerDown(e){if(ee.current=e.pointerType,te.current=e.pointerType===`pen`,!C||!w||j)return;let t=NL(e.currentTarget.getRootNode(),e.clientX,e.clientY);pR(t)||mR(t)||e.pointerType!==`touch`&&fe.onPointerDown?.(e)},onPointerMove(e){e.pointerType!==`touch`&&fe.onPointerMove?.(e)},onPointerUp(e){ye(e)&&fe.onPointerUp?.(e)},onPointerCancel(e){ye(e)&&fe.onPointerCancel?.(e)},onTouchStart(e){if(ee.current===`pen`&&te.current){te.current=!1,_e(!1);return}if(!C||!w||j){_e(!1);return}let t=e.touches[0];if(!t)return;if(SR(e)){_e(!1);return}let n=e.currentTarget,r=NL(n.getRootNode(),t.clientX,t.clientY),i=uw(e.nativeEvent),a=UC(i)?i:n;if(!X(n,a)){_e(!0);return}if(re?.onTouchStart(e),pR(r)){_e(!0);return}ne.current=!1;let o=ML(a,n,M),s=ML(a,n,P)!=null,c=null;o&&(c=DR(o,M,u)?null:!1),H.current={startX:t.clientX,startY:t.clientY,lastX:t.clientX,lastY:t.clientY,scrollTarget:o,hasCrossAxisScrollableContent:s,allowSwipe:c,preserveNativeCrossAxisScroll:!1,drawerAxisAttributed:!1},pe.onTouchStart?.(e)},onTouchEnd(e){re?.onTouchEnd(e),ve(),pe.onTouchEnd?.(e)},onTouchCancel(e){re?.onTouchCancel(),ve(),pe.onTouchCancel?.(e)},[YL]:void 0}),children:(0,Z.jsx)(gL.Provider,{value:ge,children:a})})});function fR(e,t){e?.toggleAttribute(lL,t)}function pR(e){return!!e?.closest(KD)}function mR(e){return!!e?.closest(uR)}function hR(e,t){return t===`left`||t===`right`?e.offsetWidth:e.offsetHeight}function gR(e,t){return Math.max(hR(e,t)*.5,QL)}function _R(e,t){return e instanceof t.HTMLInputElement&&e.type===`range`}function vR(e){return e.tagName===`INPUT`||e.tagName===`TEXTAREA`}function yR(e,t){let n=UC(e.anchorNode)?e.anchorNode:e.anchorNode?.parentElement,r=UC(e.focusNode)?e.focusNode:e.focusNode?.parentElement;return e.containsNode(t,!0)||X(t,n)||X(t,r)}function bR(e,t){let n=lw(e);if(n&&X(t,n)&&vR(n)){let{selectionStart:e,selectionEnd:t}=n;if(e!=null&&t!=null&&e<t)return!0}let r=e.getSelection?.();return!r||r.isCollapsed?!1:yR(r,t)}function xR(e,t){return e.composedPath().some(e=>_R(e,t))}function SR(e){return xR(e.nativeEvent,BC(e.currentTarget))}function CR(e,t){e.lastX=t.clientX,e.lastY=t.clientY}function wR(e,t,n,r){if(e.preserveNativeCrossAxisScroll)return!0;if(e.drawerAxisAttributed||e.allowSwipe===!0||!e.hasCrossAxisScrollableContent)return!1;if(!t.cancelable)return e.preserveNativeCrossAxisScroll=!0,!0;let i=r?n.clientY-e.startY:n.clientX-e.startX,a=r?n.clientX-e.startX:n.clientY-e.startY,o=Math.abs(i),s=Math.abs(a);return s>=cR&&s>o+lR?(e.preserveNativeCrossAxisScroll=!0,!0):o>=cR?(e.drawerAxisAttributed=!0,!1):!0}function TR(e,t){return ER(e,t).max>0}function ER(e,t){if(t===`vertical`){let t=Math.max(0,e.scrollHeight-e.clientHeight);return{offset:e.scrollTop,max:t}}let n=Math.max(0,e.scrollWidth-e.clientWidth);return{offset:e.scrollLeft,max:n}}function DR(e,t,n){let r=kR(n,t),{offset:i,max:a}=ER(e,t);return r?i<=0:i>=a}function OR(e,t,n,r){return(kR(n,t)?r>0:r<0)&&DR(e,t,n)}function kR(e,t){return t===`vertical`?e===`down`:e===`right`}var AR=T.createContext(void 0);function jR(e){let t=T.useContext(AR);if(t===void 0&&!e)throw Error(dC(47));return t}var MR={...yA,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},NR=class extends Uk{constructor(e,t,n){let r=new fA;super(PR(e,r,t,n),FR(r),MR)}setOpen=(e,t)=>{let n=t.reason===Qw,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=aA(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=iA(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),XD.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function PR(e,t,n,r=!1){let i={...pA(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function FR(e){return{popupRef:T.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:T.createRef(),beforeContentFocusGuardRef:T.createRef(),stickIfOpenTimeout:new gC,triggerElements:e}}var IR=iC(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=RR(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),dA(u,d),cA(u);let{forceUnmount:m}=lA(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o}),T.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),T.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,pT(uT))}),[m,u]);let h=d||f;return(0,Z.jsxs)(AR.Provider,{value:u,children:[s&&(0,Z.jsx)(tA,{handle:s,store:u}),h&&(0,Z.jsx)(zR,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function LR(e){return jR(!0)?(0,Z.jsx)(IR,{props:e}):(0,Z.jsx)(uO,{children:(0,Z.jsx)(IR,{props:e})})}function RR(e,t){let n=eA((e,n)=>new NR(t,e,n));return T.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function zR({store:e,modal:t}){let n=DO(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return uA(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var BR=aC(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=jR(!0),h=bA(s)??m;if(!h)throw Error(dC(74));let g=rj(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=T.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=sA(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),w=h.useState(`openChangeReason`),E=h.useState(`stickIfOpen`),D=h.useState(`openMethod`),O=h.useState(`focusManagerModal`),k=NA(v,{enabled:!a&&l&&(D!==`touch`||w!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:XA(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),A=xO(v,{stickIfOpen:E}),j=jM(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),M=h.useState(`triggerProps`,C),{getButtonProps:N,buttonRef:P}=GM({disabled:a,native:o}),F={open(e){return e&&w===`trigger-press`?Nw.open(e):Mw.open(e)}},{preFocusGuardRef:I,handlePreFocusGuardFocus:L,handleFocusTargetFocus:R}=zI(h,x),z=FD(`button`,e,{state:{disabled:a,open:y},ref:[P,t,S,x],props:[A.reference,k,M,j,{[UD]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,N],stateAttributesMapping:F}),B=(0,Z.jsx)(T.Fragment,{children:z},g);return C&&!O?(0,Z.jsxs)(T.Fragment,{children:[(0,Z.jsx)(BT,{ref:I,onFocus:L}),B,(0,Z.jsx)(BT,{ref:h.context.triggerFocusTargetRef,onFocus:R})]}):B}),VR=T.createContext(void 0);function HR(){let e=T.useContext(VR);if(e===void 0)throw Error(dC(45));return e}var UR=T.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return jR().useState(`mounted`)||n?(0,Z.jsx)(VR.Provider,{value:n,children:(0,Z.jsx)(tO,{ref:t,...r})}):null}),WR=T.createContext(void 0);function GR(){let e=T.useContext(WR);if(!e)throw Error(dC(46));return e}var KR=T.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=JD,..._}=e,v=jR(),y=HR(),b=cO(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),E=v.useState(`activeTriggerElement`),D=v.useState(`modal`),O=v.useState(`openMethod`),k=v.useState(`positionerElement`),A=v.useState(`instantType`),j=v.useState(`transitionStatus`),M=v.useState(`adaptiveOrigin`),N=T.useRef(null),P=Xk(k),F=jj({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:M}),I=x.useState(`domReferenceElement`);Y(()=>{let e=I,t=N.current;if(e&&(N.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return P(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[I,P,v]);let L=D===!0&&w!==`trigger-hover`;DN(C&&L,O===`touch`,k,E);let R=v.useStateSetter(`positionerElement`),z=Fj(e,{open:C,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:A},{styles:F.positionerStyles,transitionStatus:j,props:_,refs:[t,R],hidden:!S,inert:!C});return(0,Z.jsxs)(WR.Provider,{value:F,children:[S&&L&&(0,Z.jsx)(fN,{inert:Rj(!C),cutout:E}),(0,Z.jsx)(lO,{id:b,children:z})]})}),qR=T.createContext(void 0);function JR(){let[e,t]=T.useState(0),n=Q(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:T.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var YR=T.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=jR(),l=GR(),u=NN(!0)!=null,{context:d,hasClosePart:f}=JR(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);Zk({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),jA(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?$k(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=FD(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...Qk,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&RN.has(e.key)&&e.stopPropagation()}},Pj(g),s],stateAttributesMapping:Fw});return(0,Z.jsx)(bO,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:WC(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,Z.jsx)(qR.Provider,{value:d,children:M})})}),XR=(0,T.createContext)(null);function ZR(){let e=(0,T.useContext)(XR);if(e===null)throw Error(`useEditorBundle must be used within an EditorProvider`);return e}function $(e){return ty(ZR().store,e)}function QR(){return ZR().store}var $R=e=>`${e.fileName}:${e.lineNumber}:${e.columnNumber}`,ez=e=>e.occurrences>1?`${e.tag} ${e.occurrence} of ${e.occurrences}`:e.tag,tz=(e,t)=>{let n=e.origins[0];if(n===void 0)return ez(e);let r=t.split(`
29
+ `)[n.lineNumber-1];return r===void 0?ez(e):r.slice(Math.max(0,n.columnNumber-1)).match(/<([A-Za-z][A-Za-z0-9_.:-]*)/)?.[1]??ez(e)},nz=(e,t)=>{let n=t.slice(e.start,e.end).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,` `).replace(/<[^>]+>/g,` `).replace(/&nbsp;/gi,` `).replace(/&amp;/gi,`&`).replace(/&lt;/gi,`<`).replace(/&gt;/gi,`>`).replace(/&quot;/gi,`"`).replace(/&#39;/gi,`'`).replace(/\s+/g,` `).trim();if(n!==``)return n.length>72?`${n.slice(0,69).trimEnd()}…`:n},rz=e=>{let t=[],n=(e,r)=>{t.push({depth:r,node:e});for(let t of e.children)n(t,r+1)};for(let t of e.roots)n(t,0);return t},iz=e=>{let t=VS(e),n=new Map,r=new Map,i=[];for(let t of e){let e=[];n.set(t.instancePath,e);let a={instancePath:t.instancePath,selection:t,children:e};r.set(t.instancePath,a);let o=t.parentPath===void 0?void 0:n.get(t.parentPath);o===void 0?i.push(a):o.push(a)}return{roots:i,index:t,nodes:r}},az=(e,t)=>{let n=[],r=e.index.get(t)?.parentPath;for(;r!==void 0;)n.unshift(r),r=e.index.get(r)?.parentPath;return n},oz=(e,t)=>[...az(e,t),t].flatMap(t=>{let n=e.index.get(t);return n===void 0?[]:[{instancePath:t,label:ez(n)}]}),sz=e=>{let t=new Set;if(e===null)return t;for(let n of e.roots){t.add(n.instancePath);for(let e of n.children)e.children.length>0&&t.add(e.instancePath)}return t},cz={kind:`document`},lz={kind:`envelope`},uz=e=>new TextEncoder().encode(e).length,dz=e=>Math.max(1,Math.round(e/1024)),fz=(e,t)=>e.channel===`email`?e.render===null?0:dz(uz(e.render.html)):t===null||!t.ok?0:dz(uz(t.artifact.channel===`sms`?t.artifact.body:JSON.stringify(t.artifact))),pz=(e,t)=>{let n=e.channel===`email`?null:bv(e.source);return{compiled:n,outline:e.channel===`email`&&e.render!==null?iz(e.render.selections):null,sizeKb:fz(e,n),checks:Ez(e,n,t)}},mz=(e,t)=>e.origins.length===t.origins.length&&e.origins.every((e,n)=>{let r=t.origins[n];return r!==void 0&&r.fileName===e.fileName&&r.lineNumber===e.lineNumber&&r.columnNumber===e.columnNumber}),hz=(e,t)=>e.tag===t.tag&&e.authored===t.authored&&e.occurrence===t.occurrence&&e.occurrences===t.occurrences&&mz(e,t),gz=(e,t,n)=>{if(e.kind!==`element`)return e;if(t===null||t.channel!==`email`)return cz;let{render:r,fixture:i}=t;if(r===null||i===null)return cz;let a=r.selections.find(t=>t.instancePath===e.instancePath);if(a===void 0)return cz;if(e.revision===r.revision&&e.fixture===i)return e;let o=n?.index.get(e.instancePath);return o===void 0||!hz(o,a)?cz:{kind:`element`,instancePath:e.instancePath,revision:r.revision,fixture:i}},_z=(e,t,n)=>{let r=t.authoredSource!==void 0&&(n===null||n===t.authoredSource)?t.authoredSource:e.origin.authoredSource,i={...e.origin,authoredSource:r};if(t.channel===`email`){if(e.channel!==`email`)throw Error(`Host sent an email change for a ${e.channel} document`);return{...e,rev:t.rev,origin:i,fixtures:t.fixtures,fixture:t.fixture,preview:t.preview,render:t.render,diagnostics:t.diagnostics,incompatibilities:t.incompatibilities}}if(e.channel===`email`)throw Error(`Host sent a ${t.channel} change for an email document`);return{...e,rev:t.rev,origin:i,channel:t.channel,source:t.source}},vz=104448,yz=e=>e.severity===`error`?`error`:e.severity===`warning`?`warn`:`info`,bz=e=>e===`caniemail/system-ui-ui-serif-ui-sans-serif-ui-rounded-ui-monospace`?`System fonts`:e===`caniemail/media`?`Media queries`:e===`caniemail/color-scheme-meta-tag`?`Color scheme metadata`:e.startsWith(`caniemail/`)?e.slice(10).replace(/-property$/,``).replace(/-attribute$/,` attribute`).replace(/-element$/,` element`):e.replaceAll(`-`,` `),xz=(e,t)=>{let n=new Map;for(let t of e){let e=n.get(t.code)??new Map,r=JSON.stringify([t.severity,t.compatibility?.assessment,t.compatibility?.title,t.message,[...t.clients??[]].sort(),t.notes,t.provenance]),i=e.get(r),a=new Map;for(let e of i===void 0?[t]:[i,t])for(let t of e.occurrences??[e.origins])t.length>0&&a.set(JSON.stringify(t),t);e.set(r,{...t,origins:i?.origins??t.origins,fixtures:[...new Set([...i?.fixtures??[],...t.fixtures??[]])].sort(),occurrences:[...a.values()]}),n.set(t.code,e)}return[...n].map(([e,n])=>Sz(`${t}:${e}`,[...n.values()]))},Sz=(e,t)=>{let n=e=>e.compatibility?.assessment===`unverified`?0:e.compatibility?.assessment===`degradation`?1:2,r=[...t].sort((e,t)=>n(e)-n(t)),i=r.find(e=>e.severity===`error`)??r.find(e=>e.severity===`warning`)??r[0],a=new Set(r.flatMap(e=>e.fixtures??[])),o=new Set(r.flatMap(e=>e.clients??[]));return{id:e,severity:yz(i),label:i.compatibility?.title??bz(i.code),detail:[`${r.length} finding${r.length===1?``:`s`}`,...o.size===0?[]:[`${o.size} client${o.size===1?``:`s`}`],...a.size===0?[]:[`${a.size} fixture${a.size===1?``:`s`}`]].join(` · `),diagnostics:r}},Cz=(e,t)=>e.ok?e.artifact.channel===t?e.artifact.warnings.map((e,t)=>({id:`compile:warning:${e.code}:${t}`,severity:`warn`,label:e.code,detail:e.message})):[{id:`compile:channel-mismatch`,severity:`error`,label:`Channel mismatch`,detail:`This ${t} document compiled as ${e.artifact.channel}. Use a ${t} root element.`}]:[{id:`compile:error`,severity:`error`,label:`Compile failed`,detail:e.message}],wz=e=>{let t=YS(e.html);return t<=vz?{id:`size:gmail-clip`,severity:`ok`,label:`Gmail clipping`,detail:`Worst-case HTML is ${Math.ceil(t/1024)} KB, under Gmail's 102 KB clipping threshold.`}:{id:`size:gmail-clip`,severity:`warn`,label:`Gmail clipping risk`,detail:`Worst-case HTML is ${Math.ceil(t/1024)} KB, above Gmail's 102 KB clipping threshold.`}},Tz={id:`build:no-render`,severity:`error`,label:`No render`,detail:`The template entry did not produce a render at this revision.`},Ez=(e,t,n)=>{if(e.channel===`email`){let t=[...xz(e.diagnostics,`diagnostic`),...xz(e.incompatibilities,`compat`)];return e.render===null?[...t.length===0?[Tz]:t,...n]:[...t,wz(e.render),...n]}return[...t===null?[]:Cz(t,e.channel),...n]},Dz=e=>{let t=[],n=[],r=[],i=[];for(let a of e)a.severity===`error`?t.push(a):a.severity===`warn`?n.push(a):a.severity===`info`?r.push(a):i.push(a);return{actionable:[...t,...n],info:r,ok:i,errorCount:t.length,warnCount:n.length,badgeCount:t.length+n.length}},Oz=e=>Ue(e,`_tag`)&&e._tag===`DocumentUnavailable`&&Ue(e,`reason`)&&typeof e.reason==`string`,kz=e=>Oz(e)?e.reason:e instanceof Error?e.message:`The document session failed.`,Az=(e,t)=>{let n=``,r=[],i=!1,a,o=!1,s=!1,c,l=[],u=0,d=()=>{let e=l;l=[];for(let t of e)t.resolve(n)},f=e=>{let t=l;l=[];for(let n of t)n.reject(e)},p=()=>{if(a!==void 0&&(clearTimeout(a),a=void 0),e.access!==`editable`)return;let s=e.writer;if(i)return;i=!0;let c=u;(async()=>{for(;r.length>0&&!o;){let e=r[0],a={kind:`authoredSource`,baseRev:n,authoredSource:e.authoredSource};try{let e=await s.save(a);if(u!==c)return;n=e.rev,t.onPersistedRevision(n),r.shift(),t.onStorageError(null)}catch(e){if(u!==c)return;if(Oz(e)){t.onStorageError(e.reason),i=!1,f(e);return}r=[],o=!0,t.onConflict();break}}u===c&&(i=!1,d())})()},m=()=>{u+=1,i=!1,s=!1;let a=u,l=!1,d=[],f=e=>{if(u!==a)return;if(e.origin===`self`){t.onSelfAck(e);return}let i=r.length>0;i&&(o=!0),n=e.rev,t.onForeignChange(e,i)};e.document.open(e=>{l?f(e):d.push(e)},e=>{u===a&&(s=!1,t.onSessionError(kz(e)))}).then(({initial:e,close:i})=>{if(u!==a){i();return}c=i,l=!0,s=!0,n=e.rev,t.onInitial(e);for(let e of d)f(e);d.length=0,r.length>0&&p()}).catch(e=>{u===a&&t.onSessionError(kz(e))})};return{open:m,dispose:()=>{u+=1,a!==void 0&&clearTimeout(a),a=void 0,s=!1,c?.(),c=void 0},reload:()=>{o=!1,r=[],i=!1,a!==void 0&&clearTimeout(a),a=void 0,d(),c?.(),c=void 0,m()},enqueueAuthoredSource:(t,n)=>{if(e.access!==`editable`)return;let o={kind:`authoredSource`,authoredSource:t,coalesceKey:n?.coalesceKey},s=r.length-1,c=r[s],l=s>=+!!i;o.coalesceKey!==void 0&&l&&c?.kind===`authoredSource`&&c.coalesceKey===o.coalesceKey?r[s]=o:r.push(o),a!==void 0&&clearTimeout(a),a=setTimeout(p,300)},flushSaves:()=>(a!==void 0&&p(),r.length===0&&!i?Promise.resolve(n):new Promise((e,t)=>{l.push({resolve:e,reject:t})})),retrySave:()=>{if(e.access===`editable`){if(t.onStorageError(null),!s){c?.(),c=void 0,m();return}p()}},adoptRev:e=>{n=e,o=!1}}},jz={desktop:600,mobile:375},Mz=`samva.editor.leftWidth`,Nz=`samva.editor.assistantWidth`,Pz=`samva.editor.rightWidth`,Fz=260,Iz=360,Lz=320,Rz=200,zz=420,Bz=300,Vz=520,Hz=260,Uz=440,Wz=(e,t)=>{try{let n=localStorage.getItem(e);if(n===null)return t;let r=Number(n);return Number.isFinite(r)?r:t}catch{return t}},Gz=(e,t)=>{try{localStorage.setItem(e,String(t))}catch{}},Kz=e=>e!==null&&e.channel===`email`?e.render:null,qz=(e,t)=>{let n,r=t=>e.access!==`editable`||t.doc?.access.kind===`readonly`||t.lifecycleBusy,i=t=>t!==null&&e.access===`editable`&&e.sourceAccess===`editable`&&t.access.kind!==`readonly`,a=(e,t,n)=>{let r=pz(t,e.hostChecks),i=!e.layersSeeded&&r.outline!==null;return{doc:t,pendingAuthoredSource:n,...r,render:Kz(t),expandedLayers:i?sz(r.outline):e.expandedLayers,layersSeeded:e.layersSeeded||i,selection:gz(e.selection,t,e.outline)}},o=$v((o,s)=>{let c=(e,t)=>{let r=s();r.doc!==null&&(o({doc:{...r.doc,origin:{...r.doc.origin,authoredSource:e}},pendingAuthoredSource:e,sourceEditError:null}),n.enqueueAuthoredSource(e,{coalesceKey:t?.coalesceKey??`authored-source`}))},l=e=>{let t=s();if(r(t)||!t.sourceEditable||t.conflict||t.doc===null)return;let n=e===`undo`?t.undoHistory:t.redoHistory,i=n.at(-1);if(i!==void 0){if(t.doc.origin.authoredSource!==(e===`undo`?i.after:i.before)){o({sourceEditError:`History conflicts with a newer change. Your current work is kept. Review the saved versions.`});return}o(e===`undo`?{undoHistory:n.slice(0,-1),redoHistory:[...t.redoHistory,i]}:{redoHistory:n.slice(0,-1),undoHistory:[...t.undoHistory,i]}),c(e===`undo`?i.before:i.after)}};return{sourceEditError:null,agentOriginIndex:0,undoHistory:[],redoHistory:[],workspaceView:`visual`,doc:null,pendingAuthoredSource:null,editable:e.access===`editable`,sourceEditable:e.access===`editable`&&e.sourceAccess===`editable`,metadataEditable:e.access===`editable`&&e.metadataAccess!==`readonly`,readonlyReason:null,render:null,outline:null,compiled:null,sizeKb:0,checks:t.hostChecks,hostChecks:t.hostChecks,sendCapability:e.send,lifecycleCapability:e.lifecycle,assetsCapability:e.assets,fixtureCapability:e.fixtures,fixtureBusy:!1,fixtureError:null,diagnosticAssistance:null,selection:cz,renameActive:!1,expandedLayers:new Set,layersSeeded:!1,leftCollapsed:!1,rightCollapsed:!1,rightMode:`agent`,designView:`layers`,focusedPane:`assistant`,leftWidth:Wz(Mz,Fz),assistantWidth:Math.min(Vz,Math.max(Bz,Wz(Nz,Iz))),rightWidth:Wz(Pz,Lz),previewDevice:`desktop`,canvasZoom:`100`,layoutMode:`wide`,metadataSaving:!1,metadataError:null,lifecycleBusy:!1,conflict:!1,storageError:null,hoveredCandidatePath:null,actions:{requestSourceAssistance:e=>o({agentOriginIndex:e,rightMode:`agent`,rightCollapsed:!1}),requestDiagnosticAssistance:e=>{let t=s();t.doc===null||r(t)||t.pendingAuthoredSource!==null||t.conflict||o({diagnosticAssistance:{id:(t.diagnosticAssistance?.id??0)+1,revision:t.doc.rev,check:e},rightMode:`agent`,rightCollapsed:!1})},openSource:()=>o({workspaceView:`source`}),undo:()=>l(`undo`),redo:()=>l(`redo`),applySourceEdit:e=>{let t=s();if(r(t)||!t.sourceEditable||t.conflict||t.doc===null)return;if(t.doc.rev!==e.revision||t.doc.origin.authoredSource!==e.source||t.pendingAuthoredSource!==null){o({sourceEditError:`That edit is stale. The preview moved on. Reselect the element and try again.`});return}let n=NS(e.source,e.edits);if(!n.ok){o({sourceEditError:n.reason});return}n.source!==e.source&&(o({undoHistory:[...t.undoHistory,{before:e.source,after:n.source}],redoHistory:[]}),c(n.source))},replaceAuthoredSource:e=>{let t=s();r(t)||!t.sourceEditable||t.doc===null||e===t.doc.origin.authoredSource||t.conflict||(o({undoHistory:[...t.undoHistory,{before:t.doc.origin.authoredSource,after:e}],redoHistory:[]}),c(e))},replaceSource:(e,t)=>{let n=s();if(r(n)||!n.sourceEditable||n.conflict||n.doc===null||n.doc.channel===`email`||e===n.doc.source)return;let i={...n.doc,source:e};o(a(n,i,e)),c(e,{coalesceKey:t?.coalesceKey})},viewFixture:e=>{let t=s(),n=t.fixtureCapability;n?.status===`ready`&&t.doc?.channel===`email`&&!t.fixtureBusy&&t.doc.fixtures.includes(e)&&t.doc.fixture!==e&&(o({fixtureBusy:!0,fixtureError:null}),n.api.view(e).then(()=>o({fixtureBusy:!1}),()=>o({fixtureBusy:!1,fixtureError:`Couldn't render the ${e} fixture.`})))},reload:()=>{s().lifecycleBusy||(o({conflict:!1,storageError:null,fixtureError:null}),n.reload())},flushSaves:()=>n.flushSaves(),beginLifecycle:()=>{let t=s();return t.lifecycleBusy||t.doc===null||e.access!==`editable`||t.doc.access.kind===`readonly`?!1:(o({lifecycleBusy:!0}),!0)},endLifecycle:()=>o({lifecycleBusy:!1}),adoptLifecycleSnapshot:e=>{n.adoptRev(e.rev),o(t=>{if(t.doc===null)return{conflict:!1};let n={...t.doc,rev:e.rev,origin:{...t.doc.origin,authoredSource:e.authoredSource}};return{...a(t,n,null),sourceEditable:i(n),conflict:!1}})},retrySave:()=>{r(s())||n.retrySave()},select:e=>o(t=>{if(e===null)return{selection:cz};let{render:n,doc:r}=t;if(n===null||r?.channel!==`email`||r.fixture===null||!n.selections.some(t=>t.instancePath===e))return{selection:cz};let i=new Set(t.expandedLayers);if(t.outline!==null)for(let n of az(t.outline,e))i.add(n);return{agentOriginIndex:0,selection:{kind:`element`,instancePath:e,revision:n.revision,fixture:r.fixture},expandedLayers:i}}),selectDocument:()=>o({selection:cz}),selectEnvelope:()=>o({selection:lz}),toggleLeft:()=>o(e=>({leftCollapsed:!e.leftCollapsed})),toggleRight:()=>o(e=>({rightCollapsed:!e.rightCollapsed})),setRightMode:e=>o({rightMode:e}),openAgentPanel:()=>o({rightMode:`agent`,rightCollapsed:!1}),setDesignView:e=>{s().designView!==e&&o({designView:e})},setFocusedPane:e=>{s().focusedPane!==e&&o({focusedPane:e})},openReview:()=>o(e=>({designView:`review`,focusedPane:e.layoutMode===`narrow`?`assistant`:`design`})),setWorkspaceView:e=>o({workspaceView:e}),setLeftWidth:e=>{let t=Math.min(zz,Math.max(Rz,Math.round(e)));Gz(Mz,t),o({leftWidth:t})},setAssistantWidth:e=>{let t=Math.min(Vz,Math.max(Bz,Math.round(e)));Gz(Nz,t),o({assistantWidth:t})},setRightWidth:e=>{let t=Math.min(Uz,Math.max(Hz,Math.round(e)));Gz(Pz,t),o({rightWidth:t})},setPreviewDevice:e=>o({previewDevice:e}),setCanvasZoom:e=>o({canvasZoom:e}),setLayoutMode:e=>{if(s().layoutMode!==e){if(e===`wide`){o({layoutMode:e,leftCollapsed:!1,rightCollapsed:!1,canvasZoom:`100`});return}if(e===`standard`){o({layoutMode:e,leftCollapsed:!1,rightCollapsed:!0,canvasZoom:`fit`});return}o({layoutMode:e,leftCollapsed:!0,rightCollapsed:!0,canvasZoom:`fit`})}},setRenameActive:e=>o({renameActive:e}),rename:t=>{let n=s();if(r(n)||e.access!==`editable`||e.metadataAccess===`readonly`)return;let i=e.writer,a=n.doc;if(a===null)return;let c=t.trim()||`Untitled template`;c!==a.name&&(o(e=>e.doc===null?e:{doc:{...e.doc,name:c},metadataSaving:!0,metadataError:null}),i.save({kind:`metadata`,patch:{name:c}}).then(()=>o({metadataSaving:!1}),()=>{o(e=>({doc:e.doc===null?e.doc:{...e.doc,name:a.name},metadataSaving:!1,metadataError:`Couldn't save the template name.`}))}))},saveMetadata:t=>{let n=s();if(r(n)||e.access!==`editable`||e.metadataAccess===`readonly`)return;let i=e.writer,a=n.doc;a!==null&&(o(e=>e.doc===null?e:{doc:{...e.doc,metadata:{fromDefault:t.fromDefault===void 0?e.doc.metadata.fromDefault:t.fromDefault??void 0,replyToDefault:t.replyToDefault===void 0?e.doc.metadata.replyToDefault:t.replyToDefault??void 0}},metadataSaving:!0,metadataError:null}),i.save({kind:`metadata`,patch:t}).then(()=>o({metadataSaving:!1}),()=>{o(e=>({doc:e.doc===null?e.doc:{...e.doc,metadata:a.metadata},metadataSaving:!1,metadataError:`Couldn't save the sender defaults.`}))}))},toggleLayerExpand:e=>o(t=>{let n=new Set(t.expandedLayers);return n.has(e)?n.delete(e):n.add(e),{expandedLayers:n}}),ancestryOf:e=>{let{outline:t}=s();return t===null?[]:az(t,e)},breadcrumbOf:e=>{let{outline:t}=s();return t===null?[]:oz(t,e)},setHovered:e=>o({hoveredCandidatePath:e}),setHostChecks:e=>{Object.is(s().hostChecks,e)||o(t=>({hostChecks:e,checks:t.doc===null?e:Ez(t.doc,t.compiled,e)}))}}}}),s=(e,t)=>{o.setState(n=>{if(n.doc===null)return n;let r=t?n.pendingAuthoredSource:null,i=_z(n.doc,e,r),o=e.authoredSource!==void 0&&e.authoredSource===i.origin.authoredSource;return a(n,i,o?null:r)})};return n=Az(e,{onInitial:t=>{o.setState(n=>({...a(n,t,null),editable:e.access===`editable`&&t.access.kind!==`readonly`,sourceEditable:i(t),readonlyReason:t.access.kind===`readonly`?t.access.reason:null}))},onPersistedRevision:e=>{o.setState(t=>t.doc===null?t:{doc:{...t.doc,rev:e}})},onSelfAck:e=>s(e,!0),onForeignChange:(e,t)=>{if(t){o.setState(t=>t.doc===null?t:{doc:{...t.doc,rev:e.rev},sourceEditable:!1,conflict:!0});return}s(e,!1),o.setState(e=>({sourceEditable:i(e.doc)}))},onConflict:()=>o.setState({conflict:!0,sourceEditable:!1}),onStorageError:e=>o.setState({storageError:e}),onSessionError:e=>o.setState({storageError:e})}),{host:e,store:o,spine:n}},Jz=[];function Yz({host:e,checks:t=Jz,children:n}){let[r,i]=(0,T.useState)(()=>qz(e,{hostChecks:t}));return r.host!==e&&i(qz(e,{hostChecks:t})),(0,T.useEffect)(()=>(r.spine.open(),()=>r.spine.dispose()),[r]),(0,T.useEffect)(()=>{r.store.getState().actions.setHostChecks(t)},[r,t]),(0,Z.jsx)(XR.Provider,{value:r,children:n})}var Xz=(0,T.createContext)(void 0);function Zz({container:e,children:t}){return(0,Z.jsx)(Xz,{value:e,children:t})}var Qz=()=>(0,T.useContext)(Xz),$z=(0,T.createContext)(null),eB=$z.Provider;function tB(){return(0,T.useContext)($z)}function nB(){return(0,T.useContext)($z)!==null}var rB=(0,T.createContext)(null),iB=rB.Provider;function aB(){return(0,T.useContext)(rB)}var oB=(0,T.createContext)(null),sB=oB.Provider;function cB(){return(0,T.useContext)(oB)}var lB=(0,T.createContext)(null),uB=lB.Provider;function dB(){return(0,T.useContext)(lB)}function fB(...e){return IP(e)}var pB=`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,mB=fB(`inline-flex items-center justify-center gap-1.5 rounded-[7px] font-medium transition-all outline-none disabled:pointer-events-none disabled:opacity-50`,jP,pB);function hB({name:e,className:t}){return(0,Z.jsx)(`span`,{className:fB(`inline-flex items-baseline rounded-md bg-accent-teal/20 px-1.5 py-px font-mono text-[0.82em] font-medium text-foreground ring-1 ring-inset ring-accent-teal/20`,t),children:`{{${e}}}`})}function gB({children:e}){return(0,Z.jsx)(`div`,{className:`text-muted-foreground mb-2 flex items-center justify-between text-[10.5px] font-semibold tracking-[0.06em] uppercase`,children:e})}function _B({children:e,className:t,title:n,help:r=n,pressed:i,onClick:a,disabled:o,testId:s}){let c=Qz();return(0,Z.jsxs)(tj,{disabled:o,children:[(0,Z.jsx)(lj,{render:(0,Z.jsx)(`button`,{type:`button`,"aria-label":n,"aria-pressed":i,disabled:o,"data-testid":s,onClick:a,className:fB(`inline-flex h-7.5 items-center gap-1.5 rounded-[7px] px-2.5 text-muted-foreground outline-none transition-all hover:bg-muted hover:text-foreground active:translate-y-px disabled:opacity-40`,NP,`aria-pressed:text-accent-foreground`,pB,t)}),children:e}),(0,Z.jsx)(pj,{container:c,children:(0,Z.jsx)(Ij,{side:`bottom`,sideOffset:5,className:`z-[200]`,children:(0,Z.jsx)(Lj,{role:`tooltip`,className:`bg-foreground text-background rounded-md px-2 py-1 text-[11px] shadow-[var(--shadow-md)]`,children:r})})})]})}var vB=fB(`inline-flex items-center justify-center gap-1.5 rounded-md border border-transparent font-medium whitespace-nowrap text-muted-foreground outline-none`,`hover:bg-muted hover:text-foreground`,`transition-[color,background-color,border-color,box-shadow] duration-150 ease-out`,pB,PP);function yB({ariaLabel:e,options:t,value:n,onChange:r,size:i=`md`,testId:a}){let o=Qz();return(0,Z.jsx)(AP,{"aria-label":e,value:[n],"data-testid":a,onValueChange:e=>{let t=e[0];t!==void 0&&r(t)},className:fB(`bg-muted inline-flex gap-0.5 rounded-lg p-0.5`,i===`sm`&&`rounded-[7px]`),children:t.map(e=>{let t=(0,Z.jsx)(CP,{type:`button`,"aria-label":e.title,"data-testid":e.testId,value:e.value,className:fB(vB,i===`sm`?`h-6 px-2 text-xs`:`h-7 px-2.5 text-xs`),children:e.label},e.value);return e.title===void 0?t:(0,Z.jsxs)(tj,{children:[(0,Z.jsx)(lj,{render:t}),(0,Z.jsx)(pj,{container:o,children:(0,Z.jsx)(Ij,{side:`bottom`,sideOffset:5,className:`z-[200]`,children:(0,Z.jsx)(Lj,{role:`tooltip`,className:`bg-foreground text-background rounded-md px-2 py-1 text-[11px] shadow-[var(--shadow-md)]`,children:e.title})})})]},e.value)})})}function bB({children:e,className:t,overridden:n,testId:r}){return(0,Z.jsxs)(`span`,{"data-testid":r,className:fB(`inline-flex h-7 max-w-[170px] items-center gap-1.5 overflow-hidden rounded-[7px] border border-border bg-background px-2.5 font-mono text-xs whitespace-nowrap text-foreground`,n&&`border-accent-email/40 bg-sel-soft ring-1 ring-accent-email/20`,t),title:n?`Overridden on mobile`:void 0,children:[e,n&&(0,Z.jsx)(`span`,{className:`text-accent-email ml-auto text-[9px] font-semibold tracking-wide uppercase`,children:`M`})]})}function xB({hidden:e=!1}){let t=tB(),n=aB(),r=$(e=>e.assistantWidth),i=$(e=>e.layoutMode),a=i===`compact`||i===`narrow`;return t===null?null:(0,Z.jsx)(`aside`,{"aria-label":`Assistant`,hidden:e,"data-editor-rail":`left`,"data-editor-rail-mode":`agent`,"data-testid":`agent-column`,style:a?void 0:{width:r},className:fB(`min-h-0 min-w-0 flex-col overflow-hidden bg-background`,e?`hidden`:`flex`,a&&`h-full w-full flex-1`,!a&&`h-full shrink-0 border-r border-border`),children:(0,Z.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,style:a?void 0:{width:r,maxWidth:`100%`},children:[(0,Z.jsxs)(`div`,{className:`border-border-subtle flex min-h-11 shrink-0 items-center gap-2 border-b px-3 py-2`,children:[(0,Z.jsx)(_e,{className:`text-accent-orange size-[15px] shrink-0`}),(0,Z.jsx)(`p`,{className:`text-foreground truncate text-[13px] leading-none font-semibold`,children:`Assistant`}),n!==null&&(0,Z.jsx)(`div`,{className:`ml-auto shrink-0`,children:n})]}),(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:t})]})})}function SB({children:e}){let{rightCollapsed:t,rightWidth:n,layoutMode:r}=$(vP(e=>({rightCollapsed:e.rightCollapsed,rightWidth:e.rightWidth,layoutMode:e.layoutMode}))),i=r===`compact`||r===`narrow`;return(0,Z.jsx)(`aside`,{"aria-label":`Assistant`,"aria-hidden":t||void 0,inert:t||void 0,"data-editor-rail":`right`,"data-editor-rail-mode":`agent`,style:{width:t?0:n,maxWidth:i?`calc(100% - 48px)`:void 0},className:fB(`flex h-full shrink-0 flex-col overflow-hidden border-l border-border bg-background transition-[width,transform,box-shadow] duration-180 ease-out`,i&&`absolute inset-y-0 right-0 z-40 shadow-[var(--shadow-floating)]`,t&&`border-l-0`),children:(0,Z.jsx)(`div`,{className:`flex h-full min-w-0 flex-col`,style:{width:n,maxWidth:`100%`},children:(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:e})})})}var CB=(e,t,n)=>{let r=new Map;for(let i of e.diagnostics??[])if(i.code===`caniemail/target-attribute`&&i.severity===`warning`)for(let e of i.occurrences??[i.origins]){let i=e[0];if(i===void 0)continue;let a=AS(t,n,i);if(a===null||a.tag!==`a`||a.hasSpread)continue;let o=a.properties.filter(e=>e.name===`target`),s=o[0];if(o.length!==1||s===void 0||s.kind!==`literal`||![`_self`,`_parent`,`_top`].includes(s.value))continue;let c=jS(t,s,`_blank`);c!==null&&r.set(c.start,c)}return[...r.values()].sort((e,t)=>e.start-t.start)};function wB({check:e}){let t=nB(),{doc:n,sourceEditable:r,pending:i,conflict:a,lifecycleBusy:o}=$(vP(e=>({doc:e.doc,sourceEditable:e.sourceEditable,pending:e.pendingAuthoredSource!==null,conflict:e.conflict,lifecycleBusy:e.lifecycleBusy}))),s=$(e=>e.actions.applySourceEdit),c=$(e=>e.actions.requestDiagnosticAssistance);if(n===null||!r)return null;let l=CB(e,n.origin.authoredSource,n.origin.file);if(l.length===0&&!t)return null;let u=i||a||o;return(0,Z.jsxs)(`div`,{className:`mt-2 space-y-1`,children:[l.length>0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`text-muted-foreground text-[11.5px]`,children:[`Set `,l.length,` local link target`,l.length===1?``:`s`,` to _blank to match these clients.`]}),(0,Z.jsx)(`button`,{type:`button`,"data-testid":`check.fix-target`,disabled:u,className:`border-border hover:bg-muted rounded border px-2 py-1 text-[11.5px] disabled:opacity-50`,onClick:()=>s({revision:n.rev,source:n.origin.authoredSource,edits:l}),children:`Use new-window links`})]}),t&&(0,Z.jsx)(`button`,{type:`button`,"data-testid":`check.fix-with-assistant`,disabled:u,className:`border-border hover:bg-muted rounded border px-2 py-1 text-[11.5px] disabled:opacity-50`,onClick:()=>c(e),children:`Fix with Assistant`})]})}var TB={risk:`Known risk`,unverified:`Needs verification`,degradation:`Expected differences`,"not-applicable":`Not affected`};function EB({check:e,actions:t}){return e.diagnostics===void 0?(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`p`,{className:`text-foreground text-[12.5px]`,children:e.label}),(0,Z.jsx)(`p`,{className:`text-muted-foreground text-[11.5px]`,children:e.detail})]}):(0,Z.jsxs)(`details`,{className:`min-w-0 flex-1`,"data-testid":`check.${e.id}`,children:[(0,Z.jsxs)(`summary`,{className:`text-foreground cursor-pointer text-[12.5px] break-words`,children:[e.label,(0,Z.jsx)(`span`,{className:`text-muted-foreground mt-0.5 block text-[11.5px]`,children:e.detail})]}),(0,Z.jsxs)(`div`,{className:`mt-2 space-y-3 text-[11.5px] break-words`,children:[e.diagnostics.map((e,t)=>(0,Z.jsxs)(`div`,{className:`border-border-subtle border-l pl-2`,children:[e.compatibility!==void 0&&(0,Z.jsxs)(`p`,{className:`mb-1 font-medium`,children:[e.compatibility.title,` ·`,` `,TB[e.compatibility.assessment]]}),(0,Z.jsx)(`p`,{children:e.message}),e.clients!==void 0&&!e.clients.every(t=>e.message.includes(t))&&(0,Z.jsxs)(`p`,{className:`mt-1`,children:[`Clients: `,e.clients.join(`, `)]}),e.notes!==void 0&&(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-1`,children:e.notes}),(e.fixtures?.length??0)>0&&(0,Z.jsxs)(`p`,{className:`mt-1`,children:[`Fixtures: `,e.fixtures.join(`, `)]}),(e.occurrences??[e.origins]).map((e,t)=>e.length===0?null:(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-1 break-all`,children:e.map($R).join(` → `)},t)),e.provenance!==void 0&&(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-1`,children:e.provenance})]},t)),(0,Z.jsx)(`p`,{className:`text-muted-foreground font-mono break-all`,children:e.diagnostics[0]?.code}),t]})]})}function DB({checks:e,editable:t=!1}){let{actionable:n}=Dz(e),r=e.filter(e=>e.diagnostics?.some(e=>e.compatibility?.assessment===`unverified`)).length;return(0,Z.jsxs)(`section`,{className:`space-y-3`,"aria-label":`Needs attention`,children:[(0,Z.jsxs)(`h3`,{className:`text-foreground text-[13px] font-semibold`,children:[`Needs attention`,n.length>0?` · ${n.length}`:``]}),n.length===0?(0,Z.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:e.length===0?`No checks yet.`:`No known risks found.`}):n.map(e=>(0,Z.jsx)(EB,{check:e,actions:t?(0,Z.jsx)(wB,{check:e}):void 0},e.id)),(0,Z.jsx)(OB,{checks:e,editable:t}),(0,Z.jsx)(`p`,{className:`text-muted-foreground text-[11.5px]`,children:r>0?`${r} finding group${r===1?` needs`:`s need`} client verification.`:`These checks do not confirm rendering in every inbox.`})]})}function OB({checks:e,editable:t=!1}){let n=Qz(),r=Object.fromEntries(Object.keys(TB).map(t=>[t,e.filter(e=>e.diagnostics?.some(e=>e.compatibility?.assessment===t)).length])),[i,a]=(0,T.useState)(`all`),[o,s]=(0,T.useState)(`all`),c=[...new Set(e.flatMap(e=>e.diagnostics?.flatMap(e=>e.clients??[])??[]))].sort(),l=e.flatMap(e=>{if(e.diagnostics===void 0)return i===`all`&&o===`all`?[e]:[];let t=e.diagnostics.filter(e=>(i===`all`||e.compatibility?.assessment===i)&&(o===`all`||e.clients?.includes(o)));return t.length===0?[]:[Sz(e.id,t)]}),u=e=>e.severity===`error`||e.severity===`warn`?0:e.diagnostics?.some(e=>e.compatibility?.assessment===`unverified`)?1:e.diagnostics?.some(e=>e.compatibility?.assessment===`degradation`)?2:3;return l.sort((e,t)=>u(e)-u(t)),(0,Z.jsxs)(zF,{onOpenChange:e=>{e&&(a(r.unverified>0?`unverified`:`all`),s(`all`))},children:[(0,Z.jsx)(HF,{"data-testid":`checks.compatibility-report`,className:`border-border text-foreground hover:bg-muted rounded-md border px-2.5 py-1.5 text-xs`,children:`Compatibility report`}),(0,Z.jsxs)(MF,{container:n,children:[(0,Z.jsx)(CF,{className:`fixed inset-0 z-[130] bg-black/30`}),(0,Z.jsxs)(jF,{"data-testid":`checks.report`,className:`samva-editor-shell border-border bg-surface-elevated text-foreground fixed top-1/2 left-1/2 z-[131] flex max-h-[85dvh] w-[min(840px,calc(100vw-32px))] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl border p-5 shadow-xl`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsx)(VF,{className:`text-lg font-semibold`,children:`Compatibility report`}),(0,Z.jsx)(wF,{"data-testid":`checks.report.close`,"aria-label":`Close compatibility report`,className:`hover:bg-muted rounded border px-2 py-1 text-xs`,children:`Close`})]}),(0,Z.jsx)(TF,{className:`text-muted-foreground mt-2 text-sm`,children:`Client verification remains. Review known risks, unverified behavior and fallbacks before testing in your recipients’ inboxes.`}),(0,Z.jsxs)(`p`,{className:`text-muted-foreground mt-2 text-xs`,children:[Object.entries(TB).map(([e,t])=>`${r[e]} ${t.toLowerCase()}`).join(` · `),`. Groups can appear in more than one category.`]}),(0,Z.jsxs)(`div`,{className:`my-4 flex flex-wrap gap-3 text-xs`,children:[(0,Z.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[`Assessment`,(0,Z.jsxs)(`select`,{"data-testid":`checks.report.assessment`,"aria-label":`Assessment`,value:i,onChange:e=>a(e.target.value),className:`border-border bg-background rounded border p-2`,children:[(0,Z.jsx)(`option`,{value:`all`,children:`All assessments`}),Object.entries(TB).map(([e,t])=>(0,Z.jsxs)(`option`,{value:e,children:[t,` (`,r[e],`)`]},e))]})]}),(0,Z.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[`Client`,(0,Z.jsxs)(`select`,{"data-testid":`checks.report.client`,"aria-label":`Client`,value:o,onChange:e=>s(e.target.value),className:`border-border bg-background rounded border p-2`,children:[(0,Z.jsx)(`option`,{value:`all`,children:`All clients`}),c.map(e=>(0,Z.jsx)(`option`,{children:e},e))]})]})]}),(0,Z.jsx)(`div`,{className:`samva-editor-scroll min-h-0 space-y-4 overflow-y-auto`,children:l.length===0?(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No evidence matches these filters.`}):l.map(e=>(0,Z.jsx)(`div`,{className:`border-border-subtle border-t pt-3`,children:(0,Z.jsx)(EB,{check:e,actions:t?(0,Z.jsx)(wB,{check:e}):void 0})},e.id))})]})]})]})}var kB=fB(`flex flex-1 items-center justify-center gap-1.5 px-2 text-[12px]`,vB);function AB(){let e=$(e=>e.rightMode),{setRightMode:t}=$(e=>e.actions);return(0,Z.jsx)(`div`,{className:`border-border-subtle flex shrink-0 border-b px-2 py-1.5`,children:(0,Z.jsxs)(AP,{"aria-label":`Right rail mode`,value:[e],onValueChange:e=>{let n=e[0];(n===`inspector`||n===`agent`)&&t(n)},className:`bg-muted flex flex-1 gap-0.5 rounded-lg p-0.5`,children:[(0,Z.jsxs)(CP,{value:`inspector`,"data-testid":`rail-mode.inspector`,className:kB,children:[(0,Z.jsx)(ge,{className:`size-[14px]`}),`Design`]}),(0,Z.jsxs)(CP,{value:`agent`,"data-testid":`rail-mode.agent`,className:kB,children:[(0,Z.jsx)(_e,{className:`size-[14px]`}),`AI`]})]})})}var jB=fB(`border-border bg-background text-foreground w-full rounded border px-2 py-1.5 text-xs`,pB),MB=fB(`border-border hover:bg-muted rounded border px-2 py-1 text-xs disabled:opacity-50`,pB);function NB({field:e,source:t,propose:n,apply:r}){let[i,a]=(0,T.useState)(e.value),[o,s]=(0,T.useState)(e.kind===`literal`&&e.literalType===`string`?JSON.stringify(e.value):e.value);return(0,Z.jsxs)(`div`,{className:`mt-3 space-y-1.5`,children:[(0,Z.jsxs)(`label`,{className:`block text-xs`,children:[e.name===`children`?`Text`:e.name===`className`?`Style classes`:e.name,` `,`· `,e.kind,e.kind===`literal`?(0,Z.jsx)(`input`,{"aria-label":`${e.name} literal`,"data-testid":`source.property.${e.name}.literal`,type:e.literalType===`number`?`number`:`text`,className:jB,value:i,onChange:e=>a(e.target.value)}):(0,Z.jsx)(`code`,{className:`bg-muted mt-1 block rounded p-2 break-all`,children:e.value})]}),e.kind===`literal`&&(0,Z.jsx)(`button`,{"data-testid":`source.property.${e.name}.apply`,type:`button`,className:MB,disabled:jS(t,e,i)===null,onClick:()=>{let n=jS(t,e,i);n!==null&&r(n)},children:`Apply literal`}),(0,Z.jsxs)(`details`,{children:[(0,Z.jsx)(`summary`,{"data-testid":`source.property.${e.name}.expression-toggle`,className:`cursor-pointer text-xs`,children:e.kind===`literal`?`Change to a binding or expression`:`Review a binding or expression change`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground my-1 text-xs`,children:`This changes template logic. Fixture values are edited separately.`}),(0,Z.jsx)(`textarea`,{"aria-label":`${e.name} expression`,"data-testid":`source.property.${e.name}.expression`,className:jB,value:o,onChange:e=>s(e.target.value)}),(0,Z.jsx)(`button`,{"data-testid":`source.property.${e.name}.review`,type:`button`,className:MB,onClick:()=>n(MS(t,e,o)),children:`Review expression diff`})]})]})}function PB({selection:e}){let{doc:t,pending:n,revision:r,editable:i}=$(vP(e=>({doc:e.doc,pending:e.pendingAuthoredSource,revision:e.render?.revision,editable:e.sourceEditable}))),{applySourceEdit:a,openSource:o,requestSourceAssistance:s}=$(e=>e.actions),c=nB(),[l,u]=(0,T.useState)(0),[d,f]=(0,T.useState)(null),[p,m]=(0,T.useState)(``),[h,g]=(0,T.useState)(`<p>New content</p>`),[_,v]=(0,T.useState)(``),[y,b]=(0,T.useState)(null),[x,S]=(0,T.useState)(null);if(t===null)return null;let C=e.origins[l],w=t.origin.authoredSource,E=C===void 0?null:AS(w,t.origin.file,C),D=i&&n===null&&r===t.rev&&E!==null,O=e=>{a({revision:r??``,source:w,edits:[e]}),S(null)};return(0,Z.jsxs)(`div`,{className:`border-border-subtle border-b py-3`,children:[(0,Z.jsx)(gB,{children:`Source properties`}),(0,Z.jsxs)(`label`,{className:`block text-xs`,children:[`Edit scope`,(0,Z.jsx)(`select`,{"aria-label":`Edit scope`,"data-testid":`source.scope`,className:jB,value:l,onChange:e=>{u(Number(e.target.value)),S(null)},children:e.origins.map((e,t)=>(0,Z.jsxs)(`option`,{value:t,children:[t===0?`Shared definition`:`Call site ${t}`,` · `,$R(e)]},t))})]}),(0,Z.jsxs)(`p`,{className:`text-muted-foreground mt-2 text-xs`,children:[l===0?`Changes every use of this definition.`:`Changes this call site, including every loop iteration it produces.`,` `,`Fixture items remain separate data.`]}),D?(0,Z.jsxs)(Z.Fragment,{children:[E.properties.length===0&&(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-2 text-xs`,children:`No unambiguous scalar properties here. Use source or the agent for this shape.`}),E.hasSpread&&(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-2 text-xs`,children:`Spread properties can override attributes here. Edit attributes in Source or ask the agent.`}),E.properties.filter(e=>!E.hasSpread||e.syntax===`child`).map(e=>(0,Z.jsx)(NB,{field:e,source:w,apply:O,propose:S},`${t.rev}:${w}:${l}:${e.name}`)),!E.hasSpread&&!E.properties.some(e=>e.name===`className`)&&(0,Z.jsxs)(`div`,{className:`mt-3`,children:[(0,Z.jsxs)(`label`,{className:`block text-xs`,children:[`Style classes · literal`,(0,Z.jsx)(`input`,{"aria-label":`Style classes`,className:jB,value:p,onChange:e=>m(e.target.value)})]}),(0,Z.jsx)(`button`,{type:`button`,className:MB,onClick:()=>{let e=IS(E,p);e!==null&&O(e)},children:`Apply styles`})]}),(0,Z.jsxs)(`details`,{className:`mt-3`,children:[(0,Z.jsx)(`summary`,{"data-testid":`source.structure-toggle`,className:`cursor-pointer text-xs`,children:`Structure · authored block`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground my-2 text-xs`,children:`This changes the whole source block at the scope above. A rendered loop instance has no independent source block. Change fixture items separately; edit loop or conditional logic in Source.`}),(0,Z.jsx)(`textarea`,{"aria-label":`Insert TSX`,"data-testid":`source.insert`,value:h,className:jB,onChange:e=>g(e.target.value)}),(0,Z.jsx)(`button`,{"data-testid":`source.review-insert`,type:`button`,className:MB,disabled:E.contentEnd===null,onClick:()=>b(PS(w,E,{kind:`insert`,tsx:h})),children:`Review insert`}),` `,(0,Z.jsx)(`button`,{"data-testid":`source.review-delete`,type:`button`,className:MB,disabled:!E.structural,onClick:()=>b(PS(w,E,{kind:`delete`})),children:`Review delete`}),(0,Z.jsxs)(`label`,{className:`mt-2 block text-xs`,children:[`Move into shared source container`,(0,Z.jsxs)(`select`,{"aria-label":`Move destination`,"data-testid":`source.destination`,value:_,className:jB,onChange:e=>v(e.target.value),children:[(0,Z.jsx)(`option`,{value:``,children:`Choose destination`}),t.channel===`email`&&t.render?.selections.map(e=>(0,Z.jsxs)(`option`,{value:e.instancePath,children:[e.tag,` · `,e.instancePath,` ·`,` `,e.origins[0]===void 0?`generated`:$R(e.origins[0])]},e.instancePath))]})]}),(0,Z.jsx)(`button`,{"data-testid":`source.review-move`,type:`button`,className:MB,disabled:!E.structural||_===``,onClick:()=>{let e=(t.channel===`email`?t.render?.selections.find(e=>e.instancePath===_):void 0)?.origins[0],n=e===void 0?null:AS(w,t.origin.file,e),r=n===null?null:PS(w,E,{kind:`move`,destination:n});b(r),f(r===null?`This destination cannot accept the selected block. Choose another source container or use Source.`:null)},children:`Review move`}),d!==null&&(0,Z.jsx)(`p`,{role:`alert`,className:`text-status-error text-xs`,children:d}),y!==null&&(0,Z.jsxs)(`div`,{role:`region`,"aria-label":`Structural source diff`,className:`mt-2`,children:[(0,Z.jsx)(`pre`,{className:`bg-muted overflow-auto p-2 text-xs`,children:y.map(e=>`- ${e.before}\n+ ${e.after}`).join(`
30
+ `)}),(0,Z.jsx)(`button`,{"data-testid":`source.apply-structure`,type:`button`,className:MB,onClick:()=>{a({revision:r??``,source:w,edits:y}),b(null)},children:`Apply structural change`}),` `,(0,Z.jsx)(`button`,{type:`button`,className:MB,onClick:()=>b(null),children:`Cancel`})]})]}),x!==null&&(0,Z.jsxs)(`div`,{role:`region`,"aria-label":`Proposed source diff`,className:`mt-3 space-y-2`,children:[(0,Z.jsx)(`p`,{className:`text-xs`,children:`Review the exact source change`}),(0,Z.jsx)(`pre`,{className:`bg-muted overflow-auto p-2 text-xs`,children:`- ${x.before}\n+ ${x.after}`}),(0,Z.jsx)(`button`,{"data-testid":`source.apply-reviewed`,type:`button`,className:MB,onClick:()=>O(x),children:`Apply reviewed change`}),` `,(0,Z.jsx)(`button`,{type:`button`,className:MB,onClick:()=>S(null),children:`Cancel`})]})]}):(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-2 text-xs`,children:n===null?E===null?`This origin is outside the editable entry or cannot be resolved. Open its source or ask the agent.`:`This source is read-only.`:`Waiting for the latest source to render.`}),(0,Z.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,Z.jsx)(`button`,{type:`button`,className:MB,onClick:o,children:`Open source`}),c&&(0,Z.jsx)(`button`,{type:`button`,className:MB,onClick:()=>s(l),children:`Ask agent`})]})]})}function FB(){let{undo:e,redo:t,error:n,editable:r}=$(vP(e=>({undo:e.undoHistory.length,redo:e.redoHistory.length,error:e.sourceEditError,editable:e.sourceEditable}))),i=$(e=>e.actions);return(0,Z.jsxs)(`div`,{className:`border-border border-b px-3 py-1.5`,children:[(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(`button`,{"data-testid":`source.undo`,type:`button`,className:MB,disabled:!r||e===0,onClick:i.undo,children:`Undo`}),(0,Z.jsx)(`button`,{"data-testid":`source.redo`,type:`button`,className:MB,disabled:!r||t===0,onClick:i.redo,children:`Redo`})]}),n!==null&&(0,Z.jsx)(`p`,{role:`alert`,className:`text-status-error mt-1 text-xs`,children:n})]})}function IB(){let e=$(e=>e.doc),t=$(e=>e.pendingAuthoredSource),n=$(e=>e.sourceEditable),{applySourceEdit:r,openSource:i}=$(e=>e.actions),[a,o]=(0,T.useState)(null),[s,c]=(0,T.useState)(!1);if(e?.channel!==`email`)return null;let l=FS(e.origin.authoredSource).find(t=>t.name===e.fixture);return(0,Z.jsxs)(`div`,{className:`border-border-subtle border-b py-3`,children:[(0,Z.jsxs)(gB,{children:[`Fixture data · `,e.fixture]}),(0,Z.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Example input for this fixture. Changes do not replace template bindings or change other fixtures.`}),l===void 0?(0,Z.jsx)(`button`,{type:`button`,className:MB,onClick:i,children:`Open fixture source`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`textarea`,{"aria-label":`Fixture data source`,"data-testid":`source.fixture-data`,className:jB,value:a??l.source,onChange:e=>{o(e.target.value),c(!1)},disabled:!n||t!==null}),(0,Z.jsx)(`button`,{"data-testid":`source.fixture-review`,type:`button`,className:MB,disabled:!n||t!==null||a===null,onClick:()=>c(!0),children:`Review fixture change`}),s&&a!==null&&(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`pre`,{className:`bg-muted overflow-auto p-2 text-xs`,children:`- ${l.source}\n+ ${a}`}),(0,Z.jsx)(`button`,{"data-testid":`source.fixture-apply`,type:`button`,className:MB,onClick:()=>{r({revision:e.rev,source:e.origin.authoredSource,edits:[{start:l.start,end:l.end,before:l.source,after:a}]}),o(null),c(!1)},children:`Apply fixture change`}),` `,(0,Z.jsx)(`button`,{type:`button`,className:MB,onClick:()=>{o(null),c(!1)},children:`Cancel`})]})]})]})}function LB({selection:e}){let t=$(e=>`${e.doc?.rev}:${e.doc?.origin.authoredSource}:${e.doc?.channel===`email`?e.doc.fixture:``}`);return(0,Z.jsx)(PB,{selection:e},t)}function RB(){let e=$(e=>`${e.doc?.rev}:${e.doc?.origin.authoredSource}:${e.doc?.channel===`email`?e.doc.fixture:``}`);return(0,Z.jsx)(IB,{},e)}var zB=[],BB=[],VB=[];function HB({label:e,title:t,children:n}){return(0,Z.jsxs)(`div`,{title:t,className:`mt-1.5 flex items-center justify-between gap-2 first:mt-0`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-xs`,children:e}),n]})}function UB(){let e=$(e=>e.doc?.variables??BB);return e.length===0?null:(0,Z.jsxs)(`div`,{className:`border-border-subtle border-b py-3`,children:[(0,Z.jsx)(gB,{children:`Variables`}),(0,Z.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map(e=>(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 text-[12.5px]`,children:[(0,Z.jsx)(hB,{name:e.name,className:`shrink-0`}),(0,Z.jsx)(`span`,{className:`text-placeholder ml-auto text-[11px]`,children:e.required?`required`:`optional`})]},e.name))}),(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-2.5 text-[11.5px]`,children:`The canvas shows the values of the fixture selected in the toolbar.`})]})}function WB(){let e=$(e=>e.checks),t=$(e=>e.sourceEditable);return(0,Z.jsx)(`div`,{className:`py-3`,children:(0,Z.jsx)(DB,{checks:e,editable:t})})}function GB(){let{deviceWidth:e,entryFile:t,fixture:n,fixtures:r}=$(vP(e=>({deviceWidth:jz[e.previewDevice],entryFile:e.doc?.origin.file??null,fixture:e.doc?.channel===`email`?e.doc.fixture:null,fixtures:e.doc?.channel===`email`?e.doc.fixtures:zB})));return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`border-border-subtle border-b py-3`,children:[(0,Z.jsx)(gB,{children:`Document`}),(0,Z.jsx)(HB,{label:`Width`,children:(0,Z.jsxs)(bB,{children:[e,` `,(0,Z.jsx)(`span`,{className:`text-placeholder text-[10.5px]`,children:`px`})]})}),t!==null&&(0,Z.jsx)(HB,{label:`Entry`,children:(0,Z.jsx)(bB,{children:t})}),n!==null&&(0,Z.jsx)(HB,{label:`Fixture`,title:`${r.length} declared`,children:(0,Z.jsx)(bB,{children:n})})]}),(0,Z.jsx)(RB,{},`${n}:${t}`),(0,Z.jsx)(UB,{}),(0,Z.jsx)(WB,{})]})}function KB({value:e,onChange:t,onCommit:n,placeholder:r,type:i=`text`,testId:a}){return(0,Z.jsx)(`input`,{type:i,value:e,placeholder:r,"data-testid":a,spellCheck:!1,onChange:e=>t(e.target.value),onBlur:n,onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()},className:fB(`border-border bg-background text-foreground placeholder:text-placeholder h-7 max-w-none min-w-0 flex-1 rounded-[5px] border px-2.5 text-xs outline-none`,pB)})}function qB(){let e=$(e=>e.doc),t=$(e=>e.metadataError),{saveMetadata:n}=$(e=>e.actions),r=e?.metadata.fromDefault,[i,a]=(0,T.useState)(r?.name??``),[o,s]=(0,T.useState)(r?.email??``),[c,l]=(0,T.useState)((e?.metadata.replyToDefault??[]).join(`, `)),u=()=>{let e=o.trim();n({fromDefault:e.length===0?null:{email:e,name:i.trim()||void 0}})};return(0,Z.jsxs)(`div`,{className:`py-3`,children:[(0,Z.jsx)(gB,{children:`Defaults · per send`}),(0,Z.jsx)(HB,{label:`From name`,children:(0,Z.jsx)(KB,{value:i,onChange:a,onCommit:u,placeholder:`Sender name`})}),(0,Z.jsx)(HB,{label:`From email`,children:(0,Z.jsx)(KB,{type:`email`,value:o,onChange:s,onCommit:u,placeholder:`you@domain.com`,testId:`inspector.envelope.from-email`})}),(0,Z.jsx)(HB,{label:`Reply-To`,children:(0,Z.jsx)(KB,{type:`email`,value:c,onChange:l,onCommit:()=>{let e=c.split(`,`).map(e=>e.trim()).filter(e=>e.length>0);n({replyToDefault:e.length===0?null:e})},placeholder:`Comma-separated`})}),t!==null&&(0,Z.jsx)(`p`,{role:`alert`,className:`text-status-error mt-2 text-[11.5px]`,children:t})]})}function JB(){let e=$(e=>e.metadataEditable),t=$(e=>e.render);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`border-border-subtle text-muted-foreground border-b py-2.5 text-[11px] leading-relaxed`,children:`Subject and preview text come from the template code and the fixture on screen. From / Reply-To are template defaults, overridden per send.`}),(0,Z.jsxs)(`div`,{className:`border-border-subtle border-b py-3`,children:[(0,Z.jsx)(gB,{children:`Rendered`}),(0,Z.jsx)(HB,{label:`Subject`,children:(0,Z.jsx)(bB,{children:t?.subject??`No subject`})}),(0,Z.jsx)(HB,{label:`Preview`,children:(0,Z.jsx)(bB,{children:t?.preheader??`No preview text`})})]}),e?(0,Z.jsx)(qB,{}):(0,Z.jsx)(`p`,{className:`text-muted-foreground py-3 text-xs`,children:`This host does not edit sender defaults.`})]})}function YB({selection:e}){let t=$(e=>e.render?.selections??VB),{select:n}=$(e=>e.actions),r=e.origins[0],i=e.origins.slice(1),a=HS(t,e),o=US(t,e);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`border-border-subtle border-b py-3`,children:[(0,Z.jsx)(gB,{children:`Element`}),(0,Z.jsx)(HB,{label:`Tag`,children:(0,Z.jsx)(bB,{testId:`inspector.element.tag`,children:e.tag})}),(0,Z.jsx)(HB,{label:`Source`,title:e.authored?`This element was written in the template.`:`A compiler primitive produced this element; the authoring below is the call that asked for it.`,children:(0,Z.jsx)(bB,{testId:`inspector.element.provenance`,children:e.authored?`Authored`:`Generated`})}),(0,Z.jsx)(HB,{label:`Instance`,children:(0,Z.jsx)(bB,{testId:`inspector.element.instance`,children:e.instancePath})})]}),(0,Z.jsxs)(`div`,{className:`border-border-subtle border-b py-3`,children:[(0,Z.jsx)(gB,{children:`Authoring`}),r===void 0?(0,Z.jsx)(`p`,{className:`text-muted-foreground text-[11.5px]`,children:`The renderer produced this element with no authoring on the stack, so nothing in the template points at it.`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(HB,{label:`Written at`,children:(0,Z.jsx)(bB,{testId:`inspector.authoring.origin`,children:$R(r)})}),(0,Z.jsx)(`p`,{"data-testid":`inspector.authoring.occurrence`,className:`text-muted-foreground mt-2 text-[11.5px]`,children:e.occurrences>1?`This authoring renders ${e.occurrences} elements here; this is number ${e.occurrence}.`:`This authoring renders one element here.`}),o.length>a.length&&(0,Z.jsxs)(`p`,{"data-testid":`inspector.authoring.definition-scope`,className:`text-muted-foreground mt-1 text-[11.5px]`,children:[o.length,` elements across the whole render come from it, through more than one call site.`]})]})]}),(0,Z.jsx)(LB,{selection:e},`${e.instancePath}:${e.start}:${e.end}`),i.length>0&&(0,Z.jsxs)(`div`,{className:`border-border-subtle border-b py-3`,children:[(0,Z.jsx)(gB,{children:`Call sites`}),(0,Z.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-1.5 p-0`,children:i.map((e,t)=>(0,Z.jsx)(`li`,{"data-testid":`inspector.call-site.${t}`,className:`text-foreground font-mono text-[11.5px] break-all`,children:$R(e)},`${$R(e)}:${t}`))}),(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-2 text-[11.5px]`,children:`Innermost call first.`})]}),a.length>1&&(0,Z.jsxs)(`div`,{className:`py-3`,children:[(0,Z.jsx)(gB,{children:`Iterations`}),(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:a.map((t,r)=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`inspector.iteration.${t.instancePath}`,onClick:()=>n(t.instancePath),className:fB(`hover:bg-muted w-full rounded px-1.5 py-1 text-left font-mono text-[11.5px]`,t.instancePath===e.instancePath&&`bg-sel-soft text-accent-email`),children:[r+1,`. `,t.instancePath]})},t.instancePath))})]})]})}function XB({embedded:e=!1}={}){let t=nB(),n=Qz(),{outline:r,selection:i,rightCollapsed:a,rightWidth:o,layoutMode:s}=$(vP(e=>({outline:e.outline,selection:e.selection,rightCollapsed:e.rightCollapsed,rightWidth:e.rightWidth,layoutMode:e.layoutMode}))),{select:c,selectDocument:l,breadcrumbOf:u,toggleRight:d}=$(e=>e.actions),f=i.kind===`element`?r?.index.get(i.instancePath)??null:null,p=i.kind===`envelope`?`envelope`:f===null?`document`:`element`,m=f===null?[]:u(f.instancePath),h=!e&&(s===`compact`||s===`narrow`);return(0,Z.jsx)(`aside`,{"aria-label":`Inspector`,"data-testid":`inspector`,"aria-hidden":!e&&a?!0:void 0,inert:!e&&a?!0:void 0,"data-editor-rail":`right`,style:{width:e?`100%`:a?0:o,maxWidth:h?`calc(100% - 48px)`:void 0},className:fB(`flex h-full shrink-0 flex-col overflow-hidden bg-background transition-[width,transform,box-shadow] duration-180 ease-out`,!e&&`border-l border-border`,h&&`absolute inset-y-0 right-0 z-40 shadow-[var(--shadow-floating)]`,!e&&a&&`border-l-0`),children:(0,Z.jsxs)(`div`,{className:`flex h-full min-w-0 flex-col`,style:{width:e?`100%`:o,maxWidth:`100%`},children:[!e&&t&&(0,Z.jsx)(AB,{}),(0,Z.jsx)(`div`,{className:`border-border bg-background/95 sticky top-0 z-10 border-b backdrop-blur-md`,children:(0,Z.jsxs)(`div`,{className:`flex min-h-10 items-center gap-2 px-3 py-2`,children:[(0,Z.jsx)(`div`,{className:`text-muted-foreground flex min-w-0 flex-1 items-center gap-0.5 overflow-hidden text-xs`,children:p===`document`?(0,Z.jsx)(`span`,{className:`text-foreground truncate px-1 font-semibold`,children:`Document`}):p===`envelope`?(0,Z.jsx)(`span`,{className:`text-foreground truncate px-1 font-semibold`,children:`Envelope`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`button`,{type:`button`,onClick:l,"data-testid":`inspector.document`,className:`hover:bg-muted hover:text-foreground shrink-0 rounded px-1`,children:`Email`}),m.map((e,t)=>(0,Z.jsxs)(`span`,{className:`contents`,children:[(0,Z.jsx)(`span`,{className:`text-placeholder`,children:`/`}),t===m.length-1?(0,Z.jsx)(`span`,{className:`text-foreground truncate px-1 font-semibold`,children:e.label}):(0,Z.jsx)(`button`,{type:`button`,onClick:()=>c(e.instancePath),className:`hover:bg-muted hover:text-foreground max-w-[72px] truncate rounded px-1`,children:e.label})]},e.instancePath))]})}),f!==null&&(0,Z.jsx)(`span`,{"data-testid":`inspector.selection-badge`,className:`bg-muted text-muted-foreground shrink-0 rounded-md px-1.5 py-0.5 text-[10px] font-medium tracking-wide uppercase`,children:f.authored?ez(f):`${f.tag} · generated`}),!e&&(0,Z.jsxs)(tj,{children:[(0,Z.jsx)(lj,{render:(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Collapse inspector`,"data-testid":`inspector.collapse`,onClick:d,className:`text-muted-foreground hover:bg-muted hover:text-foreground shrink-0 rounded-md p-1.5`}),children:(0,Z.jsx)(he,{className:`size-[15px]`})}),(0,Z.jsx)(pj,{container:n,children:(0,Z.jsx)(Ij,{side:`bottom`,sideOffset:5,className:`z-[200]`,children:(0,Z.jsx)(Lj,{role:`tooltip`,className:`bg-foreground text-background rounded-md px-2 py-1 text-[11px] shadow-[var(--shadow-md)]`,children:`Collapse inspector`})})})]})]})}),(0,Z.jsxs)(tF,{"data-samva-scroll-area":`inspector`,className:`relative min-h-0 flex-1`,children:[(0,Z.jsx)(pF,{className:`size-full`,children:(0,Z.jsxs)(`div`,{className:`samva-inspector-content pb-4`,children:[p===`document`&&(0,Z.jsx)(GB,{}),p===`envelope`&&(0,Z.jsx)(JB,{}),f!==null&&(0,Z.jsx)(YB,{selection:f})]})}),(0,Z.jsx)(yF,{orientation:`vertical`,className:`absolute top-0 right-0 bottom-0 flex w-2.5 touch-none p-0.5 select-none`,children:(0,Z.jsx)(bF,{className:`relative flex-1 rounded-full bg-[var(--editor-scrollbar-thumb)] hover:bg-[var(--editor-scrollbar-thumb-hover)]`})})]})]})})}function ZB({embedded:e=!1}={}){let t=Qz(),{checks:n,doc:r,readonlyReason:i,rightCollapsed:a,rightWidth:o}=$(vP(e=>({checks:e.checks,doc:e.doc,readonlyReason:e.readonlyReason,rightCollapsed:e.rightCollapsed,rightWidth:e.rightWidth}))),{toggleRight:s}=$(e=>e.actions);return!e&&a?null:(0,Z.jsxs)(`aside`,{"data-editor-rail":`right`,style:{width:e?`100%`:o},className:e?`bg-background flex h-full shrink-0 flex-col overflow-hidden`:`border-border bg-background flex h-full shrink-0 flex-col overflow-hidden border-l`,children:[(0,Z.jsxs)(`div`,{className:`border-border-subtle flex h-11 items-center border-b px-3`,children:[(0,Z.jsx)(`span`,{className:`text-[12.5px] font-medium`,children:`Template details`}),!e&&(0,Z.jsxs)(tj,{children:[(0,Z.jsx)(lj,{render:(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Collapse inspector`,onClick:s,className:`text-muted-foreground hover:bg-muted hover:text-foreground ml-auto rounded-md p-1.5`}),children:(0,Z.jsx)(he,{className:`size-[15px]`})}),(0,Z.jsx)(pj,{container:t,children:(0,Z.jsx)(Ij,{side:`bottom`,sideOffset:5,className:`z-[200]`,children:(0,Z.jsx)(Lj,{role:`tooltip`,className:`bg-foreground text-background rounded-md px-2 py-1 text-[11px] shadow-[var(--shadow-md)]`,children:`Collapse inspector`})})})]})]}),(0,Z.jsxs)(`div`,{className:`samva-editor-scroll min-h-0 flex-1 overflow-y-auto p-4 text-[12.5px]`,children:[(0,Z.jsx)(`p`,{className:`font-medium`,children:`Read-only`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-1`,children:i}),r!==null&&(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-3 font-mono text-[11.5px] break-all`,children:r.origin.file}),(0,Z.jsx)(`div`,{className:`border-border-subtle mt-5 border-t pt-4`,children:(0,Z.jsx)(DB,{checks:n})})]})]})}function QB({readOnly:e=!1}){let t=tB(),n=$(e=>e.rightMode);return t!==null&&n===`agent`?(0,Z.jsx)(SB,{children:t}):e?(0,Z.jsx)(ZB,{}):(0,Z.jsx)(XB,{})}function $B(){let e=tB(),t=$(e=>e.rightMode);return e===null||t!==`agent`?null:(0,Z.jsx)(SB,{children:e})}function eV({label:e,source:t,editable:n,onChange:r,testId:i}){return(0,Z.jsxs)(`section`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,Z.jsx)(`div`,{className:`border-border-subtle bg-surface-inset text-muted-foreground border-b px-4 py-2 font-mono text-[11px] font-medium`,children:e}),(0,Z.jsx)(`textarea`,{"aria-label":e,"data-testid":i,readOnly:!n,spellCheck:!1,value:t,onChange:e=>r?.(e.target.value),className:fB(MP,`samva-editor-scroll text-foreground min-h-0 flex-1 resize-none border-t-0 p-4 font-mono text-[12.5px] leading-5 outline-none`,`read-only:bg-muted read-only:shadow-none dark:read-only:bg-muted/40 dark:read-only:shadow-none`)})]})}function tV(){let e=$(e=>e.doc),t=$(e=>e.sourceEditable),{replaceAuthoredSource:n}=$(e=>e.actions);if(e===null)return(0,Z.jsx)(`div`,{className:`text-muted-foreground grid flex-1 place-items-center text-sm`,children:`Loading…`});let r=(0,Z.jsx)(eV,{label:`Authored TSX · ${e.origin.file}`,source:e.origin.authoredSource,editable:t,testId:`source-workspace.authored-tsx`,onChange:t?n:void 0});return e.channel===`email`?(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:r}):(0,Z.jsxs)(`div`,{className:`divide-border flex min-h-0 min-w-0 flex-1 divide-x`,children:[r,(0,Z.jsx)(eV,{label:`Emitted SML · render truth`,source:e.source,editable:!1,testId:`source-workspace.emitted-sml`})]})}var nV=fB(vB,`h-7 px-2.5 text-[12px] capitalize`);function rV(e,t){return`${e}-view-tab-${t}`}function iV({value:e,onChange:t,children:n,panelId:r,idBase:i}){let a=(0,T.useId)(),o=i??a,s=`${o}-view-panel`;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(AP,{role:`tablist`,"aria-label":`Workspace view`,value:[e],onValueChange:e=>{let n=e[0];(n===`visual`||n===`source`)&&t(n)},className:`border-border bg-background flex h-10 shrink-0 items-center gap-1 border-b px-3`,children:[`visual`,`source`].map(t=>(0,Z.jsx)(CP,{id:rV(o,t),type:`button`,role:`tab`,"aria-selected":e===t,"aria-controls":r??s,"aria-pressed":void 0,value:t,"data-testid":`workspace.tab.${t}`,className:nV,children:t},t))}),r===void 0&&(0,Z.jsx)(`div`,{role:`tabpanel`,id:s,"aria-labelledby":rV(o,e),className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:n})]})}function aV({label:e,children:t}){return(0,Z.jsxs)(`label`,{className:`grid gap-1.5 text-[12.5px]`,children:[(0,Z.jsx)(`span`,{className:`text-foreground font-medium`,children:e}),t]})}var oV=fB(`min-h-9 w-full rounded-lg border border-border bg-background px-2.5 text-[13px] text-foreground outline-none disabled:cursor-not-allowed disabled:bg-surface-inset disabled:text-muted-foreground`,pB);function sV({summary:e}){return(0,Z.jsxs)(`div`,{className:`border-border bg-surface-inset rounded-lg border border-dashed px-3 py-2`,children:[(0,Z.jsx)(`p`,{className:`text-foreground truncate font-mono text-[11.5px]`,children:e}),(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-0.5 text-[11px]`,children:`Locked structure. Preserved as is. Edit it in Source.`})]})}function cV({diagnostics:e}){return e.length===0?null:(0,Z.jsx)(`ul`,{className:`grid gap-2`,children:e.map((e,t)=>(0,Z.jsx)(`li`,{className:`border-status-error/30 bg-status-error/5 text-status-error rounded-lg border px-3 py-2 text-[12px]`,children:e.message},`${e.code}-${t}`))})}function lV({variables:e}){return e.length===0?null:(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.map(e=>(0,Z.jsx)(`span`,{className:`border-border-subtle bg-surface-inset rounded-full border px-2 py-0.5 font-mono text-[11px]`,children:`{{${e}}}`},e))})}var uV=`none`;function dV({model:e,editable:t,onChange:n}){let r=(0,T.useRef)(!1),i=(t,r)=>n({...e,segments:Dv(e.segments,t,r)});return(0,Z.jsx)(`div`,{className:`bg-muted text-foreground rounded-[18px] px-4 py-3 text-[14px] whitespace-pre-wrap`,children:e.segments.map((e,n)=>e.kind===`locked`?(0,Z.jsx)(`span`,{contentEditable:!1,title:`Locked structure — edit in Source`,"data-testid":`sms-workspace.locked-segment`,className:`border-border bg-surface-inset text-muted-foreground mx-0.5 inline-flex rounded-md border border-dashed px-1.5 py-0.5 font-mono text-[11.5px]`,children:e.summary},`locked-${n}`):(0,Z.jsx)(`span`,{role:`textbox`,"aria-label":`SMS message preview segment ${n+1}`,"data-testid":`sms-workspace.preview-segment.${n+1}`,"aria-multiline":`true`,contentEditable:t?`plaintext-only`:!1,suppressContentEditableWarning:!0,onCompositionStart:()=>{r.current=!0},onCompositionEnd:e=>{r.current=!1,i(n,e.currentTarget.textContent??``)},onInput:e=>{r.current||i(n,e.currentTarget.textContent??``)},className:`focus:bg-background focus-visible:ring-ring/50 rounded-sm outline-none focus-visible:ring-[3px]`,children:e.text},`text-${n}`))})}function fV({model:e,editable:t,onChange:n}){let r=Qz(),i=t=>n({...e,...t});return(0,Z.jsxs)(`div`,{className:`grid gap-4`,children:[(0,Z.jsx)(aV,{label:`Category`,children:(0,Z.jsxs)(IM,{value:e.category??uV,disabled:!t,onValueChange:e=>{let t=Fv.find(t=>t.value===e)?.value;i({category:e===uV?void 0:t})},children:[(0,Z.jsx)(ZM,{"data-testid":`sms-workspace.category`,className:oV,children:(0,Z.jsx)($M,{})}),(0,Z.jsx)(eN,{container:r,children:(0,Z.jsx)(kN,{sideOffset:4,className:`z-[120]`,children:(0,Z.jsxs)(XN,{className:`samva-editor-shell border-border bg-surface-elevated min-w-[var(--anchor-width)] rounded-lg border p-1 shadow-[var(--shadow-lg)]`,children:[(0,Z.jsx)(sP,{value:uV,"data-testid":`sms-workspace.category-option.none`,className:`data-highlighted:bg-muted rounded-md px-2.5 py-1.5 text-[13px] outline-none`,children:(0,Z.jsx)(cP,{children:`Not set`})}),Fv.map(e=>(0,Z.jsx)(sP,{value:e.value,"data-testid":`sms-workspace.category-option.${e.value}`,className:`data-highlighted:bg-muted rounded-md px-2.5 py-1.5 text-[13px] outline-none`,children:(0,Z.jsx)(cP,{children:e.label})},e.value))]})})})]})}),(0,Z.jsxs)(`div`,{className:`grid gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-[12.5px] font-medium`,children:`Message body`}),e.segments.map((n,r)=>n.kind===`locked`?(0,Z.jsx)(sV,{summary:n.summary},`locked-${r}`):(0,Z.jsx)(`textarea`,{"aria-label":`Message body segment ${r+1}`,"data-testid":`sms-workspace.body-segment.${r+1}`,value:n.text,disabled:!t,onChange:t=>i({segments:Dv(e.segments,r,t.target.value)}),rows:5,className:`${oV} resize-y py-2`},`text-${r}`))]}),(0,Z.jsx)(lV,{variables:e.variables})]})}function pV(){let e=$(e=>e.doc),t=$(e=>e.sourceEditable),n=$(e=>e.compiled),{replaceSource:r}=$(e=>e.actions),[i,a]=(0,T.useState)(`visual`),o=e!==null&&e.channel!==`email`?e.source:``,s=(0,T.useMemo)(()=>n===null?{errors:[],compiled:null,model:null}:Lv(o,n),[o,n]),c=s.compiled,l=Object.fromEntries((e?.variables??[]).map(e=>[e.name,e.sample??`{{${e.name}}}`])),u=c===null?``:fP(c.body,l),d=(e,t)=>r(Rv(e),{label:`Edit SMS template`,coalesceKey:t});return(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:(0,Z.jsx)(iV,{value:i,onChange:a,children:i===`source`?(0,Z.jsx)(tV,{}):(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:[(0,Z.jsxs)(`aside`,{className:`samva-editor-scroll border-border bg-background w-[380px] shrink-0 overflow-y-auto border-r p-4`,children:[(0,Z.jsx)(cV,{diagnostics:s.errors}),s.model!==null&&(0,Z.jsx)(fV,{model:s.model,editable:t,onChange:d})]}),(0,Z.jsx)(`main`,{className:`samva-editor-workspace samva-editor-scroll min-w-0 flex-1 overflow-auto p-8`,children:(0,Z.jsxs)(`div`,{className:`border-border bg-background mx-auto max-w-[420px] rounded-[28px] border p-5 shadow-[var(--shadow-lg)]`,children:[(0,Z.jsx)(`div`,{"data-testid":`sms-workspace.preview-heading`,className:`border-border-subtle text-muted-foreground mb-5 border-b pb-3 text-center text-[12px] font-medium`,children:`SMS preview`}),s.model===null?(0,Z.jsx)(`div`,{className:`bg-muted text-muted-foreground rounded-[18px] px-4 py-3 text-[14px]`,children:u||`Message preview`}):(0,Z.jsx)(dV,{model:s.model,editable:t,onChange:e=>d(e,`sms-preview`)}),c!==null&&(0,Z.jsxs)(`p`,{className:`text-muted-foreground mt-4 text-center text-[11.5px]`,children:[c.encoding.toUpperCase(),` · `,c.estimatedSegments,` segment`,c.estimatedSegments===1?``:`s`,c.maxSegments===void 0?``:` · up to ${c.maxSegments} with conditionals`]})]})}),(0,Z.jsx)($B,{})]})})})}function mV({label:e,slot:t,editable:n,onChange:r}){return t.kind===`locked`?(0,Z.jsx)(sV,{summary:`${e} · ${t.summary}`}):(0,Z.jsx)(aV,{label:e,children:(0,Z.jsx)(`input`,{value:t.kind===`editable`?t.text:``,disabled:!n,"data-testid":`whatsapp-workspace.slot.${e.toLowerCase()}`,onChange:e=>r(e.target.value===``?{kind:`absent`}:{kind:`editable`,node:t.kind===`editable`?t.node:void 0,text:e.target.value}),className:oV})})}function hV({buttons:e,editable:t,onChange:n}){let r=Qz(),[i,a]=(0,T.useState)(`quick-reply`),o=(t,r)=>n(e.map((e,n)=>n===t&&e.kind===`editable`?{...e,...r}:e));return(0,Z.jsxs)(`div`,{className:`grid gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-[12.5px] font-medium`,children:`Buttons`}),e.map((i,a)=>i.kind===`locked`?(0,Z.jsx)(sV,{summary:i.summary},`locked-${a}`):(0,Z.jsxs)(`div`,{className:`border-border grid gap-2 rounded-lg border p-3`,children:[(0,Z.jsxs)(IM,{value:i.type,disabled:!t,onValueChange:e=>{let t=Vv.find(t=>t.value===e)?.value;t!==void 0&&o(a,{type:t})},children:[(0,Z.jsx)(ZM,{"aria-label":`Button ${a+1} type`,className:oV,children:(0,Z.jsx)($M,{})}),(0,Z.jsx)(eN,{container:r,children:(0,Z.jsx)(kN,{sideOffset:4,className:`z-[120]`,children:(0,Z.jsx)(XN,{className:`samva-editor-shell border-border bg-surface-elevated min-w-[var(--anchor-width)] rounded-lg border p-1 shadow-[var(--shadow-lg)]`,children:Vv.map(e=>(0,Z.jsx)(sP,{value:e.value,className:`data-highlighted:bg-muted rounded-md px-2.5 py-1.5 text-[13px] outline-none`,children:(0,Z.jsx)(cP,{children:e.label})},e.value))})})})]}),(0,Z.jsx)(`input`,{"aria-label":`Button ${a+1} label`,value:i.text,disabled:!t,onChange:e=>o(a,{text:e.target.value}),className:oV}),i.type===`url`&&(0,Z.jsx)(`input`,{"aria-label":`Button ${a+1} URL`,value:i.url??``,disabled:!t,onChange:e=>o(a,{url:e.target.value}),className:oV}),i.type===`phone`&&(0,Z.jsx)(`input`,{"aria-label":`Button ${a+1} phone`,value:i.phone??``,disabled:!t,onChange:e=>o(a,{phone:e.target.value}),className:oV}),t&&(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Remove button ${a+1}`,onClick:()=>n(e.filter((e,t)=>t!==a)),className:`text-muted-foreground hover:text-status-error justify-self-end text-[11.5px]`,children:`Remove`})]},`button-${a}`)),t&&(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsxs)(IM,{value:i,onValueChange:e=>{let t=Vv.find(t=>t.value===e)?.value;t!==void 0&&a(t)},children:[(0,Z.jsx)(ZM,{"aria-label":`New button type`,className:oV,children:(0,Z.jsx)($M,{})}),(0,Z.jsx)(eN,{container:r,children:(0,Z.jsx)(kN,{sideOffset:4,className:`z-[120]`,children:(0,Z.jsx)(XN,{className:`samva-editor-shell border-border bg-surface-elevated min-w-[var(--anchor-width)] rounded-lg border p-1 shadow-[var(--shadow-lg)]`,children:Vv.map(e=>(0,Z.jsx)(sP,{value:e.value,className:`data-highlighted:bg-muted rounded-md px-2.5 py-1.5 text-[13px] outline-none`,children:(0,Z.jsx)(cP,{children:e.label})},e.value))})})})]}),(0,Z.jsx)(`button`,{type:`button`,"data-testid":`whatsapp-workspace.add-button`,onClick:()=>n([...e,Zv(i)]),className:`border-border hover:bg-muted shrink-0 rounded-lg border px-3 text-[12px]`,children:`Add`})]})]})}function gV({model:e,editable:t,onChange:n}){let r=Qz(),i=t=>n({...e,...t});return(0,Z.jsxs)(`div`,{className:`grid gap-4`,children:[(0,Z.jsx)(aV,{label:`Template name`,children:(0,Z.jsx)(`input`,{value:e.name,disabled:!t,"data-testid":`whatsapp-workspace.name`,onChange:e=>i({name:e.target.value}),className:oV})}),(0,Z.jsx)(aV,{label:`Language`,children:(0,Z.jsx)(`input`,{value:e.language,disabled:!t,onChange:e=>i({language:e.target.value}),className:oV})}),(0,Z.jsx)(aV,{label:`Category`,children:(0,Z.jsxs)(IM,{value:e.category,disabled:!t,onValueChange:e=>{let t=zv.find(t=>t.value===e)?.value;t!==void 0&&i({category:t})},children:[(0,Z.jsx)(ZM,{className:oV,children:(0,Z.jsx)($M,{})}),(0,Z.jsx)(eN,{container:r,children:(0,Z.jsx)(kN,{sideOffset:4,className:`z-[120]`,children:(0,Z.jsx)(XN,{className:`samva-editor-shell border-border bg-surface-elevated min-w-[var(--anchor-width)] rounded-lg border p-1 shadow-[var(--shadow-lg)]`,children:zv.map(e=>(0,Z.jsx)(sP,{value:e.value,className:`data-highlighted:bg-muted rounded-md px-2.5 py-1.5 text-[13px] outline-none`,children:(0,Z.jsx)(cP,{children:e.label})},e.value))})})})]})}),(0,Z.jsx)(aV,{label:`Header type`,children:(0,Z.jsxs)(IM,{value:e.headerType,disabled:!t||e.header.kind===`locked`,onValueChange:e=>{let t=Bv.find(t=>t.value===e)?.value;t!==void 0&&i({headerType:t})},children:[(0,Z.jsx)(ZM,{className:oV,children:(0,Z.jsx)($M,{})}),(0,Z.jsx)(eN,{container:r,children:(0,Z.jsx)(kN,{sideOffset:4,className:`z-[120]`,children:(0,Z.jsx)(XN,{className:`samva-editor-shell border-border bg-surface-elevated min-w-[var(--anchor-width)] rounded-lg border p-1 shadow-[var(--shadow-lg)]`,children:Bv.map(e=>(0,Z.jsx)(sP,{value:e.value,className:`data-highlighted:bg-muted rounded-md px-2.5 py-1.5 text-[13px] outline-none`,children:(0,Z.jsx)(cP,{children:e.label})},e.value))})})})]})}),(0,Z.jsx)(mV,{label:`Header`,slot:e.header,editable:t,onChange:e=>i({header:e})}),(0,Z.jsxs)(`div`,{className:`grid gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-[12.5px] font-medium`,children:`Body`}),e.body.map((n,r)=>n.kind===`locked`?(0,Z.jsx)(sV,{summary:n.summary},`body-locked-${r}`):(0,Z.jsx)(`textarea`,{"aria-label":`Body segment ${r+1}`,"data-testid":`whatsapp-workspace.body.${r+1}`,value:n.text,disabled:!t,onChange:t=>i({body:Dv(e.body,r,t.target.value)}),rows:4,className:`${oV} resize-y py-2`},`body-text-${r}`))]}),(0,Z.jsx)(mV,{label:`Footer`,slot:e.footer,editable:t,onChange:e=>i({footer:e})}),(0,Z.jsx)(hV,{buttons:e.buttons,editable:t,onChange:e=>i({buttons:e})}),(0,Z.jsx)(lV,{variables:e.variables})]})}function _V({label:e,slot:t,editable:n,placeholder:r,className:i,onChange:a}){return t.kind===`locked`?(0,Z.jsx)(sV,{summary:`${e} · ${t.summary}`}):(0,Z.jsx)(`input`,{"aria-label":`${e} preview`,"data-testid":`whatsapp-workspace.preview.${e.toLowerCase()}`,value:t.kind===`editable`?t.text:``,readOnly:!n,placeholder:r,onChange:e=>a(e.target.value===``?{kind:`absent`}:{kind:`editable`,node:t.kind===`editable`?t.node:void 0,text:e.target.value}),className:`placeholder:text-muted-foreground/60 w-full min-w-0 bg-transparent outline-none ${i} ${n?`focus-visible:ring-ring/50 rounded-sm focus-visible:ring-2`:`cursor-default`}`})}function vV({model:e,editable:t,category:n,buttonLabels:r,onChange:i}){let a=t=>i({...e,...t});return(0,Z.jsxs)(`div`,{className:`border-border mx-auto max-w-[420px] rounded-[28px] border bg-[#e9e2d8] p-5 shadow-[var(--shadow-lg)] dark:bg-[#0b141a]`,children:[(0,Z.jsx)(`div`,{"data-testid":`whatsapp-workspace.preview-heading`,className:`text-muted-foreground mb-4 text-center text-[12px] font-medium`,children:`WhatsApp business preview`}),(0,Z.jsxs)(`div`,{className:`bg-background rounded-xl px-3.5 py-3 shadow-[var(--shadow-sm)]`,children:[(0,Z.jsx)(_V,{label:`Header`,slot:e.header,editable:t&&e.headerType===`text`,placeholder:e.headerType===`text`?`Add header`:`${e.headerType} header`,className:`mb-1 font-semibold`,onChange:e=>a({header:e})}),(0,Z.jsx)(`div`,{className:`grid gap-1`,children:e.body.map((n,r)=>n.kind===`locked`?(0,Z.jsx)(sV,{summary:`Body · ${n.summary}`},n.node.id):(0,Z.jsx)(`textarea`,{"aria-label":`Body preview segment ${r+1}`,"data-testid":`whatsapp-workspace.body-preview.${r+1}`,value:n.text,readOnly:!t,placeholder:`Write your message`,rows:Math.max(1,n.text.split(`
31
+ `).length),onChange:t=>a({body:Dv(e.body,r,t.target.value)}),className:`placeholder:text-muted-foreground/60 min-h-5 w-full resize-none overflow-hidden bg-transparent text-[14px] whitespace-pre-wrap outline-none ${t?`focus-visible:ring-ring/50 rounded-sm focus-visible:ring-2`:`cursor-default`}`},`body-text-${r}`))}),(0,Z.jsx)(_V,{label:`Footer`,slot:e.footer,editable:t,placeholder:`Add footer`,className:`text-muted-foreground mt-2 text-[11.5px]`,onChange:e=>a({footer:e})}),r.map((e,t)=>(0,Z.jsx)(`div`,{className:`border-border-subtle text-accent-email mt-2 border-t pt-2 text-center text-[12px]`,children:e},`${e}-${t}`))]}),(0,Z.jsxs)(`p`,{className:`text-muted-foreground mt-4 text-center text-[11.5px] capitalize`,children:[n,` template`]})]})}function yV(){let e=$(e=>e.doc),t=$(e=>e.sourceEditable),n=$(e=>e.compiled),{replaceSource:r}=$(e=>e.actions),[i,a]=(0,T.useState)(`visual`),o=e!==null&&e.channel!==`email`?e.source:``,s=(0,T.useMemo)(()=>n===null?{errors:[],compiled:null,model:null}:qv(o,n),[o,n]),c=s.compiled,l=Object.fromEntries((e?.variables??[]).map(e=>[e.name,e.sample??`{{${e.name}}}`])),u=e=>e===void 0?``:fP(e,l),d=(e,t)=>r(Xv(e),{label:`Edit WhatsApp template`,coalesceKey:t});return(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:(0,Z.jsx)(iV,{value:i,onChange:a,children:i===`source`?(0,Z.jsx)(tV,{}):(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:[(0,Z.jsxs)(`aside`,{className:`samva-editor-scroll border-border bg-background w-[400px] shrink-0 overflow-y-auto border-r p-4`,children:[(0,Z.jsx)(cV,{diagnostics:s.errors}),s.model!==null&&(0,Z.jsx)(gV,{model:s.model,editable:t,onChange:d})]}),(0,Z.jsx)(`main`,{className:`samva-editor-workspace samva-editor-scroll min-w-0 flex-1 overflow-auto p-8`,children:s.model!==null&&(0,Z.jsx)(vV,{model:s.model,editable:t,category:c?.category??s.model.category,buttonLabels:c?.buttons.map(e=>e.type===`COPY_CODE`?`Copy code`:u(e.text))??[],onChange:e=>d(e,`whatsapp-preview`)})}),(0,Z.jsx)($B,{})]})})})}var bV=`html,body{margin:0;padding:0;overflow:hidden}`,xV={"--editor-canvas-hover":`#93c5fd`,"--editor-canvas-selected":`#2563eb`,"--editor-canvas-selected-fg":`#fff`,"--editor-canvas-generated":`#a855f7`},SV=e=>`:root{${Object.entries(xV).map(([t,n])=>`${t}:${e[t]?.trim()||n}`).join(`;`)}}`,CV=e=>{let t=e.parentElement;if(t===null)return{};let n=document.createElement(`span`);n.hidden=!0,t.appendChild(n);let r=Object.fromEntries(Object.keys(xV).map(e=>(n.style.color=`var(${e})`,[e,getComputedStyle(n).color])));return n.remove(),r},wV=/@media\s*\(\s*prefers-color-scheme:\s*dark\s*\)/g,TV=(e,t)=>e.replace(wV,t===`dark`?`@media all`:`@media not all`),EV=e=>({top:e.top,left:e.left,width:e.width,height:e.height}),DV=(e,t)=>{let n=e.querySelectorAll(`[${LS}="${CSS.escape(t)}"]`),r=null;for(let e of n){let t=EV(e.getBoundingClientRect());if(r??=t,t.width>0&&t.height>0)return t}return r},OV=`a[href],button,input[type="button"],input[type="submit"],input[type="image"]`,kV=e=>e!==null&&`closest`in e&&typeof e.closest==`function`,AV=e=>kV(e)&&e.closest(OV)!==null,jV=e=>kV(e)?e.closest(`[data-samva-instance]`)?.getAttribute(`data-samva-instance`)??null:null,MV=e=>e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.button!==0,NV=e=>{let t=e.contentDocument;if(t===null)return null;let n=t.body.getBoundingClientRect(),r=Math.max(n.height,t.body.offsetHeight),i=Math.ceil(r>0?r:Math.max(t.body.scrollHeight,t.documentElement.scrollHeight));return e.style.height=`${i}px`,i},PV=({document_:e,width:t,dark:n,overlay:r,onSelect:i,onHover:a,onContextMenu:o})=>{let s=(0,T.useRef)(null),[c,l]=(0,T.useState)(null),u=(0,T.useRef)({onSelect:i,onHover:a,onContextMenu:o});return(0,T.useLayoutEffect)(()=>{u.current={onSelect:i,onHover:a,onContextMenu:o}},[i,a,o]),(0,T.useLayoutEffect)(()=>{let t=s.current;if(t===null)return;let n=null,r=()=>{n===null&&(n=requestAnimationFrame(()=>{n=null,NV(t)}))},i=new ResizeObserver(r),a=new MutationObserver(r),o=()=>{let e=t.contentDocument;if(e===null)return;let n=e.head.querySelector(`style[data-samva-editor-chrome]`);n===null&&(n=e.createElement(`style`),n.dataset.samvaEditorChrome=``,e.head.appendChild(n)),n.textContent=`${bV}${SV(CV(t))}`},c=()=>{let n=t.contentDocument;n!==null&&(n.open(),n.write(e),n.close(),o(),l(n.body),i.disconnect(),i.observe(n.body),a.disconnect(),a.observe(n.body,{childList:!0,subtree:!0}),NV(t))},d=e=>{!MV(e)&&AV(e.target)&&e.preventDefault(),u.current.onSelect?.(jV(e.target))},f=e=>u.current.onHover?.(jV(e.target)),p=()=>u.current.onHover?.(null),m=e=>{let n=u.current.onContextMenu;if(n===void 0)return;e.preventDefault();let r=t.getBoundingClientRect(),i=t.clientWidth===0?1:r.width/t.clientWidth,a=t.clientHeight===0?1:r.height/t.clientHeight;n({instancePath:jV(e.target),clientX:r.left+e.clientX*i,clientY:r.top+e.clientY*a})},h=()=>{let e=t.contentDocument;e!==null&&(e.addEventListener(`click`,d),e.addEventListener(`mousemove`,f),e.addEventListener(`mouseleave`,p),e.addEventListener(`contextmenu`,m))},g=()=>{let e=t.contentDocument;e!==null&&(e.removeEventListener(`click`,d),e.removeEventListener(`mousemove`,f),e.removeEventListener(`mouseleave`,p),e.removeEventListener(`contextmenu`,m))};c(),h();let _=new MutationObserver(o);return _.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>{g(),i.disconnect(),a.disconnect(),_.disconnect(),n!==null&&cancelAnimationFrame(n)}},[e]),(0,Z.jsx)(`iframe`,{ref:s,"data-testid":`canvas.frame`,title:`Email canvas`,sandbox:`allow-same-origin`,style:{width:t,height:0,display:`block`,border:`none`,background:n?`#0a0a0a`:`var(--editor-canvas-document-bg, #fff)`,colorScheme:n?`dark`:`light`},children:c!==null&&r!==void 0?(0,XD.createPortal)(r,c):null})},FV=({html:e,forceColorScheme:t,...n})=>{let r=t===void 0?e:TV(e,t);return(0,Z.jsx)(PV,{document_:r,dark:t===`dark`,...n},r)},IV=(e,t,n)=>({position:`fixed`,top:e.top,left:e.left,width:e.width,height:e.height,outline:`${n}px solid ${t}`,outlineOffset:-n,pointerEvents:`none`,zIndex:2147483646}),LV=({renderRevision:e,selected:t,hovered:n})=>{let r=(0,T.useRef)(null),[i,a]=(0,T.useState)(null),[o,s]=(0,T.useState)(null),c=t?.instancePath??null,l=n?.instancePath??null;return(0,T.useLayoutEffect)(()=>{let e=r.current?.ownerDocument;e!==void 0&&(a(c===null?null:DV(e,c)),s(l===null||l===c?null:DV(e,l)))},[e,c,l]),(0,Z.jsxs)(`div`,{ref:r,"data-samva-overlay":!0,style:{position:`fixed`,inset:0,pointerEvents:`none`},children:[o===null?null:(0,Z.jsx)(`div`,{style:IV(o,`var(--editor-canvas-hover)`,1)}),i!==null&&t!==null?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{style:IV(i,t.authored?`var(--editor-canvas-selected)`:`var(--editor-canvas-generated)`,2)}),(0,Z.jsx)(`div`,{"data-samva-chip":!0,style:{position:`fixed`,top:Math.max(0,i.top-18),left:i.left,padding:`1px 6px`,borderRadius:4,background:t.authored?`var(--editor-canvas-selected)`:`var(--editor-canvas-generated)`,color:`var(--editor-canvas-selected-fg)`,font:`11px/1.4 ui-sans-serif, system-ui, sans-serif`,pointerEvents:`none`,zIndex:2147483647},children:t.authored?ez(t):`${ez(t)} · generated`})]}):null]})},RV=e=>e===void 0?`No default sender`:e.name?`${e.name} <${e.email}>`:e.email;function zV(){return(0,Z.jsx)(`span`,{title:`Overridable per send`,className:`border-border-subtle text-placeholder shrink-0 rounded-full border px-2 py-px text-[10px]`,children:`default`})}function BV({value:e,placeholder:t,testId:n}){return(0,Z.jsx)(`span`,{"data-testid":n,className:`text-foreground min-w-0 flex-1 truncate`,children:e.length>0?e:(0,Z.jsx)(`span`,{className:`text-placeholder`,children:t})})}function VV(){let{doc:e,render:t,selected:n,layoutMode:r}=$(vP(e=>({doc:e.doc,render:e.render,selected:e.selection.kind===`envelope`,layoutMode:e.layoutMode}))),{selectEnvelope:i}=$(e=>e.actions),[a,o]=(0,T.useState)(!1),s=(0,T.useRef)(null),c=(0,T.useRef)(!1),l=e?.metadata.fromDefault,u=e?.metadata.replyToDefault??[],d=t?.subject??``,f=t?.preheader??``,p=r===`compact`||r===`narrow`;return(0,T.useEffect)(()=>{p&&!a&&c.current&&(c.current=!1,s.current?.focus())},[p,a]),(0,Z.jsxs)(eI,{open:!p||a,onOpenChange:e=>{e||(c.current=!0),o(e)},children:[p&&!a&&(0,Z.jsxs)(nI,{ref:s,"aria-label":`Expand envelope`,"data-testid":`envelope.expand`,onClick:e=>{e.stopPropagation(),i()},className:fB(`mb-4 flex h-11 w-full items-center gap-3 rounded-xl border bg-background px-3 text-left shadow-[var(--shadow-xs)] transition-[border-color,box-shadow] hover:border-sel-mid`,n&&`border-accent-email shadow-[0_0_0_1px_var(--accent-email)]`),children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground text-[10px] font-semibold tracking-[0.08em] uppercase`,children:`Envelope`}),(0,Z.jsx)(`span`,{className:`text-foreground min-w-0 flex-1 truncate text-[12px]`,children:d===``?`No subject`:d}),(0,Z.jsx)(P,{className:`text-muted-foreground size-4 shrink-0`})]}),(0,Z.jsx)(fI,{children:(0,Z.jsxs)(`div`,{onClick:e=>{e.stopPropagation(),i()},className:fB(`mb-6 cursor-pointer overflow-hidden rounded-2xl border transition-shadow`,n?`border-accent-email shadow-[0_0_0_1px_var(--accent-email)]`:`border-border/80 hover:border-sel-mid`),children:[(0,Z.jsxs)(`div`,{className:`border-border-subtle bg-surface-inset/80 flex items-center justify-between border-b px-3 py-1.5`,children:[(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Select envelope`,"data-testid":`envelope.select`,onClick:e=>{e.stopPropagation(),i()},className:`text-muted-foreground hover:bg-muted hover:text-foreground rounded px-1 py-0.5 text-[10px] font-semibold tracking-[0.08em] uppercase`,children:`Envelope`}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-placeholder text-[10px]`,children:`defaults muted · subject & preview rendered`}),p&&(0,Z.jsx)(nI,{"aria-label":`Collapse envelope`,"data-testid":`envelope.collapse`,onClick:e=>{e.stopPropagation()},className:`text-muted-foreground hover:bg-muted hover:text-foreground rounded p-1`,children:(0,Z.jsx)(L,{className:`size-3.5`})})]})]}),(0,Z.jsxs)(`div`,{className:`border-border-subtle bg-surface-inset/40 border-b`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2 text-[12.5px]`,children:[(0,Z.jsx)(`span`,{className:`text-placeholder w-16 shrink-0 text-[11px] font-medium tracking-wide uppercase`,children:`From`}),(0,Z.jsx)(`span`,{className:`text-muted-foreground min-w-0 flex-1 truncate`,children:RV(l)}),(0,Z.jsx)(zV,{})]}),(0,Z.jsxs)(`div`,{"data-testid":`envelope.reply-to-row`,className:`flex items-center gap-3 px-4 py-2 text-[12.5px]`,children:[(0,Z.jsx)(`span`,{className:`text-placeholder w-16 shrink-0 text-[11px] font-medium tracking-wide uppercase`,children:`Reply-To`}),(0,Z.jsx)(`span`,{className:`text-muted-foreground min-w-0 flex-1 truncate`,children:u.length>0?u.join(`, `):`None`}),(0,Z.jsx)(zV,{})]})]}),(0,Z.jsxs)(`div`,{className:`bg-background`,children:[(0,Z.jsxs)(`div`,{className:`border-border-subtle flex items-center gap-3 border-b px-4 py-2.5 text-[12.5px]`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground w-16 shrink-0 text-[11px] font-medium tracking-wide uppercase`,children:`Subject`}),(0,Z.jsx)(BV,{value:d,placeholder:`No subject`,testId:`envelope.subject-value`})]}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2.5 text-[12.5px]`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground w-16 shrink-0 text-[11px] font-medium tracking-wide uppercase`,children:`Preview`}),(0,Z.jsx)(BV,{value:f,placeholder:`No preview text`,testId:`envelope.preview-value`})]})]})]})})]})}var HV=fB(`samva-editor-context-item`,`grid min-h-8 grid-cols-[1fr_auto] items-center gap-5 rounded-md px-2.5 text-[12.5px] text-foreground outline-none`,`data-[highlighted]:bg-sel-soft data-[highlighted]:text-accent-email`);function UV({children:e,ancestors:t,onSelect:n,onOpenChange:r,portalContainer:i,open:a,anchor:o}){return(0,Z.jsxs)(BI,{open:a,onOpenChange:r,children:[(0,Z.jsx)(HI,{render:e}),(0,Z.jsx)(EI,{container:i,children:(0,Z.jsx)(UI,{anchor:o,sideOffset:2,children:(0,Z.jsxs)(CI,{"aria-label":`Select element`,"data-testid":`node-context-menu.popup`,className:`samva-editor-context-popup samva-editor-shell border-border bg-surface-elevated z-50 min-w-52 rounded-lg border p-1 shadow-[var(--shadow-lg)] outline-none`,children:[(0,Z.jsx)(`div`,{className:`text-muted-foreground px-2.5 py-1 text-[11px]`,children:`Select`}),t.map(e=>(0,Z.jsxs)(SI,{className:HV,"data-testid":`node-context-menu.item.${e.instancePath}`,onClick:()=>n(e.instancePath),children:[(0,Z.jsx)(`span`,{children:e.label}),e.generated?(0,Z.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`generated`}):null]},e.instancePath))]})})})]})}function WV({pointing:e=!1}){let{doc:t,render:n,outline:r,selection:i,previewDevice:a,canvasZoom:o}=$(vP(e=>({doc:e.doc,render:e.render,outline:e.outline,selection:e.selection,previewDevice:e.previewDevice,canvasZoom:e.canvasZoom}))),{select:s,selectDocument:c,setHovered:l,setPreviewDevice:u,setCanvasZoom:d}=$(e=>e.actions),f=$(e=>e.hoveredCandidatePath===null?null:e.outline?.index.get(e.hoveredCandidatePath)??null),p=Qz(),m=dB(),h=(0,T.useRef)(null),[g,_]=(0,T.useState)(1),[v,y]=(0,T.useState)([]),[b,x]=(0,T.useState)(!1),[S,C]=(0,T.useState)(null),w=i.kind===`element`?r?.index.get(i.instancePath)??null:null,E=a===`mobile`?375:600;(0,T.useLayoutEffect)(()=>{let e=h.current;if(e===null||typeof ResizeObserver>`u`)return;let t=()=>{let t=Math.max(240,e.clientWidth-80);_(Math.min(1,Math.max(.5,t/E)))};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[E]);let D=o===`fit`?g:1,O=(0,T.useCallback)(t=>{if(e||r===null||t.instancePath===null){x(!1);return}let n=[...az(r,t.instancePath),t.instancePath].toReversed().flatMap(e=>{let t=r.index.get(e);return t===void 0?[]:[{instancePath:e,label:ez(t),generated:!t.authored}]});if(n.length===0){x(!1);return}s(t.instancePath),y(n);let{clientX:i,clientY:a}=t;C({getBoundingClientRect:()=>DOMRect.fromRect({x:i,y:a})}),queueMicrotask(()=>x(!0))},[r,e,s]),k=n===null?null:(0,Z.jsx)(FV,{html:n.html,width:E,onSelect:s,onHover:l,onContextMenu:e?void 0:O,overlay:(0,Z.jsx)(LV,{renderRevision:n.revision,selected:w,hovered:f})});return(0,Z.jsxs)(`div`,{className:`samva-editor-workspace relative flex min-w-0 flex-1 flex-col`,children:[m!==null&&(0,Z.jsx)(`div`,{"data-samva-canvas-status":!0,className:`pointer-events-none absolute inset-x-0 top-3 z-10 flex justify-center`,children:m}),(0,Z.jsx)(`div`,{ref:h,"data-samva-canvas-viewport":!0,className:`samva-editor-scroll relative flex-1 overflow-auto px-10 pt-10 pb-24 [overflow-anchor:none]`,onClick:c,children:t===null?(0,Z.jsx)(`div`,{className:`text-muted-foreground grid h-full place-items-center text-[12.5px]`,children:`Loading document…`}):(0,Z.jsxs)(`div`,{className:`mx-auto`,"data-canvas-zoom":o,style:{width:E,zoom:D},onClick:e=>e.stopPropagation(),children:[t.channel===`email`&&t.preview.status===`stale`&&(0,Z.jsxs)(`div`,{"data-testid":`canvas.preview-stale`,className:`border-warning/35 bg-warning/10 text-foreground mb-3 rounded-[9px] border px-3 py-2 text-[12px] shadow-sm`,children:[`Showing the last preview that worked. Your latest edit has a problem:`,` `,t.preview.reason]}),(0,Z.jsx)(VV,{}),k===null?(0,Z.jsx)(GV,{}):e?k:(0,Z.jsx)(UV,{ancestors:v,onSelect:s,portalContainer:p,anchor:S??void 0,open:b,onOpenChange:e=>x(e&&v.length>0),children:k})]})}),t!==null&&(0,Z.jsxs)(`div`,{className:`border-border bg-background/95 absolute bottom-3 left-1/2 z-20 flex -translate-x-1/2 items-center gap-1 rounded-[9px] border p-1 shadow-[var(--shadow-lg)] backdrop-blur-md`,children:[(0,Z.jsx)(yB,{ariaLabel:`Canvas preview width`,value:a,onChange:e=>u(e),size:`sm`,options:[{value:`desktop`,title:`Preview desktop width`,testId:`canvas.device.desktop`,label:(0,Z.jsx)(ce,{className:`size-[13px]`})},{value:`mobile`,title:`Preview mobile width`,testId:`canvas.device.mobile`,label:(0,Z.jsx)(W,{className:`size-[13px]`})}]}),(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`canvas.zoom`,title:o===`fit`?`Show canvas at 100%`:`Fit canvas to workspace`,"aria-label":o===`fit`?`Show canvas at 100%`:`Fit canvas to workspace`,onClick:()=>d(o===`fit`?`100`:`fit`),className:fB(`text-muted-foreground hover:bg-muted hover:text-foreground inline-flex h-7 items-center gap-1.5 rounded-[6px] px-2 text-[11.5px] transition-colors`,o===`fit`&&`bg-sel-soft text-accent-email`),children:[(0,Z.jsx)(A,{className:`size-[14px]`}),o===`fit`?`Fit`:`100%`]})]})]})}function GV(){let e=$(vP(e=>e.checks.filter(e=>e.severity===`error`))),t=e.length>0;return(0,Z.jsxs)(`div`,{"data-testid":`canvas.unbuilt`,"data-unbuilt-reason":t?`failed`:`not-built`,className:`border-border bg-surface-inset text-foreground rounded-xl border border-dashed p-6 text-[12.5px]`,children:[(0,Z.jsx)(`p`,{className:`font-medium`,children:t?`No preview`:`No preview yet`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-1`,children:t?`The current draft broke the preview. Fix the source and it will come back.`:`Nothing has run this entry yet. The next pass puts the preview here.`}),t&&(0,Z.jsx)(`ul`,{className:`mt-4 space-y-2`,children:e.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(EB,{check:e})},e.id))})]})}var KV={body:ee,div:H,table:re,tbody:re,tr:re,td:ye,th:ye,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,p:de,span:de,a:M,button:M,img:ae,hr:B,br:k,ul:j,ol:j,li:j},qV=e=>KV[e.toLowerCase()]??H;function JV({node:e,depth:t}){let{selectedPath:n,expandedLayers:r}=$(vP(e=>({selectedPath:e.selection.kind===`element`?e.selection.instancePath:null,expandedLayers:e.expandedLayers}))),{select:i,toggleLayerExpand:a,setHovered:o}=$(e=>e.actions),s=e.children.length>0,c=r.has(e.instancePath),l=n===e.instancePath,{selection:u}=e;return(0,Z.jsxs)(`li`,{children:[(0,Z.jsx)(`div`,{className:`group relative`,style:{paddingLeft:t*12},onMouseEnter:()=>o(e.instancePath),onMouseLeave:()=>o(null),children:(0,Z.jsxs)(`div`,{className:fB(`flex h-[30px] w-full items-center gap-1.5 rounded-[7px] pr-2 pl-1.5 text-left transition-colors`,l?`bg-sel-soft text-accent-email`:`text-foreground hover:bg-muted`),children:[s?(0,Z.jsx)(`button`,{type:`button`,"aria-expanded":c,"data-testid":`left-rail.layer.toggle`,"aria-label":`${c?`Collapse`:`Expand`} ${ez(u)}`,className:fB(`grid size-3.5 shrink-0 place-items-center text-muted-foreground transition-transform`,c&&`rotate-90`),onClick:t=>{t.stopPropagation(),a(e.instancePath)},children:(0,Z.jsx)(I,{className:`size-[11px]`})}):(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`size-3.5 shrink-0`}),(0,Z.jsxs)(`button`,{"data-layer-instance-path":e.instancePath,"data-testid":`layers.node.${e.instancePath}`,type:`button`,onClick:()=>i(e.instancePath),className:`flex min-w-0 flex-1 items-center gap-1.5 text-left`,children:[(0,T.createElement)(qV(u.tag),{className:fB(`size-[15px] shrink-0`,l?`text-accent-email`:`text-muted-foreground`)}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12.5px]`,children:ez(u)}),!u.authored&&(0,Z.jsx)(`span`,{className:`text-placeholder shrink-0 text-[10px]`,children:`generated`})]})]})}),s&&c&&(0,Z.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.children.map(e=>(0,Z.jsx)(JV,{node:e,depth:t+1},e.instancePath))})]})}function YV(){let e=$(e=>e.outline);return e===null?(0,Z.jsx)(`div`,{className:`text-placeholder px-3 py-8 text-center text-xs`,children:`There is no preview yet, so there are no layers to show.`}):(0,Z.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.roots.map(e=>(0,Z.jsx)(JV,{node:e,depth:0},e.instancePath))})}function XV(){let e=Qz(),{leftCollapsed:t,leftWidth:n,layoutMode:r}=$(vP(e=>({leftCollapsed:e.leftCollapsed,leftWidth:e.leftWidth,layoutMode:e.layoutMode}))),{toggleLeft:i}=$(e=>e.actions),a=r===`compact`||r===`narrow`;return(0,Z.jsx)(`aside`,{"aria-label":`Layers`,"aria-hidden":t||void 0,inert:t||void 0,"data-editor-rail":`left`,style:{width:t?0:n,maxWidth:a?`calc(100% - 48px)`:void 0},className:fB(`flex h-full shrink-0 flex-col overflow-hidden border-r border-border bg-background transition-[width,transform,box-shadow] duration-180 ease-out`,a&&`absolute inset-y-0 left-0 z-40 shadow-[var(--shadow-floating)]`,t&&`border-r-0`),children:(0,Z.jsxs)(`div`,{className:`flex h-full min-w-0 flex-col`,style:{width:n,maxWidth:`100%`},children:[(0,Z.jsxs)(`div`,{className:`border-border-subtle flex items-center gap-0.5 border-b px-3 py-2`,children:[(0,Z.jsx)(`span`,{className:`text-foreground text-[12.5px] font-medium`,children:`Layers`}),(0,Z.jsxs)(tj,{children:[(0,Z.jsx)(lj,{render:(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Collapse layers`,"data-testid":`left-rail.collapse`,onClick:i,className:`text-muted-foreground hover:bg-muted hover:text-foreground ml-auto rounded-md p-1.5`}),children:(0,Z.jsx)(pe,{className:`size-[15px]`})}),(0,Z.jsx)(pj,{container:e,children:(0,Z.jsx)(Ij,{side:`bottom`,sideOffset:5,className:`z-[200]`,children:(0,Z.jsx)(Lj,{role:`tooltip`,className:`bg-foreground text-background rounded-md px-2 py-1 text-[11px] shadow-[var(--shadow-md)]`,children:`Collapse layers`})})})]})]}),(0,Z.jsxs)(tF,{"data-samva-scroll-area":`layers`,className:`relative min-h-0 flex-1`,children:[(0,Z.jsx)(pF,{className:`size-full`,children:(0,Z.jsx)(`div`,{className:`px-2 pt-2.5 pb-5`,children:(0,Z.jsx)(YV,{})})}),(0,Z.jsx)(yF,{orientation:`vertical`,className:`absolute top-0 right-0 bottom-0 flex w-2.5 touch-none p-0.5 select-none`,children:(0,Z.jsx)(bF,{className:`relative flex-1 rounded-full bg-[var(--editor-scrollbar-thumb)] hover:bg-[var(--editor-scrollbar-thumb-hover)]`})})]})]})})}var ZV=fB(`flex flex-1 items-center justify-center gap-1.5 px-2 text-[12px]`,vB),QV={layers:{label:`Layers`,Icon:oe},inspector:{label:`Inspector`,Icon:ge},review:{label:`Review`,Icon:ne}},$V=[`layers`,`inspector`,`review`];function eH({view:e,sourceEditable:t,review:n}){return e===`layers`?(0,Z.jsx)(`div`,{className:`samva-editor-scroll h-full overflow-y-auto px-2 pt-2.5 pb-5`,children:(0,Z.jsx)(YV,{})}):e===`review`&&n!==null?(0,Z.jsx)(`div`,{className:`samva-editor-scroll h-full overflow-y-auto px-2 pt-2.5 pb-5`,children:n.content}):t?(0,Z.jsx)(XB,{embedded:!0}):(0,Z.jsx)(ZB,{embedded:!0})}function tH({focused:e=!1}){let t=$(e=>e.sourceEditable),n=$(e=>e.rightWidth),r=$(e=>e.designView),i=$(e=>e.actions.setDesignView),a=cB(),o=r===`review`&&a===null?`layers`:r,s=(0,T.useId)(),c=`${s}-panel`;return(0,Z.jsxs)(`aside`,{"aria-label":`Design`,"data-testid":`design-rail`,"data-editor-rail":`right`,style:e?void 0:{width:n},className:fB(`bg-background flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,e?`w-full flex-1`:`shrink-0 border-l border-border`),children:[(0,Z.jsx)(`div`,{className:`border-border-subtle flex min-h-11 shrink-0 items-center border-b px-2 py-1.5`,children:(0,Z.jsx)(AP,{role:`tablist`,"aria-label":`Design view`,value:[o],onValueChange:e=>{let t=e[0];(t===`layers`||t===`inspector`)&&i(t),t===`review`&&a!==null&&i(`review`)},className:`bg-muted flex flex-1 gap-0.5 rounded-lg p-0.5`,children:$V.filter(e=>e!==`review`||a!==null).map(e=>{let{Icon:t,label:n}=QV[e];return(0,Z.jsxs)(CP,{id:`${s}-tab-${e}`,type:`button`,role:`tab`,"aria-selected":o===e,"aria-controls":c,"aria-pressed":void 0,value:e,"data-testid":`design.tab.${e}`,className:ZV,children:[(0,Z.jsx)(t,{className:`size-[14px]`}),n,e===`review`&&a?.badge]},e)})})}),(0,Z.jsx)(`div`,{role:`tabpanel`,id:c,"aria-labelledby":`${s}-tab-${o}`,className:`min-h-0 flex-1`,children:(0,Z.jsx)(eH,{view:o,sourceEditable:t,review:a})})]})}function nH({side:e}){let t=$(e=>e.leftWidth),n=$(e=>e.assistantWidth),r=$(e=>e.rightWidth),{setAssistantWidth:i,setLeftWidth:a,setRightWidth:o}=$(e=>e.actions),s=(0,T.useRef)(!1);return(0,T.useEffect)(()=>{let t=t=>{s.current&&(e===`assistant`?i(t.clientX):e===`assistant-end`?i(window.innerWidth-t.clientX):e===`left`?a(t.clientX):o(window.innerWidth-t.clientX))},n=()=>{s.current&&(s.current=!1,document.body.style.cursor=``,document.body.style.userSelect=``)};return window.addEventListener(`mousemove`,t),window.addEventListener(`mouseup`,n),()=>{window.removeEventListener(`mousemove`,t),window.removeEventListener(`mouseup`,n)}},[e,i,a,o]),(0,Z.jsx)(`div`,{"data-editor-resize":e,role:`separator`,"aria-orientation":`vertical`,"aria-valuenow":e===`assistant`||e===`assistant-end`?n:e===`left`?t:r,"aria-label":e===`assistant`||e===`assistant-end`?`Resize Assistant`:e===`left`?`Resize layers panel`:`Resize inspector`,"data-testid":e===`assistant`||e===`assistant-end`?`agent-column.resize`:e===`left`?`left-rail.resize`:`inspector.resize`,tabIndex:0,onMouseDown:e=>{e.preventDefault(),s.current=!0,document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},onKeyDown:s=>{let c=s.shiftKey?24:8;(s.key===`ArrowLeft`||s.key===`ArrowRight`)&&(s.preventDefault(),e===`assistant`?(s.key===`ArrowLeft`&&i(n-c),s.key===`ArrowRight`&&i(n+c)):e===`assistant-end`?(s.key===`ArrowLeft`&&i(n+c),s.key===`ArrowRight`&&i(n-c)):e===`left`?(s.key===`ArrowLeft`&&a(t-c),s.key===`ArrowRight`&&a(t+c)):(s.key===`ArrowLeft`&&o(r+c),s.key===`ArrowRight`&&o(r-c)))},className:fB(`group relative z-10 w-2 shrink-0 cursor-col-resize`,`before:absolute before:inset-y-0 before:left-1/2 before:w-px before:-translate-x-1/2 before:bg-border before:transition-colors`,`hover:before:w-0.5 hover:before:bg-accent-email active:before:bg-accent-email`,`after:absolute after:top-1/2 after:left-1/2 after:h-10 after:w-1 after:-translate-x-1/2 after:-translate-y-1/2 after:rounded-full after:bg-muted-foreground/35 after:opacity-60 after:transition-opacity`,`hover:after:opacity-100 hover:after:bg-accent-email`)})}var rH={assistant:{label:`Assistant`,tip:`Show the assistant`,Icon:_e},preview:{label:`Preview`,tip:`Show the preview`,Icon:te},design:{label:`Design`,tip:`Show designs, layers, and inspector`,Icon:oe}};function iH(){let e=$(e=>e.sourceEditable),t=$(e=>e.leftCollapsed),n=$(e=>e.rightCollapsed),r=$(e=>e.layoutMode),i=nB(),a=cB(),o=$(e=>e.workspaceView),s=$(e=>e.focusedPane),c=$(e=>e.actions.setFocusedPane),l=QR(),u=e=>l.setState({workspaceView:e}),d=(0,T.useId)(),f=i&&r===`compact`,p=i&&r===`narrow`,m=f||p,h=f?[`assistant`,`preview`,`design`]:[`assistant`,`preview`],g=o===`source`?`preview`:h.includes(s)?s:`assistant`;return i?(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,Z.jsx)(iV,{value:o,onChange:e=>{u(e),m&&c(`preview`)},idBase:d,panelId:`${d}-view-panel`}),m&&(0,Z.jsx)(AP,{role:`tablist`,value:[g],onValueChange:e=>{let t=e[0];h.some(e=>e===t)&&(c(t),t!==`preview`&&o===`source`&&u(`visual`))},"aria-label":`Editor pane`,className:`border-border bg-background flex h-11 shrink-0 items-center gap-1 border-b p-1.5`,children:h.map(e=>{let{Icon:t,label:n,tip:r}=rH[e];return(0,Z.jsxs)(CP,{id:`${d}-tab-${e}`,type:`button`,role:`tab`,"aria-selected":g===e,"aria-controls":`${d}-pane-${e}`,"aria-pressed":void 0,value:e,title:r,"data-testid":`agent-workspace.tab.${e}`,className:fB(vB,`h-8 flex-1 px-2.5 text-[12px]`),children:[(0,Z.jsx)(t,{className:`size-3.5 shrink-0`}),n,e===`design`&&a?.badge]},e)})}),(0,Z.jsxs)(`div`,{className:`relative flex min-h-0 min-w-0 flex-1`,"data-agent-workspace-layout":m?`focused`:`split`,children:[(0,Z.jsx)(`div`,{id:`${d}-pane-assistant`,role:m?`tabpanel`:void 0,"aria-labelledby":m?`${d}-tab-assistant`:void 0,hidden:m&&g!==`assistant`,className:fB(!m&&`contents`,m&&g===`assistant`&&`flex h-full min-h-0 min-w-0 flex-1`),children:(0,Z.jsx)(xB,{hidden:m&&g!==`assistant`})}),!m&&(0,Z.jsx)(nH,{side:`assistant`}),(0,Z.jsx)(`div`,{id:`${d}-pane-preview`,role:m?`tabpanel`:void 0,"aria-labelledby":m?`${d}-tab-preview`:void 0,hidden:m&&g!==`preview`,className:fB(`min-h-0 min-w-0 flex-1`,(!m||g===`preview`)&&`flex`),children:(0,Z.jsx)(`div`,{id:`${d}-view-panel`,role:`tabpanel`,"aria-labelledby":rV(d,o),className:`flex min-h-0 min-w-0 flex-1`,children:o===`source`?(0,Z.jsx)(tV,{}):(0,Z.jsx)(WV,{pointing:!0})})}),!m&&(0,Z.jsx)(nH,{side:`right`}),(0,Z.jsx)(`div`,{id:`${d}-pane-design`,role:f?`tabpanel`:void 0,"aria-labelledby":f?`${d}-tab-design`:void 0,hidden:m&&g!==`design`,className:fB(!m&&`contents`,m&&g===`design`&&`flex h-full min-h-0 min-w-0 flex-1`),children:p?null:(0,Z.jsx)(tH,{focused:m})})]})]}):(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,Z.jsx)(FB,{}),(0,Z.jsx)(iV,{value:o,onChange:u,children:o===`source`?(0,Z.jsx)(tV,{}):(0,Z.jsxs)(`div`,{className:`relative flex min-h-0 min-w-0 flex-1`,children:[(0,Z.jsx)(XV,{}),!t&&(0,Z.jsx)(nH,{side:`left`}),(0,Z.jsx)(WV,{}),!n&&(0,Z.jsx)(nH,{side:`right`}),(0,Z.jsx)(QB,{readOnly:!e})]})})]})}var aH=RegExp(`\\s${LS}="[^"]*"`,`g`),oH=e=>e.replace(aH,``),sH=e=>{let t=e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``);return t===``?`email`:t},cH=(e,t)=>{let n=new Blob([oH(e)],{type:`text/html;charset=utf-8`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`${sH(t)}.html`,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(r)},lH=e=>Ue(e,`reason`)&&typeof e.reason==`string`?e.reason:`The template project operation failed.`,uH=e=>e.isPublished?`Published`:e.isHead?`Current saved version`:`Saved version`;function dH({file:e,content:t,busy:n,onChange:r,onApply:i}){let a=e.status===`conflicted`;return(0,Z.jsxs)(`div`,{className:`border-border space-y-3 rounded-lg border p-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsx)(`h4`,{className:`truncate font-mono text-xs font-semibold`,children:e.path}),(0,Z.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-xs`,children:e.status})]}),e.binary===!0?(0,Z.jsx)(`p`,{className:`text-muted-foreground text-xs`,"data-testid":`lifecycle-sheet.binary-file`,children:`Binary assets come from the saved version. Restore another version to change this asset.`}):a?(0,Z.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Resolve this file below before editing its workspace source.`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`textarea`,{"aria-label":`Project source for ${e.path}`,"data-testid":`lifecycle-sheet.file-source.${e.path}`,value:t,onChange:e=>r(e.target.value),disabled:n,spellCheck:!1,className:`border-border bg-surface-inset text-foreground min-h-52 w-full resize-y rounded-md border p-3 font-mono text-xs outline-none disabled:opacity-60`}),(0,Z.jsx)(`button`,{type:`button`,disabled:n||t===e.content,"data-testid":`lifecycle-sheet.apply-file.${e.path}`,onClick:()=>i(t),className:fB(`bg-primary text-primary-foreground rounded-md px-3 py-2 text-xs font-medium disabled:opacity-50`,pB),children:`Apply file`})]})]})}function fH({conflict:e,busy:t,onResolve:n}){let[r,i]=(0,T.useState)(e.draft??e.main??``);return(0,Z.jsxs)(`article`,{className:`border-status-warning/45 space-y-3 rounded-lg border p-4`,children:[(0,Z.jsx)(`h4`,{className:`font-mono text-xs font-semibold`,children:e.path}),(0,Z.jsxs)(`details`,{className:`border-border rounded-md border`,children:[(0,Z.jsx)(`summary`,{className:`hover:bg-muted cursor-pointer px-3 py-2 text-xs font-medium`,children:`Compare base, draft, and main`}),(0,Z.jsx)(`div`,{className:`divide-border border-border divide-y border-t`,children:[[`Base`,e.base],[`Draft`,e.draft],[`Latest saved version`,e.main]].map(([e,t])=>(0,Z.jsxs)(`div`,{className:`space-y-1 p-3`,children:[(0,Z.jsx)(`p`,{className:`text-muted-foreground text-[11px] font-medium`,children:e}),(0,Z.jsx)(`pre`,{className:`samva-editor-scroll max-h-32 overflow-auto font-mono text-xs whitespace-pre-wrap`,children:t??`File does not exist`})]},e))})]}),(0,Z.jsx)(`textarea`,{"aria-label":`Resolved source for ${e.path}`,"data-testid":`lifecycle-sheet.conflict-source.${e.path}`,value:r,onChange:e=>i(e.target.value),spellCheck:!1,className:`border-border bg-surface-inset text-foreground min-h-40 w-full resize-y rounded-md border p-3 font-mono text-xs outline-none`}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Z.jsx)(`button`,{type:`button`,disabled:t,onClick:()=>n(`draft`),"data-testid":`lifecycle-sheet.keep-draft`,className:fB(`border-border hover:bg-muted rounded-md border px-3 py-2 text-xs`,pB),children:`Keep draft`}),(0,Z.jsx)(`button`,{type:`button`,disabled:t,onClick:()=>n(`main`),className:fB(`border-border hover:bg-muted rounded-md border px-3 py-2 text-xs`,pB),children:`Use saved version`}),(0,Z.jsx)(`button`,{type:`button`,disabled:t,"data-testid":`lifecycle-sheet.resolve-edited.${e.path}`,onClick:()=>n({content:r}),className:fB(`bg-primary text-primary-foreground rounded-md px-3 py-2 text-xs font-medium`,pB),children:`Use edited source`})]})]})}function pH({open:e,onClose:t,onLockedAction:n}){return e?(0,Z.jsx)(mH,{onClose:t,onLockedAction:n}):null}function mH({onClose:e,onLockedAction:t}){let n=Qz(),r=$(e=>e.doc),i=$(e=>e.lifecycleCapability),{beginLifecycle:a,endLifecycle:o,flushSaves:s,adoptLifecycleSnapshot:c}=$(e=>e.actions),l=r!==null&&i?.status===`ready`,[u,d]=(0,T.useState)(null),[f,p]=(0,T.useState)(null),[m,h]=(0,T.useState)(null),[g,_]=(0,T.useState)({}),[v,y]=(0,T.useState)(()=>l?`loading`:null),[b,x]=(0,T.useState)(null),[S,C]=(0,T.useState)(null),[w,E]=(0,T.useState)(l);if(l!==w&&(E(l),l&&(y(`loading`),d(null),x(null),C(null),p(null),h(null),_({}))),(0,T.useEffect)(()=>{if(i?.status!==`ready`)return;let e=!1;return s().then(()=>i.api.inspect()).then(t=>{if(e)return;d(t);let n=r?.origin.kind===`tsx`?r.origin.file:void 0;h(e=>e!==null&&t.files.some(({path:t})=>t===e)?e:n!==void 0&&t.files.some(({path:e})=>e===n)?n:t.files[0]?.path??null)}).catch(t=>{e||x(lH(t))}).finally(()=>{e||y(null)}),()=>{e=!0}},[r,s,i]),i===void 0)return null;if(i.status===`locked`)return(0,Z.jsx)(zF,{open:!0,onOpenChange:t=>!t&&e(),children:(0,Z.jsxs)(MF,{container:n,children:[(0,Z.jsx)(CF,{className:`fixed inset-0 z-[110] bg-[var(--editor-backdrop,rgb(0_0_0/0.28))]`}),(0,Z.jsx)(BF,{className:`fixed inset-0 z-[111] grid place-items-center p-4`,children:(0,Z.jsxs)(jF,{className:`border-border bg-popover w-full max-w-lg rounded-xl border p-5 shadow-[var(--shadow-floating)]`,children:[(0,Z.jsx)(VF,{className:`text-base font-semibold`,children:`Publishing is unavailable`}),(0,Z.jsx)(TF,{className:`text-muted-foreground mt-2 text-sm`,"data-testid":`lifecycle-sheet.locked-reason`,children:i.upsell.reason}),(0,Z.jsx)(`a`,{"data-testid":`lifecycle-sheet.upsell-cta`,className:fB(`bg-primary text-primary-foreground mt-4 inline-flex rounded-md px-3 py-2 text-sm font-medium`,pB),href:i.upsell.cta.href,onClick:e=>{t!==void 0&&(e.preventDefault(),t())},children:i.upsell.cta.label}),(0,Z.jsx)(wF,{className:fB(`border-border hover:bg-muted mt-4 ml-2 inline-flex rounded-md border px-3 py-2 text-sm font-medium`,pB),children:`Close`})]})})]})});let D=u?.commits.find(({commit:e})=>e===f),O=u?.files.find(({path:e})=>e===m),k=O?.content??``,A=O===void 0?void 0:g[O.path],j=A?.baseContent===k?A.content:k,M=u?.files.some(e=>{let t=g[e.path],n=e.content??``;return t?.baseContent===n&&t.content!==n})??!1,N=u!==null&&!u.dirty&&u.conflicts.length===0&&!M,P=u?.commits.find(({commit:e})=>e===u.baseCommit),F=N&&u?.baseCommit===u.remoteHead,I=async()=>d(await i.api.inspect()),L=()=>{u!==null&&F&&v===null&&a()&&(y(`publish`),x(null),i.api.publish({baseRev:u.rev,commit:u.baseCommit}).then(async()=>{await I(),C(`Published the current saved version.`)}).catch(e=>x(lH(e))).finally(()=>{o(),y(null)}))},R=()=>{u!==null&&D!==void 0&&!D.isHead&&N&&v===null&&a()&&(y(`restore`),x(null),s().then(e=>i.api.restore({commit:D.commit,baseRev:e})).then(async e=>{c(e),await I(),p(null),C(`Restored the saved version to the draft. Save a version to keep this restore.`)}).catch(e=>x(lH(e))).finally(()=>{o(),y(null)}))},z=(e,t)=>{u!==null&&v===null&&a()&&(y(`resolve`),x(null),s().then(n=>i.api.resolveConflict({path:e.path,baseRev:n,resolution:t})).then(t=>{d(t),C(`Resolved ${e.path}.`)}).catch(e=>x(lH(e))).finally(()=>{o(),y(null)}))},B=(e,t)=>{u!==null&&v===null&&(y(`file`),x(null),i.api.updateFile({path:e.path,baseRev:u.rev,content:t}).then(t=>{d(t),_(t=>{let{[e.path]:n,...r}=t;return r}),C(`Updated ${e.path}.`)}).catch(e=>x(lH(e))).finally(()=>y(null)))};return(0,Z.jsx)(TL,{open:!0,onOpenChange:t=>!t&&e(),swipeDirection:`right`,children:(0,Z.jsxs)(SL,{container:n,children:[(0,Z.jsx)(QI,{className:`fixed inset-0 z-[110] bg-[var(--editor-backdrop,rgb(0_0_0/0.28))]`}),(0,Z.jsx)(dR,{className:`pointer-events-none fixed inset-0 z-[111] flex justify-end`,children:(0,Z.jsxs)(xL,{className:`border-border bg-popover pointer-events-auto flex h-full w-full max-w-2xl flex-col border-l shadow-[var(--shadow-floating)]`,children:[(0,Z.jsxs)(`header`,{className:`border-border flex items-center justify-between border-b px-5 py-4`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(JL,{className:`text-base font-semibold`,children:`Publish and saved versions`}),(0,Z.jsx)(tL,{className:`text-muted-foreground mt-0.5 text-xs`,children:`Save keeps a named version. Restore brings an older version into your draft.`})]}),(0,Z.jsx)($I,{className:fB(`hover:bg-muted rounded-md px-2 py-1 text-sm`,pB),children:`Close`})]}),(0,Z.jsxs)(`div`,{className:`samva-editor-scroll min-h-0 flex-1 space-y-6 overflow-y-auto p-5`,children:[v===`loading`&&(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Loading saved versions…`}),b!==null&&(0,Z.jsx)(`p`,{className:`text-status-error text-sm`,role:`alert`,children:b}),S!==null&&(0,Z.jsx)(`p`,{className:`text-status-success text-sm`,role:`status`,"data-testid":`lifecycle-sheet.notice`,children:S}),u!==null&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`section`,{className:`border-border bg-muted/30 space-y-3 rounded-lg border p-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Current saved version`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-1 text-xs`,children:P?.message??`Current saved version`})]}),(0,Z.jsx)(`button`,{type:`button`,onClick:L,disabled:!F||v!==null,"data-testid":`lifecycle-sheet.confirm-publish`,className:fB(`bg-primary text-primary-foreground rounded-md px-3 py-2 text-sm font-medium disabled:opacity-50`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`),children:v===`publish`?`Publishing…`:`Publish saved version`})]}),!N&&(0,Z.jsx)(`p`,{className:`text-muted-foreground text-xs`,"data-testid":`lifecycle-sheet.cleanliness-warning`,children:u.conflicts.length>0?`Resolve workspace conflicts before Save or Publish.`:`The draft has unsaved changes. Save a version before publishing or restoring.`}),N&&u.baseCommit!==u.remoteHead&&(0,Z.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`The saved version changed elsewhere. Refresh before publishing.`})]}),(0,Z.jsxs)(`section`,{className:`space-y-2`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Project files`}),(0,Z.jsx)(`div`,{className:`border-border divide-border divide-y rounded-lg border`,children:u.files.map(e=>(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`lifecycle-sheet.file.${e.path}`,onClick:()=>h(e.path),className:fB(`hover:bg-muted flex w-full items-center justify-between gap-4 px-3 py-2 text-left`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,m===e.path&&`bg-muted`),children:[(0,Z.jsx)(`span`,{className:`truncate font-mono text-xs`,children:e.path}),(0,Z.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-xs`,children:e.status})]},e.path))}),O!==void 0&&(0,Z.jsx)(dH,{file:O,content:j,busy:v!==null,onChange:e=>_(t=>{if(e===k){let{[O.path]:e,...n}=t;return n}return{...t,[O.path]:{baseContent:k,content:e}}}),onApply:e=>B(O,e)},`${O.path}:${O.content??``}`)]}),u.conflicts.length>0&&(0,Z.jsxs)(`section`,{className:`space-y-3`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Resolve conflicts`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-1 text-xs`,children:`Choose either side or edit the final file. Save remains blocked until every path is resolved.`})]}),u.conflicts.map(e=>(0,Z.jsx)(fH,{conflict:e,busy:v!==null,onResolve:t=>z(e,t)},e.path))]}),(0,Z.jsxs)(`section`,{className:`space-y-2`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Saved versions`}),(0,Z.jsx)(`div`,{className:`space-y-2`,children:u.commits.map(e=>(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`lifecycle-sheet.commit.${e.commit}`,onClick:()=>p(e.commit),className:fB(`border-border hover:bg-muted flex w-full items-start justify-between gap-4 rounded-lg border p-3 text-left`,f===e.commit&&`ring-primary ring-2`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`),children:[(0,Z.jsxs)(`span`,{className:`min-w-0`,children:[(0,Z.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.message}),(0,Z.jsx)(`span`,{className:`text-muted-foreground mt-1 block text-xs`,children:e.committedAt.toLocaleString()})]}),(0,Z.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-xs`,children:uH(e)})]},e.commit))})]}),D!==void 0&&!D.isHead&&(0,Z.jsxs)(`section`,{className:`border-border space-y-3 rounded-lg border p-4`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Restore saved version`}),(0,Z.jsxs)(`p`,{className:`text-muted-foreground mt-1 text-xs`,children:[`Bring “`,D.message,`” into the current draft. Save a version when you want to keep the restored draft.`]})]}),(0,Z.jsx)(`button`,{type:`button`,onClick:R,disabled:!N||v!==null,"data-testid":`lifecycle-sheet.restore`,className:fB(`border-border hover:bg-muted rounded-md border px-3 py-2 text-sm`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`),children:v===`restore`?`Restoring…`:`Restore this version`})]})]})]})]})})]})})}var hH={desktop:600,mobile:375},gH=`Copy code`;function _H({open:e,onClose:t}){return e?(0,Z.jsx)(vH,{onClose:t}):null}function vH({onClose:e}){let t=Qz(),{doc:n,render:r,compiled:i,checks:a,previewDevice:o}=$(vP(e=>({doc:e.doc,render:e.render,compiled:e.compiled,checks:e.checks,previewDevice:e.previewDevice}))),[s,c]=(0,T.useState)(`preview`),[l,u]=(0,T.useState)(o),[d,f]=(0,T.useState)(`light`),[p,m]=(0,T.useState)(n?.channel);n?.channel!==p&&(m(n?.channel),c(`preview`));let[h,g]=(0,T.useState)(o);if(o!==h&&(g(o),c(`preview`),u(o),f(`light`)),n===null)return null;let _=n.metadata.fromDefault,v=i!==null&&i.ok?i.artifact:null,y=Object.fromEntries(n.variables.map(e=>[e.name,e.sample??`{{${e.name}}}`])),b=e=>e===void 0?``:fP(e,y),x=(e,t)=>({value:e,label:t,testId:`preview-overlay.view.${e}`}),S=n.channel===`email`?[x(`preview`,`Preview`),x(`html`,`HTML`),x(`text`,`Text`),x(`source`,`TSX`)]:n.channel===`sms`?[x(`preview`,`Preview`),x(`text`,`Text`),x(`source`,`SML`)]:[x(`preview`,`Preview`),x(`payload`,`Payload`),x(`source`,`SML`)],C=s===`source`?n.channel===`email`?n.origin.authoredSource:n.source:s===`html`&&r!==null?r.html:s===`text`&&r!==null?r.text:s===`text`&&v?.channel===`sms`?v.body:s===`payload`&&v?.channel===`whatsapp`?JSON.stringify(v,null,2):``;return(0,Z.jsx)(zF,{open:!0,onOpenChange:t=>!t&&e(),children:(0,Z.jsx)(MF,{container:t,children:(0,Z.jsxs)(jF,{className:`samva-editor-shell fixed inset-0 z-[100] flex flex-col bg-[var(--editor-canvas-bg)] outline-none`,children:[(0,Z.jsx)(VF,{className:`sr-only`,children:`Template preview`}),(0,Z.jsx)(TF,{className:`sr-only`,children:`Preview the rendered template and inspect its generated output.`}),(0,Z.jsxs)(`div`,{"data-testid":`preview-overlay.toolbar`,className:`border-border-subtle flex shrink-0 flex-wrap items-center gap-2 border-b px-3 py-2.5 sm:gap-2.5 sm:px-4`,children:[(0,Z.jsx)(`span`,{className:`text-[13px] font-semibold`,children:`Preview`}),(0,Z.jsx)(`span`,{className:`text-muted-foreground hidden text-xs sm:inline`,children:`rendered message, exactly what ships`}),(0,Z.jsx)(yB,{ariaLabel:`Preview format`,testId:`preview-overlay.format-group`,value:s,onChange:e=>c(e),options:S}),(0,Z.jsx)(`span`,{className:`hidden flex-1 sm:block`}),n.channel===`email`&&s===`preview`&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(yB,{ariaLabel:`Preview width`,testId:`preview-overlay.width-group`,value:l,onChange:e=>u(e),options:[{value:`desktop`,label:`Desktop`,testId:`preview-overlay.device.desktop`},{value:`mobile`,label:`Mobile`,testId:`preview-overlay.device.mobile`}]}),(0,Z.jsx)(yB,{ariaLabel:`Preview color scheme`,testId:`preview-overlay.color-scheme-group`,value:d,onChange:e=>f(e),options:[{value:`light`,label:`Light`,testId:`preview-overlay.scheme.light`},{value:`dark`,label:`Dark`,testId:`preview-overlay.scheme.dark`}]}),(0,Z.jsx)(OB,{checks:a})]}),(0,Z.jsxs)(wF,{"data-testid":`preview-overlay.close`,className:`border-border text-foreground hover:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 ml-auto inline-flex h-[30px] items-center gap-1.5 rounded-[7px] border px-2.5 outline-none focus-visible:ring-[3px]`,children:[`Close`,(0,Z.jsx)(`kbd`,{className:`text-muted-foreground text-[10px]`,children:`⎋`})]})]}),s===`preview`?n.channel===`email`?(0,Z.jsxs)(`div`,{className:`samva-editor-scroll flex-1 overflow-auto px-6 pt-3 pb-12`,children:[(0,Z.jsxs)(`div`,{"data-testid":`preview-overlay.device-frame`,className:fB(`mx-auto mb-3.5 max-w-full truncate text-[12.5px] text-muted-foreground transition-[width] duration-180`,l===`mobile`?`w-[375px]`:`w-[600px]`),children:[_!==void 0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`b`,{className:`text-foreground font-semibold`,children:_.name??_.email}),_.name===void 0?null:(0,Z.jsxs)(Z.Fragment,{children:[` <`,_.email,`>`]}),` ·`,` `]}),(0,Z.jsx)(`b`,{className:`text-foreground font-semibold`,children:r?.subject??``}),r?.preheader!==void 0&&(0,Z.jsxs)(`span`,{className:`opacity-70`,children:[` — `,r.preheader]})]}),(0,Z.jsx)(`div`,{className:fB(`mx-auto h-[calc(100%-2rem)] max-w-full transition-[width] duration-180 ease-out`,l===`mobile`?`w-[375px]`:`w-[600px]`),children:r===null?(0,Z.jsx)(`pre`,{className:`border-status-error/40 bg-background text-status-error rounded-lg border p-4 font-mono text-xs whitespace-pre-wrap`,children:`The current draft did not build, so there is nothing to preview.`}):(0,Z.jsx)(FV,{html:r.html,width:hH[l],forceColorScheme:d})})]}):(0,Z.jsx)(`div`,{className:`samva-editor-scroll flex-1 overflow-auto p-8`,children:(0,Z.jsx)(`div`,{className:`border-border bg-background mx-auto max-w-[460px] rounded-[28px] border p-5 shadow-[var(--shadow-lg)]`,children:v?.channel===`sms`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{"data-testid":`preview-overlay.sms-body`,className:`bg-muted rounded-[18px] px-4 py-3 text-[14px] whitespace-pre-wrap`,children:b(v.body)}),(0,Z.jsxs)(`p`,{className:`text-muted-foreground mt-4 text-center text-xs`,children:[v.encoding.toUpperCase(),` · `,v.estimatedSegments,` `,`segment`,v.estimatedSegments===1?``:`s`]})]}):v?.channel===`whatsapp`?(0,Z.jsxs)(`div`,{className:`bg-surface-inset rounded-xl p-3.5`,children:[b(v.headerContent)!==``&&(0,Z.jsx)(`p`,{className:`mb-1 font-semibold`,children:b(v.headerContent)}),(0,Z.jsx)(`p`,{className:`whitespace-pre-wrap`,children:b(v.bodyContent)}),b(v.footerContent)!==``&&(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-2 text-xs`,children:b(v.footerContent)}),v.buttons.map((e,t)=>(0,Z.jsx)(`div`,{className:`border-border-subtle text-accent-email mt-2 border-t pt-2 text-center text-xs`,children:e.type===`COPY_CODE`?gH:b(e.text)},`${e.type}-${t}`))]}):(0,Z.jsx)(`pre`,{className:`text-status-error whitespace-pre-wrap`,children:i!==null&&!i.ok?i.message:`No compiled preview.`})})}):(0,Z.jsx)(`div`,{className:`samva-editor-scroll flex-1 overflow-auto p-6`,children:(0,Z.jsx)(`pre`,{className:`border-border bg-background text-foreground mx-auto min-h-full max-w-[1100px] rounded-lg border p-5 font-mono text-[12px] leading-5 whitespace-pre-wrap`,children:C})})]})})})}var yH=`text-[11px] font-semibold tracking-[0.05em] text-muted-foreground uppercase`,bH=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,xH=/^\+[1-9]\d{6,14}$/,SH=(e,t)=>Ue(e,`reason`)&&typeof e.reason==`string`?e.reason:Ue(e,`_tag`)&&e._tag===`DocumentConflict`?`The template changed since you opened this. Reopen the sheet and retry.`:t,CH=()=>{let e=new Date;return new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,16)},wH=e=>new Date(El(e)).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}),TH={idle:`Send test to me`,sending:`Sending…`,sent:`Test sent`,error:`Retry test`},EH=(e,t)=>e===`sending`?t?`Scheduling…`:`Sending…`:e===`sent`?t?`Scheduled`:`Sent`:e===`error`?`Retry`:t?`Schedule`:`Send now`;function DH({open:e,onClose:t,onLockedAction:n}){let r=Qz(),i=$(e=>e.doc),a=$(e=>e.sendCapability),{flushSaves:o}=$(e=>e.actions),[s,c]=(0,T.useState)({}),[l,u]=(0,T.useState)([]),[d,f]=(0,T.useState)(``),[p,m]=(0,T.useState)(``),[h,g]=(0,T.useState)(`idle`),[_,v]=(0,T.useState)(null),[y,b]=(0,T.useState)(`idle`),[x,S]=(0,T.useState)(null),[C,w]=(0,T.useState)(null),E=(i?.variables??[]).map(e=>e.name).join(`\0`),D=i===null?``:[i.channel,i.id??``,i.origin.file].join(`\0`),O=(0,T.useRef)(!1),k=(0,T.useRef)(null),A=(0,T.useRef)(null);if((0,T.useEffect)(()=>{let n=e&&!O.current,r=e&&O.current&&A.current!==null&&A.current!==D,a=e&&O.current&&k.current!==E;(n||r||a)&&i!==null&&c(Object.fromEntries(i.variables.map(e=>[e.name,e.sample??``]))),(n||r)&&(u([]),f(``),m(``),g(`idle`),v(null),b(`idle`),S(null),w(null)),r&&t(),O.current=e,k.current=e?E:null,A.current=e&&i!==null?D:null},[e,E,D,i,t]),a===void 0)return null;let j=a.status===`ready`?a:null,M=i?.channel??`email`,N=M===`email`?`email address`:`E.164 phone number`,P=M===`email`?`email addresses`:`E.164 phone numbers`,F=M===`email`?bH:xH,I=j?.api.testRecipient??(M===`email`&&i?.metadata.fromDefault?.email!==void 0?{address:i.metadata.fromDefault.email}:void 0),L=()=>Object.fromEntries((i?.variables??[]).map(e=>{let t=s[e.name];return[e.name,t&&t.trim()!==``?t:e.sample??``]})),B=e=>{let t=e.split(/[\s,]+/).map(e=>e.trim()).filter(e=>e!==``),n=[],r=[];for(let e of t)(F.test(e)?n:r).push(e);return n.length>0&&u(e=>M===`email`?[...e,...n.filter(t=>!e.includes(t))]:[n[n.length-1]]),r.join(` `)},V=e=>u(t=>t.filter(t=>t!==e)),ee=e=>{e.key===`Enter`||e.key===`,`?(e.preventDefault(),f(B(d))):e.key===`Backspace`&&d===``&&l.length>0&&V(l[l.length-1])},te=()=>{let e=d.trim(),t=e!==``&&F.test(e)&&!l.includes(e)?[e]:[];return[...l,...t]},ne=p!==``,H=te().length,re=I??(M!==`email`&&H===1?{address:te()[0]}:void 0),ie=i!==null&&j!==null&&re!==void 0&&h!==`sending`,ae=i!==null&&j!==null&&(M===`email`?H>0:H===1)&&y!==`sending`;return(0,Z.jsx)(TL,{open:e,onOpenChange:e=>!e&&t(),swipeDirection:`right`,children:(0,Z.jsxs)(SL,{container:r,children:[(0,Z.jsx)(QI,{className:`fixed inset-0 z-[110] bg-[var(--editor-backdrop,rgb(0_0_0/0.28))]`}),(0,Z.jsx)(dR,{className:`pointer-events-none fixed inset-0 z-[111] flex justify-end`,children:(0,Z.jsxs)(xL,{className:`samva-editor-shell border-border bg-background pointer-events-auto flex h-full w-[420px] max-w-[92vw] flex-col border-l shadow-[var(--shadow-floating)] outline-none`,children:[(0,Z.jsxs)(JL,{className:`sr-only`,children:[`Send `,M,` template`]}),(0,Z.jsx)(tL,{className:`sr-only`,children:`Choose recipients, template variables, and an optional schedule before sending.`}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between px-5 pt-4 pb-3`,children:[(0,Z.jsxs)(`span`,{className:`text-[15px] font-semibold`,children:[`Send “`,i?.name??`template`,`”`]}),(0,Z.jsxs)(tj,{children:[(0,Z.jsx)(lj,{render:(0,Z.jsx)($I,{type:`button`,"aria-label":`Close send panel`,"data-testid":`send-sheet.close`,className:`text-muted-foreground hover:bg-muted hover:text-foreground rounded-md p-1.5`}),children:(0,Z.jsx)(be,{className:`size-[15px]`})}),(0,Z.jsx)(pj,{container:r,children:(0,Z.jsx)(Ij,{side:`bottom`,sideOffset:5,className:`z-[200]`,children:(0,Z.jsx)(Lj,{role:`tooltip`,className:`bg-foreground text-background rounded-md px-2 py-1 text-[11px] shadow-[var(--shadow-md)]`,children:`Close send panel`})})})]})]}),a.status===`locked`?(0,Z.jsx)(OH,{reason:a.upsell.reason,cta:a.upsell.cta,onAction:n}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`samva-editor-scroll min-h-0 flex-1 overflow-y-auto px-5 pb-5`,children:[(0,Z.jsx)(`div`,{className:fB(`mt-4 mb-1.5`,yH),children:`To`}),(0,Z.jsxs)(`div`,{className:`border-border focus-within:border-ring focus-within:ring-ring/50 flex min-h-[34px] flex-wrap items-center gap-2 rounded-lg border px-2.5 py-1.5 text-[13px] focus-within:ring-[3px]`,children:[l.map(e=>(0,Z.jsxs)(`span`,{className:`bg-muted inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-[12.5px]`,children:[e,(0,Z.jsxs)(tj,{children:[(0,Z.jsx)(lj,{render:(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e}`,"data-testid":`send-sheet.recipient-remove.${e}`,onClick:()=>V(e),className:`text-muted-foreground hover:text-foreground`}),children:(0,Z.jsx)(be,{className:`size-2.5`})}),(0,Z.jsx)(pj,{container:r,children:(0,Z.jsx)(Ij,{side:`top`,sideOffset:5,className:`z-[200]`,children:(0,Z.jsx)(Lj,{role:`tooltip`,className:`bg-foreground text-background rounded-md px-2 py-1 text-[11px] shadow-[var(--shadow-md)]`,children:`Remove ${e}`})})})]})]},e)),(0,Z.jsx)(`input`,{value:d,onChange:e=>f(e.target.value),onKeyDown:ee,onBlur:()=>f(B(d)),placeholder:l.length===0?`Add ${P}…`:``,spellCheck:!1,autoComplete:`off`,className:`text-foreground placeholder:text-placeholder min-w-[8ch] flex-1 bg-transparent text-[13px] outline-none`,"aria-label":`Add recipient ${N}`,"data-testid":`send-sheet.recipient-input`})]}),(0,Z.jsx)(`div`,{className:fB(`mt-4 mb-1.5`,yH),children:`From`}),(0,Z.jsxs)(`div`,{className:`border-border flex min-h-[34px] items-center gap-2 rounded-lg border px-2.5 py-1.5 text-[13px]`,children:[M===`email`&&i?.metadata.fromDefault?i.metadata.fromDefault.name?`${i.metadata.fromDefault.name} <${i.metadata.fromDefault.email}>`:i.metadata.fromDefault.email:M===`email`?`No default sender`:`Managed by channel settings`,(0,Z.jsx)(`span`,{className:`text-placeholder ml-auto text-[11px]`,children:M===`email`?`template default`:M})]}),(0,Z.jsx)(`div`,{className:fB(`mt-4 mb-1.5`,yH),children:`Variables`}),(0,Z.jsx)(`div`,{className:`border-border-subtle bg-surface-inset text-muted-foreground mb-2 rounded-lg border px-2.5 py-2 text-[11.5px]`,children:`Detected from the document. Values fill per recipient at send time; blank falls back to the sample.`}),(i?.variables??[]).map(e=>(0,Z.jsxs)(`div`,{className:`mt-2 flex items-center gap-2.5`,children:[(0,Z.jsx)(hB,{name:e.name,className:`shrink-0`}),(0,Z.jsx)(`input`,{value:s[e.name]??``,onChange:t=>c(n=>({...n,[e.name]:t.target.value})),placeholder:e.sample??`value`,spellCheck:!1,"data-testid":`send-sheet.variable-input.${e.name}`,className:fB(`border-border text-foreground placeholder:text-placeholder h-[30px] min-w-0 flex-1 rounded-lg border px-2.5 text-[13px] outline-none`,pB)})]},e.name)),(0,Z.jsx)(`div`,{className:fB(`mt-4 mb-1.5`,yH),children:`Schedule`}),(0,Z.jsxs)(`div`,{className:`border-border focus-within:border-ring focus-within:ring-ring/50 flex min-h-[34px] items-center gap-2 rounded-lg border px-2.5 py-1.5 text-[13px] focus-within:ring-[3px]`,children:[(0,Z.jsx)(z,{className:`text-muted-foreground size-[14px] shrink-0`}),(0,Z.jsx)(`input`,{type:`datetime-local`,value:p,min:CH(),onChange:e=>m(e.target.value),"aria-label":`Schedule send time`,"data-testid":`send-sheet.schedule-input`,className:`text-foreground min-w-0 flex-1 bg-transparent text-[13px] [color-scheme:light] outline-none dark:[color-scheme:dark]`}),ne?(0,Z.jsx)(`button`,{type:`button`,title:`Clear schedule`,onClick:()=>m(``),className:`text-muted-foreground hover:text-foreground shrink-0 text-[11px]`,children:`Send now`}):(0,Z.jsx)(`span`,{className:`text-placeholder shrink-0 text-[11px]`,children:`Sends immediately`})]}),(0,Z.jsx)(`div`,{className:`border-border-subtle bg-surface-inset text-muted-foreground mt-2.5 rounded-lg border px-2.5 py-2 text-[11.5px]`,children:`Test send goes to you with the values above. The real send fills in each recipient.`})]}),(0,Z.jsxs)(`div`,{className:`border-border border-t px-5 py-3.5`,children:[h===`error`&&_!==null&&(0,Z.jsx)(`p`,{className:`text-status-error mb-2 text-[11.5px]`,children:_}),y===`error`&&x!==null&&(0,Z.jsx)(`p`,{className:`text-status-error mb-2 text-[11.5px]`,children:x}),y===`sent`&&C!==null&&(0,Z.jsx)(`p`,{className:`text-status-success mb-2 text-[11.5px]`,children:C}),j!==null&&re===void 0&&(0,Z.jsxs)(`p`,{className:`text-muted-foreground mb-2 text-[11.5px]`,children:[`No `,M===`email`?`viewer email`:`viewer phone number`,` is available for a test send.`]}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{ie&&i!==null&&j!==null&&(g(`sending`),v(null),o().then(e=>j.api.sendTest({channel:i.channel,to:re,variables:L(),baseRev:e})).then(()=>g(`sent`)).catch(e=>{g(`error`),v(SH(e,`Test send failed. Try again.`))}))},disabled:!ie,"data-testid":`send-sheet.send-test`,title:re===void 0?`No test ${N} is available`:void 0,className:fB(`inline-flex h-9 flex-1 items-center justify-center gap-1.5 rounded-[7px] border border-border transition-colors hover:bg-muted disabled:opacity-60 disabled:hover:bg-transparent`,h===`sent`&&`border-status-success/40 text-status-success`,h===`error`&&`border-status-error/40 text-status-error`),children:[h===`sending`&&(0,Z.jsx)(se,{className:`size-[15px] animate-spin`}),h===`sent`&&(0,Z.jsx)(R,{className:`size-[15px]`}),TH[h]]}),(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{let e=te();j!==null&&i!==null&&e.length!==0&&y!==`sending`&&(b(`sending`),S(null),w(null),o().then(t=>j.api.send({channel:i.channel,to:e.map(e=>({address:e})),variables:L(),schedule:ne?new Date(p).toISOString():null,baseRev:t})).then(e=>{b(`sent`),w(e.kind===`scheduled`?`Scheduled to send ${wH(e.scheduledFor)}. Delivery status shows up in Activity.`:`Sent. Track delivery in Activity.`)}).catch(e=>{b(`error`),S(SH(e,`Send failed. Try again.`))}))},disabled:!ae,"data-testid":`send-sheet.send`,className:fB(`inline-flex h-9 flex-1 items-center justify-center gap-1.5 rounded-[7px] bg-primary font-medium text-primary-foreground transition-opacity hover:opacity-90 disabled:opacity-60`,y===`sent`&&`bg-status-success`),children:[y===`sending`&&(0,Z.jsx)(se,{className:`size-[15px] animate-spin`}),y===`sent`&&(0,Z.jsx)(R,{className:`size-[15px]`}),EH(y,ne)]})]})]})]})]})})]})})}function OH({reason:e,cta:t,onAction:n}){return(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-start gap-4 px-5 pt-6 pb-8`,children:[(0,Z.jsx)(`div`,{className:`border-border-subtle bg-surface-inset text-muted-foreground rounded-lg border px-3.5 py-3 text-[13px]`,children:e}),(0,Z.jsx)(`a`,{href:t.href,onClick:e=>{n!==void 0&&(e.preventDefault(),n())},"data-testid":`send-sheet.upsell-cta`,className:`bg-primary text-primary-foreground inline-flex h-9 items-center rounded-[7px] px-4 font-medium transition-opacity hover:opacity-90`,children:t.label})]})}function kH({saveVersionStatus:e,saveVersionState:t,onSaveVersion:n,saveVersionBusy:r,saveVersionBlocked:i,guestHeadline:a}){let o=Qz(),{doc:s,checks:c,sizeKb:l,deviceWidth:u,layoutMode:d}=$(vP(e=>({doc:e.doc,checks:e.checks,sizeKb:e.sizeKb,deviceWidth:jz[e.previewDevice],layoutMode:e.layoutMode}))),{selectDocument:f}=$(e=>e.actions),p=$(e=>e.sourceEditable),m=$(e=>e.pendingAuthoredSource),h=$(vP(e=>({storageError:e.storageError,conflict:e.conflict}))),[g,_]=(0,T.useState)(!1),{errorCount:v,warnCount:y}=Dz(c),b=d===`compact`||d===`narrow`,x=c.filter(e=>e.diagnostics?.some(e=>e.compatibility?.assessment===`unverified`)).length,S=`No known risks found`;x>0&&(S=`No known risks · ${x} need verification`),y>0&&(S=`${y} warning${y>1?`s`:``}`),v>0&&(S=`${v} check${v>1?`s`:``} failing`),c.length===0&&(S=`No checks yet`);let C=t===`error`||h.storageError!==null||h.conflict?`Couldn't save version`:m!==null||r===!0?`Saving…`:void 0;return(0,Z.jsxs)(`footer`,{className:`border-border bg-background text-muted-foreground z-30 flex min-h-8 items-center gap-4 border-t px-3.5 py-1 text-[11.5px]`,children:[(0,Z.jsxs)(LR,{open:g,onOpenChange:_,children:[(0,Z.jsxs)(BR,{"data-testid":`statusbar.checks-trigger`,onClick:()=>f(),className:fB(`inline-flex items-center gap-1.5 rounded-md px-1.5 py-0.5 transition-colors hover:bg-muted hover:text-foreground`,g&&`bg-muted text-foreground`),children:[(0,Z.jsx)(`span`,{className:fB(`size-[7px] rounded-full`,v>0?`bg-status-error`:y>0?`bg-status-warning`:`bg-muted-foreground`)}),a===void 0?S:null]}),(0,Z.jsx)(UR,{container:o,children:(0,Z.jsx)(KR,{side:`top`,align:`start`,sideOffset:8,collisionPadding:12,className:`z-[80] outline-none`,children:(0,Z.jsx)(YR,{"data-testid":`statusbar.checks-popup`,className:`samva-editor-shell border-border bg-surface-elevated max-h-[min(560px,70vh)] w-[360px] origin-[var(--transform-origin)] overflow-y-auto rounded-xl border p-3.5 shadow-[var(--shadow-xl)] transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0`,children:(0,Z.jsx)(DB,{checks:c,editable:p})})})})]}),a===void 0?!b&&(0,Z.jsx)(`span`,{children:s===null?`Loading…`:`Draft`}):(0,Z.jsx)(`span`,{"data-testid":`statusbar.guest`,className:`min-w-0 truncate`,children:C??a}),a===void 0?(0,Z.jsx)(`span`,{"aria-live":`polite`,"data-testid":`statusbar.save-version`,"data-save-version-state":t??`unavailable`,children:e??`Autosaved just now`}):(0,Z.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"data-testid":`statusbar.save-version`,"data-save-version-state":t??`unavailable`,children:C??e??a}),n!==void 0&&(0,Z.jsx)(`button`,{type:`button`,onClick:n,disabled:r===!0||i===!0,"data-testid":`topbar.save-version`,"aria-label":`Save the current draft as a version`,title:`Save this draft as a version (⌘/Ctrl+S)`,className:`hover:bg-muted hover:text-foreground rounded-md px-1.5 py-0.5 transition-colors`,children:r===!0?`Saving…`:e===`Couldn’t save version`?`Retry`:`Save version`}),(0,Z.jsx)(`span`,{className:`flex-1`}),!b&&(0,Z.jsxs)(`span`,{children:[l,` KB`]}),d!==`narrow`&&(0,Z.jsx)(`span`,{children:s?.channel===`email`?`${u}px`:s?.channel.toUpperCase()??``})]})}var AH=[];function jH(){let{fixtures:e,fixture:t,busy:n,available:r}=$(vP(e=>({fixtures:e.doc?.channel===`email`?e.doc.fixtures:AH,fixture:e.doc?.channel===`email`?e.doc.fixture:null,busy:e.fixtureBusy,available:e.fixtureCapability?.status===`ready`}))),{viewFixture:i}=$(e=>e.actions);return!r||t===null||e.length<2?null:(0,Z.jsxs)(`label`,{className:`text-muted-foreground flex shrink-0 items-center gap-1.5 text-[12px]`,children:[(0,Z.jsx)(`span`,{className:`sr-only`,children:`Fixture`}),(0,Z.jsx)(`select`,{"data-testid":`topbar.fixture`,value:t,disabled:n,onChange:e=>i(e.target.value),title:`Render another declared fixture`,className:fB(`border-border bg-background text-foreground h-[30px] rounded-[7px] border px-2 text-[12px] outline-none`,pB),children:e.map(e=>(0,Z.jsx)(`option`,{value:e,children:e},e))})]})}function MH({leading:e,extraActions:t,onBack:n,onUndo:r,onRedo:i,canUndo:a=!1,canRedo:o=!1,onPreview:s,onSend:c,onLifecycle:l,channelSwitcher:u,exportEnabled:d,onExport:f,renameEnabled:p=!0}){let{doc:m,render:h,pendingAuthoredSource:g,sendCapability:_,lifecycleCapability:v,editable:y,readonlyReason:b,renameActive:x,metadataError:S,layoutMode:C}=$(vP(e=>({doc:e.doc,render:e.render,pendingAuthoredSource:e.pendingAuthoredSource,sendCapability:e.sendCapability,lifecycleCapability:e.lifecycleCapability,editable:e.editable,readonlyReason:e.readonlyReason,renameActive:e.renameActive,metadataError:e.metadataError,layoutMode:e.layoutMode}))),{rename:w,setRenameActive:E}=$(e=>e.actions),D=(0,T.useRef)(null),O=m?.name??`Untitled template`;(0,T.useEffect)(()=>{if(x&&D.current){D.current.focus();let e=document.createRange();e.selectNodeContents(D.current);let t=window.getSelection();t?.removeAllRanges(),t?.addRange(e)}},[x]);let k=_!==void 0,A=_?.status===`locked`?_.upsell.reason:`Send a test`,j=d===!0&&m?.channel===`email`&&h!==null&&g===null,M=C===`compact`||C===`narrow`,N=C===`standard`,P=()=>{j&&m!==null&&h!==null&&(cH(h.html,m.name),f?.())};return(0,Z.jsxs)(`header`,{className:fB(`z-30 flex min-w-0 flex-col border-b border-border bg-background/92 px-3 backdrop-blur-md`,M?`h-[92px]`:`h-12`),children:[(0,Z.jsxs)(`div`,{className:`flex h-12 min-w-0 shrink-0 items-center gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[e!==void 0&&(0,Z.jsx)(`div`,{className:`mr-1 shrink-0`,children:e}),n!==void 0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(_B,{title:`Back to templates`,className:`gap-1.5`,onClick:n,testId:`topbar.back`,children:[(0,Z.jsx)(F,{className:`size-[15px]`}),`Templates`]}),(0,Z.jsx)(`div`,{className:`bg-border mx-1 h-[18px] w-px`})]}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(`span`,{ref:D,"data-testid":`topbar.name`,contentEditable:y&&p,suppressContentEditableWarning:!0,spellCheck:!1,title:y&&p?`Click to rename`:b??`This template name is fixed.`,className:fB(`max-w-[280px] truncate rounded-md border border-transparent px-[7px] py-[3px] text-[13.5px] font-medium outline-none`,`hover:bg-muted focus-visible:bg-background`,pB),onFocus:()=>{y&&p&&E(!0)},onBlur:e=>{y&&p&&(E(!1),w(e.currentTarget.textContent??``))},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),e.currentTarget.blur()),e.key===`Escape`&&(e.currentTarget.textContent=O,e.currentTarget.blur())},children:O}),S!==null&&(0,Z.jsx)(`span`,{role:`alert`,className:`text-status-error truncate text-[11.5px]`,children:S}),u===void 0?(0,Z.jsx)(`span`,{className:`border-border-subtle bg-surface-inset text-muted-foreground inline-flex items-center rounded-md border px-2 py-0.5 text-[10.5px] font-medium tracking-[0.04em] uppercase`,children:m?.channel??`Template`}):(0,Z.jsx)(`div`,{className:fB(`min-w-0 shrink-0`,M&&`[&_[data-channel-button]]:px-1.5 [&_[data-channel-label]]:hidden`),children:u}),!y&&m!==null&&(0,Z.jsx)(`span`,{title:b??`This template is read-only.`,"data-testid":`topbar.readonly-badge`,className:`border-border-subtle bg-surface-inset text-muted-foreground inline-flex items-center rounded-md border px-2 py-0.5 text-[10.5px] font-medium`,children:`Read-only`})]})]}),(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-1`,children:[!M&&r!==void 0&&(0,Z.jsx)(_B,{title:`Undo`,testId:`topbar.undo`,onClick:r,disabled:!a,className:`h-[30px] px-2.5`,children:`Undo`}),!M&&i!==void 0&&(0,Z.jsx)(_B,{title:`Redo`,testId:`topbar.redo`,onClick:i,disabled:!o,className:`h-[30px] px-2.5`,children:`Redo`}),!M&&(0,Z.jsx)(jH,{}),!M&&(0,Z.jsx)(`div`,{className:`bg-border mx-1 h-[18px] w-px`}),!M&&(0,Z.jsxs)(_B,{title:`Preview template`,testId:`topbar.preview`,onClick:s,className:`h-[30px] px-2.5`,children:[(0,Z.jsx)(te,{className:`size-[15px]`}),N?null:`Preview`]}),d===!0&&!M&&(0,Z.jsxs)(_B,{title:j?`Export rendered HTML`:`Export waits for the latest render`,testId:`topbar.export`,onClick:P,disabled:!j,className:`h-[30px] px-2.5`,children:[(0,Z.jsx)(V,{className:`size-[15px]`}),N?null:`Export HTML`]}),k&&!M&&(0,Z.jsxs)(_B,{title:`Send a test`,help:A,testId:`topbar.send`,onClick:c,className:`h-[30px] px-2.5`,children:[(0,Z.jsx)(ue,{className:`size-[15px]`}),N?null:`Send`]}),!M&&t,!M&&y&&v!==void 0&&(0,Z.jsx)(`button`,{type:`button`,onClick:l,"data-testid":`topbar.publish`,title:v.status===`locked`?v.upsell.reason:`Publish and view history`,className:fB(mB,`ml-0.5 h-[30px] px-3`),children:`Publish`})]})]}),M&&(0,Z.jsxs)(`div`,{className:`samva-editor-scroll border-border-subtle flex h-11 min-w-0 items-center gap-1 overflow-x-auto border-t`,children:[t,r!==void 0&&(0,Z.jsx)(_B,{title:`Undo`,testId:`topbar.undo`,onClick:r,disabled:!a,className:`h-10 shrink-0 px-2`,children:`Undo`}),i!==void 0&&(0,Z.jsx)(_B,{title:`Redo`,testId:`topbar.redo`,onClick:i,disabled:!o,className:`h-10 shrink-0 px-2`,children:`Redo`}),(0,Z.jsx)(jH,{}),(0,Z.jsxs)(_B,{title:`Preview template`,testId:`topbar.preview`,onClick:s,className:`h-10 shrink-0 px-2`,children:[(0,Z.jsx)(te,{className:`size-[15px]`}),`Preview`]}),d===!0&&(0,Z.jsxs)(_B,{title:j?`Export rendered HTML`:`Export waits for the latest render`,testId:`topbar.export`,onClick:P,disabled:!j,className:`h-10 shrink-0 px-2`,children:[(0,Z.jsx)(V,{className:`size-[15px]`}),`Export`]}),k&&(0,Z.jsxs)(_B,{title:`Send a test`,help:A,testId:`topbar.send`,onClick:c,className:`h-10 shrink-0 px-2`,children:[(0,Z.jsx)(ue,{className:`size-[15px]`}),`Send`]}),y&&v!==void 0&&(0,Z.jsx)(`button`,{type:`button`,onClick:l,"data-testid":`topbar.publish`,title:v.status===`locked`?v.upsell.reason:`Publish and view history`,className:fB(mB,`h-10 shrink-0 px-2.5`),children:`Publish`})]})]})}var NH=e=>e>=1280?`wide`:e>=980?`standard`:e>=720?`compact`:`narrow`;function PH(){let e=$(e=>e.conflict),{reload:t}=$(e=>e.actions);return!$(e=>e.editable)||!e?null:(0,Z.jsxs)(`div`,{className:`border-border bg-surface-elevated text-foreground absolute inset-x-0 top-3 z-30 mx-auto flex w-fit items-center gap-3 rounded-lg border px-3.5 py-2 text-[13px] shadow-[var(--shadow-md)]`,children:[(0,Z.jsx)(`span`,{children:`Document changed elsewhere — your recent edits weren’t saved.`}),(0,Z.jsx)(`button`,{type:`button`,onClick:t,className:`bg-primary text-primary-foreground rounded-md px-2.5 py-1 font-medium transition-opacity hover:opacity-90`,children:`Reload`})]})}function FH(){let e=$(e=>e.storageError),t=$(e=>e.conflict),{retrySave:n}=$(e=>e.actions);return!$(e=>e.editable)||e===null||t?null:(0,Z.jsxs)(`div`,{className:`border-status-warning/45 bg-surface-elevated text-foreground absolute inset-x-0 top-3 z-30 mx-auto flex w-fit items-center gap-3 rounded-lg border px-3.5 py-2 text-[13px] shadow-[var(--shadow-md)]`,children:[(0,Z.jsxs)(`span`,{children:[e,` Your work is kept here; export a copy or retry.`]}),(0,Z.jsx)(`button`,{type:`button`,onClick:n,className:`border-border hover:bg-muted rounded-md border px-2.5 py-1 font-medium transition-colors`,children:`Retry`})]})}function IH(){let e=$(e=>e.doc);return e===null||e.channel===`email`?(0,Z.jsx)(iH,{}):e.channel===`sms`?(0,Z.jsx)(pV,{}):(0,Z.jsx)(yV,{})}function LH({height:e=`100dvh`,dashSidebar:t,toolbarLeading:n,toolbarActions:r,channelSwitcher:i,agentPanel:a,agentPanelHeader:o,designRailReview:s,guestStatus:c,canvasStatus:l,onBack:u,exportable:d,renameEnabled:f,onPreview:p,onExport:m,onLockedSend:h,onLockedLifecycle:g,onSaveVersion:_}){let v=$(e=>e.leftCollapsed),y=$(e=>e.rightCollapsed),b=$(e=>e.rightMode),x=$(e=>e.layoutMode),S=$(e=>e.doc?.rev??null),C=$(e=>e.checks),w=$(e=>e.sourceEditable&&!e.conflict&&e.pendingAuthoredSource===null&&!e.lifecycleBusy),E=$(e=>e.agentOriginIndex),D=$(e=>e.selection),O=$(e=>e.outline),k=$(e=>e.undoHistory.length),A=$(e=>e.redoHistory.length),j=$(e=>e.sourceEditable),M=$(e=>e.doc),N=$(e=>e.render),P=$(e=>e.diagnosticAssistance),F=$(e=>e.pendingAuthoredSource),I=$(e=>e.lifecycleBusy),L=a!==void 0,{flushSaves:R,beginLifecycle:z,endLifecycle:B,adoptLifecycleSnapshot:V,toggleLeft:ee,toggleRight:te,setLayoutMode:ne,undo:H,redo:re}=$(e=>e.actions),[ie,ae]=(0,T.useState)(!1),[oe,se]=(0,T.useState)(!1),[U,W]=(0,T.useState)(!1),[ce,le]=(0,T.useState)(`idle`),[ue,de]=(0,T.useState)(null),pe=QR(),he=(0,T.useRef)(null),ge=(0,T.useRef)(()=>{}),_e=(0,T.useRef)(null),ve=(0,T.useRef)(null),ye=d===!0&&M?.channel===`email`&&N!==null&&F===null,be=()=>{ye&&M!==null&&N!==null&&(cH(N.html,M.name),m?.())},xe=()=>{if(_===void 0||he.current!==null||!z())return;let e=()=>{},t=new Promise(t=>{e=t});he.current=t,le(`saving`),pe.getState().actions.flushSaves().then(async e=>{let t=pe.getState().doc,n=await _(e),r=pe.getState().doc;t!==null&&(r?.rev===e||r?.rev===n)&&r.origin.authoredSource===t.origin.authoredSource&&pe.getState().actions.adoptLifecycleSnapshot({rev:n,authoredSource:t.origin.authoredSource}),de(n),le(`idle`)}).catch(()=>le(`error`)).finally(()=>{B(),he.current===t&&(he.current=null),e()})};(0,T.useEffect)(()=>{ge.current=xe});let Se=`idle`;ce===`saving`?Se=`saving`:ce===`error`?Se=`error`:ue!==null&&ue===S&&(Se=`saved`);let Ce;_!==void 0&&(Ce=`Unsaved changes`,Se===`saving`?Ce=`Saving version…`:Se===`saved`?Ce=`Saved version`:Se===`error`&&(Ce=`Couldn’t save version`));let we=Dz(C),Te=D.kind===`element`?O?.index.get(D.instancePath)??null:null,Ee=Te===null||D.kind!==`element`?null:{originIndex:E,instancePath:Te.instancePath,fixture:D.fixture,label:ez(Te)},De=M?.channel===`email`?M.fixture:null,Oe=O===null||De===null||N===null||M===null?[]:rz(O).map(({depth:e,node:t})=>{let n=nz(t.selection,N.html);return{instancePath:t.instancePath,fixture:De,...t.selection.origins[E]===void 0?{}:{originIndex:E},label:tz(t.selection,M.origin.authoredSource),...n===void 0?{}:{detail:n},depth:e,active:D.kind===`element`&&D.instancePath===t.instancePath}}),ke=typeof a==`function`?a({flushSaves:()=>pe.getState().actions.flushSaves(),exportHtml:be,canExport:ye,openReview:s===void 0?void 0:()=>pe.getState().actions.openReview(),workspace:{draftRevision:S,saveVersionStatus:_===void 0?`unavailable`:Se,checks:{errors:we.errorCount,warnings:we.warnCount,findings:we.actionable,canFix:w},diagnosticAssistance:P,pointedElement:Ee,availableInstancePaths:O===null?[]:[...O.index.keys()],layout:x,layers:Oe}}):a,Ae={flushSaves:R,beginLifecycle:z,endLifecycle:B,adoptLifecycleSnapshot:V,undo:H,redo:re,canUndo:j&&k>0,canRedo:j&&A>0,preview:()=>{ae(!0),p?.()},exportHtml:be,canExport:ye},je=typeof r==`function`?r(Ae):r,Me=typeof i==`function`?i(Ae):i;(0,T.useEffect)(()=>{if(_===void 0)return;let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`s`&&e.target instanceof HTMLElement&&e.target.closest(`[data-samva-editor-theme]`)!==null&&e.target.closest(`[role="menu"], [role="dialog"], [data-base-ui-portal]`)===null&&(e.preventDefault(),ge.current())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]),(0,T.useLayoutEffect)(()=>{let e=_e.current;if(e===null||typeof ResizeObserver>`u`)return;let t,n=e=>{let n=NH(e);n!==t&&(t=n,ne(n))};n(e.getBoundingClientRect().width);let r=new ResizeObserver(([e])=>{e!==void 0&&n(e.contentRect.width)});return r.observe(e),()=>r.disconnect()},[ne]);let Ne=(x===`compact`||x===`narrow`)&&(!v||!y);return(0,T.useEffect)(()=>{if(!Ne)return;let e=e=>{e.key===`Escape`&&(v||ee(),y||te())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[v,Ne,y,ee,te]),(0,Z.jsx)(sB,{value:s??null,children:(0,Z.jsx)(eB,{value:ke??null,children:(0,Z.jsx)(iB,{value:o??null,children:(0,Z.jsx)(Zz,{container:ve,children:(0,Z.jsxs)(`div`,{ref:_e,className:`samva-editor-frame flex`,style:{height:e},children:[t,(0,Z.jsxs)(`div`,{"data-samva-editor-theme":`host`,"data-layout":x,inert:I,"aria-busy":I,className:`samva-editor-shell grid min-w-0 flex-1 grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden`,children:[(0,Z.jsx)(MH,{leading:n,extraActions:je,onBack:t===void 0?u:void 0,onPreview:()=>{ae(!0),p?.()},onSend:()=>se(!0),onLifecycle:()=>W(!0),onUndo:H,onRedo:re,canUndo:j&&k>0,canRedo:j&&A>0,channelSwitcher:Me,exportEnabled:d,renameEnabled:f,onExport:m}),(0,Z.jsxs)(`div`,{className:`samva-editor-body relative flex min-h-0 min-w-0 overflow-hidden`,children:[Ne&&(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Close editor panel`,className:`bg-background/45 absolute inset-0 z-30 cursor-default backdrop-blur-[1px]`,onClick:()=>{v||ee(),y||te()}}),v&&!L&&(0,Z.jsxs)(tj,{children:[(0,Z.jsx)(lj,{render:(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Show layers and blocks`,"data-testid":`shell.show-left`,onClick:ee,className:`border-border bg-background/92 text-muted-foreground hover:bg-muted hover:text-foreground absolute top-3 left-3 z-20 rounded-md border p-1.5 shadow-[var(--shadow-md)] backdrop-blur-md transition-colors`}),children:(0,Z.jsx)(fe,{className:`size-[15px]`})}),(0,Z.jsx)(pj,{container:ve,children:(0,Z.jsx)(Ij,{side:`right`,sideOffset:5,className:`z-[200]`,children:(0,Z.jsx)(Lj,{role:`tooltip`,className:`bg-foreground text-background rounded-md px-2 py-1 text-[11px] shadow-[var(--shadow-md)]`,children:`Show layers and blocks`})})})]}),y&&!L&&(0,Z.jsxs)(tj,{children:[(0,Z.jsx)(lj,{render:(0,Z.jsx)(`button`,{type:`button`,"aria-label":L&&b===`agent`?`Show assistant`:`Show inspector`,"data-testid":`shell.show-right`,onClick:te,className:`border-border bg-background/92 text-muted-foreground hover:bg-muted hover:text-foreground absolute top-3 right-3 z-20 rounded-md border p-1.5 shadow-[var(--shadow-md)] backdrop-blur-md transition-colors`}),children:(0,Z.jsx)(me,{className:`size-[15px]`})}),(0,Z.jsx)(pj,{container:ve,children:(0,Z.jsx)(Ij,{side:`left`,sideOffset:5,className:`z-[200]`,children:(0,Z.jsx)(Lj,{role:`tooltip`,className:`bg-foreground text-background rounded-md px-2 py-1 text-[11px] shadow-[var(--shadow-md)]`,children:L&&b===`agent`?`Show assistant`:`Show inspector`})})})]}),(0,Z.jsx)(uB,{value:l??null,children:(0,Z.jsx)(IH,{})}),(0,Z.jsx)(PH,{}),(0,Z.jsx)(FH,{})]}),(0,Z.jsx)(kH,{saveVersionStatus:c!==void 0&&!c.saveVersion?void 0:Ce,saveVersionState:_===void 0?void 0:Se,onSaveVersion:c!==void 0&&!c.saveVersion||_===void 0?void 0:xe,saveVersionBusy:Se===`saving`,saveVersionBlocked:I,guestHeadline:c?.headline})]}),(0,Z.jsx)(_H,{open:ie,onClose:()=>ae(!1)}),(0,Z.jsx)(DH,{open:oe,onClose:()=>se(!1),onLockedAction:h}),(0,Z.jsx)(pH,{open:U,onClose:()=>W(!1),onLockedAction:g}),(0,Z.jsx)(`div`,{ref:ve,"data-samva-editor-portal-root":!0,className:`samva-editor-shell`})]})})})})})}var RH=Sp({fileName:G,lineNumber:Up.check(Bp(1)),columnNumber:Up.check(Bp(1))}),zH=Dp([`error`,`warning`,`info`]),BH=Sp({assessment:Dp([`risk`,`degradation`,`unverified`,`not-applicable`]),title:G}),VH=Sp({code:G,severity:zH,message:G,origins:wp(RH),clients:mp(wp(G)),notes:mp(G),provenance:mp(G),fixtures:mp(wp(G)),occurrences:mp(wp(wp(RH))),compatibility:mp(BH)});Sp({start:Up.check(Bp(0)),end:Up.check(Bp(0)),origins:wp(RH),instancePath:G.check(Wp(1)),tag:G.check(Wp(1)),authored:bp});var HH=Sp({instancePath:G.check(Wp(1)),tag:G.check(Wp(1)),origins:wp(RH),authored:bp,occurrence:Up.check(Bp(1)),occurrences:Up.check(Bp(1)),parentPath:pp(G),start:Up.check(Bp(0)),end:Up.check(Bp(0))}),UH=`2026-09-22.1`,WH=Dp([`email`,`sms`,`whatsapp`]),GH=G;Sp({reason:G,cta:Sp({label:G,href:G})});var KH=Sp({name:G,sample:mp(G),required:bp}),qH=Sp({email:G,name:mp(G)}),JH=Sp({fromDefault:mp(qH),replyToDefault:mp(wp(G))}),YH=G.check(Wp(1)),XH=Sp({revision:GH,subject:G,preheader:pp(G),html:G,text:G,selections:wp(HH)}),ZH=Ep([Sp({status:hp(`current`)}),Sp({status:hp(`stale`),reason:G})]),QH=Sp({kind:hp(`tsx`),file:G,authoredSource:G}),$H={id:Op(G),name:G,rev:GH,origin:QH,variables:wp(KH),metadata:JH},eU={channel:hp(`email`),preview:ZH,fixtures:wp(YH),fixture:Op(YH),render:Op(XH),diagnostics:wp(VH),incompatibilities:wp(VH)},tU={channel:Dp([`sms`,`whatsapp`]),source:G},nU=Sp({kind:hp(`editable`)}),rU=Sp({kind:hp(`readonly`),reason:G}),iU=Sp({...$H,...eU,access:nU}),aU=Sp({...$H,...tU,access:nU}),oU=Sp({...$H,...eU,access:rU}),sU=Sp({...$H,...tU,access:rU});Ep([iU,aU]),Ep([oU,sU]),Ep([iU,aU,oU,sU]),Ep([Sp({kind:hp(`authoredSource`),baseRev:GH,authoredSource:G}),Sp({kind:hp(`metadata`),patch:Sp({name:mp(G),fromDefault:mp(Op(qH)),replyToDefault:mp(Op(wp(G)))})})]);var cU={rev:GH,origin:Dp([`self`,`agent`,`external`]),authoredSource:mp(G)};Ep([Sp({...cU,...eU}),Sp({...cU,...tU})]);var lU=class extends lm()(`DocumentConflict`,{expectedRev:GH,actualRev:GH}){},uU=class extends lm()(`DocumentUnavailable`,{reason:G}){},dU=Sp({commit:G,tree:G,parentCommit:Op(G),message:G,committedAt:qp,isHead:bp,isPublished:bp}),fU=Sp({path:G,binary:pp(bp),status:Dp([`clean`,`modified`,`deleted`,`conflicted`]),content:Op(G)}),pU=Sp({path:G,base:Op(G),draft:Op(G),main:Op(G)});Sp({rev:GH,baseCommit:G,remoteHead:G,dirty:bp,files:wp(fU),conflicts:wp(pU),commits:wp(dU)}),Sp({publicationId:G,commit:G,publishedAt:qp}),lm()(`LifecycleUnavailable`,{reason:G}),Sp({channel:WH,to:Sp({address:G,name:mp(G)}),variables:Cp(G,gp),baseRev:GH}),Sp({messageId:G,acceptedAt:em}),Sp({channel:WH,to:wp(Sp({address:G,name:mp(G)})),variables:Cp(G,gp),schedule:mp(Op(G)),baseRev:GH}),Ep([Sp({kind:hp(`sent`),messageId:G,acceptedAt:em}),Sp({kind:hp(`scheduled`),scheduledMessageId:G,scheduledFor:em})]),lm()(`SendUnavailable`,{reason:G}),Sp({url:G}),Sp({family:G,fallback:G}),Sp({name:G,data:mp(Cp(G,gp))});var mU=(e,t)=>{let n=new URL(`api/${e}`,window.location.href);for(let[e,r]of Object.entries(t))n.searchParams.set(e,r);return n.toString()},hU=e=>e.channel===`email`?e.fixture:void 0,gU=(e,t,n,r)=>{let i={rev:t,origin:n,...r===void 0?{}:{authoredSource:r}};return e.channel===`email`?{...i,channel:`email`,preview:e.preview,fixtures:e.fixtures,fixture:e.fixture,render:e.render,diagnostics:e.diagnostics,incompatibilities:e.incompatibilities}:{...i,channel:e.channel,source:e.source}},_U=(e,t,n)=>Dc(function*(){let r=yield*mf(),i=new EventSource(mU(`events`,{id:e,client:t}));yield*Rc(()=>wc(()=>i.close())),i.addEventListener(`samva:change`,t=>{let i=JSON.parse(t.data);i.id===e&&(n.rev=i.rev,n.fixture=hU(i),i.authoredSource!==void 0&&(n.authoredSource=i.authoredSource),hf(r,gU(i,i.rev,i.origin,i.authoredSource)))});let a=()=>fetch(mU(`document`,{id:e,client:t})).then(e=>e.ok?e.json():void 0).then(e=>{if(e===void 0)return;let t=e.origin.authoredSource;(e.rev!==n.rev||t!==n.authoredSource||hU(e)!==n.fixture)&&(n.rev=e.rev,n.authoredSource=t,n.fixture=hU(e),hf(r,gU(e,e.rev,`external`,t)))}).catch(()=>{}),o=!1,s;i.addEventListener(`open`,()=>{if(!o){o=!0,s?.(Tc);return}a()}),i.addEventListener(`error`,()=>{!o&&i.readyState!==EventSource.OPEN&&s?.(new uU({reason:`editor event stream failed to open`}))}),yield*Ec(e=>{if(i.readyState===EventSource.OPEN)return o=!0,e(Tc);s=e});let c=yield*xc({try:()=>fetch(mU(`document`,{id:e,client:t})),catch:e=>new uU({reason:String(e)})});if(!c.ok)return yield*new uU({reason:`open failed (${c.status})`});let l=yield*xc({try:()=>c.json(),catch:e=>new uU({reason:String(e)})});return n.rev=l.rev,n.authoredSource=l.origin.authoredSource,n.fixture=hU(l),{initial:l,changes:mm(r)}}),vU=(e,t)=>({view:n=>Dc(function*(){let r=yield*xc({try:()=>fetch(mU(`fixture`,{id:e,client:t}),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({fixture:n})}),catch:e=>new uU({reason:String(e)})});if(r.ok)return;let i=`view fixture failed (${r.status})`;return yield*new uU({reason:yield*xc({try:()=>r.json(),catch:()=>new uU({reason:i})}).pipe(Fc(e=>e.error??i))})})}),yU=(e,t)=>({save:n=>Dc(function*(){if(n.kind!==`authoredSource`)return yield*new uU({reason:`Local metadata is declared in source.`});let r=yield*xc({try:()=>fetch(mU(`document`,{id:e,client:t}),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(n)}),catch:e=>new uU({reason:String(e)})}),i=yield*xc({try:()=>r.json(),catch:e=>new uU({reason:String(e)})});return r.status===409?yield*new lU({expectedRev:n.baseRev,actualRev:i.actualRev??n.baseRev}):!r.ok||i.rev===void 0?yield*new uU({reason:i.error??`Local source save failed.`}):{rev:i.rev}})}),bU={status:`locked`,upsell:{reason:`Test sends run against a published template on Samva. Commit and push this file, run samva templates publish --commit HEAD, then send it by its template ID.`,cta:{label:`How publishing works`,href:`https://samva.dev/docs/sml/authoring-tsx`}}},xU=({id:e,authenticated:t,channel:n=`email`})=>{let r=crypto.randomUUID(),i={rev:``};return n===`email`?{contractVersion:UH,access:`editable`,sourceAccess:`editable`,metadataAccess:`readonly`,writer:yU(e,r),document:{open:_U(e,r,i)},fixtures:{status:`ready`,api:vU(e,r)},...t?{send:bU}:{}}:{contractVersion:UH,access:`readonly`,sourceAccess:`readonly`,document:{open:_U(e,r,i)}}},SU=e=>new URL(`api/${e}`,window.location.href).toString(),CU=async e=>{let t=await fetch(SU(e));if(!t.ok)throw Error(`${e} failed (${t.status})`);return t.json()},wU=()=>{let[e,t]=(0,T.useState)(()=>typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches);return(0,T.useEffect)(()=>{document.documentElement.classList.toggle(`dark`,e)},[e]),()=>t(e=>!e)};function TU({onBack:e,onToggleTheme:t}){return(0,Z.jsxs)(`nav`,{"aria-label":`Samva editor`,className:`border-border bg-background z-30 flex w-12 flex-none flex-col items-center gap-1 border-r py-3`,children:[(0,Z.jsx)(`span`,{className:`bg-primary text-primary-foreground mb-2 grid size-7 place-items-center rounded-lg text-[13px] font-bold`,children:`S`}),e?(0,Z.jsx)(`button`,{type:`button`,title:`Back to templates`,onClick:e,className:`text-muted-foreground hover:bg-muted hover:text-foreground grid size-8 place-items-center rounded-lg transition-colors`,children:(0,Z.jsx)(O,{className:`size-[16px]`})}):null,(0,Z.jsx)(`div`,{className:`flex-1`}),(0,Z.jsx)(`button`,{type:`button`,title:`Toggle theme`,onClick:t,className:`text-muted-foreground hover:bg-muted hover:text-foreground grid size-8 place-items-center rounded-lg transition-colors dark:hidden`,children:(0,Z.jsx)(le,{className:`size-[16px]`})}),(0,Z.jsx)(`button`,{type:`button`,title:`Toggle theme`,onClick:t,className:`text-muted-foreground hover:bg-muted hover:text-foreground hidden size-8 place-items-center rounded-lg transition-colors dark:grid`,children:(0,Z.jsx)(ve,{className:`size-[16px]`})})]})}function EU({template:e,authenticated:t,onBack:n,onToggleTheme:r}){let i=(0,T.useMemo)(()=>ym(xU({id:e.id,authenticated:t,channel:e.channel})),[t,e.id,e.channel]);return(0,Z.jsx)(Yz,{host:i,children:(0,Z.jsxs)(`div`,{className:`relative h-dvh`,children:[e.stale?(0,Z.jsx)(`div`,{role:`status`,"data-testid":`tsx-preview-stale`,className:`bg-status-warning text-background absolute top-2 left-1/2 z-50 -translate-x-1/2 rounded-full px-3 py-1 text-[11px] font-semibold shadow-md`,children:`Stale preview · current TSX has errors`}):null,(0,Z.jsx)(LH,{dashSidebar:(0,Z.jsx)(TU,{onBack:n,onToggleTheme:r}),onBack:n,renameEnabled:!1})]})},`${e.id}:${e.channel}`)}var DU={email:{icon:ee,label:`Email`,className:`bg-sel-soft text-accent-email`},sms:{icon:U,label:`SMS`,className:`bg-muted text-primary`},whatsapp:{icon:N,label:`WhatsApp`,className:`bg-status-success/10 text-status-success`}};function OU({catalog:e,authenticated:t,onOpen:n,onToggleTheme:r}){return(0,Z.jsxs)(`div`,{className:`flex h-dvh`,children:[(0,Z.jsx)(TU,{onToggleTheme:r}),(0,Z.jsx)(`div`,{className:`bg-surface-inset min-w-0 flex-1 overflow-y-auto`,children:(0,Z.jsxs)(`div`,{className:`mx-auto max-w-[720px] px-6 py-16`,children:[(0,Z.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`h1`,{className:`text-foreground text-lg font-semibold`,children:`Templates`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-1 text-[13px]`,children:`Preview your templates and fixtures. Email source edits save to your project.`})]}),(0,Z.jsx)(`span`,{className:t?`bg-status-success/12 text-status-success rounded-full px-2.5 py-1 text-[11px] font-medium`:`bg-muted text-muted-foreground rounded-full px-2.5 py-1 text-[11px] font-medium`,title:t?`SAMVA_API_KEY is set — authenticated affordances are available.`:`No API key — local editing only.`,children:t?`API key set`:`Local only`})]}),e.diagnostics.length>0?(0,Z.jsx)(`section`,{"aria-label":`Catalog diagnostics`,className:`border-border bg-surface-elevated mt-6 overflow-hidden rounded-xl border`,children:e.diagnostics.map((e,t)=>(0,Z.jsxs)(`div`,{className:`px-4 py-3 text-[12px]`+(t>0?` border-border-subtle border-t`:``),children:[(0,Z.jsxs)(`p`,{className:e.severity===`error`?`text-status-error`:`text-status-warning`,children:[e.file,` · `,e.code]}),(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-0.5`,children:e.message})]},`${e.file}:${e.code}:${t}`))}):null,(0,Z.jsxs)(`ul`,{className:`border-border bg-surface-elevated mt-8 overflow-hidden rounded-xl border shadow-md`,children:[e.templates.length===0?(0,Z.jsxs)(`li`,{className:`text-muted-foreground px-4 py-10 text-center text-[13px]`,children:[`No valid templates found. Add a `,(0,Z.jsx)(`code`,{className:`text-foreground`,children:`.tsx`}),` file with a Samva template as its default export.`]}):null,e.templates.map((e,t)=>{let r=DU[e.channel],i=r.icon;return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>n(e),"data-testid":`template-card.${e.id}`,className:`hover:bg-muted flex w-full items-center gap-3 px-4 py-3 text-left transition-colors`+(t>0?` border-border-subtle border-t`:``),children:[(0,Z.jsx)(`span`,{className:`grid size-8 flex-none place-items-center rounded-lg ${r.className}`,children:(0,Z.jsx)(i,{className:`size-[16px]`})}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`span`,{className:`text-foreground block truncate text-[13px] font-medium`,children:e.name}),(0,Z.jsx)(`span`,{className:`text-muted-foreground block truncate text-[12px]`,children:e.id})]}),(0,Z.jsxs)(`span`,{className:`text-muted-foreground text-right text-[11px]`,children:[(0,Z.jsx)(`span`,{className:`block`,children:r.label}),(0,Z.jsx)(`span`,{className:`block`,children:e.stale?`Stale preview`:e.channel===`email`?`Editable source`:`Read-only preview`})]})]})},e.id)})]})]})})]})}function kU(){let e=wU(),[t,n]=(0,T.useState)(!1),[r,i]=(0,T.useState)(null),[a,o]=(0,T.useState)(null),[s,c]=(0,T.useState)(null);(0,T.useEffect)(()=>{let e=!0,t=()=>CU(`templates`).then(t=>{e&&(i(t),o(null))});Promise.all([CU(`capabilities`).then(t=>{e&&n(!!t.authenticated)}),t()]).catch(t=>{e&&o(String(t))});let r=new EventSource(SU(`catalog-events`));return r.addEventListener(`samva:catalog`,()=>{t().catch(t=>{e&&o(String(t))})}),()=>{e=!1,r.close()}},[]);let l=r?.templates.find(e=>e.id===s)??null;return s!==null&&r!==null&&l===null&&c(null),a===null?r===null?(0,Z.jsx)(`div`,{className:`text-muted-foreground grid h-dvh place-items-center text-[13px]`,children:`Loading templates…`}):l===null?(0,Z.jsx)(OU,{catalog:r,authenticated:t,onOpen:e=>c(e.id),onToggleTheme:e}):(0,Z.jsx)(EU,{template:l,authenticated:t,onBack:()=>c(null),onToggleTheme:e}):(0,Z.jsxs)(`div`,{className:`text-status-error grid h-dvh place-items-center px-6 text-center text-[13px]`,children:[`Couldn’t reach the Samva editor dev server: `,a]})}(0,gm.createRoot)(document.getElementById(`root`)).render((0,Z.jsx)(T.StrictMode,{children:(0,Z.jsx)(kU,{})}));
32
+ //# sourceMappingURL=index-BeVA-Ur2.js.map