@samva/vite 0.18.1 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +5 -2
- package/CHANGELOG.md +28 -0
- package/README.md +41 -0
- package/dist/{brand-BkXQMGgY.d.ts → brand-q80zlW2d.d.ts} +4 -2
- package/dist/build.d.ts +1 -1
- package/dist/build.js +4 -4
- package/dist/dev.d.ts +2 -2
- package/dist/dev.js +1 -1
- package/dist/editor/assets/index-D2Eh4--j.css +2 -0
- package/dist/editor/assets/index-mDq6Sihj.js +184 -0
- package/dist/editor/index.html +2 -2
- package/dist/editor/licenses/character-entities-legacy.md +22 -0
- package/dist/editor/licenses/character-reference-invalid.md +22 -0
- package/dist/editor/licenses/css-tree.md +19 -0
- package/dist/editor/licenses/decode-named-character-reference.md +22 -0
- package/dist/editor/licenses/devlop.md +22 -0
- package/dist/editor/licenses/estree-util-is-identifier-name.md +22 -0
- package/dist/editor/licenses/estree-util-visit.md +22 -0
- package/dist/editor/licenses/is-alphabetical.md +22 -0
- package/dist/editor/licenses/is-alphanumerical.md +22 -0
- package/dist/editor/licenses/is-decimal.md +22 -0
- package/dist/editor/licenses/is-hexadecimal.md +22 -0
- package/dist/editor/licenses/mdast-util-from-markdown.md +22 -0
- package/dist/editor/licenses/mdast-util-mdx-expression.md +22 -0
- package/dist/editor/licenses/mdast-util-mdx-jsx.md +22 -0
- package/dist/editor/licenses/mdast-util-to-string.md +22 -0
- package/dist/editor/licenses/micromark-core-commonmark.md +22 -0
- package/dist/editor/licenses/micromark-extension-mdx-expression.md +22 -0
- package/dist/editor/licenses/micromark-extension-mdx-jsx.md +22 -0
- package/dist/editor/licenses/micromark-factory-destination.md +22 -0
- package/dist/editor/licenses/micromark-factory-label.md +22 -0
- package/dist/editor/licenses/micromark-factory-mdx-expression.md +22 -0
- package/dist/editor/licenses/micromark-factory-space.md +22 -0
- package/dist/editor/licenses/micromark-factory-title.md +22 -0
- package/dist/editor/licenses/micromark-factory-whitespace.md +22 -0
- package/dist/editor/licenses/micromark-util-character.md +22 -0
- package/dist/editor/licenses/micromark-util-chunked.md +22 -0
- package/dist/editor/licenses/micromark-util-classify-character.md +22 -0
- package/dist/editor/licenses/micromark-util-combine-extensions.md +22 -0
- package/dist/editor/licenses/micromark-util-decode-numeric-character-reference.md +22 -0
- package/dist/editor/licenses/micromark-util-decode-string.md +22 -0
- package/dist/editor/licenses/micromark-util-edit-map.md +22 -0
- package/dist/editor/licenses/micromark-util-events-to-acorn.md +22 -0
- package/dist/editor/licenses/micromark-util-html-tag-name.md +22 -0
- package/dist/editor/licenses/micromark-util-normalize-identifier.md +22 -0
- package/dist/editor/licenses/micromark-util-resolve-all.md +22 -0
- package/dist/editor/licenses/micromark-util-subtokenize.md +22 -0
- package/dist/editor/licenses/micromark.md +22 -0
- package/dist/editor/licenses/parse-entities.md +22 -0
- package/dist/editor/licenses/source-map-js.md +28 -0
- package/dist/editor/licenses/unist-util-position-from-estree.md +22 -0
- package/dist/editor/licenses/unist-util-stringify-position.md +22 -0
- package/dist/editor/licenses/vfile-message.md +22 -0
- package/dist/editor/licenses/yaml.md +13 -0
- package/dist/{editor-CXu5ksXm.js → editor-CXbIfm3N.js} +1 -1
- package/dist/{editor-DfdlKEeu.d.ts → editor-DqMrfMrR.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/{project-BDIqD8ho.js → project-l7pOcW8X.js} +73 -15
- package/dist/project.d.ts +13 -2
- package/dist/project.js +2 -2
- package/dist/render.js +4 -4
- package/package.json +3 -3
- package/dist/editor/assets/index-DLPhDgu1.css +0 -2
- package/dist/editor/assets/index-Dz2KgyxA.js +0 -39
|
@@ -0,0 +1,184 @@
|
|
|
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,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(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},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(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 u=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 ee={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=ee,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`})),d=o(((e,t)=>{t.exports=u()})),f=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}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();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 u(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=u(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=u(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=u(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=u(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`})),h=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=m()})),g=o((e=>{var t=p(),n=d(),r=h();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 u(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 f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function m(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)&&m(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`),ee=Symbol.for(`react.lazy`),B=Symbol.for(`react.activity`),V=Symbol.for(`react.legacy_hidden`),te=Symbol.for(`react.memo_cache_sentinel`),H=Symbol.for(`react.view_transition`),ne=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 B:return`Activity`;case H: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 ee: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,ce=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},ue=[],de=-1;function W(e){return{current:e}}function fe(e){0>de||(e.current=ue[de],ue[de]=null,de--)}function pe(e,t){de++,ue[de]=e.current,e.current=t}var me=W(null),he=W(null),ge=W(null),_e=W(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)?vp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=vp(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=le)}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=ce.p;return e===0?(e=window.event,e===void 0?32:jh(e.type)):e}function mt(e,t){var n=ce.p;try{return ce.p=e,t()}finally{ce.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)&&(Wd(),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=tp(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){qf(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=tp(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=Td.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=Nd;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<Pd)throw Pd=0,Fd=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 B:return e=Di(31,n,t,a),e.elementType=B,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 V:case H:return e=a|32,e=Di(30,n,t,e),e.elementType=H,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 ee: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`:Jf(`cancel`,t),Jf(`close`,t);break;case`iframe`:case`object`:case`embed`:Jf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Gf.length;n++)Jf(Gf[n],t);break;case`source`:Jf(`error`,t);break;case`img`:case`image`:case`link`:Jf(`error`,t),Jf(`load`,t);break;case`details`:Jf(`toggle`,t);break;case`input`:Jf(`invalid`,t),$t(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Jf(`invalid`,t);break;case`textarea`:Jf(`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||sp(t.textContent,n)?(r.popover!=null&&(Jf(`beforetoggle`,t),Jf(`toggle`,t)),r.onScroll!=null&&Jf(`scroll`,t),r.onScrollEnd!=null&&Jf(`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&&(_d===null?_d=e:_d.push.apply(_d,e),ta=null),e}function ua(e){ta===null?ta=[e]:ta.push(e)}var da=W(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=Bf(),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(bd=Pe(),typeof t==`object`&&t&&typeof t.then==`function`&&La(e,t),ja!==null)for(var n=Ef;n!==null;)Aa(n,ja),n=n.next;if(n=e.types,n!==null){for(var r=Ef;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=W(null);function Ha(){var e=Va.current;return e===null?td.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=td,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===ee&&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 ee: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 ee: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 ee: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===ee&&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 ee: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),G=oo(!1),co=!1;function lo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uo(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 fo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function po(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ed&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 mo(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 ho(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 go=!1;function _o(){if(go){var e=Ia;if(e!==null)throw e}}function vo(e,t,n,r){go=!1;var i=e.updateQueue;co=!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?(rd&f)===f:(r&f)===f){f!==0&&f===Fa&&(go=!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:co=!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),dd|=o,e.lanes=o,e.memoizedState=d}}function yo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function bo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)yo(n[e],t)}var xo=W(null),So=W(0);function Co(e,t){e=ld,pe(So,e),pe(xo,t),ld=e|t.baseLanes}function wo(){pe(So,ld),pe(xo,xo.current)}function To(){ld=So.current,fe(xo),fe(So)}var Eo=W(null),Do=null;function Oo(e){var t=e.alternate;pe(No,No.current&1),pe(Eo,e),Do===null&&(t===null||xo.current!==null||t.memoizedState!==null)&&(Do=e)}function ko(e){pe(No,No.current),pe(Eo,e),Do===null&&(Do=e)}function Ao(e){e.tag===22?(pe(No,No.current),pe(Eo,e),Do===null&&(Do=e)):jo()}function jo(){pe(No,No.current),pe(Eo,Eo.current)}function Mo(e){fe(Eo),Do===e&&(Do=null),fe(No)}var No=W(0);function Po(e,t){pe(Eo,Eo.current),pe(No,t)}function Fo(e){fe(No),fe(Eo),Do===e&&(Do=null)}function Io(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 Lo=0,Ro=null,zo=null,Bo=null,Vo=!1,Ho=!1,Uo=!1,Wo=0,Go=0,Ko=null,qo=0;function Jo(){throw Error(i(321))}function Yo(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 Xo(e,t,n,r,i,a){return Lo=a,Ro=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?pc:mc,Uo=!1,a=n(r,i),Uo=!1,Ho&&(a=Qo(t,n,r,i)),Zo(e),a}function Zo(e){U.H=fc;var t=zo!==null&&zo.next!==null;if(Lo=0,Bo=zo=Ro=null,Vo=!1,Go=0,Ko=null,t)throw Error(i(300));e===null||jc||(e=e.dependencies,e!==null&&ya(e)&&(jc=!0))}function Qo(e,t,n,r){Ro=e;var a=0;do{if(Ho&&(Ko=null),Go=0,Ho=!1,25<=a)throw Error(i(301));if(a+=1,Bo=zo=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=hc,o=t(n,r)}while(Ho);return o}function $o(){var e=U.H,t=e.useState()[0];return t=typeof t.then==`function`?os(t):t,e=e.useState()[0],(zo===null?null:zo.memoizedState)!==e&&(Ro.flags|=1024),t}function es(){var e=Wo!==0;return Wo=0,e}function ts(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ns(e){if(Vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Vo=!1}Lo=0,Bo=zo=Ro=null,Ho=!1,Go=Wo=0,Ko=null}function rs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bo===null?Ro.memoizedState=Bo=e:Bo=Bo.next=e,Bo}function is(){if(zo===null){var e=Ro.alternate;e=e===null?null:e.memoizedState}else e=zo.next;var t=Bo===null?Ro.memoizedState:Bo.next;if(t!==null)Bo=t,zo=e;else{if(e===null)throw Ro.alternate===null?Error(i(467)):Error(i(310));zo=e,e={memoizedState:zo.memoizedState,baseState:zo.baseState,baseQueue:zo.baseQueue,queue:zo.queue,next:null},Bo===null?Ro.memoizedState=Bo=e:Bo=Bo.next=e}return Bo}function as(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function os(e){var t=Go;return Go+=1,Ko===null&&(Ko=[]),e=Xa(Ko,e,t),t=Ro,(Bo===null?t.memoizedState:Bo.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?pc:mc),e}function ss(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return os(e);if(e.$$typeof===ne)return;if(e.$$typeof===F)return xa(e)}throw Error(i(438,String(e)))}function cs(e){var t=null,n=Ro.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Ro.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=as(),Ro.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 ls(e,t){return typeof t==`function`?t(e):t}function us(e){return ds(is(),zo,e)}function ds(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?(Lo&f)===f:(rd&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((Lo&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,Ro.lanes|=p,dd|=p;f=u.action,Uo&&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,Ro.lanes|=f,dd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Ir(o,e.memoizedState)&&(jc=!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 fs(e){var t=is(),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)||(jc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ps(e,t,n){var r=Ro,a=is(),o=ea;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Ir((zo||a).memoizedState,n);if(s&&(a.memoizedState=n,jc=!0),a=a.queue,Rs(gs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Bo!==null&&!!(Bo.memoizedState.tag&1),Ns(e?9:8,{destroy:void 0},hs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,td===null)throw Error(i(349));o||Lo&127||ms(r,t,n)}return n}function ms(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ro.updateQueue,t===null?(t=as(),Ro.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function hs(e,t,n,r){t.value=n,t.getSnapshot=r,_s(t)&&vs(e)}function gs(e,t,n){return n(function(){_s(t)&&vs(e)})}function _s(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ir(e,n)}catch{return!0}}function vs(e){var t=Si(e,2);t!==null&&zd(t,e,2)}function ys(e){var t=rs();if(typeof e==`function`){var n=e;if(e=n(),Uo){Ge(!0);try{n()}finally{Ge(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:e},t}function bs(e,t,n,r){return e.baseState=n,ds(e,zo,typeof r==`function`?r:ls)}function xs(e,t,n,r,a){if(lc(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,Ss(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ss(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),Cs(e,t,s)}catch(n){Ts(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),U.T=a}}else try{a=n(i,r),Cs(e,t,a)}catch(n){Ts(e,t,n)}}function Cs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ws(e,t,n)},function(n){return Ts(e,t,n)}):ws(e,t,n)}function ws(e,t,n){t.status=`fulfilled`,t.value=n,Es(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ss(e,n)))}function Ts(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Es(t),t=t.next;while(t!==r)}e.action=null}function Es(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ds(e,t){return t}function Os(e,t){if(ea){var n=td.formState;if(n!==null){a:{var r=Ro;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=rs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:t},n.queue=r,n=oc.bind(null,Ro,r),r.dispatch=n,r=ys(!1),a=cc.bind(null,Ro,!1,r.queue),r=rs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=xs.bind(null,Ro,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ks(e){return As(is(),zo,e)}function As(e,t,n){if(t=ds(e,t,Ds)[0],e=us(ls)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=os(t)}catch(e){throw e===Ga?qa:e}else r=t;t=is();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Ro.flags|=2048,Ns(9,{destroy:void 0},js.bind(null,i,n),null)),[r,a,e]}function js(e,t){e.action=t}function Ms(e){var t=is(),n=zo;if(n!==null)return As(t,n,e);is(),t=t.memoizedState,n=is();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Ro.updateQueue,t===null&&(t=as(),Ro.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 Ps(){return is().memoizedState}function Fs(e,t,n,r){var i=rs();Ro.flags|=e,i.memoizedState=Ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function Is(e,t,n,r){var i=is();r=r===void 0?null:r;var a=i.memoizedState.inst;zo!==null&&r!==null&&Yo(r,zo.memoizedState.deps)?i.memoizedState=Ns(t,a,n,r):(Ro.flags|=e,i.memoizedState=Ns(1|t,a,n,r))}function Ls(e,t){Fs(8390656,8,e,t)}function Rs(e,t){Is(2048,8,e,t)}function zs(e){Ro.flags|=4;var t=Ro.updateQueue;if(t===null)t=as(),Ro.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Bs(e){var t=is().memoizedState;return zs({ref:t,nextImpl:e}),function(){if(ed&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Vs(e,t){return Is(4,2,e,t)}function Hs(e,t){return Is(4,4,e,t)}function Us(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 Ws(e,t,n){n=n==null?null:n.concat([e]),Is(4,4,Us.bind(null,t,e),n)}function Gs(){}function Ks(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function qs(e,t){var n=is();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Yo(t,r[1]))return r[0];if(r=e(),Uo){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[r,t],r}function Js(e,t,n){return n===void 0||Lo&1073741824&&!(rd&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ld(),Ro.lanes|=e,dd|=e,n)}function Ys(e,t,n,r){return Ir(n,t)?n:xo.current===null?!(Lo&106)||Lo&1073741824&&!(rd&261930)?(jc=!0,e.memoizedState=n):(e=Ld(),Ro.lanes|=e,dd|=e,t):(e=Js(e,n,r),Ir(e,t)||(jc=!0),e)}function Xs(e,t,n,r,i){var a=ce.p;ce.p=a!==0&&8>a?a:8;var o=U.T,s={};s.types=o===null?null:o.types,U.T=s,cc(e,!1,t,n);try{var c=i(),l=U.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?sc(e,t,za(c,r),Id(e)):sc(e,t,r,Id(e))}catch(n){sc(e,t,{then:function(){},status:`rejected`,reason:n},Id())}finally{ce.p=a,o!==null&&s.types!==null&&(o.types=s.types),U.T=o}}function Zs(){}function Qs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=$s(e).queue;Xs(e,a,t,le,n===null?Zs:function(){return ec(e),n(r)})}function $s(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:le},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ec(e){var t=$s(e);t.next===null&&(t=e.alternate.memoizedState),sc(e,t.next.queue,{},Id())}function tc(){return xa(hh)}function nc(){return is().memoizedState}function rc(){return is().memoizedState}function ic(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Id();e=fo(n);var r=po(t,e,n);r!==null&&(zd(r,t,n),mo(r,t,n)),t={cache:Oa()},e.payload=t;return}t=t.return}}function ac(e,t,n){var r=Id();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},lc(e)?uc(t,n):(n=xi(e,t,n,r),n!==null&&(zd(n,e,r),dc(n,t,r)))}function oc(e,t,n){sc(e,t,n,Id())}function sc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(lc(e))uc(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),td===null&&yi(),!1}catch{}if(n=xi(e,t,i,r),n!==null)return zd(n,e,r),dc(n,t,r),!0}return!1}function cc(e,t,n,r){if(r={lane:2,revertLane:Bf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},lc(e)){if(t)throw Error(i(479))}else t=xi(e,n,r,2),t!==null&&zd(t,e,2)}function lc(e){var t=e.alternate;return e===Ro||t!==null&&t===Ro}function uc(e,t){Ho=Vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function dc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lt(e,n)}}var fc={readContext:xa,use:ss,useCallback:Jo,useContext:Jo,useEffect:Jo,useImperativeHandle:Jo,useLayoutEffect:Jo,useInsertionEffect:Jo,useMemo:Jo,useReducer:Jo,useRef:Jo,useState:Jo,useDebugValue:Jo,useDeferredValue:Jo,useTransition:Jo,useSyncExternalStore:Jo,useId:Jo,useHostTransitionStatus:Jo,useFormState:Jo,useActionState:Jo,useOptimistic:Jo,useMemoCache:Jo,useCacheRefresh:Jo,useEffectEvent:Jo},pc={readContext:xa,use:ss,useCallback:function(e,t){return rs().memoizedState=[e,t===void 0?null:t],e},useContext:xa,useEffect:Ls,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Fs(4194308,4,Us.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Fs(4194308,4,e,t)},useInsertionEffect:function(e,t){Fs(4,2,e,t)},useMemo:function(e,t){var n=rs();t=t===void 0?null:t;var r=e();if(Uo){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=rs();if(n!==void 0){var i=n(t);if(Uo){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=ac.bind(null,Ro,e),[r.memoizedState,e]},useRef:function(e){var t=rs();return e={current:e},t.memoizedState=e},useState:function(e){e=ys(e);var t=e.queue,n=oc.bind(null,Ro,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Gs,useDeferredValue:function(e,t){return Js(rs(),e,t)},useTransition:function(){var e=ys(!1);return e=Xs.bind(null,Ro,e.queue,!0,!1),rs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Ro,a=rs();if(ea){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),td===null)throw Error(i(349));rd&127||ms(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ls(gs.bind(null,r,o,e),[e]),r.flags|=2048,Ns(9,{destroy:void 0},hs.bind(null,r,o,n,t),null),n},useId:function(){var e=rs(),t=td.identifierPrefix;if(ea){var n=Ki,r=Gi;n=(r&~(1<<32-Ke(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Wo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=qo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:tc,useFormState:Os,useActionState:Os,useOptimistic:function(e){var t=rs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=cc.bind(null,Ro,!0,n),n.dispatch=t,[e,t]},useMemoCache:cs,useCacheRefresh:function(){return rs().memoizedState=ic.bind(null,Ro)},useEffectEvent:function(e){var t=rs(),n={impl:e};return t.memoizedState=n,function(){if(ed&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},mc={readContext:xa,use:ss,useCallback:Ks,useContext:xa,useEffect:Rs,useImperativeHandle:Ws,useInsertionEffect:Vs,useLayoutEffect:Hs,useMemo:qs,useReducer:us,useRef:Ps,useState:function(){return us(ls)},useDebugValue:Gs,useDeferredValue:function(e,t){return Ys(is(),zo.memoizedState,e,t)},useTransition:function(){var e=us(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:nc,useHostTransitionStatus:tc,useFormState:ks,useActionState:ks,useOptimistic:function(e,t){return bs(is(),zo,e,t)},useMemoCache:cs,useCacheRefresh:rc,useEffectEvent:Bs},hc={readContext:xa,use:ss,useCallback:Ks,useContext:xa,useEffect:Rs,useImperativeHandle:Ws,useInsertionEffect:Vs,useLayoutEffect:Hs,useMemo:qs,useReducer:fs,useRef:Ps,useState:function(){return fs(ls)},useDebugValue:Gs,useDeferredValue:function(e,t){var n=is();return zo===null?Js(n,e,t):Ys(n,zo.memoizedState,e,t)},useTransition:function(){var e=fs(ls)[0],t=is().memoizedState;return[typeof e==`boolean`?e:os(e),t]},useSyncExternalStore:ps,useId:nc,useHostTransitionStatus:tc,useFormState:Ms,useActionState:Ms,useOptimistic:function(e,t){var n=is();return zo===null?(n.baseState=e,[e,n.queue.dispatch]):bs(n,zo,e,t)},useMemoCache:cs,useCacheRefresh:rc,useEffectEvent:Bs};function gc(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 _c={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Id(),i=fo(r);i.payload=t,n!=null&&(i.callback=n),t=po(e,i,r),t!==null&&(zd(t,e,r),mo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Id(),i=fo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=po(e,i,r),t!==null&&(zd(t,e,r),mo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Id(),r=fo(n);r.tag=2,t!=null&&(r.callback=t),t=po(e,r,n),t!==null&&(zd(t,e,n),mo(t,e,n))}};function vc(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 yc(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&&_c.enqueueReplaceState(t,t.state,null)}function bc(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 xc(e){hi(e)}function Sc(e){console.error(e)}function Cc(e){hi(e)}function wc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Tc(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 Ec(e,t,n){return n=fo(n),n.tag=3,n.payload={element:null},n.callback=function(){wc(e,t)},n}function Dc(e){return e=fo(e),e.tag=3,e}function Oc(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(){Tc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Tc(t,n,r),typeof i!=`function`&&(Cd===null?Cd=new Set([this]):Cd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function kc(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=Eo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Do===null?Zd():n.alternate===null&&ud===0&&(ud=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),bf(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)),bf(e,r,a)),!1}throw Error(i(435,n.tag))}return bf(e,r,a),Zd(),!1}if(ea)return t=Eo.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=Ec(e.stateNode,r,a),ho(e,a),ud!==4&&(ud=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),gd===null?gd=[o]:gd.push(o),ud!==4&&(ud=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=Ec(n.stateNode,r,e),ho(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`&&(Cd===null||!Cd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Dc(a),Oc(a,e,n,r),ho(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Ac=Error(i(461)),jc=!1;function Mc(e,t,n,r){t.child=e===null?G(t,null,n,r):so(t,e.child,n,r)}function Nc(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=Xo(e,t,n,o,a,i),s=es(),e!==null&&!jc?(ts(e,t,i),sl(e,t,i)):(ea&&s&&Yi(t),t.flags|=1,Mc(e,t,r,i),t.child)}function Pc(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,Fc(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,!cl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Lr:n,n(o,r)&&e.ref===t.ref)return sl(e,t,i)}return t.flags|=1,e=ki(a,r),e.ref=t.ref,e.return=t,t.child=e}function Fc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Lr(a,r)&&e.ref===t.ref){if(jc=!1,t.pendingProps=r=a,cl(e,i))e.flags&131072&&(jc=!0);else return t.lanes=e.lanes,sl(e,t,i)}}return Uc(e,t,n,r,i)}function Ic(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 Rc(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?wo():Co(t,a),Ao(t);else return r=t.lanes=536870912,Rc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ua(t,null),wo(),jo()):(Ua(t,a.cachePool),Co(t,a),jo(),t.memoizedState=null);return Mc(e,t,i,n),t.child}function Lc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Rc(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),wo(),Ao(t),e!==null&&va(e,t,r,!0),t.childLanes=i,null}function zc(e,t){return t=Qc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Bc(e,t,n){return so(t,e.child,null,n),e=zc(t,t.pendingProps),e.flags|=2,Mo(t),t.memoizedState=null,e}function Vc(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=zc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Lc(null,e);if(ko(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 zc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ko(t),a){if(t.flags&256)t.flags&=-257,t=Bc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(jc||va(e,t,n,!1),a=(n&e.childLanes)!==0,jc||a){if(xo.current===null){if(r=td,r!==null&&(s=ut(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Si(e,s),zd(r,e,s),Ac;Zd()}t=Bc(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=zc(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 Hc(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 Uc(e,t,n,r,i){return ba(t),n=Xo(e,t,n,r,void 0,i),r=es(),e!==null&&!jc?(ts(e,t,i),sl(e,t,i)):(ea&&r&&Yi(t),t.flags|=1,Mc(e,t,n,i),t.child)}function Wc(e,t,n,r,i,a){return ba(t),t.updateQueue=null,n=Qo(t,r,n,i),Zo(e),r=es(),e!==null&&!jc?(ts(e,t,a),sl(e,t,a)):(ea&&r&&Yi(t),t.flags|=1,Mc(e,t,n,a),t.child)}function Gc(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=_c,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},lo(t),o=n.contextType,a.context=typeof o==`object`&&o?xa(o):Ti,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(gc(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&&_c.enqueueReplaceState(a,a.state,null),vo(t,r,a,i),_o(),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=bc(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)&&yc(t,a,r,o),co=!1;var f=t.memoizedState;a.state=f,vo(t,r,a,i),_o(),l=t.memoizedState,s||f!==l||co?(typeof d==`function`&&(gc(t,n,d,r),l=t.memoizedState),(c=co||vc(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,uo(e,t),o=t.memoizedProps,u=bc(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)&&yc(t,a,r,c),co=!1,f=t.memoizedState,a.state=f,vo(t,r,a,i),_o();var p=t.memoizedState;o!==d||f!==p||co||e!==null&&e.dependencies!==null&&ya(e.dependencies)?(typeof s==`function`&&(gc(t,n,s,r),p=t.memoizedState),(u=co||vc(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,Hc(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)):Mc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=sl(e,t,i),e}function Kc(e,t,n,r){return ca(),t.flags|=256,Mc(e,t,n,r),t.child}var qc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jc(e){return{baseLanes:e,cachePool:Wa()}}function Yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=md),e}function Xc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(No.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(ea){if(i?Oo(t):jo(),(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?(jo(),i=t.mode,a=Qc({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=Jc(n),r.childLanes=Yc(e,o,n),t.memoizedState=qc,Lc(null,r)):(Oo(t),Zc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return el(e,t,a,o,r,c,s,n)}return i?(jo(),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,Lc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Jc(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=Yc(e,o,n),t.memoizedState=qc,Lc(e.child,r)):(Oo(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 Zc(e,t){return t=Qc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Qc(e,t){return e=Di(22,e,null,t),e.lanes=0,e}function $c(e,t,n){return so(t,e.child,null,n),e=Zc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function el(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Oo(t),t.flags&=-257,$c(e,t,c)):t.memoizedState===null?(jo(),o=a.fallback,s=t.mode,a=Qc({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=Jc(c),a.childLanes=Yc(e,r,c),t.memoizedState=qc,Lc(null,a)):(jo(),t.child=e.child,t.flags|=128,null);if(Oo(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})),$c(e,t,c)}if(jc||va(e,t,c,!1),r=(c&e.childLanes)!==0,jc||r){if(xo.current!==null)return $c(e,t,c);if(r=td,r!==null&&(a=ut(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Si(e,a),zd(r,e,a),Ac;return mm(o)||Zd(),$c(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=Zc(t,a.children),t.flags|=134221824,t)}function tl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ga(e.return,t,n)}function nl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Io(n)===null&&(t=e),e=e.sibling}return t}function rl(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 il(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 al(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=No.current;if(t.flags&128)return Po(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Po(t,o),i===`backwards`&&e!==null?(il(e),Mc(e,t,r,n),il(e)):Mc(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&&tl(e,n,t);else if(e.tag===19)tl(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=nl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,il(t)),rl(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&&Io(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}rl(t,!0,n,null,a,r);break;case`together`:rl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=nl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),rl(t,!1,i,n,a,r)}return t.child}function ol(e,t,n){var r=t.pendingProps;return ma(t,t.type,r.value),Mc(e,t,r.children,n),t.child}function sl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),dd|=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 cl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ya(e)))}function ll(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,ko(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Oo(t),t.flags|=128,null;r=va(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Xc(e,t,n):(Oo(t),e=sl(e,t,n),e===null?null:e.sibling)}Oo(t);break;case 19:if(t.flags&128)return al(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 al(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Po(t,No.current),r)break;return null;case 22:return t.lanes=0,Ic(e,t,n,t.pendingProps);case 24:ma(t,Da,e.memoizedState.cache)}return sl(e,t,n)}function ul(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)jc=!0;else{if(!cl(e,n)&&!(t.flags&128))return jc=!1,ll(e,t,n);jc=!!(e.flags&131072)}}else jc=!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=bc(e,r),t.tag=1,t=Gc(null,t,e,r,n)):(t.tag=0,t=Uc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===I){t.tag=11,t=Nc(null,t,e,r,n);break a}if(a===z){t.tag=14,t=Pc(null,t,e,r,n);break a}if(a===F){t.tag=10,t.type=e,t=ol(null,t,n);break a}}throw t=oe(e)||e,Error(i(306,t,``))}}return t;case 0:return Uc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=bc(r,t.pendingProps),Gc(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,uo(e,t),vo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ma(t,Da,r),r!==o.cache&&_a(t,[Da],n,!0),_o(),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=Kc(e,t,r,n);break a}if(r!==a){a=Li(Error(i(424)),t),ua(a),t=Kc(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=G(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ca(),r===a){t=sl(e,t,n);break a}Mc(e,t,r,n)}t=t.child}return t;case 26:return Hc(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),Mc(e,t,t.pendingProps.children,n),Hc(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=Xo(e,t,$o,null,null,n),hh._currentValue=a),Hc(e,t),Mc(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 Xc(e,t,n);case 4:return ve(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=so(t,null,r,n):Mc(e,t,r,n),t.child;case 11:return Nc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Hc(e,t),Mc(e,t,r,n),t.child;case 8:return Mc(e,t,t.pendingProps.children,n),t.child;case 12:return Mc(e,t,t.pendingProps.children,n),t.child;case 10:return ol(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,Mc(e,t,r,n),t.child;case 14:return Pc(e,t,t.type,t.pendingProps,n);case 15:return Fc(e,t,t.type,t.pendingProps,n);case 19:return al(e,t,n);case 31:return Vc(e,t,n);case 22:return Ic(e,t,n,t.pendingProps);case 24:return ba(t),r=xa(Da),e===null?(a=Ha(),a===null&&(a=td,o=Oa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},lo(t),ma(t,Da,a)):((e.lanes&n)!==0&&(uo(e,t),vo(t,null,null,n),_o()),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))),Mc(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:Hc(e,t),Mc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function dl(e){e.flags|=4}function fl(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(Jd())e.flags|=8192;else throw Qa=Ja,Ka}}else e.flags&=-16777217}function pl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!rh(t)){if(Jd())e.flags|=8192;else throw Qa=Ja,Ka}}function ml(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:it(),e.lanes|=t,hd|=t)}function hl(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 gl(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 _l(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 gl(t),null;case 1:return gl(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)?dl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,la())),gl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(dl(t),o===null?(gl(t),fl(t,a,null,r,n)):(gl(t),pl(t,o))):o?o===e.memoizedState?(gl(t),t.flags&=-16777217):(dl(t),gl(t),pl(t,o)):(e=e.memoizedProps,e!==r&&dl(t),gl(t),fl(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&&dl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return gl(t),t.subtreeFlags&=-33554433,null}e=me.current,sa(t)?aa(t,e):(e=Cm(a,r,n),t.stateNode=e,dl(t))}return gl(t),t.subtreeFlags&=-33554433,null;case 5:if(xe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&dl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return gl(t),t.subtreeFlags&=-33554433,null}if(o=me.current,sa(t))aa(t,o);else{var s=_p(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(up(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&&dl(t)}}return gl(t),t.subtreeFlags&=-33554433,fl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&dl(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||sp(e.nodeValue,n)),e||ia(t,!0)}else e=_p(e).createTextNode(r),e[gt]=t,t.stateNode=e}return gl(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;gl(t),e=!1}else n=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Mo(t),t):(Mo(t),null);if(t.flags&128)throw Error(i(558))}return gl(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;gl(t),a=!1}else a=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Mo(t),t):(Mo(t),null)}return Mo(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),ml(t,t.updateQueue),gl(t),null);case 4:return ye(),e===null&&Zf(t.stateNode.containerInfo),t.flags|=67108864,gl(t),null;case 10:return ha(t.type),gl(t),null;case 19:if(Fo(t),r=t.memoizedState,r===null)return gl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)hl(r,!1);else{if(ud!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Io(e),o!==null){for(t.flags|=128,hl(r,!1),e=o.updateQueue,t.updateQueue=e,ml(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ai(n,e),n=n.sibling;return Po(t,No.current&1|2),ea&&qi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Pe()>xd&&(t.flags|=128,a=!0,hl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Io(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,ml(t,e),hl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!ea)return gl(t),null}else 2*Pe()-r.renderingStartTime>xd&&n!==536870912&&(t.flags|=128,a=!0,hl(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=No.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||ea?Po(t,o):(n=o,pe(Eo,t),pe(No,n),Do===null&&(Do=t)),ea&&qi(t,r.treeForkCount),e}return gl(t),null;case 22:case 23:return Mo(t),To(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(gl(t),t.subtreeFlags&6&&(t.flags|=8192)):gl(t),n=t.updateQueue,n!==null&&ml(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),gl(t),null;case 25:return null;case 30:return t.flags|=33554432,gl(t),null}throw Error(i(156,t.tag))}function vl(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(Mo(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(Mo(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 Fo(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 Mo(t),To(),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 yl(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&&Mo(t);break;case 13:Mo(t);break;case 19:Fo(t);break;case 10:ha(t.type);break;case 22:case 23:Mo(t),To(),e!==null&&fe(Va);break;case 24:ha(Da)}}function bl(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){yf(t,t.return,e)}}function xl(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){yf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){yf(t,t.return,e)}}function Sl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{bo(t,n)}catch(t){yf(e,e.return,t)}}}function Cl(e,t,n){n.props=bc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){yf(e,t,n)}}function wl(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);m(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){yf(e,t,n)}}function Tl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){yf(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){yf(e,t,n)}else n.current=null}}function El(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 Dl(e){for(var t=e.return;t!==null&&(Al(t)&&cm(e.stateNode,t.stateNode),!kl(t));)t=t.return}function Ol(e){for(var t=e.return;t!==null&&(Al(t)&&lm(e.stateNode,t.stateNode),!kl(t));)t=t.return}function kl(e){return e.tag===5||e.tag===3||e.tag===27}function Al(e){return e&&e.tag===7&&e.stateNode!==null}function jl(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){yf(e,e.return,t)}}function Ml(e,t,n){try{var r=e.stateNode;fp(r,e.type,n,t),r[_t]=t}catch(t){yf(e,e.return,t)}}function Nl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ap(e.type)||e.tag===4}function Pl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Nl(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 Fl(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)),El(e,r),Bt=!0;else if(i!==4&&(i===27&&(El(e,r),r=null,Ap(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Fl(e,t,n,r),e=e.sibling;e!==null;)Fl(e,t,n,r),e=e.sibling}function Il(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),El(e,r),Bt=!0;else if(i!==4&&(i===27&&(El(e,r),r=null,Ap(e.type)&&(n=e.stateNode)),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){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);up(t,r,n),t[gt]=e,t[_t]=n}catch(t){yf(e,e.return,t)}}var Rl=!1,zl=null;function Bl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Rl=!0)}var Vl=null;function Hl(){var e=Vl;return Vl=null,e}var Ul=0;function Wl(e,t,n,r,i){return Ul=0,Gl(e.child,t,n,r,i)}function Gl(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);Rl=!0,Np(o,Ul===0?t:t+`_`+Ul,n),Ul++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Gl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Kl(e,t){for(;e!==null;)e.tag===5?Pp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Kl(e.child,t)),e=e.sibling}function ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(ql(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`&&(Wl(e,n,t,null,!1)||Kl(e.child,!1))}e=e.sibling}}function Jl(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`?ql(e):Wl(e,i,a,null,!1)?(ql(e),n.paired||t||Rd(e,r.onEnter)):Kl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e,t),e=e.sibling;else ql(e)}function Yl(e){if(zl!==null&&zl.size!==0){var t=zl;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`&&(Wl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Rd(e,n.onShare)):Kl(e.child,!1)),t.delete(r),t.size===0)break}}}Yl(e)}e=e.sibling}}}function Xl(e){if(e.tag===30){var t=e.memoizedProps,n=fi(t,e.stateNode),r=zl===null?void 0:zl.get(n),i=mi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Wl(e,n,i,null,!1)?r===void 0?Rd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,zl.delete(n),Rd(e,t.onShare)):Kl(e.child,!1)),zl!==null&&Yl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e),e=e.sibling;else zl!==null&&Yl(e)}function Zl(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`&&Wl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Zl(e);e=e.sibling}}function Ql(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,Kl(e.child,!1))}Ql(e)}e=e.sibling}}function $l(e){if(e.tag===30)e.stateNode.paired=null,Kl(e.child,!1),Ql(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)$l(e),e=e.sibling;else Ql(e)}function eu(e){for(e=e.child;e!==null;)e.tag===30?Kl(e.child,!1):e.subtreeFlags&33554432&&eu(e),e=e.sibling}function tu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Ul<a.length){var l=a[Ul],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,Ul===0?n:n+`_`+Ul,i),s&&e.flags&4||(Vl===null&&(Vl=[]),Vl.push(c,Ul===0?r:r+`_`+Ul,t.memoizedProps)),Ul++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:tu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function nu(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;Ul=0,i=tu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Rd(e,n.onUpdate))}else e.subtreeFlags&33554432&&nu(e,t);e=e.sibling}}var ru=!1,iu=!1,au=!1,ou=!1,su=typeof WeakSet==`function`?WeakSet:Set,cu=null,lu=!1,uu=!1,du=!1,fu=!1;function pu(e,t,n){if(e=e.containerInfo,hp=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(gp={focusedElem:e,selectionRange:r},wh=!1,n=(n&335544064)===n,cu=t,t=n?9270:1024;cu!==null;){if(e=cu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Xl(r[a]);if(e.alternate===null&&e.flags&2)n&&Bl(e),mu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Xl(r),mu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Bl(e),mu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,cu=r):(n&&Zl(e),mu(n))}}zl=null}function mu(e){for(;cu!==null;){var t=cu,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=bc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){yf(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`&&Wl(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,cu=r;break}cu=t.return}}function hu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Fu(e,n),r&4&&bl(5,n);break;case 1:if(Fu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){yf(n,n.return,e)}else{var i=bc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){yf(n,n.return,e)}}}r&64&&Sl(n),r&512&&wl(n,n.return);break;case 3:if(Fu(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{bo(e,t)}catch(e){yf(n,n.return,e)}}break;case 27:t===null&&r&4&&Ll(n);case 26:case 5:Fu(e,n),t===null&&r&4&&jl(n),r&512&&wl(n,n.return);break;case 12:Fu(e,n);break;case 31:Fu(e,n),r&4&&wu(e,n);break;case 13:Fu(e,n),r&4&&Tu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Cf.bind(null,n),gm(e,n))));break;case 22:if(r=n.memoizedState!==null||ru,!r){var a=t!==null&&t.memoizedState!==null||iu;t=ru,i=iu,ru=r,(iu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Lu(e,n,r)):Fu(e,n),ru=t,iu=i}break;case 30:Fu(e,n),r&512&&wl(n,n.return);break;case 7:r&512&&wl(n,n.return);default:Fu(e,n)}}function gu(e,t){for(e=e.child;e!==null;)_u(e,t),e=e.sibling}function _u(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){yf(e,e.return,t)}vu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Bt=!0}catch(t){yf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Mp(s,!0):Mp(e.stateNode,!1)}catch(t){yf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&gu(e,t);break;default:gu(e,t)}}function vu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:_u(n,r);break a;case 22:n.memoizedState===null&&vu(n,r);break a;default:vu(n,r)}}e=e.sibling}}function yu(e){var t=e.alternate;t!==null&&(e.alternate=null,yu(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 bu=null,xu=!1;function Su(e,t,n){for(n=n.child;n!==null;)Cu(e,t,n),n=n.sibling}function Cu(e,t,n){if(We&&typeof We.onCommitFiberUnmount==`function`)try{We.onCommitFiberUnmount(Ue,n)}catch{}switch(n.tag){case 26:iu||Tl(n,t),Su(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!iu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:iu||Tl(n,t),Ol(n);var r=bu,i=xu;Ap(n.type)&&(bu=n.stateNode,xu=!1),Su(e,t,n),wm(n.stateNode,n.type,n.memoizedProps),bu=r,xu=i;break;case 5:iu||Tl(n,t),Ol(n);case 6:if(n.tag===6&&Ol(n),r=bu,i=xu,bu=null,Su(e,t,n),bu=r,xu=i,bu!==null){if(xu)try{(bu.nodeType===9?bu.body:bu.nodeName===`HTML`?bu.ownerDocument.body:bu).removeChild(n.stateNode),Bt=!0}catch(e){yf(n,t,e)}else try{bu.removeChild(n.stateNode),Bt=!0}catch(e){yf(n,t,e)}}break;case 18:bu!==null&&(xu?(e=bu,jp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Xh(e)):jp(bu,n.stateNode));break;case 4:r=bu,i=xu,bu=n.stateNode.containerInfo,xu=!0,Su(e,t,n),bu=r,xu=i;break;case 0:case 11:case 14:case 15:xl(2,n,t),iu||xl(4,n,t),Su(e,t,n);break;case 1:iu||(Tl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Cl(n,t,r)),Su(e,t,n);break;case 21:Su(e,t,n);break;case 22:iu=(r=iu)||n.memoizedState!==null,Su(e,t,n),iu=r;break;case 30:Tl(n,t),Su(e,t,n);break;case 7:iu||Tl(n,t),Su(e,t,n);break;default:Su(e,t,n)}}function wu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Xh(e)}catch(e){yf(t,t.return,e)}}}function Tu(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){yf(t,t.return,e)}}function Eu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new su),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new su),t;default:throw Error(i(435,e.tag))}}function Du(e,t){var n=Eu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=wf.bind(null,e,t);t.then(r,r)}})}function Ou(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)){bu=l.stateNode,xu=!1;break a}break;case 5:bu=l.stateNode,xu=!1;break a;case 3:case 4:bu=l.stateNode.containerInfo,xu=!0;break a}l=l.return}if(bu===null)throw Error(i(160));Cu(s,c,o),bu=null,xu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Au(t,e,n),t=t.sibling}var ku=null;function Au(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}Ou(t,e,n),ju(e),a&4&&(xl(3,e,e.return),bl(3,e),xl(5,e,e.return));break;case 1:Ou(t,e,n),ju(e),a&512&&(iu||r===null||Tl(r,r.return)),a&64&&ru&&(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=ku,Ou(t,e,n),ju(e),a&512&&(iu||r===null||Tl(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(ru)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`))),up(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),up(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),up(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 ru||eh(o,e.type,e.stateNode)}else e.stateNode=Jm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Ml(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||iu||t.parentNode.removeChild(t)):a.count--,n===null?ru||eh(o,e.type,e.stateNode):Jm(o,n,e.memoizedProps))}break;case 27:Ou(t,e,n),ju(e),a&512&&(iu||r===null||Tl(r,r.return)),r!==null&&a&4&&Ml(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=au,au=!1,Ou(t,e,n),au=o,ju(e),a&512&&(iu||r===null||Tl(r,r.return)),e.flags&32){t=e.stateNode;try{an(t,``),Bt=!0}catch(t){yf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Ml(e,t,r===null?t:r.memoizedProps)),a&1024&&(ou=!0);break;case 6:if(Ou(t,e,n),ju(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){yf(e,e.return,t)}}break;case 3:if(Bt=!1,Qm=null,o=ku,ku=Om(t.containerInfo),Ou(t,e,n),ku=o,ju(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Xh(t.containerInfo)}catch(t){yf(e,e.return,t)}ou&&(ou=!1,Mu(e)),Bt=!1;break;case 4:a=au,au=ru,r=Vt(),o=ku,ku=Om(e.stateNode.containerInfo),Ou(t,e,n),ju(e),ku=o,Bt&&uu&&(du=!0),Bt=r,au=a;break;case 12:Ou(t,e,n),ju(e);break;case 31:Ou(t,e,n),ju(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 13:Ou(t,e,n),ju(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(yd=Pe()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=ru,l=iu,u=au;ru=c||o,au=u||o,iu=l||s,Ou(t,e,n),iu=l,au=u,ru=c,ju(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||ru||iu||(t=s||iu,n=ru,r=iu,ru=o||ru,iu=t,Iu(e,2),ru=n,iu=r),!o&&au||gu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Du(e,n))));break;case 19:Ou(t,e,n),ju(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 30:a&512&&(iu||r===null||Tl(r,r.return)),a=Vt(),o=uu,s=(n&335544064)===n,c=e.memoizedProps,uu=s&&mi(c.default,c.update)!==`none`,Ou(t,e,n),ju(e),s&&r!==null&&Bt&&(e.flags|=4),uu=o,Bt=a;break;case 21:break;case 7:a&512&&(iu||r===null||Tl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Ou(t,e,n),ju(e)}}function ju(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Nl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Al(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(kl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Il(e,Pl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(an(l,``),n.flags&=-33),Il(e,Pl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Fl(e,Pl(e),u,s);break;default:throw Error(i(161))}}catch(t){yf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Mu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,wh=!0,t.reset(),wh=!1),e=e.sibling}}function Nu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Pu(t,e),t=t.sibling;else nu(t,!1)}function Pu(e,t){var n=e.alternate;if(n===null)Jl(e,!1);else switch(e.tag){case 3:if(fu=lu=!1,Hl(),Nu(t,e),!lu&&!du){if(e=Vl,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`})),fu=!0}Vl=null;break;case 5:Nu(t,e);break;case 4:r=lu,lu=!1,Nu(t,e),lu&&(du=!0),lu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Nu(t,e):Jl(e,!1));break;case 30:r=lu,i=Hl(),lu=!1,Nu(t,e),lu&&(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,Ul=0,t=tu(e,n,t,o,s,a,!0),Ul!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Rd(e,e.memoizedProps.onUpdate),Vl=i):i!==null&&(i.push.apply(i,Vl),Vl=i),lu=e.flags&32?!0:r;break;default:Nu(t,e)}}function Fu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)hu(e,t.alternate,t),t=t.sibling}function Iu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:xl(4,n,n.return),Iu(n,r);break;case 1:Tl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Cl(n,n.return,i),Iu(n,r);break;case 27:r&2&&wm(n.stateNode,n.type,n.memoizedProps);case 5:Tl(n,n.return),n.tag!==5&&n.tag!==27||Ol(n),Iu(n,r);break;case 6:Ol(n);break;case 26:Tl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||iu||i.parentNode.removeChild(i),Iu(n,r);break;case 22:n.memoizedState===null&&Iu(n,r);break;case 30:Tl(n,n.return),Iu(n,r);break;case 7:Tl(n,n.return);default:Iu(n,r)}e=e.sibling}}function Lu(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:Lu(i,a,n),bl(4,a);break;case 1:if(Lu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){yf(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++)yo(l[i],c)}catch(e){yf(r,r.return,e)}}s&&o&64&&Sl(a),wl(a,a.return);break;case 27:n&2&&Ll(a);case 5:a.tag!==5&&a.tag!==27||Dl(a),Lu(i,a,n),s&&r===null&&o&4&&jl(a),wl(a,a.return);break;case 6:Dl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||ru||eh(Om(c.ownerDocument),a.type,c),Lu(i,a,n),s&&r===null&&o&4&&jl(a),wl(a,a.return);break;case 12:Lu(i,a,n);break;case 31:Lu(i,a,n),s&&o&4&&wu(i,a);break;case 13:Lu(i,a,n),s&&o&4&&Tu(i,a);break;case 22:a.memoizedState===null&&Lu(i,a,n),wl(a,a.return);break;case 30:Lu(i,a,n),wl(a,a.return);break;case 7:wl(a,a.return);default:Lu(i,a,n)}t=t.sibling}}function Ru(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 zu(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 Bu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Vu(e,t,n,r),t=t.sibling;else i&&eu(t)}function Vu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&$l(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Bu(e,t,n,r),a&2048&&bl(9,t);break;case 1:Bu(e,t,n,r);break;case 3:Bu(e,t,n,r),i&&fu&&(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){Bu(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){yf(t,t.return,e)}}else Bu(e,t,n,r);break;case 31:Bu(e,t,n,r);break;case 13:Bu(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&&$l(t),o._visibility&2?Bu(e,t,n,r):(o._visibility|=2,Hu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&$l(s),o._visibility&2?Bu(e,t,n,r):Uu(e,t)),a&2048&&Ru(s,t);break;case 24:Bu(e,t,n,r),a&2048&&zu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Kl(a.child,!0),Kl(t.child,!0))),Bu(e,t,n,r);break;default:Bu(e,t,n,r)}}function Hu(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:Hu(a,o,s,c,i),bl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Hu(a,o,s,c,i)):u._visibility&2?Hu(a,o,s,c,i):Uu(a,o),i&&l&2048&&Ru(o.alternate,o);break;case 24:Hu(a,o,s,c,i),i&&l&2048&&zu(o.alternate,o);break;default:Hu(a,o,s,c,i)}t=t.sibling}}function Uu(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:Uu(n,r),i&2048&&Ru(r.alternate,r);break;case 24:Uu(n,r),i&2048&&zu(r.alternate,r);break;default:Uu(n,r)}t=t.sibling}}var Wu=8192;function Gu(e,t,n){if(e.subtreeFlags&Wu)for(e=e.child;e!==null;)Ku(e,t,n),e=e.sibling}function Ku(e,t,n){switch(e.tag){case 26:Gu(e,t,n),e.flags&Wu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&ah(n,e)):oh(n,ku,e.memoizedState,e.memoizedProps));break;case 5:Gu(e,t,n),e.flags&Wu&&(e=e.stateNode,(t&335544128)===t&&ah(n,e));break;case 3:case 4:var r=ku;ku=Om(e.stateNode.containerInfo),Gu(e,t,n),ku=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Wu,Wu=16777216,Gu(e,t,n),Wu=r):Gu(e,t,n));break;case 30:if((e.flags&Wu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,zl===null&&(zl=new Map),zl.set(r,i)}Gu(e,t,n);break;default:Gu(e,t,n)}}function qu(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 Ju(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cu=r,Zu(r,e)}qu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Yu(e),e=e.sibling}function Yu(e){switch(e.tag){case 0:case 11:case 15:Ju(e),e.flags&2048&&xl(9,e,e.return);break;case 3:Ju(e);break;case 12:Ju(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Xu(e)):Ju(e);break;default:Ju(e)}}function Xu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cu=r,Zu(r,e)}qu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:xl(8,t,t.return),Xu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Xu(t));break;default:Xu(t)}e=e.sibling}}function Zu(e,t){for(;cu!==null;){var n=cu;switch(n.tag){case 0:case 11:case 15:xl(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,cu=r;else a:for(n=e;cu!==null;){r=cu;var i=r.sibling,a=r.return;if(yu(r),r===n){cu=null;break a}if(i!==null){i.return=a,cu=i;break a}cu=a}}}var Qu={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}},$u=typeof WeakMap==`function`?WeakMap:Map,ed=0,td=null,nd=null,rd=0,id=0,ad=null,od=!1,sd=!1,cd=!1,ld=0,ud=0,dd=0,fd=0,pd=0,md=0,hd=0,gd=null,_d=null,vd=!1,yd=0,bd=0,xd=1/0,Sd=null,Cd=null,wd=0,Td=null,Ed=null,Dd=0,Od=0,kd=null,Ad=null,jd=null,Md=null,Nd=null,Pd=0,Fd=null;function Id(){return ed&2&&rd!==0?rd&-rd:U.T===null?pt():Bf()}function Ld(){if(md===0){if(!(rd&536870912)||ea){var e=Ze;Ze<<=1,!(Ze&3932160)&&(Ze=262144),md=e}else md=536870912}return e=Eo.current,e!==null&&(e.flags|=32),md}function Rd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Hp(fi(e.memoizedProps,n))),Md===null&&(Md=[]),Md.push(t.bind(null,r))}}function zd(e,t,n){(e===td&&(id===2||id===9)||e.cancelPendingCommit!==null)&&(Kd(e,0),Ud(e,rd,md,!1)),ot(e,n),(!(ed&2)||e!==td)&&(e===td&&(!(ed&2)&&(fd|=n),ud===4&&Ud(e,rd,md,!1)),Mf(e))}function Bd(e,t,n){if(ed&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||tt(e,t),a=r?ef(e,t):Qd(e,t,!0),o=r;do{if(a===0){sd&&!r&&Ud(e,t,0,!1);break}if(n=e.current.alternate,o&&!Hd(n)){a=Qd(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=gd;var l=c.current.memoizedState.isDehydrated;if(l&&(Kd(c,s).flags|=256),s=Qd(c,s,!1),s!==2&&s!==6){if(cd&&!l){c.errorRecoveryDisabledLanes|=o,fd|=o,a=4;break a}o=_d,_d=a,o!==null&&(_d===null?_d=o:_d.push.apply(_d,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Kd(e,0),Ud(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:Ud(r,t,md,!od);break a;case 2:_d=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=yd+300-Pe(),10<a)){if(Ud(r,t,md,!od),et(r,0,!0)!==0)break a;Dd=t,r.timeoutHandle=wp(Vd.bind(null,r,n,_d,Sd,vd,t,md,fd,hd,od,o,`Throttled`,-0,0),a);break a}Vd(r,n,_d,Sd,vd,t,md,fd,hd,od,o,null,-0,0)}break}while(1);Mf(e)}function Vd(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},zl=null,Ku(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?yd-Pe():(a&4194048)===a?bd-Pe():0,m=ch(d,m),m!==null)){Dd=a,e.cancelPendingCommit=m(cf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ud(e,a,o,!l);return}cf(e,t,a,n,r,i,o,s,c,l,u,d)}function Hd(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 Ud(e,t,n,r){t=nt(e,t),t&=~pd,t&=~fd,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 Wd(){return ed&6?!0:(Nf(0,!1),!1)}function Gd(){if(nd!==null){if(id===0)var e=nd.return;else e=nd,pa=fa=null,ns(e),to=null,no=0,e=nd;for(;e!==null;)yl(e.alternate,e),e=e.return;nd=null}}function Kd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Tp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Dd=0,Gd(),td=e,nd=n=ki(e.current,null),rd=t,id=0,ad=null,od=!1,sd=tt(e,t),cd=!1,hd=md=pd=fd=dd=ud=0,_d=gd=null,vd=!1,ld=nt(e,t),yi(),n}function qd(e,t){Ro=null,U.H=fc,t===Ga||t===qa?(t=$a(),id=3):t===Ka?(t=$a(),id=4):id=t===Ac?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ad=t,nd===null&&(ud=1,wc(e,Li(t,e.current)))}function Jd(){var e=Eo.current;return e===null?!0:(rd&4194048)===rd?Do===null:(rd&62914560)===rd||rd&536870912?e===Do:!1}function Yd(){var e=U.H;return U.H=fc,e===null?fc:e}function Xd(){var e=U.A;return U.A=Qu,e}function Zd(){ud=4,od||(rd&4194048)!==rd&&Eo.current!==null||(sd=!0),!(dd&134217727)&&!(fd&134217727)||td===null||Ud(td,rd,md,!1)}function Qd(e,t,n){var r=ed;ed|=2;var i=Yd(),a=Xd();(td!==e||rd!==t)&&(Sd=null,Kd(e,t)),t=!1;var o=ud;a:do try{if(id!==0&&nd!==null){var s=nd,c=ad;switch(id){case 8:Gd(),o=6;break a;case 3:case 2:case 9:case 6:Eo.current===null&&(t=!0);var l=id;if(id=0,ad=null,af(e,s,c,l),n&&sd){o=0;break a}break;default:l=id,id=0,ad=null,af(e,s,c,l)}}$d(),o=ud;break}catch(t){qd(e,t)}while(1);return t&&e.shellSuspendCounter++,pa=fa=null,ed=r,U.H=i,U.A=a,nd===null&&(td=null,rd=0,yi()),o}function $d(){for(;nd!==null;)nf(nd)}function ef(e,t){var n=ed;ed|=2;var r=Yd(),a=Xd();td!==e||rd!==t?(Sd=null,xd=Pe()+500,Kd(e,t)):sd=tt(e,t);a:do try{if(id!==0&&nd!==null){t=nd;var o=ad;b:switch(id){case 1:id=0,ad=null,af(e,t,o,1);break;case 2:case 9:if(Ya(o)){id=0,ad=null,rf(t);break}t=function(){id!==2&&id!==9||td!==e||(id=7),Mf(e)},o.then(t,t);break a;case 3:id=7;break a;case 4:id=5;break a;case 7:Ya(o)?(id=0,ad=null,rf(t)):(id=0,ad=null,af(e,t,o,7));break;case 5:var s=null;switch(nd.tag){case 26:s=nd.memoizedState;case 5:case 27:var c=nd;if(s?rh(s):c.stateNode.complete){id=0,ad=null;var l=c.sibling;if(l!==null)nd=l;else{var u=c.return;u===null?nd=null:(nd=u,of(u))}break b}}id=0,ad=null,af(e,t,o,5);break;case 6:id=0,ad=null,af(e,t,o,6);break;case 8:Gd(),ud=6;break a;default:throw Error(i(462))}}tf();break}catch(t){qd(e,t)}while(1);return pa=fa=null,U.H=r,U.A=a,ed=n,nd===null?(td=null,rd=0,yi(),ud):0}function tf(){for(;nd!==null&&!Me();)nf(nd)}function nf(e){var t=ul(e.alternate,e,ld);e.memoizedProps=e.pendingProps,t===null?of(e):nd=t}function rf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Wc(n,t,t.pendingProps,t.type,void 0,rd);break;case 11:t=Wc(n,t,t.pendingProps,t.type.render,t.ref,rd);break;case 5:ns(t);var r=t;r===Qi&&(ea?(oa(r),r.tag===5&&r.stateNode!=null&&($i=r.stateNode)):(oa(r),ea=!0));default:yl(n,t),t=nd=Ai(t,ld),t=ul(n,t,ld)}e.memoizedProps=e.pendingProps,t===null?of(e):nd=t}function af(e,t,n,r){pa=fa=null,ns(t),to=null,no=0;var i=t.return;try{if(kc(e,i,t,n,rd)){ud=1,wc(e,Li(n,e.current)),nd=null;return}}catch(t){if(i!==null)throw nd=i,t;ud=1,wc(e,Li(n,e.current)),nd=null;return}t.flags&32768?(ea||r===1?e=!0:sd||rd&536870912?e=!1:(od=e=!0,(r===2||r===9||r===3||r===6)&&(r=Eo.current,r!==null&&r.tag===13&&(r.flags|=16384))),sf(t,e)):of(t)}function of(e){var t=e;do{if(t.flags&32768){sf(t,od);return}e=t.return;var n=_l(t.alternate,t,ld);if(n!==null){nd=n;return}if(t=t.sibling,t!==null){nd=t;return}nd=t=e}while(t!==null);ud===0&&(ud=5)}function sf(e,t){do{var n=vl(e.alternate,e);if(n!==null){n.flags&=32767,nd=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){nd=e;return}nd=e=n}while(e!==null);ud=6,nd=null}function cf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do gf();while(wd!==0);if(ed&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===td&&(nd=td=null,rd=0),Ed=t,Td=e,Dd=n,kd=a,Ad=r,lf(e,t,n,s,c,l,f)}}function lf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Od=s,s|=vi,st(e,n,s,r,i,a),Md=null,(n&335544064)===n?(Nd=Ma(e),r=10262):(Nd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Tf(Re,function(){return _f(),null})):(e.callbackNode=null,e.callbackPriority=0),Rl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=U.T,U.T=null,i=ce.p,ce.p=2,a=ed,ed|=4;try{pu(e,t,n)}finally{ed=a,ce.p=i,U.T=r}}wd=1,Rl?jd=Bp(o,e.containerInfo,Nd,ff,pf,df,mf,_f,uf,null,null):(ff(),pf(),mf())}function uf(e){if(wd!==0){var t=Td.onRecoverableError;t(e,{componentStack:null})}}function df(){wd===3&&(wd=0,Pu(Ed,Td),wd=4)}function ff(){if(wd===1){wd=0;var e=Td,t=Ed,n=Dd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=U.T,U.T=null;var i=ce.p;ce.p=2;var a=ed;ed|=4;try{uu=du=!1,Au(t,e,n),n=gp;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=!!hp,gp=hp=null}finally{ed=a,ce.p=i,U.T=r}}e.current=t,wd=2}}function pf(){if(wd===2){wd=0;var e=Td,t=Ed,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=U.T,U.T=null;var r=ce.p;ce.p=2;var i=ed;ed|=4;try{hu(e,t.alternate,t)}finally{ed=i,ce.p=r,U.T=n}}wd=3}}function mf(){if(wd===4||wd===3){wd=0;var e=jd;jd=null,Ne();var t=Td,n=Ed,r=Dd,i=Ad,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?wd=5:(wd=0,Ed=Td=null,hf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Cd=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=ce.p,ce.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,ce.p=a}}if(i=Md,o=Nd,Nd=null,i!==null&&(Md=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);Dd&3&&gf(),Mf(t),a=t.pendingLanes,r&261930&&a&42?t===Fd?Pd++:(Pd=0,Fd=t):(Pd=0,Fd=null),Nf(0,!1)}}function hf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ka(t)))}function gf(){return jd!==null&&(jd.skipTransition(),jd=null),ff(),pf(),mf(),_f()}function _f(){if(wd!==5)return!1;var e=Td,t=Od;Od=0;var n=ft(Dd),r=U.T,a=ce.p;try{ce.p=32>n?32:n,U.T=null,n=kd,kd=null;var o=Td,s=Dd;if(wd=0,Ed=Td=null,Dd=0,ed&6)throw Error(i(331));var c=ed;if(ed|=4,Yu(o.current),Vu(o,o.current,s,n),ed=c,Nf(0,!1),We&&typeof We.onPostCommitFiberRoot==`function`)try{We.onPostCommitFiberRoot(Ue,o)}catch{}return!0}finally{ce.p=a,U.T=r,hf(e,t)}}function vf(e,t,n){t=Li(n,t),t=Ec(e.stateNode,t,2),e=po(e,t,2),e!==null&&(ot(e,2),Mf(e))}function yf(e,t,n){if(e.tag===3)vf(e,e,n);else for(;t!==null;){if(t.tag===3){vf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Cd===null||!Cd.has(r))){e=Li(n,e),n=Dc(2),r=po(t,n,2),r!==null&&(Oc(n,r,t,e),ot(r,2),Mf(r));break}}t=t.return}}function bf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $u;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)||(cd=!0,i.add(n),e=xf.bind(null,e,t,n),t.then(e,e))}function xf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,td===e&&(rd&n)===n&&(ud===4||ud===3&&(rd&62914560)===rd&&300>Pe()-yd?ed&2?pd|=n:Kd(e,0):pd|=n,hd===rd&&(hd=0)),Mf(e)}function Sf(e,t){t===0&&(t=it()),e=Si(e,t),e!==null&&(ot(e,t),Mf(e))}function Cf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sf(e,n)}function wf(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),Sf(e,n)}function Tf(e,t){return Ae(e,t)}var Ef=null,Df=null,Of=!1,kf=!1,Af=!1,jf=0;function Mf(e){e!==Df&&e.next===null&&(Df===null?Ef=Df=e:Df=Df.next=e),kf=!0,Of||(Of=!0,zf())}function Nf(e,t){if(!Af&&kf){Af=!0;do for(var n=!1,r=Ef;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,Rf(r,a))}else a=rd,a=et(r,r===td?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||tt(r,a)||(n=!0,Rf(r,a))}r=r.next}while(n);Af=!1}}function Pf(){Ff()}function Ff(){kf=Of=!1;var e=0;jf!==0&&Cp()&&(e=jf);for(var t=Pe(),n=null,r=Ef;r!==null;){var i=r.next,a=If(r,t);a===0?(r.next=null,n===null?Ef=i:n.next=i,i===null&&(Df=n)):(n=r,(e!==0||a&3)&&(kf=!0)),r=i}wd!==0&&wd!==5||Nf(e,!1),jf!==0&&(jf=0)}function If(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=td,n=rd,n=et(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(id===2||id===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=Lf.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 Lf(e,t){if(wd!==0&&wd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(gf()&&e.callbackNode!==n)return null;var r=rd;return r=et(e,e===td?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Bd(e,r,t),If(e,Pe()),e.callbackNode!=null&&e.callbackNode===n?Lf.bind(null,e):null)}function Rf(e,t){if(gf())return null;Bd(e,t,!0)}function zf(){Op(function(){ed&6?Ae(Ie,Pf):Ff()})}function Bf(){if(jf===0){var e=Fa;e===0&&(e=Xe,Xe<<=1,!(Xe&261888)&&(Xe=256)),jf=e}return jf}function Vf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:fn(e)}function Hf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Vf((i[_t]||null).action),o=r.submitter;o&&(t=(t=o[_t]||null)?Vf(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(jf!==0){var e=new FormData(i,o);Qs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Qs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Uf=0;Uf<li.length;Uf++){var Wf=li[Uf];ui(Wf.toLowerCase(),`on`+(Wf[0].toUpperCase()+Wf.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 Gf=`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(` `),Kf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Gf));function qf(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 Jf(e,t){var n=t[yt];n===void 0&&(n=t[yt]=new Set);var r=e+`__bubble`;n.has(r)||(Qf(t,e,2,!1),n.add(r))}function Yf(e,t,n){var r=0;t&&(r|=4),Qf(n,e,r,t)}var Xf=`_reactListening`+Math.random().toString(36).slice(2);function Zf(e){if(!e[Xf]){e[Xf]=!0,Mt.forEach(function(t){t!==`selectionchange`&&(Kf.has(t)||Yf(t,!1,e),Yf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xf]||(t[Xf]=!0,Yf(`selectionchange`,!1,t))}}function Qf(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 $f(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(ep(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,np):null,c!==null&&rp(s,u,c,d,!1),l!==null&&f!==null&&rp(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=tp(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=tp(r,`onBeforeInput`),0<b.length&&(v=new Kn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Hf(s,e,r,n,i)}qf(s,t)})}function ep(e,t,n){return{instance:e,listener:t,currentTarget:n}}function tp(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(ep(e,i,a)),i=xn(e,t),i!=null&&r.push(ep(e,i,a))),e.tag===3)return r;e=e.return}return[]}function np(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function rp(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(ep(n,l,c))):i||(l=xn(n,a),l!=null&&o.push(ep(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ip=/\r\n?/g,ap=/\u0000|\uFFFD/g;function op(e){return(typeof e==`string`?e:``+e).replace(ip,`
|
|
9
|
+
`).replace(ap,``)}function sp(e,t){return t=op(t),op(e)===t}function cp(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`&&cp(e,t,`name`,a.name,a,null),cp(e,t,`formEncType`,a.formEncType,a,null),cp(e,t,`formMethod`,a.formMethod,a,null),cp(e,t,`formTarget`,a.formTarget,a,null)):(cp(e,t,`encType`,a.encType,a,null),cp(e,t,`method`,a.method,a,null),cp(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&&Jf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Jf(`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`:Jf(`beforetoggle`,e),Jf(`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 lp(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&&Jf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Jf(`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 up(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Jf(`error`,e),Jf(`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:cp(e,t,o,s,n,null)}}a&&cp(e,t,`srcSet`,n.srcSet,n,null),r&&cp(e,t,`src`,n.src,n,null);return;case`input`:Jf(`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:cp(e,t,r,d,n,null)}}$t(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Jf(`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:cp(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 Jf(`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:cp(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:cp(e,t,l,r,n,null)}return;case`dialog`:Jf(`beforetoggle`,e),Jf(`toggle`,e),Jf(`cancel`,e),Jf(`close`,e);break;case`iframe`:case`object`:Jf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Gf.length;r++)Jf(Gf[r],e);break;case`image`:Jf(`error`,e),Jf(`load`,e);break;case`details`:Jf(`toggle`,e);break;case`embed`:case`source`:case`link`:Jf(`error`,e),Jf(`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:cp(e,t,u,r,n,null)}return;default:if(ln(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&lp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&cp(e,t,c,r,n,null))}var dp={};function fp(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)||cp(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&&cp(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)||cp(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&&cp(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:cp(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&&cp(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:cp(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:cp(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)&&cp(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:cp(e,t,u,p,r,m)}return;default:if(ln(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&lp(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||lp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&cp(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||cp(e,t,f,p,r,m)}function pp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function mp(){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&&pp(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&&pp(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 hp=null,gp=null;function _p(e){return e.nodeType===9?e:e.ownerDocument}function vp(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=_p(n).createElement(e),n[gt]=r,n[_t]=t,up(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}),m(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),m(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){m(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=[];m(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=_p(e).activeElement,e!==null&&m(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),m(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),m(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 m(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=[];m(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:(m(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:(m(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=[];m(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=_p(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&&cp(e,t,r,null,dp,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=ce.d;ce.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=Wd();return e||t}function jm(e){var t=Dt(e);t!==null&&t.tag===5&&t.type===`form`?ec(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`),up(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`);up(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`),up(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),up(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),up(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),up(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),up(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),up(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}),up(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),up(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}),up(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*mp());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:le,_currentValue2:le,_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},lo(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=fo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=po(e,r,t),n!==null&&(zd(n,e,t),mo(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&&zd(t,e,67108864),xh(e,67108864)}}function Ch(e){if(e.tag===13||e.tag===31){var t=Id();t=dt(t);var n=Si(e,t);n!==null&&zd(n,e,t),xh(e,t)}}var wh=!0;function Th(e,t,n,r){var i=U.T;U.T=null;var a=ce.p;try{ce.p=2,Dh(e,t,n,r)}finally{ce.p=a,U.T=i}}function Eh(e,t,n,r){var i=U.T;U.T=null;var a=ce.p;try{ce.p=8,Dh(e,t,n,r)}finally{ce.p=a,U.T=i}}function Dh(e,t,n,r){if(wh){var i=Oh(r);if(i===null)$f(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}Mf(a),!(ed&6)&&(xd=Pe()+500,Nf(0,!1))}}break;case 31:case 13:s=Si(a,2),s!==null&&zd(s,a,2),Wd(),xh(a,2)}if(a=Oh(r),a===null&&$f(e,t,r,kh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else $f(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,Qs(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,Id(),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),Wd(),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`));ce.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=u(t),e=e===null?null:f(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=xc,s=Sc,c=Cc;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,Zf(e),new Qh(t)}})),_=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=g()})),v=(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}}},y=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)}}}},b=e=>e,x=e=>()=>e,S=x(!0),C=x(void 0),w=C,T=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},E=new WeakSet,D=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),O=0,k=()=>{O++};function A(e){return typeof e==`function`}function j(e){return typeof e==`object`&&!!e||A(e)}var M=y(2,(e,t)=>j(e)&&t in e),N=`~effect/Hash`,P=e=>{switch(typeof e){case`number`:return ee(e);case`bigint`:return B(e.toString(10));case`string`:return B(e);case`function`:case`object`:if(e===null)break;if(e instanceof Date)return Number.isNaN(e.getTime())?B(`Invalid Date`):B(e.toISOString());if(e instanceof RegExp)return B(e.toString());{if(E.has(e))return F(e);let t=se.get(e);if(t!==void 0)return t;if(U.has(e))return k(),B(`[Circular]`);U.add(e);let n=O,r;try{r=`~effect/Hash`in e?e[N]():typeof e==`function`?F(e):e instanceof DataView?ne(D(e)):Array.isArray(e)||ArrayBuffer.isView(e)?ne(e):e instanceof Map?re(e):e instanceof Set?ae(e):te(e)}finally{U.delete(e)}return n===O&&se.set(e,r),r}}return R(I(B(String(e))))},F=e=>(oe.has(e)||oe.set(e,R(Math.random()*4294967296|0)),oe.get(e)),I=e=>(e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^e>>>16),L=y(2,(e,t)=>I(Math.imul(e,2654435761)+Math.imul(t,2246822507))),R=e=>e&3221225471|e>>>1&1073741824,z=new DataView(new ArrayBuffer(8)),ee=e=>{let t=e|0;return t===e?R(t):(z.setFloat64(0,e===e?e:NaN),R(L(z.getInt32(0),z.getInt32(4))))},B=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return R(t)},V=(e,t)=>{let n=12289;for(let r of t)n^=L(P(r),P(e[r]));return R(n)},te=e=>V(e,T(e)),H=(e,t)=>n=>{let r=e;for(let e of n)r^=t(e);return R(r)},ne=e=>{let t=6151;for(let n of e)t=L(t,P(n));return R(t)},re=H(B(`Map`),([e,t])=>L(P(e),P(t))),ie=B(`Set`),ae=H(ie,e=>L(ie,P(e))),oe=new WeakMap,se=new WeakMap,U=new WeakSet,ce=`~effect/Equal`;function le(){return arguments.length===1?e=>ue(e,arguments[0]):ue(arguments[0],arguments[1])}function ue(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`||E.has(e)||E.has(t)?!1:de(e,t):!1}function de(e,t){let n=fe.length;for(let r=n;r-->0;)if(fe[r]===e&&pe[r]===t)return!0;if(n)return W(e,t);let r=me.get(e);r||me.set(e,r=new WeakMap);let i=r.get(t);return i===void 0&&r.set(t,i=W(e,t)),i}function W(e,t){fe.push(e),pe.push(t);try{return he(e,t)}finally{fe.pop(),pe.pop()}}var fe=[],pe=[],me=new WeakMap;function he(e,t){if(P(e)!==P(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=Se(e);if(n!==Se(t)||typeof e==`function`&&!n)return!1;if(n)return e[ce](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:ge(e,t);if(ArrayBuffer.isView(e)){let n=e instanceof DataView;return!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView?!1:n?_e(D(e),D(t)):_e(e,t)}return e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:ye(e,t,be,xe):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:ye(e,t,P,ue):ve(e,t)}function ge(e,t){for(let n=0;n<e.length;n++)if(!ue(e[n],t[n]))return!1;return!0}function _e(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 ve(e,t){let n=T(e),r=T(t);if(n.size!==r.size)return!1;for(let i of n)if(!r.has(i)||!ue(e[i],t[i]))return!1;return!0}function ye(e,t,n,r){let i=new Map;for(let e of t){let t=n(e),r=i.get(t);r?r.push(e):i.set(t,[e])}outer:for(let t of e){let e=i.get(n(t));if(e){for(let n=0;n<e.length;n++)if(r(t,e[n])){e[n]=e[e.length-1],e.pop();continue outer}}return!1}return!0}var be=e=>P(e[0]),xe=(e,t)=>ue(e[0],t[0])&&ue(e[1],t[1]),Se=e=>M(e,ce),Ce=Symbol.for(`~effect/Redactable`),we=e=>M(e,Ce);function Te(e){return we(e)?Ee(e):e}function Ee(e){return e[Ce](globalThis[`~effect/Fiber/currentFiber`]?.context??ke)}var De=`~effect/Fiber/currentFiber`,Oe=new Map,ke={"~effect/Context":{},base:Oe,depth:0,mapUnsafe:Oe,pipe(){return v(this,arguments)}};function Ae(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 je;r.add(e);let l;if(Ce in e)l=c(Ee(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=Ne(e);else if(!t?.ignoreToString&&M(e,`toString`)&&typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=Pe(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=>`${Me(t)}:${c(Fe(e,t),n)}`).join(`,`)}}`;l=o(e,r)}else{let r=`{\n${t.map(t=>`${a(n+1)}${Me(t)}: ${c(Fe(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 je=`[Circular]`;function Me(e){return typeof e==`string`?JSON.stringify(e):String(e)}function Ne(e){try{return e.toISOString()}catch{return`Invalid Date`}}function Pe(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}function Fe(e,t){try{return e[t]}catch{return`[property access threw]`}}var Ie=Symbol.for(`nodejs.util.inspect.custom`),Le=e=>{try{return e=Te(e),M(e,`toJSON`)&&A(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(Le):e}catch{return`[toJSON threw]`}},Re=()=>Error.stackTraceLimit,ze=class{constructor(e){this.value=e,this.done=!1}next(e){return this.done?(this.value=e,this):(this.done=!0,{value:this.value,done:!1})}},Be=(()=>{let e=`~effect/Utils/internal`,t={[e]:e=>e()},n={[e]:e=>{try{return e()}finally{}}};return Re()!==0&&t[e](()=>Error().stack)?.includes(e)===!0?t[e]:n[e]})();function Ve(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function He(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&Ve(e,n,t[n])}var Ue=`~effect/Effect`,We=`~effect/Exit`,Ge={_A:b,_E:b,_R:b},Ke=`${Ue}/identifier`,qe=`${Ue}/args`,Je=`${Ue}/evaluate`,Ye=`${Ue}/successCont`,Xe=`${Ue}/failureCont`,Ze=`${Ue}/ensureCont`,Qe=Symbol.for(`effect/Effect/Yield`),$e={pipe(){return v(this,arguments)},toJSON(){return{...this}},toString(){return Ae(this.toJSON(),{ignoreToString:!0,space:2})},[Ie](){return this.toJSON()}},et={[Ue]:Ge,...$e,[Symbol.iterator](){return new ze(this)},toJSON(){return{_id:`Effect`,op:this[Ke],...qe in this?{args:this[qe]}:void 0}}},tt=e=>M(e,Ue),nt=e=>M(e,We),rt=`~effect/Cause`,it=`~effect/Cause/Reason`,at=e=>M(e,rt),ot=class{constructor(e){this[rt]=rt,this.reasons=e}pipe(){return v(this,arguments)}toJSON(){return{_id:`Cause`,failures:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${Ae(this.reasons)})`}[Ie](){return this.toJSON()}[ce](e){return at(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>le(t,e.reasons[n]))}[N](){return ne(this.reasons)}},st=new WeakMap,ct=class{[it];annotations;_tag;constructor(e,t,n){if(this[it]=it,this._tag=e,t!==lt&&typeof n==`object`&&n&&t.size>0){let e=st.get(n);e&&(t=new Map([...e,...t])),st.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 v(this,arguments)}toString(){return Ae(this)}[Ie](){return this.toString()}},lt=new Map,ut=class extends ct{constructor(e,t=lt){super(`Fail`,t,e),this.error=e}toString(){return`Fail(${Ae(this.error)})`}toJSON(){return{_tag:`Fail`,error:this.error}}[ce](e){return gt(e)&&le(this.error,e.error)&&le(this.annotations,e.annotations)}[N](){return L(B(this._tag))(L(P(this.error))(P(this.annotations)))}},dt=e=>new ot(e),ft=e=>new ot([new ut(e)]),pt=class extends ct{constructor(e,t=lt){super(`Die`,t,e),this.defect=e}toString(){return`Die(${Ae(this.defect)})`}toJSON(){return{_tag:`Die`,defect:this.defect}}[ce](e){return _t(e)&&le(this.defect,e.defect)&&le(this.annotations,e.annotations)}[N](){return L(B(this._tag))(L(P(this.defect))(P(this.annotations)))}},mt=e=>new ot([new pt(e)]),ht=y(e=>at(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new ot(e.reasons.map(e=>e.annotate(t,n)))),gt=e=>e._tag===`Fail`,_t=e=>e._tag===`Die`,vt=e=>e._tag===`Interrupt`;function yt(e){return Ot(`Effect.evaluate: Not implemented`)}var bt=e=>({...et,[Ke]:e.op,[Je]:e[Je]??yt,[Ye]:e[Ye],[Xe]:e[Xe],[Ze]:e[Ze]}),xt=e=>{let t=bt(e),n=function(e){this[qe]=e};return n.prototype=t,function(e){return new n(e)}},St=e=>{let t={[We]:We,_tag:e.op,get[e.prop](){return this[qe]},...bt(e),toString(){return`${e.op}(${Ae(this[qe])})`},toJSON(){return{_id:`Exit`,_tag:e.op,[e.prop]:this[qe]}},[ce](e){return nt(e)&&e._tag===this._tag&&le(this[qe],e[qe])},[N](){return L(B(e.op),P(this[qe]))}},n=function(e){this[qe]=e};return n.prototype=t,function(e){return new n(e)}},Ct=St({op:`Success`,prop:`value`,[Je](e){let t=e.getCont(Ye);return t?t[Ye](this[qe],e,this):e.yieldWith(this)}}),wt={key:`effect/Cause/StackTrace`},Tt={key:`effect/Cause/InterruptorStackTrace`},Et=St({op:`Failure`,prop:`cause`,[Je](e){let t=this[qe],n=!1;e.cache.stackFrame&&(t=ht(t,{mapUnsafe:new Map([[wt.key,e.cache.stackFrame]])}),n=!0);let r=e.getCont(Xe);for(;e.interruptible&&e._interruptedCause&&r;)r=e.getCont(Xe);return r?r[Xe](t,e,n?void 0:this):e.yieldWith(n?Et(t):this)}}),Dt=e=>Et(ft(e)),Ot=e=>Et(mt(e)),kt=xt({op:`WithFiber`,[Je](e){return this[qe](e)}}),At=function(){class e extends globalThis.Error{}let t=bt({op:`YieldableError`,[Je](){return Dt(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),jt=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return class extends At{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(He(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}(),Mt=e=>{class t extends jt{_tag=e}return t.prototype.name=e,t},Nt=`~effect/Cause/Done`,Pt=e=>M(e,Nt),Ft={[Nt]:Nt,_tag:`Done`,value:void 0},It=e=>e===void 0?Ft:{[Nt]:Nt,_tag:`Done`,value:e},Lt=Dt(Ft),Rt=e=>e===void 0?Lt:Dt(It(e)),zt=e=>bt({op:e.label,[Je]:e.evaluate}),Bt=`~effect/Result`,Vt={[Bt]:{_A:e=>e,_E:e=>e},...$e,[Symbol.iterator](){return new ze(this)}},Ht=Object.assign(Object.create(Vt),{_tag:`Success`,_op:`Success`,[ce](e){return Wt(e)&&Kt(e)&&le(this.success,e.success)},[N](){return L(P(this._tag))(P(this.success))},toString(){return`success(${Ae(this.success)})`},toJSON(){return{_id:`Result`,_tag:this._tag,value:Le(this.success)}}}),Ut=Object.assign(Object.create(Vt),{_tag:`Failure`,_op:`Failure`,[ce](e){return Wt(e)&&Gt(e)&&le(this.failure,e.failure)},[N](){return L(P(this._tag))(P(this.failure))},toString(){return`failure(${Ae(this.failure)})`},toJSON(){return{_id:`Result`,_tag:this._tag,failure:Le(this.failure)}}}),Wt=e=>M(e,Bt),Gt=e=>e._tag===`Failure`,Kt=e=>e._tag===`Success`,qt=function(e){this.failure=e};qt.prototype=Ut;var Jt=e=>new qt(e),Yt=function(e){this.success=e};Yt.prototype=Ht;var Xt=e=>new Yt(e),Zt=`~effect/Context/Service`,Qt=function(){function e(){}let t=e;Object.setPrototypeOf(t,$t);let n=(e,n)=>(t.key=e,n?.defaultValue&&(t[tn]=tn,t.defaultValue=n.defaultValue),n?.make&&(t.make=n.make),n?.fiberCached&&en.add(e),t);return arguments.length>0?n(arguments[0],arguments[1]):n},$t={[Zt]:Zt,...zt({label:`Service`,evaluate(e){return Ct(Cn(e.context,this))}}),toJSON(){return{_id:`Service`,key:this.key}},of(e){return e},context(e){return yn(this,e)},use(e){return kt(t=>e(Cn(t.context,this)))},useSync(e){return kt(t=>Ct(e(Cn(t.context,this))))}},en=new Set,tn=`~effect/Context/Reference`,nn=`~effect/Context`,rn=8,an=8,on=(e,t,n,r)=>{let i=Object.create(pn);return i.cacheRoot=e??i,i.base=t,i.overlay=n,i.depth=r,i._flat=void 0,i.baseHits=0,i},sn=(e,t)=>{t&&(sn(e,t.parent),e.set(t.key,t.value))},cn=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return sn(t,e.overlay),e._flat=t},ln=(e,t)=>{let n=new Map(e.mapUnsafe);return t(n),fn(n)},un=Symbol(),dn=(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)?un:(n.overlay&&++n.baseHits>=n.base.size&&n.baseHits>=an&&(n.base=cn(n),n.overlay=void 0,n.depth=0),r)},fn=e=>on(void 0,e,void 0,0),pn={get mapUnsafe(){return cn(this)},...$e,[nn]:{_Services:e=>e},toJSON(){return{_id:`Context`,services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[ce](e){if(!hn(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)||!le(r,n.get(e)))return!1;return!0},[N](){return ee(this.mapUnsafe.size)}},mn=(e,t)=>e.cacheRoot===t.cacheRoot,hn=e=>M(e,nn),gn=e=>!!e[tn],_n=()=>vn,vn=fn(new Map),yn=(e,t)=>fn(new Map([[e.key,t]])),bn=y(3,(e,t,n)=>xn(e,t.key,n)),xn=(e,t,n)=>{let r=e,i=en.has(t)?void 0:r.cacheRoot;if(r.depth>=rn){let e=new Map(r.mapUnsafe);return e.set(t,n),on(i,e,void 0,0)}return on(i,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)},Sn=(e,t)=>{let n=dn(e,t);return n===un?void 0:n},Cn=y(2,(e,t)=>{let n=dn(e,t.key);if(n===un){if(gn(t))return Tn(t);throw En(t)}return n}),wn=`~effect/Context/defaultValue`,Tn=e=>wn in e?e[wn]:e[wn]=e.defaultValue(),En=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},Dn=y(2,(e,t)=>e.mapUnsafe.size===0?t:t.mapUnsafe.size===0?e:ln(e,e=>t.mapUnsafe.forEach((t,n)=>e.set(n,t)))),On=Qt,kn=e=>e>0?Math.floor(e):0,An=Xt,jn=Jt,Mn=Gt,Nn=On(`effect/Scheduler`,{fiberCached:!0,defaultValue:()=>new Rn}),Pn=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},Fn=`setImmediate`in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},In=e=>{try{return Fn(e)}catch{return Pn(e)}},Ln=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}},Rn=class{executionMode;setImmediate;constructor(e=`async`,t){this.executionMode=e,this.setImmediate=t??(e===`sync`?Pn:In)}shouldYield(e){return e.currentOpCount>=e.cache.maxOpsBeforeYield}makeDispatcher(){return new zn(this.setImmediate)}},zn=class{tasks=new Ln;running=void 0;setImmediate;constructor(e=In){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()}},Bn=On(`effect/Scheduler/MaxOpsBeforeYield`,{fiberCached:!0,defaultValue:()=>2048}),Vn=On(`effect/Scheduler/PreventSchedulerYield`,{fiberCached:!0,defaultValue:()=>!1}),Hn=Mt,Un=`effect/Tracer/ParentSpan`,Wn=`effect/Tracer`,Gn=`effect/Metric/FiberRuntimeMetrics`,Kn=On(`effect/References/CurrentStackFrame`,{fiberCached:!0,defaultValue:C}),qn=On(`effect/References/TracerEnabled`,{fiberCached:!0,defaultValue:S}),Jn=On(`effect/References/CurrentLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),Yn=On(`effect/References/MinimumLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),Xn=class extends ct{constructor(e,t=lt){super(`Interrupt`,t,`Interrupted`),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:`Interrupt`,fiberId:this.fiberId}}[ce](e){return vt(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[N](){return L(B(`${this._tag}:${this.fiberId}`))(F(this.annotations))}},Zn=e=>new ot([new Xn(e)]),Qn=e=>{for(let t=0;t<e.reasons.length;t++){let n=e.reasons[t];if(n._tag===`Fail`)return An(n.error)}return jn(e)},$n=e=>e.reasons.some(vt),er=(e,t)=>{let n=new Map,r=[];for(let i of e.concat(t)){let e=P(i),t=n.get(e);if(t===void 0)n.set(e,[i]);else if(t.some(e=>le(e,i)))continue;else t.push(i);r.push(i)}return r},tr=y(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new ot(er(e.reasons,t.reasons));return le(e,n)?e:n}),nr=e=>{let t;for(let n of e.reasons){if(n._tag===`Fail`)return n.error;n._tag===`Die`&&(t??=n)}return t===void 0?e.reasons.length>0?new globalThis.Error(`All fibers interrupted without error`):new globalThis.Error(`Empty cause`):t.defect},rr=`~effect/Fiber`,ir={_A:b,_E:b},ar={id:0},or=()=>globalThis[De],sr=class{constructor(e,t=!0){this.setContext(e),this.id=++ar.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)}get[rr](){return ir}get currentDispatcher(){return this._dispatcher??=this.cache.scheduler.makeDispatcher()}getRef(e){return Cn(this.context,e)}addObserver(e){return this._exit?(e(this._exit),w):(this._observers===void 0?this._observers=[e]:this._observers.push(e),()=>this.removeObserver(e))}removeObserver(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=Zn(e);this.cache.stackFrame&&(n=ht(n,yn(wt,this.cache.stackFrame))),t&&(n=ht(n,t)),this._interruptedCause=this._interruptedCause?tr(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(vr(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===Qe)return;let n=dr.interruptChildren&&dr.interruptChildren(this);if(n!==void 0)return this.evaluate(Hr(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=_n()}runLoop(e){let t=globalThis[De];globalThis[De]=this;let n=this._running;this._running=!0;let r=!1,i=e;this.currentOpCount=0;try{for(;;){this._deferredInterrupt&&(this._deferredInterrupt=!1,i=vr(this._interruptedCause)),this.currentOpCount++;let e=this.cache;if(!r&&!e.preventYield&&e.scheduler.shouldYield(this)){r=!0;let e=i;i=Hr(Sr,()=>e)}if(i=e.tracerContext?e.tracerContext(i,this):i[Je](this),i===Qe){let e=this._yielded;if(We in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return Qe}}}catch(e){return M(i,Je)?this.runLoop(Ot(e)):Ot(`Fiber.runLoop: Not a valid effect: ${String(i)}`)}finally{this._running=n,globalThis[De]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,lr;for(;;){let t=this._stack.pop();if(!t)return;let n=t[Ze];if(n!==void 0){let r=n.call(t,this);if(r)return r[e]=r,r}if(t[e])return t}}succeedWith(e){if(!(++this.currentOpCount&ur-1))return Ct(e);let t=this.getCont(Ye);return t?t[Ye](e,this):this.yieldWith(Ct(e))}yieldWith(e){return this._yielded=e,Qe}children(){return this._children??=new Set}pipe(){return v(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&mn(t,e))return;let n=e.cacheRoot,r=n._fiberCache??=cr(e);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}},cr=e=>{let t=Sn(e,Wn);return{scheduler:Cn(e,Nn),tracer:t,tracerContext:t?t.context:void 0,tracerEnabled:Cn(e,qn),span:Sn(e,Un),logLevel:Cn(e,Jn),minimumLogLevel:Cn(e,Yn),stackFrame:Cn(e,Kn),runtimeMetrics:Sn(e,Gn),maxOpsBeforeYield:Cn(e,Bn),preventYield:Cn(e,Vn)}},lr={[Ye](e,t){return vr(t._interruptedCause)},[Xe](e,t){return vr(t._interruptedCause)}},ur=32,dr={interruptChildren:void 0},fr=e=>{if(!e.cache.stackFrame)return;let t=new Map;return t.set(Tt.key,e.cache.stackFrame),fn(t)},pr=e=>{let t=e;return t._exit?_r(t._exit):Or(n=>t._exit?n(_r(t._exit)):br(e.addObserver(e=>n(_r(e)))))},mr=e=>Or(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(_r(r))}return a(),br(()=>i?.())}),hr=e=>kt(t=>gr(e,t.id)),gr=y(e=>M(e[0],rr),(e,t,n)=>kt(r=>{let i=fr(r);return i=i&&n?Dn(i,n):i??n,e.interruptUnsafe(t,i),Vr(pr(e))})),_r=Ct,vr=Et,yr=Dt,br=xt({op:`Sync`,[Je](e){let t=this[qe](),n=e.getCont(Ye);return n?n[Ye](t,e):e.yieldWith(Ct(t))}}),xr=xt({op:`Suspend`,[Je](e){return this[qe]()}}),Sr=xt({op:`Yield`,[Je](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(qr)},this[qe]??0),e.yieldWith(()=>{t=!0})}})(0),Cr=e=>Ot(e),wr=_r(void 0),Tr=e=>{let t=typeof e==`function`?e:e.try,n=typeof e==`function`?e=>new Bi(e,`An error occurred in Effect.tryPromise`):e.catch;return Er(function(e,r){let i=t=>{try{e(yr(Be(()=>n(t))))}catch(t){e(Cr(t))}};try{t(r).then(t=>e(_r(t)),i)}catch(e){i(e)}},t.length!==0)},Er=function(){let e=bt({op:`Async`,[Je](e){let t=!1,n=!1,r=this.withSignal?new AbortController:void 0,i=this.register.call(e.cache.scheduler,r=>{t||(t=!0,n?e.evaluate(r):n=r)},r?.signal);return n===!1?(n=!0,e._yielded=()=>{t=!0},r===void 0&&i===void 0||e._stack.push(Dr(()=>(t=!0,r?.abort(),i??qr))),Qe):n}}),t=function(e,t){this.register=e,this.withSignal=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),Dr=xt({op:`AsyncFinalizer`,[Ze](e){e.interruptible&&(e.interruptible=!1,e._stack.push(ji))},[Xe](e,t){return $n(e)?Hr(hi(Et(e),this[qe]()),()=>vr(e)):vr(e)}}),Or=e=>Er(e,e.length>=2),kr=(...e)=>{if(e.length===1){let t=e[0];return xr(()=>Mr(t()))}let[t,n]=e;return xr(()=>Mr(n.call(t.self)))},Ar=(e,...t)=>{let n=t.length===0?function(){return xr(()=>Mr(e.apply(this,arguments)))}:function(){let n=xr(()=>Mr(e.apply(this,arguments)));for(let e=0;e<t.length;e++)n=t[e](n,...arguments);return n};return jr(e.length,n)},jr=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),Mr=function(){let e=bt({op:`Iterator`,[Ye](e,t){let n=this.iterator;for(;;){let r=n.next(e);if(r.done)return _r(r.value);if(!Ur(r.value))return t._stack.push(this),r.value;if(r.value._tag===`Failure`)return r.value;e=r.value.value}},[Je](e){return this[Ye](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)}}(),Nr=function(e){return e._stack.push(this),this[qe]},Pr=bt({op:`OnSuccess`,[Je]:Nr}),Fr=function(e,t,n){this[qe]=e,this[Ye]=t,this.payload=n};Fr.prototype=Pr;var Ir=function(){return this.payload},Lr=(()=>{let e=`~effect/Effect/stackProbe`;return{[e]:function(){return Error().stack}}[e]()?.includes(`[as `+e+`]`)===!0})(),Rr=function(e,t){let n=this.payload;return t.succeedWith(Lr?n(e):Be(()=>n(e)))},zr=function(e){let t=this.payload;return t(e)},Br=y(2,(e,t)=>new Fr(e,tt(t)?Ir:zr,t)),Vr=e=>new Fr(e,Ir,qr),Hr=y(2,(e,t)=>new Fr(e,zr,t)),Ur=e=>e[We]!==void 0,Wr=y(2,(e,t)=>new Fr(e,Rr,t)),Gr=e=>e._tag===`Success`,Kr=e=>e._tag===`Failure`,qr=Ct(void 0),Jr=e=>{let t=[];for(let n of e)n._tag===`Failure`&&t.push(...n.cause.reasons);return t.length===0?qr:Et(dt(t))},Yr=y(2,(e,t)=>kt(n=>{let r=n.context,i=t(r);return r===i?e:(n.setContext(i),ki(n,()=>{n.setContext(r)}),e)})),Xr=e=>kt(t=>e(t.context)),Zr=y(2,(e,t)=>Ur(e)?e:Yr(e,Dn(t))),Qr=function(){return arguments.length===1?y(2,(e,t)=>$r(e,arguments[0],t)):y(3,(e,t,n)=>$r(e,t,n)).apply(this,arguments)},$r=(e,t,n)=>Yr(e,bn(t,n)),ei=y(e=>tt(e[0]),(e,t)=>Ni({while:S,body:x(t?.disableYield?e:Hr(e,e=>Sr)),step:w})),ti=y(2,(e,t)=>new ri(e,t.length===1?t:e=>t(e))),ni=bt({op:`OnFailure`,[Je]:Nr}),ri=function(e,t){this[qe]=e,this[Xe]=t};ri.prototype=ni;var ii=y(3,(e,t,n)=>ti(e,e=>{let r=t(e);return Mn(r)?vr(r.failure):n(r.success,e)})),ai=y(3,(e,t,n)=>ti(e,e=>{let r=t(e);return Mn(r)?vr(e):Br(n(r.success,e),vr(e))})),oi=y(2,(e,t)=>ai(e,Qn,e=>t(e))),si=e=>Ur(e)?Ct(e):ci(e),ci=xt({op:`Exit`,[Je](e){return e._stack.push(this),this[qe]},[Ye](e,t,n){return t.succeedWith(n??Ct(e))},[Xe](e,t,n){return t.succeedWith(n??Et(e))}}),li=`~effect/Scope`,ui=`~effect/Scope/Closeable`,di=Qt(`effect/Scope`),fi=(e,t)=>kt(n=>{let r=pi(e,t);return r===void 0?wr:(Mi(n),r)}),pi=(e,t)=>{let n=e.state;if(n._tag===`Closed`||(e.state={_tag:`Closed`,exit:t},e.parent!==void 0&&yi(e.parent,e),n._tag===`Empty`))return;if(n.finalizer!==void 0)return mi(n.finalizer,t);let r=n.finalizers;return r.size===1?mi(r.values().next().value,t):gi(e,r,t)},mi=(e,t)=>{try{return e(t)}catch(e){return Ot(e)}},hi=(e,t)=>Gr(e)?t:ti(t,t=>vr(tr(e.cause,t))),gi=Ar(function*(e,t,n){let r=[],i=[],a=Array.from(t.values()),o=or();for(let t=a.length-1;t>=0;t--){let s=a[t];e.strategy===`sequential`?r.push(yield*si(mi(s,n))):i.push(Pi(o,mi(s,n),!0,!0,`inherit`))}return i.length>0&&(r=yield*mr(i)),yield*Jr(r)}),_i=(e,t)=>xr(()=>e.state._tag===`Closed`?t(e.state.exit):(vi(e,{},t),wr)),vi=(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.set(t,n):(r.finalizers=new Map([[r.finalizerKey,r.finalizer]]),r.finalizerKey=void 0,r.finalizer=void 0,r.finalizers.set(t,n))}},yi=(e,t)=>{if(e.state._tag!==`Open`)return;let n=e.state;n.finalizerKey===t?e.state=Si:n.finalizers!==void 0&&(n.finalizers.delete(t),n.finalizers.size===0&&(e.state=Si))},bi=e=>xi(e,void 0),xi=(e=`sequential`,t)=>({[ui]:ui,[li]:li,strategy:e,parent:t,state:Si}),Si={_tag:`Empty`},Ci=e=>br(()=>bi(e)),wi=di,Ti=Qr(di),Ei=e=>Hr(wi,t=>Xr(n=>_i(t,t=>Zr(e(t),n)))),Di=function(){let e=bt({op:`OnExit`,[Je](e){return e._stack.push(this),this.effect},[Ze](e){e.interruptible&&this.interruptible!==!0&&(e._stack.push(ji),e.interruptible=!1)},[Ye](e,t,n){n??=Ct(e);let r;try{r=this.onExit(n)}catch(e){r=Ot(e)}return r?Hr(r,e=>n):n},[Xe](e,t,n){n??=Et(e);let r;try{r=this.onExit(n)}catch(e){r=Ot(e)}return r?Hr(hi(n,r),e=>n):n}}),t=function(e,t,n){this.effect=e,this.onExit=t,this.interruptible=n};return t.prototype=e,t}(),Oi=(e,t,n)=>new Di(e,t,n),ki=(e,t)=>{e._stack.push(new Di(void 0,t,void 0))},Ai=y(2,Oi),ji=xt({op:`SetInterruptible`,[Ze](e){if(e.interruptible=this[qe],e._interruptedCause&&e.interruptible)return()=>vr(e._interruptedCause)}})(!0),Mi=e=>{let t=e;t.interruptible&&(t.interruptible=!1,t._stack.push(ji))},Ni=xt({op:`While`,[Ye](e,t){return this[qe].step(e),this[qe].while()?(t._stack.push(this),this[qe].body()):qr},[Je](e){return this[qe].while()?(e._stack.push(this),this[qe].body()):qr}}),Pi=(e,t,n=!1,r=!1,i=!1)=>{let a=e,o=i===`inherit`?a.interruptible:!i,s=new sr(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},Fi=e=>(t,n)=>{let r=new sr(n?.scheduler?bn(e,Nn,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},Ii=Fi(_n()),Li=e=>{let t=Fi(e);return(e,n)=>{let r=t(e,n);return new Promise(e=>{r.addObserver(t=>e(t))})}},Ri=(e=>{let t=Li(e);return(e,n)=>t(e,n).then(e=>{if(e._tag===`Failure`)throw nr(e.cause);return e.value})})(_n()),zi=`~effect/Cause/UnknownError`,Bi=class extends Mt(`UnknownError`){[zi]=zi;constructor(e,t){super({message:t,cause:e})}},Vi={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};Vi.gray,Vi.blue,Vi.green,Vi.yellow,Vi.red,Vi.bgBrightRed,Vi.black;var Hi=dt,Ui=Pt,Wi=Rt,Gi=Kr,Ki=Ci,qi=bi,Ji=Ti,Yi=fi,Xi=y(2,(e,t)=>ii(e,ea,e=>t(e))),Zi=e=>e.reasons.some(Qi),Qi=e=>e._tag===`Fail`&&Ui(e.error),$i=e=>{let t,n=!1;for(let r of e.reasons)Qi(r)?t??=r.error:r._tag!==`Interrupt`&&(n=!0);return t===void 0?jn(e):n?jn(Hi(e.reasons.filter(e=>!Qi(e)))):An(t)},ea=e=>{let t=$i(e);return Mn(t)?t:An(t.success.value)},ta=Ni,na=Tr,ra=_r,ia=xr,aa=br,oa=wr,sa=Or,ca=kr,la=vr,ua=Hr,da=Br,fa=Wr,pa=ti,ma=oi,ha=Ei,ga=Ai,_a=ei,va=Ii,ya=Ri,ba=hr,xa=Symbol.for(`effect/MutableList/Empty`),Sa=()=>({head:void 0,tail:void 0,length:0}),Ca=e=>{let t=e.head;t.offset>=1024&&t===e.tail&&t.mutable&&(t.array.length-t.offset)*8<=t.offset&&(e.head=e.tail={array:t.array.slice(t.offset),mutable:!0,offset:0,next:void 0})},wa=()=>({array:[],mutable:!0,offset:0,next:void 0}),Ta=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=wa(),e.tail=e.tail.next):e.head=e.tail=wa(),e.tail.array.push(t),e.length++},Ea=e=>{e.head=e.tail=void 0,e.length=0},Da=(e,t)=>{if(t=kn(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 Ea(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.offset===i.array.length&&i.next?i.next:i,e.length-=t,e.length===0?Ea(e):Ca(e),n;i=i.next}return Ea(e),n},Oa=e=>{if(!e.head)return xa;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:Ea(e):Ca(e),t},ka=`~effect/Queue`,Aa=`~effect/Queue/Enqueue`,ja=`~effect/Queue/Dequeue`,Ma={_A:b,_E:b},Na={[ka]:Ma,[Aa]:Ma,[ja]:Ma,...$e,toJSON(){return{_id:`effect/Queue`,state:this.state._tag,size:za(this)}}},Pa=e=>kt(t=>{let n=Object.create(Na);return n.dispatcher=t.currentDispatcher,n.capacity=e?.capacity??1/0,n.strategy=e?.strategy??`suspend`,n.messages=Sa(),n.scheduleRunning=!1,n.state={_tag:`Open`,takers:new Set,offers:new Set,awaiters:new Set},_r(n)}),Fa=()=>Pa(),Ia=(e,t)=>e.state._tag===`Open`?e.messages.length>=e.capacity?e.strategy===`sliding`?(Oa(e.messages),Ta(e.messages,t),!0):e.capacity<=0&&e.state.takers.size>0&&(Ta(e.messages,t),Va(e),!0):(Ta(e.messages,t),Ha(e),!0):!1,La=e=>Ra(e,1,1/0),Ra=y(3,(e,t,n)=>(t=kn(t),n=kn(n),xr(()=>Ua(e,t,n)??Br(Ga(e,()=>Wa(e,t)),Ra(e,t,n))))),za=e=>e.state._tag===`Done`?0:e.messages.length,Ba=Ct(!0),Va=e=>{if(e.state._tag!==`Done`&&e.state.takers.size!==0){for(let t of e.state.takers)if(t.ready()&&(e.state.takers.delete(t),t.resume(qr),e.messages.length===0))break}},Ha=e=>{e.scheduleRunning||e.state._tag===`Done`||e.state.takers.size===0||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>{e.scheduleRunning=!1,Va(e)},0))},Ua=(e,t,n)=>{if(e.state._tag===`Done`)return e.state.exit;if(n<=0||t<=0)return Ct([]);if(!Wa(e,t))return;let r=e.messages.length>0?Da(e.messages,n):[Ka(e.state.offers)];return qa(e),Ct(r)},Wa=(e,t)=>e.messages.length>=(e.state._tag===`Closing`?1:Math.min(t,e.capacity||1))||e.capacity<=0&&e.state._tag!==`Done`&&e.state.offers.size>0,Ga=(e,t)=>Or(n=>{if(e.state._tag===`Done`)return n(e.state.exit);if(t())return n(qr);let r={ready:t,resume:n};return e.state.takers.add(r),br(()=>{e.state._tag!==`Done`&&e.state.takers.delete(r)})}),Ka=e=>{let t=e.values().next().value;if(t._tag===`Single`)return e.delete(t),t.resume(Ba),t.message;let n=t.remaining[t.offset++];return t.offset===t.remaining.length&&(e.delete(t),t.resume(Ct([]))),n},qa=e=>{if(e.state._tag===`Done`)return Zi(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag===`Closing`&&e.messages.length===0&&(Ja(e,e.state.exit),Zi(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`)Ta(e.messages,t.message),e.state.offers.delete(t),t.resume(Ba);else{for(;t.offset<t.remaining.length;t.offset++){if(n===0)return!1;Ta(e.messages,t.remaining[t.offset]),n--}e.state.offers.delete(t),t.resume(Ct([]))}}return!1},Ja=(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.resume(t);n.takers.clear();for(let e of n.awaiters)e(t);n.awaiters.clear()},Ya={"~effect/Channel":{_Env:b,_InErr:b,_InElem:b,_OutErr:b,_OutElem:b},pipe(){return v(this,arguments)}},Xa=e=>{let t=Object.create(Ya);return t.transform=(t,n)=>pa(e(t,n),e=>ra(la(e))),t},Za=e=>Xa((t,n)=>e),Qa=e=>e.transform,$a=e=>Za(ra(La(e))),eo=(e,t,n)=>ia(()=>{let r=qi();return Xi(ua(Qa(e)(Wi(),r),t),n||ra).pipe(ga(e=>Yi(r,e)))}),to=y(2,(e,t)=>eo(e,e=>_a(ua(e,t),{disableYield:!0}))),no=`~effect/Stream`,ro={_R:b,_E:b,_A:b},io=function(e){this.channel=e};io.prototype={[no]:ro,pipe(){return v(this,arguments)}};var ao=e=>new io(e),oo=e=>ao($a(e)),so=y(2,(e,t)=>to(e.channel,e=>{let n=0;return ta({while:()=>n<e.length,body:()=>t(e[n++]),step:w})})),G=l(d()),co=_(),lo=(e,t)=>e.status===`ready`?{status:`ready`,api:t(e.api)}:e,uo=e=>({open:async(t,n,r)=>{let i=await ya(Ki()),a=await ya(Ji(e.open,i).pipe(ga(e=>Gi(e)?Yi(i,e):oa))),o=!1,s=so(a.changes,e=>aa(()=>{o||t(e)})),c=va((n?s.pipe(ma(e=>aa(()=>{o||n(e)}))):s).pipe(da(aa(()=>{!o&&r&&r()})),ga(e=>Yi(i,e))));return{initial:a.initial,close:()=>{o=!0,va(ba(c))}}}});function fo(e){let t=e.telemetry,n={contractVersion:e.contractVersion,sourceAccess:e.sourceAccess,metadataAccess:e.metadataAccess,assets:e.assets&&lo(e.assets,e=>({uploadImage:t=>ya(e.uploadImage(t)),fonts:{catalog:()=>ya(e.fonts.catalog)}})),fixtures:e.fixtures&&lo(e.fixtures,e=>({view:t=>ya(e.view(t))})),versions:e.versions&&lo(e.versions,e=>({save:(t,n)=>ya(e.save(t,n)),savedRevision:()=>ya(e.savedRevision)})),lifecycle:e.lifecycle&&lo(e.lifecycle,e=>({inspect:()=>ya(e.inspect),publish:t=>ya(e.publish(t)),restore:t=>ya(e.restore(t)),resolveConflict:t=>ya(e.resolveConflict(t)),updateFile:t=>ya(e.updateFile(t)),putAsset:t=>ya(e.putAsset(t))})),render:e.render&&((t,n,r)=>ya(e.render(t,n,r))),telemetry:t&&(e=>{va(t(e))})};return e.access===`readonly`?{...n,access:`readonly`,document:uo(e.document)}:{...n,access:`editable`,document:uo(e.document),writer:{save:t=>ya(e.writer.save(t))}}}var po=`2026-10-03.1`,mo=e=>e.kind===`page`,ho=class extends Hn(`DocumentConflict`){},go=class extends Hn(`DocumentUnavailable`){};Hn(`LifecycleUnavailable`),Hn(`ProjectFileExists`);var _o=[{value:`transactional`,label:`Transactional`},{value:`promotional`,label:`Promotional`},{value:`service_implicit`,label:`Service (implicit opt-in)`}],vo=[{value:`marketing`,label:`Marketing`},{value:`utility`,label:`Utility`},{value:`authentication`,label:`Authentication`}],yo=[{value:`text`,label:`Text`},{value:`image`,label:`Image`},{value:`video`,label:`Video`},{value:`document`,label:`Document`}],bo=[{value:`quick-reply`,label:`Quick reply`},{value:`url`,label:`URL`},{value:`phone`,label:`Phone number`},{value:`copy-code`,label:`Copy code`}],xo=[[`path`,{d:`M12.001 5.00003V19.002`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M19.002 12.002L4.99998 12.002`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],So=[[`path`,{d:`M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Co=[[`path`,{d:`M16.4999 3.26621C17.3443 3.25421 20.1408 2.67328 20.7337 3.26621C21.3266 3.85913 20.7457 6.65559 20.7337 7.5M20.5059 3.49097L13.5021 10.4961`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M3.26636 16.5001C3.25436 17.3445 2.67343 20.141 3.26636 20.7339C3.85928 21.3268 6.65574 20.7459 7.50015 20.7339M10.502 13.4976L3.49824 20.5027`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],wo=[[`path`,{d:`M15 6C15 6 9.00001 10.4189 9 12C8.99999 13.5812 15 18 15 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],To=[[`path`,{d:`M5.5 12.002H19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M10.9999 18.002C10.9999 18.002 4.99998 13.583 4.99997 12.0019C4.99996 10.4208 11 6.00195 11 6.00195`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Eo=[[`path`,{d:`M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Do=[[`path`,{d:`M6.5023 10.7365C7.34671 10.7485 10.1432 11.3294 10.7361 10.7365C11.329 10.1436 10.7481 7.34708 10.7361 6.50267M13.2685 17.5027C13.2565 16.6583 12.6756 13.8618 13.2685 13.2689C13.8614 12.676 16.6579 13.2569 17.5023 13.2689M20.9991 21.001L13.6102 13.6188M10.3691 10.3763L2.99998 2.99902`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Oo=[[`path`,{d:`M17.9998 15C17.9998 15 13.5809 9.00001 11.9998 9C10.4187 8.99999 5.99985 15 5.99985 15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],ko=[[`path`,{d:`M12 5.5V19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M18 11C18 11 13.5811 5.00001 12 5C10.4188 4.99999 6 11 6 11`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Ao=[[`path`,{d:`M7 4V20`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M17 19L17 4`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M10 6.99998C10 6.99998 7.79053 4.00001 6.99998 4C6.20942 3.99999 4 7 4 7`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M20 17C20 17 17.7905 20 17 20C16.2094 20 14 17 14 17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],jo=[[`path`,{d:`M21.5 12C21.5 17.2467 17.2467 21.5 12 21.5C10.3719 21.5 8.8394 21.0904 7.5 20.3687C5.63177 19.362 4.37462 20.2979 3.26592 20.4658C3.09774 20.4913 2.93024 20.4302 2.80997 20.31C2.62741 20.1274 2.59266 19.8451 2.6935 19.6074C3.12865 18.5818 3.5282 16.6382 2.98341 15C2.6698 14.057 2.5 13.0483 2.5 12C2.5 6.75329 6.75329 2.5 12 2.5C17.2467 2.5 21.5 6.75329 21.5 12Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12.1257 12H12.0007M8.125 12H8M16.125 12H16M12.2507 12C12.2507 12.1381 12.1388 12.25 12.0007 12.25C11.8627 12.25 11.7507 12.1381 11.7507 12C11.7507 11.8619 11.8627 11.75 12.0007 11.75C12.1388 11.75 12.2507 11.8619 12.2507 12ZM8.25 12C8.25 12.1381 8.13807 12.25 8 12.25C7.86193 12.25 7.75 12.1381 7.75 12C7.75 11.8619 7.86193 11.75 8 11.75C8.13807 11.75 8.25 11.8619 8.25 12ZM16.25 12C16.25 12.1381 16.1381 12.25 16 12.25C15.8619 12.25 15.75 12.1381 15.75 12C15.75 11.8619 15.8619 11.75 16 11.75C16.1381 11.75 16.25 11.8619 16.25 12Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Mo=[[`path`,{d:`M18 6L6.00081 17.9992M17.9992 18L6 6.00085`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],No=[[`path`,{d:`M11 6L21 6`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M11 12L21 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M11 18L21 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M3 7.39286C3 7.39286 4 8.04466 4.5 9C4.5 9 6 5.25 8 4`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M3 18.3929C3 18.3929 4 19.0447 4.5 20C4.5 20 6 16.25 8 15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}]],Po=[[`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 8V12L14 14`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Fo=[[`path`,{d:`M14 21H16M14 21C13.1716 21 12.5 20.3284 12.5 19.5V17L12 17M14 21H10M10 21H8M10 21C10.8284 21 11.5 20.3284 11.5 19.5V17L12 17M12 17V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M16 3H8C5.17157 3 3.75736 3 2.87868 3.87868C2 4.75736 2 6.17157 2 9V11C2 13.8284 2 15.2426 2.87868 16.1213C3.75736 17 5.17157 17 8 17H16C18.8284 17 20.2426 17 21.1213 16.1213C22 15.2426 22 13.8284 22 11V9C22 6.17157 22 4.75736 21.1213 3.87868C20.2426 3 18.8284 3 16 3Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Io=[[`path`,{d:`M7.5 14.5C7.5 11.2002 7.5 9.55025 8.52513 8.52513C9.55025 7.5 11.2002 7.5 14.5 7.5C17.7998 7.5 19.4497 7.5 20.4749 8.52513C21.5 9.55025 21.5 11.2002 21.5 14.5C21.5 17.7998 21.5 19.4497 20.4749 20.4749C19.4497 21.5 17.7998 21.5 14.5 21.5C11.2002 21.5 9.55025 21.5 8.52513 20.4749C7.5 19.4497 7.5 17.7998 7.5 14.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7.5 16.5C6.10355 16.5 5.40533 16.5 4.84402 16.3036C3.83866 15.9518 3.0482 15.1613 2.69641 14.156C2.5 13.5947 2.5 12.8964 2.5 11.5V9.5C2.5 6.20017 2.5 4.55025 3.52513 3.52513C4.55025 2.5 6.20017 2.5 9.5 2.5H11.5C12.8964 2.5 13.5947 2.5 14.156 2.69641C15.1613 3.0482 15.9518 3.83866 16.3036 4.84402C16.5 5.40533 16.5 6.10355 16.5 7.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Lo=[[`path`,{d:`M14.5352 11.0865L18.5575 12.6605C20.8775 13.5683 22.0375 14.0222 21.9991 14.7422C21.9606 15.4622 20.75 15.7924 18.3288 16.4527C17.6079 16.6493 17.2475 16.7476 16.9976 16.9976C16.7476 17.2475 16.6493 17.6079 16.4527 18.3288C15.7924 20.75 15.4622 21.9606 14.7422 21.9991C14.0222 22.0375 13.5683 20.8775 12.6605 18.5575L11.0865 14.5352C10.136 12.1062 9.6608 10.8918 10.2763 10.2763C10.8918 9.6608 12.1062 10.136 14.5352 11.0865Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M10.8576 7.08329C11.0714 7.43808 11.5323 7.55239 11.8871 7.33861C12.2419 7.12483 12.3562 6.66392 12.1424 6.30913L10.8576 7.08329ZM6.30914 12.1424C6.66392 12.3562 7.12483 12.2419 7.33861 11.8871C7.55239 11.5323 7.43808 11.0714 7.08329 10.8576L6.30914 12.1424ZM5.75 8.5C5.75 6.98122 6.98123 5.75 8.5 5.75V4.25C6.15281 4.25 4.25 6.15279 4.25 8.5H5.75ZM8.5 5.75C9.49944 5.75 10.3752 6.28272 10.8576 7.08329L12.1424 6.30913C11.3999 5.07687 10.0469 4.25 8.5 4.25V5.75ZM7.08329 10.8576C6.28272 10.3752 5.75 9.49945 5.75 8.5H4.25C4.25 10.0469 5.07688 11.3999 6.30914 12.1424L7.08329 10.8576Z`,fill:`currentColor`,key:`1`}],[`path`,{d:`M14.2515 8.13498C14.2778 8.54836 14.6342 8.86216 15.0476 8.83587C15.461 8.80958 15.7748 8.45316 15.7485 8.03979L14.2515 8.13498ZM8.04118 15.7485C8.45457 15.7747 8.81093 15.4608 8.83714 15.0475C8.86335 14.6341 8.54948 14.2777 8.1361 14.2515L8.04118 15.7485ZM2.75 8.50661C2.75 5.32733 5.32736 2.75 8.50664 2.75V1.25C4.49895 1.25 1.25 4.49889 1.25 8.50661H2.75ZM8.50664 2.75C11.561 2.75 14.0604 5.12926 14.2515 8.13498L15.7485 8.03979C15.5074 4.24925 12.3576 1.25 8.50664 1.25V2.75ZM8.1361 14.2515C5.12986 14.0609 2.75 11.5614 2.75 8.50661H1.25C1.25 12.358 4.25002 15.5081 8.04118 15.7485L8.1361 14.2515Z`,fill:`currentColor`,key:`2`}]],Ro=[[`path`,{d:`M19.5 5.5L18.8803 15.5251C18.7219 18.0864 18.6428 19.3671 18.0008 20.2879C17.6833 20.7431 17.2747 21.1273 16.8007 21.416C15.8421 22 14.559 22 11.9927 22C9.42312 22 8.1383 22 7.17905 21.4149C6.7048 21.1257 6.296 20.7408 5.97868 20.2848C5.33688 19.3626 5.25945 18.0801 5.10461 15.5152L4.5 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M3 5.5H21M16.0557 5.5L15.3731 4.09173C14.9196 3.15626 14.6928 2.68852 14.3017 2.39681C14.215 2.3321 14.1231 2.27454 14.027 2.2247C13.5939 2 13.0741 2 12.0345 2C10.9688 2 10.436 2 9.99568 2.23412C9.8981 2.28601 9.80498 2.3459 9.71729 2.41317C9.32164 2.7167 9.10063 3.20155 8.65861 4.17126L8.05292 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M9.5 16.5L9.5 10.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M14.5 16.5L14.5 10.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}]],zo=[[`path`,{d:`M16.9504 12.1817C17.1981 12.814 16.5076 13.5726 15.1267 15.0899C13.6702 16.6902 12.9201 17.4904 12 17.5C11.0799 17.4904 10.3298 16.6902 8.87331 15.0899C7.49239 13.5726 6.80193 12.814 7.04964 12.1817C7.05868 12.1586 7.06851 12.1359 7.0791 12.1135C7.34928 11.542 8.24477 11.5029 10 11.5002V4.99998C10 4.53501 10 4.30253 10.0511 4.11179C10.1898 3.59414 10.5941 3.1898 11.1118 3.05111C11.3025 3 11.535 3 12 3C12.4649 3 12.6974 3 12.8882 3.05111C13.4058 3.1898 13.8102 3.59414 13.9489 4.11179C14 4.30253 14 4.53501 14 4.99998V11.5002C15.7552 11.5029 16.6507 11.542 16.9209 12.1135C16.9315 12.1359 16.9413 12.1586 16.9504 12.1817Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M5.00006 21H19.0001`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Bo=[[`path`,{d:`M14.4998 19H12.4998C9.67139 19 8.25718 19 7.3785 18.1213C6.49982 17.2426 6.49982 15.8284 6.49982 13V8C6.49982 5.17157 6.49982 3.75736 7.3785 2.87868C8.25718 2 9.67139 2 12.4998 2H13.843C14.6605 2 15.0692 2 15.4368 2.15224C15.8043 2.30448 16.0933 2.59351 16.6714 3.17157L19.3282 5.82843C19.9063 6.40648 20.1953 6.69552 20.3476 7.06306C20.4998 7.4306 20.4998 7.83935 20.4998 8.65685V13C20.4998 15.8284 20.4998 17.2426 19.6211 18.1213C18.7425 19 17.3282 19 14.4998 19Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M14.9998 2.5V3.5C14.9998 5.38562 14.9998 6.32843 15.5856 6.91421C16.1714 7.5 17.1142 7.5 18.9998 7.5H19.9998`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M6.49945 5C4.8426 5 3.49945 6.34315 3.49945 8V16C3.49945 18.8285 3.49945 20.2427 4.37813 21.1213C5.25681 22 6.67102 22 9.49945 22H14.4998C16.1566 22 17.4998 20.6568 17.4998 19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M10 11H14M10 15H17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],Vo=[[`path`,{d:`M2 6H22M2 18H22`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M6 22L6 2M18 22V2`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Ho=[[`path`,{d:`M19 17L19 11C19 8.17157 19 6.75736 18.1213 5.87868C17.2426 5 15.8284 5 13 5H10M10 5C10 4.29977 11.9943 2.99153 12.5 2.5M10 5C10 5.70023 11.9943 7.00847 12.5 7.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M5 7.5L5 13.5C5 16.3284 5 17.7426 5.87868 18.6213C6.75736 19.5 8.17157 19.5 11 19.5H14M14 19.5C14 20.2002 12.0057 21.5085 11.5 22M14 19.5C14 18.7998 12.0057 17.4915 11.5 17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`circle`,{cx:`19`,cy:`19`,r:`2`,stroke:`currentColor`,strokeWidth:`1.5`,key:`2`}],[`circle`,{cx:`5`,cy:`5`,r:`2`,stroke:`currentColor`,strokeWidth:`1.5`,key:`3`}]],Uo=[[`path`,{d:`M4 5V19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M14 5V19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M17 19H18.5M20 19H18.5M18.5 19V11L17 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M4 12L14 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],Wo=[[`circle`,{cx:`7.5`,cy:`7.5`,r:`1.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M5 21C9.37246 15.775 14.2741 8.88406 21.4975 13.5424`,stroke:`currentColor`,strokeWidth:`1.5`,key:`2`}]],Go=[[`path`,{d:`M8.64298 3.14559L6.93816 3.93362C4.31272 5.14719 3 5.75397 3 6.75C3 7.74603 4.31272 8.35281 6.93817 9.56638L8.64298 10.3544C10.2952 11.1181 11.1214 11.5 12 11.5C12.8786 11.5 13.7048 11.1181 15.357 10.3544L17.0618 9.56638C19.6873 8.35281 21 7.74603 21 6.75C21 5.75397 19.6873 5.14719 17.0618 3.93362L15.357 3.14559C13.7048 2.38186 12.8786 2 12 2C11.1214 2 10.2952 2.38186 8.64298 3.14559Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M20.788 11.0972C20.9293 11.2959 21 11.5031 21 11.7309C21 12.7127 19.6873 13.3109 17.0618 14.5072L15.357 15.284C13.7048 16.0368 12.8786 16.4133 12 16.4133C11.1214 16.4133 10.2952 16.0368 8.64298 15.284L6.93817 14.5072C4.31272 13.3109 3 12.7127 3 11.7309C3 11.5031 3.07067 11.2959 3.212 11.0972`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M20.3767 16.2661C20.7922 16.5971 21 16.927 21 17.3176C21 18.2995 19.6873 18.8976 17.0618 20.0939L15.357 20.8707C13.7048 21.6236 12.8786 22 12 22C11.1214 22 10.2952 21.6236 8.64298 20.8707L6.93817 20.0939C4.31272 18.8976 3 18.2995 3 17.3176C3 16.927 3.20778 16.5971 3.62334 16.2661`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Ko=[[`path`,{d:`M3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 2.5V21.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}]],qo=[[`path`,{d:`M20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28248 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12C2.5 7.52166 2.5 5.28248 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M21.5 8.5L2.5 8.5`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M21.5 15.5L2.5 15.5`,stroke:`currentColor`,strokeWidth:`1.5`,key:`2`}]],Jo=[[`path`,{d:`M8 5.5L20 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8 12.5L20 12.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M8 19.5L20 19.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M4.375 5.5H4.25M4.5 5.5C4.5 5.63807 4.38807 5.75 4.25 5.75C4.11193 5.75 4 5.63807 4 5.5C4 5.36193 4.11193 5.25 4.25 5.25C4.38807 5.25 4.5 5.36193 4.5 5.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M4.375 12.5H4.25M4.5 12.5C4.5 12.6381 4.38807 12.75 4.25 12.75C4.11193 12.75 4 12.6381 4 12.5C4 12.3619 4.11193 12.25 4.25 12.25C4.38807 12.25 4.5 12.3619 4.5 12.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M4.375 19.5H4.25M4.5 19.5C4.5 19.6381 4.38807 19.75 4.25 19.75C4.11193 19.75 4 19.6381 4 19.5C4 19.3619 4.11193 19.25 4.25 19.25C4.38807 19.25 4.5 19.3619 4.5 19.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`5`}]],Yo=[[`path`,{d:`M9.14339 10.691L9.35031 10.4841C11.329 8.50532 14.5372 8.50532 16.5159 10.4841C18.4947 12.4628 18.4947 15.671 16.5159 17.6497L13.6497 20.5159C11.671 22.4947 8.46279 22.4947 6.48405 20.5159C4.50532 18.5372 4.50532 15.329 6.48405 13.3503L6.9484 12.886`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M17.0516 11.114L17.5159 10.6497C19.4947 8.67095 19.4947 5.46279 17.5159 3.48405C15.5372 1.50532 12.329 1.50532 10.3503 3.48405L7.48405 6.35031C5.50532 8.32904 5.50532 11.5372 7.48405 13.5159C9.46279 15.4947 12.671 15.4947 14.6497 13.5159L14.8566 13.309`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}]],Xo=[[`path`,{d:`M11.0991 3.00012C7.45013 3.00669 5.53932 3.09629 4.31817 4.31764C3.00034 5.63568 3.00034 7.75704 3.00034 11.9997C3.00034 16.2424 3.00034 18.3638 4.31817 19.6818C5.63599 20.9999 7.75701 20.9999 11.9991 20.9999C16.241 20.9999 18.3621 20.9999 19.6799 19.6818C20.901 18.4605 20.9906 16.5493 20.9972 12.8998`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M20.556 3.49612L11.0487 13.0586M20.556 3.49612C20.062 3.00151 16.7343 3.04761 16.0308 3.05762M20.556 3.49612C21.05 3.99074 21.0039 7.32273 20.9939 8.02714`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Zo=[[`path`,{d:`M2 6L8.91302 9.91697C11.4616 11.361 12.5384 11.361 15.087 9.91697L22 6`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M2.01577 13.4756C2.08114 16.5412 2.11383 18.0739 3.24496 19.2094C4.37608 20.3448 5.95033 20.3843 9.09883 20.4634C11.0393 20.5122 12.9607 20.5122 14.9012 20.4634C18.0497 20.3843 19.6239 20.3448 20.7551 19.2094C21.8862 18.0739 21.9189 16.5412 21.9842 13.4756C22.0053 12.4899 22.0053 11.5101 21.9842 10.5244C21.9189 7.45886 21.8862 5.92609 20.7551 4.79066C19.6239 3.65523 18.0497 3.61568 14.9012 3.53657C12.9607 3.48781 11.0393 3.48781 9.09882 3.53656C5.95033 3.61566 4.37608 3.65521 3.24495 4.79065C2.11382 5.92608 2.08114 7.45885 2.01576 10.5244C1.99474 11.5101 1.99475 12.4899 2.01577 13.4756Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Qo=[[`path`,{d:`M8.5 14.5H15.5M8.5 9.5H12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M14.1706 20.8905C18.3536 20.6125 21.6856 17.2332 21.9598 12.9909C22.0134 12.1607 22.0134 11.3009 21.9598 10.4707C21.6856 6.22838 18.3536 2.84913 14.1706 2.57107C12.7435 2.47621 11.2536 2.47641 9.8294 2.57107C5.64639 2.84913 2.31441 6.22838 2.04024 10.4707C1.98659 11.3009 1.98659 12.1607 2.04024 12.9909C2.1401 14.536 2.82343 15.9666 3.62791 17.1746C4.09501 18.0203 3.78674 19.0758 3.30021 19.9978C2.94941 20.6626 2.77401 20.995 2.91484 21.2351C3.05568 21.4752 3.37026 21.4829 3.99943 21.4982C5.24367 21.5285 6.08268 21.1757 6.74868 20.6846C7.1264 20.4061 7.31527 20.2668 7.44544 20.2508C7.5756 20.2348 7.83177 20.3403 8.34401 20.5513C8.8044 20.7409 9.33896 20.8579 9.8294 20.8905C11.2536 20.9852 12.7435 20.9854 14.1706 20.8905Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],$o=[[`path`,{d:`M20 12L4 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],es=[[`path`,{d:`M21.5 14.0784C20.3003 14.7189 18.9301 15.0821 17.4751 15.0821C12.7491 15.0821 8.91792 11.2509 8.91792 6.52485C8.91792 5.06986 9.28105 3.69968 9.92163 2.5C5.66765 3.49698 2.5 7.31513 2.5 11.8731C2.5 17.1899 6.8101 21.5 12.1269 21.5C16.6849 21.5 20.503 18.3324 21.5 14.0784Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],ts=[[`path`,{d:`M6.00449 12.5V12M18.0045 12.5V12M12.0045 12.5V12M7.00449 12.5C7.00449 11.9477 6.55677 11.5 6.00449 11.5C5.4522 11.5 5.00449 11.9477 5.00449 12.5C5.00449 13.0523 5.4522 13.5 6.00449 13.5C6.55677 13.5 7.00449 13.0523 7.00449 12.5ZM19.0045 12.5C19.0045 11.9477 18.5568 11.5 18.0045 11.5C17.4522 11.5 17.0045 11.9477 17.0045 12.5C17.0045 13.0523 17.4522 13.5 18.0045 13.5C18.5568 13.5 19.0045 13.0523 19.0045 12.5ZM13.0045 12.5C13.0045 11.9477 12.5568 11.5 12.0045 11.5C11.4522 11.5 11.0045 11.9477 11.0045 12.5C11.0045 13.0523 11.4522 13.5 12.0045 13.5C12.5568 13.5 13.0045 13.0523 13.0045 12.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],ns=[[`path`,{d:`M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C12.8417 22 14 22.1163 14 21C14 20.391 13.6832 19.9212 13.3686 19.4544C12.9082 18.7715 12.4523 18.0953 13 17C13.6667 15.6667 14.7778 15.6667 16.4815 15.6667C17.3334 15.6667 18.3334 15.6667 19.5 15.5C21.601 15.1999 22 13.9084 22 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`circle`,{cx:`9.5`,cy:`8.5`,r:`1.5`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}],[`circle`,{cx:`16.5`,cy:`9.5`,r:`1.5`,stroke:`currentColor`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M7.125 15H7M7.25 15C7.25 15.1381 7.13807 15.25 7 15.25C6.86193 15.25 6.75 15.1381 6.75 15C6.75 14.8619 6.86193 14.75 7 14.75C7.13807 14.75 7.25 14.8619 7.25 15Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],rs=[[`path`,{d:`M10 4C10 2.89543 10.8954 2 12 2H13C14.1046 2 15 2.89543 15 4V6.55337C15 7.86603 15.8534 9.02626 17.1065 9.41722L17.8935 9.66278C19.1466 10.0537 20 11.214 20 12.5266V14C20 14.5523 19.5523 15 19 15H6C5.44772 15 5 14.5523 5 14V12.5266C5 11.214 5.85339 10.0537 7.10648 9.66278L7.89352 9.41722C9.14661 9.02626 10 7.86603 10 6.55337V4Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M6.00217 15C6.15797 16.3082 5.4957 19.5132 4 21.8679C4 21.8679 14.2924 23.0594 15.6851 17.9434V19.8712C15.6851 20.8125 15.6851 21.2831 15.9783 21.5755C16.5421 22.1377 19.1891 22.1531 19.7538 21.5521C20.0504 21.2363 20.0207 20.7819 19.9611 19.8731C19.8629 18.3746 19.5932 16.4558 18.8523 15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],is=[[`path`,{d:`M21 11C21 7.22876 21 5.34315 19.8284 4.17157C18.6569 3 16.7712 3 13 3H11C7.22876 3 5.34315 3 4.17157 4.17157C3 5.34315 3 7.22876 3 11V13C3 16.7712 3 18.6569 4.17157 19.8284C5.34315 21 7.22876 21 11 21H13C16.7712 21 18.6569 21 19.8284 19.8284C21 18.6569 21 16.7712 21 13V11Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9 3V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M14 9L15.1082 9.87868C16.3694 10.8787 17 11.3787 17 12C17 12.6213 16.3694 13.1213 15.1082 14.1213L14 15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],as=[[`path`,{d:`M13 3H11C7.22876 3 5.34315 3 4.17157 4.17157C3 5.34315 3 7.22876 3 11V13C3 16.7712 3 18.6569 4.17157 19.8284C5.34315 21 7.22876 21 11 21H13C16.7712 21 18.6569 21 19.8284 19.8284C21 18.6569 21 16.7712 21 13V11C21 7.22876 21 5.34315 19.8284 4.17157C18.6569 3 16.7712 3 13 3Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9 3V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],os=[[`path`,{d:`M3 11C3 7.22876 3 5.34315 4.17157 4.17157C5.34315 3 7.22876 3 11 3H13C16.7712 3 18.6569 3 19.8284 4.17157C21 5.34315 21 7.22876 21 11V13C21 16.7712 21 18.6569 19.8284 19.8284C18.6569 21 16.7712 21 13 21H11C7.22876 21 5.34315 21 4.17157 19.8284C3 18.6569 3 16.7712 3 13V11Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M15 3V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M8 9L9.10819 9.87868C10.3694 10.8787 11 11.3787 11 12C11 12.6213 10.3694 13.1213 9.10819 14.1213L8 15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],ss=[[`path`,{d:`M13 3H11C7.22876 3 5.34315 3 4.17157 4.17157C3 5.34315 3 7.22876 3 11V13C3 16.7712 3 18.6569 4.17157 19.8284C5.34315 21 7.22876 21 11 21H13C16.7712 21 18.6569 21 19.8284 19.8284C21 18.6569 21 16.7712 21 13V11C21 7.22876 21 5.34315 19.8284 4.17157C18.6569 3 16.7712 3 13 3Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M15 3V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],cs=[[`path`,{d:`M15 3V21M15 3H10M15 3H21M10 12H7.5C5.01472 12 3 9.98528 3 7.5C3 5.01472 5.01472 3 7.5 3H10M10 12V3M10 12V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],ls=[[`path`,{d:`M12 16V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8 5.2918C8 5.02079 8 4.88529 8.01312 4.77132C8.1194 3.84789 8.84789 3.1194 9.77133 3.01312C9.88529 3 10.0208 3 10.2918 3H13.7082C13.9792 3 14.1147 3 14.2287 3.01312C15.1521 3.1194 15.8806 3.84789 15.9869 4.77132C16 4.88529 16 5.02079 16 5.2918C16 5.37885 16 5.42237 15.9967 5.46264C15.9708 5.78281 15.7927 6.07104 15.5179 6.2374C15.4834 6.25832 15.4444 6.27779 15.3666 6.31672L15.1055 6.44726C14.7021 6.64897 14.5003 6.74983 14.3681 6.90564C14.26 7.03286 14.1856 7.18509 14.1515 7.34846C14.1097 7.54854 14.1539 7.76968 14.2424 8.21197L15 12H15.3333C15.9533 12 16.2633 12 16.5176 12.0681C17.2078 12.2531 17.7469 12.7922 17.9319 13.4824C18 13.7367 18 14.0467 18 14.6667C18 14.9767 18 15.1317 17.9659 15.2588C17.8735 15.6039 17.6039 15.8735 17.2588 15.9659C17.1317 16 16.9767 16 16.6667 16H7.33333C7.02334 16 6.86835 16 6.74118 15.9659C6.39609 15.8735 6.12654 15.6039 6.03407 15.2588C6 15.1317 6 14.9767 6 14.6667C6 14.0467 6 13.7367 6.06815 13.4824C6.25308 12.7922 6.79218 12.2531 7.48236 12.0681C7.73669 12 8.04669 12 8.66667 12H9L9.75761 8.21197C9.84606 7.76968 9.89029 7.54854 9.84852 7.34846C9.81441 7.18509 9.73995 7.03286 9.63194 6.90564C9.49965 6.74983 9.29794 6.64897 8.89452 6.44726L8.63344 6.31672C8.55558 6.27779 8.51665 6.25832 8.48208 6.2374C8.20731 6.07104 8.02917 5.78281 8.00326 5.46264C8 5.42237 8 5.37885 8 5.2918Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],us=[[`path`,{d:`M12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C15.3313 3 18.2398 4.80989 19.796 7.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M20.9991 3V4.27816C20.9991 6.47004 20.9991 7.56599 20.2918 8.16512C19.5846 8.76425 18.5036 8.58408 16.3415 8.22373L14.9991 8`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],ds=[[`path`,{d:`M20.0092 2V5.13219C20.0092 5.42605 19.6418 5.55908 19.4537 5.33333C17.6226 3.2875 14.9617 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],fs=[[`path`,{d:`M20.0071 14.5662L19.3587 14.1731C18.7986 13.8508 18.3579 13.3564 18.102 12.7634L15.68 7.15102C15.5927 6.94865 15.4729 6.77988 15.328 6.64097C14.6876 6.02689 13.5808 6.28697 13.0432 6.99226C12.0506 8.29448 13.3839 9.52751 13.1022 10.6133L5.35908 6.26089C3.55799 5.28913 2.0024 7.87074 3.79277 9.06333L8.37607 11.6124C7.4934 12.765 5.25512 18.3551 8.12341 20.0599C8.28646 20.1568 8.4672 20.2213 8.64852 20.2773C8.76516 20.3134 8.88186 20.3496 8.99761 20.3857C9.8979 20.6667 11.6003 21.02 12.7668 20.9182C13.9811 20.8123 14.7421 21.4597 15.68 21.9995`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.36184 4.96447C9.75873 5.36011 11.4854 5.24597 12.1223 5.16653M9.36184 4.96447C8.96494 4.56883 8.95358 2.63679 9.03328 2.0019M9.36184 4.96447C10.3829 3.19624 14.4425 0.375691 18.4708 3.19624C20.4175 4.55924 20.6922 5.4182 21 5.99362`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],ps=[[`path`,{d:`M17 17L21 21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11C3 15.4183 6.58172 19 11 19C15.4183 19 19 15.4183 19 11Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],ms=[[`path`,{d:`M8 17C8 17 10.946 21 12 21C13.0541 21 16 17 16 17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8 6.99997C8 6.99997 10.946 3.00001 12 3C13.0541 2.99999 16 7 16 7`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M3 12H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],hs=[[`path`,{d:`M3.99963 5.00055L9.99963 5.00031`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12.9996 5.00031L19.9996 5.00031`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M15.9996 9.00031L15.9996 15.0003`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M9.99963 2.00031L9.99963 8.00031`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M11.9996 16.0003L11.9996 22.0003`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M15.9996 12.0001L19.9996 12.0003`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`5`}],[`path`,{d:`M3.99963 12.0005L12.9996 12.0003`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`6`}],[`path`,{d:`M11.9996 19.0003L19.9996 19.0003`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`7`}],[`path`,{d:`M3.99963 19.0005L8.99963 19.0003`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`8`}]],gs=[[`path`,{d:`M13.5 2H10.5C8.14298 2 6.96447 2 6.23223 2.73223C5.5 3.46447 5.5 4.64298 5.5 7V17C5.5 19.357 5.5 20.5355 6.23223 21.2678C6.96447 22 8.14298 22 10.5 22H13.5C15.857 22 17.0355 22 17.7678 21.2678C18.5 20.5355 18.5 19.357 18.5 17V7C18.5 4.64298 18.5 3.46447 17.7678 2.73223C17.0355 2 15.857 2 13.5 2Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12.125 19H12M12.25 19C12.25 19.1381 12.1381 19.25 12 19.25C11.8619 19.25 11.75 19.1381 11.75 19C11.75 18.8619 11.8619 18.75 12 18.75C12.1381 18.75 12.25 18.8619 12.25 19Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],_s=[[`path`,{d:`M2.5 12L21.5002 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],vs=[[`path`,{d:`M17 8L18.8398 9.85008C19.6133 10.6279 20 11.0168 20 11.5C20 11.9832 19.6133 12.3721 18.8398 13.1499L17 15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7 8L5.16019 9.85008C4.38673 10.6279 4 11.0168 4 11.5C4 11.9832 4.38673 12.3721 5.16019 13.1499L7 15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M14.5 4L9.5 20`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],ys=[[`path`,{d:`M15 2L15.5387 4.39157C15.9957 6.42015 17.5798 8.00431 19.6084 8.46127L22 9L19.6084 9.53873C17.5798 9.99569 15.9957 11.5798 15.5387 13.6084L15 16L14.4613 13.6084C14.0043 11.5798 12.4202 9.99569 10.3916 9.53873L8 9L10.3916 8.46127C12.4201 8.00431 14.0043 6.42015 14.4613 4.39158L15 2Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7 12L7.38481 13.7083C7.71121 15.1572 8.84275 16.2888 10.2917 16.6152L12 17L10.2917 17.3848C8.84275 17.7112 7.71121 18.8427 7.38481 20.2917L7 22L6.61519 20.2917C6.28879 18.8427 5.15725 17.7112 3.70827 17.3848L2 17L3.70827 16.6152C5.15725 16.2888 6.28879 15.1573 6.61519 13.7083L7 12Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],bs=[[`path`,{d:`M17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7C14.7614 7 17 9.23858 17 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 2V3.5M12 20.5V22M19.0708 19.0713L18.0101 18.0106M5.98926 5.98926L4.9286 4.9286M22 12H20.5M3.5 12H2M19.0713 4.92871L18.0106 5.98937M5.98975 18.0107L4.92909 19.0714`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}]],xs=[[`path`,{d:`M3 3H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8 9H16`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M3 15H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M8 21H16`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],Ss=[[`path`,{d:`M3 3H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M3 9H11`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M3 15H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M3 21H11`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],Cs=[[`path`,{d:`M3 3H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M13 9H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M3 15H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M13 21H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],ws=[[`path`,{d:`M5 14L8.5 17.5L19 6.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Ts=[[`path`,{d:`M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C8.66873 3 5.76018 4.80989 4.20404 7.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M3 3V4.27816C3 6.47004 3 7.56599 3.70725 8.16512C4.4145 8.76425 5.49553 8.58408 7.6576 8.22373L9 8`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Es=[[`path`,{d:`M21.544 11.045C21.848 11.4713 22 11.6845 22 12C22 12.3155 21.848 12.5287 21.544 12.955C20.1779 14.8706 16.6892 19 12 19C7.31078 19 3.8221 14.8706 2.45604 12.955C2.15201 12.5287 2 12.3155 2 12C2 11.6845 2.15201 11.4713 2.45604 11.045C3.8221 9.12944 7.31078 5 12 5C16.6892 5 20.1779 9.12944 21.544 11.045Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15C13.6569 15 15 13.6569 15 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}]],Ds={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`},Os=(0,G.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n,absoluteStrokeWidth:r=!1,className:i=``,altIcon:a,showAlt:o=!1,icon:s,primaryColor:c,secondaryColor:l,disableSecondaryOpacity:u=!1,...d},f)=>{let p=n===void 0?void 0:r?Number(n)*24/Number(t):n,m=p===void 0?{}:{strokeWidth:p,stroke:`currentColor`},h={ref:f,...Ds,width:t,height:t,color:c||e,className:i,...m,...d},g=[...o&&a?a:s].sort(([,e],[,t])=>{let n=e.opacity!==void 0;return t.opacity===void 0?n?-1:0:1}).map(([t,n])=>{let r=n.opacity!==void 0,i=r&&!u?n.opacity:void 0,a=l?{...n.stroke===void 0?{fill:r?l:c||e}:{stroke:r?l:c||e}}:{};return(0,G.createElement)(t,{...n,...m,...a,opacity:i,key:n.key})});return(0,G.createElement)(`svg`,h,g)});Os.displayName=`HugeiconsIcon`;var ks=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},As=(e=>e?ks(e):ks),js=e=>e;function Ms(e,t=js){let n=G.useSyncExternalStore(e.subscribe,G.useCallback(()=>t(e.getState()),[e,t]),G.useCallback(()=>t(e.getInitialState()),[e,t]));return G.useDebugValue(n),n}var Ns=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Ps=(e,t)=>typeof e==`object`&&e||typeof e==`function`?t in e:!1,Fs=[`money`,`number`,`date`,`time`,`plural`,`list`],Is=`__samva_source_location`,Ls=e=>{if(e?.fileName!==void 0&&e.lineNumber!==void 0&&e.columnNumber!==void 0)return Object.freeze({fileName:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber})},Rs={Text:e=>({type:`Text`,...e}),Element:e=>({type:`Element`,...e}),Fragment:e=>({type:`Fragment`,...e}),Raw:e=>({type:`Raw`,...e})},zs=new Set([`Text`,`Element`,`Fragment`,`Raw`]),Bs=e=>Ps(e,`type`)&&typeof e.type==`string`&&zs.has(e.type),Vs=Symbol.for(`@samva/markup/email/Fragment`),Hs=[],Us=()=>[...Hs].reverse(),Ws=(e,t)=>{if(t.length===0||e.type!==`Element`&&e.type!==`Fragment`)return e;let n=Us();return{...e,diagnostics:[...e.diagnostics??[],...t.map(e=>({...e,origins:n}))]}},Gs=e=>e.type!==`Element`&&e.type!==`Fragment`?[]:[...e.diagnostics??[],...e.children.flatMap(Gs)],Ks=e=>{if(e==null||typeof e==`boolean`)return[];if(typeof e==`string`)return[Rs.Text({value:e})];if(typeof e==`number`&&Number.isFinite(e))return[Rs.Text({value:String(e)})];if(Array.isArray(e))return e.flatMap(Ks);if(Bs(e))return[e];throw TypeError(`Email children must be synchronous text, finite numbers, elements, or arrays`)},qs=(e,t=``)=>Rs.Raw({html:e,text:t,origins:Us()}),Js=(e,t)=>{let{children:n,[Is]:r,...i}=t??{},a=Ls(r);if(e===Vs)return Rs.Fragment({children:Ks(n)});if(typeof e==`string`)return Rs.Element({tag:e,props:i,children:Ks(n),origins:a===void 0?Us():[a,...Us()],authored:a!==void 0});a!==void 0&&Hs.push(a);try{return Rs.Fragment({children:Ks(e({...i,children:n}))})}finally{a!==void 0&&Hs.pop()}},Ys=e=>e instanceof Error?{name:e.name,message:e.message,stack:e.stack}:e,Xs=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:Ys(this.cause),stack:this.stack}}*[Symbol.iterator](){return yield*tc(this),Zs(`Unreachable: Err yielded in Panic but generator continued`,this)}},Zs=(e,t)=>{throw new Xs({message:e,cause:t})},Qs=(e,t)=>{try{return e()}catch(e){throw Zs(t,e)}},$s=async(e,t)=>{try{return await e()}catch(e){throw Zs(t,e)}},ec=class e{status=`error`;constructor(e){this.error=e}isOk(){return!1}isErr(){return!0}map(e){return this}mapError(t){return Qs(()=>new e(t(this.error)),`mapError callback threw`)}tryRecover(e){return Qs(()=>e(this.error),`tryRecover callback threw`)}tryRecoverAsync(e){return $s(()=>e(this.error),`tryRecoverAsync callback threw`)}andThen(e){return this}andThenAsync(e){return Promise.resolve(this)}match(e){return Qs(()=>e.err(this.error),`match err handler threw`)}unwrap(e){return Zs(e??`Unwrap called on Err: ${String(this.error)}`,this.error)}unwrapOr(e){return e}tap(e){return this}tapError(e){return Qs(()=>(e(this.error),this),`tapError callback threw`)}tapAsync(e){return Promise.resolve(this)}tapErrorAsync(e){return $s(async()=>(await e(this.error),this),`tapErrorAsync callback threw`)}tapBoth(e){return Qs(()=>(e.err(this.error),this),`tapBoth err callback threw`)}tapBothAsync(e){return $s(async()=>(await e.err(this.error),this),`tapBothAsync err callback threw`)}*[Symbol.iterator](){return yield this,Zs(`Unreachable: Err yielded in Result.gen but generator continued`,this.error)}},tc=e=>new ec(e),nc=Symbol(`samva.unsubscribe-link`),rc=Symbol(`samva.brand-footer-marker`),ic={specifier:`samva:brand`,footerAttribute:`data-samva-footer`,unsubscribeRowAttribute:`data-samva-unsubscribe`,unsubscribeUrlPlaceholder:`%samva:unsubscribe-url%`,noTrackAttribute:`data-samva-no-track`},ac=`[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?`,oc=e=>e.replace(/[.*+?^${}()|[\]\\/]/g,`\\$&`),sc=(e,t={})=>{let n=t.brandPlugin??ic,r=RegExp(`^${oc(n.specifier)}(?:\\/(${ac}))?$`).exec(e);return r===null?void 0:{slug:r[1]}},cc=e=>new Set([e.footerAttribute,e.unsubscribeRowAttribute,e.noTrackAttribute]),lc={id:{type:`string`},title:{type:`string`},lang:{type:`string`},dir:{type:`string`,values:[`ltr`,`rtl`,`auto`]},role:{type:`string`}},uc={type:`string`,values:[`left`,`center`,`right`]},dc={type:`string`,values:[`top`,`middle`,`bottom`]},fc={align:uc},pc={align:uc,valign:dc,width:{type:`measure`},height:{type:`measure`},bgcolor:{type:`string`},colspan:{type:`number`},rowspan:{type:`number`}},mc=e=>({content:`flow`,layout:`block`,attributes:e}),hc=()=>({content:`flow`,layout:`inline`,attributes:{}}),gc={html:{content:`flow`,layout:`document`,attributes:{xmlns:{type:`string`},"xmlns:o":{type:`string`},"xmlns:v":{type:`string`},"xmlns:w":{type:`string`}},childElements:[`head`,`body`]},head:{content:`flow`,layout:`metadata`,attributes:{},childElements:[`title`,`meta`,`style`]},title:{content:`text`,layout:`metadata`,attributes:{}},style:{content:`raw`,layout:`metadata`,attributes:{type:{type:`string`}}},meta:{content:`void`,layout:`metadata`,attributes:{name:{type:`string`},content:{type:`string`},charset:{type:`string`},"http-equiv":{type:`string`}}},body:{content:`flow`,layout:`block`,attributes:{bgcolor:{type:`string`}}},div:mc(fc),section:mc(fc),article:mc(fc),header:mc(fc),footer:mc(fc),main:mc(fc),center:mc({}),p:mc(fc),blockquote:mc(fc),pre:{content:`flow`,layout:`preformatted`,attributes:{}},h1:mc(fc),h2:mc(fc),h3:mc(fc),h4:mc(fc),h5:mc(fc),h6:mc(fc),span:hc(),strong:hc(),b:hc(),em:hc(),i:hc(),u:hc(),s:hc(),small:hc(),code:hc(),a:{content:`flow`,layout:`link`,attributes:{href:{type:`url`,required:!0},target:{type:`string`},rel:{type:`string`},name:{type:`string`}}},img:{content:`void`,layout:`image`,attributes:{src:{type:`url`,required:!0},alt:{type:`string`,required:!0},width:{type:`measure`},height:{type:`measure`},border:{type:`measure`},align:uc}},table:{content:`flow`,layout:`table`,attributes:{width:{type:`measure`},height:{type:`measure`},border:{type:`measure`},cellpadding:{type:`measure`},cellspacing:{type:`measure`},align:uc,bgcolor:{type:`string`}},childElements:[`caption`,`colgroup`,`thead`,`tbody`,`tfoot`,`tr`]},caption:{content:`flow`,layout:`block`,attributes:fc},colgroup:{content:`flow`,layout:`table-section`,attributes:{span:{type:`number`},width:{type:`measure`}},childElements:[`col`]},col:{content:`void`,layout:`table-section`,attributes:{span:{type:`number`},width:{type:`measure`}}},thead:{content:`flow`,layout:`table-section`,attributes:{align:uc,valign:dc,bgcolor:{type:`string`}},childElements:[`tr`]},tbody:{content:`flow`,layout:`table-section`,attributes:{align:uc,valign:dc,bgcolor:{type:`string`}},childElements:[`tr`]},tfoot:{content:`flow`,layout:`table-section`,attributes:{align:uc,valign:dc,bgcolor:{type:`string`}},childElements:[`tr`]},tr:{content:`flow`,layout:`row`,attributes:{align:uc,valign:dc,bgcolor:{type:`string`},height:{type:`measure`}},childElements:[`td`,`th`]},td:{content:`flow`,layout:`cell`,attributes:pc},th:{content:`flow`,layout:`cell`,attributes:pc},ul:{content:`flow`,layout:`list`,attributes:{},childElements:[`li`]},ol:{content:`flow`,layout:`list`,attributes:{start:{type:`number`},type:{type:`string`}},childElements:[`li`]},li:{content:`flow`,layout:`list-item`,attributes:{}},br:{content:`void`,layout:`break`,attributes:{}},hr:{content:`void`,layout:`rule`,attributes:{width:{type:`measure`},size:{type:`number`},align:uc}}},_c=e=>Object.hasOwn(gc,e)?gc[e]:void 0,vc=e=>e===null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`,yc=e=>typeof e!=`object`||!e||!(`type`in e||`el`in e||`each`in e||`raw`in e||`preheader`in e||`if`in e&&Array.isArray(e.then)),bc=(e,t)=>{let n=0,r=e=>e.map(e=>yc(e)?e:`el`in e?{...t(e,n++),...e.children===void 0?{}:{children:r(e.children)}}:`raw`in e?t(e,n++):`each`in e?{...e,children:r(e.children)}:`if`in e?{...e,then:r(e.then),...e.else===void 0?{}:{else:r(e.else)}}:e);return r(e)},xc=(e,t)=>{let n=[];bc([e],e=>(n.push(e),e));let r={};return bc([t],(e,t)=>{let i=n[t];if(typeof e!=`object`||!e||typeof i!=`object`||!i)return e;if(`el`in e&&`el`in i){let n=JSON.stringify(e.attrs)===JSON.stringify(i.attrs)?void 0:e.attrs,a=JSON.stringify(e.style)===JSON.stringify(i.style)?void 0:e.style??``;(n!==void 0||a!==void 0)&&(r[t]={...n===void 0?{}:{attrs:n},...a===void 0?{}:{style:a}})}else`raw`in e&&`raw`in i&&JSON.stringify(e.raw)!==JSON.stringify(i.raw)&&(r[t]={raw:e.raw});return e}),r},Sc={Email:{kind:`same`,note:`Recipients get the full message with the theme's colors and font.`},Section:{kind:`same`,note:`Recipients see the section and everything in it.`},Columns:{kind:`same`,note:`Recipients see every cell of every row.`},Column:{kind:`same`,note:`Recipients see the cell and everything in it.`},Button:{kind:`same`,note:`Recipients see the button's label and can follow its link.`},Spacer:{kind:`same`,note:`Recipients see the space between blocks.`},Divider:{kind:`same`,note:`Recipients see the horizontal rule.`},Image:{kind:`same`,note:`Recipients get the image and its alternative text.`},Link:{kind:`same`,note:`Recipients can follow the link.`},BrandLogo:{kind:`same`,note:`Recipients get the brand logo, with the dark version where their client supports it.`},BrandFooter:{kind:`same`,note:`Recipients see the brand's contact details and links, including the unsubscribe link when supplied.`}},Cc=e=>[e.street1,e.street2,[e.city,e.region,e.postalCode].filter(e=>e.trim()!==``).join(`, `),e.country].filter(e=>e!==void 0&&e.trim()!==``),wc=(...e)=>{let t=e.filter(e=>e!==void 0&&e!==``).join(` `);return t===``?void 0:t},Tc=(e,t)=>Js(`p`,{style:{margin:t?`0`:`0 0 8px 0`},children:e}),Ec=e=>/(?:^|\s)text-(left|center|right)(?:\s|$)/.exec(e??``)?.[1]??`center`,Dc=(e,t=ic)=>{let n=e.assets??{},r=e.footer??{};return{BrandLogo:({width:e=120,alt:t,align:i,className:a})=>{if(n.logoUrl===void 0)return null;let o=t??r.companyName??``,s=(t,n,r)=>Js(`img`,{src:t,alt:r,width:e,border:0,...i===void 0?{}:{align:i},className:wc(n,a),style:{display:`block`,outline:`none`,border:`none`,height:`auto`}});return n.logoDarkUrl===void 0?s(n.logoUrl,void 0,o):Js(Vs,{children:[s(n.logoUrl,`dark:hidden!`,o),Js(`div`,{className:`hidden dark:block!`,style:{msoHide:`all`,maxHeight:0,overflow:`hidden`},children:s(n.logoDarkUrl,void 0,``)})]})},BrandFooter:({unsubscribeLabel:e=`Unsubscribe`,className:n})=>{let i=[],a=()=>i.length===0?[]:[` · `];r.companyName!==void 0&&r.companyName.trim()!==``&&i.push(Js(`span`,{className:`font-semibold`,children:r.companyName}));for(let e of r.socialLinks??[])i.push(...a(),Js(`a`,{href:e.url,className:`text-muted-foreground underline`,children:e.label}));i.push(Js(`span`,{[t.unsubscribeRowAttribute]:``,[rc]:!0,children:[...i.length===0?[]:[qs(` · `,`
|
|
15
|
+
`)],Oc(e,t)]}));let o=r.address===void 0?[]:Cc(r.address),s=Ec(n);return Js(`table`,{role:`presentation`,width:`100%`,border:0,cellpadding:0,cellspacing:0,[t.footerAttribute]:``,[rc]:!0,children:Js(`tbody`,{children:Js(`tr`,{children:Js(`td`,{align:s,className:wc(`text-xs text-muted-foreground`,s===`center`?`text-center`:void 0,n),style:{padding:`32px 16px`},children:[Tc(i,o.length===0),...o.length===0?[]:[Tc([o.join(`, `)],!0)]]})})})})}}},Oc=(e,t)=>Js(`a`,{href:t.unsubscribeUrlPlaceholder,className:`text-muted-foreground underline`,[nc]:!0,children:e}),kc={email:`sml-email`,button:`sml-button`,link:`sml-link`,divider:`sml-divider`,stack:`sml-stack`},Ac=`@layer components {
|
|
16
|
+
.${kc.email} {
|
|
17
|
+
color: var(--color-foreground);
|
|
18
|
+
font-family: var(--font-sans);
|
|
19
|
+
padding-left: 16px;
|
|
20
|
+
padding-right: 16px;
|
|
21
|
+
}
|
|
22
|
+
.${kc.button} {
|
|
23
|
+
background-color: var(--color-primary);
|
|
24
|
+
color: var(--color-primary-foreground);
|
|
25
|
+
font-family: var(--font-sans);
|
|
26
|
+
border-radius: var(--radius);
|
|
27
|
+
}
|
|
28
|
+
.${kc.link} {
|
|
29
|
+
color: var(--color-primary);
|
|
30
|
+
text-decoration: underline;
|
|
31
|
+
}
|
|
32
|
+
.${kc.divider} {
|
|
33
|
+
border-top: 1px solid var(--color-border);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
@media only screen and (max-width: 599px) {
|
|
37
|
+
.${kc.stack} {
|
|
38
|
+
display: block;
|
|
39
|
+
width: 100%;
|
|
40
|
+
max-width: 100%;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
`,jc=``,Mc=``,Nc=/(\d+)/g,Pc=class{entries=[];value(e){return typeof e==`string`?e:(this.entries.push({value:e}),`${jc}${this.entries.length-1}${Mc}`)}nodes(e){return this.entries.push({nodes:e}),`${jc}${this.entries.length-1}${Mc}`}parse(e){let t=[],n=0;for(let r of e.matchAll(Nc)){r.index>n&&t.push(e.slice(n,r.index));let i=this.entries[Number(r[1])];i!==void 0&&t.push(i),n=r.index+r[0].length}return n<e.length&&t.push(e.slice(n)),t}toValue(e){let t=this.parse(e);if(t.length===0)return``;let n=[];for(let e of t)if(typeof e==`string`)n.push(e);else if(`value`in e)n.push(e.value);else return;return n.length===1?n[0]:{concat:n}}},Fc=(e,t)=>vc(t)?t:e.value(t),Ic=e=>e===void 0?{}:{src:e},Lc=(e,t)=>{let n=[],r=!1,i,a=``,o=()=>{a!==``&&n.push(a),a=``};for(let s=0;s<t.length;s++){let c=t[s];if(c===jc){let i=t.indexOf(Mc,s),a=e.parse(t.slice(s,i+1))[0];if(i>s&&a!==void 0&&typeof a!=`string`&&`value`in a){o(),n.push(r?{attr:a.value}:{text:a.value}),s=i;continue}}!r&&c===`<`?r=!0:r&&i===void 0&&(c===`"`||c===`'`)?i=c:r&&i===c?i=void 0:r&&i===void 0&&c===`>`&&(r=!1),a+=c}return o(),n},Rc=(e,t)=>{if(!Ns(t))return;let n=[];for(let[r,i]of Object.entries(t))if(i!=null){if(typeof i==`number`)n.push([r,i]);else if(typeof i==`string`){let t=e.toValue(i);t!==void 0&&n.push([r,t])}}return n},zc=(e,t,n)=>{if(e===null)return[];switch(e.type){case`Text`:{let n=[];for(let r of t.parse(e.value))typeof r==`string`?n.push(r):`value`in r?n.push(r.value):n.push(...r.nodes);return n}case`Fragment`:return e.children.flatMap(e=>zc(e,t,n));case`Raw`:return[{raw:Lc(t,e.html),...e.text===``?{}:{text:e.text},...Ic(n)}];case`Element`:{let r={},i;for(let[n,a]of Object.entries(e.props)){if(n===`key`||a==null||a===!1)continue;if(n===`style`){i=Rc(t,a);continue}let e=n===`className`?`class`:n;typeof a==`string`?r[e]=t.toValue(a)??a:(typeof a==`number`||a===!0)&&(r[e]=a)}let a=e.props[rc]===!0;return[{el:e.tag,...Object.keys(r).length===0?{}:{attrs:r},...i===void 0||Array.isArray(i)&&i.length===0?{}:{style:i},...e.children.length===0?{}:{children:e.children.flatMap(e=>zc(e,t,n))},...a?{reserved:!0}:{},...Ic(n)}]}}},Bc=(e,t)=>typeof t==`object`&&t&&`object`in t?Object.fromEntries(Object.entries(t.object).map(([t,n])=>[t,Bc(e,n)])):Fc(e,t),Vc=(e,t)=>{let n=t.length===1?t[0]:void 0;return n!==void 0&&yc(n)&&n!==null&&typeof n!=`boolean`?typeof n==`string`?n:e.value(n):t.map(t=>yc(t)?typeof t==`string`?t:e.value(t):e.nodes([t]))},Hc=(e,t=ic,n)=>{let r={Email:bl,Section:Sl,Columns:Dl,Column:Ol,Button:Pl,Spacer:Fl,Divider:Il,Image:Ll,Link:Rl},i=e=>e.flatMap(e=>{if(yc(e))return[e];if(`type`in e){if(e.type!==`component`){let{type:t,tag:n,children:r,...a}=e;return[{el:n,...a,...r===void 0?{}:{children:i(r)}}]}let a=i(e.children??[]),o=new Pc,s={};for(let[t,n]of Object.entries(e.props??{}))(e.name!==`Columns`||t!==`each`&&t!==`per`&&(t!==`stack`||e.props?.each===void 0))&&(s[t]=Bc(o,n));e.name===`Column`&&(s.width===void 0&&e.emailColumn?.width!==void 0&&(s.width=Fc(o,e.emailColumn.width)),e.emailColumn?.stack===!0&&(s.className=typeof s.className==`string`&&s.className!==``?`${kc.stack} ${s.className}`:kc.stack)),a.length>0&&(s.children=Vc(o,a)),e.name===`Button`&&typeof s.children==`string`&&s.children!==``&&s.width===void 0&&s.height!==void 0&&o.toValue(s.children)!==s.children&&n?.({code:`button-dynamic-label`,severity:`error`,message:`A button with a dynamic label requires an explicit width for its Outlook fallback.`});let c=(e.name===`BrandLogo`||e.name===`BrandFooter`?Dc({...e.brand,css:``},t)[e.name]:r[e.name])(s);if(c!==null)for(let e of Gs(c))n?.(e);return[...zc(c,o,e.src)]}return`el`in e?[{...e,...e.children===void 0?{}:{children:i(e.children)}}]:`each`in e?[{...e,children:i(e.children)}]:`if`in e?[{...e,then:i(e.then),...e.else===void 0?{}:{else:i(e.else)}}]:[e]});return i(e)},Uc=new Set([`[`,`]`,`{`,`}`,`\\`,`~`,`|`,`€`,`^`,`\f`]),Wc=/^[@£$¥èéùìòÇ\nØø\rÅåΔ_ΦΓΛΩΠΨΣΘΞÆæßÉ !"#¤%&'()*+,\-./:;<=>?¡0-9ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüà]*$/,Gc=e=>{for(let t of e)if(!Uc.has(t)&&!Wc.test(t))return!0;return!1},Kc=e=>{if(Gc(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+=Uc.has(n)?2:1;let n=t<=160?1:Math.ceil(t/153);return{encoding:`gsm7`,characterCount:e.length,segmentCount:n}},qc=`data-samva-instance`,Jc=e=>`${e.fileName}:${e.lineNumber}:${e.columnNumber}`,Yc=e=>`${e.tag}\u0000${e.origins.map(Jc).join(`\0`)}`,Xc=e=>new Map(e.map(e=>[e.instancePath,e])),Zc=(e,t)=>{let n=Yc(t);return e.filter(e=>Yc(e)===n)},Qc=(e,t)=>{let n=t.origins[0],r=`${t.tag}\u0000${n===void 0?``:Jc(n)}`;return e.filter(e=>{let t=e.origins[0];return`${e.tag}\u0000${t===void 0?``:Jc(t)}`===r})},$c=e=>e.replace(/[&<>]/g,e=>({"&":`&`,"<":`<`,">":`>`})[e]??e),el=e=>e.replace(/[&<>"']/g,e=>({"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`})[e]??e),tl=/[\u0000-\u001f\u007f]/,nl=/^(https:\/\/|mailto:|tel:|cid:|#)/i,rl=/^(\.{1,2}\/|\/(?!\/))/,il=(e,t)=>!/^[\u0000-\u0020]/.test(e)&&!tl.test(e)&&!e.includes(`\\`)&&(nl.test(e)||t&&rl.test(e)),al=/^(--[a-zA-Z0-9-]+|[a-zA-Z][a-zA-Z0-9-]*)$/,ol=/[;{}<>\\]|expression\s*\(|@import|\/\*/i,sl=/url\(\s*(['"]?)([^'")]*)\1\s*\)/gi,cl=e=>e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),ll=new Set([`opacity`,`zIndex`,`fontWeight`,`lineHeight`,`order`,`flexGrow`,`flexShrink`,`columnCount`,`orphans`,`widows`,`zoom`,`fillOpacity`,`strokeOpacity`]),ul=(e,t)=>typeof t==`number`&&t!==0&&!ll.has(e)&&!e.startsWith(`--`)?`${t}px`:String(t),dl=(e,t,n,r,i=`error`)=>{e.diagnostics.push({code:t,severity:i,message:n,origins:r})},fl=(e,t,n)=>{let r=[];for(let[i,a]of Object.entries(t)){if(a==null)continue;if(!al.test(i)){dl(e,`unsupported-style-property`,`Style property ${JSON.stringify(i)} is not a CSS property name; write it in camelCase (backgroundColor) or as a custom property (--brand).`,n);continue}if(typeof a!=`string`&&typeof a!=`number`){dl(e,`invalid-style-value`,`Style ${i} must be a string or number, not ${typeof a}.`,n);continue}let t=ul(i,a);if(ol.test(t)||tl.test(t)){dl(e,`unsafe-style-value`,`Style ${i} contains CSS that could break out of the declaration; remove ${JSON.stringify(t)}.`,n);continue}let o;for(let n of t.matchAll(sl))il(n[2]??``,e.relativeUrls)||(o=n[2]??``);if(o!==void 0){dl(e,`unsafe-url`,`Style ${i} points at ${JSON.stringify(o)}; email URLs must use https:, mailto:, tel:, cid: or a fragment${e.relativeUrls?`, or a relative path`:``}.`,n);continue}r.push(`${cl(i)}:${t}`)}return r.join(`;`)},pl=(e,t,n,r,i,a)=>{if(i==null||i===!1)return;if(i===!0)return``;if(typeof i!=`string`&&typeof i!=`number`){dl(e,`invalid-attribute-value`,`<${t} ${n}> must be a string or number, not ${typeof i}.`,a);return}let o=String(i);if(tl.test(o)){dl(e,`invalid-attribute-value`,`<${t} ${n}> contains control characters.`,a);return}if(r.values!==void 0&&!r.values.includes(o)){dl(e,`invalid-attribute-value`,`<${t} ${n}> accepts ${r.values.join(`, `)}; received ${JSON.stringify(o)}.`,a);return}if(r.type===`number`&&!/^-?\d+$/.test(o)){dl(e,`invalid-attribute-value`,`<${t} ${n}> must be an integer.`,a);return}if(r.type===`measure`&&!/^\d+(\.\d+)?%?$/.test(o)){dl(e,`invalid-attribute-value`,`<${t} ${n}> must be a pixel count or a percentage.`,a);return}if(r.type===`url`&&!il(o,e.relativeUrls)){dl(e,`unsafe-url`,e.relativeUrls?`<${t} ${n}> must use https:, mailto:, tel:, cid:, a fragment, or a relative path; received ${JSON.stringify(o)}.`:`<${t} ${n}> must use https:, mailto:, tel:, cid: or a fragment; received ${JSON.stringify(o)}. A relative path resolves only in an export, never in a delivered message.`,a);return}return o},ml=e=>{let t=e.brandPlugin??ic;return{diagnostics:[],positions:[],written:0,relativeUrls:e.relativeUrls===!0,instancePaths:e.instancePaths===!0,brandPlugin:t,reservedAttributes:cc(t)}},hl=(e,t)=>{let n=ml({});return{css:fl(n,e,t),diagnostics:n.diagnostics}},gl=(e,t,n,r)=>{let i=ml({}),a=_c(e),o=lc,s=(()=>{if(/^(data|aria)-[a-z0-9-]+$/.test(t))return{type:`string`};if(Object.hasOwn(o,t))return o[t];if(a!==void 0&&Object.hasOwn(a.attributes,t))return a.attributes[t]})();return s===void 0?{text:void 0,diagnostics:i.diagnostics}:{text:pl(i,e,t,s,n,r),diagnostics:i.diagnostics}},_l=(e,t,n={})=>Js(`table`,{role:`presentation`,border:0,cellpadding:0,cellspacing:0,...e,children:Js(`tbody`,{children:Js(`tr`,{...n,children:t})})}),vl=(e,t)=>t===void 0||t.trim()===``?e:`${e} ${t}`,yl=(e,t,n,r,i={})=>{if(r!==void 0){if(typeof r==`number`&&Number.isFinite(r)&&(i.min===void 0||r>=i.min))return r;e.push({code:`invalid-number-prop`,severity:`error`,message:`<${t} ${n}> must be a finite number${i.min===void 0?``:` of at least ${i.min}`}.`})}},bl=({className:e,lang:t=`en`,dir:n=`ltr`,title:r,backgroundColor:i=`var(--color-background)`,gutter:a,style:o,children:s})=>{let c=[],l=yl(c,`Email`,`gutter`,a,{min:0}),u={...l===void 0?{}:{paddingLeft:`${l}px`,paddingRight:`${l}px`},...o};return Ws(Js(`html`,{lang:t,dir:n,xmlns:`http://www.w3.org/1999/xhtml`,"xmlns:o":`urn:schemas-microsoft-com:office:office`,children:[Js(`head`,{children:[Js(`meta`,{charset:`utf-8`}),Js(`meta`,{"http-equiv":`Content-Type`,content:`text/html; charset=UTF-8`}),Js(`meta`,{name:`viewport`,content:`width=device-width, initial-scale=1`}),Js(`meta`,{name:`x-apple-disable-message-reformatting`}),Js(`meta`,{name:`color-scheme`,content:`light dark`}),Js(`meta`,{name:`supported-color-schemes`,content:`light dark`}),r===void 0?null:Js(`title`,{children:r}),qs(`<!--[if mso]><xml><o:OfficeDocumentSettings><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]-->`)]}),Js(`body`,{style:{margin:0,padding:0,width:`100%`,backgroundColor:i},children:[_l({align:`center`,width:`100%`,bgcolor:i,style:{width:`100%`,backgroundColor:i}},Js(`td`,{className:vl(kc.email,e),...Object.keys(u).length===0?{}:{style:u},children:s}))]})]}),c)},xl=e=>{let t=typeof e==`number`||/^\d+(?:\.\d+)?(?:px)?$/.test(e)?e:void 0;if(t!==void 0)return{width:`100%`,maxWidth:typeof t==`number`?`${t}px`:`${Number.parseFloat(t)}px`}},Sl=({className:e,align:t=`center`,width:n=`100%`,bgcolor:r,style:i,tableStyle:a,children:o})=>{let s=xl(n),c=s===void 0?a:{...s,...a};return _l({align:t,width:n,...r===void 0?{}:{bgcolor:r},...c===void 0?{}:{style:c}},Js(`td`,{className:e,...i===void 0?{}:{style:i},children:o}))},Cl=e=>`${Math.floor(100/e)}%`,wl=(e,t,n)=>{if(e.type===`Fragment`)return Rs.Fragment({children:e.children.map(e=>wl(e,t,n))});if(e.type!==`Element`||e.tag!==`td`)return e;let r={},i=t===void 0||e.props.width!==void 0;for(let[n,a]of Object.entries(e.props))n===`style`&&!i&&(r.width=t),r[n]=a;return!i&&r.width===void 0&&(r.width=t),n&&(r.className=vl(kc.stack,typeof r.className==`string`?r.className:void 0)),Rs.Element({...e,props:r})},Tl=(e,t)=>Js(`td`,{...t?{className:kc.stack}:{},width:e,style:{width:`${e}px`,...t?{height:`${e}px`}:{},fontSize:`1px`,lineHeight:`1px`},children:``}),El=(e,t,n)=>{if(t===void 0||t===0)return e;let r=[];for(let i of e){if(i.type===`Text`&&i.value.trim()===``){r.push(i);continue}r.some(e=>e.type!==`Text`||e.value.trim()!==``)&&r.push(Tl(t,n)),r.push(i)}return r},Dl=({className:e,align:t=`center`,width:n=`100%`,style:r,each:i,per:a,stack:o=!0,gap:s,children:c})=>{let l={className:e,align:t,width:n,...r===void 0?{}:{style:r}},u=[],d=yl(u,`Columns`,`gap`,s,{min:0});if(i===void 0||typeof c!=`function`)return Ws(_l(l,El(Ks(c).map(e=>wl(e,void 0,o)),d,o),{style:{width:`100%`}}),u);a!==void 0&&(!Number.isInteger(a)||a<1)&&u.push({code:`invalid-columns-per`,severity:`error`,message:`<Columns per> must be a positive integer.`});let f=a!==void 0&&Number.isInteger(a)&&a>=1?a:void 0,p=[];if(f===void 0)p.push(i);else for(let e=0;e<i.length;e+=f)p.push(i.slice(e,e+f));let m=Cl(f??Math.max(i.length,1));return Ws(Js(Vs,{children:p.map(e=>_l(l,El(e.flatMap((e,t)=>Ks(c(e,t)).map(e=>wl(e,m,o))),d,o),{style:{width:`100%`}}))}),u)},Ol=({className:e,align:t,valign:n,width:r,style:i,children:a})=>Js(`td`,{className:e,...t===void 0?{}:{align:t},...n===void 0?{}:{valign:n},...r===void 0?{}:{width:r},...i===void 0?{}:{style:i},children:a}),kl=.6,Al=(e,t)=>{e.push({code:`invalid-button-number`,severity:`error`,message:`<Button ${t}> must be a finite number.`})},jl=(e,t,n,r)=>typeof n==`number`&&Number.isFinite(n)?n:(Al(e,t),r),Ml=(e,t,n)=>{if(n!==void 0){if(typeof n==`number`&&Number.isFinite(n))return n;Al(e,t)}},Nl=(e,t,n)=>{if(n!==void 0){if(typeof n==`number`&&Number.isFinite(n)&&n>0)return n;e.push({code:`invalid-button-number`,severity:`error`,message:`<Button ${t}> must be a positive finite number.`})}},Pl=({className:e,href:t,width:n,height:r,paddingX:i=16,backgroundColor:a,color:o,borderRadius:s,borderColor:c,borderWidth:l=0,fontSize:u=16,fontFamily:d,align:f=`left`,style:p,children:m})=>{let h=[],g=Ml(h,`width`,n),_=Nl(h,`height`,r),v=jl(h,`paddingX`,i,16),y=Ml(h,`borderRadius`,s),b=jl(h,`borderWidth`,l,0),x=jl(h,`fontSize`,u,16),S=typeof m==`string`?m:void 0,C=_!==void 0&&S!==void 0;C||h.push({code:`button-outlook-fallback`,severity:`warning`,message:`<Button> draws its classic Outlook shape from VML, which needs a height and a plain string label. Without both, classic Windows Outlook shows an unstyled link.`,clients:[`outlook-windows`]});let w=_===void 0?0:Math.round((y??0)/_*100),T=g??Math.ceil((S?.length??0)*x*kl)+2*v,E=a??`var(--color-primary)`,D=o??`var(--color-primary-foreground)`,O=d??`var(--font-sans)`;return Ws(_l({width:`100%`,style:{borderCollapse:`collapse`}},Js(`td`,{align:f,children:[C?qs(`<!--[if mso]><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="${el(t)}" style="height:${_}px;v-text-anchor:middle;width:${T}px;" arcsize="${w}%" ${c===void 0?`stroke="false"`:`strokecolor="${el(c)}" strokeweight="${b}px"`} fillcolor="${el(E)}"><w:anchorlock/><center style="color:${el(D)};font-family:${el(O)};font-size:${x}px;font-weight:bold;">${$c(S)}</center></v:roundrect><![endif]-->`):null,Js(`a`,{className:vl(kc.button,e),href:t,target:`_blank`,rel:`noopener noreferrer`,style:{...a===void 0?{}:{backgroundColor:a},...o===void 0?{}:{color:o},...y===void 0?{}:{borderRadius:`${y}px`},display:`inline-block`,...d===void 0?{}:{fontFamily:d},fontSize:`${x}px`,fontWeight:`bold`,lineHeight:_===void 0?`120%`:`${_-2*b}px`,textAlign:`center`,textDecoration:`none`,...g===void 0?{padding:`0 ${v}px`}:{width:`${g}px`,maxWidth:`100%`},...c===void 0?{}:{border:`${b}px solid ${c}`},...C?{msoHide:`all`}:{},...p},children:m})]})),h)},Fl=({height:e})=>_l({width:`100%`},Js(`td`,{height:e,style:{height:`${e}px`,lineHeight:`${e}px`,fontSize:`1px`},children:``})),Il=({className:e,color:t,thickness:n,style:r})=>_l({width:`100%`},Js(`td`,{className:vl(kc.divider,e),style:{...t===void 0&&n===void 0?{}:{borderTop:`${n??1}px solid ${t??`var(--color-border)`}`},fontSize:`1px`,lineHeight:`1px`,...r},children:``})),Ll=({className:e,src:t,alt:n,width:r,height:i,align:a,style:o})=>Js(`img`,{className:e,src:t,alt:n,border:0,...r===void 0?{}:{width:r},...i===void 0?{}:{height:i},...a===void 0?{}:{align:a},style:{display:`block`,outline:`none`,border:`none`,textDecoration:`none`,maxWidth:`100%`,...o}}),Rl=({className:e,href:t,target:n=`_blank`,rel:r=`noopener noreferrer`,style:i,children:a})=>Js(`a`,{className:vl(kc.link,e),href:t,target:n,rel:r,...i===void 0?{}:{style:i},children:a}),zl=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},Bl=(e,t)=>{let n=0,r=e.length-1;for(;n<r;){let i=n+r+1>>1;e[i]<=t?n=i:r=i-1}return{line:n+1,column:t-e[n]+1}};function Vl(e,t){let n=typeof e;if(n!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(!Vl(e[r],t[r]))return!1;return!0}if(n===`object`){if(!e||!t)return e===t;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Vl(e[r],t[r]))return!1;return!0}return e===t}function Hl(e){return encodeURI(Ul(e))}function Ul(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}var Wl={prefixItems:!0,items:!0,allOf:!0,anyOf:!0,oneOf:!0},Gl={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependentSchemas:!0},Kl={id:!0,$id:!0,$ref:!0,$schema:!0,$anchor:!0,$vocabulary:!0,$comment:!0,default:!0,enum:!0,const:!0,required:!0,type:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0},ql=typeof self<`u`&&self.location&&self.location.origin!==`null`?new URL(self.location.origin+self.location.pathname+location.search):new URL(`https://github.com/cfworker`);function Jl(e,t=Object.create(null),n=ql,r=``){if(e&&typeof e==`object`&&!Array.isArray(e)){let i=e.$id||e.id;if(i){let a=new URL(i,n.href);a.hash.length>1?t[a.href]=e:(a.hash=``,r===``?n=a:Jl(e,t,n))}}else if(e!==!0&&e!==!1)return t;let i=n.href+(r?`#`+r:``);if(t[i]!==void 0)throw Error(`Duplicate schema URI "${i}".`);if(t[i]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:i}),e.$ref&&e.__absolute_ref__===void 0){let t=new URL(e.$ref,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:t.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let t=new URL(e.$recursiveRef,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:t.href})}if(e.$anchor){let r=new URL(`#`+e.$anchor,n.href);t[r.href]=e}for(let i in e){if(Kl[i])continue;let a=`${r}/${Hl(i)}`,o=e[i];if(Array.isArray(o)){if(Wl[i]){let e=o.length;for(let r=0;r<e;r++)Jl(o[r],t,n,`${a}/${r}`)}}else if(Gl[i])for(let e in o)Jl(o[e],t,n,`${a}/${Hl(e)}`);else Jl(o,t,n,a)}return t}var Yl=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Xl=[0,31,28,31,30,31,30,31,31,30,31,30,31],Zl=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,Ql=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,$l=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,eu=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,tu=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,nu=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,ru=/^(?:\/(?:[^~/]|~0|~1)*)*$/,iu=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,au=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,ou=e=>{if(e[0]===`"`)return!1;let[t,n,...r]=e.split(`@`);return!t||!n||r.length!==0||t.length>64||n.length>253||t[0]===`.`||t.endsWith(`.`)||t.includes(`..`)||!/^[a-z0-9.-]+$/i.test(n)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:n.split(`.`).every(e=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e))},su=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,cu=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,lu=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function uu(e){return e.test.bind(e)}var du={date:pu,time:mu.bind(void 0,!1),"date-time":gu,duration:lu,uri:yu,"uri-reference":uu($l),"uri-template":uu(eu),url:uu(tu),email:ou,hostname:uu(Ql),ipv4:uu(su),ipv6:uu(cu),regex:xu,uuid:uu(nu),"json-pointer":uu(ru),"json-pointer-uri-fragment":uu(iu),"relative-json-pointer":uu(au)};function fu(e){return e%4==0&&(e%100!=0||e%400==0)}function pu(e){let t=e.match(Yl);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r==2&&fu(n)?29:Xl[r])}function mu(e,t){let n=t.match(Zl);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||o)}var hu=/t|\s/i;function gu(e){let t=e.split(hu);return t.length==2&&pu(t[0])&&mu(!0,t[1])}var _u=/\/|:/,vu=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function yu(e){return _u.test(e)&&vu.test(e)}var bu=/[^\\]\\Z/;function xu(e){if(bu.test(e))return!1;try{return new RegExp(e,`u`),!0}catch{return!1}}function Su(e){let t=0,n=e.length,r=0,i;for(;r<n;)t++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<n&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return t}function Cu(e,t,n=`2019-09`,r=Jl(t),i=!0,a=null,o=`#`,s=`#`,c=Object.create(null)){if(t===!0)return{valid:!0,errors:[]};if(t===!1)return{valid:!1,errors:[{instanceLocation:o,keyword:`false`,keywordLocation:o,error:`False boolean schema.`}]};let l=typeof e,u;switch(l){case`boolean`:case`number`:case`string`:u=l;break;case`object`:u=e===null?`null`:Array.isArray(e)?`array`:`object`;break;default:throw Error(`Instances of "${l}" type are not supported.`)}let{$ref:d,$recursiveRef:f,$recursiveAnchor:p,type:m,const:h,enum:g,required:_,not:v,anyOf:y,allOf:b,oneOf:x,if:S,then:C,else:w,format:T,properties:E,patternProperties:D,additionalProperties:O,unevaluatedProperties:k,minProperties:A,maxProperties:j,propertyNames:M,dependentRequired:N,dependentSchemas:P,dependencies:F,prefixItems:I,items:L,additionalItems:R,unevaluatedItems:z,contains:ee,minContains:B,maxContains:V,minItems:te,maxItems:H,uniqueItems:ne,minimum:re,maximum:ie,exclusiveMinimum:ae,exclusiveMaximum:oe,multipleOf:se,minLength:U,maxLength:ce,pattern:le,__absolute_ref__:ue,__absolute_recursive_ref__:de}=t,W=[];if(p===!0&&a===null&&(a=t),f===`#`){let l=a===null?r[de]:a,u=`${s}/$recursiveRef`,d=Cu(e,a===null?t:a,n,r,i,l,o,u,c);d.valid||W.push({instanceLocation:o,keyword:`$recursiveRef`,keywordLocation:u,error:`A subschema had errors.`},...d.errors)}if(d!==void 0){let t=r[ue||d];if(t===void 0){let e=`Unresolved $ref "${d}".`;throw ue&&ue!==d&&(e+=` Absolute URI "${ue}".`),e+=`\nKnown schemas:\n- ${Object.keys(r).join(`
|
|
44
|
+
- `)}`,Error(e)}let l=`${s}/$ref`,u=Cu(e,t,n,r,i,a,o,l,c);if(u.valid||W.push({instanceLocation:o,keyword:`$ref`,keywordLocation:l,error:`A subschema had errors.`},...u.errors),n===`4`||n===`7`)return{valid:W.length===0,errors:W}}if(Array.isArray(m)){let t=m.length,n=!1;for(let r=0;r<t;r++)if(u===m[r]||m[r]===`integer`&&u===`number`&&e%1==0&&e===e){n=!0;break}n||W.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m.join(`", "`)}".`})}else m===`integer`?(u!==`number`||e%1||e!==e)&&W.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m}".`}):m!==void 0&&u!==m&&W.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m}".`});if(h!==void 0&&(u===`object`||u===`array`?Vl(e,h)||W.push({instanceLocation:o,keyword:`const`,keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(h)}.`}):e!==h&&W.push({instanceLocation:o,keyword:`const`,keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(h)}.`})),g!==void 0&&(u===`object`||u===`array`?g.some(t=>Vl(e,t))||W.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`}):g.some(t=>e===t)||W.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`})),v!==void 0){let t=`${s}/not`;Cu(e,v,n,r,i,a,o,t).valid&&W.push({instanceLocation:o,keyword:`not`,keywordLocation:t,error:`Instance matched "not" schema.`})}let fe=[];if(y!==void 0){let t=`${s}/anyOf`,l=W.length,u=!1;for(let s=0;s<y.length;s++){let l=y[s],d=Object.create(c),f=Cu(e,l,n,r,i,p===!0?a:null,o,`${t}/${s}`,d);W.push(...f.errors),u||=f.valid,f.valid&&fe.push(d)}u?W.length=l:W.splice(l,0,{instanceLocation:o,keyword:`anyOf`,keywordLocation:t,error:`Instance does not match any subschemas.`})}if(b!==void 0){let t=`${s}/allOf`,l=W.length,u=!0;for(let s=0;s<b.length;s++){let l=b[s],d=Object.create(c),f=Cu(e,l,n,r,i,p===!0?a:null,o,`${t}/${s}`,d);W.push(...f.errors),u&&=f.valid,f.valid&&fe.push(d)}u?W.length=l:W.splice(l,0,{instanceLocation:o,keyword:`allOf`,keywordLocation:t,error:`Instance does not match every subschema.`})}if(x!==void 0){let t=`${s}/oneOf`,l=W.length,u=x.filter((s,l)=>{let u=Object.create(c),d=Cu(e,s,n,r,i,p===!0?a:null,o,`${t}/${l}`,u);return W.push(...d.errors),d.valid&&fe.push(u),d.valid}).length;u===1?W.length=l:W.splice(l,0,{instanceLocation:o,keyword:`oneOf`,keywordLocation:t,error:`Instance does not match exactly one subschema (${u} matches).`})}if((u===`object`||u===`array`)&&Object.assign(c,...fe),S!==void 0){let t=`${s}/if`;if(Cu(e,S,n,r,i,a,o,t,c).valid){if(C!==void 0){let l=Cu(e,C,n,r,i,a,o,`${s}/then`,c);l.valid||W.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "then" schema.`},...l.errors)}}else if(w!==void 0){let l=Cu(e,w,n,r,i,a,o,`${s}/else`,c);l.valid||W.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "else" schema.`},...l.errors)}}if(u===`object`){if(_!==void 0)for(let t of _)t in e||W.push({instanceLocation:o,keyword:`required`,keywordLocation:`${s}/required`,error:`Instance does not have required property "${t}".`});let t=Object.keys(e);if(A!==void 0&&t.length<A&&W.push({instanceLocation:o,keyword:`minProperties`,keywordLocation:`${s}/minProperties`,error:`Instance does not have at least ${A} properties.`}),j!==void 0&&t.length>j&&W.push({instanceLocation:o,keyword:`maxProperties`,keywordLocation:`${s}/maxProperties`,error:`Instance does not have at least ${j} properties.`}),M!==void 0){let t=`${s}/propertyNames`;for(let s in e){let e=`${o}/${Hl(s)}`,c=Cu(s,M,n,r,i,a,e,t);c.valid||W.push({instanceLocation:o,keyword:`propertyNames`,keywordLocation:t,error:`Property name "${s}" does not match schema.`},...c.errors)}}if(N!==void 0){let t=`${s}/dependantRequired`;for(let n in N)if(n in e){let r=N[n];for(let i of r)i in e||W.push({instanceLocation:o,keyword:`dependentRequired`,keywordLocation:t,error:`Instance has "${n}" but does not have "${i}".`})}}if(P!==void 0)for(let t in P){let l=`${s}/dependentSchemas`;if(t in e){let s=Cu(e,P[t],n,r,i,a,o,`${l}/${Hl(t)}`,c);s.valid||W.push({instanceLocation:o,keyword:`dependentSchemas`,keywordLocation:l,error:`Instance has "${t}" but does not match dependant schema.`},...s.errors)}}if(F!==void 0){let t=`${s}/dependencies`;for(let s in F)if(s in e){let c=F[s];if(Array.isArray(c))for(let n of c)n in e||W.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not have "${n}".`});else{let l=Cu(e,c,n,r,i,a,o,`${t}/${Hl(s)}`);l.valid||W.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not match dependant schema.`},...l.errors)}}}let l=Object.create(null),u=!1;if(E!==void 0){let t=`${s}/properties`;for(let s in E){if(!(s in e))continue;let d=`${o}/${Hl(s)}`,f=Cu(e[s],E[s],n,r,i,a,d,`${t}/${Hl(s)}`);if(f.valid)c[s]=l[s]=!0;else if(u=i,W.push({instanceLocation:o,keyword:`properties`,keywordLocation:t,error:`Property "${s}" does not match schema.`},...f.errors),u)break}}if(!u&&D!==void 0){let t=`${s}/patternProperties`;for(let s in D){let d=new RegExp(s,`u`),f=D[s];for(let p in e){if(!d.test(p))continue;let m=`${o}/${Hl(p)}`,h=Cu(e[p],f,n,r,i,a,m,`${t}/${Hl(s)}`);h.valid?c[p]=l[p]=!0:(u=i,W.push({instanceLocation:o,keyword:`patternProperties`,keywordLocation:t,error:`Property "${p}" matches pattern "${s}" but does not match associated schema.`},...h.errors))}}}if(!u&&O!==void 0){let t=`${s}/additionalProperties`;for(let s in e){if(l[s])continue;let d=`${o}/${Hl(s)}`,f=Cu(e[s],O,n,r,i,a,d,t);f.valid?c[s]=!0:(u=i,W.push({instanceLocation:o,keyword:`additionalProperties`,keywordLocation:t,error:`Property "${s}" does not match additional properties schema.`},...f.errors))}}else if(!u&&k!==void 0){let t=`${s}/unevaluatedProperties`;for(let s in e)if(!c[s]){let l=`${o}/${Hl(s)}`,u=Cu(e[s],k,n,r,i,a,l,t);u.valid?c[s]=!0:W.push({instanceLocation:o,keyword:`unevaluatedProperties`,keywordLocation:t,error:`Property "${s}" does not match unevaluated properties schema.`},...u.errors)}}}else if(u===`array`){H!==void 0&&e.length>H&&W.push({instanceLocation:o,keyword:`maxItems`,keywordLocation:`${s}/maxItems`,error:`Array has too many items (${e.length} > ${H}).`}),te!==void 0&&e.length<te&&W.push({instanceLocation:o,keyword:`minItems`,keywordLocation:`${s}/minItems`,error:`Array has too few items (${e.length} < ${te}).`});let t=e.length,l=0,u=!1;if(I!==void 0){let d=`${s}/prefixItems`,f=Math.min(I.length,t);for(;l<f;l++){let t=Cu(e[l],I[l],n,r,i,a,`${o}/${l}`,`${d}/${l}`);if(c[l]=!0,!t.valid&&(u=i,W.push({instanceLocation:o,keyword:`prefixItems`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}}if(L!==void 0){let d=`${s}/items`;if(Array.isArray(L)){let s=Math.min(L.length,t);for(;l<s;l++){let t=Cu(e[l],L[l],n,r,i,a,`${o}/${l}`,`${d}/${l}`);if(c[l]=!0,!t.valid&&(u=i,W.push({instanceLocation:o,keyword:`items`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}}else for(;l<t;l++){let t=Cu(e[l],L,n,r,i,a,`${o}/${l}`,d);if(c[l]=!0,!t.valid&&(u=i,W.push({instanceLocation:o,keyword:`items`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}if(!u&&R!==void 0){let d=`${s}/additionalItems`;for(;l<t;l++){let t=Cu(e[l],R,n,r,i,a,`${o}/${l}`,d);c[l]=!0,t.valid||(u=i,W.push({instanceLocation:o,keyword:`additionalItems`,keywordLocation:d,error:`Items did not match additional items schema.`},...t.errors))}}}if(ee!==void 0){if(t===0&&B===void 0)W.push({instanceLocation:o,keyword:`contains`,keywordLocation:`${s}/contains`,error:`Array is empty. It must contain at least one item matching the schema.`});else if(B!==void 0&&t<B)W.push({instanceLocation:o,keyword:`minContains`,keywordLocation:`${s}/minContains`,error:`Array has less items (${t}) than minContains (${B}).`});else{let l=`${s}/contains`,u=W.length,d=0;for(let s=0;s<t;s++){let t=Cu(e[s],ee,n,r,i,a,`${o}/${s}`,l);t.valid?(c[s]=!0,d++):W.push(...t.errors)}d>=(B||0)&&(W.length=u),B===void 0&&V===void 0&&d===0?W.splice(u,0,{instanceLocation:o,keyword:`contains`,keywordLocation:l,error:`Array does not contain item matching schema.`}):B!==void 0&&d<B?W.push({instanceLocation:o,keyword:`minContains`,keywordLocation:`${s}/minContains`,error:`Array must contain at least ${B} items matching schema. Only ${d} items were found.`}):V!==void 0&&d>V&&W.push({instanceLocation:o,keyword:`maxContains`,keywordLocation:`${s}/maxContains`,error:`Array may contain at most ${V} items matching schema. ${d} items were found.`})}}if(!u&&z!==void 0){let u=`${s}/unevaluatedItems`;for(;l<t;l++){if(c[l])continue;let t=Cu(e[l],z,n,r,i,a,`${o}/${l}`,u);c[l]=!0,t.valid||W.push({instanceLocation:o,keyword:`unevaluatedItems`,keywordLocation:u,error:`Items did not match unevaluated items schema.`},...t.errors)}}if(ne)for(let n=0;n<t;n++){let r=e[n],i=typeof r==`object`&&!!r;for(let a=0;a<t;a++){if(n===a)continue;let t=e[a];(r===t||i&&typeof t==`object`&&t&&Vl(r,t))&&(W.push({instanceLocation:o,keyword:`uniqueItems`,keywordLocation:`${s}/uniqueItems`,error:`Duplicate items at indexes ${n} and ${a}.`}),n=2**53-1,a=2**53-1)}}}else if(u===`number`){if(n===`4`?(re!==void 0&&(ae===!0&&e<=re||e<re)&&W.push({instanceLocation:o,keyword:`minimum`,keywordLocation:`${s}/minimum`,error:`${e} is less than ${ae?`or equal to `:``} ${re}.`}),ie!==void 0&&(oe===!0&&e>=ie||e>ie)&&W.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${oe?`or equal to `:``} ${ie}.`})):(re!==void 0&&e<re&&W.push({instanceLocation:o,keyword:`minimum`,keywordLocation:`${s}/minimum`,error:`${e} is less than ${re}.`}),ie!==void 0&&e>ie&&W.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${ie}.`}),ae!==void 0&&e<=ae&&W.push({instanceLocation:o,keyword:`exclusiveMinimum`,keywordLocation:`${s}/exclusiveMinimum`,error:`${e} is less than ${ae}.`}),oe!==void 0&&e>=oe&&W.push({instanceLocation:o,keyword:`exclusiveMaximum`,keywordLocation:`${s}/exclusiveMaximum`,error:`${e} is greater than or equal to ${oe}.`})),se!==void 0){let t=e%se;Math.abs(0-t)>=1.1920929e-7&&Math.abs(se-t)>=1.1920929e-7&&W.push({instanceLocation:o,keyword:`multipleOf`,keywordLocation:`${s}/multipleOf`,error:`${e} is not a multiple of ${se}.`})}}else if(u===`string`){let t=U===void 0&&ce===void 0?0:Su(e);U!==void 0&&t<U&&W.push({instanceLocation:o,keyword:`minLength`,keywordLocation:`${s}/minLength`,error:`String is too short (${t} < ${U}).`}),ce!==void 0&&t>ce&&W.push({instanceLocation:o,keyword:`maxLength`,keywordLocation:`${s}/maxLength`,error:`String is too long (${t} > ${ce}).`}),le!==void 0&&!new RegExp(le,`u`).test(e)&&W.push({instanceLocation:o,keyword:`pattern`,keywordLocation:`${s}/pattern`,error:`String does not match pattern.`}),T!==void 0&&du[T]&&!du[T](e)&&W.push({instanceLocation:o,keyword:`format`,keywordLocation:`${s}/format`,error:`String does not match format "${T}".`})}return{valid:W.length===0,errors:W}}var wu=class{schema;draft;shortCircuit;lookup;constructor(e,t=`2019-09`,n=!0){this.schema=e,this.draft=t,this.shortCircuit=n,this.lookup=Jl(e)}validate(e){return Cu(e,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(e,t){t&&(e={...e,$id:t}),Jl(e,this.lookup)}},Tu={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/applicator`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:`meta`,title:`Applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{prefixItems:{$ref:`#/$defs/schemaArray`},items:{$dynamicRef:`#meta`},contains:{$dynamicRef:`#meta`},additionalProperties:{$dynamicRef:`#meta`},properties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},patternProperties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},propertyNames:{format:`regex`},default:{}},dependentSchemas:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},propertyNames:{$dynamicRef:`#meta`},if:{$dynamicRef:`#meta`},then:{$dynamicRef:`#meta`},else:{$dynamicRef:`#meta`},allOf:{$ref:`#/$defs/schemaArray`},anyOf:{$ref:`#/$defs/schemaArray`},oneOf:{$ref:`#/$defs/schemaArray`},not:{$dynamicRef:`#meta`}},$defs:{schemaArray:{type:`array`,minItems:1,items:{$dynamicRef:`#meta`}}}},Eu={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/content`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:`meta`,title:`Content vocabulary meta-schema`,type:[`object`,`boolean`],properties:{contentEncoding:{type:`string`},contentMediaType:{type:`string`},contentSchema:{$dynamicRef:`#meta`}}},Du={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/core`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:`meta`,title:`Core vocabulary meta-schema`,type:[`object`,`boolean`],properties:{$id:{$ref:`#/$defs/uriReferenceString`,$comment:`Non-empty fragments not allowed.`,pattern:`^[^#]*#?$`},$schema:{$ref:`#/$defs/uriString`},$ref:{$ref:`#/$defs/uriReferenceString`},$anchor:{$ref:`#/$defs/anchorString`},$dynamicRef:{$ref:`#/$defs/uriReferenceString`},$dynamicAnchor:{$ref:`#/$defs/anchorString`},$vocabulary:{type:`object`,propertyNames:{$ref:`#/$defs/uriString`},additionalProperties:{type:`boolean`}},$comment:{type:`string`},$defs:{type:`object`,additionalProperties:{$dynamicRef:`#meta`}}},$defs:{anchorString:{type:`string`,pattern:`^[A-Za-z_][-A-Za-z0-9._]*$`},uriString:{type:`string`,format:`uri`},uriReferenceString:{type:`string`,format:`uri-reference`}}},Ou={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/format-annotation`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:`meta`,title:`Format vocabulary meta-schema for annotation results`,type:[`object`,`boolean`],properties:{format:{type:`string`}}},ku={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/meta-data`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:`meta`,title:`Meta-data vocabulary meta-schema`,type:[`object`,`boolean`],properties:{title:{type:`string`},description:{type:`string`},default:!0,deprecated:{type:`boolean`,default:!1},readOnly:{type:`boolean`,default:!1},writeOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0}}},Au={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/unevaluated`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:`meta`,title:`Unevaluated applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{unevaluatedItems:{$dynamicRef:`#meta`},unevaluatedProperties:{$dynamicRef:`#meta`}}},ju={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/validation`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:`meta`,title:`Validation vocabulary meta-schema`,type:[`object`,`boolean`],properties:{type:{anyOf:[{$ref:`#/$defs/simpleTypes`},{type:`array`,items:{$ref:`#/$defs/simpleTypes`},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/$defs/nonNegativeInteger`},minLength:{$ref:`#/$defs/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},maxItems:{$ref:`#/$defs/nonNegativeInteger`},minItems:{$ref:`#/$defs/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},maxContains:{$ref:`#/$defs/nonNegativeInteger`},minContains:{$ref:`#/$defs/nonNegativeInteger`,default:1},maxProperties:{$ref:`#/$defs/nonNegativeInteger`},minProperties:{$ref:`#/$defs/nonNegativeIntegerDefault0`},required:{$ref:`#/$defs/stringArray`},dependentRequired:{type:`object`,additionalProperties:{$ref:`#/$defs/stringArray`}}},$defs:{nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{$ref:`#/$defs/nonNegativeInteger`,default:0},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}}},Mu=new wu({$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/schema`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:`meta`,title:`Core and Validation specifications meta-schema`,allOf:[{$ref:`meta/core`},{$ref:`meta/applicator`},{$ref:`meta/unevaluated`},{$ref:`meta/validation`},{$ref:`meta/meta-data`},{$ref:`meta/format-annotation`},{$ref:`meta/content`}],type:[`object`,`boolean`],$comment:`This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.`,properties:{definitions:{$comment:`"definitions" has been replaced by "$defs".`,type:`object`,additionalProperties:{$dynamicRef:`#meta`},deprecated:!0,default:{}},dependencies:{$comment:`"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.`,type:`object`,additionalProperties:{anyOf:[{$dynamicRef:`#meta`},{$ref:`meta/validation#/$defs/stringArray`}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:`"$recursiveAnchor" has been replaced by "$dynamicAnchor".`,$ref:`meta/core#/$defs/anchorString`,deprecated:!0},$recursiveRef:{$comment:`"$recursiveRef" has been replaced by "$dynamicRef".`,$ref:`meta/core#/$defs/uriReferenceString`,deprecated:!0}}},`2020-12`,!1);for(let e of[Tu,Eu,Du,Ou,ku,Au,ju])Mu.addSchema(e);var Nu=e=>Array.isArray(e)?e.map(Nu):Ns(e)?Object.fromEntries(Object.entries(e).sort(([e],[t])=>e<t?-1:+(e>t)).map(([e,t])=>[e,Nu(t)])):e,Pu=new Set([`title`,`description`,`default`,`examples`,`deprecated`,`readOnly`,`writeOnly`,`$comment`]),Fu=new Set([`$schema`,`$ref`,`type`,`enum`,`const`,`required`,`minProperties`,`maxProperties`,`minItems`,`maxItems`,`uniqueItems`,`minLength`,`maxLength`,`pattern`,`minimum`,`maximum`,`exclusiveMinimum`,`exclusiveMaximum`,`multipleOf`]),Iu=new Set([`properties`,`$defs`,`patternProperties`,`dependentSchemas`]),Lu=new Set([`additionalProperties`,`items`,`contains`,`not`,`if`,`then`,`else`,`propertyNames`]),Ru=new Set([`allOf`,`anyOf`,`oneOf`,`prefixItems`]),zu=(e,t=`#`)=>{if(typeof e==`boolean`)return e;if(!Ns(e))throw TypeError(`Invalid schema at ${t}`);let n=Mu.validate(e);if(!n.valid)throw TypeError(`Invalid JSON Schema at ${t}: ${JSON.stringify(n.errors)}`);let r={};for(let[n,i]of Object.entries(e).sort(([e],[t])=>e<t?-1:+(e>t)))if(!Pu.has(n)){if(Iu.has(n)){if(!Ns(i))throw TypeError(`Invalid ${t}/${n}`);r[n]=Object.fromEntries(Object.entries(i).sort(([e],[t])=>e<t?-1:+(e>t)).map(([e,r])=>[e,zu(r,`${t}/${n}/${e}`)]))}else if(Lu.has(n))r[n]=zu(i,`${t}/${n}`);else if(Ru.has(n)){if(!Array.isArray(i))throw TypeError(`Invalid ${t}/${n}`);r[n]=i.map((e,r)=>zu(e,`${t}/${n}/${r}`))}else if(Fu.has(n)){if(n===`$ref`&&(typeof i!=`string`||!(i===`#`||i.startsWith(`#/`))))throw TypeError(`Only local JSON Pointer references are supported at ${t}/$ref`);if(n===`$schema`&&i!==`https://json-schema.org/draft/2020-12/schema`)throw TypeError(`Expected JSON Schema 2020-12 at ${t}`);r[n]=Nu(i)}else throw TypeError(`Unsupported input schema keyword ${t}/${n}`)}return r},Bu=e=>({"~standard":{version:1,vendor:`samva-json-schema`,jsonSchema:{input:()=>e,output:()=>e}}}),Vu=e=>{let t=e[`~standard`].vendor;if(t!==`effect`&&t!==`zod`)return;let n=new WeakSet,r=e=>{if(Array.isArray(e)){for(let t of e)r(t);return}if(Ns(e)&&!n.has(e)){if(n.add(e),t===`zod`&&Ns(e._zod)){r(e._zod.def);return}if(t===`effect`&&e.encoding!==void 0)throw TypeError(`Nonportable Effect transform; use a JSON input schema without decoding transforms`);if(t===`effect`&&e._tag===`Suspend`)throw TypeError(`Unsupported suspended Effect converter; use local JSON Schema references`);if(t===`zod`&&e.type===`lazy`)throw TypeError(`Unsupported lazy Zod converter; author recursive input with local JSON Schema references`);if(t===`zod`&&(e.check===`custom`||e.check===`overwrite`||[`transform`,`default`,`prefault`,`catch`].includes(String(e.type))))throw TypeError(`Nonportable Zod refinement/transform; express constraints in JSON Schema`);if(t===`effect`&&e._tag===`Filter`&&(!Ns(e.annotations)||typeof e.annotations.toJsonSchema!=`function`))throw TypeError(`Nonportable Effect refinement; provide a JSON Schema constraint`);for(let[t,n]of Object.entries(e))t!==`~standard`&&t!==`annotations`&&r(n)}};t===`effect`&&Ps(e,`ast`)?r(e.ast):r(e)},Hu=e=>{Vu(e);let t=e[`~standard`].jsonSchema,n=structuredClone(t.input({target:`draft-2020-12`})),r=zu(n),i=zu(t.output({target:`draft-2020-12`}));if(JSON.stringify(r)!==JSON.stringify(i))throw TypeError(`Template schemas must preserve JSON input; input/output conversion differs`);let a=new wu(n,`2020-12`,!1),o=e=>{let t=a.validate(e);return o.errors=t.errors,t.valid};return o.errors=[],{schema:n,validationIdentity:JSON.stringify(r),validate:o}},Uu=/^[A-Za-z0-9_][A-Za-z0-9._-]*$/,Wu=/^(?=.{1,100}$)[a-z0-9]+(?:-[a-z0-9]+)*$/,Gu={".png":`image/png`,".jpg":`image/jpeg`,".jpeg":`image/jpeg`,".gif":`image/gif`,".webp":`image/webp`,".avif":`image/avif`,".svg":`image/svg+xml`,".ico":`image/x-icon`,".woff":`font/woff`,".woff2":`font/woff2`,".ttf":`font/ttf`,".otf":`font/otf`,".pdf":`application/pdf`,".txt":`text/plain`},Ku=e=>{let t=e.lastIndexOf(`.`);return t<0?``:e.slice(t).toLowerCase()},qu=e=>Object.hasOwn(Gu,Ku(e)),Ju=(e,t=0,n=1)=>e<t?t:e>n?n:e,Yu=e=>e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055,Xu=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4,Zu=(e,t,n,r)=>{let i=(e+.3963377774*t+.2158037573*n)**3,a=(e-.1055613458*t-.0638541728*n)**3,o=(e-.0894841775*t-1.291485548*n)**3;return{r:Yu(4.0767416621*i-3.3077115913*a+.2309699292*o),g:Yu(-1.2684380046*i+2.6097574011*a-.3413193965*o),b:Yu(-.0041960863*i-.7034186147*a+1.707614701*o),a:r}},Qu=e=>{let t=Xu(e.r),n=Xu(e.g),r=Xu(e.b),i=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),a=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),o=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r);return{L:.2104542553*i+.793617785*a-.0040720468*o,a:1.9779984951*i-2.428592205*a+.4505937099*o,b:.0259040371*i+.7827717662*a-.808675766*o,alpha:e.a}},$u=(e,t,n,r)=>{let i=(e%360+360)%360,a=(1-Math.abs(2*n-1))*t,o=a*(1-Math.abs(i/60%2-1)),s=n-a/2,[c,l,u]=[[a,o,0],[o,a,0],[0,a,o],[0,o,a],[o,0,a],[a,0,o]][Math.min(5,Math.floor(i/60))];return{r:c+s,g:l+s,b:u+s,a:r}},ed={transparent:`#00000000`,black:`#000000`,white:`#ffffff`,red:`#ff0000`,green:`#008000`,blue:`#0000ff`,gray:`#808080`,grey:`#808080`,silver:`#c0c0c0`,yellow:`#ffff00`,orange:`#ffa500`,purple:`#800080`,navy:`#000080`,teal:`#008080`,olive:`#808000`,maroon:`#800000`,lime:`#00ff00`,aqua:`#00ffff`,cyan:`#00ffff`,fuchsia:`#ff00ff`,magenta:`#ff00ff`},td=(e,t=1)=>{let n=e.trim();if(n===`none`)return 0;if(n.endsWith(`%`)){let e=Number.parseFloat(n.slice(0,-1));return Number.isFinite(e)?e/100*t:void 0}let r=Number.parseFloat(n);return Number.isFinite(r)?r:void 0},nd=e=>{let t=e.trim(),n=Number.parseFloat(t);if(Number.isFinite(n))return t.endsWith(`turn`)?n*360:t.endsWith(`rad`)?n*180/Math.PI:t.endsWith(`grad`)?n*.9:n},rd=e=>{let t=[],n,r=0,i=``,a=!1;for(let o of e){if(o===`(`&&(r+=1),o===`)`&&--r,r===0&&(o===`,`||o===` `||o===`/`)){if(o===`/`){i.trim()!==``&&t.push(i.trim()),i=``,a=!0;continue}i.trim()!==``&&(a?n=i.trim():t.push(i.trim())),i=``;continue}i+=o}return i.trim()!==``&&(a?n=i.trim():t.push(i.trim())),n===void 0?{parts:t}:{parts:t,alpha:n}},id=e=>{let t=/^([a-zA-Z-]+)\(/.exec(e.trim());if(t===null)return;let n=e.trim(),r=0;for(let e=t[0].length-1;e<n.length;e++)if(n[e]===`(`)r+=1;else if(n[e]===`)`&&(--r,r===0))return{name:t[1].toLowerCase(),body:n.slice(t[0].length,e)}},ad=e=>{let t=e.trim(),n=ed[t.toLowerCase()];if(n!==void 0)return ad(n);if(t.startsWith(`#`)){let e=t.slice(1),n=e=>Number.parseInt(e.repeat(2/e.length),16)/255;return e.length===3||e.length===4?{r:n(e[0]),g:n(e[1]),b:n(e[2]),a:e.length===4?n(e[3]):1}:e.length===6||e.length===8?{r:Number.parseInt(e.slice(0,2),16)/255,g:Number.parseInt(e.slice(2,4),16)/255,b:Number.parseInt(e.slice(4,6),16)/255,a:e.length===8?Number.parseInt(e.slice(6,8),16)/255:1}:void 0}let r=id(t);if(r===void 0)return;let{parts:i,alpha:a}=rd(r.body),o=a===void 0?1:td(a)??1;switch(r.name){case`rgb`:case`rgba`:{let[e,t,n,r]=i;if(e===void 0||t===void 0||n===void 0)return;let a=e=>{let t=td(e,255);return t===void 0?void 0:t/255},[s,c,l]=[a(e),a(t),a(n)];return s===void 0||c===void 0||l===void 0?void 0:{r:s,g:c,b:l,a:r===void 0?o:td(r)??1}}case`hsl`:case`hsla`:{let[e,t,n,r]=i;if(e===void 0||t===void 0||n===void 0)return;let a=nd(e),s=td(t),c=td(n);return a===void 0||s===void 0||c===void 0?void 0:$u(a,s,c,r===void 0?o:td(r)??1)}case`oklch`:{let[e,t,n]=i;if(e===void 0||t===void 0||n===void 0)return;let r=td(e),a=td(t,.4),s=nd(n);if(r===void 0||a===void 0||s===void 0)return;let c=s*Math.PI/180;return Zu(r,a*Math.cos(c),a*Math.sin(c),o)}case`oklab`:{let[e,t,n]=i;if(e===void 0||t===void 0||n===void 0)return;let r=td(e),a=td(t,.4),s=td(n,.4);return r===void 0||a===void 0||s===void 0?void 0:Zu(r,a,s,o)}case`color-mix`:return od(r.body);default:return}},od=e=>{let t=e.split(`,`).map(e=>e.trim()),[n,r,i]=t;if(n===void 0||r===void 0||i===void 0||t.length!==3)return;let a=/^in\s+([a-z-]+)/i.exec(n)?.[1]?.toLowerCase();if(a===void 0)return;let o=e=>{let t=/\s([\d.]+)%$/.exec(e),n=ad(t===null?e:e.slice(0,t.index));if(n!==void 0)return{color:n,weight:t===null?void 0:Number.parseFloat(t[1])/100}},s=o(r),c=o(i);if(s===void 0||c===void 0)return;let l=s.weight??(c.weight===void 0?.5:1-c.weight),u=l+(c.weight??1-l);if(u===0)return;let d=l/u,f=s.color.a*d+c.color.a*(1-d),p=(e,t)=>f===0?0:(e*s.color.a*d+t*c.color.a*(1-d))/f;if(a===`srgb`)return{r:p(s.color.r,c.color.r),g:p(s.color.g,c.color.g),b:p(s.color.b,c.color.b),a:f};let m=Qu(s.color),h=Qu(c.color),g=(e,t)=>f===0?0:(e*s.color.a*d+t*c.color.a*(1-d))/f;return Zu(g(m.L,h.L),g(m.a,h.a),g(m.b,h.b),f)},sd=e=>Math.round(Ju(e)*255).toString(16).padStart(2,`0`),cd=e=>e.a>=1?`#${sd(e.r)}${sd(e.g)}${sd(e.b)}`:`rgba(${Math.round(Ju(e.r)*255)},${Math.round(Ju(e.g)*255)},${Math.round(Ju(e.b)*255)},${Math.round(Ju(e.a)*1e3)/1e3})`,ld=/\b(oklch|oklab|color-mix|lab|lch)\(/i,ud=e=>{if(!ld.test(e))return e;let t=``,n=e;for(;n.length>0;){let e=ld.exec(n);if(e===null||e.index===void 0){t+=n;break}t+=n.slice(0,e.index);let r=n.slice(e.index),i=id(r);if(i===void 0){t+=r;break}let a=r.indexOf(`(`)+i.body.length+2,o=ad(r.slice(0,a));t+=o===void 0?r.slice(0,a):cd(o),n=r.slice(a)}return t},dd=`@media (prefers-color-scheme: dark)`,fd=/^(?:only\s+)?(?:screen\s+and\s+)?\(\s*prefers-color-scheme\s*:\s*dark\s*\)$/i,pd=e=>fd.test(e.trim()),md=e=>e.length===1&&/^@media\s/i.test(e[0])&&pd(e[0].replace(/^@media\s+/i,``)),hd=e=>e.some(e=>md([e])),gd=0;function _d(e){return e>=48&&e<=57}function vd(e){return _d(e)||e>=65&&e<=70||e>=97&&e<=102}function yd(e){return e>=65&&e<=90}function bd(e){return e>=97&&e<=122}function xd(e){return yd(e)||bd(e)}function Sd(e){return e>=128}function Cd(e){return xd(e)||Sd(e)||e===95}function wd(e){return Cd(e)||_d(e)||e===45}function Td(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function Ed(e){return e===10||e===13||e===12}function Dd(e){return Ed(e)||e===32||e===9}function Od(e,t){return!(e!==92||Ed(t)||t===gd)}function kd(e,t,n){return e===45?Cd(t)||t===45||Od(t,n):Cd(e)?!0:e===92&&Od(e,t)}function Ad(e,t,n){return e===43||e===45?_d(t)?2:t===46&&_d(n)?3:0:e===46?_d(t)?2:0:+!!_d(e)}function jd(e){return+(e===65279||e===65534)}var Md=Array(128);for(let e=0;e<Md.length;e++)Md[e]=Dd(e)&&130||_d(e)&&131||Cd(e)&&132||Td(e)&&133||e||128;function Nd(e){return e<128?Md[e]:132}function Pd(e,t){return t<e.length?e.charCodeAt(t):0}function Fd(e,t,n){return n===13&&Pd(e,t+1)===10?2:1}function Id(e,t,n){let r=e.charCodeAt(t);return yd(r)&&(r|=32),r===n}function Ld(e,t,n,r){if(n-t!==r.length||t<0||n>e.length)return!1;for(let i=t;i<n;i++){let n=r.charCodeAt(i-t),a=e.charCodeAt(i);if(yd(a)&&(a|=32),a!==n)return!1}return!0}function Rd(e,t){for(;t>=0&&Dd(e.charCodeAt(t));t--);return t+1}function zd(e,t){for(;t<e.length&&Dd(e.charCodeAt(t));t++);return t}function Bd(e,t){for(;t<e.length&&_d(e.charCodeAt(t));t++);return t}function Vd(e,t){if(t+=2,vd(Pd(e,t-1))){for(let n=Math.min(e.length,t+5);t<n&&vd(Pd(e,t));t++);let n=Pd(e,t);Dd(n)&&(t+=Fd(e,t,n))}return t}function Hd(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(!wd(n)){if(Od(n,Pd(e,t+1))){t=Vd(e,t)-1;continue}break}}return t}function Ud(e,t){let n=e.charCodeAt(t);if((n===43||n===45)&&(n=e.charCodeAt(t+=1)),_d(n)&&(t=Bd(e,t+1),n=e.charCodeAt(t)),n===46&&_d(e.charCodeAt(t+1))&&(t+=2,t=Bd(e,t)),Id(e,t,101)){let r=0;n=e.charCodeAt(t+1),(n===45||n===43)&&(r=1,n=e.charCodeAt(t+2)),_d(n)&&(t=Bd(e,t+1+r+1))}return t}function Wd(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n===41){t++;break}Od(n,Pd(e,t+1))&&(t=Vd(e,t))}return t}function Gd(e){if(e.length===1&&!vd(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(t===0||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}var Kd=`EOF-token.ident-token.function-token.at-keyword-token.hash-token.string-token.bad-string-token.url-token.bad-url-token.delim-token.number-token.percentage-token.dimension-token.whitespace-token.CDO-token.CDC-token.colon-token.semicolon-token.comma-token.[-token.]-token.(-token.)-token.{-token.}-token.comment-token`.split(`.`),qd=16384;function Jd(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,qd)):e}var Yd=10,Xd=12,Zd=13;function Qd(e){let t=e.source,n=t.length,r=t.length>0?jd(t.charCodeAt(0)):0,i=Jd(e.lines,n),a=Jd(e.columns,n),o=e.startLine,s=e.startColumn;for(let e=r;e<n;e++){let r=t.charCodeAt(e);i[e]=o,a[e]=s++,(r===Yd||r===Zd||r===Xd)&&(r===Zd&&e+1<n&&t.charCodeAt(e+1)===Yd&&(e++,i[e]=o,a[e]=s),o++,s=1)}i[n]=o,a[n]=s,e.lines=i,e.columns=a,e.computed=!0}var $d=class{constructor(e,t,n,r){this.setSource(e,t,n,r),this.lines=null,this.columns=null}setSource(e=``,t=0,n=1,r=1){this.source=e,this.startOffset=t,this.startLine=n,this.startColumn=r,this.computed=!1}getLocation(e,t){return this.computed||Qd(this),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,t,n){return this.computed||Qd(this),{source:n,start:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]},end:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}}},ef=16777215,tf=24,nf=1,rf=2,af=new Uint8Array(32);af[2]=22,af[21]=22,af[19]=20,af[23]=24;var of=new Uint8Array(32);of[2]=nf,of[21]=nf,of[19]=nf,of[23]=nf,of[22]=rf,of[20]=rf,of[24]=rf;function sf(e,t,n){return e<t?t:e>n?n:e}var cf=class{constructor(e,t){this.setSource(e,t)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(e=``,t=()=>{}){e=String(e||``);let n=e.length,r=Jd(this.offsetAndType,e.length+1),i=Jd(this.balance,e.length+1),a=0,o=-1,s=0,c=e.length;this.offsetAndType=null,this.balance=null,i.fill(0),t(e,(e,t,n)=>{let l=a++;if(r[l]=e<<tf|n,o===-1&&(o=t),i[l]=c,e===s){let e=i[c];i[c]=l,c=e,s=af[r[e]>>tf]}else this.isBlockOpenerTokenType(e)&&(c=l,s=af[e])}),r[a]=0<<tf|n,i[a]=a;for(let e=0;e<a;e++){let t=i[e];if(t<=e){let n=i[t];n!==e&&(i[e]=n)}else t>a&&(i[e]=a)}this.source=e,this.firstCharOffset=o===-1?0:o,this.tokenCount=a,this.offsetAndType=r,this.balance=i,this.reset(),this.next()}lookupType(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e]>>tf:0}lookupTypeNonSC(e){for(let t=this.tokenIndex;t<this.tokenCount;t++){let n=this.offsetAndType[t]>>tf;if(n!==13&&n!==25&&e--===0)return n}return 0}lookupOffset(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e-1]&ef:this.source.length}lookupOffsetNonSC(e){for(let t=this.tokenIndex;t<this.tokenCount;t++){let n=this.offsetAndType[t]>>tf;if(n!==13&&n!==25&&e--===0)return t-this.tokenIndex}return 0}lookupValue(e,t){return e+=this.tokenIndex,e<this.tokenCount&&Ld(this.source,this.offsetAndType[e-1]&ef,this.offsetAndType[e]&ef,t)}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&ef:this.offsetAndType[this.tokenCount]&ef:this.firstCharOffset}getTokenEnd(e){return e===this.tokenIndex?this.tokenEnd:this.offsetAndType[sf(e,0,this.tokenCount)]&ef}getTokenType(e){return e===this.tokenIndex?this.tokenType:this.offsetAndType[sf(e,0,this.tokenCount)]>>tf}substrToCursor(e){return this.source.substring(e,this.tokenStart)}isBlockOpenerTokenType(e){return of[e]===nf}isBlockCloserTokenType(e){return of[e]===rf}getBlockTokenPairIndex(e){let t=this.getTokenType(e);if(of[t]===1){let n=this.balance[e],r=this.getTokenType(n);return af[t]===r?n:-1}if(of[t]===2){let n=this.balance[e];return af[this.getTokenType(n)]===t?n:-1}return-1}isBalanceEdge(e){return this.balance[this.tokenIndex]<e}isDelim(e,t){return t?this.lookupType(t)===9&&this.source.charCodeAt(this.lookupOffset(t))===e:this.tokenType===9&&this.source.charCodeAt(this.tokenStart)===e}skip(e){let t=this.tokenIndex+e;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.offsetAndType[t-1]&ef,t=this.offsetAndType[t],this.tokenType=t>>tf,this.tokenEnd=t&ef):(this.tokenIndex=this.tokenCount,this.next())}next(){let e=this.tokenIndex+1;e<this.tokenCount?(this.tokenIndex=e,this.tokenStart=this.tokenEnd,e=this.offsetAndType[e],this.tokenType=e>>tf,this.tokenEnd=e&ef):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===13||this.tokenType===25;)this.next()}skipUntilBalanced(e,t){let n=e,r=0,i=0;loop:for(;n<this.tokenCount;n++){if(r=this.balance[n],r<e)break loop;switch(i=n>0?this.offsetAndType[n-1]&ef:this.firstCharOffset,t(this.source.charCodeAt(i))){case 1:break loop;case 2:n++;break loop;default:this.isBlockOpenerTokenType(this.offsetAndType[n]>>tf)&&(n=r)}}this.skip(n-this.tokenIndex)}forEachToken(e){for(let t=0,n=this.firstCharOffset;t<this.tokenCount;t++){let r=n,i=this.offsetAndType[t],a=i&ef,o=i>>tf;n=a,e(o,r,a,t)}}dump(){let e=Array(this.tokenCount);return this.forEachToken((t,n,r,i)=>{e[i]={idx:i,type:Kd[t],chunk:this.source.substring(n,r),balance:this.balance[i]}}),e}};function lf(e,t){function n(t){return t<s?e.charCodeAt(t):0}function r(){if(l=Ud(e,l),kd(n(l),n(l+1),n(l+2))){u=12,l=Hd(e,l);return}if(n(l)===37){u=11,l++;return}u=10}function i(){let t=l;if(l=Hd(e,l),Ld(e,t,l,`url`)&&n(l)===40){if(l=zd(e,l+1),n(l)===34||n(l)===39){u=2,l=t+4;return}o();return}if(n(l)===40){u=2,l++;return}u=1}function a(t){for(t||=n(l++),u=5;l<e.length;l++){let r=e.charCodeAt(l);switch(Nd(r)){case t:l++;return;case 130:if(Ed(r)){l+=Fd(e,l,r),u=6;return}break;case 92:if(l===e.length-1)break;let i=n(l+1);Ed(i)?l+=Fd(e,l+1,i):Od(r,i)&&(l=Vd(e,l)-1)}}}function o(){for(u=7,l=zd(e,l);l<e.length;l++){let t=e.charCodeAt(l);switch(Nd(t)){case 41:l++;return;case 130:if(l=zd(e,l),n(l)===41||l>=e.length){l<e.length&&l++;return}l=Wd(e,l),u=8;return;case 34:case 39:case 40:case 133:l=Wd(e,l),u=8;return;case 92:if(Od(t,n(l+1))){l=Vd(e,l)-1;break}l=Wd(e,l),u=8;return}}}e=String(e||``);let s=e.length,c=jd(n(0)),l=c,u;for(;l<s;){let o=e.charCodeAt(l);switch(Nd(o)){case 130:u=13,l=zd(e,l+1);break;case 34:a();break;case 35:wd(n(l+1))||Od(n(l+1),n(l+2))?(u=4,l=Hd(e,l+1)):(u=9,l++);break;case 39:a();break;case 40:u=21,l++;break;case 41:u=22,l++;break;case 43:Ad(o,n(l+1),n(l+2))?r():(u=9,l++);break;case 44:u=18,l++;break;case 45:Ad(o,n(l+1),n(l+2))?r():n(l+1)===45&&n(l+2)===62?(u=15,l+=3):kd(o,n(l+1),n(l+2))?i():(u=9,l++);break;case 46:Ad(o,n(l+1),n(l+2))?r():(u=9,l++);break;case 47:n(l+1)===42?(u=25,l=e.indexOf(`*/`,l+2),l=l===-1?e.length:l+2):(u=9,l++);break;case 58:u=16,l++;break;case 59:u=17,l++;break;case 60:n(l+1)===33&&n(l+2)===45&&n(l+3)===45?(u=14,l+=4):(u=9,l++);break;case 64:kd(n(l+1),n(l+2),n(l+3))?(u=3,l=Hd(e,l+1)):(u=9,l++);break;case 91:u=19,l++;break;case 92:Od(o,n(l+1))?i():(u=9,l++);break;case 93:u=20,l++;break;case 123:u=23,l++;break;case 125:u=24,l++;break;case 131:r();break;case 132:i();break;default:u=9,l++}t(u,c,c=l)}}var uf=null,df=class e{static createItem(e){return{prev:null,next:null,data:e}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return e.createItem(t)}allocateCursor(e,t){let n;return uf===null?n={prev:e,next:t,cursor:this.cursor}:(n=uf,uf=uf.cursor,n.prev=e,n.next=t,n.cursor=this.cursor),this.cursor=n,n}releaseCursor(){let{cursor:e}=this;this.cursor=e.cursor,e.prev=null,e.next=null,e.cursor=uf,uf=e}updateCursors(e,t,n,r){let{cursor:i}=this;for(;i!==null;)i.prev===e&&(i.prev=t),i.next===n&&(i.next=r),i=i.cursor}*[Symbol.iterator](){for(let e=this.head;e!==null;e=e.next)yield e.data}get size(){let e=0;for(let t=this.head;t!==null;t=t.next)e++;return e}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(t){let n=null;this.head=null;for(let r of t){let t=e.createItem(r);n===null?this.head=t:n.next=t,t.prev=n,n=t}return this.tail=n,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(e,t=this){let n=this.allocateCursor(null,this.head);for(;n.next!==null;){let r=n.next;n.next=r.next,e.call(t,r.data,r,this)}this.releaseCursor()}forEachRight(e,t=this){let n=this.allocateCursor(this.tail,null);for(;n.prev!==null;){let r=n.prev;n.prev=r.prev,e.call(t,r.data,r,this)}this.releaseCursor()}reduce(e,t,n=this){let r=this.allocateCursor(null,this.head),i=t,a;for(;r.next!==null;)a=r.next,r.next=a.next,i=e.call(n,i,a.data,a,this);return this.releaseCursor(),i}reduceRight(e,t,n=this){let r=this.allocateCursor(this.tail,null),i=t,a;for(;r.prev!==null;)a=r.prev,r.prev=a.prev,i=e.call(n,i,a.data,a,this);return this.releaseCursor(),i}some(e,t=this){for(let n=this.head;n!==null;n=n.next)if(e.call(t,n.data,n,this))return!0;return!1}map(t,n=this){let r=new e;for(let e=this.head;e!==null;e=e.next)r.appendData(t.call(n,e.data,e,this));return r}filter(t,n=this){let r=new e;for(let e=this.head;e!==null;e=e.next)t.call(n,e.data,e,this)&&r.appendData(e.data);return r}nextUntil(e,t,n=this){if(e===null)return;let r=this.allocateCursor(null,e);for(;r.next!==null;){let e=r.next;if(r.next=e.next,t.call(n,e.data,e,this))break}this.releaseCursor()}prevUntil(e,t,n=this){if(e===null)return;let r=this.allocateCursor(e,null);for(;r.prev!==null;){let e=r.prev;if(r.prev=e.prev,t.call(n,e.data,e,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){let t=new e;for(let e of this)t.appendData(e);return t}prepend(e){return this.updateCursors(null,e,this.head,e),this.head===null?this.tail=e:(this.head.prev=e,e.next=this.head),this.head=e,this}prependData(t){return this.prepend(e.createItem(t))}append(e){return this.insert(e)}appendData(t){return this.insert(e.createItem(t))}insert(e,t=null){if(t!==null){if(this.updateCursors(t.prev,e,t,e),t.prev===null){if(this.head!==t)throw Error(`before doesn't belong to list`);this.head=e,t.prev=e,e.next=t,this.updateCursors(null,e)}else t.prev.next=e,e.prev=t.prev,t.prev=e,e.next=t}else this.updateCursors(this.tail,e,null,e),this.tail===null?this.head=e:(this.tail.next=e,e.prev=this.tail),this.tail=e;return this}insertData(t,n){return this.insert(e.createItem(t),n)}remove(e){if(this.updateCursors(e,e.prev,e,e.next),e.prev!==null)e.prev.next=e.next;else{if(this.head!==e)throw Error(`item doesn't belong to list`);this.head=e.next}if(e.next!==null)e.next.prev=e.prev;else{if(this.tail!==e)throw Error(`item doesn't belong to list`);this.tail=e.prev}return e.prev=null,e.next=null,e}push(t){this.insert(e.createItem(t))}pop(){return this.tail===null?null:this.remove(this.tail)}unshift(t){this.prepend(e.createItem(t))}shift(){return this.head===null?null:this.remove(this.head)}prependList(e){return this.insertList(e,this.head)}appendList(e){return this.insertList(e)}insertList(e,t){return e.head===null?this:(t==null?(this.updateCursors(this.tail,e.tail,null,e.head),this.tail===null?this.head=e.head:(this.tail.next=e.head,e.head.prev=this.tail),this.tail=e.tail):(this.updateCursors(t.prev,e.tail,t,e.head),t.prev===null?this.head=e.head:(t.prev.next=e.head,e.head.prev=t.prev),t.prev=e.tail,e.tail.next=t),e.head=null,e.tail=null,this)}replace(e,t){`head`in t?this.insertList(t,e):this.insert(t,e),this.remove(e)}};function ff(e,t){let n=Object.create(SyntaxError.prototype),r=Error();return Object.assign(n,{name:e,message:t,get stack(){return(r.stack||``).replace(/^(.+\n){1,3}/,`${e}: ${t}\n`)}})}var pf=100,mf=60,hf=` `;function gf({source:e,line:t,column:n,baseLine:r,baseColumn:i},a){function o(e,t){return s.slice(e,t).map((t,n)=>String(e+n+1).padStart(u)+` |`+t).join(`
|
|
45
|
+
`)}let s=(`
|
|
46
|
+
`.repeat(Math.max(r-1,0))+` `.repeat(Math.max(i-1,0))+e).split(/\r\n?|\n|\f/),c=Math.max(1,t-a)-1,l=Math.min(t+a,s.length+1),u=Math.max(4,String(l).length)+1,d=0;n+=3*(s[t-1].substr(0,n-1).match(/\t/g)||[]).length,n>pf&&(d=n-mf+3,n=58);for(let e=c;e<=l;e++)e>=0&&e<s.length&&(s[e]=s[e].replace(/\t/g,hf),s[e]=(d>0&&s[e].length>d?`…`:``)+s[e].substr(d,98)+(s[e].length>d+pf-1?`…`:``));return[o(c,t),Array(n+u+2).join(`-`)+`^`,o(t,l)].filter(Boolean).join(`
|
|
47
|
+
`).replace(/^(\s+\d+\s+\|\n)+/,``).replace(/\n(\s+\d+\s+\|)+$/,``)}function _f(e,t,n,r,i,a=1,o=1){return Object.assign(ff(`SyntaxError`,e),{source:t,offset:n,line:r,column:i,sourceFragment(e){return gf({source:t,line:r,column:i,baseLine:a,baseColumn:o},isNaN(e)?0:e)},get formattedMessage(){return`Parse error: ${e}\n`+gf({source:t,line:r,column:i,baseLine:a,baseColumn:o},2)}})}function vf(e){let t=this.createList(),n=!1,r={recognizer:e};for(;!this.eof;){switch(this.tokenType){case 25:this.next();continue;case 13:n=!0,this.next();continue}let i=e.getNode.call(this,r);if(i===void 0)break;n&&=(e.onWhiteSpace&&e.onWhiteSpace.call(this,i,t,r),!1),t.push(i)}return n&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,r),t}var yf=()=>{},bf=33,xf=35,Sf=59,Cf=123,wf=0,Tf={createList(){return[]},createSingleNodeList(e){return[e]},getFirstListNode(e){return e&&e[0]||null},getLastListNode(e){return e&&e.length>0?e[e.length-1]:null}},Ef={createList(){return new df},createSingleNodeList(e){return new df().appendData(e)},getFirstListNode(e){return e&&e.first},getLastListNode(e){return e&&e.last}};function Df(e){return function(){return this[e]()}}function Of(e){let t=Object.create(null);for(let n of Object.keys(e)){let r=e[n],i=r.parse||r;i&&(t[n]=i)}return t}function kf(e){let t={context:Object.create(null),features:Object.assign(Object.create(null),e.features),scope:Object.assign(Object.create(null),e.scope),atrule:Of(e.atrule),pseudo:Of(e.pseudo),node:Of(e.node)};for(let[n,r]of Object.entries(e.parseContext))switch(typeof r){case`function`:t.context[n]=r;break;case`string`:t.context[n]=Df(r)}return{config:t,...t,...t.node}}function Af(e){let t=``,n=`<unknown>`,r=!1,i=yf,a=!1,o=new $d,s=Object.assign(new cf,kf(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:vf,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(e){return+(e===Cf)},consumeUntilLeftCurlyBracketOrSemicolon(e){return+(e===Cf||e===Sf)},consumeUntilExclamationMarkOrSemicolon(e){return+(e===bf||e===Sf)},consumeUntilSemicolonIncluded(e){return e===Sf?2:0},createList:yf,createSingleNodeList:yf,getFirstListNode:yf,getLastListNode:yf,parseWithFallback(e,t){let n=this.tokenIndex;try{return e.call(this)}catch(e){if(a)throw e;this.skip(n-this.tokenIndex);let r=t.call(this);return a=!0,i(e,r),a=!1,r}},lookupNonWSType(e){let t;do if(t=this.lookupType(e++),t!==13&&t!==25)return t;while(t!==wf);return wf},charCodeAt(e){return e>=0&&e<t.length?t.charCodeAt(e):0},substring(e,n){return t.substring(e,n)},substrToCursor(e){return this.source.substring(e,this.tokenStart)},cmpChar(e,n){return Id(t,e,n)},cmpStr(e,n,r){return Ld(t,e,n,r)},consume(e){let t=this.tokenStart;return this.eat(e),this.substrToCursor(t)},consumeFunctionName(){let e=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),e},consumeNumber(e){let n=t.substring(this.tokenStart,Ud(t,this.tokenStart));return this.eat(e),n},eat(e){if(this.tokenType!==e){let t=Kd[e].slice(0,-6).replace(/-/g,` `).replace(/^./,e=>e.toUpperCase()),n=`${/[[\](){}]/.test(t)?`"${t}"`:t} is expected`,r=this.tokenStart;switch(e){case 1:this.tokenType===2||this.tokenType===7?(r=this.tokenEnd-1,n=`Identifier is expected but function found`):n=`Identifier is expected`;break;case 4:this.isDelim(xf)&&(this.next(),r++,n=`Name is expected`);break;case 11:this.tokenType===10&&(r=this.tokenEnd,n=`Percent sign is expected`)}this.error(n,r)}this.next()},eatIdent(e){(this.tokenType!==1||this.lookupValue(0,e)===!1)&&this.error(`Identifier "${e}" is expected`),this.next()},eatDelim(e){this.isDelim(e)||this.error(`Delim "${String.fromCharCode(e)}" is expected`),this.next()},getLocation(e,t){return r?o.getLocationRange(e,t,n):null},getLocationFromList(e){if(r){let t=this.getFirstListNode(e),r=this.getLastListNode(e);return o.getLocationRange(t===null?this.tokenStart:t.loc.start.offset-o.startOffset,r===null?this.tokenStart:r.loc.end.offset-o.startOffset,n)}return null},error(e,n){let r=n!==void 0&&n<t.length?o.getLocation(n):this.eof?o.getLocation(Rd(t,t.length-1)):o.getLocation(this.tokenStart);throw new _f(e||`Unexpected input`,t,r.offset,r.line,r.column,o.startLine,o.startColumn)}}),c=()=>({filename:n,source:t,tokenCount:s.tokenCount,getTokenType:e=>s.getTokenType(e),getTokenTypeName:e=>Kd[s.getTokenType(e)],getTokenStart:e=>s.getTokenStart(e),getTokenEnd:e=>s.getTokenEnd(e),getTokenValue:e=>s.source.substring(s.getTokenStart(e),s.getTokenEnd(e)),substring:(e,t)=>s.source.substring(e,t),balance:s.balance.subarray(0,s.tokenCount+1),isBlockOpenerTokenType:s.isBlockOpenerTokenType,isBlockCloserTokenType:s.isBlockCloserTokenType,getBlockTokenPairIndex:e=>s.getBlockTokenPairIndex(e),getLocation:e=>o.getLocation(e,n),getRangeLocation:(e,t)=>o.getLocationRange(e,t,n)});return Object.assign(function(e,l){t=e,l||={},s.setSource(t,lf),o.setSource(t,l.offset,l.line,l.column),n=l.filename||`<unknown>`,r=!!l.positions,i=typeof l.onParseError==`function`?l.onParseError:yf,a=!1,s.parseAtrulePrelude=`parseAtrulePrelude`in l?!!l.parseAtrulePrelude:!0,s.parseRulePrelude=`parseRulePrelude`in l?!!l.parseRulePrelude:!0,s.parseValue=`parseValue`in l?!!l.parseValue:!0,s.parseCustomProperty=`parseCustomProperty`in l&&!!l.parseCustomProperty;let{context:u=`default`,list:d=!0,onComment:f,onToken:p}=l;if(!(u in s.context))throw Error("Unknown context `"+u+"`");Object.assign(s,d?Ef:Tf),Array.isArray(p)?s.forEachToken((e,t,n)=>{p.push({type:e,start:t,end:n})}):typeof p==`function`&&s.forEachToken(p.bind(c())),typeof f==`function`&&s.forEachToken((e,n,r)=>{if(e===25){let e=s.getLocation(n,r),i=Ld(t,r-2,r,`*/`)?t.slice(n+2,r-2):t.slice(n+2,r);f(i,e)}});let m=s.context[u].call(s,l);return s.eof||s.error(),m},{SyntaxError:_f,config:s.config})}var jf=o((e=>{var t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.split(``);e.encode=function(e){if(0<=e&&e<t.length)return t[e];throw TypeError(`Must be between 0 and 63: `+e)},e.decode=function(e){var t=65,n=90,r=97,i=122,a=48;return t<=e&&e<=n?e-t:r<=e&&e<=i?e-r+26:a<=e&&e<=57?e-a+52:e==43?62:e==47?63:-1}})),Mf=o((e=>{var t=jf(),n=5,r=1<<n,i=r-1,a=r;function o(e){return e<0?(-e<<1)+1:(e<<1)+0}function s(e){var t=(e&1)==1,n=e>>1;return t?-n:n}e.encode=function(e){var r=``,s,c=o(e);do s=c&i,c>>>=n,c>0&&(s|=a),r+=t.encode(s);while(c>0);return r},e.decode=function(e,r,o){var c=e.length,l=0,u=0,d,f;do{if(r>=c)throw Error(`Expected more digits in base 64 VLQ value.`);if(f=t.decode(e.charCodeAt(r++)),f===-1)throw Error(`Invalid base64 digit: `+e.charAt(r-1));d=!!(f&a),f&=i,l+=f<<u,u+=n}while(d);o.value=s(l),o.rest=r}})),Nf=o((e=>{function t(e,t,n){if(t in e)return e[t];if(arguments.length===3)return n;throw Error(`"`+t+`" is a required argument.`)}e.getArg=t;var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function i(e){var t=e.match(n);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}e.urlParse=i;function a(e){var t=``;return e.scheme&&(t+=e.scheme+`:`),t+=`//`,e.auth&&(t+=e.auth+`@`),e.host&&(t+=e.host),e.port&&(t+=`:`+e.port),e.path&&(t+=e.path),t}e.urlGenerate=a;var o=32;function s(e){var t=[];return function(n){for(var r=0;r<t.length;r++)if(t[r].input===n){var i=t[0];return t[0]=t[r],t[r]=i,t[0].result}var a=e(n);return t.unshift({input:n,result:a}),t.length>o&&t.pop(),a}}var c=s(function(t){var n=t,r=i(t);if(r){if(!r.path)return t;n=r.path}for(var o=e.isAbsolute(n),s=[],c=0,l=0;;){if(c=l,l=n.indexOf(`/`,c),l===-1){s.push(n.slice(c));break}for(s.push(n.slice(c,l));l<n.length&&n[l]===`/`;)l++}for(var u,d=0,l=s.length-1;l>=0;l--)u=s[l],u===`.`?s.splice(l,1):u===`..`?d++:d>0&&(u===``?(s.splice(l+1,d),d=0):(s.splice(l,2),d--));return n=s.join(`/`),n===``&&(n=o?`/`:`.`),r?(r.path=n,a(r)):n});e.normalize=c;function l(e,t){e===``&&(e=`.`),t===``&&(t=`.`);var n=i(t),o=i(e);if(o&&(e=o.path||`/`),n&&!n.scheme)return o&&(n.scheme=o.scheme),a(n);if(n||t.match(r))return t;if(o&&!o.host&&!o.path)return o.host=t,a(o);var s=t.charAt(0)===`/`?t:c(e.replace(/\/+$/,``)+`/`+t);return o?(o.path=s,a(o)):s}e.join=l,e.isAbsolute=function(e){return e.charAt(0)===`/`||n.test(e)};function u(e,t){e===``&&(e=`.`),e=e.replace(/\/$/,``);for(var n=0;t.indexOf(e+`/`)!==0;){var r=e.lastIndexOf(`/`);if(r<0||(e=e.slice(0,r),e.match(/^([^\/]+:\/)?\/*$/)))return t;++n}return Array(n+1).join(`../`)+t.substr(e.length+1)}e.relative=u;var d=function(){return!(`__proto__`in Object.create(null))}();function f(e){return e}function p(e){return h(e)?`$`+e:e}e.toSetString=d?f:p;function m(e){return h(e)?e.slice(1):e}e.fromSetString=d?f:m;function h(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var n=t-10;n>=0;n--)if(e.charCodeAt(n)!==36)return!1;return!0}function g(e,t,n){var r=b(e.source,t.source);return r!==0||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0||n)||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=e.generatedLine-t.generatedLine,r!==0)?r:b(e.name,t.name)}e.compareByOriginalPositions=g;function _(e,t,n){var r=e.originalLine-t.originalLine;return r!==0||(r=e.originalColumn-t.originalColumn,r!==0||n)||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=e.generatedLine-t.generatedLine,r!==0)?r:b(e.name,t.name)}e.compareByOriginalPositionsNoSource=_;function v(e,t,n){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0||n)||(r=b(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:b(e.name,t.name)}e.compareByGeneratedPositionsDeflated=v;function y(e,t,n){var r=e.generatedColumn-t.generatedColumn;return r!==0||n||(r=b(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:b(e.name,t.name)}e.compareByGeneratedPositionsDeflatedNoLine=y;function b(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function x(e,t){var n=e.generatedLine-t.generatedLine;return n!==0||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=b(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:b(e.name,t.name)}e.compareByGeneratedPositionsInflated=x;function S(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,``))}e.parseSourceMapInput=S;function C(e,t,n){if(t||=``,e&&(e[e.length-1]!==`/`&&t[0]!==`/`&&(e+=`/`),t=e+t),n){var r=i(n);if(!r)throw Error(`sourceMapURL could not be parsed`);if(r.path){var o=r.path.lastIndexOf(`/`);o>=0&&(r.path=r.path.substring(0,o+1))}t=l(a(r),t)}return c(t)}e.computeSourceURL=C})),Pf=o((e=>{var t=Nf(),n=Object.prototype.hasOwnProperty,r=typeof Map<`u`;function i(){this._array=[],this._set=r?new Map:Object.create(null)}i.fromArray=function(e,t){for(var n=new i,r=0,a=e.length;r<a;r++)n.add(e[r],t);return n},i.prototype.size=function(){return r?this._set.size:Object.getOwnPropertyNames(this._set).length},i.prototype.add=function(e,i){var a=r?e:t.toSetString(e),o=r?this.has(e):n.call(this._set,a),s=this._array.length;(!o||i)&&this._array.push(e),o||(r?this._set.set(e,s):this._set[a]=s)},i.prototype.has=function(e){if(r)return this._set.has(e);var i=t.toSetString(e);return n.call(this._set,i)},i.prototype.indexOf=function(e){if(r){var i=this._set.get(e);if(i>=0)return i}else{var a=t.toSetString(e);if(n.call(this._set,a))return this._set[a]}throw Error(`"`+e+`" is not in the set.`)},i.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw Error(`No element indexed by `+e)},i.prototype.toArray=function(){return this._array.slice()},e.ArraySet=i})),Ff=o((e=>{var t=Nf();function n(e,n){var r=e.generatedLine,i=n.generatedLine,a=e.generatedColumn,o=n.generatedColumn;return i>r||i==r&&o>=a||t.compareByGeneratedPositionsInflated(e,n)<=0}function r(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}r.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},r.prototype.add=function(e){n(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},r.prototype.toArray=function(){return this._sorted||=(this._array.sort(t.compareByGeneratedPositionsInflated),!0),this._array},e.MappingList=r})),If=o((e=>{var t=Mf(),n=Nf(),r=Pf().ArraySet,i=Ff().MappingList;function a(e){e||={},this._file=n.getArg(e,`file`,null),this._sourceRoot=n.getArg(e,`sourceRoot`,null),this._skipValidation=n.getArg(e,`skipValidation`,!1),this._ignoreInvalidMapping=n.getArg(e,`ignoreInvalidMapping`,!1),this._sources=new r,this._names=new r,this._mappings=new i,this._sourcesContents=null}a.prototype._version=3,a.fromSourceMap=function(e,t){var r=e.sourceRoot,i=new a(Object.assign(t||{},{file:e.file,sourceRoot:r}));return e.eachMapping(function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};e.source!=null&&(t.source=e.source,r!=null&&(t.source=n.relative(r,t.source)),t.original={line:e.originalLine,column:e.originalColumn},e.name!=null&&(t.name=e.name)),i.addMapping(t)}),e.sources.forEach(function(t){var a=t;r!==null&&(a=n.relative(r,t)),i._sources.has(a)||i._sources.add(a);var o=e.sourceContentFor(t);o!=null&&i.setSourceContent(t,o)}),i},a.prototype.addMapping=function(e){var t=n.getArg(e,`generated`),r=n.getArg(e,`original`,null),i=n.getArg(e,`source`,null),a=n.getArg(e,`name`,null);(this._skipValidation||this._validateMapping(t,r,i,a)!==!1)&&(i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),a!=null&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:r!=null&&r.line,originalColumn:r!=null&&r.column,source:i,name:a}))},a.prototype.setSourceContent=function(e,t){var r=e;this._sourceRoot!=null&&(r=n.relative(this._sourceRoot,r)),t==null?this._sourcesContents&&(delete this._sourcesContents[n.toSetString(r)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null)):(this._sourcesContents||=Object.create(null),this._sourcesContents[n.toSetString(r)]=t)},a.prototype.applySourceMap=function(e,t,i){var a=t;if(t==null){if(e.file==null)throw Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);a=e.file}var o=this._sourceRoot;o!=null&&(a=n.relative(o,a));var s=new r,c=new r;this._mappings.unsortedForEach(function(t){if(t.source===a&&t.originalLine!=null){var r=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});r.source!=null&&(t.source=r.source,i!=null&&(t.source=n.join(i,t.source)),o!=null&&(t.source=n.relative(o,t.source)),t.originalLine=r.line,t.originalColumn=r.column,r.name!=null&&(t.name=r.name))}var l=t.source;l!=null&&!s.has(l)&&s.add(l);var u=t.name;u!=null&&!c.has(u)&&c.add(u)},this),this._sources=s,this._names=c,e.sources.forEach(function(t){var r=e.sourceContentFor(t);r!=null&&(i!=null&&(t=n.join(i,t)),o!=null&&(t=n.relative(o,t)),this.setSourceContent(t,r))},this)},a.prototype._validateMapping=function(e,t,n,r){if(t&&typeof t.line!=`number`&&typeof t.column!=`number`){var i=`original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.`;if(this._ignoreInvalidMapping)return typeof console<`u`&&console.warn&&console.warn(i),!1;throw Error(i)}if(!(e&&`line`in e&&`column`in e&&e.line>0&&e.column>=0&&!t&&!n&&!r)&&!(e&&`line`in e&&`column`in e&&t&&`line`in t&&`column`in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n)){var i=`Invalid mapping: `+JSON.stringify({generated:e,source:n,original:t,name:r});if(this._ignoreInvalidMapping)return typeof console<`u`&&console.warn&&console.warn(i),!1;throw Error(i)}},a.prototype._serializeMappings=function(){for(var e=0,r=1,i=0,a=0,o=0,s=0,c=``,l,u,d,f,p=this._mappings.toArray(),m=0,h=p.length;m<h;m++){if(u=p[m],l=``,u.generatedLine!==r){e=0;var g=u.generatedLine-r;l+=g===1?`;`:`;`.repeat(g),r=u.generatedLine}else if(m>0){if(!n.compareByGeneratedPositionsInflated(u,p[m-1]))continue;l+=`,`}l+=t.encode(u.generatedColumn-e),e=u.generatedColumn,u.source!=null&&(f=this._sources.indexOf(u.source),l+=t.encode(f-s),s=f,l+=t.encode(u.originalLine-1-a),a=u.originalLine-1,l+=t.encode(u.originalColumn-i),i=u.originalColumn,u.name!=null&&(d=this._names.indexOf(u.name),l+=t.encode(d-o),o=d)),c+=l}return c},a.prototype._generateSourcesContent=function(e,t){return e.map(function(e){if(!this._sourcesContents)return null;t!=null&&(e=n.relative(t,e));var r=n.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)},a.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},a.prototype.toString=function(){return JSON.stringify(this.toJSON())},e.SourceMapGenerator=a}))(),Lf=new Set([`Atrule`,`Selector`,`Declaration`]);function Rf(e){let t=new If.SourceMapGenerator,n={line:1,column:0},r={line:0,column:0},i={line:1,column:0},a={generated:i},o=1,s=0,c=!1,l=e.node;e.node=function(e){if(e.loc&&e.loc.start&&Lf.has(e.type)){let l=e.loc.start.line,u=e.loc.start.column-1;(r.line!==l||r.column!==u)&&(r.line=l,r.column=u,n.line=o,n.column=s,c&&(c=!1,(n.line!==i.line||n.column!==i.column)&&t.addMapping(a)),c=!0,t.addMapping({source:e.loc.source,original:r,generated:n}))}l.call(this,e),c&&Lf.has(e.type)&&(i.line=o,i.column=s)};let u=e.emit;e.emit=function(e,t,n){for(let t=0;t<e.length;t++)e.charCodeAt(t)===10?(o++,s=0):s++;u(e,t,n)};let d=e.result;return e.result=function(){return c&&t.addMapping(a),{css:d(),map:t}},e}var zf=s({safe:()=>qf,spec:()=>Kf}),Bf=43,Vf=45,Hf=(e,t)=>(e===9&&(e=t),typeof e==`string`&&(e=Math.min(e.charCodeAt(0),128)<<6),e<<1),Uf=[[1,1],[1,2],[1,7],[1,8],[1,`-`],[1,10],[1,11],[1,12],[1,15],[1,21],[3,1],[3,2],[3,7],[3,8],[3,`-`],[3,10],[3,11],[3,12],[3,15],[4,1],[4,2],[4,7],[4,8],[4,`-`],[4,10],[4,11],[4,12],[4,15],[12,1],[12,2],[12,7],[12,8],[12,`-`],[12,10],[12,11],[12,12],[12,15],[`#`,1],[`#`,2],[`#`,7],[`#`,8],[`#`,`-`],[`#`,10],[`#`,11],[`#`,12],[`#`,15],[`-`,1],[`-`,2],[`-`,7],[`-`,8],[`-`,`-`],[`-`,10],[`-`,11],[`-`,12],[`-`,15],[10,1],[10,2],[10,7],[10,8],[10,10],[10,11],[10,12],[10,`%`],[10,15],[`@`,1],[`@`,2],[`@`,7],[`@`,8],[`@`,`-`],[`@`,15],[`.`,10],[`.`,11],[`.`,12],[`+`,10],[`+`,11],[`+`,12],[`/`,`*`]],Wf=Uf.concat([[1,4],[12,4],[4,4],[3,21],[3,5],[3,16],[11,11],[11,12],[11,2],[11,`-`],[22,1],[22,2],[22,11],[22,12],[22,4],[22,`-`]]);function Gf(e){let t=new Set(e.map(([e,t])=>Hf(e)<<16|Hf(t)));return function(e,n,r){let i=Hf(n,r),a=r.charCodeAt(0);return i|(a===Vf&&n!==1&&n!==2&&n!==15||a===Bf?t.has((e&65534)<<16|a<<7):t.has((e&65534)<<16|i))}}var Kf=Gf(Uf),qf=Gf(Wf),Jf=92;function Yf(e,t){if(typeof t==`function`){let n=null;e.children.forEach(e=>{n!==null&&t.call(this,n),this.node(e),n=e});return}e.children.forEach(this.node,this)}function Xf(e){let t=new Map;for(let[n,r]of Object.entries(e.node))typeof(r.generate||r)==`function`&&t.set(n,r.generate||r);return function(e,n){let r=``,i=0,a={node(e){if(t.has(e.type))t.get(e.type).call(o,e);else throw Error(`Unknown node type: `+e.type)},tokenBefore:qf,token(e,t,n){i=this.tokenBefore(i,e,t),!n&&i&1&&this.emit(` `,13,!0),this.emit(t,e,!1),e===9&&t.charCodeAt(0)===Jf&&this.emit(`
|
|
48
|
+
`,13,!0)},emit(e){r+=e},result(){return r}};n&&(typeof n.decorator==`function`&&(a=n.decorator(a)),n.sourceMap&&(a=Rf(a)),n.mode in zf&&(a.tokenBefore=zf[n.mode]));let o={node:e=>a.node(e),children:Yf,token:(e,t)=>a.token(e,t),tokenize:e=>lf(e,(t,n,r)=>{a.token(t,e.slice(n,r),n!==0)})};return a.node(e),a.result()}}function Zf(e){return{fromPlainObject(t){return e(t,{enter(e){e.children&&!(e.children instanceof df)&&(e.children=new df().fromArray(e.children))}}),t},toPlainObject(t){return e(t,{leave(e){e.children&&e.children instanceof df&&(e.children=e.children.toArray())}}),t}}}var{hasOwnProperty:Qf}=Object.prototype,$f=function(){};function ep(e){return typeof e==`function`?e:$f}function tp(e,t){return function(n,r,i){n.type===t&&e.call(this,n,r,i)}}function np(e,t){let n=t.structure,r=[];for(let e in n){if(Qf.call(n,e)===!1)continue;let t=n[e],i={name:e,type:!1,nullable:!1};Array.isArray(t)||(t=[t]);for(let e of t)e===null?i.nullable=!0:typeof e==`string`?i.type=`node`:Array.isArray(e)&&(i.type=`list`);i.type&&r.push(i)}return r.length?{context:t.walkContext,fields:r}:null}function rp(e){let t={};for(let n in e.node)if(Qf.call(e.node,n)){let r=e.node[n];if(!r.structure)throw Error("Missed `structure` field in `"+n+"` node type definition");t[n]=np(n,r)}return t}function ip(e,t){let n=e.fields.slice(),r=e.context,i=typeof r==`string`;return t&&n.reverse(),function(e,a,o,s){let c;i&&(c=a[r],a[r]=e);for(let r of n){let n=e[r.name];if(!r.nullable||n){if(r.type===`list`){if(t?n.reduceRight(s,!1):n.reduce(s,!1))return!0}else if(o(n))return!0}}i&&(a[r]=c)}}function ap({StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:i}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Rule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Declaration:{StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:i}}}function op(e){let t=rp(e),n={},r={},i=Symbol(`break-walk`),a=Symbol(`skip-node`);for(let e in t)Qf.call(t,e)&&t[e]!==null&&(n[e]=ip(t[e],!1),r[e]=ip(t[e],!0));let o=ap(n),s=ap(r),c=function(e,c){function l(e,t,n){let r=u.call(m,e,t,n);return r===i||r!==a&&!!(f.hasOwnProperty(e.type)&&f[e.type](e,m,l,p)||d.call(m,e,t,n)===i)}let u=$f,d=$f,f=n,p=(e,t,n,r)=>e||l(t,n,r),m={break:i,skip:a,root:e,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof c==`function`)u=c;else if(c&&(u=ep(c.enter),d=ep(c.leave),c.reverse&&(f=r),c.visit)){if(o.hasOwnProperty(c.visit))f=c.reverse?s[c.visit]:o[c.visit];else if(!t.hasOwnProperty(c.visit))throw Error("Bad value `"+c.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(`, `)+`)`);u=tp(u,c.visit),d=tp(d,c.visit)}if(u===$f&&d===$f)throw Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");l(e)};return c.break=i,c.skip=a,c.find=function(e,t){let n=null;return c(e,function(e,r,a){if(t.call(this,e,r,a))return n=e,i}),n},c.findLast=function(e,t){let n=null;return c(e,{reverse:!0,enter(e,r,a){if(t.call(this,e,r,a))return n=e,i}}),n},c.findAll=function(e,t){let n=[];return c(e,function(e,r,i){t.call(this,e,r,i)&&n.push(e)}),n},c}function sp(e){return e}function cp(e){let{min:t,max:n,comma:r}=e;return t===0&&n===0?r?`#?`:`*`:t===0&&n===1?`?`:t===1&&n===0?r?`#`:`+`:t===1&&n===1?``:(r?`#`:``)+(t===n?`{`+t+`}`:`{`+t+`,`+(n===0?``:n)+`}`)}function lp(e){switch(e.type){case`Range`:return` [`+(e.min===null?`-∞`:e.min)+`,`+(e.max===null?`∞`:e.max)+`]`;default:throw Error("Unknown node type `"+e.type+"`")}}function up(e,t,n,r){let i=e.combinator===` `||r?e.combinator:` `+e.combinator+` `,a=e.terms.map(e=>dp(e,t,n,r)).join(i);return e.explicit||n?(r||a[0]===`,`?`[`:`[ `)+a+(r?`]`:` ]`):a}function dp(e,t,n,r){let i;switch(e.type){case`Group`:i=up(e,t,n,r)+(e.disallowEmpty?`!`:``);break;case`Multiplier`:return dp(e.term,t,n,r)+t(cp(e),e);case`Boolean`:i=`<boolean-expr[`+dp(e.term,t,n,r)+`]>`;break;case`Type`:i=`<`+e.name+(e.opts?t(lp(e.opts),e.opts):``)+`>`;break;case`Property`:i=`<'`+e.name+`'>`;break;case`Keyword`:i=e.name;break;case`AtKeyword`:i=`@`+e.name;break;case`Function`:i=e.name+`(`;break;case`String`:case`Token`:i=e.value;break;case`Comma`:i=`,`;break;default:throw Error("Unknown node type `"+e.type+"`")}return t(i,e)}function fp(e,t){let n=sp,r=!1,i=!1;return typeof t==`function`?n=t:t&&(r=!!t.forceBraces,i=!!t.compact,typeof t.decorate==`function`&&(n=t.decorate)),dp(e,n,r,i)}var pp={offset:0,line:1,column:1};function mp(e,t){let n=e.tokens,r=e.longestMatch,i=r<n.length&&n[r].node||null,a=i===t?null:i,o=0,s=0,c=0,l=``,u,d;for(let e=0;e<n.length;e++){let t=n[e].value;e===r&&(s=t.length,o=l.length),a!==null&&n[e].node===a&&(e<=r?c++:c=0),l+=t}return r===n.length||c>1?(u=hp(a||t,`end`)||gp(pp,l),d=gp(u)):(u=hp(a,`start`)||gp(hp(t,`start`)||pp,l.slice(0,o)),d=hp(a,`end`)||gp(u,l.substr(o,s))),{css:l,mismatchOffset:o,mismatchLength:s,start:u,end:d}}function hp(e,t){let n=e&&e.loc&&e.loc[t];return n?`line`in n?gp(n):n:null}function gp({offset:e,line:t,column:n},r){let i={offset:e,line:t,column:n};if(r){let e=r.split(/\n|\r\n?|\f/);i.offset+=r.length,i.line+=e.length-1,i.column=e.length===1?i.column+r.length:e.pop().length+1}return i}var _p=function(e,t){let n=ff(`SyntaxReferenceError`,e+(t?" `"+t+"`":``));return n.reference=t,n},vp=function(e,t,n,r){let i=ff(`SyntaxMatchError`,e),{css:a,mismatchOffset:o,mismatchLength:s,start:c,end:l}=mp(r,n);return i.rawMessage=e,i.syntax=t?fp(t):`<generic>`,i.css=a,i.mismatchOffset=o,i.mismatchLength=s,i.message=e+`
|
|
49
|
+
syntax: `+i.syntax+`
|
|
50
|
+
value: `+(a||`<empty string>`)+`
|
|
51
|
+
--------`+Array(i.mismatchOffset+1).join(`-`)+`^`,Object.assign(i,c),i.loc={source:n&&n.loc&&n.loc.source||`<unknown>`,start:c,end:l},i},yp=new Map,bp=new Map,xp=45,Sp=Ep,Cp=Dp;function wp(e,t){return t||=0,e.length-t>=2&&e.charCodeAt(t)===xp&&e.charCodeAt(t+1)===xp}function Tp(e,t){if(t||=0,e.length-t>=3&&e.charCodeAt(t)===xp&&e.charCodeAt(t+1)!==xp){let n=e.indexOf(`-`,t+2);if(n!==-1)return e.substring(t,n+1)}return``}function Ep(e){if(yp.has(e))return yp.get(e);let t=e.toLowerCase(),n=yp.get(t);if(n===void 0){let e=wp(t,0),r=e?``:Tp(t,0);n=Object.freeze({basename:t.substr(r.length),name:t,prefix:r,vendor:r,custom:e})}return yp.set(e,n),n}function Dp(e){if(bp.has(e))return bp.get(e);let t=e,n=e[0];n===`/`?n=e[1]===`/`?`//`:`/`:n!==`_`&&n!==`*`&&n!==`$`&&n!==`#`&&n!==`+`&&n!==`&`&&(n=``);let r=wp(t,n.length);if(!r&&(t=t.toLowerCase(),bp.has(t))){let n=bp.get(t);return bp.set(e,n),n}let i=r?``:Tp(t,n.length),a=t.substr(0,n.length+i.length),o=Object.freeze({basename:t.substr(a.length),name:t.substr(n.length),hack:n,vendor:i,prefix:a,custom:r});return bp.set(e,o),o}var Op=[`initial`,`inherit`,`unset`,`revert`,`revert-layer`],kp=43,Ap=45,jp=110,Mp=!0,Np=!1;function Pp(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function Fp(e,t,n){for(;e!==null&&(e.type===13||e.type===25);)e=n(++t);return t}function Ip(e,t,n,r){if(!e)return 0;let i=e.value.charCodeAt(t);if(i===kp||i===Ap){if(n)return 0;t++}for(;t<e.value.length;t++)if(!_d(e.value.charCodeAt(t)))return 0;return r+1}function Lp(e,t,n){let r=!1,i=Fp(e,t,n);if(e=n(i),e===null)return t;if(e.type!==10){if(Pp(e,kp)||Pp(e,Ap)){if(r=!0,i=Fp(n(++i),i,n),e=n(i),e===null||e.type!==10)return 0}else return t}if(!r){let t=e.value.charCodeAt(0);if(t!==kp&&t!==Ap)return 0}return Ip(e,+!r,r,i)}function Rp(e,t){let n=0;if(!e)return 0;if(e.type===10)return Ip(e,0,Np,n);if(e.type===1&&e.value.charCodeAt(0)===Ap){if(!Id(e.value,1,jp))return 0;switch(e.value.length){case 2:return Lp(t(++n),n,t);case 3:return e.value.charCodeAt(2)===Ap?(n=Fp(t(++n),n,t),e=t(n),Ip(e,0,Mp,n)):0;default:return e.value.charCodeAt(2)===Ap?Ip(e,3,Mp,n):0}}else if(e.type===1||Pp(e,kp)&&t(n+1).type===1){if(e.type!==1&&(e=t(++n)),e===null||!Id(e.value,0,jp))return 0;switch(e.value.length){case 1:return Lp(t(++n),n,t);case 2:return e.value.charCodeAt(1)===Ap?(n=Fp(t(++n),n,t),e=t(n),Ip(e,0,Mp,n)):0;default:return e.value.charCodeAt(1)===Ap?Ip(e,2,Mp,n):0}}else if(e.type===12){let r=e.value.charCodeAt(0),i=+(r===kp||r===Ap),a=i;for(;a<e.value.length&&_d(e.value.charCodeAt(a));a++);return a===i||!Id(e.value,a,jp)?0:a+1===e.value.length?Lp(t(++n),n,t):e.value.charCodeAt(a+1)===Ap?a+2===e.value.length?(n=Fp(t(++n),n,t),e=t(n),Ip(e,0,Mp,n)):Ip(e,a+2,Mp,n):0}return 0}var zp=43,Bp=45,Vp=63,Hp=117;function Up(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function Wp(e,t){return e.value.charCodeAt(0)===t}function Gp(e,t,n){let r=0;for(let i=t;i<e.value.length;i++){let a=e.value.charCodeAt(i);if(a===Bp&&n&&r!==0)return Gp(e,t+r+1,!1),6;if(!vd(a)||++r>6)return 0}return r}function Kp(e,t,n){if(!e)return 0;for(;Up(n(t),Vp);){if(++e>6)return 0;t++}return t}function qp(e,t){let n=0;if(e===null||e.type!==1||!Id(e.value,0,Hp)||(e=t(++n),e===null))return 0;if(Up(e,zp))return e=t(++n),e===null?0:e.type===1?Kp(Gp(e,0,!0),++n,t):Up(e,Vp)?Kp(1,++n,t):0;if(e.type===10){let r=Gp(e,1,!0);return r===0?0:(e=t(++n),e===null?n:e.type===12||e.type===10?!Wp(e,Bp)||!Gp(e,1,!1)?0:n+1:Kp(r,n,t))}return e.type===12?Kp(Gp(e,1,!0),++n,t):0}var Jp=[`calc(`,`-moz-calc(`,`-webkit-calc(`],Yp=[`min(`,`max(`,`clamp(`],Xp=[`round(`,`mod(`,`rem(`],Zp=[`sin(`,`cos(`,`tan(`],Qp=[`asin(`,`acos(`,`atan(`,`atan2(`],$p=[`pow(`,`sqrt(`,`log(`,`exp(`,`sign(`],em=[`hypot(`],tm=[`abs(`],nm=[...Jp,...Yp,...Xp,...Zp,...$p,...em,...tm],rm=[...Jp,...Yp,...Xp,...em,...tm],im=[...Jp,...Yp,...Xp,...Qp,...em,...tm],am=new Map([[2,22],[21,22],[19,20],[23,24]]);function om(e,t){return t<e.length?e.charCodeAt(t):0}function sm(e,t){return Ld(e,0,e.length,t)}function cm(e,t){for(let n=0;n<t.length;n++)if(sm(e,t[n]))return!0;return!1}function lm(e,t){return t===e.length-2&&om(e,t)===92&&_d(om(e,t+1))}function um(e,t,n){if(e&&e.type===`Range`){let r=Number(n!==void 0&&n!==t.length?t.substr(0,n):t);if(isNaN(r)||e.min!==null&&r<e.min&&typeof e.min!=`string`||e.max!==null&&r>e.max&&typeof e.max!=`string`)return!0}return!1}function dm(e,t){let n=0,r=[],i=0;scan:do{switch(e.type){case 24:case 22:case 20:if(e.type!==n)break scan;if(n=r.pop(),r.length===0){i++;break scan}break;case 2:case 21:case 19:case 23:r.push(n),n=am.get(e.type)}i++}while(e=t(i));return i}function fm(e,t){return function(n,r,i){return n===null?0:n.type===2&&cm(n.value,t)?dm(n,r):e(n,r,i)}}function pm(e){return function(t){return t===null||t.type!==e?0:1}}function mm(e){if(e===null||e.type!==1)return 0;let t=e.value.toLowerCase();return cm(t,Op)||sm(t,`default`)?0:1}function hm(e){return e===null||e.type!==1||om(e.value,0)!==45||om(e.value,1)!==45?0:1}function gm(e){return!hm(e)||e.value===`--`?0:1}function _m(e){if(e===null||e.type!==4)return 0;let t=e.value.length;if(t!==4&&t!==5&&t!==7&&t!==9)return 0;for(let n=1;n<t;n++)if(!vd(om(e.value,n)))return 0;return 1}function vm(e){return e===null||e.type!==4||!kd(om(e.value,1),om(e.value,2),om(e.value,3))?0:1}function ym(e,t){if(!e)return 0;let n=0,r=[],i=0;scan:do{switch(e.type){case 6:case 8:break scan;case 24:case 22:case 20:if(e.type!==n)break scan;n=r.pop();break;case 17:if(n===0)break scan;break;case 9:if(n===0&&e.value===`!`)break scan;break;case 2:case 21:case 19:case 23:r.push(n),n=am.get(e.type)}i++}while(e=t(i));return i}function bm(e,t){if(!e)return 0;let n=0,r=[],i=0;scan:do{switch(e.type){case 6:case 8:break scan;case 24:case 22:case 20:if(e.type!==n)break scan;n=r.pop();break;case 2:case 21:case 19:case 23:r.push(n),n=am.get(e.type)}i++}while(e=t(i));return i}function xm(e){return e&&=new Set(e),function(t,n,r){if(t===null||t.type!==12)return 0;let i=Ud(t.value,0);if(e!==null){let n=t.value.indexOf(`\\`,i),r=n===-1||!lm(t.value,n)?t.value.substr(i):t.value.substring(i,n);if(e.has(r.toLowerCase())===!1)return 0}return+!um(r,t.value,i)}}function Sm(e,t,n){return e===null||e.type!==11||um(n,e.value,e.value.length-1)?0:1}function Cm(e){return typeof e!=`function`&&(e=function(){return 0}),function(t,n,r){return t!==null&&t.type===10&&Number(t.value)===0?1:e(t,n,r)}}function wm(e,t,n){if(e===null)return 0;let r=Ud(e.value,0);return r!==e.value.length&&!lm(e.value,r)||um(n,e.value,r)?0:1}function Tm(e,t,n){if(e===null||e.type!==10)return 0;let r=+(om(e.value,0)===43||om(e.value,0)===45);for(;r<e.value.length;r++)if(!_d(om(e.value,r)))return 0;return+!um(n,e.value,r)}var Em={"ident-token":pm(1),"function-token":pm(2),"at-keyword-token":pm(3),"hash-token":pm(4),"string-token":pm(5),"bad-string-token":pm(6),"url-token":pm(7),"bad-url-token":pm(8),"delim-token":pm(9),"number-token":pm(10),"percentage-token":pm(11),"dimension-token":pm(12),"whitespace-token":pm(13),"CDO-token":pm(14),"CDC-token":pm(15),"colon-token":pm(16),"semicolon-token":pm(17),"comma-token":pm(18),"[-token":pm(19),"]-token":pm(20),"(-token":pm(21),")-token":pm(22),"{-token":pm(23),"}-token":pm(24)},Dm={string:pm(5),ident:pm(1),percentage:fm(Sm,rm),zero:Cm(),number:fm(wm,nm),integer:fm(Tm,nm),"custom-ident":mm,"dashed-ident":hm,"custom-property-name":gm,"hex-color":_m,"id-selector":vm,"an-plus-b":Rp,urange:qp,"declaration-value":ym,"any-value":bm},Om=[`length`,`angle`,`time`,`frequency`,`resolution`,`flex`,`decibel`,`semitones`];function km(e){let{angle:t,decibel:n,frequency:r,flex:i,length:a,resolution:o,semitones:s,time:c}=e||{};return{dimension:fm(xm(null),im),angle:fm(xm(t),im),decibel:fm(xm(n),im),frequency:fm(xm(r),im),flex:fm(xm(i),im),length:fm(Cm(xm(a)),im),resolution:fm(xm(o),im),semitones:fm(xm(s),im),time:fm(xm(c),im)}}function Am(e){let t=new Set;for(let n of Om)if(Array.isArray(e[n]))for(let r of e[n])t.add(r.toLowerCase());return function(e){return e===null?0:e.type===9&&e.value===`%`||e.type===1&&t.has(e.value.toLowerCase())?1:0}}function jm(e){return{...Em,...Dm,...km(e),"attr-unit":Am(e)}}var Mm=s({angle:()=>Pm,decibel:()=>zm,flex:()=>Rm,frequency:()=>Im,length:()=>Nm,resolution:()=>Lm,semitones:()=>Bm,time:()=>Fm}),Nm=`cm.mm.q.in.pt.pc.px.em.rem.ex.rex.cap.rcap.ch.rch.ic.ric.lh.rlh.vw.svw.lvw.dvw.vh.svh.lvh.dvh.vi.svi.lvi.dvi.vb.svb.lvb.dvb.vmin.svmin.lvmin.dvmin.vmax.svmax.lvmax.dvmax.cqw.cqh.cqi.cqb.cqmin.cqmax`.split(`.`),Pm=[`deg`,`grad`,`rad`,`turn`],Fm=[`s`,`ms`],Im=[`hz`,`khz`],Lm=[`dpi`,`dpcm`,`dppx`,`x`],Rm=[`fr`],zm=[`db`],Bm=[`st`];function Vm(e,t,n){return Object.assign(ff(`SyntaxError`,e),{input:t,offset:n,rawMessage:e,message:e+`
|
|
52
|
+
`+t+`
|
|
53
|
+
--`+Array((n||t.length)+1).join(`-`)+`^`})}var Hm=9,Um=10,Wm=12,Gm=13,Km=32,qm=new Uint8Array(128).map((e,t)=>+!!/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))),Jm=class{constructor(e){this.str=e,this.pos=0}charCodeAt(e){return e<this.str.length?this.str.charCodeAt(e):0}charCode(){return this.charCodeAt(this.pos)}isNameCharCode(e=this.charCode()){return e<128&&qm[e]===1}nextCharCode(){return this.charCodeAt(this.pos+1)}nextNonWsCode(e){return this.charCodeAt(this.findWsEnd(e))}skipWs(){this.pos=this.findWsEnd(this.pos)}findWsEnd(e){for(;e<this.str.length;e++){let t=this.str.charCodeAt(e);if(t!==Gm&&t!==Um&&t!==Wm&&t!==Km&&t!==Hm)break}return e}substringToPos(e){return this.str.substring(this.pos,this.pos=e)}eat(e){this.charCode()!==e&&this.error("Expect `"+String.fromCharCode(e)+"`"),this.pos++}peek(){return this.pos<this.str.length?this.str.charAt(this.pos++):``}error(e){throw new Vm(e,this.str,this.pos)}scanSpaces(){return this.substringToPos(this.findWsEnd(this.pos))}scanWord(){let e=this.pos;for(;e<this.str.length;e++){let t=this.str.charCodeAt(e);if(t>=128||qm[t]===0)break}return this.pos===e&&this.error(`Expect a keyword`),this.substringToPos(e)}scanNumber(){let e=this.pos;for(;e<this.str.length;e++){let t=this.str.charCodeAt(e);if(t<48||t>57)break}return this.pos===e&&this.error(`Expect a number`),this.substringToPos(e)}scanString(){let e=this.str.indexOf(`'`,this.pos+1);return e===-1&&(this.pos=this.str.length,this.error(`Expect an apostrophe`)),this.substringToPos(e+1)}},Ym=9,Xm=10,Zm=12,Qm=13,$m=32,eh=33,th=35,nh=38,rh=39,ih=40,ah=41,oh=42,sh=43,ch=44,lh=45,uh=60,dh=62,fh=63,ph=64,mh=91,hh=93,gh=123,_h=124,vh=125,yh=8734,bh={" ":1,"&&":2,"||":3,"|":4};function xh(e){let t=null,n=null;return e.eat(gh),e.skipWs(),t=e.scanNumber(e),e.skipWs(),e.charCode()===ch?(e.pos++,e.skipWs(),e.charCode()!==vh&&(n=e.scanNumber(e),e.skipWs())):n=t,e.eat(vh),{min:Number(t),max:n?Number(n):0}}function Sh(e){let t=null,n=!1;switch(e.charCode()){case oh:e.pos++,t={min:0,max:0};break;case sh:e.pos++,t={min:1,max:0};break;case fh:e.pos++,t={min:0,max:1};break;case th:e.pos++,n=!0,e.charCode()===gh?t=xh(e):e.charCode()===fh?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case gh:t=xh(e);break;default:return null}return{type:`Multiplier`,comma:n,min:t.min,max:t.max,term:null}}function Ch(e,t){let n=Sh(e);return n===null?t:(n.term=t,e.charCode()===th&&e.charCodeAt(e.pos-1)===sh||e.charCode()===fh&&e.charCodeAt(e.pos-1)===vh?Ch(e,n):n)}function wh(e){let t=e.peek();return t===``?null:Ch(e,{type:`Token`,value:t})}function Th(e){let t;return e.eat(uh),e.eat(rh),t=e.scanWord(),e.eat(rh),e.eat(dh),Ch(e,{type:`Property`,name:t})}function Eh(e){let t=null,n=null,r=1;return e.eat(mh),e.charCode()===lh&&(e.peek(),r=-1),r==-1&&e.charCode()===yh?e.peek():(t=r*Number(e.scanNumber(e)),e.isNameCharCode()&&(t+=e.scanWord())),e.skipWs(),e.eat(ch),e.skipWs(),e.charCode()===yh?e.peek():(r=1,e.charCode()===lh&&(e.peek(),r=-1),n=r*Number(e.scanNumber(e)),e.isNameCharCode()&&(n+=e.scanWord())),e.eat(hh),{type:`Range`,min:t,max:n}}function Dh(e){let t,n=null;if(e.eat(uh),t=e.scanWord(),t===`boolean-expr`){e.eat(mh);let t=Ah(e,hh);return e.eat(hh),e.eat(dh),Ch(e,{type:`Boolean`,term:t.terms.length===1?t.terms[0]:t})}return e.charCode()===ih&&e.nextCharCode()===ah&&(e.pos+=2,t+=`()`),e.charCodeAt(e.findWsEnd(e.pos))===mh&&(e.skipWs(),n=Eh(e)),e.eat(dh),Ch(e,{type:`Type`,name:t,opts:n})}function Oh(e){let t=e.scanWord();return e.charCode()===ih?(e.pos++,{type:`Function`,name:t}):Ch(e,{type:`Keyword`,name:t})}function kh(e,t){function n(e,t){return{type:`Group`,terms:e,combinator:t,disallowEmpty:!1,explicit:!1}}let r;for(t=Object.keys(t).sort((e,t)=>bh[e]-bh[t]);t.length>0;){r=t.shift();let i=0,a=0;for(;i<e.length;i++){let t=e[i];t.type===`Combinator`&&(t.value===r?(a===-1&&(a=i-1),e.splice(i,1),i--):(a!==-1&&i-a>1&&(e.splice(a,i-a,n(e.slice(a,i),r)),i=a+1),a=-1))}a!==-1&&t.length&&e.splice(a,i-a,n(e.slice(a,i),r))}return r}function Ah(e,t=-1){let n=Object.create(null),r=[],i=null,a=e.pos,o=!1;for(;e.charCode()!==t;){let t=o?Ah(e,ah):Mh(e);if(!t)break;if(t.type!==`Spaces`){if(o){if(t.terms.length===0){o=!1;continue}if(t.combinator===` `){for(;t.terms.length>1;)n[` `]=!0,r.push({type:`Combinator`,value:` `},t.terms.shift());t=t.terms[0]}}t.type===`Combinator`?((i===null||i.type===`Combinator`)&&(e.pos=a,e.error(`Unexpected combinator`)),n[t.value]=!0):i!==null&&i.type!==`Combinator`&&(n[` `]=!0,r.push({type:`Combinator`,value:` `})),r.push(t),i=t,a=e.pos,o=t.type===`Function`}}return i!==null&&i.type===`Combinator`&&(e.pos-=a,e.error(`Unexpected combinator`)),{type:`Group`,terms:r,combinator:kh(r,n)||` `,disallowEmpty:!1,explicit:!1}}function jh(e){let t;return e.eat(mh),t=Ah(e,hh),e.eat(hh),t.explicit=!0,e.charCode()===eh&&(e.pos++,t.disallowEmpty=!0),t}function Mh(e){let t=e.charCode();switch(t){case hh:break;case mh:return Ch(e,jh(e));case uh:return e.nextCharCode()===rh?Th(e):Dh(e);case _h:return{type:`Combinator`,value:e.substringToPos(e.pos+(e.nextCharCode()===_h?2:1))};case nh:return e.pos++,e.eat(nh),{type:`Combinator`,value:`&&`};case ch:return e.pos++,{type:`Comma`};case rh:return Ch(e,{type:`String`,value:e.scanString()});case $m:case Ym:case Xm:case Qm:case Zm:return{type:`Spaces`,value:e.scanSpaces()};case ph:return t=e.nextCharCode(),e.isNameCharCode(t)?(e.pos++,{type:`AtKeyword`,name:e.scanWord()}):wh(e);case oh:case sh:case fh:case th:case eh:break;case gh:if(t=e.nextCharCode(),t<48||t>57)return wh(e);break;default:return e.isNameCharCode(t)?Oh(e):wh(e)}}function Nh(e){let t=new Jm(e),n=Ah(t);return t.pos!==e.length&&t.error(`Unexpected input`),n.terms.length===1&&n.terms[0].type===`Group`?n.terms[0]:n}var Ph=function(){};function Fh(e){return typeof e==`function`?e:Ph}function Ih(e,t,n){function r(e){switch(i.call(n,e),e.type){case`Group`:e.terms.forEach(r);break;case`Multiplier`:case`Boolean`:r(e.term);break;case`Type`:case`Property`:case`Keyword`:case`AtKeyword`:case`Function`:case`String`:case`Token`:case`Comma`:break;default:throw Error(`Unknown type: `+e.type)}a.call(n,e)}let i=Ph,a=Ph;if(typeof t==`function`?i=t:t&&(i=Fh(t.enter),a=Fh(t.leave)),i===Ph&&a===Ph)throw Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");r(e,n)}var Lh={decorator(e){let t=[],n=null;return{...e,node(t){let r=n;n=t,e.node.call(this,t),n=r},emit(e,r,i){t.push({type:r,value:e,node:i?null:n})},result(){return t}}}};function Rh(e){let t=[];return lf(e,(n,r,i)=>t.push({type:n,value:e.slice(r,i),node:null})),t}function zh(e,t){return typeof e==`string`?Rh(e):t.generate(e,Lh)}var Bh={type:`Match`},Vh={type:`Mismatch`},Hh={type:`DisallowEmpty`},Uh=40,Wh=41;function Gh(e,t,n){return t===Bh&&n===Vh||e===Bh&&t===Bh&&n===Bh?e:(e.type===`If`&&e.else===Vh&&t===Bh&&(t=e.then,e=e.match),{type:`If`,match:e,then:t,else:n})}function Kh(e){return e.length>2&&e.charCodeAt(e.length-2)===Uh&&e.charCodeAt(e.length-1)===Wh}function qh(e){return e.type===`Keyword`||e.type===`AtKeyword`||e.type===`Function`||e.type===`Type`&&Kh(e.name)}function Jh(e,t=` `,n=!1){return{type:`Group`,terms:e,combinator:t,disallowEmpty:!1,explicit:n}}function Yh(e,t,n=new Set){if(!n.has(e))switch(n.add(e),e.type){case`If`:e.match=Yh(e.match,t,n),e.then=Yh(e.then,t,n),e.else=Yh(e.else,t,n);break;case`Type`:return t[e.name]||e}return e}function Xh(e,t,n){switch(e){case` `:{let e=Bh;for(let n=t.length-1;n>=0;n--){let r=t[n];e=Gh(r,e,Vh)}return e}case`|`:{let e=Vh,n=null;for(let r=t.length-1;r>=0;r--){let i=t[r];if(qh(i)&&(n===null&&r>0&&qh(t[r-1])&&(n=Object.create(null),e=Gh({type:`Enum`,map:n},Bh,e)),n!==null)){let e=(Kh(i.name)?i.name.slice(0,-1):i.name).toLowerCase();if(!(e in n)){n[e]=i;continue}}n=null,e=Gh(i,Bh,e)}return e}case`&&`:{if(t.length>5)return{type:`MatchOnce`,terms:t,all:!0};let n=Vh;for(let r=t.length-1;r>=0;r--){let i=t[r],a;a=t.length>1?Xh(e,t.filter(function(e){return e!==i}),!1):Bh,n=Gh(i,a,n)}return n}case`||`:{if(t.length>5)return{type:`MatchOnce`,terms:t,all:!1};let r=n?Bh:Vh;for(let n=t.length-1;n>=0;n--){let i=t[n],a;a=t.length>1?Xh(e,t.filter(function(e){return e!==i}),!0):Bh,r=Gh(i,a,r)}return r}}}function Zh(e){let t=Bh,n=Qh(e.term);if(e.max===0)n=Gh(n,Hh,Vh),t=Gh(n,null,Vh),t.then=Gh(Bh,Bh,t),e.comma&&(t.then.else=Gh({type:`Comma`,syntax:e},t,Vh));else for(let r=e.min||1;r<=e.max;r++)e.comma&&t!==Bh&&(t=Gh({type:`Comma`,syntax:e},t,Vh)),t=Gh(n,Gh(Bh,Bh,t),Vh);if(e.min===0)t=Gh(Bh,Bh,t);else for(let r=0;r<e.min-1;r++)e.comma&&t!==Bh&&(t=Gh({type:`Comma`,syntax:e},t,Vh)),t=Gh(n,t,Vh);return t}function Qh(e){if(typeof e==`function`)return{type:`Generic`,fn:e};switch(e.type){case`Group`:{let t=Xh(e.combinator,e.terms.map(Qh),!1);return e.disallowEmpty&&(t=Gh(t,Hh,Vh)),t}case`Multiplier`:return Zh(e);case`Boolean`:{let t=Qh(e.term),n=Qh(Jh([Jh([{type:`Keyword`,name:`not`},{type:`Type`,name:`!boolean-group`}]),Jh([{type:`Type`,name:`!boolean-group`},Jh([{type:`Multiplier`,comma:!1,min:0,max:0,term:Jh([{type:`Keyword`,name:`and`},{type:`Type`,name:`!boolean-group`}])},{type:`Multiplier`,comma:!1,min:0,max:0,term:Jh([{type:`Keyword`,name:`or`},{type:`Type`,name:`!boolean-group`}])}],`|`)])],`|`)),r=Qh(Jh([{type:`Type`,name:`!term`},Jh([{type:`Token`,value:`(`},{type:`Type`,name:`!self`},{type:`Token`,value:`)`}]),{type:`Type`,name:`general-enclosed`}],`|`));return Yh(r,{"!term":t,"!self":n}),Yh(n,{"!boolean-group":r}),n}case`Type`:case`Property`:return{type:e.type,name:e.name,syntax:e};case`Keyword`:return{type:e.type,name:e.name.toLowerCase(),syntax:e};case`AtKeyword`:return{type:e.type,name:`@`+e.name.toLowerCase(),syntax:e};case`Function`:return{type:e.type,name:e.name.toLowerCase()+`(`,syntax:e};case`String`:return e.value.length===3?{type:`Token`,value:e.value.charAt(1),syntax:e}:{type:e.type,value:e.value.substr(1,e.value.length-2).replace(/\\'/g,`'`),syntax:e};case`Token`:return{type:e.type,value:e.value,syntax:e};case`Comma`:return{type:e.type,syntax:e};default:throw Error(`Unknown node type:`,e.type)}}function $h(e,t){return typeof e==`string`&&(e=Nh(e)),{type:`MatchGraph`,match:Qh(e),syntax:t||null,source:e}}var{hasOwnProperty:eg}=Object.prototype,tg=0,ng=1,rg=2,ig=3,ag=`Match`,og=`Mismatch`,sg=`Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)`,cg=15e3,lg=0;function ug(e){let t=null,n=null,r=e;for(;r!==null;)n=r.prev,r.prev=t,t=r,r=n;return t}function dg(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=t.charCodeAt(n),i=e.charCodeAt(n);if(i>=65&&i<=90&&(i|=32),i!==r)return!1}return!0}function fg(e){return e.type===9&&e.value!==`?`}function pg(e){return e===null||e.type===18||e.type===2||e.type===21||e.type===19||e.type===23||fg(e)}function mg(e){return e===null||e.type===22||e.type===20||e.type===24||e.type===9&&e.value===`/`}function hg(e,t,n){function r(){do v++,_=v<e.length?e[v]:null;while(_!==null&&(_.type===13||_.type===25))}function i(t){let n=v+t;return n<e.length?e[n]:null}function a(e,t){return{nextState:e,matchStack:b,syntaxStack:d,thenStack:f,tokenIndex:v,prev:t}}function o(e){f={nextState:e,matchStack:b,syntaxStack:d,prev:f}}function s(e){p=a(e,p)}function c(){b={type:ng,syntax:t.syntax,token:_,prev:b},r(),m=null,v>y&&(y=v)}function l(){d={syntax:t.syntax,opts:t.syntax.opts||d!==null&&d.opts||null,prev:d},b={type:rg,syntax:t.syntax,token:b.token,prev:b}}function u(){b=b.type===rg?b.prev:{type:ig,syntax:d.syntax,token:b.token,prev:b},d=d.prev}let d=null,f=null,p=null,m=null,h=0,g=null,_=null,v=-1,y=0,b={type:tg,syntax:null,token:null,prev:null};for(r();g===null&&++h<cg;)switch(t.type){case`Match`:if(f===null){if(_!==null&&(v!==e.length-1||_.value!==`\\0`&&_.value!==`\\9`)){t=Vh;break}g=ag;break}if(t=f.nextState,t===Hh){if(f.matchStack===b){t=Vh;break}t=Bh}for(;f.syntaxStack!==d;)u();f=f.prev;break;case`Mismatch`:if(m!==null&&m!==!1)(p===null||v>p.tokenIndex)&&(p=m,m=!1);else if(p===null){g=og;break}t=p.nextState,f=p.thenStack,d=p.syntaxStack,b=p.matchStack,v=p.tokenIndex,_=v<e.length?e[v]:null,p=p.prev;break;case`MatchGraph`:t=t.match;break;case`If`:t.else!==Vh&&s(t.else),t.then!==Bh&&o(t.then),t=t.match;break;case`MatchOnce`:t={type:`MatchOnceBuffer`,syntax:t,index:0,mask:0};break;case`MatchOnceBuffer`:{let e=t.syntax.terms;if(t.index===e.length){if(t.mask===0||t.syntax.all){t=Vh;break}t=Bh;break}if(t.mask===(1<<e.length)-1){t=Bh;break}for(;t.index<e.length;t.index++){let n=1<<t.index;if((t.mask&n)===0){s(t),o({type:`AddMatchOnce`,syntax:t.syntax,mask:t.mask|n}),t=e[t.index++];break}}break}case`AddMatchOnce`:t={type:`MatchOnceBuffer`,syntax:t.syntax,index:0,mask:t.mask};break;case`Enum`:if(_!==null){let e=_.value.toLowerCase();if(e.indexOf(`\\`)!==-1&&(e=e.replace(/\\[09].*$/,``)),eg.call(t.map,e)){t=t.map[e];break}}t=Vh;break;case`Generic`:{let e=d===null?null:d.opts,n=v+Math.floor(t.fn(_,i,e));if(!isNaN(n)&&n>v){for(;v<n;)c();t=Bh}else t=Vh;break}case`Type`:case`Property`:{let e=t.type===`Type`?`types`:`properties`,r=eg.call(n,e)?n[e][t.name]:null;if(!r||!r.match)throw Error(`Bad syntax reference: `+(t.type===`Type`?`<`+t.name+`>`:`<'`+t.name+`'>`));if(m!==!1&&_!==null&&t.type===`Type`&&(t.name===`custom-ident`&&_.type===1||t.name===`length`&&_.value===`0`)){m===null&&(m=a(t,p)),t=Vh;break}l(),t=r.matchRef||r.match;break}case`Keyword`:{let e=t.name;if(_!==null){let n=_.value;if(n.indexOf(`\\`)!==-1&&(n=n.replace(/\\[09].*$/,``)),dg(n,e)){c(),t=Bh;break}}t=Vh;break}case`AtKeyword`:case`Function`:if(_!==null&&dg(_.value,t.name)){c(),t=Bh;break}t=Vh;break;case`Token`:if(_!==null&&_.value===t.value){c(),t=Bh;break}t=Vh;break;case`Comma`:_!==null&&_.type===18?pg(b.token)?t=Vh:(c(),t=mg(_)?Vh:Bh):t=pg(b.token)||mg(_)?Bh:Vh;break;case`String`:let r=``,h=v;for(;h<e.length&&r.length<t.value.length;h++)r+=e[h].value;if(dg(r,t.value)){for(;v<h;)c();t=Bh}else t=Vh;break;default:throw Error(`Unknown node type: `+t.type)}switch(lg+=h,g){case null:console.warn(`[csstree-match] BREAK after 15000 iterations`),g=sg,b=null;break;case ag:for(;d!==null;)u();break;default:b=null}return{tokens:e,reason:g,iterations:h,match:b,longestMatch:y}}function gg(e,t,n){let r=hg(e,t,n||{});if(r.match===null)return r;let i=r.match,a=r.match={syntax:t.syntax||null,match:[]},o=[a];for(i=ug(i).prev;i!==null;){switch(i.type){case rg:a.match.push(a={syntax:i.syntax,match:[]}),o.push(a);break;case ig:o.pop(),a=o[o.length-1];break;default:a.match.push({syntax:i.syntax||null,token:i.token.value,node:i.token.node})}i=i.prev}return r}var _g=s({getTrace:()=>vg,isKeyword:()=>xg,isProperty:()=>bg,isType:()=>yg});function vg(e){function t(e){return e===null?!1:e.type===`Type`||e.type===`Property`||e.type===`Keyword`}function n(i){if(Array.isArray(i.match)){for(let e=0;e<i.match.length;e++)if(n(i.match[e]))return t(i.syntax)&&r.unshift(i.syntax),!0}else if(i.node===e)return r=t(i.syntax)?[i.syntax]:[],!0;return!1}let r=null;return this.matched!==null&&n(this.matched),r}function yg(e,t){return Sg(this,e,e=>e.type===`Type`&&e.name===t)}function bg(e,t){return Sg(this,e,e=>e.type===`Property`&&e.name===t)}function xg(e){return Sg(this,e,e=>e.type===`Keyword`)}function Sg(e,t,n){let r=vg.call(e,t);return r!==null&&r.some(n)}function Cg(e){return`node`in e?e.node:Cg(e.match[0])}function wg(e){return`node`in e?e.node:wg(e.match[e.match.length-1])}function Tg(e,t,n,r,i){function a(n){if(n.syntax!==null&&n.syntax.type===r&&n.syntax.name===i){let r=Cg(n),i=wg(n);e.syntax.walk(t,function(e,t,n){if(e===r){let e=new df;do{if(e.appendData(t.data),t.data===i)break;t=t.next}while(t!==null);o.push({parent:n,nodes:e})}})}Array.isArray(n.match)&&n.match.forEach(a)}let o=[];return n.matched!==null&&a(n.matched),o}var{hasOwnProperty:Eg}=Object.prototype;function Dg(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e&&e>=0}function Og(e){return!!e&&Dg(e.offset)&&Dg(e.line)&&Dg(e.column)}function kg(e,t){return function(n,r){if(!n||n.constructor!==Object)return r(n,`Type of node should be an Object`);for(let i in n){let a=!0;if(Eg.call(n,i)!==!1){if(i===`type`)n.type!==e&&r(n,"Wrong node type `"+n.type+"`, expected `"+e+"`");else if(i===`loc`){if(n.loc===null)continue;if(n.loc&&n.loc.constructor===Object){if(typeof n.loc.source!=`string`)i+=`.source`;else if(!Og(n.loc.start))i+=`.start`;else if(!Og(n.loc.end))i+=`.end`;else continue}a=!1}else if(t.hasOwnProperty(i)){a=!1;for(let e=0;!a&&e<t[i].length;e++){let r=t[i][e];switch(r){case String:a=typeof n[i]==`string`;break;case Boolean:a=typeof n[i]==`boolean`;break;case null:a=n[i]===null;break;default:typeof r==`string`?a=n[i]&&n[i].type===r:Array.isArray(r)&&(a=n[i]instanceof df)}}}else r(n,"Unknown field `"+i+"` for "+e+` node type`);a||r(n,"Bad value for `"+e+`.`+i+"`")}}for(let i in t)Eg.call(t,i)&&Eg.call(n,i)===!1&&r(n,"Field `"+e+`.`+i+"` is missed")}}function Ag(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r];if(i===String||i===Boolean)n.push(i.name.toLowerCase());else if(i===null)n.push(`null`);else if(typeof i==`string`)n.push(i);else if(Array.isArray(i))n.push(`List<`+(Ag(i,t)||`any`)+`>`);else throw Error("Wrong value `"+i+"` in `"+t+"` structure definition")}return n.join(` | `)}function eee(e,t){let n=t.structure,r={type:String,loc:!0},i={type:`"`+e+`"`};for(let t in n)Eg.call(n,t)!==!1&&(i[t]=Ag(r[t]=Array.isArray(n[t])?n[t].slice():[n[t]],e+`.`+t));return{docs:i,check:kg(e,r)}}function tee(e){let t={};if(e.node){for(let n in e.node)if(Eg.call(e.node,n)){let r=e.node[n];if(r.structure)t[n]=eee(n,r);else throw Error("Missed `structure` field in `"+n+"` node type definition")}}return t}function jg(e,t,n){let r={};for(let i in e)e[i].syntax&&(r[i]=n?e[i].syntax:fp(e[i].syntax,{compact:t}));return r}function nee(e,t,n){let r={};for(let[i,a]of Object.entries(e))r[i]={prelude:a.prelude&&(n?a.prelude.syntax:fp(a.prelude.syntax,{compact:t})),descriptors:a.descriptors&&jg(a.descriptors,t,n)};return r}function Mg(e){for(let t=0;t<e.length;t++)if(e[t].value.toLowerCase()===`var(`)return!0;return!1}function Ng(e){let t=e.terms[0];return e.explicit===!1&&e.terms.length===1&&t.type===`Multiplier`&&t.comma===!0}function Pg(e,t,n){return{matched:e,iterations:n,error:t,..._g}}function Fg(e,t,n,r){let i=zh(n,e.syntax),a;return Mg(i)?Pg(null,Error(`Matching for a tree with var() is not supported`)):(r&&(a=gg(i,e.cssWideKeywordsSyntax,e)),(!r||!a.match)&&(a=gg(i,t.match,e),!a.match)?Pg(null,new vp(a.reason,t.syntax,n,a),a.iterations):Pg(a.match,null,a.iterations))}var Ig=class{constructor(e,t,n){if(this.cssWideKeywords=Op,this.syntax=t,this.generic=!1,this.units={...Mm},this.atrules=Object.create(null),this.properties=Object.create(null),this.types=Object.create(null),this.structure=n||tee(e),e){if(e.cssWideKeywords&&(this.cssWideKeywords=e.cssWideKeywords),e.units)for(let t of Object.keys(Mm))Array.isArray(e.units[t])&&(this.units[t]=e.units[t]);if(e.types)for(let[t,n]of Object.entries(e.types))this.addType_(t,n);if(e.generic){this.generic=!0;for(let[e,t]of Object.entries(jm(this.units)))this.addType_(e,t)}if(e.atrules)for(let[t,n]of Object.entries(e.atrules))this.addAtrule_(t,n);if(e.properties)for(let[t,n]of Object.entries(e.properties))this.addProperty_(t,n)}this.cssWideKeywordsSyntax=$h(this.cssWideKeywords.join(` | `))}checkStructure(e){function t(e,t){r.push({node:e,message:t})}let n=this.structure,r=[];return this.syntax.walk(e,function(e){n.hasOwnProperty(e.type)?n[e.type].check(e,t):t(e,"Unknown node type `"+e.type+"`")}),r.length?r:!1}createDescriptor(e,t,n,r=null){let i={type:t,name:n},a={type:t,name:n,parent:r,serializable:typeof e==`string`||e&&typeof e.type==`string`,syntax:null,match:null,matchRef:null};return typeof e==`function`?a.match=$h(e,i):(typeof e==`string`?Object.defineProperty(a,"syntax",{get(){return Object.defineProperty(a,"syntax",{value:Nh(e)}),a.syntax}}):a.syntax=e,Object.defineProperty(a,"match",{get(){return Object.defineProperty(a,"match",{value:$h(a.syntax,i)}),a.match}}),t===`Property`&&Object.defineProperty(a,"matchRef",{get(){let e=a.syntax,t=Ng(e)?$h({...e,terms:[e.terms[0].term]},i):null;return Object.defineProperty(a,"matchRef",{value:t}),t}})),a}addAtrule_(e,t){t&&(this.atrules[e]={type:`Atrule`,name:e,prelude:t.prelude?this.createDescriptor(t.prelude,`AtrulePrelude`,e):null,descriptors:t.descriptors?Object.keys(t.descriptors).reduce((n,r)=>(n[r]=this.createDescriptor(t.descriptors[r],`AtruleDescriptor`,r,e),n),Object.create(null)):null})}addProperty_(e,t){t&&(this.properties[e]=this.createDescriptor(t,`Property`,e))}addType_(e,t){t&&(this.types[e]=this.createDescriptor(t,`Type`,e))}checkAtruleName(e){if(!this.getAtrule(e))return new _p(`Unknown at-rule`,`@`+e)}checkAtrulePrelude(e,t){let n=this.checkAtruleName(e);if(n)return n;let r=this.getAtrule(e);if(!r.prelude&&t)return SyntaxError("At-rule `@"+e+"` should not contain a prelude");if(r.prelude&&!t&&!Fg(this,r.prelude,``,!1).matched)return SyntaxError("At-rule `@"+e+"` should contain a prelude")}checkAtruleDescriptorName(e,t){let n=this.checkAtruleName(e);if(n)return n;let r=this.getAtrule(e),i=Sp(t);if(!r.descriptors)return SyntaxError("At-rule `@"+e+"` has no known descriptors");if(!r.descriptors[i.name]&&!r.descriptors[i.basename])return new _p(`Unknown at-rule descriptor`,t)}checkPropertyName(e){if(!this.getProperty(e))return new _p(`Unknown property`,e)}matchAtrulePrelude(e,t){let n=this.checkAtrulePrelude(e,t);if(n)return Pg(null,n);let r=this.getAtrule(e);return r.prelude?Fg(this,r.prelude,t||``,!1):Pg(null,null)}matchAtruleDescriptor(e,t,n){let r=this.checkAtruleDescriptorName(e,t);if(r)return Pg(null,r);let i=this.getAtrule(e),a=Sp(t);return Fg(this,i.descriptors[a.name]||i.descriptors[a.basename],n,!1)}matchDeclaration(e){return e.type===`Declaration`?this.matchProperty(e.property,e.value):Pg(null,Error(`Not a Declaration node`))}matchProperty(e,t){if(Cp(e).custom)return Pg(null,Error(`Lexer matching doesn't applicable for custom properties`));let n=this.checkPropertyName(e);return n?Pg(null,n):Fg(this,this.getProperty(e),t,!0)}matchType(e,t){let n=this.getType(e);return n?Fg(this,n,t,!1):Pg(null,new _p(`Unknown type`,e))}match(e,t){return typeof e!=`string`&&(!e||!e.type)?Pg(null,new _p(`Bad syntax`)):((typeof e==`string`||!e.match)&&(e=this.createDescriptor(e,`Type`,`anonymous`)),Fg(this,e,t,!1))}findValueFragments(e,t,n,r){return Tg(this,t,this.matchProperty(e,t),n,r)}findDeclarationValueFragments(e,t,n){return Tg(this,e.value,this.matchDeclaration(e),t,n)}findAllFragments(e,t,n){let r=[];return this.syntax.walk(e,{visit:`Declaration`,enter:e=>{r.push.apply(r,this.findDeclarationValueFragments(e,t,n))}}),r}getAtrule(e,t=!0){let n=Sp(e);return(n.vendor&&t?this.atrules[n.name]||this.atrules[n.basename]:this.atrules[n.name])||null}getAtrulePrelude(e,t=!0){let n=this.getAtrule(e,t);return n&&n.prelude||null}getAtruleDescriptor(e,t){return this.atrules.hasOwnProperty(e)&&this.atrules.declarators&&this.atrules[e].declarators[t]||null}getProperty(e,t=!0){let n=Cp(e);return(n.vendor&&t?this.properties[n.name]||this.properties[n.basename]:this.properties[n.name])||null}getType(e){return hasOwnProperty.call(this.types,e)?this.types[e]:null}validate(){function e(e,t){return t?`<${e}>`:`<'${e}'>`}function t(a,o,s,c){if(s.has(o))return s.get(o);s.set(o,!1),c.syntax!==null&&Ih(c.syntax,function(c){if(c.type!==`Type`&&c.type!==`Property`)return;let l=c.type===`Type`?a.types:a.properties,u=c.type===`Type`?r:i;hasOwnProperty.call(l,c.name)?t(a,c.name,u,l[c.name])&&(n.push(`${e(o,s===r)} used broken syntax definition ${e(c.name,c.type===`Type`)}`),s.set(o,!0)):(n.push(`${e(o,s===r)} used missed syntax definition ${e(c.name,c.type===`Type`)}`),s.set(o,!0))},this)}let n=[],r=new Map,i=new Map;for(let e in this.types)t(this,e,r,this.types[e]);for(let e in this.properties)t(this,e,i,this.properties[e]);let a=[...r.keys()].filter(e=>r.get(e)),o=[...i.keys()].filter(e=>i.get(e));return a.length||o.length?{errors:n,types:a,properties:o}:null}dump(e,t){return{generic:this.generic,cssWideKeywords:this.cssWideKeywords,units:this.units,types:jg(this.types,!t,e),properties:jg(this.properties,!t,e),atrules:nee(this.atrules,!t,e)}}toString(){return JSON.stringify(this.dump())}};function Lg(e,t){return typeof t==`string`&&/^\s*\|/.test(t)?typeof e==`string`?e+t:t.replace(/^\s*\|\s*/,``):t||null}function Rg(e,t){let n=Object.create(null);for(let r of Object.keys(e))t.includes(r)&&(n[r]=e[r]);return n}function zg(e,t,n){let r={...e};for(let[e,i]of Object.entries(t))r[e]={...r[e],...n?Rg(i,n):i};return r}function Bg(e,t){let n={...e};for(let[r,i]of Object.entries(t))switch(r){case`generic`:n[r]=!!i;break;case`cssWideKeywords`:n[r]=e[r]?[...e[r],...i]:i||[];break;case`units`:n[r]={...e[r]};for(let[e,t]of Object.entries(i))n[r][e]=Array.isArray(t)?t:[];break;case`atrules`:n[r]={...e[r]};for(let[e,t]of Object.entries(i)){let i=n[r][e]||{},a=n[r][e]={prelude:i.prelude||null,descriptors:{...i.descriptors}};if(t){a.prelude=t.prelude?Lg(a.prelude,t.prelude):a.prelude||null;for(let[e,n]of Object.entries(t.descriptors||{}))a.descriptors[e]=n?Lg(a.descriptors[e],n):null;Object.keys(a.descriptors).length||(a.descriptors=null)}}break;case`types`:case`properties`:n[r]={...e[r]};for(let[e,t]of Object.entries(i))n[r][e]=Lg(n[r][e],t);break;case`parseContext`:n[r]={...e[r],...i};break;case`scope`:case`features`:n[r]=zg(e[r],i);break;case`atrule`:case`pseudo`:n[r]=zg(e[r],i,[`parse`]);break;case`node`:n[r]=zg(e[r],i,[`name`,`structure`,`parse`,`generate`,`walkContext`])}return n}function Vg(e){let t=Af(e),n=op(e),r=Xf(e),{fromPlainObject:i,toPlainObject:a}=Zf(n),o={lexer:null,createLexer:e=>new Ig(e,o,o.lexer.structure),tokenize:lf,parse:t,generate:r,walk:n,find:n.find,findLast:n.findLast,findAll:n.findAll,fromPlainObject:i,toPlainObject:a,fork(t){let n=Bg({},e);return Vg(typeof t==`function`?t(n):Bg(n,t))}};return o.lexer=new Ig({generic:e.generic,cssWideKeywords:e.cssWideKeywords,units:e.units,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},o),o}var Hg=e=>Vg(Bg({},e)),Ug={generic:!0,cssWideKeywords:[`initial`,`inherit`,`unset`,`revert`,`revert-layer`],units:{angle:[`deg`,`grad`,`rad`,`turn`],decibel:[`db`],flex:[`fr`],frequency:[`hz`,`khz`],length:`cm.mm.q.in.pt.pc.px.em.rem.ex.rex.cap.rcap.ch.rch.ic.ric.lh.rlh.vw.svw.lvw.dvw.vh.svh.lvh.dvh.vi.svi.lvi.dvi.vb.svb.lvb.dvb.vmin.svmin.lvmin.dvmin.vmax.svmax.lvmax.dvmax.cqw.cqh.cqi.cqb.cqmin.cqmax`.split(`.`),resolution:[`dpi`,`dpcm`,`dppx`,`x`],semitones:[`st`],time:[`s`,`ms`]},types:{"abs()":`abs( <calc-sum> )`,"absolute-size":`xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large`,"acos()":`acos( <calc-sum> )`,"alpha-value":`<number>|<percentage>`,"an+b":`odd|even|<integer>|<n-dimension>|'+'? † n|-n|<ndashdigit-dimension>|'+'? † <ndashdigit-ident>|<dashndashdigit-ident>|<n-dimension> <signed-integer>|'+'? † n <signed-integer>|-n <signed-integer>|<ndash-dimension> <signless-integer>|'+'? † n- <signless-integer>|-n- <signless-integer>|<n-dimension> ['+'|'-'] <signless-integer>|'+'? † n ['+'|'-'] <signless-integer>|-n ['+'|'-'] <signless-integer>`,"anchor()":`anchor( <anchor-name>?&&<anchor-side> , <length-percentage>? )`,"anchor-name":`<dashed-ident>`,"anchor-side":`inside|outside|top|left|right|bottom|start|end|self-start|self-end|<percentage>|center`,"anchor-size":`width|height|block|inline|self-block|self-inline`,"anchor-size()":`anchor-size( [<anchor-name>||<anchor-size>]? , <length-percentage>? )`,"angle-percentage":`<angle>|<percentage>`,"angular-color-hint":`<angle-percentage>|<zero>`,"angular-color-stop":`<color> <color-stop-angle>?`,"angular-color-stop-list":`<angular-color-stop> , [<angular-color-hint>? , <angular-color-stop>]#?`,"animateable-feature":`scroll-position|contents|<custom-ident>`,"animation-action":`none|play|play-once|play-forwards|play-backwards|pause|reset|replay`,"asin()":`asin( <calc-sum> )`,"atan()":`atan( <calc-sum> )`,"atan2()":`atan2( <calc-sum> , <calc-sum> )`,attachment:`scroll|fixed|local`,"attr()":`attr( <attr-name> <attr-type>? , <declaration-value>? )`,"attr-matcher":`['~'|'|'|'^'|'$'|'*']? '='`,"attr-modifier":`i|s`,"attr-type":`type( <syntax> )|raw-string|number|<attr-unit>`,"attribute-selector":`'[' <wq-name> ']'|'[' <wq-name> <attr-matcher> [<string-token>|<ident-token>] <attr-modifier>? ']'`,"auto-repeat":`repeat( [auto-fill|auto-fit] , [<line-names>? <fixed-size>]+ <line-names>? )`,"auto-track-list":`[<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>? <auto-repeat> [<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>?`,axis:`block|inline|x|y`,"baseline-position":`[first|last]? baseline`,"basic-shape":`<inset()>|<xywh()>|<rect()>|<circle()>|<ellipse()>|<polygon()>|<path()>`,"basic-shape-rect":`<inset()>|<rect()>|<xywh()>`,"bg-clip":`<visual-box>|border-area|text`,"bg-image":`<image>|none`,"bg-layer":`<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<visual-box>||<visual-box>`,"bg-position":`[[left|center|right|top|bottom|<length-percentage>]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]|[center|[left|right] <length-percentage>?]&&[center|[top|bottom] <length-percentage>?]]`,"bg-size":`[<length-percentage [0,∞]>|auto]{1,2}|cover|contain`,"blend-mode":`normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity`,"blur()":`blur( <length>? )`,"brightness()":`brightness( [<number>|<percentage>]? )`,"calc()":`calc( <calc-sum> )`,"calc-constant":`e|pi|infinity|-infinity|NaN`,"calc-product":`<calc-value> ['*' <calc-value>|'/' <number>]*`,"calc-size()":`calc-size( <calc-size-basis> , <calc-sum> )`,"calc-size-basis":`<intrinsic-size-keyword>|<calc-size()>|any|<calc-sum>`,"calc-sum":`<calc-product> [['+'|'-'] <calc-product>]*`,"calc-value":`<number>|<dimension>|<percentage>|<calc-constant>|( <calc-sum> )`,"cf-final-image":`<image>|<color>`,"cf-mixing-image":`<percentage>?&&<image>`,"circle()":`circle( <radial-size>? [at <position>]? )`,"clamp()":`clamp( <calc-sum>#{3} )`,"class-selector":`'.' <ident-token>`,"clip-source":`<url>`,color:`<color-base>|currentColor|<system-color>|<device-cmyk()>|<light-dark()>|<-non-standard-color>`,"color()":`color( <colorspace-params> [/ [<alpha-value>|none]]? )`,"color-base":`<hex-color>|<color-function>|<named-color>|<color-mix()>|transparent`,"color-function":`<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hwb()>|<lab()>|<lch()>|<oklab()>|<oklch()>|<color()>`,"color-interpolation-method":`in [<rectangular-color-space>|<polar-color-space> <hue-interpolation-method>?|<custom-color-space>]`,"color-mix()":`color-mix( <color-interpolation-method> , [<color>&&<percentage [0,100]>?]#{2} )`,"color-stop":`<color-stop-length>|<color-stop-angle>`,"color-stop-angle":`[<angle-percentage>|<zero>]{1,2}`,"color-stop-length":`<length-percentage>{1,2}`,"color-stop-list":`<linear-color-stop> , [<linear-color-hint>? , <linear-color-stop>]#?`,"colorspace-params":`[<predefined-rgb-params>|<xyz-params>]`,combinator:`'>'|'+'|'~'|['|' '|']`,"common-lig-values":`[common-ligatures|no-common-ligatures]`,"compat-auto":`searchfield|textarea|checkbox|radio|menulist|listbox|meter|progress-bar|button`,"compat-special":`textfield|menulist-button`,"complex-selector":`<complex-selector-unit> [<combinator>? <complex-selector-unit>]*`,"complex-selector-list":`<complex-selector>#`,"composite-style":`clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor`,"compositing-operator":`add|subtract|intersect|exclude`,"compound-selector":`[<type-selector>? <subclass-selector>*]!`,"compound-selector-list":`<compound-selector>#`,"conic-gradient()":`conic-gradient( [<conic-gradient-syntax>] )`,"conic-gradient-syntax":`[[[from [<angle>|<zero>]]? [at <position>]?]||<color-interpolation-method>]? , <angular-color-stop-list>`,"container-condition":`not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]`,"container-name":`<custom-ident>`,"container-query":`not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]`,"content-distribution":`space-between|space-around|space-evenly|stretch`,"content-list":`[<string>|contents|<image>|<counter>|<quote>|<target>|<leader()>|<attr()>]+`,"content-position":`center|start|end|flex-start|flex-end`,"content-replacement":`<image>`,"contextual-alt-values":`[contextual|no-contextual]`,"contrast()":`contrast( [<number>|<percentage>]? )`,"coord-box":`content-box|padding-box|border-box|fill-box|stroke-box|view-box`,"corner-shape-value":`round|scoop|bevel|notch|square|squircle|<superellipse()>`,"cos()":`cos( <calc-sum> )`,counter:`<counter()>|<counters()>`,"counter()":`counter( <counter-name> , <counter-style>? )`,"counter-name":`<custom-ident>`,"counter-style":`<counter-style-name>|symbols( )`,"counter-style-name":`<custom-ident>`,"counters()":`counters( <counter-name> , <string> , <counter-style>? )`,"cross-fade()":`cross-fade( <cf-mixing-image> , <cf-final-image>? )`,"cubic-bezier()":`cubic-bezier( [<number [0,1]> , <number>]#{2} )`,"cubic-bezier-easing-function":`ease|ease-in|ease-out|ease-in-out|cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )`,"cursor-predefined":`auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing`,"custom-color-space":`<dashed-ident>`,"custom-params":`<dashed-ident> [<number>|<percentage>|none]+`,dasharray:`[[<length-percentage>|<number>]+]#`,"dashndashdigit-ident":`<ident-token>`,"deprecated-system-color":`ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonHighlight|ButtonShadow|CaptionText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText`,"discretionary-lig-values":`[discretionary-ligatures|no-discretionary-ligatures]`,"display-box":`contents|none`,"display-inside":`flow|flow-root|table|flex|grid|ruby`,"display-internal":`table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container`,"display-legacy":`inline-block|inline-list-item|inline-table|inline-flex|inline-grid`,"display-listitem":`<display-outside>?&&[flow|flow-root]?&&list-item`,"display-outside":`block|inline|run-in`,"drop-shadow()":`drop-shadow( [<color>?&&<length>{2,3}] )`,"dynamic-range-limit-mix()":`dynamic-range-limit-mix( [<'dynamic-range-limit'>&&<percentage [0,100]>]#{2,} )`,"easing-function":`<linear-easing-function>|<cubic-bezier-easing-function>|<step-easing-function>`,"east-asian-variant-values":`[jis78|jis83|jis90|jis04|simplified|traditional]`,"east-asian-width-values":`[full-width|proportional-width]`,"element()":`element( <custom-ident> , [first|start|last|first-except]? )|element( <id-selector> )`,"ellipse()":`ellipse( <radial-size>? [at <position>]? )`,"env()":`env( <custom-ident> , <declaration-value>? )`,"exp()":`exp( <calc-sum> )`,"explicit-track-list":`[<line-names>? <track-size>]+ <line-names>?`,"family-name":`<string>|<custom-ident>+`,"feature-tag-value":`<string> [<integer>|on|off]?`,"feature-type":`@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation`,"feature-value-block":`<feature-type> '{' <feature-value-declaration-list> '}'`,"feature-value-block-list":`<feature-value-block>+`,"feature-value-declaration":`<custom-ident> : <integer>+ ;`,"feature-value-declaration-list":`<feature-value-declaration>`,"feature-value-name":`<custom-ident>`,"filter-function":`<blur()>|<brightness()>|<contrast()>|<drop-shadow()>|<grayscale()>|<hue-rotate()>|<invert()>|<opacity()>|<saturate()>|<sepia()>`,"filter-value-list":`[<filter-function>|<url>]+`,"final-bg-layer":`<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<visual-box>||<visual-box>||<'background-color'>`,"fit-content()":`fit-content( <length-percentage [0,∞]> )`,"fixed-breadth":`<length-percentage>`,"fixed-repeat":`repeat( [<integer [1,∞]>] , [<line-names>? <fixed-size>]+ <line-names>? )`,"fixed-size":`<fixed-breadth>|minmax( <fixed-breadth> , <track-breadth> )|minmax( <inflexible-breadth> , <fixed-breadth> )`,"font-stretch-absolute":`normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|<percentage>`,"font-variant-css2":`normal|small-caps`,"font-weight-absolute":`normal|bold|<number [1,1000]>`,"font-width-css3":`normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded`,"form-control-identifier":`select`,"frequency-percentage":`<frequency>|<percentage>`,"generic-complete":`serif|sans-serif|system-ui|cursive|fantasy|math|monospace`,"general-enclosed":`[<function-token> <any-value>? )]|[( <any-value>? )]`,"generic-family":`<generic-script-specific>|<generic-complete>|<generic-incomplete>|<-non-standard-generic-family>`,"generic-incomplete":`ui-serif|ui-sans-serif|ui-monospace|ui-rounded`,"geometry-box":`<shape-box>|fill-box|stroke-box|view-box`,gradient:`<linear-gradient()>|<repeating-linear-gradient()>|<radial-gradient()>|<repeating-radial-gradient()>|<conic-gradient()>|<repeating-conic-gradient()>|<-legacy-gradient>`,"grayscale()":`grayscale( [<number>|<percentage>]? )`,"grid-line":`auto|<custom-ident>|[<integer>&&<custom-ident>?]|[span&&[<integer>||<custom-ident>]]`,"historical-lig-values":`[historical-ligatures|no-historical-ligatures]`,"hsl()":`hsl( <hue> , <percentage> , <percentage> , <alpha-value>? )|hsl( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )`,"hsla()":`hsla( <hue> , <percentage> , <percentage> , <alpha-value>? )|hsla( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )`,hue:`<number>|<angle>`,"hue-interpolation-method":`[shorter|longer|increasing|decreasing] hue`,"hue-rotate()":`hue-rotate( [<angle>|<zero>]? )`,"hwb()":`hwb( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )`,"hypot()":`hypot( <calc-sum># )`,image:`<url>|<image()>|<image-set()>|<element()>|<paint()>|<cross-fade()>|<gradient>`,"image()":`image( <image-tags>? [<image-src>? , <color>?]! )`,"image-set()":`image-set( <image-set-option># )`,"image-set-option":`[<image>|<string>] [<resolution>||type( <string> )]`,"image-src":`<url>|<string>`,"image-tags":`ltr|rtl`,"inflexible-breadth":`<length-percentage>|min-content|max-content|auto`,"inset()":`inset( <length-percentage>{1,4} [round <'border-radius'>]? )`,"invert()":`invert( [<number>|<percentage>]? )`,"keyframe-block":`<keyframe-selector># { <declaration-list> }`,"keyframe-selector":`from|to|<percentage [0,100]>|<timeline-range-name> <percentage>`,"keyframes-name":`<custom-ident>|<string>`,"lab()":`lab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )`,"layer()":`layer( <layer-name> )`,"layer-name":`<ident> ['.' <ident>]*`,"lch()":`lch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )`,"leader()":`leader( <leader-type> )`,"leader-type":`dotted|solid|space|<string>`,"length-percentage":`<length>|<percentage>`,"light-dark()":`light-dark( <color> , <color> )`,"line-name-list":`[<line-names>|<name-repeat>]+`,"line-names":`'[' <custom-ident>* ']'`,"line-style":`none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset`,"line-width":`<length>|thin|medium|thick`,"linear()":`linear( [<number>&&<percentage>{0,2}]# )`,"linear-color-hint":`<length-percentage>`,"linear-color-stop":`<color> <color-stop-length>?`,"linear-easing-function":`linear|<linear()>`,"linear-gradient()":`linear-gradient( [<linear-gradient-syntax>] )`,"linear-gradient-syntax":`[[<angle>|<zero>|to <side-or-corner>]||<color-interpolation-method>]? , <color-stop-list>`,"log()":`log( <calc-sum> , <calc-sum>? )`,"mask-layer":`<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||<geometry-box>||[<geometry-box>|no-clip]||<compositing-operator>||<masking-mode>`,"mask-position":`[<length-percentage>|left|center|right] [<length-percentage>|top|center|bottom]?`,"mask-reference":`none|<image>|<mask-source>`,"mask-source":`<url>`,"masking-mode":`alpha|luminance|match-source`,"matrix()":`matrix( <number>#{6} )`,"matrix3d()":`matrix3d( <number>#{16} )`,"max()":`max( <calc-sum># )`,"media-and":`<media-in-parens> [and <media-in-parens>]+`,"media-condition":`<media-not>|<media-and>|<media-or>|<media-in-parens>`,"media-condition-without-or":`<media-not>|<media-and>|<media-in-parens>`,"media-feature":`( [<mf-plain>|<mf-boolean>|<mf-range>] )`,"media-in-parens":`( <media-condition> )|<media-feature>|<general-enclosed>`,"media-not":`not <media-in-parens>`,"media-or":`<media-in-parens> [or <media-in-parens>]+`,"media-query":`<media-condition>|[not|only]? <media-type> [and <media-condition-without-or>]?`,"media-query-list":`<media-query>#`,"media-type":`<ident>`,"mf-boolean":`<mf-name>`,"mf-name":`<ident>`,"mf-plain":`<mf-name> : <mf-value>`,"mf-range":`<mf-name> ['<'|'>']? '='? <mf-value>|<mf-value> ['<'|'>']? '='? <mf-name>|<mf-value> '<' '='? <mf-name> '<' '='? <mf-value>|<mf-value> '>' '='? <mf-name> '>' '='? <mf-value>`,"mf-value":`<number>|<dimension>|<ident>|<ratio>`,"min()":`min( <calc-sum># )`,"minmax()":`minmax( [<length-percentage>|min-content|max-content|auto] , [<length-percentage>|<flex>|min-content|max-content|auto] )`,"mod()":`mod( <calc-sum> , <calc-sum> )`,"n-dimension":`<dimension-token>`,"name-repeat":`repeat( [<integer [1,∞]>|auto-fill] , <line-names>+ )`,"named-color":`aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen`,"namespace-prefix":`<ident>`,"ndash-dimension":`<dimension-token>`,"ndashdigit-dimension":`<dimension-token>`,"ndashdigit-ident":`<ident-token>`,"ns-prefix":`[<ident-token>|'*']? '|'`,"number-percentage":`<number>|<percentage>`,"numeric-figure-values":`[lining-nums|oldstyle-nums]`,"numeric-fraction-values":`[diagonal-fractions|stacked-fractions]`,"numeric-spacing-values":`[proportional-nums|tabular-nums]`,"offset-path":`<ray()>|<url>|<basic-shape>`,"oklab()":`oklab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )`,"oklch()":`oklch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )`,"opacity()":`opacity( [<number>|<percentage>]? )`,"opacity-value":`<number>|<percentage>`,"outline-line-style":`none|dotted|dashed|solid|double|groove|ridge|inset|outset`,"outline-radius":`<length>|<percentage>`,"overflow-position":`unsafe|safe`,"page-body":`<declaration>? [; <page-body>]?|<page-margin-box> <page-body>`,"page-margin-box":`<page-margin-box-type> '{' <declaration-list> '}'`,"page-margin-box-type":`@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom`,"page-selector":`<pseudo-page>+|<ident> <pseudo-page>*`,"page-selector-list":`[<page-selector>#]?`,"page-size":`A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger`,paint:`none|<color>|<url> [none|<color>]?|context-fill|context-stroke`,"paint()":`paint( <ident> , <declaration-value>? )`,"paint-box":`<visual-box>|fill-box|stroke-box`,"palette-identifier":`<dashed-ident>`,"palette-mix()":`palette-mix( <color-interpolation-method> , [[normal|light|dark|<palette-identifier>|<palette-mix()>]&&<percentage [0,100]>?]#{2} )`,"path()":`path( <'fill-rule'>? , <string> )`,"perspective()":`perspective( [<length [0,∞]>|none] )`,"polar-color-space":`hsl|hwb|lch|oklch`,"polygon()":`polygon( <'fill-rule'>? , [<length-percentage> <length-percentage>]# )`,position:`[[left|center|right]||[top|center|bottom]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]?|[[left|right] <length-percentage>]&&[[top|bottom] <length-percentage>]]`,"position-area":`[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|center|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|center|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]`,"pow()":`pow( <calc-sum> , <calc-sum> )`,"predefined-rgb":`srgb|srgb-linear|display-p3|display-p3-linear|a98-rgb|prophoto-rgb|rec2020`,"predefined-rgb-params":`<predefined-rgb> [<number>|<percentage>|none]{3}`,"pseudo-class-selector":`':' <ident-token>|':' <function-token> <any-value> ')'`,"pseudo-element-selector":`':' <pseudo-class-selector>|<legacy-pseudo-element-selector>`,"pseudo-page":`: [left|right|first|blank]`,"query-in-parens":`( <container-condition> )|( <size-feature> )|style( <style-query> )|<general-enclosed>`,quote:`open-quote|close-quote|no-open-quote|no-close-quote`,"radial-extent":`closest-corner|closest-side|farthest-corner|farthest-side`,"radial-gradient()":`radial-gradient( [<radial-gradient-syntax>] )`,"radial-gradient-syntax":`[[[<radial-shape>||<radial-size>]? [at <position>]?]||<color-interpolation-method>]? , <color-stop-list>`,"radial-shape":`circle|ellipse`,"radial-size":`<radial-extent>|<length [0,∞]>|<length-percentage [0,∞]>{2}`,ratio:`<number [0,∞]> [/ <number [0,∞]>]?`,"ray()":`ray( <angle>&&<ray-size>?&&contain?&&[at <position>]? )`,"ray-size":`closest-side|closest-corner|farthest-side|farthest-corner|sides`,"rect()":`rect( [<length-percentage>|auto]{4} [round <'border-radius'>]? )`,"rectangular-color-space":`srgb|srgb-linear|display-p3|display-p3-linear|a98-rgb|prophoto-rgb|rec2020|lab|oklab|xyz|xyz-d50|xyz-d65`,"relative-selector":`<combinator>? <complex-selector>`,"relative-selector-list":`<relative-selector>#`,"relative-size":`larger|smaller`,"rem()":`rem( <calc-sum> , <calc-sum> )`,"repeat-style":`repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}`,"repeating-conic-gradient()":`repeating-conic-gradient( [<conic-gradient-syntax>] )`,"repeating-linear-gradient()":`repeating-linear-gradient( [<linear-gradient-syntax>] )`,"repeating-radial-gradient()":`repeating-radial-gradient( [<radial-gradient-syntax>] )`,"reversed-counter-name":`reversed( <counter-name> )`,"rgb()":`rgb( <percentage>#{3} , <alpha-value>? )|rgb( <number>#{3} , <alpha-value>? )|rgb( [<number>|<percentage>|none]{3} [/ [<alpha-value>|none]]? )`,"rgba()":`rgba( <percentage>#{3} , <alpha-value>? )|rgba( <number>#{3} , <alpha-value>? )|rgba( [<number>|<percentage>|none]{3} [/ [<alpha-value>|none]]? )`,"rotate()":`rotate( [<angle>|<zero>] )`,"rotate3d()":`rotate3d( <number> , <number> , <number> , [<angle>|<zero>] )`,"rotateX()":`rotateX( [<angle>|<zero>] )`,"rotateY()":`rotateY( [<angle>|<zero>] )`,"rotateZ()":`rotateZ( [<angle>|<zero>] )`,"round()":`round( <rounding-strategy>? , <calc-sum> , <calc-sum> )`,"rounding-strategy":`nearest|up|down|to-zero`,"saturate()":`saturate( [<number>|<percentage>]? )`,"scale()":`scale( [<number>|<percentage>]#{1,2} )`,"scale3d()":`scale3d( [<number>|<percentage>]#{3} )`,"scaleX()":`scaleX( [<number>|<percentage>] )`,"scaleY()":`scaleY( [<number>|<percentage>] )`,"scaleZ()":`scaleZ( [<number>|<percentage>] )`,"scope-end":`<forgiving-selector-list>`,"scope-start":`<forgiving-selector-list>`,"scroll()":`scroll( [<scroller>||<axis>]? )`,scroller:`root|nearest|self`,"scroll-state-feature":`<media-query-list>`,"scroll-state-in-parens":`( <scroll-state-query> )|( <scroll-state-feature> )|<general-enclosed>`,"scroll-state-query":`not <scroll-state-in-parens>|<scroll-state-in-parens> [[and <scroll-state-in-parens>]*|[or <scroll-state-in-parens>]*]|<scroll-state-feature>`,"selector-list":`<complex-selector-list>`,"self-position":`center|start|end|self-start|self-end|flex-start|flex-end`,"sepia()":`sepia( [<number>|<percentage>]? )`,shadow:`inset?&&<length>{2,4}&&<color>?`,"shadow-t":`[<length>{2,3}&&<color>?]`,shape:`rect( <top> , <right> , <bottom> , <left> )|rect( <top> <right> <bottom> <left> )`,"shape-box":`<visual-box>|margin-box`,"side-or-corner":`[left|right]||[top|bottom]`,"sign()":`sign( <calc-sum> )`,"signed-integer":`<number-token>`,"signless-integer":`<number-token>`,"sin()":`sin( <calc-sum> )`,"single-animation":`<'animation-duration'>||<easing-function>||<'animation-delay'>||<single-animation-iteration-count>||<single-animation-direction>||<single-animation-fill-mode>||<single-animation-play-state>||[none|<keyframes-name>]||<single-animation-timeline>`,"single-animation-composition":`replace|add|accumulate`,"single-animation-direction":`normal|reverse|alternate|alternate-reverse`,"single-animation-fill-mode":`none|forwards|backwards|both`,"single-animation-iteration-count":`infinite|<number>`,"single-animation-play-state":`running|paused`,"single-animation-timeline":`auto|none|<dashed-ident>|<scroll()>|<view()>`,"single-transition":`[none|<single-transition-property>]||<time>||<easing-function>||<time>||<transition-behavior-value>`,"single-transition-property":`all|<custom-ident>`,size:`closest-side|farthest-side|closest-corner|farthest-corner|<length>|<length-percentage>{2}`,"size-feature":`<mf-plain>|<mf-boolean>|<mf-range>`,"skew()":`skew( [<angle>|<zero>] , [<angle>|<zero>]? )`,"skewX()":`skewX( [<angle>|<zero>] )`,"skewY()":`skewY( [<angle>|<zero>] )`,"sqrt()":`sqrt( <calc-sum> )`,"step-position":`jump-start|jump-end|jump-none|jump-both|start|end`,"step-easing-function":`step-start|step-end|<steps()>`,"steps()":`steps( <integer> , <step-position>? )`,"style-feature":`<declaration>`,"style-in-parens":`( <style-condition> )|( <style-feature> )|<general-enclosed>`,"style-query":`<style-condition>|<style-feature>`,"subclass-selector":`<id-selector>|<class-selector>|<attribute-selector>|<pseudo-class-selector>`,"superellipse()":`superellipse( [<number>|infinity|-infinity] )`,"supports-condition":`not <supports-in-parens>|<supports-in-parens> [and <supports-in-parens>]*|<supports-in-parens> [or <supports-in-parens>]*`,"supports-decl":`( <declaration> )`,"supports-feature":`<supports-decl>|<supports-selector-fn>`,"supports-in-parens":`( <supports-condition> )|<supports-feature>|<general-enclosed>`,"supports-selector-fn":`selector( <complex-selector> )`,symbol:`<string>|<image>|<custom-ident>`,"symbols()":`symbols( <symbols-type>? [<string>|<image>]+ )`,"symbols-type":`cyclic|numeric|alphabetic|symbolic|fixed`,"system-color":`AccentColor|AccentColorText|ActiveText|ButtonBorder|ButtonFace|ButtonText|Canvas|CanvasText|Field|FieldText|GrayText|Highlight|HighlightText|LinkText|Mark|MarkText|SelectedItem|SelectedItemText|VisitedText`,"system-family-name":`caption|icon|menu|message-box|small-caption|status-bar`,"tan()":`tan( <calc-sum> )`,target:`<target-counter()>|<target-counters()>|<target-text()>`,"target-counter()":`target-counter( [<string>|<url>] , <custom-ident> , <counter-style>? )`,"target-counters()":`target-counters( [<string>|<url>] , <custom-ident> , <string> , <counter-style>? )`,"target-text()":`target-text( [<string>|<url>] , [content|before|after|first-letter]? )`,"text-edge":`[text|cap|ex|ideographic|ideographic-ink] [text|alphabetic|ideographic|ideographic-ink]?`,"time-percentage":`<time>|<percentage>`,"timeline-range-name":`cover|contain|entry|exit|entry-crossing|exit-crossing`,"track-breadth":`<length-percentage>|<flex>|min-content|max-content|auto`,"track-list":`[<line-names>? [<track-size>|<track-repeat>]]+ <line-names>?`,"track-repeat":`repeat( [<integer [1,∞]>] , [<line-names>? <track-size>]+ <line-names>? )`,"track-size":`<track-breadth>|minmax( <inflexible-breadth> , <track-breadth> )|fit-content( <length-percentage> )`,"transform-function":`<matrix()>|<translate()>|<translateX()>|<translateY()>|<scale()>|<scaleX()>|<scaleY()>|<rotate()>|<skew()>|<skewX()>|<skewY()>|<matrix3d()>|<translate3d()>|<translateZ()>|<scale3d()>|<scaleZ()>|<rotate3d()>|<rotateX()>|<rotateY()>|<rotateZ()>|<perspective()>`,"transform-list":`<transform-function>+`,"transition-behavior-value":`normal|allow-discrete`,"translate()":`translate( <length-percentage> , <length-percentage>? )`,"translate3d()":`translate3d( <length-percentage> , <length-percentage> , <length> )`,"translateX()":`translateX( <length-percentage> )`,"translateY()":`translateY( <length-percentage> )`,"translateZ()":`translateZ( <length> )`,"try-size":`most-width|most-height|most-block-size|most-inline-size`,"try-tactic":`flip-block||flip-inline||flip-start`,"type-or-unit":`string|color|url|integer|number|length|angle|time|frequency|cap|ch|em|ex|ic|lh|rlh|rem|vb|vi|vw|vh|vmin|vmax|mm|Q|cm|in|pt|pc|px|deg|grad|rad|turn|ms|s|Hz|kHz|%`,"type-selector":`<wq-name>|<ns-prefix>? '*'`,"var()":`var( <custom-property-name> , <declaration-value>? )`,"view()":`view( [<axis>||<'view-timeline-inset'>]? )`,"viewport-length":`auto|<length-percentage>`,"visual-box":`content-box|padding-box|border-box`,"wq-name":`<ns-prefix>? <ident-token>`,"xywh()":`xywh( <length-percentage>{2} <length-percentage [0,∞]>{2} [round <'border-radius'>]? )`,xyz:`xyz|xyz-d50|xyz-d65`,"xyz-params":`<xyz-space> [<number>|<percentage>|none]{3}`,"-legacy-gradient":`<-webkit-gradient()>|<-legacy-linear-gradient>|<-legacy-repeating-linear-gradient>|<-legacy-radial-gradient>|<-legacy-repeating-radial-gradient>`,"-legacy-linear-gradient":`-moz-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-linear-gradient( <-legacy-linear-gradient-arguments> )`,"-legacy-repeating-linear-gradient":`-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )`,"-legacy-linear-gradient-arguments":`[<angle>|<side-or-corner>]? , <color-stop-list>`,"-legacy-radial-gradient":`-moz-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-radial-gradient( <-legacy-radial-gradient-arguments> )`,"-legacy-repeating-radial-gradient":`-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )`,"-legacy-radial-gradient-arguments":`[<position> ,]? [[[<-legacy-radial-gradient-shape>||<-legacy-radial-gradient-size>]|[<length>|<percentage>]{2}] ,]? <color-stop-list>`,"-legacy-radial-gradient-size":`closest-side|closest-corner|farthest-side|farthest-corner|contain|cover`,"-legacy-radial-gradient-shape":`circle|ellipse`,"-non-standard-font":`-apple-system-body|-apple-system-headline|-apple-system-subheadline|-apple-system-caption1|-apple-system-caption2|-apple-system-footnote|-apple-system-short-body|-apple-system-short-headline|-apple-system-short-subheadline|-apple-system-short-caption1|-apple-system-short-footnote|-apple-system-tall-body`,"-non-standard-color":`-moz-ButtonDefault|-moz-ButtonHoverFace|-moz-ButtonHoverText|-moz-CellHighlight|-moz-CellHighlightText|-moz-Combobox|-moz-ComboboxText|-moz-Dialog|-moz-DialogText|-moz-dragtargetzone|-moz-EvenTreeRow|-moz-Field|-moz-FieldText|-moz-html-CellHighlight|-moz-html-CellHighlightText|-moz-mac-accentdarkestshadow|-moz-mac-accentdarkshadow|-moz-mac-accentface|-moz-mac-accentlightesthighlight|-moz-mac-accentlightshadow|-moz-mac-accentregularhighlight|-moz-mac-accentregularshadow|-moz-mac-chrome-active|-moz-mac-chrome-inactive|-moz-mac-focusring|-moz-mac-menuselect|-moz-mac-menushadow|-moz-mac-menutextselect|-moz-MenuHover|-moz-MenuHoverText|-moz-MenuBarText|-moz-MenuBarHoverText|-moz-nativehyperlinktext|-moz-OddTreeRow|-moz-win-communicationstext|-moz-win-mediatext|-moz-activehyperlinktext|-moz-default-background-color|-moz-default-color|-moz-hyperlinktext|-moz-visitedhyperlinktext|-webkit-activelink|-webkit-focus-ring-color|-webkit-link|-webkit-text`,"-non-standard-image-rendering":`optimize-contrast|-moz-crisp-edges|-o-crisp-edges|-webkit-optimize-contrast`,"-non-standard-overflow":`overlay|-moz-scrollbars-none|-moz-scrollbars-horizontal|-moz-scrollbars-vertical|-moz-hidden-unscrollable`,"-non-standard-size":`intrinsic|min-intrinsic|-webkit-fill-available|-webkit-fit-content|-webkit-min-content|-webkit-max-content|-moz-available|-moz-fit-content|-moz-min-content|-moz-max-content`,"-webkit-gradient()":`-webkit-gradient( <-webkit-gradient-type> , <-webkit-gradient-point> [, <-webkit-gradient-point>|, <-webkit-gradient-radius> , <-webkit-gradient-point>] [, <-webkit-gradient-radius>]? [, <-webkit-gradient-color-stop>]* )`,"-webkit-gradient-color-stop":`from( <color> )|color-stop( [<number-zero-one>|<percentage>] , <color> )|to( <color> )`,"-webkit-gradient-point":`[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]`,"-webkit-gradient-radius":`<length>|<percentage>`,"-webkit-gradient-type":`linear|radial`,"-webkit-mask-box-repeat":`repeat|stretch|round`,"-ms-filter-function-list":`<-ms-filter-function>+`,"-ms-filter-function":`<-ms-filter-function-progid>|<-ms-filter-function-legacy>`,"-ms-filter-function-progid":`'progid:' [<ident-token> '.']* [<ident-token>|<function-token> <any-value>? )]`,"-ms-filter-function-legacy":`<ident-token>|<function-token> <any-value>? )`,age:`child|young|old`,"attr-name":`<wq-name>`,"attr-fallback":`<any-value>`,autospace:`no-autospace|[ideograph-alpha||ideograph-numeric||punctuation]||[insert|replace]`,bottom:`<length>|auto`,"generic-voice":`[<age>? <gender> <integer>?]`,gender:`male|female|neutral`,"generic-script-specific":`generic( kai )|generic( fangsong )|generic( nastaliq )`,"-non-standard-generic-family":`-apple-system|BlinkMacSystemFont`,"intrinsic-size-keyword":`min-content|max-content|fit-content`,left:`<length>|auto`,"device-cmyk()":`<legacy-device-cmyk-syntax>|<modern-device-cmyk-syntax>`,"legacy-device-cmyk-syntax":`device-cmyk( <number>#{4} )`,"modern-device-cmyk-syntax":`device-cmyk( <cmyk-component>{4} [/ [<alpha-value>|none]]? )`,"cmyk-component":`<number>|<percentage>|none`,"color-space":`<rectangular-color-space>|<polar-color-space>|<custom-color-space>`,right:`<length>|auto`,"forgiving-selector-list":`<complex-real-selector-list>`,"forgiving-relative-selector-list":`<relative-real-selector-list>`,"complex-real-selector-list":`<complex-real-selector>#`,"simple-selector-list":`<simple-selector>#`,"relative-real-selector-list":`<relative-real-selector>#`,"complex-selector-unit":`[<compound-selector>? <pseudo-compound-selector>*]!`,"complex-real-selector":`<compound-selector> [<combinator>? <compound-selector>]*`,"relative-real-selector":`<combinator>? <complex-real-selector>`,"pseudo-compound-selector":`<pseudo-element-selector> <pseudo-class-selector>*`,"simple-selector":`<type-selector>|<subclass-selector>`,"legacy-pseudo-element-selector":`':' [before|after|first-line|first-letter]`,"svg-length":`<percentage>|<length>|<number>`,"svg-writing-mode":`lr-tb|rl-tb|tb-rl|lr|rl|tb`,top:`<length>|auto`,x:`<number>`,y:`<number>`,declaration:`<ident-token> : <declaration-value>? ['!' important]?`,"declaration-list":`[<declaration>? ';']* <declaration>?`,url:`url( <string> <url-modifier>* )|<url-token>`,"url-modifier":`<ident>|<function-token> <any-value> )`,"number-zero-one":`<number [0,1]>`,"number-one-or-greater":`<number [1,∞]>`,"xyz-space":`xyz|xyz-d50|xyz-d65`,"style-condition":`not <style-in-parens>|<style-in-parens> [[and <style-in-parens>]*|[or <style-in-parens>]*]`,"-non-standard-display":`-ms-inline-flexbox|-ms-grid|-ms-inline-grid|-webkit-flex|-webkit-inline-flex|-webkit-box|-webkit-inline-box|-moz-inline-stack|-moz-box|-moz-inline-box`,"inset-area":`[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]`,syntax:`'*'|<syntax-component> [<syntax-combinator> <syntax-component>]*|<syntax-string>`,"syntax-component":`<syntax-single-component> <syntax-multiplier>?|'<' transform-list '>'`,"syntax-single-component":`'<' <syntax-type-name> '>'|<ident>`,"syntax-type-name":`angle|color|custom-ident|image|integer|length|length-percentage|number|percentage|resolution|string|time|url|transform-function`,"syntax-combinator":`'|'`,"syntax-multiplier":`'#'|'+'`,"syntax-string":`<string>`},properties:{"--*":`<declaration-value>`,"-ms-accelerator":`false|true`,"-ms-block-progression":`tb|rl|bt|lr`,"-ms-content-zoom-chaining":`none|chained`,"-ms-content-zoom-limit":`<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>`,"-ms-content-zoom-limit-max":`<percentage>`,"-ms-content-zoom-limit-min":`<percentage>`,"-ms-content-zoom-snap":`<'-ms-content-zoom-snap-type'>||<'-ms-content-zoom-snap-points'>`,"-ms-content-zoom-snap-points":`snapInterval( <percentage> , <percentage> )|snapList( <percentage># )`,"-ms-content-zoom-snap-type":`none|proximity|mandatory`,"-ms-content-zooming":`none|zoom`,"-ms-filter":`<string>`,"-ms-flow-from":`[none|<custom-ident>]#`,"-ms-flow-into":`[none|<custom-ident>]#`,"-ms-grid-columns":`none|<track-list>|<auto-track-list>`,"-ms-grid-rows":`none|<track-list>|<auto-track-list>`,"-ms-high-contrast-adjust":`auto|none`,"-ms-hyphenate-limit-chars":`auto|<integer>{1,3}`,"-ms-hyphenate-limit-lines":`no-limit|<integer>`,"-ms-hyphenate-limit-zone":`<percentage>|<length>`,"-ms-ime-align":`auto|after`,"-ms-overflow-style":`auto|none|scrollbar|-ms-autohiding-scrollbar`,"-ms-scroll-chaining":`chained|none`,"-ms-scroll-limit":`<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>`,"-ms-scroll-limit-x-max":`auto|<length>`,"-ms-scroll-limit-x-min":`<length>`,"-ms-scroll-limit-y-max":`auto|<length>`,"-ms-scroll-limit-y-min":`<length>`,"-ms-scroll-rails":`none|railed`,"-ms-scroll-snap-points-x":`snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )`,"-ms-scroll-snap-points-y":`snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )`,"-ms-scroll-snap-type":`none|proximity|mandatory`,"-ms-scroll-snap-x":`<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>`,"-ms-scroll-snap-y":`<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>`,"-ms-scroll-translation":`none|vertical-to-horizontal`,"-ms-scrollbar-3dlight-color":`<color>`,"-ms-scrollbar-arrow-color":`<color>`,"-ms-scrollbar-base-color":`<color>`,"-ms-scrollbar-darkshadow-color":`<color>`,"-ms-scrollbar-face-color":`<color>`,"-ms-scrollbar-highlight-color":`<color>`,"-ms-scrollbar-shadow-color":`<color>`,"-ms-scrollbar-track-color":`<color>`,"-ms-text-autospace":`none|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space`,"-ms-touch-select":`grippers|none`,"-ms-user-select":`none|element|text`,"-ms-wrap-flow":`auto|both|start|end|maximum|clear`,"-ms-wrap-margin":`<length>`,"-ms-wrap-through":`wrap|none`,"-moz-appearance":`none|button|button-arrow-down|button-arrow-next|button-arrow-previous|button-arrow-up|button-bevel|button-focus|caret|checkbox|checkbox-container|checkbox-label|checkmenuitem|dualbutton|groupbox|listbox|listitem|menuarrow|menubar|menucheckbox|menuimage|menuitem|menuitemtext|menulist|menulist-button|menulist-text|menulist-textfield|menupopup|menuradio|menuseparator|meterbar|meterchunk|progressbar|progressbar-vertical|progresschunk|progresschunk-vertical|radio|radio-container|radio-label|radiomenuitem|range|range-thumb|resizer|resizerpanel|scale-horizontal|scalethumbend|scalethumb-horizontal|scalethumbstart|scalethumbtick|scalethumb-vertical|scale-vertical|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|separator|sheet|spinner|spinner-downbutton|spinner-textfield|spinner-upbutton|splitter|statusbar|statusbarpanel|tab|tabpanel|tabpanels|tab-scroll-arrow-back|tab-scroll-arrow-forward|textfield|textfield-multiline|toolbar|toolbarbutton|toolbarbutton-dropdown|toolbargripper|toolbox|tooltip|treeheader|treeheadercell|treeheadersortarrow|treeitem|treeline|treetwisty|treetwistyopen|treeview|-moz-mac-unified-toolbar|-moz-win-borderless-glass|-moz-win-browsertabbar-toolbox|-moz-win-communicationstext|-moz-win-communications-toolbox|-moz-win-exclude-glass|-moz-win-glass|-moz-win-mediatext|-moz-win-media-toolbox|-moz-window-button-box|-moz-window-button-box-maximized|-moz-window-button-close|-moz-window-button-maximize|-moz-window-button-minimize|-moz-window-button-restore|-moz-window-frame-bottom|-moz-window-frame-left|-moz-window-frame-right|-moz-window-titlebar|-moz-window-titlebar-maximized`,"-moz-binding":`<url>|none`,"-moz-border-bottom-colors":`<color>+|none`,"-moz-border-left-colors":`<color>+|none`,"-moz-border-right-colors":`<color>+|none`,"-moz-border-top-colors":`<color>+|none`,"-moz-context-properties":`none|[fill|fill-opacity|stroke|stroke-opacity]#`,"-moz-float-edge":`border-box|content-box|margin-box|padding-box`,"-moz-force-broken-image-icon":`0|1`,"-moz-orient":`inline|block|horizontal|vertical`,"-moz-outline-radius":`<outline-radius>{1,4} [/ <outline-radius>{1,4}]?`,"-moz-outline-radius-bottomleft":`<outline-radius>`,"-moz-outline-radius-bottomright":`<outline-radius>`,"-moz-outline-radius-topleft":`<outline-radius>`,"-moz-outline-radius-topright":`<outline-radius>`,"-moz-stack-sizing":`ignore|stretch-to-fit`,"-moz-text-blink":`none|blink`,"-moz-user-focus":`ignore|normal|select-after|select-before|select-menu|select-same|select-all|none`,"-moz-user-input":`auto|none|enabled|disabled`,"-moz-user-modify":`read-only|read-write|write-only`,"-moz-window-dragging":`drag|no-drag`,"-moz-window-shadow":`default|menu|tooltip|sheet|none`,"-webkit-appearance":`none|button|button-bevel|caps-lock-indicator|caret|checkbox|default-button|inner-spin-button|listbox|listitem|media-controls-background|media-controls-fullscreen-background|media-current-time-display|media-enter-fullscreen-button|media-exit-fullscreen-button|media-fullscreen-button|media-mute-button|media-overlay-play-button|media-play-button|media-seek-back-button|media-seek-forward-button|media-slider|media-sliderthumb|media-time-remaining-display|media-toggle-closed-captions-button|media-volume-slider|media-volume-slider-container|media-volume-sliderthumb|menulist|menulist-button|menulist-text|menulist-textfield|meter|progress-bar|progress-bar-value|push-button|radio|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbargripper-horizontal|scrollbargripper-vertical|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|searchfield-cancel-button|searchfield-decoration|searchfield-results-button|searchfield-results-decoration|slider-horizontal|slider-vertical|sliderthumb-horizontal|sliderthumb-vertical|square-button|textarea|textfield|-apple-pay-button`,"-webkit-border-before":`<'border-width'>||<'border-style'>||<color>`,"-webkit-border-before-color":`<color>`,"-webkit-border-before-style":`<'border-style'>`,"-webkit-border-before-width":`<'border-width'>`,"-webkit-box-reflect":`[above|below|right|left]? <length>? <image>?`,"-webkit-line-clamp":`none|<integer>`,"-webkit-mask":`[<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||[<visual-box>|border|padding|content|text]||[<visual-box>|border|padding|content]]#`,"-webkit-mask-attachment":`<attachment>#`,"-webkit-mask-clip":`[<coord-box>|no-clip|border|padding|content|text]#`,"-webkit-mask-composite":`<composite-style>#`,"-webkit-mask-image":`<mask-reference>#`,"-webkit-mask-origin":`[<coord-box>|border|padding|content]#`,"-webkit-mask-position":`<position>#`,"-webkit-mask-position-x":`[<length-percentage>|left|center|right]#`,"-webkit-mask-position-y":`[<length-percentage>|top|center|bottom]#`,"-webkit-mask-repeat":`<repeat-style>#`,"-webkit-mask-repeat-x":`repeat|no-repeat|space|round`,"-webkit-mask-repeat-y":`repeat|no-repeat|space|round`,"-webkit-mask-size":`<bg-size>#`,"-webkit-overflow-scrolling":`auto|touch`,"-webkit-tap-highlight-color":`<color>`,"-webkit-text-fill-color":`<color>`,"-webkit-text-stroke":`<length>||<color>`,"-webkit-text-stroke-color":`<color>`,"-webkit-text-stroke-width":`<length>`,"-webkit-touch-callout":`default|none`,"-webkit-user-modify":`read-only|read-write|read-write-plaintext-only`,"-webkit-user-select":`auto|none|text|all`,"accent-color":`auto|<color>`,"align-content":`normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>`,"align-items":`normal|stretch|<baseline-position>|[<overflow-position>? <self-position>]|anchor-center`,"align-self":`auto|normal|stretch|<baseline-position>|<overflow-position>? <self-position>|anchor-center`,"align-tracks":`[normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>]#`,"alignment-baseline":`auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical`,all:`initial|inherit|unset|revert|revert-layer`,"anchor-name":`none|<dashed-ident>#`,"anchor-scope":`none|all|<dashed-ident>#`,animation:`<single-animation>#`,"animation-composition":`<single-animation-composition>#`,"animation-delay":`<time>#`,"animation-direction":`<single-animation-direction>#`,"animation-duration":`[auto|<time [0s,∞]>]#`,"animation-fill-mode":`<single-animation-fill-mode>#`,"animation-iteration-count":`<single-animation-iteration-count>#`,"animation-name":`[none|<keyframes-name>]#`,"animation-play-state":`<single-animation-play-state>#`,"animation-range":`[<'animation-range-start'> <'animation-range-end'>?]#`,"animation-range-end":`[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#`,"animation-range-start":`[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#`,"animation-timeline":`<single-animation-timeline>#`,"animation-timing-function":`<easing-function>#`,"animation-trigger":`[none|[<dashed-ident> <animation-action>+]+]#`,appearance:`none|auto|<compat-auto>|<compat-special>`,"aspect-ratio":`auto||<ratio>`,"backdrop-filter":`none|<filter-value-list>`,"backface-visibility":`visible|hidden`,background:`<bg-layer>#? , <final-bg-layer>`,"background-attachment":`<attachment>#`,"background-blend-mode":`<blend-mode>#`,"background-clip":`<bg-clip>#`,"background-color":`<color>`,"background-image":`<bg-image>#`,"background-origin":`<visual-box>#`,"background-position":`<bg-position>#`,"background-position-x":`[center|[[left|right|x-start|x-end]? <length-percentage>?]!]#`,"background-position-y":`[center|[[top|bottom|y-start|y-end]? <length-percentage>?]!]#`,"background-repeat":`<repeat-style>#`,"background-size":`<bg-size>#`,"baseline-shift":`baseline|sub|super|<svg-length>`,"baseline-source":`auto|first|last`,"block-size":`<'width'>`,border:`<line-width>||<line-style>||<color>`,"border-block":`<'border-block-start'>`,"border-block-color":`<'border-top-color'>{1,2}`,"border-block-end":`<'border-top-width'>||<'border-top-style'>||<color>`,"border-block-end-color":`<'border-top-color'>`,"border-block-end-style":`<'border-top-style'>`,"border-block-end-width":`<'border-top-width'>`,"border-block-start":`<'border-top-width'>||<'border-top-style'>||<color>`,"border-block-start-color":`<'border-top-color'>`,"border-block-start-style":`<'border-top-style'>`,"border-block-start-width":`<'border-top-width'>`,"border-block-style":`<'border-top-style'>{1,2}`,"border-block-width":`<'border-top-width'>{1,2}`,"border-bottom":`<line-width>||<line-style>||<color>`,"border-bottom-color":`<'border-top-color'>`,"border-bottom-left-radius":`<length-percentage [0,∞]>{1,2}`,"border-bottom-right-radius":`<length-percentage [0,∞]>{1,2}`,"border-bottom-style":`<line-style>`,"border-bottom-width":`<line-width>`,"border-collapse":`separate|collapse`,"border-color":`<color>{1,4}`,"border-end-end-radius":`<'border-top-left-radius'>`,"border-end-start-radius":`<'border-top-left-radius'>`,"border-image":`<'border-image-source'>||<'border-image-slice'> [/ <'border-image-width'>|/ <'border-image-width'>? / <'border-image-outset'>]?||<'border-image-repeat'>`,"border-image-outset":`[<length [0,∞]>|<number [0,∞]>]{1,4}`,"border-image-repeat":`[stretch|repeat|round|space]{1,2}`,"border-image-slice":`[<number [0,∞]>|<percentage [0,∞]>]{1,4}&&fill?`,"border-image-source":`none|<image>`,"border-image-width":`[<length-percentage [0,∞]>|<number [0,∞]>|auto]{1,4}`,"border-inline":`<'border-block-start'>`,"border-inline-color":`<'border-top-color'>{1,2}`,"border-inline-end":`<'border-top-width'>||<'border-top-style'>||<color>`,"border-inline-end-color":`<'border-top-color'>`,"border-inline-end-style":`<'border-top-style'>`,"border-inline-end-width":`<'border-top-width'>`,"border-inline-start":`<'border-top-width'>||<'border-top-style'>||<color>`,"border-inline-start-color":`<'border-top-color'>`,"border-inline-start-style":`<'border-top-style'>`,"border-inline-start-width":`<'border-top-width'>`,"border-inline-style":`<'border-top-style'>{1,2}`,"border-inline-width":`<'border-top-width'>{1,2}`,"border-left":`<line-width>||<line-style>||<color>`,"border-left-color":`<color>`,"border-left-style":`<line-style>`,"border-left-width":`<line-width>`,"border-radius":`<length-percentage [0,∞]>{1,4} [/ <length-percentage [0,∞]>{1,4}]?`,"border-right":`<line-width>||<line-style>||<color>`,"border-right-color":`<color>`,"border-right-style":`<line-style>`,"border-right-width":`<line-width>`,"border-spacing":`<length>{1,2}`,"border-start-end-radius":`<'border-top-left-radius'>`,"border-start-start-radius":`<'border-top-left-radius'>`,"border-style":`<line-style>{1,4}`,"border-top":`<line-width>||<line-style>||<color>`,"border-top-color":`<color>`,"border-top-left-radius":`<length-percentage [0,∞]>{1,2}`,"border-top-right-radius":`<length-percentage [0,∞]>{1,2}`,"border-top-style":`<line-style>`,"border-top-width":`<line-width>`,"border-width":`<line-width>{1,4}`,bottom:`auto|<length-percentage>|<anchor()>|<anchor-size()>`,"box-align":`start|center|end|baseline|stretch`,"box-decoration-break":`slice|clone`,"box-direction":`normal|reverse|inherit`,"box-flex":`<number>`,"box-flex-group":`<integer>`,"box-lines":`single|multiple`,"box-ordinal-group":`<integer>`,"box-orient":`horizontal|vertical|inline-axis|block-axis|inherit`,"box-pack":`start|center|end|justify`,"box-shadow":`none|<shadow>#`,"box-sizing":`content-box|border-box`,"break-after":`auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region`,"break-before":`auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region`,"break-inside":`auto|avoid|avoid-page|avoid-column|avoid-region`,"caption-side":`top|bottom`,caret:`<'caret-color'>||<'caret-animation'>||<'caret-shape'>`,"caret-animation":`auto|manual`,"caret-color":`auto|<color>`,"caret-shape":`auto|bar|block|underscore`,clear:`none|left|right|both|inline-start|inline-end`,clip:`<shape>|auto`,"clip-path":`<clip-source>|[<basic-shape>||<geometry-box>]|none`,"clip-rule":`nonzero|evenodd`,color:`<color>`,"color-interpolation-filters":`auto|sRGB|linearRGB`,"color-scheme":`normal|[light|dark|<custom-ident>]+&&only?`,"column-count":`<integer>|auto`,"column-fill":`auto|balance`,"column-gap":`normal|<length-percentage>`,"column-height":`auto|<length [0,∞]>`,"column-rule":`<'column-rule-width'>||<'column-rule-style'>||<'column-rule-color'>`,"column-rule-color":`<color>`,"column-rule-style":`<'border-style'>`,"column-rule-width":`<'border-width'>`,"column-span":`none|all`,"column-width":`auto|<length [0,∞]>`,"column-wrap":`auto|nowrap|wrap`,columns:`[<'column-width'>||<'column-count'>] [/ <'column-height'>]?`,contain:`none|strict|content|[[size||inline-size]||layout||style||paint]`,"contain-intrinsic-block-size":`auto? [none|<length>]`,"contain-intrinsic-height":`auto? [none|<length>]`,"contain-intrinsic-inline-size":`auto? [none|<length>]`,"contain-intrinsic-size":`[auto? [none|<length>]]{1,2}`,"contain-intrinsic-width":`auto? [none|<length>]`,container:`<'container-name'> [/ <'container-type'>]?`,"container-name":`none|<custom-ident>+`,"container-type":`normal||[size|inline-size]`,content:`normal|none|[<content-replacement>|<content-list>] [/ [<string>|<counter>|<attr()>]+]?`,"content-visibility":`visible|auto|hidden`,"corner-block-end-shape":`<corner-shape-value>{1,2}`,"corner-block-start-shape":`<corner-shape-value>{1,2}`,"corner-bottom-shape":`<corner-shape-value>{1,2}`,"corner-bottom-left-shape":`<corner-shape-value>`,"corner-bottom-right-shape":`<corner-shape-value>`,"corner-end-end-shape":`<corner-shape-value>`,"corner-end-start-shape":`<corner-shape-value>`,"corner-inline-end-shape":`<corner-shape-value>{1,2}`,"corner-inline-start-shape":`<corner-shape-value>{1,2}`,"corner-left-shape":`<corner-shape-value>{1,2}`,"corner-right-shape":`<corner-shape-value>{1,2}`,"corner-shape":`<corner-shape-value>{1,4}`,"corner-start-start-shape":`<corner-shape-value>`,"corner-start-end-shape":`<corner-shape-value>`,"corner-top-shape":`<corner-shape-value>{1,2}`,"corner-top-left-shape":`<corner-shape-value>`,"corner-top-right-shape":`<corner-shape-value>`,"counter-increment":`[<counter-name> <integer>?]+|none`,"counter-reset":`[<counter-name> <integer>?|<reversed-counter-name> <integer>?]+|none`,"counter-set":`[<counter-name> <integer>?]+|none`,cursor:`[[<url> [<x> <y>]? ,]* [auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing|hand|-webkit-grab|-webkit-grabbing|-webkit-zoom-in|-webkit-zoom-out|-moz-grab|-moz-grabbing|-moz-zoom-in|-moz-zoom-out]]`,cx:`<length>|<percentage>`,cy:`<length>|<percentage>`,d:`none|path( <string> )`,direction:`ltr|rtl`,display:`[<display-outside>||<display-inside>]|<display-listitem>|<display-internal>|<display-box>|<display-legacy>|<-non-standard-display>`,"dominant-baseline":`auto|use-script|no-change|reset-size|ideographic|alphabetic|hanging|mathematical|central|middle|text-after-edge|text-before-edge`,"dynamic-range-limit":`standard|no-limit|constrained|<dynamic-range-limit-mix()>`,"empty-cells":`show|hide`,"field-sizing":`content|fixed`,fill:`<paint>`,"fill-opacity":`<number-zero-one>|<percentage>`,"fill-rule":`nonzero|evenodd`,filter:`none|<filter-value-list>|<-ms-filter-function-list>`,flex:`none|[<'flex-grow'> <'flex-shrink'>?||<'flex-basis'>]`,"flex-basis":`content|<'width'>`,"flex-direction":`row|row-reverse|column|column-reverse`,"flex-flow":`<'flex-direction'>||<'flex-wrap'>`,"flex-grow":`<number>`,"flex-shrink":`<number>`,"flex-wrap":`nowrap|wrap|wrap-reverse`,float:`left|right|none|inline-start|inline-end`,"flood-color":`<color>`,"flood-opacity":`<'opacity'>`,font:`[[<'font-style'>||<font-variant-css2>||<'font-weight'>||<font-width-css3>]? <'font-size'> [/ <'line-height'>]? <'font-family'>#]|<system-family-name>|<-non-standard-font>`,"font-family":`[<family-name>|<generic-family>]#`,"font-feature-settings":`normal|<feature-tag-value>#`,"font-kerning":`auto|normal|none`,"font-language-override":`normal|<string>`,"font-optical-sizing":`auto|none`,"font-palette":`normal|light|dark|<palette-identifier>|<palette-mix()>`,"font-size":`<absolute-size>|<relative-size>|<length-percentage [0,∞]>|math`,"font-size-adjust":`none|[ex-height|cap-height|ch-width|ic-width|ic-height]? [from-font|<number>]`,"font-smooth":`auto|never|always|<absolute-size>|<length>`,"font-stretch":`<font-stretch-absolute>`,"font-style":`normal|italic|oblique <angle>?`,"font-synthesis":`none|[weight||style||small-caps||position]`,"font-synthesis-position":`auto|none`,"font-synthesis-small-caps":`auto|none`,"font-synthesis-style":`auto|none`,"font-synthesis-weight":`auto|none`,"font-variant":`normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]`,"font-variant-alternates":`normal|[stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )]`,"font-variant-caps":`normal|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps`,"font-variant-east-asian":`normal|[<east-asian-variant-values>||<east-asian-width-values>||ruby]`,"font-variant-emoji":`normal|text|emoji|unicode`,"font-variant-ligatures":`normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>]`,"font-variant-numeric":`normal|[<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero]`,"font-variant-position":`normal|sub|super`,"font-variation-settings":`normal|[<string> <number>]#`,"font-weight":`<font-weight-absolute>|bolder|lighter`,"font-width":`normal|<percentage [0,∞]>|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded`,"forced-color-adjust":`auto|none|preserve-parent-color`,gap:`<'row-gap'> <'column-gap'>?`,grid:`<'grid-template'>|<'grid-template-rows'> / [auto-flow&&dense?] <'grid-auto-columns'>?|[auto-flow&&dense?] <'grid-auto-rows'>? / <'grid-template-columns'>`,"grid-area":`<grid-line> [/ <grid-line>]{0,3}`,"grid-auto-columns":`<track-size>+`,"grid-auto-flow":`[row|column]||dense`,"grid-auto-rows":`<track-size>+`,"grid-column":`<grid-line> [/ <grid-line>]?`,"grid-column-end":`<grid-line>`,"grid-column-gap":`<length-percentage>`,"grid-column-start":`<grid-line>`,"grid-gap":`<'grid-row-gap'> <'grid-column-gap'>?`,"grid-row":`<grid-line> [/ <grid-line>]?`,"grid-row-end":`<grid-line>`,"grid-row-gap":`<length-percentage>`,"grid-row-start":`<grid-line>`,"grid-template":`none|[<'grid-template-rows'> / <'grid-template-columns'>]|[<line-names>? <string> <track-size>? <line-names>?]+ [/ <explicit-track-list>]?`,"grid-template-areas":`none|<string>+`,"grid-template-columns":`none|<track-list>|<auto-track-list>|subgrid <line-name-list>?`,"grid-template-rows":`none|<track-list>|<auto-track-list>|subgrid <line-name-list>?`,"hanging-punctuation":`none|[first||[force-end|allow-end]||last]`,height:`auto|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>`,"hyphenate-character":`auto|<string>`,"hyphenate-limit-chars":`[auto|<integer>]{1,3}`,hyphens:`none|manual|auto`,"image-orientation":`from-image|<angle>|[<angle>? flip]`,"image-rendering":`auto|crisp-edges|pixelated|smooth|optimizeSpeed|optimizeQuality|<-non-standard-image-rendering>`,"image-resolution":`[from-image||<resolution>]&&snap?`,"ime-mode":`auto|normal|active|inactive|disabled`,"initial-letter":`normal|[<number> <integer>?]`,"initial-letter-align":`[auto|alphabetic|hanging|ideographic]`,"inline-size":`<'width'>`,inset:`<'top'>{1,4}`,"inset-block":`<'top'>{1,2}`,"inset-block-end":`<'top'>`,"inset-block-start":`<'top'>`,"inset-inline":`<'top'>{1,2}`,"inset-inline-end":`<'top'>`,"inset-inline-start":`<'top'>`,"interpolate-size":`numeric-only|allow-keywords`,isolation:`auto|isolate`,interactivity:`auto|inert`,"interest-delay":`<'interest-delay-start'>{1,2}`,"interest-delay-end":`normal|<time>`,"interest-delay-start":`normal|<time>`,"justify-content":`normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]`,"justify-items":`normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|legacy|legacy&&[left|right|center]|anchor-center`,"justify-self":`auto|normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|anchor-center`,"justify-tracks":`[normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]]#`,left:`auto|<length-percentage>|<anchor()>|<anchor-size()>`,"letter-spacing":`normal|<length-percentage>`,"lighting-color":`<color>`,"line-break":`auto|loose|normal|strict|anywhere`,"line-clamp":`none|<integer>`,"line-height":`normal|<number>|<length>|<percentage>`,"line-height-step":`<length>`,"list-style":`<'list-style-type'>||<'list-style-position'>||<'list-style-image'>`,"list-style-image":`<image>|none`,"list-style-position":`inside|outside`,"list-style-type":`<counter-style>|<string>|none`,margin:`<'margin-top'>{1,4}`,"margin-block":`<'margin-top'>{1,2}`,"margin-block-end":`<'margin-top'>`,"margin-block-start":`<'margin-top'>`,"margin-bottom":`<length-percentage>|auto|<anchor-size()>`,"margin-inline":`<'margin-top'>{1,2}`,"margin-inline-end":`<'margin-top'>`,"margin-inline-start":`<'margin-top'>`,"margin-left":`<length-percentage>|auto|<anchor-size()>`,"margin-right":`<length-percentage>|auto|<anchor-size()>`,"margin-top":`<length-percentage>|auto|<anchor-size()>`,"margin-trim":`none|in-flow|all`,marker:`none|<url>`,"marker-end":`none|<url>`,"marker-mid":`none|<url>`,"marker-start":`none|<url>`,mask:`<mask-layer>#`,"mask-border":`<'mask-border-source'>||<'mask-border-slice'> [/ <'mask-border-width'>? [/ <'mask-border-outset'>]?]?||<'mask-border-repeat'>||<'mask-border-mode'>`,"mask-border-mode":`luminance|alpha`,"mask-border-outset":`[<length>|<number>]{1,4}`,"mask-border-repeat":`[stretch|repeat|round|space]{1,2}`,"mask-border-slice":`<number-percentage>{1,4} fill?`,"mask-border-source":`none|<image>`,"mask-border-width":`[<length-percentage>|<number>|auto]{1,4}`,"mask-clip":`[<coord-box>|no-clip]#`,"mask-composite":`<compositing-operator>#`,"mask-image":`<mask-reference>#`,"mask-mode":`<masking-mode>#`,"mask-origin":`<coord-box>#`,"mask-position":`<position>#`,"mask-repeat":`<repeat-style>#`,"mask-size":`<bg-size>#`,"mask-type":`luminance|alpha`,"masonry-auto-flow":`[pack|next]||[definite-first|ordered]`,"math-depth":`auto-add|add( <integer> )|<integer>`,"math-shift":`normal|compact`,"math-style":`normal|compact`,"max-block-size":`<'max-width'>`,"max-height":`none|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>`,"max-inline-size":`<'max-width'>`,"max-lines":`none|<integer>`,"max-width":`none|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>`,"min-block-size":`<'min-width'>`,"min-height":`auto|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>`,"min-inline-size":`<'min-width'>`,"min-width":`auto|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>`,"mix-blend-mode":`<blend-mode>|plus-darker|plus-lighter`,"object-fit":`fill|contain|cover|none|scale-down`,"object-position":`<position>`,"object-view-box":`none|<basic-shape-rect>`,offset:`[<'offset-position'>? [<'offset-path'> [<'offset-distance'>||<'offset-rotate'>]?]?]! [/ <'offset-anchor'>]?`,"offset-anchor":`auto|<position>`,"offset-distance":`<length-percentage>`,"offset-path":`none|<offset-path>||<coord-box>`,"offset-position":`normal|auto|<position>`,"offset-rotate":`[auto|reverse]||<angle>`,opacity:`<opacity-value>`,order:`<integer>`,orphans:`<integer>`,outline:`<'outline-width'>||<'outline-style'>||<'outline-color'>`,"outline-color":`auto|<color>`,"outline-offset":`<length>`,"outline-style":`auto|<outline-line-style>`,"outline-width":`<line-width>`,overflow:`[visible|hidden|clip|scroll|auto]{1,2}|<-non-standard-overflow>`,"overflow-anchor":`auto|none`,"overflow-block":`visible|hidden|clip|scroll|auto|<-non-standard-overflow>`,"overflow-clip-box":`padding-box|content-box`,"overflow-clip-margin":`<visual-box>||<length [0,∞]>`,"overflow-inline":`visible|hidden|clip|scroll|auto|<-non-standard-overflow>`,"overflow-wrap":`normal|break-word|anywhere`,"overflow-x":`visible|hidden|clip|scroll|auto|<-non-standard-overflow>`,"overflow-y":`visible|hidden|clip|scroll|auto|<-non-standard-overflow>`,overlay:`none|auto`,"overscroll-behavior":`[contain|none|auto]{1,2}`,"overscroll-behavior-block":`contain|none|auto`,"overscroll-behavior-inline":`contain|none|auto`,"overscroll-behavior-x":`contain|none|auto`,"overscroll-behavior-y":`contain|none|auto`,padding:`<'padding-top'>{1,4}`,"padding-block":`<'padding-top'>{1,2}`,"padding-block-end":`<'padding-top'>`,"padding-block-start":`<'padding-top'>`,"padding-bottom":`<length-percentage [0,∞]>`,"padding-inline":`<'padding-top'>{1,2}`,"padding-inline-end":`<'padding-top'>`,"padding-inline-start":`<'padding-top'>`,"padding-left":`<length-percentage [0,∞]>`,"padding-right":`<length-percentage [0,∞]>`,"padding-top":`<length-percentage [0,∞]>`,page:`auto|<custom-ident>`,"page-break-after":`auto|always|avoid|left|right|recto|verso`,"page-break-before":`auto|always|avoid|left|right|recto|verso`,"page-break-inside":`auto|avoid`,"paint-order":`normal|[fill||stroke||markers]`,perspective:`none|<length>`,"perspective-origin":`<position>`,"place-content":`<'align-content'> <'justify-content'>?`,"place-items":`<'align-items'> <'justify-items'>?`,"place-self":`<'align-self'> <'justify-self'>?`,"pointer-events":`auto|none|visiblePainted|visibleFill|visibleStroke|visible|painted|fill|stroke|all|inherit`,position:`static|relative|absolute|sticky|fixed|-webkit-sticky`,"position-anchor":`auto|none|<anchor-name>`,"position-area":`none|<position-area>`,"position-try":`<'position-try-order'>? <'position-try-fallbacks'>`,"position-try-fallbacks":`none|[[<dashed-ident>||<try-tactic>]|<'position-area'>]#`,"position-try-order":`normal|<try-size>`,"position-visibility":`always|[anchors-valid||anchors-visible||no-overflow]`,"print-color-adjust":`economy|exact`,quotes:`none|auto|[<string> <string>]+`,r:`<length>|<percentage>`,"reading-flow":`normal|source-order|flex-visual|flex-flow|grid-rows|grid-columns|grid-order`,"reading-order":`<integer>`,resize:`none|both|horizontal|vertical|block|inline`,right:`auto|<length-percentage>|<anchor()>|<anchor-size()>`,rotate:`none|<angle>|[x|y|z|<number>{3}]&&<angle>`,"row-gap":`normal|<length-percentage>`,"ruby-align":`start|center|space-between|space-around`,"ruby-merge":`separate|collapse|auto`,"ruby-overhang":`auto|none`,"ruby-position":`[alternate||[over|under]]|inter-character`,rx:`<length>|<percentage>`,ry:`<length>|<percentage>`,scale:`none|[<number>|<percentage>]{1,3}`,"scroll-behavior":`auto|smooth`,"scroll-initial-target":`none|nearest`,"scroll-margin":`<length>{1,4}`,"scroll-margin-block":`<length>{1,2}`,"scroll-margin-block-end":`<length>`,"scroll-margin-block-start":`<length>`,"scroll-margin-bottom":`<length>`,"scroll-margin-inline":`<length>{1,2}`,"scroll-margin-inline-end":`<length>`,"scroll-margin-inline-start":`<length>`,"scroll-margin-left":`<length>`,"scroll-margin-right":`<length>`,"scroll-margin-top":`<length>`,"scroll-marker-group":`none|before|after`,"scroll-padding":`[auto|<length-percentage>]{1,4}`,"scroll-padding-block":`[auto|<length-percentage>]{1,2}`,"scroll-padding-block-end":`auto|<length-percentage>`,"scroll-padding-block-start":`auto|<length-percentage>`,"scroll-padding-bottom":`auto|<length-percentage>`,"scroll-padding-inline":`[auto|<length-percentage>]{1,2}`,"scroll-padding-inline-end":`auto|<length-percentage>`,"scroll-padding-inline-start":`auto|<length-percentage>`,"scroll-padding-left":`auto|<length-percentage>`,"scroll-padding-right":`auto|<length-percentage>`,"scroll-padding-top":`auto|<length-percentage>`,"scroll-snap-align":`[none|start|end|center]{1,2}`,"scroll-snap-coordinate":`none|<position>#`,"scroll-snap-destination":`<position>`,"scroll-snap-points-x":`none|repeat( <length-percentage> )`,"scroll-snap-points-y":`none|repeat( <length-percentage> )`,"scroll-snap-stop":`normal|always`,"scroll-snap-type":`none|[x|y|block|inline|both] [mandatory|proximity]?`,"scroll-snap-type-x":`none|mandatory|proximity`,"scroll-snap-type-y":`none|mandatory|proximity`,"scroll-target-group":`none|auto`,"scroll-timeline":`[<'scroll-timeline-name'> <'scroll-timeline-axis'>?]#`,"scroll-timeline-axis":`[block|inline|x|y]#`,"scroll-timeline-name":`[none|<dashed-ident>]#`,"scrollbar-color":`auto|<color>{2}`,"scrollbar-gutter":`auto|stable&&both-edges?`,"scrollbar-width":`auto|thin|none`,"shape-image-threshold":`<opacity-value>`,"shape-margin":`<length-percentage>`,"shape-outside":`none|[<shape-box>||<basic-shape>]|<image>`,"shape-rendering":`auto|optimizeSpeed|crispEdges|geometricPrecision`,"speak-as":`normal|spell-out||digits||[literal-punctuation|no-punctuation]`,"stop-color":`<'color'>`,"stop-opacity":`<'opacity'>`,stroke:`<paint>`,"stroke-color":`<color>`,"stroke-dasharray":`none|[<svg-length>+]#`,"stroke-dashoffset":`<svg-length>`,"stroke-linecap":`butt|round|square`,"stroke-linejoin":`miter|round|bevel`,"stroke-miterlimit":`<number-one-or-greater>`,"stroke-opacity":`<'opacity'>`,"stroke-width":`<svg-length>`,"tab-size":`<integer>|<length>`,"table-layout":`auto|fixed`,"text-align":`start|end|left|right|center|justify|match-parent`,"text-align-last":`auto|start|end|left|right|center|justify`,"text-anchor":`start|middle|end`,"text-autospace":`normal|<autospace>|auto`,"text-box":`normal|<'text-box-trim'>||<'text-box-edge'>`,"text-box-edge":`auto|<text-edge>`,"text-box-trim":`none|trim-start|trim-end|trim-both`,"text-combine-upright":`none|all|[digits <integer>?]`,"text-decoration":`<'text-decoration-line'>||<'text-decoration-style'>||<'text-decoration-color'>||<'text-decoration-thickness'>`,"text-decoration-color":`<color>`,"text-decoration-inset":`<length>{1,2}|auto`,"text-decoration-line":`none|[underline||overline||line-through||blink]|spelling-error|grammar-error`,"text-decoration-skip":`none|[objects||[spaces|[leading-spaces||trailing-spaces]]||edges||box-decoration]`,"text-decoration-skip-ink":`auto|all|none`,"text-decoration-style":`solid|double|dotted|dashed|wavy`,"text-decoration-thickness":`auto|from-font|<length>|<percentage>`,"text-emphasis":`<'text-emphasis-style'>||<'text-emphasis-color'>`,"text-emphasis-color":`<color>`,"text-emphasis-position":`auto|[over|under]&&[right|left]?`,"text-emphasis-style":`none|[[filled|open]||[dot|circle|double-circle|triangle|sesame]]|<string>`,"text-indent":`<length-percentage>&&hanging?&&each-line?`,"text-justify":`auto|inter-character|inter-word|none`,"text-orientation":`mixed|upright|sideways`,"text-overflow":`[clip|ellipsis|<string>]{1,2}`,"text-rendering":`auto|optimizeSpeed|optimizeLegibility|geometricPrecision`,"text-shadow":`none|<shadow-t>#`,"text-size-adjust":`none|auto|<percentage>`,"text-spacing-trim":`space-all|normal|space-first|trim-start`,"text-transform":`none|[capitalize|uppercase|lowercase]||full-width||full-size-kana|math-auto`,"text-underline-offset":`auto|<length>|<percentage>`,"text-underline-position":`auto|from-font|[under||[left|right]]`,"text-wrap":`<'text-wrap-mode'>||<'text-wrap-style'>`,"text-wrap-mode":`wrap|nowrap`,"text-wrap-style":`auto|balance|stable|pretty`,"timeline-scope":`none|<dashed-ident>#`,"timeline-trigger":`none|[<'timeline-trigger-name'> <'timeline-trigger-source'> <'timeline-trigger-range'> ['/' <'timeline-trigger-exit-range'>]?]#`,"timeline-trigger-name":`none|<dashed-ident>#`,"timeline-trigger-exit-range":`[<'timeline-trigger-exit-range-start'> <'timeline-trigger-exit-range-end'>?]#`,"timeline-trigger-exit-range-end":`[auto|normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#`,"timeline-trigger-exit-range-start":`[auto|normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#`,"timeline-trigger-range":`[<'timeline-trigger-range-start'> <'timeline-trigger-range-end'>?]#`,"timeline-trigger-range-end":`[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#`,"timeline-trigger-range-start":`[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#`,"timeline-trigger-source":`<single-animation-timeline>#`,top:`auto|<length-percentage>|<anchor()>|<anchor-size()>`,"touch-action":`auto|none|[[pan-x|pan-left|pan-right]||[pan-y|pan-up|pan-down]||pinch-zoom]|manipulation`,transform:`none|<transform-list>`,"transform-box":`content-box|border-box|fill-box|stroke-box|view-box`,"transform-origin":`[<length-percentage>|left|center|right|top|bottom]|[[<length-percentage>|left|center|right]&&[<length-percentage>|top|center|bottom]] <length>?`,"transform-style":`flat|preserve-3d`,transition:`<single-transition>#`,"transition-behavior":`<transition-behavior-value>#`,"transition-delay":`<time>#`,"transition-duration":`<time>#`,"transition-property":`none|<single-transition-property>#`,"transition-timing-function":`<easing-function>#`,translate:`none|<length-percentage> [<length-percentage> <length>?]?`,"trigger-scope":`none|all|<dashed-ident>#`,"unicode-bidi":`normal|embed|isolate|bidi-override|isolate-override|plaintext|-moz-isolate|-moz-isolate-override|-moz-plaintext|-webkit-isolate|-webkit-isolate-override|-webkit-plaintext`,"user-select":`auto|text|none|all`,"vector-effect":`none|non-scaling-stroke|non-scaling-size|non-rotation|fixed-position`,"vertical-align":`baseline|sub|super|text-top|text-bottom|middle|top|bottom|<percentage>|<length>`,"view-timeline":`[<'view-timeline-name'> [<'view-timeline-axis'>||<'view-timeline-inset'>]?]#`,"view-timeline-axis":`[block|inline|x|y]#`,"view-timeline-inset":`[[auto|<length-percentage>]{1,2}]#`,"view-timeline-name":`[none|<dashed-ident>]#`,"view-transition-class":`none|<custom-ident>+`,"view-transition-name":`none|<custom-ident>|match-element`,visibility:`visible|hidden|collapse`,"white-space":`normal|pre|pre-wrap|pre-line|<'white-space-collapse'>||<'text-wrap-mode'>`,"white-space-collapse":`collapse|preserve|preserve-breaks|preserve-spaces|break-spaces`,widows:`<integer>`,width:`auto|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>`,"will-change":`auto|<animateable-feature>#`,"word-break":`normal|break-all|keep-all|break-word|auto-phrase`,"word-spacing":`normal|<length>`,"word-wrap":`normal|break-word`,"writing-mode":`horizontal-tb|vertical-rl|vertical-lr|sideways-rl|sideways-lr|<svg-writing-mode>`,x:`<length>|<percentage>`,y:`<length>|<percentage>`,"z-index":`auto|<integer>`,zoom:`normal|reset|<number [0,∞]>||<percentage [0,∞]>`,"-moz-background-clip":`padding|border`,"-moz-border-radius-bottomleft":`<'border-bottom-left-radius'>`,"-moz-border-radius-bottomright":`<'border-bottom-right-radius'>`,"-moz-border-radius-topleft":`<'border-top-left-radius'>`,"-moz-border-radius-topright":`<'border-bottom-right-radius'>`,"-moz-control-character-visibility":`visible|hidden`,"-moz-osx-font-smoothing":`auto|grayscale`,"-moz-user-select":`none|text|all|-moz-none`,"-ms-flex-align":`start|end|center|baseline|stretch`,"-ms-flex-item-align":`auto|start|end|center|baseline|stretch`,"-ms-flex-line-pack":`start|end|center|justify|distribute|stretch`,"-ms-flex-negative":`<'flex-shrink'>`,"-ms-flex-pack":`start|end|center|justify|distribute`,"-ms-flex-order":`<integer>`,"-ms-flex-positive":`<'flex-grow'>`,"-ms-flex-preferred-size":`<'flex-basis'>`,"-ms-interpolation-mode":`nearest-neighbor|bicubic`,"-ms-grid-column-align":`start|end|center|stretch`,"-ms-grid-row-align":`start|end|center|stretch`,"-ms-hyphenate-limit-last":`none|always|column|page|spread`,"-webkit-background-clip":`[<visual-box>|border|padding|content|text]#`,"-webkit-column-break-after":`always|auto|avoid`,"-webkit-column-break-before":`always|auto|avoid`,"-webkit-column-break-inside":`always|auto|avoid`,"-webkit-font-smoothing":`auto|none|antialiased|subpixel-antialiased`,"-webkit-mask-box-image":`[<url>|<gradient>|none] [<length-percentage>{4} <-webkit-mask-box-repeat>{2}]?`,"-webkit-print-color-adjust":`economy|exact`,"-webkit-text-security":`none|circle|disc|square`,"-webkit-user-drag":`none|element|auto`,behavior:`<url>+`,cue:`<'cue-before'> <'cue-after'>?`,"cue-after":`<url> <decibel>?|none`,"cue-before":`<url> <decibel>?|none`,"glyph-orientation-horizontal":`<angle>`,"glyph-orientation-vertical":`<angle>`,kerning:`auto|<svg-length>`,pause:`<'pause-before'> <'pause-after'>?`,"pause-after":`<time>|none|x-weak|weak|medium|strong|x-strong`,"pause-before":`<time>|none|x-weak|weak|medium|strong|x-strong`,"position-try-options":`<'position-try-fallbacks'>`,rest:`<'rest-before'> <'rest-after'>?`,"rest-after":`<time>|none|x-weak|weak|medium|strong|x-strong`,"rest-before":`<time>|none|x-weak|weak|medium|strong|x-strong`,speak:`auto|never|always`,"voice-balance":`<number>|left|center|right|leftwards|rightwards`,"voice-duration":`auto|<time>`,"voice-family":`[[<family-name>|<generic-voice>] ,]* [<family-name>|<generic-voice>]|preserve`,"voice-pitch":`<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]`,"voice-range":`<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]`,"voice-rate":`[normal|x-slow|slow|medium|fast|x-fast]||<percentage>`,"voice-stress":`normal|strong|moderate|none|reduced`,"voice-volume":`silent|[[x-soft|soft|medium|loud|x-loud]||<decibel>]`,"white-space-trim":`none|discard-before||discard-after||discard-inner`},atrules:{charset:{prelude:`<string>`,descriptors:null},"counter-style":{prelude:`<counter-style-name>`,descriptors:{"additive-symbols":`[<integer [0,∞]>&&<symbol>]#`,fallback:`<counter-style-name>`,negative:`<symbol> <symbol>?`,pad:`<integer [0,∞]>&&<symbol>`,prefix:`<symbol>`,range:`[[<integer>|infinite]{2}]#|auto`,"speak-as":`auto|bullets|numbers|words|spell-out|<counter-style-name>`,suffix:`<symbol>`,symbols:`<symbol>+`,system:`cyclic|numeric|alphabetic|symbolic|additive|[fixed <integer>?]|[extends <counter-style-name>]`}},container:{prelude:`[<container-name>]? <container-condition>`,descriptors:null},document:{prelude:`[<url>|url-prefix( <string> )|domain( <string> )|media-document( <string> )|regexp( <string> )]#`,descriptors:null},"font-face":{prelude:null,descriptors:{"ascent-override":`normal|<percentage>`,"descent-override":`normal|<percentage>`,"font-display":`auto|block|swap|fallback|optional`,"font-family":`<family-name>`,"font-feature-settings":`normal|<feature-tag-value>#`,"font-stretch":`<font-stretch-absolute>{1,2}`,"font-style":`normal|italic|oblique <angle>{0,2}`,"font-variation-settings":`normal|[<string> <number>]#`,"font-weight":`<font-weight-absolute>{1,2}`,"line-gap-override":`normal|<percentage>`,"size-adjust":`<percentage>`,src:`[<url> [format( <string># )]?|local( <family-name> )]#`,"unicode-range":`<urange>#`}},"font-feature-values":{prelude:`<family-name>#`,descriptors:null},"font-palette-values":{prelude:`<dashed-ident>`,descriptors:{"base-palette":`light|dark|<integer [0,∞]>`,"font-family":`<family-name>#`,"override-colors":`[<integer [0,∞]> <color>]#`}},import:{prelude:`[<string>|<url>] [layer|layer( <layer-name> )]? [supports( [<supports-condition>|<declaration>] )]? <media-query-list>?`,descriptors:null},keyframes:{prelude:`<keyframes-name>`,descriptors:null},layer:{prelude:`[<layer-name>#|<layer-name>?]`,descriptors:null},media:{prelude:`<media-query-list>`,descriptors:null},namespace:{prelude:`<namespace-prefix>? [<string>|<url>]`,descriptors:null},page:{prelude:`<page-selector-list>`,descriptors:{bleed:`auto|<length>`,marks:`none|[crop||cross]`,"page-orientation":`upright|rotate-left|rotate-right`,size:`<length [0,∞]>{1,2}|auto|[<page-size>||[portrait|landscape]]`}},"position-try":{prelude:`<dashed-ident>`,descriptors:{top:`<'top'>`,left:`<'left'>`,bottom:`<'bottom'>`,right:`<'right'>`,"inset-block-start":`<'inset-block-start'>`,"inset-block-end":`<'inset-block-end'>`,"inset-inline-start":`<'inset-inline-start'>`,"inset-inline-end":`<'inset-inline-end'>`,"inset-block":`<'inset-block'>`,"inset-inline":`<'inset-inline'>`,inset:`<'inset'>`,"margin-top":`<'margin-top'>`,"margin-left":`<'margin-left'>`,"margin-bottom":`<'margin-bottom'>`,"margin-right":`<'margin-right'>`,"margin-block-start":`<'margin-block-start'>`,"margin-block-end":`<'margin-block-end'>`,"margin-inline-start":`<'margin-inline-start'>`,"margin-inline-end":`<'margin-inline-end'>`,margin:`<'margin'>`,"margin-block":`<'margin-block'>`,"margin-inline":`<'margin-inline'>`,width:`<'width'>`,height:`<'height'>`,"min-width":`<'min-width'>`,"min-height":`<'min-height'>`,"max-width":`<'max-width'>`,"max-height":`<'max-height'>`,"block-size":`<'block-size'>`,"inline-size":`<'inline-size'>`,"min-block-size":`<'min-block-size'>`,"min-inline-size":`<'min-inline-size'>`,"max-block-size":`<'max-block-size'>`,"max-inline-size":`<'max-inline-size'>`,"align-self":`<'align-self'>|anchor-center`,"justify-self":`<'justify-self'>|anchor-center`}},property:{prelude:`<custom-property-name>`,descriptors:{inherits:`true|false`,"initial-value":`<declaration-value>?`,syntax:`<string>`}},scope:{prelude:`[( <scope-start> )]? [to ( <scope-end> )]?`,descriptors:null},"starting-style":{prelude:null,descriptors:null},supports:{prelude:`<supports-condition>`,descriptors:null},"view-transition":{prelude:null,descriptors:{navigation:`auto|none`,types:`none|<custom-ident>+`}},"font-features-values":{prelude:`[<string>|<custom-ident>]+`,descriptors:{"font-display":`auto|block|swap|fallback|optional`}}}},Wg=s({generate:()=>r_,name:()=>e_,parse:()=>n_,structure:()=>t_}),Gg=43,Kg=45,qg=110,Jg=!0,Yg=!1;function Xg(e,t){let n=this.tokenStart+e,r=this.charCodeAt(n);for((r===Gg||r===Kg)&&(t&&this.error(`Number sign is not allowed`),n++);n<this.tokenEnd;n++)_d(this.charCodeAt(n))||this.error(`Integer is expected`,n)}function Zg(e){return Xg.call(this,0,e)}function Qg(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n=``;switch(t){case qg:n=`N is expected`;break;case Kg:n=`HyphenMinus is expected`}this.error(n,this.tokenStart+e)}}function $g(){let e=0,t=0,n=this.tokenType;for(;n===13||n===25;)n=this.lookupType(++e);if(n!==10){if(this.isDelim(Gg,e)||this.isDelim(Kg,e)){t=this.isDelim(Gg,e)?Gg:Kg;do n=this.lookupType(++e);while(n===13||n===25);n!==10&&(this.skip(e),Zg.call(this,Jg))}else return null}return e>0&&this.skip(e),t===0&&(n=this.charCodeAt(this.tokenStart),n!==Gg&&n!==Kg&&this.error(`Number sign is expected`)),Zg.call(this,t!==0),t===Kg?`-`+this.consume(10):this.consume(10)}var e_=`AnPlusB`,t_={a:[String,null],b:[String,null]};function n_(){let e=this.tokenStart,t=null,n=null;if(this.tokenType===10)Zg.call(this,Yg),n=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,Kg))switch(t=`-1`,Qg.call(this,1,qg),this.tokenEnd-this.tokenStart){case 2:this.next(),n=$g.call(this);break;case 3:Qg.call(this,2,Kg),this.next(),this.skipSC(),Zg.call(this,Jg),n=`-`+this.consume(10);break;default:Qg.call(this,2,Kg),Xg.call(this,3,Jg),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(Gg)&&this.lookupType(1)===1){let r=0;switch(t=`1`,this.isDelim(Gg)&&(r=1,this.next()),Qg.call(this,0,qg),this.tokenEnd-this.tokenStart){case 1:this.next(),n=$g.call(this);break;case 2:Qg.call(this,1,Kg),this.next(),this.skipSC(),Zg.call(this,Jg),n=`-`+this.consume(10);break;default:Qg.call(this,1,Kg),Xg.call(this,2,Jg),this.next(),n=this.substrToCursor(e+r+1)}}else if(this.tokenType===12){let r=this.charCodeAt(this.tokenStart),i=r===Gg||r===Kg,a=this.tokenStart+i;for(;a<this.tokenEnd&&_d(this.charCodeAt(a));a++);a===this.tokenStart+i&&this.error(`Integer is expected`,this.tokenStart+i),Qg.call(this,a-this.tokenStart,qg),t=this.substring(e,a),a+1===this.tokenEnd?(this.next(),n=$g.call(this)):(Qg.call(this,a-this.tokenStart+1,Kg),a+2===this.tokenEnd?(this.next(),this.skipSC(),Zg.call(this,Jg),n=`-`+this.consume(10)):(Xg.call(this,a-this.tokenStart+2,Jg),this.next(),n=this.substrToCursor(a+1)))}else this.error();return t!==null&&t.charCodeAt(0)===Gg&&(t=t.substr(1)),n!==null&&n.charCodeAt(0)===Gg&&(n=n.substr(1)),{type:`AnPlusB`,loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function r_(e){if(e.a){let t=e.a===`+1`&&`n`||e.a===`1`&&`n`||e.a===`-1`&&`-n`||e.a+`n`;if(e.b){let n=e.b[0]===`-`||e.b[0]===`+`?e.b:`+`+e.b;this.tokenize(t+n)}else this.tokenize(t)}else this.tokenize(e.b)}var i_=s({generate:()=>d_,name:()=>s_,parse:()=>u_,structure:()=>l_,walkContext:()=>c_});function a_(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function o_(){for(let e=1,t;t=this.lookupType(e);e++){if(t===24)return!0;if(t===23||t===3)return!1}return!1}var s_=`Atrule`,c_=`atrule`,l_={name:String,prelude:[`AtrulePrelude`,`Raw`,null],block:[`Block`,null]};function u_(e=!1){let t=this.tokenStart,n,r,i=null,a=null;switch(this.eat(3),n=this.substrToCursor(t+1),r=n.toLowerCase(),this.skipSC(),this.eof===!1&&this.tokenType!==23&&this.tokenType!==17&&(i=this.parseAtrulePrelude?this.parseWithFallback(this.AtrulePrelude.bind(this,n,e),a_):a_.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case 17:this.next();break;case 23:a=hasOwnProperty.call(this.atrule,r)&&typeof this.atrule[r].block==`function`?this.atrule[r].block.call(this,e):this.Block(o_.call(this))}return{type:`Atrule`,loc:this.getLocation(t,this.tokenStart),name:n,prelude:i,block:a}}function d_(e){this.token(3,`@`+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(17,`;`)}var f_=s({generate:()=>__,name:()=>p_,parse:()=>g_,structure:()=>h_,walkContext:()=>m_}),p_=`AtrulePrelude`,m_=`atrulePrelude`,h_={children:[[]]};function g_(e){let t=null;return e!==null&&(e=e.toLowerCase()),this.skipSC(),t=hasOwnProperty.call(this.atrule,e)&&typeof this.atrule[e].prelude==`function`?this.atrule[e].prelude.call(this):this.readSequence(this.scope.AtrulePrelude),this.skipSC(),this.eof!==!0&&this.tokenType!==23&&this.tokenType!==17&&this.error(`Semicolon or block is expected`),{type:`AtrulePrelude`,loc:this.getLocationFromList(t),children:t}}function __(e){this.children(e)}var v_=s({generate:()=>A_,name:()=>D_,parse:()=>k_,structure:()=>O_}),y_=36,b_=42,x_=61,S_=94,C_=124,w_=126;function T_(){this.eof&&this.error(`Unexpected end of input`);let e=this.tokenStart,t=!1;return this.isDelim(b_)?(t=!0,this.next()):this.isDelim(C_)||this.eat(1),this.isDelim(C_)?this.charCodeAt(this.tokenStart+1)===x_?t&&this.error(`Identifier is expected`,this.tokenEnd):(this.next(),this.eat(1)):t&&this.error(`Vertical line is expected`),{type:`Identifier`,loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function E_(){let e=this.tokenStart,t=this.charCodeAt(e);return t!==x_&&t!==w_&&t!==S_&&t!==y_&&t!==b_&&t!==C_&&this.error(`Attribute selector (=, ~=, ^=, $=, *=, |=) is expected`),this.next(),t!==x_&&(this.isDelim(x_)||this.error(`Equal sign is expected`),this.next()),this.substrToCursor(e)}var D_=`AttributeSelector`,O_={name:`Identifier`,matcher:[String,null],value:[`String`,`Identifier`,null],flags:[String,null]};function k_(){let e=this.tokenStart,t,n=null,r=null,i=null;return this.eat(19),this.skipSC(),t=T_.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(n=E_.call(this),this.skipSC(),r=this.tokenType===5?this.String():this.Identifier(),this.skipSC()),this.tokenType===1&&(i=this.consume(1),this.skipSC())),this.eat(20),{type:`AttributeSelector`,loc:this.getLocation(e,this.tokenStart),name:t,matcher:n,value:r,flags:i}}function A_(e){this.token(9,`[`),this.node(e.name),e.matcher!==null&&(this.tokenize(e.matcher),this.node(e.value)),e.flags!==null&&this.token(1,e.flags),this.token(9,`]`)}var j_=s({generate:()=>R_,name:()=>iee,parse:()=>L_,structure:()=>I_,walkContext:()=>aee}),M_=38;function N_(){return this.Raw(null,!0)}function P_(){return this.parseWithFallback(this.Rule,N_)}function F_(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function ree(){if(this.tokenType===17)return F_.call(this,this.tokenIndex);let e=this.parseWithFallback(this.Declaration,F_);return this.tokenType===17&&this.next(),e}var iee=`Block`,aee=`block`,I_={children:[[`Atrule`,`Rule`,`Declaration`]]};function L_(e){let t=e?ree:P_,n=this.tokenStart,r=this.createList();this.eat(23);scan:for(;!this.eof;)switch(this.tokenType){case 24:break scan;case 13:case 25:this.next();break;case 3:r.push(this.parseWithFallback(this.Atrule.bind(this,e),N_));break;default:e&&this.isDelim(M_)?r.push(P_.call(this)):r.push(t.call(this))}return this.eof||this.eat(24),{type:`Block`,loc:this.getLocation(n,this.tokenStart),children:r}}function R_(e){this.token(23,`{`),this.children(e,e=>{e.type===`Declaration`&&this.token(17,`;`)}),this.token(24,`}`)}var z_=s({generate:()=>U_,name:()=>B_,parse:()=>H_,structure:()=>V_}),B_=`Brackets`,V_={children:[[]]};function H_(e,t){let n=this.tokenStart,r=null;return this.eat(19),r=e.call(this,t),this.eof||this.eat(20),{type:`Brackets`,loc:this.getLocation(n,this.tokenStart),children:r}}function U_(e){this.token(9,`[`),this.children(e),this.token(9,`]`)}var W_=s({generate:()=>q_,name:()=>`CDC`,parse:()=>K_,structure:()=>G_}),G_=[];function K_(){let e=this.tokenStart;return this.eat(15),{type:`CDC`,loc:this.getLocation(e,this.tokenStart)}}function q_(){this.token(15,`-->`)}var J_=s({generate:()=>Z_,name:()=>`CDO`,parse:()=>X_,structure:()=>Y_}),Y_=[];function X_(){let e=this.tokenStart;return this.eat(14),{type:`CDO`,loc:this.getLocation(e,this.tokenStart)}}function Z_(){this.token(14,`<!--`)}var Q_=s({generate:()=>rv,name:()=>ev,parse:()=>nv,structure:()=>tv}),$_=46,ev=`ClassSelector`,tv={name:String};function nv(){return this.eatDelim($_),{type:`ClassSelector`,loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function rv(e){this.token(9,`.`),this.token(1,e.name)}var iv=s({generate:()=>fv,name:()=>lv,parse:()=>dv,structure:()=>uv}),av=43,ov=47,sv=62,cv=126,lv=`Combinator`,uv={name:String};function dv(){let e=this.tokenStart,t;switch(this.tokenType){case 13:t=` `;break;case 9:switch(this.charCodeAt(this.tokenStart)){case sv:case av:case cv:this.next();break;case ov:this.next(),this.eatIdent(`deep`),this.eatDelim(ov);break;default:this.error(`Combinator is expected`)}t=this.substrToCursor(e)}return{type:`Combinator`,loc:this.getLocation(e,this.tokenStart),name:t}}function fv(e){this.tokenize(e.name)}var pv=s({generate:()=>yv,name:()=>gv,parse:()=>vv,structure:()=>_v}),mv=42,hv=47,gv=`Comment`,_v={value:String};function vv(){let e=this.tokenStart,t=this.tokenEnd;return this.eat(25),t-e+2>=2&&this.charCodeAt(t-2)===mv&&this.charCodeAt(t-1)===hv&&(t-=2),{type:`Comment`,loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function yv(e){this.token(25,`/*`+e.value+`*/`)}var bv=s({generate:()=>Dv,name:()=>Sv,parse:()=>Ev,structure:()=>Cv}),xv=new Set([16,22,0]),Sv=`Condition`,Cv={kind:String,children:[[`Identifier`,`Feature`,`FeatureFunction`,`FeatureRange`,`SupportsDeclaration`]]};function wv(e){return this.lookupTypeNonSC(1)===1&&xv.has(this.lookupTypeNonSC(2))?this.Feature(e):this.FeatureRange(e)}var Tv={media:wv,container:wv,supports(){return this.SupportsDeclaration()}};function Ev(e=`media`){let t=this.createList();scan:for(;!this.eof;)switch(this.tokenType){case 25:case 13:this.next();continue;case 1:t.push(this.Identifier());break;case 21:{let n=this.parseWithFallback(()=>Tv[e].call(this,e),()=>null);n||=this.parseWithFallback(()=>{this.eat(21);let t=this.Condition(e);return this.eat(22),t},()=>this.GeneralEnclosed(e)),t.push(n);break}case 2:{let n=this.parseWithFallback(()=>this.FeatureFunction(e),()=>null);n||=this.GeneralEnclosed(e),t.push(n);break}default:break scan}return t.isEmpty&&this.error(`Condition is expected`),{type:`Condition`,loc:this.getLocationFromList(t),kind:e,children:t}}function Dv(e){e.children.forEach(e=>{e.type===`Condition`?(this.token(21,`(`),this.node(e),this.token(22,`)`)):this.node(e)})}var Ov=s({generate:()=>Uv,name:()=>zv,parse:()=>Hv,structure:()=>Vv,walkContext:()=>Bv}),kv=33,Av=35,jv=36,Mv=38,Nv=42,Pv=43,Fv=47;function Iv(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function Lv(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function Rv(){let e=this.tokenIndex,t=this.Value();return t.type!==`Raw`&&this.eof===!1&&this.tokenType!==17&&this.isDelim(kv)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}var zv=`Declaration`,Bv=`declaration`,Vv={important:[Boolean,String],property:String,value:[`Value`,`Raw`]};function Hv(){let e=this.tokenStart,t=this.tokenIndex,n=Wv.call(this),r=wp(n),i=r?this.parseCustomProperty:this.parseValue,a=r?Lv:Iv,o=!1,s;this.skipSC(),this.eat(16);let c=this.tokenIndex;if(r||this.skipSC(),s=i?this.parseWithFallback(Rv,a):a.call(this,this.tokenIndex),r&&s.type===`Value`&&s.children.isEmpty){for(let e=c-this.tokenIndex;e<=0;e++)if(this.lookupType(e)===13){s.children.appendData({type:`WhiteSpace`,loc:null,value:` `});break}}return this.isDelim(kv)&&(o=Gv.call(this),this.skipSC()),this.eof===!1&&this.tokenType!==17&&this.isBalanceEdge(t)===!1&&this.error(),{type:`Declaration`,loc:this.getLocation(e,this.tokenStart),important:o,property:n,value:s}}function Uv(e){this.token(1,e.property),this.token(16,`:`),this.node(e.value),e.important&&(this.token(9,`!`),this.token(1,e.important===!0?`important`:e.important))}function Wv(){let e=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case Nv:case jv:case Pv:case Av:case Mv:this.next();break;case Fv:this.next(),this.isDelim(Fv)&&this.next()}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(e)}function Gv(){this.eat(9),this.skipSC();let e=this.consume(1);return e===`important`||e}var Kv=s({generate:()=>Qv,name:()=>Yv,parse:()=>Zv,structure:()=>Xv}),qv=38;function Jv(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}var Yv=`DeclarationList`,Xv={children:[[`Declaration`,`Atrule`,`Rule`]]};function Zv(){let e=this.createList();scan:for(;!this.eof;)switch(this.tokenType){case 13:case 25:case 17:this.next();break;case 3:e.push(this.parseWithFallback(this.Atrule.bind(this,!0),Jv));break;default:this.isDelim(qv)?e.push(this.parseWithFallback(this.Rule,Jv)):e.push(this.parseWithFallback(this.Declaration,Jv))}return{type:`DeclarationList`,loc:this.getLocationFromList(e),children:e}}function Qv(e){this.children(e,e=>{e.type===`Declaration`&&this.token(17,`;`)})}var $v=s({generate:()=>ry,name:()=>ey,parse:()=>ny,structure:()=>ty}),ey=`Dimension`,ty={value:String,unit:String};function ny(){let e=this.tokenStart,t=this.consumeNumber(12);return{type:`Dimension`,loc:this.getLocation(e,this.tokenStart),value:t,unit:this.substring(e+t.length,this.tokenStart)}}function ry(e){this.token(12,e.value+e.unit)}var iy=s({generate:()=>ly,name:()=>oy,parse:()=>cy,structure:()=>sy}),ay=47,oy=`Feature`,sy={kind:String,name:String,value:[`Identifier`,`Number`,`Dimension`,`Ratio`,`Function`,null]};function cy(e){let t=this.tokenStart,n,r=null;if(this.eat(21),this.skipSC(),n=this.consume(1),this.skipSC(),this.tokenType!==22){switch(this.eat(16),this.skipSC(),this.tokenType){case 10:r=this.lookupNonWSType(1)===9?this.Ratio():this.Number();break;case 12:r=this.Dimension();break;case 1:r=this.Identifier();break;case 2:r=this.parseWithFallback(()=>{let e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(ay)&&this.error(),e},()=>this.Ratio());break;default:this.error(`Number, dimension, ratio or identifier is expected`)}this.skipSC()}return this.eof||this.eat(22),{type:`Feature`,loc:this.getLocation(t,this.tokenStart),kind:e,name:n,value:r}}function ly(e){this.token(21,`(`),this.token(1,e.name),e.value!==null&&(this.token(16,`:`),this.node(e.value)),this.token(22,`)`)}var uy=s({generate:()=>hy,name:()=>dy,parse:()=>my,structure:()=>fy}),dy=`FeatureFunction`,fy={kind:String,feature:String,value:[`Declaration`,`Selector`]};function py(e,t){let n=(this.features[e]||{})[t];return typeof n!=`function`&&this.error(`Unknown feature ${t}()`),n}function my(e=`unknown`){let t=this.tokenStart,n=this.consumeFunctionName(),r=py.call(this,e,n.toLowerCase());this.skipSC();let i=this.parseWithFallback(()=>{let e=this.tokenIndex,t=r.call(this);return this.eof===!1&&this.isBalanceEdge(e)===!1&&this.error(),t},()=>this.Raw(null,!1));return this.eof||this.eat(22),{type:`FeatureFunction`,loc:this.getLocation(t,this.tokenStart),kind:e,feature:n,value:i}}function hy(e){this.token(2,e.feature+`(`),this.node(e.value),this.token(22,`)`)}var gy=s({generate:()=>Ey,name:()=>xy,parse:()=>Ty,structure:()=>Sy}),_y=47,vy=60,yy=61,by=62,xy=`FeatureRange`,Sy={kind:String,left:[`Identifier`,`Number`,`Dimension`,`Ratio`,`Function`],leftComparison:String,middle:[`Identifier`,`Number`,`Dimension`,`Ratio`,`Function`],rightComparison:[String,null],right:[`Identifier`,`Number`,`Dimension`,`Ratio`,`Function`,null]};function Cy(){switch(this.skipSC(),this.tokenType){case 10:return this.isDelim(_y,this.lookupOffsetNonSC(1))?this.Ratio():this.Number();case 12:return this.Dimension();case 1:return this.Identifier();case 2:return this.parseWithFallback(()=>{let e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(_y)&&this.error(),e},()=>this.Ratio());default:this.error(`Number, dimension, ratio or identifier is expected`)}}function wy(e){if(this.skipSC(),this.isDelim(vy)||this.isDelim(by)){let e=this.source[this.tokenStart];return this.next(),this.isDelim(yy)?(this.next(),e+`=`):e}if(this.isDelim(yy))return`=`;this.error(`Expected ${e?`":", `:``}"<", ">", "=" or ")"`)}function Ty(e=`unknown`){let t=this.tokenStart;this.skipSC(),this.eat(21);let n=Cy.call(this),r=wy.call(this,n.type===`Identifier`),i=Cy.call(this),a=null,o=null;return this.lookupNonWSType(0)!==22&&(a=wy.call(this),o=Cy.call(this)),this.skipSC(),this.eat(22),{type:`FeatureRange`,loc:this.getLocation(t,this.tokenStart),kind:e,left:n,leftComparison:r,middle:i,rightComparison:a,right:o}}function Ey(e){this.token(21,`(`),this.node(e.left),this.tokenize(e.leftComparison),this.node(e.middle),e.right&&(this.tokenize(e.rightComparison),this.node(e.right)),this.token(22,`)`)}var Dy=s({generate:()=>My,name:()=>Oy,parse:()=>jy,structure:()=>Ay,walkContext:()=>ky}),Oy=`Function`,ky=`function`,Ay={name:String,children:[[]]};function jy(e,t){let n=this.tokenStart,r=this.consumeFunctionName(),i=r.toLowerCase(),a;return a=t.hasOwnProperty(i)?t[i].call(this,t):e.call(this,t),this.eof||this.eat(22),{type:`Function`,loc:this.getLocation(n,this.tokenStart),name:r,children:a}}function My(e){this.token(2,e.name+`(`),this.children(e),this.token(22,`)`)}var Ny=s({generate:()=>Ly,name:()=>Py,parse:()=>Iy,structure:()=>Fy}),Py=`GeneralEnclosed`,Fy={kind:String,function:[String,null],children:[[]]};function Iy(e){let t=this.tokenStart,n=null;this.tokenType===2?n=this.consumeFunctionName():this.eat(21);let r=this.parseWithFallback(()=>{let e=this.tokenIndex,t=this.readSequence(this.scope.Value);return this.eof===!1&&this.isBalanceEdge(e)===!1&&this.error(),t},()=>this.createSingleNodeList(this.Raw(null,!1)));return this.eof||this.eat(22),{type:`GeneralEnclosed`,loc:this.getLocation(t,this.tokenStart),kind:e,function:n,children:r}}function Ly(e){e.function?this.token(2,e.function+`(`):this.token(21,`(`),this.children(e),this.token(22,`)`)}var Ry=s({generate:()=>Hy,name:()=>zy,parse:()=>Vy,structure:()=>By,xxx:()=>`XXX`}),zy=`Hash`,By={value:String};function Vy(){let e=this.tokenStart;return this.eat(4),{type:`Hash`,loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function Hy(e){this.token(4,`#`+e.value)}var Uy=s({generate:()=>qy,name:()=>Wy,parse:()=>Ky,structure:()=>Gy}),Wy=`Identifier`,Gy={name:String};function Ky(){return{type:`Identifier`,loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function qy(e){this.token(1,e.name)}var Jy=s({generate:()=>Qy,name:()=>Yy,parse:()=>Zy,structure:()=>Xy}),Yy=`IdSelector`,Xy={name:String};function Zy(){let e=this.tokenStart;return this.eat(4),{type:`IdSelector`,loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function Qy(e){this.token(9,`#`+e.name)}var $y=s({generate:()=>ib,name:()=>tb,parse:()=>rb,structure:()=>nb}),eb=46,tb=`Layer`,nb={name:String};function rb(){let e=this.tokenStart,t=this.consume(1);for(;this.isDelim(eb);)this.eat(9),t+=`.`+this.consume(1);return{type:`Layer`,loc:this.getLocation(e,this.tokenStart),name:t}}function ib(e){this.tokenize(e.name)}var ab=s({generate:()=>lb,name:()=>ob,parse:()=>cb,structure:()=>sb}),ob=`LayerList`,sb={children:[[`Layer`]]};function cb(){let e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.Layer()),this.lookupTypeNonSC(0)===18);)this.skipSC(),this.next(),this.skipSC();return{type:`LayerList`,loc:this.getLocationFromList(e),children:e}}function lb(e){this.children(e,()=>this.token(18,`,`))}var ub=s({generate:()=>mb,name:()=>db,parse:()=>pb,structure:()=>fb}),db=`MediaQuery`,fb={modifier:[String,null],mediaType:[String,null],condition:[`Condition`,null]};function pb(){let e=this.tokenStart,t=null,n=null,r=null;if(this.skipSC(),this.tokenType===1&&this.lookupTypeNonSC(1)!==21){let e=this.consume(1),i=e.toLowerCase();switch(i===`not`||i===`only`?(this.skipSC(),t=i,n=this.consume(1)):n=e,this.lookupTypeNonSC(0)){case 1:this.skipSC(),this.eatIdent(`and`),r=this.Condition(`media`);break;case 23:case 17:case 18:case 0:break;default:this.error(`Identifier or parenthesis is expected`)}}else switch(this.tokenType){case 1:case 21:case 2:r=this.Condition(`media`);break;case 23:case 17:case 0:break;default:this.error(`Identifier or parenthesis is expected`)}return{type:`MediaQuery`,loc:this.getLocation(e,this.tokenStart),modifier:t,mediaType:n,condition:r}}function mb(e){e.mediaType?(e.modifier&&this.token(1,e.modifier),this.token(1,e.mediaType),e.condition&&(this.token(1,`and`),this.node(e.condition))):e.condition&&this.node(e.condition)}var hb=s({generate:()=>yb,name:()=>gb,parse:()=>vb,structure:()=>_b}),gb=`MediaQueryList`,_b={children:[[`MediaQuery`]]};function vb(){let e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.MediaQuery()),this.tokenType===18);)this.next();return{type:`MediaQueryList`,loc:this.getLocationFromList(e),children:e}}function yb(e){this.children(e,()=>this.token(18,`,`))}var bb=s({generate:()=>cee,name:()=>oee,parse:()=>Sb,structure:()=>see}),xb=38,oee=`NestingSelector`,see={};function Sb(){let e=this.tokenStart;return this.eatDelim(xb),{type:`NestingSelector`,loc:this.getLocation(e,this.tokenStart)}}function cee(){this.token(9,`&`)}var lee=s({generate:()=>dee,name:()=>`Nth`,parse:()=>Cb,structure:()=>uee}),uee={nth:[`AnPlusB`,`Identifier`],selector:[`SelectorList`,null]};function Cb(){this.skipSC();let e=this.tokenStart,t=e,n=null,r;return r=this.lookupValue(0,`odd`)||this.lookupValue(0,`even`)?this.Identifier():this.AnPlusB(),t=this.tokenStart,this.skipSC(),this.lookupValue(0,`of`)&&(this.next(),n=this.SelectorList(),t=this.tokenStart),{type:`Nth`,loc:this.getLocation(e,t),nth:r,selector:n}}function dee(e){this.node(e.nth),e.selector!==null&&(this.token(1,`of`),this.node(e.selector))}var fee=s({generate:()=>hee,name:()=>pee,parse:()=>wb,structure:()=>mee}),pee=`Number`,mee={value:String};function wb(){return{type:`Number`,loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function hee(e){this.token(10,e.value)}var gee=s({generate:()=>Db,name:()=>_ee,parse:()=>Eb,structure:()=>Tb}),_ee=`Operator`,Tb={value:String};function Eb(){let e=this.tokenStart;return this.next(),{type:`Operator`,loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function Db(e){this.tokenize(e.value)}var Ob=s({generate:()=>Mb,name:()=>kb,parse:()=>jb,structure:()=>Ab}),kb=`Parentheses`,Ab={children:[[]]};function jb(e,t){let n=this.tokenStart,r=null;return this.eat(21),r=e.call(this,t),this.eof||this.eat(22),{type:`Parentheses`,loc:this.getLocation(n,this.tokenStart),children:r}}function Mb(e){this.token(21,`(`),this.children(e),this.token(22,`)`)}var Nb=s({generate:()=>Lb,name:()=>Pb,parse:()=>Ib,structure:()=>Fb}),Pb=`Percentage`,Fb={value:String};function Ib(){return{type:`Percentage`,loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function Lb(e){this.token(11,e.value+`%`)}var Rb=s({generate:()=>Ub,name:()=>zb,parse:()=>Hb,structure:()=>Vb,walkContext:()=>Bb}),zb=`PseudoClassSelector`,Bb=`function`,Vb={name:String,children:[[`Raw`],null]};function Hb(){let e=this.tokenStart,t=null,n,r;return this.eat(16),this.tokenType===2?(n=this.consumeFunctionName(),r=n.toLowerCase(),this.lookupNonWSType(0)==22?t=this.createList():hasOwnProperty.call(this.pseudo,r)?(this.skipSC(),t=this.pseudo[r].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(22)):n=this.consume(1),{type:`PseudoClassSelector`,loc:this.getLocation(e,this.tokenStart),name:n,children:t}}function Ub(e){this.token(16,`:`),e.children===null?this.token(1,e.name):(this.token(2,e.name+`(`),this.children(e),this.token(22,`)`))}var Wb=s({generate:()=>Yb,name:()=>Gb,parse:()=>Jb,structure:()=>qb,walkContext:()=>Kb}),Gb=`PseudoElementSelector`,Kb=`function`,qb={name:String,children:[[`Raw`],null]};function Jb(){let e=this.tokenStart,t=null,n,r;return this.eat(16),this.eat(16),this.tokenType===2?(n=this.consumeFunctionName(),r=n.toLowerCase(),this.lookupNonWSType(0)==22?t=this.createList():hasOwnProperty.call(this.pseudo,r)?(this.skipSC(),t=this.pseudo[r].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(22)):n=this.consume(1),{type:`PseudoElementSelector`,loc:this.getLocation(e,this.tokenStart),name:n,children:t}}function Yb(e){this.token(16,`:`),this.token(16,`:`),e.children===null?this.token(1,e.name):(this.token(2,e.name+`(`),this.children(e),this.token(22,`)`))}var Xb=s({generate:()=>nx,name:()=>$b,parse:()=>tx,structure:()=>ex}),Zb=47;function Qb(){switch(this.skipSC(),this.tokenType){case 10:return this.Number();case 2:return this.Function(this.readSequence,this.scope.Value);default:this.error(`Number of function is expected`)}}var $b=`Ratio`,ex={left:[`Number`,`Function`],right:[`Number`,`Function`,null]};function tx(){let e=this.tokenStart,t=Qb.call(this),n=null;return this.skipSC(),this.isDelim(Zb)&&(this.eatDelim(Zb),n=Qb.call(this)),{type:`Ratio`,loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function nx(e){this.node(e.left),this.token(9,`/`),e.right?this.node(e.right):this.node(10,1)}var rx=s({generate:()=>sx,name:()=>`Raw`,parse:()=>ox,structure:()=>ax});function ix(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}var ax={value:String};function ox(e,t){let n=this.getTokenStart(this.tokenIndex),r;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),r=t&&this.tokenStart>n?ix.call(this):this.tokenStart,{type:`Raw`,loc:this.getLocation(n,r),value:this.substring(n,r)}}function sx(e){this.tokenize(e.value)}var cx=s({generate:()=>hx,name:()=>dx,parse:()=>mx,structure:()=>px,walkContext:()=>fx});function lx(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function ux(){let e=this.SelectorList();return e.type!==`Raw`&&this.eof===!1&&this.tokenType!==23&&this.error(),e}var dx=`Rule`,fx=`rule`,px={prelude:[`SelectorList`,`Raw`],block:[`Block`]};function mx(){let e=this.tokenIndex,t=this.tokenStart,n,r;return n=this.parseRulePrelude?this.parseWithFallback(ux,lx):lx.call(this,e),r=this.Block(!0),{type:`Rule`,loc:this.getLocation(t,this.tokenStart),prelude:n,block:r}}function hx(e){this.node(e.prelude),this.node(e.block)}var gx=s({generate:()=>bx,name:()=>_x,parse:()=>yx,structure:()=>vx}),_x=`Scope`,vx={root:[`SelectorList`,`Raw`,null],limit:[`SelectorList`,`Raw`,null]};function yx(){let e=null,t=null;this.skipSC();let n=this.tokenStart;return this.tokenType===21&&(this.next(),this.skipSC(),e=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(22)),this.lookupNonWSType(0)===1&&(this.skipSC(),this.eatIdent(`to`),this.skipSC(),this.eat(21),this.skipSC(),t=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(22)),{type:`Scope`,loc:this.getLocation(n,this.tokenStart),root:e,limit:t}}function bx(e){e.root&&(this.token(21,`(`),this.node(e.root),this.token(22,`)`)),e.limit&&(this.token(1,`to`),this.token(21,`(`),this.node(e.limit),this.token(22,`)`))}var xx=s({generate:()=>Tx,name:()=>Sx,parse:()=>wx,structure:()=>Cx}),Sx=`Selector`,Cx={children:[[`TypeSelector`,`IdSelector`,`ClassSelector`,`AttributeSelector`,`PseudoClassSelector`,`PseudoElementSelector`,`Combinator`]]};function wx(){let e=this.readSequence(this.scope.Selector);return this.getFirstListNode(e)===null&&this.error(`Selector is expected`),{type:`Selector`,loc:this.getLocationFromList(e),children:e}}function Tx(e){this.children(e)}var Ex=s({generate:()=>jx,name:()=>Dx,parse:()=>Ax,structure:()=>kx,walkContext:()=>Ox}),Dx=`SelectorList`,Ox=`selector`,kx={children:[[`Selector`,`Raw`]]};function Ax(){let e=this.createList();for(;!this.eof;){if(e.push(this.Selector()),this.tokenType===18){this.next();continue}break}return{type:`SelectorList`,loc:this.getLocationFromList(e),children:e}}function jx(e){this.children(e,()=>this.token(18,`,`))}var Mx=92,Nx=34,Px=39;function Fx(e){let t=e.length,n=e.charCodeAt(0),r=+(n===Nx||n===Px),i=r===1&&t>1&&e.charCodeAt(t-1)===n?t-2:t-1,a=``;for(let n=r;n<=i;n++){let r=e.charCodeAt(n);if(r===Mx){if(n===i){n!==t-1&&(a=e.substr(n+1));break}if(r=e.charCodeAt(++n),Od(Mx,r)){let t=n-1,r=Vd(e,t);n=r-1,a+=Gd(e.substring(t+1,r))}else r===13&&e.charCodeAt(n+1)===10&&n++}else a+=e[n]}return a}function Ix(e,t){let n=t?`'`:`"`,r=t?Px:Nx,i=``,a=!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n===0){i+=`�`;continue}if(n<=31||n===127){i+=`\\`+n.toString(16),a=!0;continue}n===r||n===Mx?(i+=`\\`+e.charAt(t),a=!1):(a&&(vd(n)||Dd(n))&&(i+=` `),i+=e.charAt(t),a=!1)}return n+i+n}var Lx=s({generate:()=>Vx,name:()=>Rx,parse:()=>Bx,structure:()=>zx}),Rx=`String`,zx={value:String};function Bx(){return{type:`String`,loc:this.getLocation(this.tokenStart,this.tokenEnd),value:Fx(this.consume(5))}}function Vx(e){this.token(5,Ix(e.value))}var Hx=s({generate:()=>Yx,name:()=>Gx,parse:()=>Jx,structure:()=>qx,walkContext:()=>Kx}),Ux=33;function Wx(){return this.Raw(null,!1)}var Gx=`StyleSheet`,Kx=`stylesheet`,qx={children:[[`Comment`,`CDO`,`CDC`,`Atrule`,`Rule`,`Raw`]]};function Jx(){let e=this.tokenStart,t=this.createList(),n;scan:for(;!this.eof;){switch(this.tokenType){case 13:this.next();continue;case 25:if(this.charCodeAt(this.tokenStart+2)!==Ux){this.next();continue}n=this.Comment();break;case 14:n=this.CDO();break;case 15:n=this.CDC();break;case 3:n=this.parseWithFallback(this.Atrule,Wx);break;default:n=this.parseWithFallback(this.Rule,Wx)}t.push(n)}return{type:`StyleSheet`,loc:this.getLocation(e,this.tokenStart),children:t}}function Yx(e){this.children(e)}var Xx=s({generate:()=>eS,name:()=>Zx,parse:()=>$x,structure:()=>Qx}),Zx=`SupportsDeclaration`,Qx={declaration:`Declaration`};function $x(){let e=this.tokenStart;this.eat(21),this.skipSC();let t=this.Declaration();return this.eof||this.eat(22),{type:`SupportsDeclaration`,loc:this.getLocation(e,this.tokenStart),declaration:t}}function eS(e){this.token(21,`(`),this.node(e.declaration),this.token(22,`)`)}var tS=s({generate:()=>cS,name:()=>aS,parse:()=>sS,structure:()=>oS}),nS=42,rS=124;function iS(){this.tokenType!==1&&this.isDelim(nS)===!1&&this.error(`Identifier or asterisk is expected`),this.next()}var aS=`TypeSelector`,oS={name:String};function sS(){let e=this.tokenStart;return this.isDelim(rS)?(this.next(),iS.call(this)):(iS.call(this),this.isDelim(rS)&&(this.next(),iS.call(this))),{type:`TypeSelector`,loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function cS(e){this.tokenize(e.name)}var lS=s({generate:()=>bS,name:()=>_S,parse:()=>yS,structure:()=>vS}),uS=43,dS=45,fS=63;function pS(e,t){let n=0;for(let r=this.tokenStart+e;r<this.tokenEnd;r++){let i=this.charCodeAt(r);if(i===dS&&t&&n!==0)return pS.call(this,e+n+1,!1),-1;vd(i)||this.error(t&&n!==0?`Hyphen minus`+(n<6?` or hex digit`:``)+` is expected`:n<6?`Hex digit is expected`:`Unexpected input`,r),++n>6&&this.error(`Too many hex digits`,r)}return this.next(),n}function mS(e){let t=0;for(;this.isDelim(fS);)++t>e&&this.error(`Too many question marks`),this.next()}function hS(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===uS?`Plus sign`:`Hyphen minus`)+` is expected`)}function gS(){let e=0;switch(this.tokenType){case 10:if(e=pS.call(this,1,!0),this.isDelim(fS)){mS.call(this,6-e);break}if(this.tokenType===12||this.tokenType===10){hS.call(this,dS),pS.call(this,1,!1);break}break;case 12:e=pS.call(this,1,!0),e>0&&mS.call(this,6-e);break;default:if(this.eatDelim(uS),this.tokenType===1){e=pS.call(this,0,!0),e>0&&mS.call(this,6-e);break}if(this.isDelim(fS)){this.next(),mS.call(this,5);break}this.error(`Hex digit or question mark is expected`)}}var _S=`UnicodeRange`,vS={value:String};function yS(){let e=this.tokenStart;return this.eatIdent(`u`),gS.call(this),{type:`UnicodeRange`,loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function bS(e){this.tokenize(e.value)}var xS=32,SS=92,CS=34,wS=39,TS=40,ES=41;function DS(e){let t=e.length,n=4,r=e.charCodeAt(t-1)===ES?t-2:t-1,i=``;for(;n<r&&Dd(e.charCodeAt(n));)n++;for(;n<r&&Dd(e.charCodeAt(r));)r--;for(let a=n;a<=r;a++){let n=e.charCodeAt(a);if(n===SS){if(a===r){a!==t-1&&(i=e.substr(a+1));break}if(n=e.charCodeAt(++a),Od(SS,n)){let t=a-1,n=Vd(e,t);a=n-1,i+=Gd(e.substring(t+1,n))}else n===13&&e.charCodeAt(a+1)===10&&a++}else i+=e[a]}return i}function OS(e){let t=``,n=!1;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(i===0){t+=`�`;continue}if(i<=31||i===127){t+=`\\`+i.toString(16),n=!0;continue}i===xS||i===SS||i===CS||i===wS||i===TS||i===ES?(t+=`\\`+e.charAt(r),n=!1):(n&&vd(i)&&(t+=` `),t+=e.charAt(r),n=!1)}return`url(`+t+`)`}var kS=s({generate:()=>MS,name:()=>`Url`,parse:()=>jS,structure:()=>AS}),AS={value:String};function jS(){let e=this.tokenStart,t;switch(this.tokenType){case 7:t=DS(this.consume(7));break;case 2:this.cmpStr(this.tokenStart,this.tokenEnd,`url(`)||this.error("Function name must be `url`"),this.eat(2),this.skipSC(),t=Fx(this.consume(5)),this.skipSC(),this.eof||this.eat(22);break;default:this.error(`Url or Function is expected`)}return{type:`Url`,loc:this.getLocation(e,this.tokenStart),value:t}}function MS(e){this.token(7,OS(e.value))}var NS=s({generate:()=>LS,name:()=>PS,parse:()=>IS,structure:()=>FS}),PS=`Value`,FS={children:[[]]};function IS(){let e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:`Value`,loc:this.getLocation(e,this.tokenStart),children:t}}function LS(e){this.children(e)}var RS=s({generate:()=>US,name:()=>BS,parse:()=>HS,structure:()=>VS}),zS=Object.freeze({type:`WhiteSpace`,loc:null,value:` `}),BS=`WhiteSpace`,VS={value:String};function HS(){return this.eat(13),zS}function US(e){this.token(13,e.value)}var WS=s({AnPlusB:()=>Wg,Atrule:()=>i_,AtrulePrelude:()=>f_,AttributeSelector:()=>v_,Block:()=>j_,Brackets:()=>z_,CDC:()=>W_,CDO:()=>J_,ClassSelector:()=>Q_,Combinator:()=>iv,Comment:()=>pv,Condition:()=>bv,Declaration:()=>Ov,DeclarationList:()=>Kv,Dimension:()=>$v,Feature:()=>iy,FeatureFunction:()=>uy,FeatureRange:()=>gy,Function:()=>Dy,GeneralEnclosed:()=>Ny,Hash:()=>Ry,IdSelector:()=>Jy,Identifier:()=>Uy,Layer:()=>$y,LayerList:()=>ab,MediaQuery:()=>ub,MediaQueryList:()=>hb,NestingSelector:()=>bb,Nth:()=>lee,Number:()=>fee,Operator:()=>gee,Parentheses:()=>Ob,Percentage:()=>Nb,PseudoClassSelector:()=>Rb,PseudoElementSelector:()=>Wb,Ratio:()=>Xb,Raw:()=>rx,Rule:()=>cx,Scope:()=>gx,Selector:()=>xx,SelectorList:()=>Ex,String:()=>Lx,StyleSheet:()=>Hx,SupportsDeclaration:()=>Xx,TypeSelector:()=>tS,UnicodeRange:()=>lS,Url:()=>kS,Value:()=>NS,WhiteSpace:()=>RS}),GS={generic:!0,cssWideKeywords:Op,...Ug,node:WS},KS=35,qS=42,JS=43,YS=45,XS=47,ZS=117;function QS(e){switch(this.tokenType){case 4:return this.Hash();case 18:return this.Operator();case 21:return this.Parentheses(this.readSequence,e.recognizer);case 19:return this.Brackets(this.readSequence,e.recognizer);case 5:return this.String();case 12:return this.Dimension();case 11:return this.Percentage();case 10:return this.Number();case 2:return this.cmpStr(this.tokenStart,this.tokenEnd,`url(`)?this.Url():this.Function(this.readSequence,e.recognizer);case 7:return this.Url();case 1:return this.cmpChar(this.tokenStart,ZS)&&this.cmpChar(this.tokenStart+1,JS)?this.UnicodeRange():this.Identifier();case 9:{let e=this.charCodeAt(this.tokenStart);if(e===XS||e===qS||e===JS||e===YS)return this.Operator();e===KS&&this.error(`Hex or identifier is expected`,this.tokenStart+1);break}}}var $S={getNode:QS},eC=35,tC=38,nC=42,rC=43,iC=47,aC=46,oC=62,sC=124,cC=126;function lC(e,t){t.last!==null&&t.last.type!==`Combinator`&&e!==null&&e.type!==`Combinator`&&t.push({type:`Combinator`,loc:null,name:` `})}function uC(){switch(this.tokenType){case 19:return this.AttributeSelector();case 4:return this.IdSelector();case 16:return this.lookupType(1)===16?this.PseudoElementSelector():this.PseudoClassSelector();case 1:return this.TypeSelector();case 10:case 11:return this.Percentage();case 12:this.charCodeAt(this.tokenStart)===aC&&this.error(`Identifier is expected`,this.tokenStart+1);break;case 9:switch(this.charCodeAt(this.tokenStart)){case rC:case oC:case cC:case iC:return this.Combinator();case aC:return this.ClassSelector();case nC:case sC:return this.TypeSelector();case eC:return this.IdSelector();case tC:return this.NestingSelector()}}}var dC={onWhiteSpace:lC,getNode:uC};function fC(){return this.createSingleNodeList(this.Raw(null,!1))}function pC(){let e=this.createList();if(this.skipSC(),e.push(this.Identifier()),this.skipSC(),this.tokenType===18){e.push(this.Operator());let t=this.tokenIndex,n=this.parseCustomProperty?this.Value(null):this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1);if(n.type===`Value`&&n.children.isEmpty){for(let e=t-this.tokenIndex;e<=0;e++)if(this.lookupType(e)===13){n.children.appendData({type:`WhiteSpace`,loc:null,value:` `});break}}e.push(n)}return e}function mC(e){return e!==null&&e.type===`Operator`&&(e.value[e.value.length-1]===`-`||e.value[e.value.length-1]===`+`)}var hC={getNode:QS,onWhiteSpace(e,t){mC(e)&&(e.value=` `+e.value),mC(t.last)&&(t.last.value+=` `)},expression:fC,var:pC},gC=s({AtrulePrelude:()=>$S,Selector:()=>dC,Value:()=>hC}),_C=new Set([`none`,`and`,`not`,`or`]),vC={parse:{prelude(){let e=this.createList();if(this.tokenType===1){let t=this.substring(this.tokenStart,this.tokenEnd);_C.has(t.toLowerCase())||e.push(this.Identifier())}return e.push(this.Condition(`container`)),e},block(e=!1){return this.Block(e)}}},yC={parse:{prelude:null,block(){return this.Block(!0)}}};function bC(e,t){return this.parseWithFallback(()=>{try{return e.call(this)}finally{this.skipSC(),this.lookupNonWSType(0)!==22&&this.error()}},t||(()=>this.Raw(null,!0)))}var xC={layer(){this.skipSC();let e=this.createList(),t=bC.call(this,this.Layer);return(t.type!==`Raw`||t.value!==``)&&e.push(t),e},supports(){this.skipSC();let e=this.createList(),t=bC.call(this,this.Declaration,()=>bC.call(this,()=>this.Condition(`supports`)));return(t.type!==`Raw`||t.value!==``)&&e.push(t),e}},SC={container:vC,"font-face":yC,import:{parse:{prelude(){let e=this.createList();switch(this.tokenType){case 5:e.push(this.String());break;case 7:case 2:e.push(this.Url());break;default:this.error(`String or url() is expected`)}return this.skipSC(),this.tokenType===1&&this.cmpStr(this.tokenStart,this.tokenEnd,`layer`)?e.push(this.Identifier()):this.tokenType===2&&this.cmpStr(this.tokenStart,this.tokenEnd,`layer(`)&&e.push(this.Function(null,xC)),this.skipSC(),this.tokenType===2&&this.cmpStr(this.tokenStart,this.tokenEnd,`supports(`)&&e.push(this.Function(null,xC)),(this.lookupNonWSType(0)===1||this.lookupNonWSType(0)===21)&&e.push(this.MediaQueryList()),e},block:null}},layer:{parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(){return this.Block(!1)}}},media:{parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(e=!1){return this.Block(e)}}},nest:{parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},page:{parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},scope:{parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(e=!1){return this.Block(e)}}},"starting-style":{parse:{prelude:null,block(e=!1){return this.Block(e)}}},supports:{parse:{prelude(){return this.createSingleNodeList(this.Condition(`supports`))},block(e=!1){return this.Block(e)}}}};function CC(){let e=this.createList();this.skipSC();loop:for(;!this.eof;){switch(this.tokenType){case 1:e.push(this.Identifier());break;case 5:e.push(this.String());break;case 18:e.push(this.Operator());break;case 22:break loop;default:this.error(`Identifier, string or comma is expected`)}this.skipSC()}return e}var wC={parse(){return this.createSingleNodeList(this.SelectorList())}},TC={parse(){return this.createSingleNodeList(this.Selector())}},EC={parse(){return this.createSingleNodeList(this.Identifier())}},DC={parse:CC},OC={parse(){return this.createSingleNodeList(this.Nth())}},kC={parseContext:{default:`StyleSheet`,stylesheet:`StyleSheet`,atrule:`Atrule`,atrulePrelude(e){return this.AtrulePrelude(e.atrule?String(e.atrule):null)},mediaQueryList:`MediaQueryList`,mediaQuery:`MediaQuery`,condition(e){return this.Condition(e.kind)},rule:`Rule`,selectorList:`SelectorList`,selector:`Selector`,block(){return this.Block(!0)},declarationList:`DeclarationList`,declaration:`Declaration`,value:`Value`},features:{supports:{selector(){return this.Selector()}},container:{style(){return this.Declaration()}}},scope:gC,atrule:SC,pseudo:{dir:EC,has:wC,lang:DC,matches:wC,is:wC,"-moz-any":wC,"-webkit-any":wC,where:wC,not:wC,"nth-child":OC,"nth-last-child":OC,"nth-last-of-type":OC,"nth-of-type":OC,slotted:TC,host:TC,"host-context":TC},node:s({AnPlusB:()=>n_,Atrule:()=>u_,AtrulePrelude:()=>g_,AttributeSelector:()=>k_,Block:()=>L_,Brackets:()=>H_,CDC:()=>K_,CDO:()=>X_,ClassSelector:()=>nv,Combinator:()=>dv,Comment:()=>vv,Condition:()=>Ev,Declaration:()=>Hv,DeclarationList:()=>Zv,Dimension:()=>ny,Feature:()=>cy,FeatureFunction:()=>my,FeatureRange:()=>Ty,Function:()=>jy,GeneralEnclosed:()=>Iy,Hash:()=>Vy,IdSelector:()=>Zy,Identifier:()=>Ky,Layer:()=>rb,LayerList:()=>cb,MediaQuery:()=>pb,MediaQueryList:()=>vb,NestingSelector:()=>Sb,Nth:()=>Cb,Number:()=>wb,Operator:()=>Eb,Parentheses:()=>jb,Percentage:()=>Ib,PseudoClassSelector:()=>Hb,PseudoElementSelector:()=>Jb,Ratio:()=>tx,Raw:()=>ox,Rule:()=>mx,Scope:()=>yx,Selector:()=>wx,SelectorList:()=>Ax,String:()=>Bx,StyleSheet:()=>Jx,SupportsDeclaration:()=>$x,TypeSelector:()=>sS,UnicodeRange:()=>yS,Url:()=>jS,Value:()=>IS,WhiteSpace:()=>HS})},AC={node:WS},jC=Hg({...GS,...kC,...AC}),MC=92;function NC(e){let t=e.length-1,n=``;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(i===MC){if(r===t)break;if(i=e.charCodeAt(++r),Od(MC,i)){let t=r-1,i=Vd(e,t);r=i-1,n+=Gd(e.substring(t+1,i))}else i===13&&e.charCodeAt(r+1)===10&&r++}else n+=e[r]}return n}var{tokenize:vee,parse:PC,generate:FC,lexer:yee,createLexer:bee,walk:IC,find:xee,findLast:See,findAll:Cee,toPlainObject:wee,fromPlainObject:Tee,fork:Eee}=jC,LC=new Set([`serif`,`sans-serif`,`monospace`,`cursive`,`fantasy`]),RC=e=>{let t=e.trim(),n=t[0];return(n===`"`||n===`'`)&&t.endsWith(n)&&t.length>=2?t.slice(1,-1):t.replace(/\s+/g,` `)},zC=e=>{let t=[],n=0,r;for(let i=0;i<e.length;i++){let a=e[i];r===void 0?a===`'`||a===`"`?r=a:a===`,`&&(t.push(RC(e.slice(n,i))),n=i+1):a===r&&(r=void 0)}return t.push(RC(e.slice(n))),t.filter(e=>e!==``)},BC=/^(?:xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large|larger|smaller|[+-]?(?:\d+\.?\d*|\.\d+)(?:[a-z]+|%)|(?:calc|clamp|min|max|var)\(.*\))$/i,VC=e=>{let t=[],n=``,r=0,i;for(let a of e.trim()){if(i!==void 0)a===i&&(i=void 0);else if(a===`'`||a===`"`)i=a;else if(a===`(`)r++;else if(a===`)`)r--;else if(/\s/.test(a)&&r===0){n!==``&&t.push(n),n=``;continue}n+=a}return n!==``&&t.push(n),t},HC=e=>{let t=VC(e),n=t.findIndex(e=>BC.test(e.replace(/\/.*$/,``)));if(n<0)return;let r=n+1,i=t[n];i.endsWith(`/`)?r+=1:!i.includes(`/`)&&t[r]?.startsWith(`/`)&&(r+=t[r]===`/`?2:1);let a=t.slice(r).join(` `);return a===``?void 0:a},UC=(e,t)=>{let n=e.replace(/\s*!important\s*$/i,``);if(!zC(n).some(e=>t.has(e.toLowerCase())))return!1;let r=n.slice(n.lastIndexOf(`,`)+1).trim();return!LC.has(r.toLowerCase())},WC=e=>({code:`email-font-fallback`,severity:`error`,message:`font-family ${JSON.stringify(e)} uses a project font without a generic fallback. Clients that drop webfonts (Gmail, classic Outlook) render this stack as written, so end it with sans-serif, serif or monospace.`}),GC=/\.woff2$/i,KC=/^woff2(?:-variations)?$/i,qC=/^[a-z][a-z0-9+.-]*:/i,JC=e=>e.type===`Declaration`?FC(e.value).trim():``,YC=(e,t,n)=>{let r=[],i=(e,n)=>r.push({code:e,severity:`error`,message:`${t}: ${n}`,origins:[]});if(e.type!==`Atrule`||e.block===null||e.block.children===null)return{rule:void 0,diagnostics:r};let a,o=0;for(let t of e.block.children){if(t.type!==`Declaration`)continue;let e=t.property.toLowerCase();if(e===`font-family`&&(a=RC(JC(t))),e!==`src`)continue;let r=JC(t),s;try{s=PC(r,{context:`value`})}catch{i(`email-font-src`,`@font-face src could not be parsed.`);continue}IC(s,{enter:e=>{if(e.type===`Function`&&e.name.toLowerCase()===`format`){let t=RC(FC(e).slice(7,-1));KC.test(t)||i(`email-font-format`,`@font-face format(${t}) is not supported. Email fonts are WOFF2 only; convert the file to .woff2.`);return}if(e.type!==`Url`)return;o++;let t=e.value,r=t.replace(/[?#].*$/,``);if(/^https:\/\//i.test(t)){!GC.test(r)&&!/format\(\s*['"]?woff2/i.test(FC(s))&&i(`email-font-format`,`@font-face src ${JSON.stringify(t)} is not a WOFF2 file. Email fonts are WOFF2 only.`);return}if(qC.test(t)||t.startsWith(`//`)){i(`email-font-src`,`@font-face src ${JSON.stringify(t)} must be a project .woff2 file or an https URL.`);return}if(!GC.test(r)){i(`email-font-format`,`@font-face src ${JSON.stringify(t)} is not a .woff2 file. Email fonts are WOFF2 only; convert the file to .woff2.`);return}let a=n?.(t);if(a===void 0){i(`email-font-missing`,`@font-face src ${JSON.stringify(t)} names no file in the project. Paths resolve from the stylesheet's own directory.`);return}e.value=a}}),t.value={type:`Raw`,value:FC(s).replace(/\)(?=(?:format|tech)\()/gi,`) `)}}return(a===void 0||a===``)&&i(`email-font-family`,`@font-face declares no font-family.`),o===0&&i(`email-font-src`,`@font-face declares no url() src.`),r.length>0||a===void 0?{rule:void 0,diagnostics:r}:{rule:{family:a,css:FC(e)},diagnostics:r}},XC=2**53-1,ZC=new Set([`media`,`supports`,`container`]),QC=new Set([`page`,`counter-style`,`keyframes`]),$C=new Set([`:root`,`:host`,`html`,`*`,`:where(:root)`]),ew=e=>e==null?``:FC(e),tw=e=>{let t=0,n=0,r=0,i=e=>{switch(e.type){case`IdSelector`:t+=1;break;case`ClassSelector`:case`AttributeSelector`:n+=1;break;case`PseudoClassSelector`:e.name!==`where`&&(n+=1);break;case`TypeSelector`:e.name!==`*`&&(r+=1);break;case`PseudoElementSelector`:r+=1}if(`children`in e&&e.children!==null&&e.children!==void 0)for(let t of e.children)i(t)};return i(e),[t,n,r]},nw=e=>{let t=!1,n=e=>{if((e.type===`PseudoClassSelector`||e.type===`PseudoElementSelector`)&&(t=!0),`children`in e&&e.children!==null&&e.children!==void 0)for(let t of e.children)n(t)};return n(e),t},rw={" ":`descendant`,">":`child`,"+":`adjacent`,"~":`sibling`},iw=e=>{let t;try{t=PC(e,{context:`selector`,positions:!1})}catch{return}if(t.type!==`Selector`||t.children===null)return;let n=[],r,i,a=[],o=[],s=!1,c=e=>{n.push({compound:{tag:r,id:i,classes:a,attributes:o,opaque:s},...e===void 0?{}:{after:e}}),r=void 0,i=void 0,a=[],o=[],s=!1};for(let e of t.children)switch(e.type){case`TypeSelector`:e.name!==`*`&&(r=e.name.toLowerCase());break;case`IdSelector`:i=e.name;break;case`ClassSelector`:a.push(NC(e.name));break;case`AttributeSelector`:o.push({name:e.name.name,operator:e.matcher??void 0,value:e.value===null||e.value===void 0?void 0:e.value.type===`String`?e.value.value:e.value.name});break;case`Combinator`:c(rw[e.name.trim()===``?` `:e.name]??`descendant`);break;default:s=!0}return c(),{parts:n}},aw=(e,t)=>t.includes(`&`)?t.replaceAll(`&`,e):`${e} ${t}`,ow=(e,t={})=>{let n=[],r=[],i=[],a={},o={},s=new Set,c=[],l=new Map,u=new Map,d=t.startOrder??0,f=e=>{let t=u.get(e);if(t!==void 0)return t;let n;try{let t=PC(e,{context:`selector`,positions:!1}),r=new Set;IC(t,{visit:`ClassSelector`,enter:e=>{r.add(NC(e.name))}}),n={classes:[...r],specificity:tw(t),pseudo:nw(t),matcher:iw(e)}}catch{n={classes:[],specificity:[0,0,0],pseudo:!0,matcher:void 0}}return u.set(e,n),n},p;try{p=PC(e,{parseValue:!1,parseCustomProperty:!1,positions:!1})}catch(e){return{rules:[],headAtRules:[],fontFaces:[],variables:{},darkVariables:{},diagnostics:[{code:`css-parse-error`,severity:`error`,message:`${t.origin??`stylesheet`} could not be parsed: ${String(e)}`,origins:[]}]}}let m=e=>{let t=[];if(e===null||e.type!==`Block`||e.children===null)return t;for(let n of e.children)n.type===`Declaration`&&t.push({property:n.property,value:ud(ew(n.value).trim().replace(/[\t\n\r\f]/g,` `)),important:n.important===!0});return t},h=(e,t,r)=>{if(r.length===0)return;let i=f(e);if($C.has(e.trim()))for(let e of r)e.property.startsWith(`--`)&&(t.conditions.length===0?a[e.property]=e.value:md(t.conditions)?o[e.property]=e.value:s.add(e.property));n.push({selector:e,classes:i.classes,specificity:i.specificity,declarations:r,order:d++,layer:t.layer,conditions:t.conditions,inlinable:t.conditions.length===0&&!i.pseudo,matcher:i.matcher})},g=(e,t)=>{if(e===null||e.type!==`Block`||e.children===null)return;let n=m(e);n.length>0&&t.selector!==void 0&&h(t.selector,t,n);for(let n of e.children)n.type!==`Declaration`&&_(n,t)},_=(e,n)=>{if(e.type===`Rule`){let t=e.prelude,r=t.type===`SelectorList`&&t.children!==null?[...t.children]:[t];for(let t of r){let r=ew(t).trim();r!==``&&g(e.block,{...n,selector:n.selector===void 0?r:aw(n.selector,r)})}return}if(e.type!==`Atrule`)return;let u=e.name.toLowerCase();if(u===`layer`){let t=ew(e.prelude).trim();if(e.block===null){for(let e of t.split(`,`).map(e=>e.trim()))e!==``&&!l.has(e)&&l.set(e,l.size);return}let r=t.split(`,`)[0]?.trim()??``;r!==``&&!l.has(r)&&l.set(r,l.size),g(e.block,{...n,layer:l.get(r)??n.layer});return}if(u===`theme`||u===`scope`){let t=n.conditions.length===0?a:md(n.conditions)?o:void 0;for(let n of m(e.block))n.property.startsWith(`--`)&&(t===void 0?s.add(n.property):t[n.property]=n.value);for(let t of e.block?.children??[])t.type!==`Declaration`&&_(t,n);return}if(u===`property`){let t=m(e.block).find(e=>e.property===`initial-value`),n=ew(e.prelude).trim();t!==void 0&&n.startsWith(`--`)&&!(n in a)&&(a[n]=t.value);return}if(ZC.has(u)){g(e.block,{...n,conditions:[...n.conditions,`@${u} ${ew(e.prelude).trim()}`]});return}if(u===`font-face`){let n=YC(e,t.origin??`stylesheet`,t.resolveFontFile);n.rule!==void 0&&i.push(n.rule),c.push(...n.diagnostics);return}if(QC.has(u)){r.push(FC(e));return}if(u===`import`){if(t.themeImports===!0)return;c.push({code:`css-import-unresolved`,severity:`error`,message:`${t.origin??`stylesheet`} uses @import ${ew(e.prelude).trim()}; import the stylesheet from the template module instead so the compiler can resolve it.`,origins:[]});return}u!==`charset`&&u!==`namespace`&&c.push({code:`css-unsupported-at-rule`,severity:`warning`,message:`@${u} is not applied to email output; remove it or move the declarations into a class rule.`,origins:[]})};if(p.type===`StyleSheet`&&p.children!==null)for(let e of p.children)_(e,{conditions:[],layer:XC});for(let e of s)e in a&&c.push({code:`css-conditional-variable`,severity:`warning`,message:`${e} is redefined inside a conditional at-rule. Inlined declarations take the unconditional value; keep the override on a class rule so the retained head rule can apply it.`,origins:[]});return{rules:n,headAtRules:r,fontFaces:i,variables:a,darkVariables:o,diagnostics:c}},sw=e=>{let t=e.props.class??e.props.className;return typeof t==`string`?t.split(/\s+/).filter(e=>e!==``):[]},cw=(e,t)=>{let n=e.props[t];if(n!=null&&n!==!1)return n===!0?``:typeof n==`string`||typeof n==`number`?String(n):void 0},lw=(e,t)=>{let n=t.name===`class`?sw(e).join(` `):cw(e,t.name);if(n===void 0)return!1;if(t.operator===void 0||t.value===void 0)return!0;switch(t.operator){case`=`:return n===t.value;case`~=`:return n.split(/\s+/).includes(t.value);case`^=`:return n.startsWith(t.value);case`$=`:return n.endsWith(t.value);case`*=`:return n.includes(t.value);case`|=`:return n===t.value||n.startsWith(`${t.value}-`);default:return!1}},uw=(e,t)=>{if(t.opaque||t.tag!==void 0&&t.tag!==e.tag||t.id!==void 0&&cw(e,`id`)!==t.id)return!1;if(t.classes.length>0){let n=sw(e);if(!t.classes.every(e=>n.includes(e)))return!1}return t.attributes.every(t=>lw(e,t))},dw=(e,t,n)=>{if(n===void 0)return!1;let r=e.parts[t];if(r===void 0||!uw(n.element,r.compound))return!1;let i=e.parts[t-1];if(i===void 0)return!0;switch(i.after??`descendant`){case`child`:return dw(e,t-1,n.parent);case`descendant`:for(let r=n.parent;r!==void 0;r=r.parent)if(dw(e,t-1,r))return!0;return!1;case`adjacent`:{let r=n.previous.at(-1);return r!==void 0&&dw(e,t-1,{element:r,parent:n.parent,previous:n.previous.slice(0,-1)})}case`sibling`:for(let r=n.previous.length-1;r>=0;r--)if(dw(e,t-1,{element:n.previous[r],parent:n.parent,previous:n.previous.slice(0,r)}))return!0;return!1}},fw=(e,t)=>e===void 0||e.parts.length===0?!1:dw(e,e.parts.length-1,t),pw=(e=>e)({"issue-layout":{summary:`A newsletter issue layout does not declare only an email channel.`,fix:`Use an email-only defineTemplate layout with one IssueContent slot.`},"issue-slot":{summary:`An issue layout does not contain exactly one unconditional content slot.`,fix:`Import IssueContent from @samva/markup/email and place one <IssueContent /> outside loops and conditions.`},"markdown-syntax":{summary:`An issue contains syntax outside SML Markdown.`,fix:`Write Markdown prose and supported SML component tags.`},"markdown-expression":{summary:`An issue contains an expression or spread, which is never evaluated.`,fix:`Replace expressions with literal prose or quoted static component attributes.`},"markdown-html":{summary:`An issue contains raw HTML rather than a supported SML component.`,fix:`Use Markdown syntax or a component from the closed SML component set.`},"markdown-frontmatter":{summary:`Issue frontmatter is missing or does not match the typed contract.`,fix:`Provide title, slug and topic strings; use only the documented preheader, seo and gate fields.`},"markdown-prop":{summary:`A Markdown component has an unknown, missing or invalid literal prop.`,fix:`Use the component's documented props with quoted static values or bare boolean flags.`},"no-template":{summary:`The entry does not default-export a template.`,fix:`Default-export defineTemplate({ ... }) imported from @samva/markup.`},"legacy-definition":{summary:`The entry default-exports something other than defineTemplate.`,fix:`Import { defineTemplate } from "@samva/markup" and default-export defineTemplate({ ... }).`,upgrade:[`Read the entry and its imports without executing them. For a default-exported defineEmail definition, import defineTemplate from "@samva/markup" and replace the definition call.`,`Preserve the entry path, template id, schema, named fixtures, content, design, bindings, conditions, project partials, assets, theme and brand imports. Replace render(input) returning { subject, preheader?, body } with email: { subject: (input) => ..., preheader: (input) => ..., body: (input) => ... }, retaining its parameter bindings and each returned expression; omit preheader when absent.`,`Inline module constants only when they are literal strings, numbers or booleans and their bindings are unambiguous; never substitute a fixture value for an input binding. Keep each channel function a single static-profile expression, and keep subject and preheader off <Email>.`,"Helper calls, `Math.*`, general arithmetic, render statements, spreads, computed properties and runtime clock or seed have no direct conversion. Rewrite with static-profile bindings, conditions, .map, .filter, project partials or `fmt.*` where equivalent; arithmetic is allowed only in formatter arguments and conditions. Otherwise compute the value in the sender, declare a payload field in the schema and every fixture, and explain the required sender change. Never guess time, randomness or computed data.",`Explicit text has no email-channel field: plain text is derived from the body. If deriving it changes intended content, or another construct cannot be preserved, explain the tradeoff and ask rather than silently discard it. Do not drop fixtures, weaken validation or hide diagnostics.`,`Convert every affected entry in the project at its existing path, including emails/ entries. Compile each entry, render every declared fixture and inspect the affected output. Resolve errors before requesting one saved version for the whole project, approved by the user; do not publish.`].join(`
|
|
54
|
+
|
|
55
|
+
`)},"dynamic-definition":{summary:`A definition field is spread or computed instead of written out.`,fix:`Write each field as name: value.`},"invalid-template-id":{summary:`The template id is not a lowercase kebab-case string literal.`,fix:`Write id: "order-shipped".`},"missing-schema":{summary:`The template declares no input schema.`,fix:`Add schema: jsonSchema<Input>({ ... }).`},"schema-not-static":{summary:`The schema cannot be read without running code.`,fix:`Write the schema as a literal jsonSchema<Input>({ type: 'object', ... }).`},"invalid-schema":{summary:`The schema uses JSON Schema keywords the compiler cannot validate against.`,fix:`Use only the JSON Schema keywords the package README lists.`},"missing-fixtures":{summary:`The template declares no fixtures.`,fix:`Add fixtures: { default: { ... } } with at least one valid payload.`},"fixtures-not-static":{summary:`A fixture is computed instead of written as data.`,fix:`Write each fixture as a literal object; an imported asset is allowed.`},"invalid-fixture-name":{summary:`A fixture key is not a single path segment.`,fix:`Use letters, digits, '.', '_' and '-', starting with a letter or digit.`},"fixture-invalid":{summary:`A fixture does not match the schema.`,fix:`Change the fixture, or the schema, so every fixture is a payload a send could carry.`},"invalid-locale":{summary:`The template's default locale is not a string literal.`,fix:`Write locale: "en-US".`},"no-channel":{summary:`The template declares no channel body.`,fix:`Add an email body.`},"invalid-channel":{summary:`A channel field is not shaped as the channel requires.`,fix:`Write email: { subject, preheader?, body } with each a function of the input.`},"not-a-function":{summary:`A channel field is not a function of the input.`,fix:`Write (input) => ... in place or declare the function in the project.`},"missing-subject":{summary:`The email channel has no subject.`,fix:`Add subject: (input) => ....`},"missing-body":{summary:`The email channel has no body.`,fix:`Add body: (input) => (<Email>...</Email>).`},"multiple-roots":{summary:`The body renders nothing or more than one root.`,fix:`Wrap the body in a single element such as <Email>.`},"preheader-without-shell":{summary:`A preheader is set but the body has no <Email> shell to hold it.`,fix:`Wrap the body in <Email>.`},"wrong-channel":{summary:`A channel body does not return its own channel component.`,fix:`Return one element imported from the channel package.`,channelOnly:!0},"syntax-error":{summary:`A project file does not parse as TSX.`,fix:`Fix the syntax at the reported location.`},"non-project-import":{summary:`The file imports something other than @samva/markup or a project file.`,fix:`Remove the import, or copy the code you need into a project file.`},"moved-import":{summary:`The file imports an @samva/markup entry that moved.`,fix:`Import email components from "@samva/markup/email".`,upgrade:[`Replace every import from "@samva/markup/email/components" with "@samva/markup/email" in every project file, templates and partials alike. The imported names are unchanged; change only the specifier.`,`Compile each entry and render every declared fixture to confirm the output is unchanged. Resolve errors before requesting one saved version for the whole project, approved by the user; do not publish.`].join(`
|
|
56
|
+
|
|
57
|
+
`)},"unresolved-import":{summary:`An import names no file in the project.`,fix:`Check the path and the file extension.`},"recursive-partial":{summary:`A partial renders itself; partials are inlined at compile time.`,fix:`Flatten the recursion, or repeat the structure with .map.`},"nesting-limit":{summary:`The template nests deeper than the compiler reads.`,fix:`Flatten the structure.`},"dynamic-expression":{summary:`An expression outside the static profile: a call other than fmt.* and .map, a computed value, or a spread.`,fix:`Compute the value where the message is sent and bind it from the payload.`},"statement-in-body":{summary:`A body contains a statement (const, if, a loop); a body is one expression.`,fix:`Use cond && <X />, cond ? <A /> : <B /> and .map, or send the computed value in the payload.`},"unsupported-pattern":{summary:`A parameter pattern or default value the profile cannot bind.`,fix:`Use plain names or destructuring without defaults; declare the field required or guard it.`},"hook-call":{summary:`A hook was called; templates have no state, effects or context.`,fix:`Read the input through the function's parameter and send anything else in the payload.`},"unknown-formatter":{summary:`fmt.<name> is not a formatter.`,fix:`Use fmt.money, number, date, time, plural or list.`},"formatter-arguments":{summary:`A formatter got the wrong number of arguments.`,fix:`Match the formatter's signature in the contract.`},"reserved-character":{summary:`Text contains a private-use character the compiler reserves.`,fix:`Remove the characters U+E000 to U+E003.`},"reserved-url":{summary:`A URL is the unsubscribe placeholder only BrandFooter can write.`,fix:`Render <BrandFooter /> instead.`},"reserved-attribute":{summary:`An attribute is written only by a brand component.`,fix:`Render BrandFooter from the brand import instead of marking an element as the footer.`},"dynamic-class":{summary:`A class name is built at run time, and Tailwind cannot see it.`,fix:`Write classes literally, or choose between literal lists: input.vip ? "bg-amber-100" : "bg-white".`},"too-many-class-variants":{summary:`A class list chooses between more literal lists than the compiler resolves.`,fix:`Split the choice into fewer conditions, or move part of it to a partial.`},"invalid-style":{summary:`A style prop is not a static property object.`,fix:`Write style={{ backgroundColor: "#fff" }} with literal values, or use classes.`},"unknown-field":{summary:`A binding names a field the schema does not declare.`,fix:`Add the field to the schema, or bind a field it declares (the message suggests the nearest).`},"unguarded-optional":{summary:`An optional field is read outside a guard, so a send without it would render a blank.`,fix:`Guard it with {input.field && ...}, or make the field required.`},"invalid-binding-type":{summary:`A binding has the wrong type for where it is used.`,fix:`Bind a field of the type the position needs, or send it in that type.`},"unknown-component":{summary:`A component the profile cannot read.`,fix:`Import components from @samva/markup/email, the brand import, or the project.`},"dynamic-numeric-prop":{summary:`A prop that sizes layout at compile time is not a number literal.`,fix:`Write the number literally, for example height={44}.`},"button-dynamic-label":{summary:`A Button label is read at render time, so classic Outlook cannot size it.`,fix:`Give the button a width: <Button width={200}>.`},"invalid-columns-each":{summary:`<Columns each> is not a list from the input.`,fix:`Write each={input.items} with a callback returning <Column>.`},"invalid-columns-per":{summary:`<Columns per> is not a positive integer literal.`,fix:`Write per={2}.`},"invalid-columns-gap":{summary:`<Columns gap> is set on a Columns whose cells are repeated with each or rendered conditionally.`,fix:`Write each Column out unconditionally, or pad the cells instead of using gap.`},"invalid-columns-stack":{summary:`<Columns stack> is not a true or false literal.`,fix:`Write stack={false}, or leave it out to stack on narrow screens.`},"invalid-button-number":{summary:`A Button size prop is not a finite number.`,fix:`Pass a finite number.`},"invalid-number-prop":{summary:`A primitive's numeric prop, such as <Email gutter>, is not a finite number in range.`,fix:`Pass a finite number the message allows, for example gutter={16}.`},"unsupported-element":{summary:`An element outside the supported email vocabulary.`,fix:`Use an element from the contract's element table.`},"unsupported-attribute":{summary:`An attribute the element does not support.`,fix:`Use a supported attribute, or data-* and aria-*.`},"missing-attribute":{summary:`An element is missing a required attribute.`,fix:`Add the attribute, for example alt on img.`},"invalid-attribute-value":{summary:`An attribute value is not a string or number, or contains control characters.`,fix:`Pass plain text.`},"duplicate-attribute":{summary:`An attribute is written twice.`,fix:`Keep one.`},"invalid-content":{summary:`An element holds content its content model does not allow.`,fix:`Move the child to a parent that accepts it.`},"void-element-children":{summary:`A void element has children.`,fix:`Remove the children.`},"event-handler":{summary:`An event handler; email clients strip scripting.`,fix:`Remove the handler; use a link for interaction.`},"dangerous-html":{summary:`dangerouslySetInnerHTML; there is no raw-HTML escape hatch.`,fix:`Write the markup as JSX.`},"unsafe-url":{summary:`A URL uses a scheme email cannot send safely.`,fix:`Use an https URL, a mailto: or tel: link, or a bound URL.`},"unsafe-raw-text":{summary:`Raw text content contains markup that could end its element.`,fix:`Remove the offending sequence.`},"unsupported-style-property":{summary:`A style property name is not a CSS property.`,fix:`Write camelCase (backgroundColor) or a custom property (--brand).`},"invalid-style-value":{summary:`A style value is not a string or number.`,fix:`Pass a string or number.`},"unsafe-style-value":{summary:`A style value contains CSS that could break out of its declaration.`,fix:`Remove the offending characters.`},"missing-head":{summary:`Styles that cannot be inlined need a <head> to live in.`,fix:`Wrap the message in <Email>, or write those declarations inline.`},"invalid-subject":{summary:`The subject is not one line of text.`,fix:`Return a single-line string.`},"invalid-preheader":{summary:`The preheader is not a string.`,fix:`Return a string.`},"invalid-text":{summary:`The plain-text body is not a string.`,fix:`Return a string.`},"button-outlook-fallback":{summary:`Classic Outlook needs a height and a plain string label to draw the button.`,fix:`Give <Button> a height and a string label.`},"unmatched-class":{summary:`A class produced no styles.`,fix:`Use a class the theme or Tailwind defines, or write the style inline.`},"tailwind-dynamic-class":{summary:`A class list is assembled at run time.`,fix:`Write the classes literally.`},"css-parse-error":{summary:`A stylesheet does not parse.`,fix:`Fix the CSS at the reported location.`},"css-import-unresolved":{summary:`A stylesheet @import cannot be resolved.`,fix:`Import the stylesheet from the template module, or use the theme.css layers.`},"css-unsupported-at-rule":{summary:`An at-rule is not applied to email output.`,fix:`Remove it or move the declarations into a class rule.`},"css-conditional-variable":{summary:`A custom property is redefined inside a conditional at-rule.`,fix:`Keep the override on a class rule.`},"email-contrast":{summary:`Text, or a filled button against its surroundings, falls below the contrast ratio in light or dark mode (below 1.5:1 a button is indistinguishable from its surface; WCAG 1.4.11 asks 3:1).`,fix:`Pair background and text tokens (bg-primary with text-primary-foreground), give the theme's dark-mode @theme a value for the token, or choose colors that reach the required ratio.`,upgrade:[`Move the project's theme onto the theme vocabulary with one dark-mode block. In starter.css and theme.css, rename each color token to the vocabulary name for its role (reference.md, Theme): a page color to --color-background, the main text to --color-foreground, a surface to --color-card with --color-card-foreground, the brand or action color to --color-primary with --color-primary-foreground, subdued text to --color-muted-foreground, a highlight to --color-accent with --color-accent-foreground, rules to --color-border, body and heading fonts to --font-sans and --font-heading, and a corner radius to --radius. Keep every value.`,`Move each --color-<name>-dark value into @media (prefers-color-scheme: dark) { @theme { --color-<name>: <value>; } } under the renamed token, and delete the -dark tokens. In every template and partial, rename the utilities to match (bg-surface to bg-card, text-muted to text-muted-foreground, and so on) and delete each dark:…-dark class whose token now has a dark value; keep a dark: class only where it picks a different token in dark mode.`,`Then fix what email-contrast still reports at its location: pair each fill with its -foreground token, or give the dark block a value that reaches the ratio. Do not weaken the design to pass: keep the brand's colors and adjust the paired token.`,`Compile every entry and render every fixture in light and dark mode; confirm the light render is unchanged apart from fixes. Resolve errors before requesting one saved version for the whole project, approved by the user; do not publish.`].join(`
|
|
58
|
+
|
|
59
|
+
`)},"email-font-fallback":{summary:`A font stack names a project font without a generic fallback.`,fix:`End the stack with sans-serif, serif or monospace.`},"email-font-family":{summary:`@font-face declares no font-family.`,fix:`Add font-family.`},"email-font-src":{summary:`@font-face declares no usable url() src.`,fix:`Add a url() pointing at a .woff2 file.`},"email-font-format":{summary:`@font-face uses a format other than WOFF2.`,fix:`Convert the file to .woff2.`},"email-font-missing":{summary:`@font-face names a file the project does not hold.`,fix:`Add the file; paths resolve from the stylesheet's directory.`},"email-external-asset":{summary:`An image points at another site's URL; a hotlinked image can disappear, be blocked, track recipients or slow the message.`,fix:`Add the image to the project's files and import it (import logo from './logo.png'), then use the import as the src.`},"invalid-asset-base":{summary:`The asset base is not an https URL or a path.`,fix:`Use an https URL, an absolute path, or a relative path.`},"brand-unavailable":{summary:`The build has no brand to resolve a brand import.`,fix:`Create or select the brand the import names.`},"brand-import-conflict":{summary:`The project imports two different brands.`,fix:`Import one brand specifier everywhere.`},"email-component-degradation":{summary:`A component loses content or behavior when lowered to email.`,fix:`Compare the email and web previews; provide an email-safe equivalent for content readers need.`},"caniemail/unknown-coverage":{summary:`A feature has no client-support data.`,fix:`Verify it in the target clients.`},"invalid-attribute":{summary:`A channel component attribute has a value the channel does not accept.`,fix:`Use one of the listed values.`,channelOnly:!0},"unknown-attribute":{summary:`A channel component attribute the component does not have.`,fix:`Use one of the listed attributes.`,channelOnly:!0},"sms-markup":{summary:`An SMS body contains an element; SMS is plain text.`,fix:`Write text and bindings, with a newline for a line break.`,channelOnly:!0},"whatsapp-template-name":{summary:`A <WhatsApp> names its Meta template; the name comes from the template's handle.`,fix:"Remove `name` from <WhatsApp>.",upgrade:["Remove the `name` attribute from every <WhatsApp> element in the project, templates and partials alike. Samva registers each WhatsApp template with Meta under its handle, with hyphens as underscores, so the attribute has no replacement. Change nothing else.",`If an authored name differs from the name the handle produces and the template is already registered with Meta under it, tell the user: keeping that Meta name means renaming the template's handle, which you do not do yourself.`,`Compile each entry and render every declared fixture to confirm the WhatsApp output is otherwise unchanged. Resolve errors before requesting one saved version for the whole project, approved by the user; do not publish.`].join(`
|
|
60
|
+
|
|
61
|
+
`),channelOnly:!0},"whatsapp-structure":{summary:`WhatsApp content sits outside Header, Body, Footer or Buttons.`,fix:`Move it into <WhatsApp.Body>.`,channelOnly:!0},"whatsapp-body-required":{summary:`A WhatsApp template has no body.`,fix:`Add <WhatsApp.Body>...</WhatsApp.Body>.`,channelOnly:!0},"whatsapp-conditional":{summary:`A WhatsApp part branches or contains elements; Meta registers its text once.`,fix:`Choose the wording in the payload, or write separate templates.`,channelOnly:!0},"whatsapp-header-media":{summary:`A WhatsApp media header is not exactly one URL.`,fix:`Write the URL as the only child: a literal or one binding.`,channelOnly:!0},"whatsapp-header-variables":{summary:`A WhatsApp header text takes more than one variable.`,fix:`Keep one binding in the header and move the rest to the body.`,channelOnly:!0},"whatsapp-length":{summary:`A WhatsApp part exceeds Meta's length limit.`,fix:`Shorten the text.`,channelOnly:!0},"whatsapp-button-text":{summary:`A WhatsApp button has no label or value between its tags.`,fix:`Write the label or value as text between the tags.`,channelOnly:!0},"whatsapp-button-limit":{summary:`The conditions can produce more buttons of a kind than Meta allows.`,fix:`Remove buttons, or split the template.`,channelOnly:!0}}),mw=e=>Object.entries(pw).some(([t,n])=>t===e&&`upgrade`in n),hw=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)}},gw=class{start;end;filename;identifierName;constructor(e,t){this.start=e,this.end=t}};function _w(e,t){let{line:n,column:r,index:i}=e;return new hw(n,r+t,i+t)}var vw=`BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED`,yw={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:vw},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:vw}},bw={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`},xw=e=>e.type===`UpdateExpression`?bw.UpdateExpression[`${e.prefix}`]:bw[e.type],Sw={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 ${xw(e)}.`,InvalidLhsBinding:({ancestor:e})=>`Binding invalid left-hand side in ${xw(e)}.`,InvalidLhsOptionalChaining:({ancestor:e})=>`Invalid optional chaining in the left-hand side of ${xw(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.`},Cw={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.`},ww={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)}\`.`},Tw=new Set([`ArrowFunctionExpression`,`AssignmentExpression`,`ConditionalExpression`,`YieldExpression`]),Ew={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 ${xw({type:e})}; please wrap it in parentheses.`,PipelineUnparenthesized:`Cannot mix binary operator with solo-await F#-style pipeline. Please wrap the pipeline in parentheses.`},Dw={UnsupportedBind:`Binding should be performed on object property.`,UnsupportedBindRHS:`The right-hand side of binding can not be super or import.`};function Ow(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!0,value:n})}function kw({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),Ow(l,`clone`,function(e={}){let{line:t,column:n,index:r=s}=e.loc??o;return a(new hw(t,n),r,{...c,...e.details})}),Ow(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 Aw(e,t){if(Array.isArray(e))return t=>Aw(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]=kw({code:`BABEL_PARSER_SYNTAX_ERROR`,reasonCode:r,toMessage:typeof a==`string`?()=>a:a,...t?{syntaxPlugin:t}:{},...o})}return n}var K={...Aw(yw),...Aw(Sw),...Aw(Cw),...Aw(ww),...Aw`pipelineOperator`(Ew),...Aw`functionBind`(Dw)};function jw(){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 Mw(e){let t=jw();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 Nw(e){let{start:t,end:n}=e.loc;return e.loc.start=new hw(t.line,t.column),e.loc.end=new hw(n.line,n.column),e}var Pw=e=>class extends e{createPosition(e){return new hw(e.line,e.column)}parse(){let e=super.parse();return this.optionFlags&512&&(e.tokens=e.tokens.map(Nw)),Nw(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 Nw(super.finishNodeAt(e,t,n))}finishNodeAtNode(e,t,n){return Nw(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),Nw(e)}resetEndLocation(e,t=this.state.lastTokEndLoc){super.resetEndLocation(e,t),Nw(e)}},Fw=!0,Iw=!0,Lw=!0,Rw=!0,zw=!0,Bw=!0,Vw=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}},Hw=new Map;function Uw(e,t={}){t.keyword=e;let n=Qw(e,t);return Hw.set(e,n),n}function Ww(e,t){return Qw(e,{beforeExpr:Fw,binop:t})}var Gw=-1,Kw=[],qw=[],Jw=[],Yw=[],Xw=[],Zw=[];function Qw(e,t={}){return++Gw,qw.push(e),Jw.push(t.binop??-1),Yw.push(t.beforeExpr??!1),Xw.push(t.startsExpr??!1),Zw.push(t.prefix??!1),Kw.push(new Vw(e,t)),Gw}function $w(e,t={}){return++Gw,Hw.set(e,Gw),qw.push(e),Jw.push(t.binop??-1),Yw.push(t.beforeExpr??!1),Xw.push(t.startsExpr??!1),Zw.push(t.prefix??!1),Kw.push(new Vw(`name`,t)),Gw}var eT={bracketL:Qw(`[`,{beforeExpr:Fw,startsExpr:Iw}),bracketR:Qw(`]`),braceL:Qw(`{`,{beforeExpr:Fw,startsExpr:Iw}),braceBarL:Qw(`{|`,{beforeExpr:Fw,startsExpr:Iw}),braceR:Qw(`}`),braceBarR:Qw(`|}`),parenL:Qw(`(`,{beforeExpr:Fw,startsExpr:Iw}),parenR:Qw(`)`),comma:Qw(`,`,{beforeExpr:Fw}),semi:Qw(`;`,{beforeExpr:Fw}),colon:Qw(`:`,{beforeExpr:Fw}),doubleColon:Qw(`::`,{beforeExpr:Fw}),dot:Qw(`.`),question:Qw(`?`,{beforeExpr:Fw}),questionDot:Qw(`?.`),arrow:Qw(`=>`,{beforeExpr:Fw}),template:Qw(`template`),ellipsis:Qw(`...`,{beforeExpr:Fw}),backQuote:Qw("`",{startsExpr:Iw}),dollarBraceL:Qw("${",{beforeExpr:Fw,startsExpr:Iw}),templateTail:Qw("...`",{startsExpr:Iw}),templateNonTail:Qw("...${",{beforeExpr:Fw,startsExpr:Iw}),at:Qw(`@`),hash:Qw(`#`,{startsExpr:Iw}),interpreterDirective:Qw(`#!...`),eq:Qw(`=`,{beforeExpr:Fw,isAssign:Rw}),assign:Qw(`_=`,{beforeExpr:Fw,isAssign:Rw}),slashAssign:Qw(`_=`,{beforeExpr:Fw,isAssign:Rw}),xorAssign:Qw(`_=`,{beforeExpr:Fw,isAssign:Rw}),moduloAssign:Qw(`_=`,{beforeExpr:Fw,isAssign:Rw}),incDec:Qw(`++/--`,{prefix:zw,postfix:Bw,startsExpr:Iw}),bang:Qw(`!`,{beforeExpr:Fw,prefix:zw,startsExpr:Iw}),tilde:Qw(`~`,{beforeExpr:Fw,prefix:zw,startsExpr:Iw}),doubleCaret:Qw(`^^`,{startsExpr:Iw}),doubleAt:Qw(`@@`,{startsExpr:Iw}),pipeline:Ww(`|>`,0),nullishCoalescing:Ww(`??`,1),logicalOR:Ww(`||`,1),logicalAND:Ww(`&&`,2),bitwiseOR:Ww(`|`,3),bitwiseXOR:Ww(`^`,4),bitwiseAND:Ww(`&`,5),equality:Ww(`==/!=/===/!==`,6),lt:Ww(`</>/<=/>=`,7),gt:Ww(`</>/<=/>=`,7),relational:Ww(`</>/<=/>=`,7),bitShift:Ww(`<</>>/>>>`,8),bitShiftL:Ww(`<</>>/>>>`,8),bitShiftR:Ww(`<</>>/>>>`,8),plusMin:Qw(`+/-`,{beforeExpr:Fw,binop:9,prefix:zw,startsExpr:Iw}),modulo:Qw(`%`,{binop:10,startsExpr:Iw}),star:Qw(`*`,{binop:10}),slash:Ww(`/`,10),exponent:Qw(`**`,{beforeExpr:Fw,binop:11,rightAssociative:!0}),_in:Uw(`in`,{beforeExpr:Fw,binop:7}),_instanceof:Uw(`instanceof`,{beforeExpr:Fw,binop:7}),_break:Uw(`break`),_case:Uw(`case`,{beforeExpr:Fw}),_catch:Uw(`catch`),_continue:Uw(`continue`),_debugger:Uw(`debugger`),_default:Uw(`default`,{beforeExpr:Fw}),_else:Uw(`else`,{beforeExpr:Fw}),_finally:Uw(`finally`),_function:Uw(`function`,{startsExpr:Iw}),_if:Uw(`if`),_return:Uw(`return`,{beforeExpr:Fw}),_switch:Uw(`switch`),_throw:Uw(`throw`,{beforeExpr:Fw,prefix:zw,startsExpr:Iw}),_try:Uw(`try`),_var:Uw(`var`),_const:Uw(`const`),_with:Uw(`with`),_new:Uw(`new`,{beforeExpr:Fw,startsExpr:Iw}),_this:Uw(`this`,{startsExpr:Iw}),_super:Uw(`super`,{startsExpr:Iw}),_class:Uw(`class`,{startsExpr:Iw}),_extends:Uw(`extends`,{beforeExpr:Fw}),_export:Uw(`export`),_import:Uw(`import`,{startsExpr:Iw}),_null:Uw(`null`,{startsExpr:Iw}),_true:Uw(`true`,{startsExpr:Iw}),_false:Uw(`false`,{startsExpr:Iw}),_typeof:Uw(`typeof`,{beforeExpr:Fw,prefix:zw,startsExpr:Iw}),_void:Uw(`void`,{beforeExpr:Fw,prefix:zw,startsExpr:Iw}),_delete:Uw(`delete`,{beforeExpr:Fw,prefix:zw,startsExpr:Iw}),_do:Uw(`do`,{isLoop:Lw,beforeExpr:Fw}),_for:Uw(`for`,{isLoop:Lw}),_while:Uw(`while`,{isLoop:Lw}),_as:$w(`as`,{startsExpr:Iw}),_assert:$w(`assert`,{startsExpr:Iw}),_async:$w(`async`,{startsExpr:Iw}),_await:$w(`await`,{startsExpr:Iw}),_defer:$w(`defer`,{startsExpr:Iw}),_from:$w(`from`,{startsExpr:Iw}),_get:$w(`get`,{startsExpr:Iw}),_let:$w(`let`,{startsExpr:Iw}),_meta:$w(`meta`,{startsExpr:Iw}),_of:$w(`of`,{startsExpr:Iw}),_sent:$w(`sent`,{startsExpr:Iw}),_set:$w(`set`,{startsExpr:Iw}),_source:$w(`source`,{startsExpr:Iw}),_static:$w(`static`,{startsExpr:Iw}),_using:$w(`using`,{startsExpr:Iw}),_yield:$w(`yield`,{startsExpr:Iw}),_asserts:$w(`asserts`,{startsExpr:Iw}),_checks:$w(`checks`,{startsExpr:Iw}),_exports:$w(`exports`,{startsExpr:Iw}),_global:$w(`global`,{startsExpr:Iw}),_implements:$w(`implements`,{startsExpr:Iw}),_intrinsic:$w(`intrinsic`,{startsExpr:Iw}),_infer:$w(`infer`,{startsExpr:Iw}),_is:$w(`is`,{startsExpr:Iw}),_mixins:$w(`mixins`,{startsExpr:Iw}),_proto:$w(`proto`,{startsExpr:Iw}),_require:$w(`require`,{startsExpr:Iw}),_satisfies:$w(`satisfies`,{startsExpr:Iw}),_keyof:$w(`keyof`,{startsExpr:Iw}),_readonly:$w(`readonly`,{startsExpr:Iw}),_unique:$w(`unique`,{startsExpr:Iw}),_abstract:$w(`abstract`,{startsExpr:Iw}),_declare:$w(`declare`,{startsExpr:Iw}),_enum:$w(`enum`,{startsExpr:Iw}),_module:$w(`module`,{startsExpr:Iw}),_namespace:$w(`namespace`,{startsExpr:Iw}),_interface:$w(`interface`,{startsExpr:Iw}),_type:$w(`type`,{startsExpr:Iw}),_opaque:$w(`opaque`,{startsExpr:Iw}),name:Qw(`name`,{startsExpr:Iw}),placeholder:Qw(`%%`,{startsExpr:Iw}),string:Qw(`string`,{startsExpr:Iw}),num:Qw(`num`,{startsExpr:Iw}),bigint:Qw(`bigint`,{startsExpr:Iw}),regexp:Qw(`regexp`,{startsExpr:Iw}),privateName:Qw(`#name`,{startsExpr:Iw}),eof:Qw(`eof`),jsxName:Qw(`jsxName`),jsxText:Qw(`jsxText`,{beforeExpr:Fw}),jsxTagStart:Qw(`jsxTagStart`,{startsExpr:Iw}),jsxTagEnd:Qw(`jsxTagEnd`)};function tT(e){return e>=89&&e<=129}function nT(e){return e<=88}function rT(e){return e>=54&&e<=129}function iT(e){return e>=54&&e<=132}function aT(e){return Yw[e]}function oT(e){return Xw[e]}function sT(e){return e>=25&&e<=29}function cT(e){return e>=125&&e<=127}function lT(e){return e>=86&&e<=88}function uT(e){return e>=54&&e<=88}function dT(e){return e>=35&&e<=55}function Dee(e){return e===30}function fT(e){return Zw[e]}function pT(e){return e>=117&&e<=119}function mT(e){return e>=120&&e<=126}function hT(e){return qw[e]}function gT(e){return Jw[e]}function _T(e){return e===53}function vT(e){return e>=20&&e<=21}function yT(e){return Kw[e]}var bT=class{constructor(e,t){this.token=e,this.preserveSpace=!!t}token;preserveSpace},xT={brace:new bT(`{`),j_oTag:new bT(`<tag`),j_cTag:new bT(`</tag`),j_expr:new bT(`<tag>...</tag>`,!0)},ST=/[\p{ID_Start}\u0558\u058b\u058c\u088f\u0c5c\u0cdc\u208f\u209d-\u209f\ua7ce\ua7cf\ua7d2\ua7d4\ua7dd\ua7e2\ua7f1\uab6c\uab6d]/u,CT=/[\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,wT=[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],TT=[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 ET(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 DT(e){return e<65?e===36:e<=90?!0:e<97?e===95:e<=122?!0:e<=65535?e>=170&&ST.test(String.fromCharCode(e)):!isNaN(e)&&e<=1114111&&(ST.test(String.fromCodePoint(e))||ET(e,wT))}function OT(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&&CT.test(String.fromCharCode(e)):!isNaN(e)&&e<=1114111&&(CT.test(String.fromCodePoint(e))||ET(e,wT)||ET(e,TT))}var kT={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`]},AT=new Set(kT.keyword),jT=new Set(kT.strict),MT=new Set(kT.strictBind);function NT(e,t){return t&&e===`await`||e===`enum`}function PT(e,t){return NT(e,t)||jT.has(e)}function FT(e){return MT.has(e)}function IT(e,t){return PT(e,t)||FT(e)}function LT(e){return AT.has(e)}function RT(e,t,n){return e===64&&t===64&&DT(n)}var zT=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 BT(e){return zT.has(e)}var VT=class{flags=0;names=new Map;firstLexicalName=``;constructor(e){this.flags=e}},HT=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 VT(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}}},UT=class extends VT{declareFunctions=new Set},WT=class extends HT{createScope(e){return new UT(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)}},GT=new Set([`_`,`any`,`bool`,`boolean`,`empty`,`extends`,`false`,`interface`,`mixed`,`null`,`number`,`static`,`string`,`true`,`typeof`,`void`]),KT=Aw`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 qT(e){return e.type===`DeclareExportAllDeclaration`||e.type===`DeclareExportDeclaration`&&(!e.declaration||e.declaration.type!==`TypeAlias`&&e.declaration.type!==`InterfaceDeclaration`)}function JT(e){return e.importKind===`type`||e.importKind===`typeof`}var YT={const:`declare export var`,let:`declare export var`,type:`export type`,interface:`export interface`};function XT(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 ZT=/\*?\s*@((?:no)?flow)\b/,QT=e=>class extends e{flowPragma=void 0;getScopeHandler(){return WT}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=ZT.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(KT.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(KT.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(KT.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),n.push(super.parseImport(e))):(this.expectContextual(121,KT.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=>{qT(e)?(r===`CommonJS`&&this.raise(KT.AmbiguousDeclareModuleKind,e),r=`ES`):e.type===`DeclareModuleExports`&&(i&&this.raise(KT.DuplicateDeclareModuleExports,e),r===`ES`&&this.raise(KT.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(KT.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:e,suggestion:YT[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(KT.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,t,n){GT.has(e)&&this.raise(n?KT.AssignReservedType:KT.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(KT.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()!==xT.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()===xT.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))&&iT(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(KT.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(KT.InexactInsideExact,this.state.lastTokStartLoc):this.raise(KT.InexactInsideNonObject,this.state.lastTokStartLoc),r&&this.raise(KT.InexactVariance,r),null):(a||this.raise(KT.UnexpectedSpreadType,this.state.lastTokStartLoc),n!=null&&this.unexpected(n),r&&this.raise(KT.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(KT.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`?KT.GetterMayNotHaveThisParam:KT.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(KT.ThisParamMustBeFirst,i),t=this.parseIdentifier(o),this.eat(13)&&(n=!0,o&&this.raise(KT.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(tT(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(KT.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(uT(this.state.type)){let e=hT(this.state.type);return this.next(),super.createIdentifier(t,e)}if(tT(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(rT(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)||tT(this.state.type)||this.match(64)||this.match(70)||this.match(78))return this.flowParseDeclare(e)}else if(tT(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||cT(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return e===122||cT(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(KT.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,[]]):XT(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(KT.DeclareClassElement,r):t.value&&this.raise(KT.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):RT(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(KT.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(KT.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(KT.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(KT.GetterMayNotHaveThisParam,n):this.isThisParam(n)&&this.raise(KT.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(KT.PatternIsOptional,e),this.isThisParam(e)&&this.raise(KT.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(10)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(KT.ThisParamAnnotationRequired,e),this.match(25)&&this.isThisParam(e)&&this.raise(KT.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(KT.TypeBeforeInitializer,n.typeAnnotation),n}parseImportSpecifierLocal(e,t,n){t.local=JT(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&&!rT(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&&rT(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=JT(e);return n&&c&&this.raise(KT.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===xT.j_oTag||a===xT.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(KT.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(KT.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(KT.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(KT.UnterminatedFlowComment,this.state.curPosition()),n}skipBlockComment(){if(this.hasPlugin(`flowComments`)&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(KT.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(KT.EnumBooleanMemberNotInitialized,e,t)}flowEnumErrorInvalidMemberInitializer(e,t){return this.raise(t.explicitType?t.explicitType===`symbol`?KT.EnumInvalidMemberInitializerSymbolType:KT.EnumInvalidMemberInitializerPrimaryType:KT.EnumInvalidMemberInitializerUnknownType,e,t)}flowEnumErrorNumberMemberNotInitialized(e,t){this.raise(KT.EnumNumberMemberNotInitialized,e,t)}flowEnumErrorStringMemberInconsistentlyInitialized(e,t){this.raise(KT.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(KT.EnumInvalidMemberName,o,{memberName:c,suggestion:c[0].toUpperCase()+c.slice(1),enumName:e}),n.has(c)&&this.raise(KT.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(!tT(this.state.type))throw this.raise(KT.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:t}=this.state;return this.next(),t!==`boolean`&&t!==`number`&&t!==`string`&&t!==`symbol`&&this.raise(KT.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(KT.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}},$T={__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:`♦`},eE=/\r\n|[\r\n\u2028\u2029]/g;function tE(e){switch(e){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function nE(e,t,n){for(let r=t;r<n;r++)if(tE(e.charCodeAt(r)))return!0;return!1}var rE=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,iE=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function aE(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 oE=Aw`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 sE(e){return e?e.type===`JSXOpeningFragment`||e.type===`JSXClosingFragment`:!1}function cE(e){if(e.type===`JSXIdentifier`)return e.name;if(e.type===`JSXNamespacedName`)return e.namespace.name+`:`+e.name.name;if(e.type===`JSXMemberExpression`)return cE(e.object)+`.`+cE(e.property);throw Error(`Node had unexpected type: `+e.type)}var lE=e=>class extends e{jsxReadToken(){let e=``,t=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(oE.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(oE.UnexpectedToken,this.state.curPosition(),{unexpected:this.input[this.state.pos],HTMLEntity:n===125?`}`:`>`});default:tE(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?`
|
|
62
|
+
`:`\r
|
|
63
|
+
`):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):tE(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=$T[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(OT(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:uT(this.state.type)?e.name=hT(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(xT.brace),this.next(),e=this.jsxParseExpressionContainer(e,xT.j_oTag),e.expression.type===`JSXEmptyExpression`&&this.raise(oE.AttributeIsEmpty,e),e;case 138:case 130:return this.parseExprAtom();default:throw this.raise(oE.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(xT.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(oE.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(xT.brace),this.next(),this.expect(17),e.argument=this.parseMaybeAssignAllowIn(),this.setContext(xT.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(xT.brace),this.next(),this.match(17)?n.push(this.jsxParseSpreadChild(e)):n.push(this.jsxParseExpressionContainer(e,xT.j_expr));break}default:this.unexpected()}sE(r)&&!sE(i)&&i!==null?this.raise(oE.MissingClosingTagFragment,i):(!sE(r)&&sE(i)||!sE(r)&&!sE(i)&&cE(i.name)!==cE(r.name))&&this.raise(oE.MissingClosingTagElement,i,{openingTagName:cE(r.name)})}if(sE(r)?(t.openingFragment=r,t.closingFragment=i):(t.openingElement=r,t.closingElement=i),t.children=n,this.match(43))throw this.raise(oE.UnwrappedAdjacentJSXElements,this.state.startLoc);return sE(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===xT.j_expr){this.jsxReadToken();return}if(t===xT.j_oTag||t===xT.j_cTag){if(DT(e)){this.jsxReadWord();return}if(e===62){++this.state.pos,this.finishToken(139);return}if((e===34||e===39)&&t===xT.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,xT.j_cTag),this.state.canStartJSXElement=!1;else if(n===138)t.push(xT.j_oTag);else if(n===139){let n=t[t.length-1];n===xT.j_oTag&&e===52||n===xT.j_cTag?(t.pop(),this.state.canStartJSXElement=t[t.length-1]===xT.j_expr):(this.setContext(xT.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=aT(n)}},uE=class extends VT{tsNames=new Map},dE=class extends HT{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 uE(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)}},fE=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 pE(e,t){e.trailingComments===void 0?e.trailingComments=t:e.trailingComments.unshift(...t)}function mE(e,t){e.leadingComments===void 0?e.leadingComments=t:e.leadingComments.unshift(...t)}function hE(e,t){e.innerComments===void 0?e.innerComments=t:e.innerComments.unshift(...t)}function gE(e,t,n){let r=null,i=t.length;for(;r===null&&i>0;)r=t[--i];r===null||r.start>n.start?hE(e,n.comments):pE(r,n.comments)}var _E=class extends fE{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&&pE(e.leadingNode,t),e.trailingNode!==null&&mE(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`:gE(n,n.properties,e);break;case`CallExpression`:case`NewExpression`:case`OptionalCallExpression`:gE(n,n.arguments,e);break;case`ImportExpression`:gE(n,[n.source,n.options??null],e);break;case`FunctionDeclaration`:case`FunctionExpression`:case`ArrowFunctionExpression`:case`ObjectMethod`:case`ClassMethod`:case`ClassPrivateMethod`:case`TSTypeParameterDeclaration`:gE(n,n.params,e);break;case`ArrayExpression`:case`ArrayPattern`:gE(n,n.elements,e);break;case`ExportNamedDeclaration`:case`ImportDeclaration`:gE(n,n.specifiers,e);break;case`TSEnumBody`:gE(n,n.members,e);break;case`TSInterfaceBody`:gE(n,n.body,e);break;default:hE(n,t)}else hE(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}}},vE=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 hw(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=[xT.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 hw(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}},yE=function(e){return e>=48&&e<=57},bE={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},xE={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 SE(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(CE(e,p,t,n)){l+=t.slice(d,n);break}if(p===92){l+=t.slice(d,n);let o=wE(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)+`
|
|
64
|
+
`,++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 CE(e,t,n,r){return e===`template`?t===96||t===36&&n.charCodeAt(r+1)===123:t===(e===`double`?34:39)}function wE(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(`
|
|
65
|
+
`);case 114:return s(`\r`);case 120:{let i;return{code:i,pos:t}=TE(e,t,n,r,2,!1,o,a),s(i===null?null:String.fromCharCode(i))}case 117:{let i;return{code:i,pos:t}=DE(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 TE(e,t,n,r,i,a,o,s){let c=t,l;return{n:l,pos:t}=EE(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 EE(e,t,n,r,i,a,o,s,c,l){let u=t,d=i===16?bE.hex:bE.decBinOct,f=i===16?xE.hex:i===10?xE.dec:i===8?xE.oct:xE.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:yE(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 DE(e,t,n,r,i,a){let o=e.charCodeAt(t),s;if(o===123){if(++t,{code:s,pos:t}=TE(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}=TE(e,t,n,r,4,!1,i,a));return{code:s,pos:t}}function OE(e,t,n){return new hw(n,e-t,e)}var kE=new Set([103,109,115,105,121,117,100,118]),AE=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 gw(e.startLoc,e.endLoc)}},jE,ME=class extends _E{isLookahead;tokens=[];constructor(e,t){super(),this.state=new vE,this.state.init(e),this.input=t,this.length=t.length,this.comments=[],this.isLookahead=!1,(!jE||jE.length<(this.length+1)*2)&&(jE=new Uint32Array((this.length+1)*2)),this.locData=jE}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 hw(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 AE(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 rE.lastIndex=e,rE.test(this.input)?rE.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 iE.lastIndex=e,iE.test(this.input)?iE.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,eE.lastIndex=n+2;eE.test(this.input)&&eE.lastIndex<=r;)++this.state.curLine,this.state.lineStart=eE.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 gw(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(;!tE(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 gw(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(aE(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());DT(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;!tE(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(DT(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,_w(e,1));let t=this.input.charCodeAt(i);if(tE(t))throw this.raise(K.UnterminatedRegExp,_w(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=()=>_w(e,i+2-t);for(;i<this.length;){let e=this.codePointAtPos(i),t=String.fromCharCode(e);if(kE.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(OT(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}=EE(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,_w(n,2),{radix:e}),this.input.charCodeAt(this.state.pos)===110&&(++this.state.pos,r=!0),DT(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,_w(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),DT(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}=DE(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}=SE(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}=SE(`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 hw(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(OT(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?DT:OT;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=Hw.get(t);n===void 0?this.finishToken(128,t):this.finishToken(n,hT(n))}checkKeywordEscapes(){let{type:e}=this.state;uT(e)&&this.state.containsEsc&&this.raise(K.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:hT(e)})}raise(e,t,n={}){let r=t instanceof hw?t:typeof t==`number`?this.getLoc(t):this.optionFlags&256?t.loc.start:this.getLoc(t.start),i=e(r,t instanceof hw?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 hw?t:this.optionFlags&256?t.loc.start:this.getLoc(t.start),i=t instanceof hw?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?hT(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,OE(t,n,r))}}errorHandlers_readInt={invalidDigit:(e,t,n,r)=>{this.raise(K.InvalidDigit,OE(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,OE(e,t,n))},unterminated:(e,t,n)=>{throw this.raise(K.UnterminatedString,OE(e-1,t,n))}};errorHandlers_readStringContents_template={...this.errorHandlers_readCodePoint,strictNumericEscape:this.errorBuilder(K.StrictNumericEscape),unterminated:(e,t,n)=>{throw this.raise(K.UnterminatedTemplate,OE(e,t,n))}}},NE=class{privateNames=new Set;loneAccessors=new Map;undefinedPrivateNames=new Map},PE=class{parser;stack=[];constructor(e){this.parser=e}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new NE)}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})}},FE=class{constructor(e=0){this.type=e}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},IE=class extends FE{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)}},LE=class{parser;stack=[new FE];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 RE(){return new FE(3)}function zE(){return new IE(1)}function BE(){return new IE(2)}function VE(){return new FE}var HE=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 UE(e,t){return(e?2:0)|!!t}var WE=class extends ME{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!(OT(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 nE(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return nE(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 iT(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 HE;let s=this.classScope;this.classScope=new PE(this);let c=this.expressionScope;return this.expressionScope=new LE(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)}},GE=class{shorthandAssignLoc=null;doubleProtoLoc=null;privateKeyLoc=null;optionalParametersLoc=null;voidPatternLoc=null},KE=class{constructor(e,t,n,r){this.start=n,this.end=0,r!==void 0&&(this.loc=new gw(r)),e&128&&(this.range=[n,0]),r!==void 0&&t&&(this.loc.filename=t)}type=``},qE=KE.prototype,JE=class extends WE{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 KE(t,n,e.index,this.createPosition(e)):new KE(t,n,e.index)}startNodeAtNode(e){let{optionFlags:t,filename:n}=this;return t&256?new KE(t,n,e.start,e.loc.start):new KE(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(qE);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(qE);return s.type=t,s.start=n,s.end=r,s.loc=i,s.range=a,s.extra=o,s.value=e.value,s}},YE=e=>e.type===`ParenthesizedExpression`?YE(e.expression):e,XE=class extends JE{toAssignable(e,t=!1){let n;switch((e.type===`ParenthesizedExpression`||e.extra?.parenthesized)&&(n=YE(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=YE(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?IT(e.name,this.inModule):FT(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}},ZE=class extends XE{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=nD(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 GE,i=!0),this.state.canStartArrow=!0;let a=this.parseMaybeConditional(e);if(t&&(a=this.parseParenItem(a,n)),sT(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`)?oT(e):oT(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>=gT(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(dT(r)&&(this.prodParam.hasIn||!this.match(54))){let i=gT(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=gT(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,_T(e)?t-1:t)}parseHackPipeBody(){let{startLoc:e}=this.state,t=this.parseMaybeAssign();return Tw.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(fT(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`)?oT(e):oT(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(;Dee(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(vT(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(BE()),i=new GE),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&&hE(e,t.innerComments),t.callee.trailingComments&&hE(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 DT(e)||e===62?this.expectOnePlugin([`jsx`,`flow`,`typescript`]):this.unexpected()}default:if(tT(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(tT(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=_w(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:hT(r)})}testTopicReferenceConfiguration(e,t,n){switch(e){case`hack`:return this.hasPlugin([`pipelineOperator`,{topicToken:hT(n)}]);default:throw this.raise(K.PipeTopicRequiresHackPipes,t)}}parseAsyncArrowUnaryFunction(e){this.prodParam.enter(UE(!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(_w(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(zE());let r=this.state.startLoc,i=[],a=new GE,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(_w(n,1));i===null&&(e||this.raise(K.InvalidEscapeSequenceTemplate,_w(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,`
|
|
66
|
+
`),cooked:i===null?null:i.slice(1,c)},o.tail=s,this.next();let u=this.finishNode(o,`TemplateElement`);return this.resetEndLocation(u,_w(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(rT(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(UE(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=UE(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(VE()),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;rT(r)?t=this.state.value:this.unexpected();let i=nT(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)&&BT(e)){if(n&<(e)){this.raise(K.UnexpectedKeyword,t,{keyword:e});return}if((this.state.strict?r?IT:PT:NT)(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||vT(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;dT(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){}},QE={kind:1},$E={kind:2},eD=/[\uD800-\uDFFF]/u,tD=/in(?:stanceof)?/y;function nD(e){for(let t=0;t<e.length;t++){let n=e[t],{type:r}=n;typeof r==`number`&&(n.type=yT(r))}return e}var rD=class extends ZE{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=nD(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`,_w(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(DT(e)){if(tD.lastIndex=t,tD.test(this.input)){let e=this.codePointAtPos(tD.lastIndex);if(!OT(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 tT(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(QE),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(QE);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 GE,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($E),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(QE),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=lT(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(UE(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||tT(this.state.type)?this.parseIdentifier():null}parseFunctionParams(e,t){this.expect(6),this.expressionScope.enter(RE()),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&&tT(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(VE()),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(tT(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(tT(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||tT(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=eD.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(rT(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 tT(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 rT(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`}},iD=/in(?:stanceof)?|as|satisfies/y;function aD(e){if(e==null)throw Error(`Unexpected ${e} value.`);return e}function oD(e){if(!e)throw Error(`Assert fail`)}var q=Aw`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 Oee(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 sD(e){return e===`private`||e===`public`||e===`protected`}function kee(e){return e===`in`||e===`out`}function cD(e){if(e.extra?.parenthesized)return!1;switch(e.type){case`Identifier`:return!0;case`MemberExpression`:return!e.computed&&cD(e.object);case`TSInstantiationExpression`:return cD(e.expression);default:return!1}}var Aee=dD([`declare`,`private`,`public`,`protected`,`override`,`abstract`,`readonly`,`static`],[`in`,`out`]),jee=dD([`readonly`],[`declare`,`abstract`,`private`,`protected`,`public`,`static`,`override`]),Mee=dD([`public`,`private`,`protected`,`override`,`readonly`]),Nee=dD([`private`,`public`,`protected`]),Pee=e=>class extends e{getScopeHandler(){return dE}tsIsIdentifier(){return tT(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(!tT(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=q.InvalidModifierOnTypeMember,n,r=!1){let i=(e,t,r,i)=>{t===r&&n[i]&&this.raise(q.InvalidModifiersOrder,e,{orderedModifiers:[r,i]})},a=(e,t,r,i)=>{(n[r]&&t===i||n[i]&&t===r)&&this.raise(q.IncompatibleModifiers,e,{modifiers:[r,i]})};for(;;){let{startLoc:o}=this.state,s=this.tsParseModifier(e,r,n.static);if(!s)break;sD(s)?n.accessibility?this.raise(q.DuplicateAccessibilityModifier,o,{modifier:s}):(i(o,s,s,`override`),i(o,s,s,`static`),i(o,s,s,`readonly`),n.accessibility=s):kee(s)?(n[s]&&this.raise(q.DuplicateModifier,o,{modifier:s}),n[s]=!0,i(o,s,`in`,`out`)):(Object.hasOwn(n,s)?this.raise(q.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 aD(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(q.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;tT(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,dD([`in`,`out`],[`const`,`public`,`private`,`protected`,`readonly`,`declare`,`abstract`,`override`]),q.InvalidModifierOnTypeParameter);tsParseConstModifier=this.tsParseModifiers.bind(this,dD([`const`],[`in`,`out`]),q.InvalidModifierOnTypeParameterPositions);tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,dD([`in`,`out`,`const`],[`public`,`private`,`protected`,`readonly`,`declare`,`abstract`,`override`]),q.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(q.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(q.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(),tT(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(q.ReadonlyForMethodSignature,e);let n=e;if(n.kind&&this.match(43)&&this.raise(q.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(q.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(q.AccessorCannotDeclareThisParameter,this.state.curPosition()),e.type===`Identifier`&&e.optional&&this.raise(q.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),e.type===`RestElement`&&this.raise(q.SetAccessorCannotHaveRestParameter,this.state.curPosition())}n.returnType&&this.raise(q.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(jee,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(q.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=rT(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(q.TupleOptionalAfterType,this.state.lastTokStartLoc))):(e=this.startNodeAt(n),e.optional=a,this.raise(q.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(tT(e)||e===84||e===80){let t=e===84?`TSVoidKeyword`:e===80?`TSNullKeyword`:Oee(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(q.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 pT(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(tT(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(),!tT(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(){oD(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(q.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());cD(t)||this.raise(q.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(q.EmptyHeritageClauseType,t,{token:e}),n}tsParseInterfaceDeclaration(e,t={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(125),t.declare&&(e.declare=!0),tT(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(q.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()!==xT.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):tT(t)?(this.raise(q.InlineModuleDeclarationMustUseString,this.state.startLoc),e.id=this.tsParseEntityName(0)):t===2?this.raise(q.EmptyNamespaceName,this.state.startLoc):(this.raise(q.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(q.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(q.InvalidModifierOnUsingDeclaration,this.state.startLoc,`declare`),e.declare=!0,this.parseVarStatement(e,`using`,!0);break;case 92:if(this.isAwaitUsing())return this.raise(q.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(tT(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)||tT(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)&&tT(this.state.type))return e.kind=`namespace`,this.tsParseNamespaceDeclaration(e);break;case 126:if(this.tsCheckLineTerminator(n)&&tT(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(q.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===xT.brace&&this.reScan_lt_gt(),this.expect(44),this.finishNode(e,`TSTypeParameterInstantiation`)}tsIsDeclarationStart(){return mT(this.state.type)}isExportDefaultSpecifier(){return!this.tsIsDeclarationStart()&&super.isExportDefaultSpecifier()}parseBindingElement(e,t){let n=t.length?null:this.state.startLoc,r={};this.tsParseModifiers(Mee,void 0,r);let i=r.accessibility,a=r.override,o=r.readonly;!(e&4)&&(i||o||a)&&this.raise(q.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(q.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(q.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(q.UnexpectedParameterModifier,t):t.type===`AssignmentPattern`&&this.raise(q.UnexpectedParameterInitializer,t);else for(let t of e.params)t.type===`AssignmentPattern`&&this.raise(q.UnexpectedParameterInitializer,t);return this.finishNode(e,r)}return r&&this.state.isAmbientContext&&(this.raise(q.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(q.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(vT(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&&oT(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(q.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(gT(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(q.ImportInTSNamespace,e),super.parseImport(e);let t;if(tT(this.state.type)&&this.lookaheadCharCode()===61){e.importKind=`value`;let t=this.tsParseImportEqualsDeclaration(e);return this.scope.inTSNamespace&&t.moduleReference.type===`TSExternalModuleReference`&&this.raise(q.ImportInTSNamespace,e),t}if(this.isContextual(126)){let n=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.scope.inTSNamespace&&this.raise(q.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(q.TypeImportCannotSpecifyDefaultAndNamed,t):this.scope.inTSNamespace&&this.raise(q.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(q.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(q.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(q.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(q.UsingDeclarationInAmbientContext,e,t),i;for(let e of i.declarations){let{id:n,init:i,definite:a}=e;a&&(i?this.raise(q.DeclaratorDefiniteAssertionWithInitializer,n):n.typeAnnotation||this.raise(q.DeclaratorDefiniteAssertionRequiresTypeAnnotation,n)),r&&i&&(t===`var`||t===`let`||n.typeAnnotation?this.raise(q.InitializerNotAllowedInAmbientContext,i):Iee(i,this.hasPlugin(`estree`))||this.raise(q.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(q.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(q.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(q.UnexpectedTypeDeclaration,e,`type`),this.next(),this.tsParseTypeAliasDeclaration(e)}}return super.parseStatementContent(e,t)}parseAccessModifier(){return this.tsParseModifier(Nee)}tsHasSomeModifiers(e,t){return t.some(t=>sD(t)?e.accessibility===t:!!e[t])}tsIsStartOfStaticBlocks(){return this.isContextual(102)&&this.lookaheadCharCode()===123}parseClassMember(e,t,n){this.tsParseModifiers(Aee,q.InvalidModifierOnTypeParameterPositions,t,!0);let r=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(t,[`declare`,`private`,`public`,`protected`,`override`,`abstract`,`readonly`,`static`])&&this.raise(q.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(q.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(q.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(q.IndexSignatureHasAbstract,t),t.accessibility&&this.raise(q.IndexSignatureHasAccessibility,t,{modifier:t.accessibility}),t.declare&&this.raise(q.IndexSignatureHasDeclare,t),t.override&&this.raise(q.IndexSignatureHasOverride,t);return}!this.state.inAbstractClass&&t.abstract&&this.raise(q.NonAbstractClassHasAbstractMethod,t),t.override&&(n.hadSuperClass||this.raise(q.OverrideNotInSubClass,t)),super.parseClassMemberWithIsStatic(e,t,n,r)}parsePostMemberNameModifiers(e){this.eat(13)&&(e.optional=!0),e.readonly&&this.match(6)&&this.raise(q.ClassMethodHasReadonly,e),e.declare&&this.match(6)&&this.raise(q.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(q.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let r=tT(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(q.DeclaratorDefiniteAssertionWithInitializer,e):t||this.raise(q.DeclaratorDefiniteAssertionRequiresTypeAnnotation,e))}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&(!e.readonly||e.typeAnnotation)&&this.match(25)&&this.raise(q.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(25)){let{key:t}=e;this.raise(q.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(q.PrivateElementHasAbstract,e),e.accessibility&&this.raise(q.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(q.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,t,n,r,i,a){let o=this.tsTryParseTypeParameters(this.tsParseConstModifier);o&&i&&this.raise(q.ConstructorHasTypeParameters,o);let{declare:s=!1,kind:c}=t;s&&(c===`get`||c===`set`)&&this.raise(q.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===xT.j_oTag||a===xT.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(q.SingleTypeParameterWithoutTrailingComma,this.optionFlags&256?_w(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&&(oD(!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(q.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(q.UnexpectedTypeCastInParameter,e):this.raise(q.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(q.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(q.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(q.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();rT(this.state.type)?(r=!0,n=t,e.local=this.parseIdentifier()):e.local=i}else rT(this.state.type)?e.local=this.parseIdentifier():(r=!0,n=t)}else rT(this.state.type)&&(r=!0,n=this.parseIdentifier(!0),this.isContextual(89)||this.checkReservedWord(n.name,n.start,!0,!0));r&&t&&this.raise(q.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();rT(this.state.type)?(r=!0,e.local=t,e.exported=this.parseModuleExportName()):e.exported=n}else rT(this.state.type)?e.exported=this.parseModuleExportName():(r=!0,e.local=t)}else rT(this.state.type)&&(r=!0,e.local=this.parseModuleExportName());r&&t&&this.raise(q.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(DT(e)){if(iD.lastIndex=t,iD.test(this.input)){let e=this.codePointAtPos(iD.lastIndex);if(!OT(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 Fee(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:uD(e.object)}function Iee(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!!(lD(e,t)||Lee(e,t)||n===`TemplateLiteral`&&e.expressions.length===0||Fee(e))}function lD(e,t){return t?e.type===`Literal`&&(typeof e.value==`number`||`bigint`in e):e.type===`NumericLiteral`||e.type===`BigIntLiteral`}function Lee(e,t){if(e.type===`UnaryExpression`){let{operator:n,argument:r}=e;if(n===`-`&&lD(r,t))return!0}return!1}function uD(e){return e.type===`Identifier`?!0:e.type!==`MemberExpression`||e.computed?!1:uD(e.object)}function dD(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 fD=Aw`placeholders`({ClassNameIsRequired:`A class name is required.`,UnexpectedSpace:`Unexpected space in placeholder.`}),Ree=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(fD.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(hT(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(fD.UnexpectedSpace,this.state.lastTokEndLoc)}},zee=e=>class extends e{parseV8Intrinsic(){if(this.match(50)){let e=this.state.startLoc,t=this.startNode();if(this.next(),tT(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)}},pD=[`fsharp`,`hack`],mD=[`^^`,`@@`,`^`,`%`,`#`];function Bee(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(!pD.includes(t)){let e=pD.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(!mD.includes(t)){let e=mD.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 hD={estree:Pw,jsx:lE,flow:QT,typescript:Pee,v8intrinsic:zee,placeholders:Ree},Vee=Object.keys(hD),gD=class extends rD{constructor(e,t,n){let r=Mw(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 HT}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 _D(e,t){if(t?.sourceType===`unambiguous`){t={...t};try{t.sourceType=`module`;let n=vD(t,e),r=n.parse();if(n.sawUnambiguousESM)return r;if(n.ambiguousScriptDifferentAst)try{return t.sourceType=`script`,vD(t,e).parse()}catch{}else r.program.sourceType=`script`;return r}catch(n){try{return t.sourceType=`script`,vD(t,e).parse()}catch{}throw n}}return vD(t,e).parse()}function Hee(e){let t={};for(let n of Object.keys(e))t[n]=yT(e[n]);return t}Hee(eT);function vD(e,t){let n=gD,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||{})}Bee(r),n=Uee(r)}return new n(e,t,r)}var yD=new Map;function Uee(e){let t=[];for(let n of Vee)e.has(n)&&t.push(n);let n=t.join(`|`),r=yD.get(n);if(!r){r=gD;for(let e of t)r=hD[e](r);yD.set(n,r)}return r}var bD=e=>e.includes(`/`)?e.slice(0,e.lastIndexOf(`/`)):``,xD=(e,t)=>{let n=t.startsWith(`/`)||e===``?[]:e.split(`/`);for(let e of t.split(`/`))if(e!==``&&e!==`.`){if(e===`..`){if(n.length===0)return;n.pop()}else n.push(e)}return n.length===0?void 0:n.join(`/`)},SD=class{items=[];locate(e,t){let n=e.position(t.start);return{fileName:e.path,lineNumber:n.line,columnNumber:n.column}}add(e,t,n,r,i,a=`error`){this.report({code:n,severity:a,message:r,...i===void 0?{}:{fix:i},origins:[this.locate(e,t)]})}report(e){let t=pw[e.code];this.items.push({...e,...t.upgrade===void 0?{}:{upgrade:t.upgrade}})}get blocking(){return this.items.some(e=>e.severity===`error`)}},CD=(e,t,n)=>e.map(e=>{if(yc(e)||!(`type`in e))return e;let r=e.children===void 0?{}:{children:CD(e.children,t,n)},i=e.src===void 0?{}:{src:[e.src[0],e.src[1],t]};if(e.type===`component`&&(e.name===`BrandLogo`||e.name===`BrandFooter`)&&n!==void 0){let{css:t,...a}=n;return{...e,...r,...i,brand:a}}return{...e,...r,...i}}),wD=`sml-issue-content`,TD=(e,t,n)=>{let r=0,i=(e,a)=>e.flatMap(e=>yc(e)?[e]:`type`in e&&e.type!==`component`&&e.tag===`sml-issue-content`?(r++,a&&n(e.src),[...t]):`if`in e?[{...e,then:i(e.then,!0),...e.else===void 0?{}:{else:i(e.else,!0)}}]:`each`in e?[{...e,children:i(e.children,!0)}]:[{...e,...`children`in e&&e.children!==void 0?{children:i(e.children,a)}:{}}]);return{nodes:i(e,!1),count:r}},ED=e=>{let t=0,n=e.flatMap(e=>{let n=t;return t+=e.rules.length+1,e.rules.map(e=>({...e,order:n+e.order}))}),r={},i={},a=[],o=new Map,s=e.flatMap(e=>e.diagnostics);for(let t of e){Object.assign(r,t.variables),Object.assign(i,t.darkVariables),a.push(...t.headAtRules);for(let e of t.fontFaces)o.set(e.css,e)}return{rules:n,headAtRules:a,fontFaces:[...o.values()],variables:r,darkVariables:i,diagnostics:s}},DD=(e,t)=>{if(e.type===`StyleSheet`)return[...e.children].flatMap(e=>DD(e,t));if(e.type!==`Rule`&&e.type!==`Atrule`)return[];let n=[],r=[];for(let i of e.block?.children??[])i.type===`Declaration`?n.push([i.property,t?.toValue(`${FC(i.value)}${i.important?`!important`:``}`)??`${FC(i.value)}${i.important?`!important`:``}`]):r.push(...DD(i,t));return[{...e.type===`Rule`?{selector:FC(e.prelude)}:{at:`${e.name}${e.prelude===null?``:` ${FC(e.prelude)}`}`},...n.length===0?{}:{style:n},...r.length===0?{}:{children:r}}]},OD=(e,t,n)=>{let r=[],i=[...new Set(e.flatMap(e=>e.rules.map(e=>e.layer)).filter(e=>e!==2**53-1))].sort((e,t)=>e-t);r.push({at:`layer sml-web-components${i.map(e=>`,sml-web-${e}`).join(``)}`});let a=e=>JSON.stringify([e.selector,e.declarations,e.conditions]),o=new Set(ow(Ac).rules.map(a)),s=new Set;for(let n of e){Object.keys(n.variables).length>0&&r.push({selector:`:root`,style:Object.entries(n.variables)}),Object.keys(n.darkVariables).length>0&&r.push({at:`media (prefers-color-scheme:dark)`,children:[{selector:`:root`,style:Object.entries(n.darkVariables)}]});for(let e of n.rules){if(n===t&&o.has(a(e)))continue;let i={selector:e.selector,style:e.declarations.filter(({property:e})=>!/^mso-/i.test(e)).map(({property:e,value:t,important:n})=>[e,`${t}${n?`!important`:``}`])};for(let t of e.conditions.toReversed())i={at:t.replace(/^@/,``),children:[i]};e.layer!==2**53-1&&(i={at:`layer sml-web-${e.layer}`,children:[i]}),r.push(i)}for(let e of n.fontFaces)s.has(e.css)||(s.add(e.css),r.push(...DD(PC(e.css))));for(let e of n.headAtRules)r.push(...DD(PC(e)))}let c=t?.rules.find(e=>e.selector===`.sml-email`)?.layer,l=e.reduce((e,t)=>t.rules.reduce((e,t)=>Math.max(e,t.specificity[0]),e),0)+1,u=[],d=e=>{if(!yc(e)){if(`type`in e&&e.type!==`component`&&e.tag===`style`||`el`in e&&e.el===`style`){let t=new Pc,n=e=>typeof e==`string`?e:e===null||typeof e==`boolean`?``:typeof e==`number`?String(e):`concat`in e?e.concat.map(n).join(``):t.value(e),r=(e.children??[]).map(e=>yc(e)?n(e):`unsupported`).join(``),i;try{i=DD(PC(r),t)}catch{i=[]}u.push(i.length===0&&r.trim()!==``?[{at:`unsupported-dynamic-stylesheet`}]:i);let a=e=>{for(let t of e)l=Math.max(l,(t.selector?.match(/#/g)?.length??0)+1),a(t.children??[])};a(i);return}if(`if`in e){for(let t of e.then)d(t);for(let t of e.else??[])d(t)}else if(`children`in e)for(let t of e.children??[])d(t)}};return d(n),{rules:r,...c===void 0?{}:{componentLayer:c},inlineSpecificity:l,...u.length===0?{}:{stylesheets:u}}},kD=e=>Ns(e)&&typeof e.type==`string`&&typeof e.start==`number`&&typeof e.end==`number`,J=(e,t)=>{let n=e[t];return kD(n)?n:void 0},AD=(e,t)=>{let n=e[t];return Array.isArray(n)?n.filter(kD):[]},jD=(e,t)=>{let n=e[t];return typeof n==`string`?n:void 0},MD=e=>{if(e!==void 0){if(e.type===`Identifier`)return jD(e,`name`);if(e.type===`StringLiteral`)return jD(e,`value`)}},ND=e=>{let t=e;for(;;){if(t.type===`ParenthesizedExpression`||t.type===`TSAsExpression`||t.type===`TSSatisfiesExpression`||t.type===`TSNonNullExpression`||t.type===`TSTypeAssertion`||t.type===`TypeCastExpression`){let e=J(t,`expression`);if(e===void 0)return t;t=e;continue}return t}},PD=class extends Error{path;line;column;constructor(e,t,n,r){super(t),this.name=`SourceSyntaxError`,this.path=e,this.line=n,this.column=r}},FD=(e,t)=>{let n=zl(t),r=e=>Bl(n,e),i;try{i=_D(t,{plugins:[`typescript`,`jsx`],sourceType:`module`}).program}catch(t){let n=Ns(t)&&Ns(t.loc)?t.loc:void 0,r=typeof n?.line==`number`?n.line:1,i=typeof n?.column==`number`?n.column+1:1;throw new PD(e,t instanceof Error?t.message.replace(/\s*\(\d+:\d+\)\s*$/,``):``,r,i)}if(!kD(i))throw new PD(e,`The file did not parse to a program.`,1,1);return{path:e,source:t,program:i,position:r}},ID=(e,t)=>e===``?t:`${e}.${t}`,LD=e=>{switch(e.k){case`path`:return e.path===``?void 0:{bind:e.path};case`value`:return e.value;default:return}},RD=[`transactional`,`promotional`,`service_implicit`],zD=[`marketing`,`utility`,`authentication`],BD=[`text`,`image`,`video`,`document`],VD=[`category`],HD=[`language`,`category`],UD=e=>typeof e==`object`&&!!e&&`concat`in e,WD=e=>{let t=[],n=[],r=``,i=e=>{if(e===null||typeof e==`boolean`)return;if(typeof e==`string`){r+=e;return}if(typeof e==`number`){r+=String(e);return}if(typeof e==`object`&&UD(e)){for(let t of e.concat)i(t);return}if(typeof e==`object`&&(`el`in e||`each`in e||`raw`in e))throw TypeError(`A WhatsApp text part holds text and values only.`);if(typeof e==`object`&&`if`in e&&Array.isArray(e.then))throw TypeError(`A WhatsApp text part cannot branch.`);let a=e,o=JSON.stringify(a),s=n.indexOf(o);s<0&&(s=n.length,n.push(o),t.push(a)),r+=`{{${s+1}}}`};for(let t of e)i(t);return{template:r,params:t}},GD=(e,t,n)=>{if(Math.abs(e.length-t.length)>n)return n+1;let r=Array.from({length:t.length+1},(e,t)=>t);for(let n=1;n<=e.length;n++){let i=[n];for(let a=1;a<=t.length;a++)i[a]=Math.min(i[a-1]+1,r[a]+1,r[a-1]+(e[n-1]===t[a-1]?0:1));r=i}return r[t.length]},KD=(e,t)=>{let n=e.toLowerCase(),r=t.find(e=>e.toLowerCase()===n);if(r!==void 0&&r!==e)return r;let i=Math.max(1,Math.min(3,Math.floor(e.length/3))),a,o=i+1;for(let e of t){let t=GD(n,e.toLowerCase(),i);t<o&&(a=e,o=t)}return a},qD=e=>typeof e==`object`&&!!e&&!Array.isArray(e),JD=(e,t,n=0)=>{let r=t.$ref;if(typeof r!=`string`||n>16)return t;if(r===`#`)return e;let i=e;for(let e of r.replace(/^#\//,``).split(`/`)){if(!qD(i))return t;i=i[e.replace(/~1/g,`/`).replace(/~0/g,`~`)]}return qD(i)?JD(e,i,n+1):t},YD=(e,t)=>{let n=JD(e,t);return[n,...[n.anyOf,n.oneOf,n.allOf].flatMap(t=>Array.isArray(t)?t.filter(qD).flatMap(t=>YD(e,t)):[])]},XD=(e,t)=>{if(t===void 0)return`unknown`;let n=new Set;for(let r of YD(e,t)){let e=r.type;if(typeof e==`string`)n.add(e);else if(Array.isArray(e))for(let t of e)typeof t==`string`&&n.add(t);if(r.const!==void 0&&n.add(typeof r.const),Array.isArray(r.enum))for(let e of r.enum)n.add(typeof e)}if(n.delete(`null`),n.size!==1)return`unknown`;let[r]=n;switch(r){case`string`:return`string`;case`number`:case`integer`:return`number`;case`boolean`:return`boolean`;case`array`:return`array`;case`object`:return`object`;default:return`unknown`}},ZD=(e,t,n)=>{let r=[],i=!0,a;for(let o of YD(e,t)){if(qD(o.properties)&&(i=!1,r.push(...Object.keys(o.properties)),Object.hasOwn(o.properties,n))){let e=o.properties[n],t=Array.isArray(o.required)&&o.required.includes(n);a={schema:qD(e)?e:void 0,required:a?.required===!0||t}}if(o.type===`object`&&!qD(o.properties)&&o.additionalProperties===!1&&(i=!1),(Array.isArray(o.items)||qD(o.items))&&/^\d+$/.test(n))return i=!1,{found:!0,schema:qD(o.items)?o.items:void 0,required:!0,names:r,open:!1};qD(o.additionalProperties)&&a===void 0&&(a={schema:o.additionalProperties,required:!1},i=!1)}return a===void 0?{found:!1,schema:void 0,required:!1,names:r,open:i}:{found:!0,schema:a.schema,required:a.required,names:r,open:!1}},QD=(e,t)=>t.size===0?e:{...e,guards:new Set([...e.guards,...t])},$D=e=>{let t=e.split(`.`);return t.map((e,n)=>t.slice(0,n+1).join(`.`))},eO=e=>typeof e==`object`&&e&&`bind`in e?e.bind:void 0,tO=(e,t)=>{let n=e=>e===void 0?new Set:new Set($D(e));if(`present`in e)return t?n(e.present):new Set;if(`truthy`in e){let r=e.truthy,i=eO(r)??(typeof r==`object`&&r&&`length`in r?eO(r.length):void 0);return t?n(i):new Set}if(`not`in e)return tO(e.not,!t);if(`and`in e||`or`in e){let n=`and`in e?e.and:e.or,r=`and`in e?t:!t,i=n.map(e=>tO(e,t));if(r)return new Set(i.flatMap(e=>[...e]));let[a,...o]=i;return new Set([...a??[]].filter(e=>o.every(t=>t.has(e))))}let[r,i]=e.args,a=eO(r)??eO(i),o=eO(r)===void 0?r:i;if(a===void 0)return new Set;let s=o===null,c=typeof o!=`object`||!o||`concat`in o||`format`in o||`op`in o||`length`in o||`count`in o;return e.cmp===`eq`?!c||t===s?new Set:n(a):e.cmp===`ne`?!c||t!==s?new Set:n(a):t?n(a):new Set},nO=(e,t,n)=>{let r=[],i=new Set,a=e=>{let t=`${e.code}\0${e.message}\0${e.src?.join(`,`)??``}`;i.has(t)||(i.add(t),r.push(e))},o=e=>e.startsWith(`$`)?e.slice(1):`input.${e}`,s=(t,n,r)=>{let i=t.split(`.`),a=i[0],o;if(a.startsWith(`$`)){if(!n.variables.has(a.slice(1)))return;o=n.variables.get(a.slice(1))}else{let i=ZD(e,e,a);if(!i.found)return c(a,i,``,r,t);!i.required&&!n.guards.has(a)&&l(a,r),o=i.schema}for(let a=1;a<i.length;a++){if(o===void 0)return;let s=i[a],u=ZD(e,o,s),d=i.slice(0,a).join(`.`);if(!u.found)return u.open?void 0:c(s,u,d,r,t);let f=i.slice(0,a+1).join(`.`);!u.required&&!n.guards.has(f)&&l(f,r),o=u.schema}return o},c=(e,t,n,r,i)=>{if(t.open)return;let s=KD(e,t.names),c=n===``?`input`:o(n);a({code:`unknown-field`,message:`\`${n===``?`input`:o(n)}.${e}\` is not in the schema${t.names.length===0?``:` (${c} has ${t.names.map(e=>`\`${e}\``).join(`, `)})`}.`,...s===void 0?{fix:`Add \`${e}\` to the schema, or bind a field it declares.`}:{fix:`Did you mean \`${n===``?`input`:o(n)}.${s}\`?`},src:r})},l=(e,t)=>{a({code:`unguarded-optional`,message:`\`${o(e)}\` is optional and is read outside a guard, so a send without it would render a blank.`,fix:`Guard it: {${o(e)} && …}, or make the field required in the schema.`,src:t})},u=(t,n,r)=>{if(typeof t==`string`)return`string`;if(typeof t==`number`)return`number`;if(typeof t==`boolean`)return`boolean`;if(t===null)return`unknown`;if(`bind`in t)return XD(e,s(t.bind,n,r));if(`lit`in t)return`unknown`;if(`concat`in t){for(let e of t.concat)u(e,n,r);return`string`}if(`format`in t)return f(t.format,t.args,n,r),`string`;if(`if`in t){p(t.if,n,r);let e=u(t.then,QD(n,tO(t.if,!0)),r);return u(t.else,QD(n,tO(t.if,!1)),r),e}if(`op`in t){for(let e of t.args)d(e,`number`,n,r,`arithmetic`);return`number`}if(`length`in t)return u(t.length,n,r),`number`;if(`count`in t){let i=eO(t.count),a;if(i===void 0)u(t.count,n,r);else{let t=s(i,n,r);if(t!==void 0)for(let n of YD(e,t))qD(n.items)&&(a=JD(e,n.items))}let o=new Map(n.variables).set(t.as.replace(/^\$/,``),a);return p(t.where,{...n,variables:o},r),`number`}return`unknown`},d=(e,t,n,r,i)=>{let s=u(e,n,r);if(s===`unknown`||s===t)return;let c=eO(e);a({code:`invalid-binding-type`,message:`${c===void 0?`This value`:`\`${o(c)}\``} is ${s===`array`?`an array`:`a ${s}`}, and ${i} needs ${t===`array`?`an array`:`a ${t}`}.`,fix:t===`number`?`Bind a number field, or send the number in the payload.`:`Bind a ${t} field.`,src:r})},f=(e,t,n,r)=>{let i={money:[`number`,`string`,`string`],number:[`number`,void 0,`string`],date:[`string`,`string`,`string`],time:[`string`,`string`,`string`],plural:[`number`,void 0,`string`],list:[`array`,`string`]};for(let[a,o]of t.entries()){let t=i[e]?.[a];t===void 0?u(o,n,r):d(o,t,n,r,`\`fmt.${e}\``)}},p=(e,t,n)=>{if(`present`in e){m(e.present,t,n);return}if(`truthy`in e){let r=e.truthy,i=eO(r);i===void 0?h(r,t,n):m(i,t,n);return}if(`not`in e){p(e.not,t,n);return}if(`and`in e){let r=t;for(let t of e.and)p(t,r,n),r=QD(r,tO(t,!0));return}if(`or`in e){let r=t;for(let t of e.or)p(t,r,n),r=QD(r,tO(t,!1));return}let r=e.cmp===`lt`||e.cmp===`gt`||e.cmp===`le`||e.cmp===`ge`,i=r&&e.args.every(e=>u(e,t,n)===`string`);for(let a of e.args){let e=eO(a);i||(e!==void 0&&!r?m(e,t,n):r?d(a,`number`,t,n,`a comparison`):h(a,t,n))}},m=(e,t,n)=>{s(e,{...t,guards:new Set([...t.guards,...$D(e)])},n)},h=(e,t,n)=>{if(typeof e==`object`&&e&&`length`in e){let r=eO(e.length);if(r!==void 0){m(r,t,n);return}}u(e,t,n)},g=(e,t,n,r)=>{let i=u(e,t,n);if(i===`array`||i===`object`){let t=eO(e);a({code:`invalid-binding-type`,message:`${t===void 0?`This value`:`\`${o(t)}\``} is ${i===`array`?`an array`:`an object`}, and ${r} takes a string or a number.`,fix:i===`array`?`Render the items with .map, or bind one of their fields.`:`Bind one of its fields.`,src:n})}},_=(e,t,n)=>{if(e===void 0||typeof e==`string`)return;if(Array.isArray(e)){for(let[,r]of e)g(r,t,n,`a style value`);return}let r=e;p(r.if,t,n),_(r.then,QD(t,tO(r.if,!0)),n),_(r.else,QD(t,tO(r.if,!1)),n)},v=(t,n,r)=>{for(let i of t){if(yc(i)){g(i,n,r,`text`);continue}if(`el`in i){for(let e of Object.values(i.attrs??{}))g(e,n,i.src,`an attribute`);_(i.style,n,i.src),v(i.children??[],n,i.src)}else if(`if`in i)p(i.if,n,i.src),v(i.then,QD(n,tO(i.if,!0)),i.src??r),v(i.else??[],QD(n,tO(i.if,!1)),i.src??r);else if(`each`in i){let t=eO(i.each),c;if(t!==void 0){c=s(t,n,i.src);let r=XD(e,c);r!==`array`&&r!==`unknown`&&a({code:`invalid-binding-type`,message:`\`${o(t)}\` is ${r===`object`?`an object`:`a ${r}`}, and a loop needs an array.`,fix:`Loop over an array field.`,src:i.src})}else u(i.each,n,i.src);let l;if(c!==void 0)for(let t of YD(e,c))qD(t.items)&&(l=JD(e,t.items));let d=i.as.replace(/^\$/,``);i.where!==void 0&&p(i.where,{...n,variables:new Map(n.variables).set(d,l)},i.src??r);let f=new Map(n.variables);f.set(d,i.chunk===void 0||l===void 0?l:{type:`array`,items:l}),i.index!==void 0&&f.set(i.index.replace(/^\$/,``),{type:`integer`});let m=i.where===void 0?n:QD(n,tO(i.where,!0));v(i.children,{...m,variables:f},i.src??r)}else if(`raw`in i)for(let e of i.raw)typeof e!=`string`&&g(`attr`in e?e.attr:e.text,n,i.src,`markup`)}},y={variables:new Map,guards:new Set};v(t,y);for(let e of n)g(e,y,void 0,`the subject or preheader`);return r},rO=(e,t)=>{let n=e=>e.flatMap(e=>yc(e)?[e]:`if`in e?[...n(e.then),...n(e.else??[])]:`each`in e?n(e.children):[e]),r=e=>{for(let t of e)yc(t)||(`el`in t?i(t):`if`in t?(r(t.then),r(t.else??[])):`each`in t&&r(t.children))},i=e=>{let i=_c(e.el),a=n(e.children??[]);if(i!==void 0){if(i.content===`void`&&a.length>0)t({code:`void-element-children`,message:`<${e.el}> cannot have children.`,src:e.src});else if(i.content===`text`||i.content===`raw`)for(let n of a)!yc(n)&&!(`raw`in n)&&t({code:`invalid-content`,message:`<${e.el}> accepts text only.`,src:e.src});else if(i.childElements!==void 0)for(let n of a)if(yc(n)){if(typeof n==`string`&&n.trim()===``)continue;t({code:`invalid-content`,message:`<${e.el}> cannot contain text directly; put it inside <${i.childElements[0]}>.`,src:e.src})}else`el`in n&&!i.childElements.includes(n.el)&&t({code:`invalid-content`,message:`<${e.el}> accepts only ${i.childElements.map(e=>`<${e}>`).join(`, `)}; found <${n.el}>.`,src:n.src??e.src});r(e.children??[])}};r(e)},iO={Email:[`gutter`],Button:[`height`,`paddingX`,`borderRadius`,`borderWidth`,`fontSize`,`width`],Spacer:[`height`],Columns:[`gap`],Divider:[`thickness`],BrandLogo:[`width`]},aO={Email:bl,Section:Sl,Columns:Dl,Column:Ol,Button:Pl,Spacer:Fl,Divider:Il,Image:Ll,Link:Rl},oO=(e,t,n,r)=>{switch(r.k){case`object`:{let n={};for(let[i,a]of r.fields)n[i]=oO(e,t,i,a);return n}case`nodes`:e.lowerer.error(e.ctx,e.node,`dynamic-expression`,`<${e.name} ${n}> takes text, not markup.`);return;default:{let i=LD(r);if(i===void 0){e.lowerer.error(e.ctx,e.node,`dynamic-expression`,`<${e.name} ${n}> cannot be the input as a whole.`,`Bind one field.`);return}return Fc(t,i)}}},sO=(e,t)=>{let n=t.length===1?t[0]:void 0;return n!==void 0&&yc(n)&&n!==null&&typeof n!=`boolean`?typeof n==`string`?n:e.value(n):t.map(t=>yc(t)?typeof t==`string`?t:e.value(t):e.nodes([t]))},cO=(e,t)=>{if(e!==void 0)return Cl(e);let n={length:t};return{concat:[{op:`/`,args:[{op:`-`,args:[100,{op:`%`,args:[100,n]}]},n]},`%`]}},lO=(e,t,n)=>{let{lowerer:r,ctx:i,node:a}=e,o=t.get(`each`),s=o===void 0?void 0:LD(o);if(s===void 0){r.error(i,a,`invalid-columns-each`,`<Columns each> takes a list from the input.`,`Write each={input.items}.`);return}let c=t.get(`per`),l=c?.k===`value`?c.value:void 0;if(c!==void 0&&!(typeof l==`number`&&Number.isInteger(l)&&l>=1)){r.error(i,a,`invalid-columns-per`,`<Columns per> is a whole number of cells, one or more.`,`Write per={2}.`);return}let u=typeof l==`number`?l:void 0,d=AD(a,`children`).filter(e=>e.type!==`JSXText`||(jD(e,`value`)??``).trim()!==``),f=d.length===1?d[0]:void 0,p=f?.type===`JSXExpressionContainer`?J(f,`expression`):void 0,m=p===void 0?void 0:ND(p);if(m===void 0||!/Function/.test(m.type)){r.error(i,a,`invalid-columns-each`,`<Columns each> takes a function of one item as its only child.`,`Write {(item) => <Column>…</Column>}.`);return}let h=u===void 0?void 0:r.freshName(i,`row`),g={...i,loops:h===void 0?i.loops:[...i.loops,h],columnWidth:cO(u,s),columnStack:n},_=r.eachOver(g,a,h===void 0?s:{bind:`$${h}`},m);if(_!==void 0)return{cells:_,wrap:e=>h===void 0||u===void 0?e:[{each:s,as:h,chunk:u,children:e,src:r.src(i.module,a)}]}},uO=e=>{let{lowerer:t,ctx:n,node:r,binding:i}=e,a=i.specifier;if(i.kind===`markup`&&(a===`@samva/markup/sms`||a===`@samva/markup/whatsapp`)){let i=e.channel?.(e);return i===void 0?(t.error(n,r,`wrong-channel`,`<${e.name}> belongs in the ${a.split(`/`).pop()} body of a template.`,"Write it in the `sms` or `whatsapp` function of defineTemplate."),[]):i}let o=i.imported,s=i.kind===`markup`&&a===`@samva/markup/email`,c=i.kind===`brand`;if(!(s||c))return t.error(n,r,`unknown-component`,`<${e.name}> is not a component the profile can read.`,`Import components from @samva/markup/email, ${e.brandPlugin.specifier}, or the project.`),[];let l;if(s)l=aO[o];else{if(e.brand===void 0)return t.error(n,r,`brand-unavailable`,`<${e.name}> comes from ${i.specifier}, and this build has no brand to resolve it.`,`Compile with a brand, or remove the brand components.`),[];let a=Dc(e.brand,e.brandPlugin);l=o===`BrandLogo`?a.BrandLogo:o===`BrandFooter`?a.BrandFooter:void 0}if(l===void 0||!Object.hasOwn(aO,o)&&s)return t.error(n,r,`unknown-component`,`\`${o}\` is not an email component.`,`Use one of ${Object.keys(aO).join(`, `)}, BrandLogo or BrandFooter.`),[];let u=t.attributeBindings(n,e.attributes);if(u===void 0)return[];let d=u,f=e=>e,p,m=u.get(`stack`),h=m===void 0||LD(m);if(o===`Columns`&&typeof h!=`boolean`)return t.error(n,r,`invalid-columns-stack`,`<Columns stack> decides the layout at compile time, so it must be true or false.`,`Write stack={false}, or leave it out to stack on narrow screens.`),[];let g={...n,columnWidth:void 0,columnStack:o===`Columns`?h===!0:void 0};if(o===`Columns`&&u.has(`each`)&&u.has(`gap`))return t.error(n,r,`invalid-columns-gap`,`<Columns gap> spaces Column children written out in the row; cells repeated with each cannot take it.`,`Write the Columns out, or pad each repeated cell (className="px-2").`),[];if(o===`Columns`&&u.has(`each`)){let t=lO(e,u,h===!0);if(t===void 0)return[];d=new Map([...u].filter(([e])=>e!==`each`&&e!==`per`&&e!==`stack`)),p=[t.cells],f=t.wrap}else p=t.jsxChildren(g,r);if(o===`Columns`&&u.has(`gap`)&&p.some(e=>!yc(e)&&!(`el`in e)&&!(`type`in e)))return t.error(n,r,`invalid-columns-gap`,`<Columns gap> spaces Column children that always render; a conditional or repeated Column would leave a stray gap.`,`Pad the cells instead (className="pr-6"), or write each Column unconditionally.`),[];let _=new Pc,v={};for(let[t,n]of d)v[t]=oO(e,_,t,n);for(let i of iO[o]??[]){let a=v[i];if(typeof a==`string`&&!/^-?\d+(\.\d+)?$/.test(a)&&a!==void 0)return t.error(n,r,`dynamic-numeric-prop`,`<${e.name} ${i}> sizes the layout at compile time, so it must be a number literal.`,`Write ${i}={44}.`),[]}if(o===`Column`&&v.width===void 0&&n.columnWidth!==void 0&&(v.width=Fc(_,n.columnWidth)),o===`Column`&&n.columnStack===!0&&(v.className=typeof v.className==`string`&&v.className!==``?`${kc.stack} ${v.className}`:kc.stack),p.length>0&&(v.children=sO(_,p)),o===`Button`&&typeof v.children==`string`&&v.children!==``&&v.width===void 0&&v.height!==void 0&&_.toValue(v.children)!==v.children)return t.error(n,r,`button-dynamic-label`,`Classic Outlook draws the button from a fixed box, and a label read at render time cannot size it.`,`Give the button a width: <Button width={200} …>.`),[];let y=l(v),b=t.findings.locate(n.module.parsed,r),x=Ns(y)&&typeof y.type==`string`;if(x)for(let e of Gs(y))t.findings.items.push({...e,origins:[b]});if(y!==null&&!x)return[];if(n.semantic!==!0)return f([...zc(y,_,t.src(n.module,r))]);let S=e=>{if(e.k===`object`){let t={};for(let[n,r]of e.fields){let e=S(r);e!==void 0&&(t[n]=e)}return{object:t}}return LD(e)},C={};for(let[e,t]of u){let n=S(t);n!==void 0&&(C[e]=n)}let w=c&&e.brand!==void 0?{slug:e.brand.slug,...e.brand.assets===void 0?{}:{assets:e.brand.assets},...e.brand.footer===void 0?{}:{footer:e.brand.footer}}:void 0;return f([{type:`component`,name:o,...Object.keys(C).length===0?{}:{props:C},...p.length===0?{}:{children:p},...w===void 0?{}:{brand:w},...o===`Column`?{emailColumn:{...n.columnWidth===void 0?{}:{width:n.columnWidth},stack:n.columnStack===!0}}:{},src:t.src(n.module,r)}])},dO=(e,t,n)=>({ok:!1,node:t,module:e,reason:n}),fO=e=>{if(e.type===`ObjectProperty`&&e.computed!==!0){let t=J(e,`key`);if(t===void 0)return;if(t.type===`Identifier`)return jD(t,`name`);if(t.type===`StringLiteral`)return jD(t,`value`);if(t.type===`NumericLiteral`)return String(t.value)}},pO=(e,t,n,r=new Set)=>{let i=`${t.path}\0${n}`;if(r.has(i))return;r.add(i);let a=t.declarations.get(n);if(a!==void 0)return{module:t,value:a.value};let o=t.imports.get(n);if(o===void 0)return;if(o.kind===`asset`)return{asset:o.path};if(o.kind!==`project`)return;let s=e.project.modules.get(o.path);if(s===void 0)return;if(o.imported==="default"){let e=s.defaultExport;return e===void 0?void 0:{module:s,value:e}}let c=s.exports.get(o.imported);return c===void 0?void 0:pO(e,s,c,r)},mO=(e,t,n,r=new Set)=>{let i=ND(n);switch(i.type){case`StringLiteral`:return{ok:!0,value:i.value};case`NumericLiteral`:return{ok:!0,value:i.value};case`BooleanLiteral`:return{ok:!0,value:i.value};case`NullLiteral`:return{ok:!0,value:null};case`TemplateLiteral`:{if(AD(i,`expressions`).length>0)return dO(t,i,"a template string with a `${}` part is computed at run time");let e=AD(i,`quasis`)[0]?.value,n=e?.cooked??e?.raw;return{ok:!0,value:typeof n==`string`?n:``}}case`UnaryExpression`:{let e=J(i,`argument`);return jD(i,`operator`)===`-`&&e!==void 0&&e.type===`NumericLiteral`&&typeof e.value==`number`?{ok:!0,value:-e.value}:dO(t,i,`only a negative number literal is data`)}case`Identifier`:{let n=jD(i,`name`)??``;if(n===`undefined`)return{ok:!0,value:void 0};let a=pO(e,t,n);if(a===void 0)return dO(t,i,`\`${n}\` is not a constant in the project`);if(`asset`in a){let r=e.assetUrl(a.asset);return r===void 0?dO(t,i,`\`${n}\` names an asset the build did not address`):{ok:!0,value:r}}let o=`${a.module.path}\0${n}\0${a.value.start}`;if(r.has(o))return dO(t,i,`\`${n}\` refers to itself`);r.add(o);let s=mO(e,a.module,a.value,r);return r.delete(o),s}case`ArrayExpression`:{let n=[];for(let a of Array.isArray(i.elements)?i.elements:[]){if(typeof a!=`object`||!a)return dO(t,i,`an array hole`);let o=a;if(o.type===`SpreadElement`){let i=J(o,`argument`);if(i===void 0)return dO(t,o,`an empty spread`);let a=mO(e,t,i,r);if(!a.ok)return a;if(!Array.isArray(a.value))return dO(t,o,`a spread of a non-array`);n.push(...a.value);continue}let s=mO(e,t,o,r);if(!s.ok)return s;n.push(s.value)}return{ok:!0,value:n}}case`ObjectExpression`:{let n={};for(let a of AD(i,`properties`)){if(a.type===`SpreadElement`){let i=J(a,`argument`);if(i===void 0)return dO(t,a,`an empty spread`);let o=mO(e,t,i,r);if(!o.ok)return o;if(typeof o.value!=`object`||o.value===null||Array.isArray(o.value))return dO(t,a,`a spread of a non-object`);Object.assign(n,o.value);continue}let i=fO(a);if(i===void 0)return dO(t,a,`a computed or method property`);let o=J(a,`value`);if(o===void 0)return dO(t,a,`a property without a value`);let s=mO(e,t,o,r);if(!s.ok)return s;s.value!==void 0&&(n[i]=s.value)}return{ok:!0,value:n}}case`CallExpression`:{let n=J(i,`callee`),a=AD(i,`arguments`)[0];return n?.type===`Identifier`&&jD(n,`name`)===`jsonSchema`&&a!==void 0?mO(e,t,a,r):dO(t,i,`a call is computed at run time`)}default:return dO(t,i,`${i.type} is not data`)}},hO=40,gO={"+":`+`,"-":`-`,"*":`*`,"/":`/`,"%":`%`},_O={"===":`eq`,"!==":`ne`,"<":`lt`,">":`gt`,"<=":`le`,">=":`ge`},vO={money:[2,3],number:[1,3],date:[1,3],time:[1,3],plural:[2,3],list:[1,2]},yO=new Set([`reduce`,`filter`,`slice`,`join`,`sort`,`concat`,`flatMap`,`find`,`some`,`every`,`toFixed`,`toLocaleString`,`toLocaleDateString`,`toUpperCase`,`toLowerCase`,`trim`,`split`,`replace`,`padStart`,`includes`,`indexOf`,`at`]),bO=e=>{let t=e.split(/\r\n|\n|\r/),n=0;for(let[e,r]of t.entries())/[^ \t]/.test(r)&&(n=e);let r=``;for(let[e,i]of t.entries()){let a=i.replace(/\t/g,` `);e!==0&&(a=a.replace(/^ +/,``)),e!==t.length-1&&(a=a.replace(/ +$/,``)),a!==``&&(e!==n&&(a+=` `),r+=a)}return r},xO=e=>e.type===`JSXIdentifier`?jD(e,`name`)??``:e.type===`JSXNamespacedName`?`${jD(J(e,`namespace`)??e,`name`)??``}:${jD(J(e,`name`)??e,`name`)??``}`:e.type===`JSXMemberExpression`?`${xO(J(e,`object`)??e)}.${jD(J(e,`property`)??e,`name`)??``}`:``,SO=e=>e===null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`,CO=e=>e===`VariableDeclaration`?"`const`":e===`IfStatement`?"`if`":/For|While/.test(e)?`a loop`:`a statement`,wO=class{options;sources=[];uniqueId=0;reservedAttributes;constructor(e){this.options=e,this.reservedAttributes=cc(e.brandPlugin)}get findings(){return this.options.findings}src(e,t){let n=e.parsed.position(t.start);if(e.path===this.options.project.entry.path)return[n.line,n.column];let r=this.sources.indexOf(e.path);return r<0&&(r=this.sources.length,this.sources.push(e.path)),[n.line,n.column,r+1]}error(e,t,n,r,i){this.findings.add(e.module.parsed,t,n,r,i)}dynamic(e,t,n,r){this.error(e,t,`dynamic-expression`,`${n} runs code, and templates render without running code.`,r)}functionExpression(e,t){let n=J(t,`body`);if(n===void 0)return;if(n.type!==`BlockStatement`)return n;let r=AD(n,`body`),i=r[0];if(r.length===1&&i?.type===`ReturnStatement`){let e=J(i,`argument`);if(e!==void 0)return e}let a=r.find(e=>e.type!==`ReturnStatement`)??n,o=CO(a.type);this.error(e,a,`statement-in-body`,`A body is one expression, and ${o} is a statement.`,"Write the value where it is used: `cond && <X />` or `cond ? <A /> : <B />` for branches, `.map` for lists. Compute anything else in the caller and send it in the payload.")}bindPattern(e,t,n,r,i){switch(t.type){case`Identifier`:{let e=jD(t,`name`)??``;r.set(e,n??{k:`value`,value:null});return}case`AssignmentPattern`:{let a=J(t,`left`),o=J(t,`right`);if(a===void 0||o===void 0)return;if(!i){this.error(e,t,`unsupported-pattern`,`A default value on the input is never inserted, so it is not part of the profile.`,`Remove the default; declare the field as required or guard it where it is read.`);return}let s=n;if(s===void 0){let t=mO(this.options.staticContext,e.module,o);if(!t.ok){this.error(e,o,`dynamic-expression`,`A default prop value must be a literal.`,`Use a string, number or boolean literal.`);return}s={k:`value`,value:t.value}}this.bindPattern(e,a,s,r,i);return}case`ObjectPattern`:for(let a of AD(t,`properties`)){if(a.type===`RestElement`){this.error(e,a,`unsupported-pattern`,`A rest element gathers props at run time.`,`Name each prop you use.`);continue}let t=J(a,`key`),o=J(a,`value`),s=MD(t);if(s===void 0||o===void 0||a.computed===!0){this.error(e,a,`unsupported-pattern`,`A computed key cannot be read statically.`);continue}let c=n===void 0?void 0:this.field(e,n,s,a);this.bindPattern(e,o,c,r,i)}return;default:this.error(e,t,`unsupported-pattern`,`A parameter is a name or an object pattern of names.`,"Write `(input) =>` or `({ name, items }) =>`.")}}field(e,t,n,r){switch(t.k){case`path`:return n===`length`&&t.path!==``?{k:`value`,value:{length:{bind:t.path}}}:{k:`path`,path:ID(t.path,n)};case`object`:return t.fields.get(n);case`value`:if(n===`length`)return{k:`value`,value:{length:t.value}};if(t.value===null)return{k:`value`,value:null};this.error(e,r,`dynamic-expression`,`\`.${n}\` reads a property of a computed value.`,`Read fields of the input directly.`);return;case`nodes`:this.error(e,r,`dynamic-expression`,"`children` has no fields.","Render `{children}` as is.");return}}binding(e,t){let n=ND(t);if(n.type===`Identifier`){let t=jD(n,`name`)??``;if(t===`undefined`)return{k:`value`,value:null};let r=e.env.get(t);if(r!==void 0)return r;let i=e.module.imports.get(t);if(i?.kind===`asset`){let e=this.options.assetUrl(i.path);if(e!==void 0)return{k:`value`,value:e}}this.error(e,n,`dynamic-expression`,`\`${t}\` is not a binding the template declared.`,"Read the input through the function's parameter, for example `input.name`.");return}if(n.type===`MemberExpression`){let t=J(n,`object`),r=J(n,`property`);if(t===void 0||r===void 0)return;if(n.computed!==!0&&jD(r,`name`)===`length`&&this.filterChain(e,t)!==void 0){let n=this.filterChain(e,t);if(n.list===void 0)return;let r=n.filters[0],i=r===void 0?void 0:AD(r,`params`)[0],a=this.uniqueName(e,i?.type===`Identifier`?jD(i,`name`)??`item`:`item`),o=this.whereClause({...e,loops:[...e.loops,a]},a,n.filters);return o===void 0?void 0:{k:`value`,value:{count:n.list,as:a,where:o}}}let i=this.binding(e,t);if(i===void 0)return;let a;if(n.computed===!0){if(r.type===`StringLiteral`?a=jD(r,`value`):r.type===`NumericLiteral`&&(a=String(r.value)),a===void 0){this.dynamic(e,n,`A computed property`,"Use `.name`, or a numeric index such as `[0]`.");return}}else a=jD(r,`name`);return a===void 0?void 0:this.field(e,i,a,n)}if(n.type===`OptionalMemberExpression`||n.type===`OptionalCallExpression`){this.dynamic(e,n,`Optional chaining`,"Guard the field: `input.discount && <p>{input.discount.label}</p>`.");return}let r=this.value(e,n,!1);return r===void 0?void 0:{k:`value`,value:r}}value(e,t,n){let r=ND(t);switch(r.type){case`StringLiteral`:return this.checkedText(e,r,jD(r,`value`)??``);case`NumericLiteral`:return typeof r.value==`number`?r.value:void 0;case`BooleanLiteral`:return r.value===!0;case`NullLiteral`:return null;case`Identifier`:case`MemberExpression`:case`OptionalMemberExpression`:{let t=this.binding(e,r);if(t===void 0)return;let n=LD(t);if(n!==void 0)return n;this.error(e,r,`dynamic-expression`,t.k===`path`?`The input as a whole is not a value.`:"An object or `children` is not text.",t.k===`path`?"Read one field: `input.name`.":"Render `{children}` as content, or read one field.");return}case`TemplateLiteral`:return this.template(e,r,n);case`ConditionalExpression`:{let t=J(r,`test`),i=J(r,`consequent`),a=J(r,`alternate`);if(t===void 0||i===void 0||a===void 0)return;let o=this.predicate(e,t),s=this.value(e,i,n),c=this.value(e,a,n);return o===void 0||s===void 0||c===void 0?void 0:{if:o,then:s,else:c}}case`LogicalExpression`:{let t=jD(r,`operator`),i=J(r,`left`),a=J(r,`right`);if(i===void 0||a===void 0)return;if(t===`||`){let t=this.value(e,i,n),r=this.value(e,a,n);return t===void 0||r===void 0?void 0:{if:{truthy:t},then:t,else:r}}if(t===`??`){this.error(e,r,`dynamic-expression`,"`??` is not one of the conditions the profile reads.",'Write the condition out: `input.name === null ? "there" : input.name`, or `input.name || "there"`.');return}this.error(e,r,`dynamic-expression`,"`&&` in a value position yields its left operand when that is falsy.","Use a conditional: `cond ? value : fallback`, or `cond && <X />` in content.");return}case`CallExpression`:return this.call(e,r);case`BinaryExpression`:{let t=jD(r,`operator`)??``,i=gO[t],a=J(r,`left`),o=J(r,`right`);if(i===void 0||a===void 0||o===void 0){this.error(e,r,`dynamic-expression`,`\`${t}\` produces a condition, not a value.`,"Use it as the test of `&&`, `? :` or `||`.");return}if(!n){this.error(e,r,`dynamic-expression`,"Arithmetic runs code, and it is allowed only inside a `fmt.*` argument or a condition.","Wrap it: `fmt.number(item.price * item.qty)`, or send the computed value in the payload.");return}if(i===`+`&&[a,o].some(e=>/StringLiteral|TemplateLiteral/.test(ND(e).type))){this.error(e,r,`dynamic-expression`,"`+` with a string joins text at run time.","Use a template string: `${a} ${b}`.");return}let s=this.value(e,a,!0),c=this.value(e,o,!0);return s===void 0||c===void 0?void 0:{op:i,args:[s,c]}}case`UnaryExpression`:{let t=jD(r,`operator`),i=J(r,`argument`);if(t===`-`&&i!==void 0){let t=ND(i);if(t.type===`NumericLiteral`&&typeof t.value==`number`)return-t.value;if(n){let t=this.value(e,i,!0);return t===void 0?void 0:{op:`-`,args:[0,t]}}}if(t===`!`){this.error(e,r,`dynamic-expression`,"`!` produces a condition, not a value.","Use it as the test of `&&`, `? :` or `||`.");return}return this.dynamic(e,r,`\`${t??`?`}\``,`Send the computed value in the payload.`)}case`JSXElement`:case`JSXFragment`:this.error(e,r,`dynamic-expression`,`Markup is not a text value.`,`Use it as content.`);return;case`ArrowFunctionExpression`:case`FunctionExpression`:return this.dynamic(e,r,`A function`,`Write the value directly.`);case`NewExpression`:case`AwaitExpression`:case`AssignmentExpression`:case`UpdateExpression`:case`SequenceExpression`:case`ObjectExpression`:case`ArrayExpression`:case`SpreadElement`:return this.dynamic(e,r,`\`${r.type}\``,`Send the computed value in the payload.`);default:return this.dynamic(e,r,`\`${r.type}\``,`Send the computed value in the payload.`)}}checkedText(e,t,n){return/[-]/.test(n)&&this.error(e,t,`reserved-character`,`This text contains a private-use character the compiler reserves.`,`Remove the characters U+E000 to U+E003.`),n}template(e,t,n){let r=AD(t,`quasis`),i=AD(t,`expressions`),a=[],o=!0;for(let[t,s]of r.entries()){let r=DO(s);r!==``&&a.push(this.checkedText(e,s,r));let c=i[t];if(c!==void 0){let t=this.value(e,c,n);t===void 0?o=!1:a.push(t)}}if(o)return OO(a)}call(e,t){let n=J(t,`callee`),r=AD(t,`arguments`);if(n===void 0)return;let i=ND(n);if(i.type===`MemberExpression`&&i.computed!==!0){let n=J(i,`object`),a=J(i,`property`),o=a===void 0?void 0:jD(a,`name`);if(n!==void 0&&o!==void 0&&this.isFmt(e,n)){if(!Fs.includes(o)){this.error(e,t,`unknown-formatter`,`\`fmt.${o}\` is not a formatter.`,`Use one of ${Fs.map(e=>`fmt.${e}`).join(`, `)}.`);return}let n=o,[i,a]=vO[n];if(r.length<i||r.length>a){this.error(e,t,`formatter-arguments`,`\`fmt.${n}\` takes ${i===a?i:`${i} to ${a}`} arguments.`,`Check the formatter table in the reference.`);return}let s=[];for(let t of r){let n=ND(t);if(n.type===`ObjectExpression`){let t=mO(this.options.staticContext,e.module,n);if(!t.ok){this.error(e,n,`dynamic-expression`,`Formatter options are literal.`,`Write plain string and number values.`);return}s.push({lit:t.value});continue}if(n.type===`ArrayExpression`){let t=mO(this.options.staticContext,e.module,n);if(t.ok){s.push({lit:t.value});continue}}let r=this.value(e,t,!0);if(r===void 0)return;s.push(r)}return{format:n,args:s}}if(o!==void 0&&yO.has(o))return this.dynamic(e,t,`\`.${o}(…)\``,"Send the computed value in the payload and bind it, or format with `fmt.*`.")}if(i.type===`Identifier`&&/^use[A-Z]/.test(jD(i,`name`)??``)){this.error(e,t,`hook-call`,`\`${jD(i,`name`)}\` is a hook, and a template has no state, effects or context.`,`Read the input through the function's parameter; send anything else in the payload.`);return}let a=i.type===`Identifier`?jD(i,`name`)??``:i.type===`MemberExpression`?`${TO(J(i,`object`))}.${jD(J(i,`property`)??i,`name`)??``}`:`a call`;return this.dynamic(e,t,`\`${a}(…)\``,"Send the computed value in the payload and bind it, or format with `fmt.money`, `fmt.number`, `fmt.date`, `fmt.time`, `fmt.plural` or `fmt.list`.")}isFmt(e,t){let n=ND(t);if(n.type!==`Identifier`)return!1;let r=e.module.imports.get(jD(n,`name`)??``);return r?.kind===`markup`&&r.specifier===`@samva/markup/fmt`}predicate(e,t){let n=ND(t);if(n.type===`LogicalExpression`){let t=jD(n,`operator`),r=J(n,`left`),i=J(n,`right`);if(r!==void 0&&i!==void 0&&(t===`&&`||t===`||`)){let n=this.predicate(e,r),a=this.predicate(e,i);if(n===void 0||a===void 0)return;if(t===`&&`){let e=e=>`and`in e?e.and:[e];return{and:[...e(n),...e(a)]}}let o=e=>`or`in e?e.or:[e];return{or:[...o(n),...o(a)]}}}if(n.type===`UnaryExpression`&&jD(n,`operator`)===`!`){let t=J(n,`argument`),r=t===void 0?void 0:this.predicate(e,t);return r===void 0?void 0:{not:r}}if(n.type===`BinaryExpression`){let t=jD(n,`operator`)??``,r=_O[t],i=J(n,`left`),a=J(n,`right`);if(r===void 0||i===void 0||a===void 0){this.error(e,n,`dynamic-expression`,t===`==`||t===`!=`?`\`${t}\` coerces types at run time.`:`\`${t}\` is not a comparison the profile reads.`,"Use `===`, `!==`, `<`, `>`, `<=` or `>=`.");return}let o=this.value(e,i,!0),s=this.value(e,a,!0);return o===void 0||s===void 0?void 0:{cmp:r,args:[o,s]}}let r=this.value(e,n,!0);if(r!==void 0)return typeof r==`object`&&r&&`bind`in r?{present:r.bind}:{truthy:r}}jsxChildren(e,t){let n=[];for(let r of AD(t,`children`))switch(r.type){case`JSXText`:{let t=bO(jD(r,`value`)??``);t!==``&&n.push(this.checkedText(e,r,t));break}case`JSXExpressionContainer`:{let t=J(r,`expression`);if(t===void 0||t.type===`JSXEmptyExpression`)break;n.push(...this.content(e,t));break}case`JSXElement`:case`JSXFragment`:n.push(...this.element(e,r));break;case`JSXSpreadChild`:this.dynamic(e,r,`A spread child`,`List the children.`)}return n}content(e,t){if(e.depth>hO)return this.error(e,t,`nesting-limit`,`The template nests too deeply.`,`Flatten it.`),[];let n=ND(t);switch(n.type){case`JSXElement`:case`JSXFragment`:return this.element(e,n);case`StringLiteral`:{let t=jD(n,`value`)??``;return t===``?[]:[this.checkedText(e,n,t)]}case`NumericLiteral`:return typeof n.value==`number`?[n.value]:[];case`BooleanLiteral`:case`NullLiteral`:return[];case`Identifier`:{let t=jD(n,`name`)??``;if(t===`undefined`)return[];let r=e.env.get(t);if(r?.k===`nodes`)return[...r.nodes];break}case`LogicalExpression`:{let t=jD(n,`operator`),r=J(n,`left`),i=J(n,`right`);if(t===`&&`&&r!==void 0&&i!==void 0){let t=this.predicate(e,r),a=this.content(e,i);return t===void 0?[]:[{if:t,then:a,src:this.src(e.module,n)}]}break}case`ConditionalExpression`:{let t=J(n,`test`),r=J(n,`consequent`),i=J(n,`alternate`);if(t===void 0||r===void 0||i===void 0)return[];let a=this.predicate(e,t),o=this.content(e,r),s=this.content(e,i);return a===void 0?[]:[{if:a,then:o,...s.length===0?{}:{else:s},src:this.src(e.module,n)}]}case`CallExpression`:{let t=J(n,`callee`),r=t===void 0?void 0:ND(t),i=r===void 0?void 0:J(r,`property`);if(r?.type===`MemberExpression`&&r.computed!==!0&&i!==void 0&&jD(i,`name`)===`map`)return this.each(e,n,r);break}}let r=this.value(e,n,!1);return r===void 0?[]:[r]}freshName(e,t){return this.uniqueName(e,t)}uniqueName(e,t){return e.loops.includes(t)?(this.uniqueId+=1,`${t}_${this.uniqueId}`):t}each(e,t,n){let r=J(n,`object`),i=AD(t,`arguments`)[0];if(r===void 0||i===void 0)return[];let a=this.filterChain(e,r),o=a===void 0?this.value(e,r,!1):a.list,s=ND(i);if(s.type!==`ArrowFunctionExpression`&&s.type!==`FunctionExpression`)return this.dynamic(e,i,`A callback that is not an inline function`,"Write `.map((item) => <Row item={item} />)`."),[];if(o===void 0)return[];let c=this.eachOver(e,t,o,s,a?.filters??[]);return c===void 0?[]:[c]}filterChain(e,t){let n=[],r=ND(t);for(;r.type===`CallExpression`;){let e=J(r,`callee`),t=e===void 0?void 0:ND(e),i=t===void 0?void 0:J(t,`property`);if(t?.type!==`MemberExpression`||t.computed===!0||i===void 0||jD(i,`name`)!==`filter`)break;let a=AD(r,`arguments`)[0],o=J(t,`object`);if(a===void 0||o===void 0)return;n.unshift(ND(a)),r=ND(o)}if(n.length!==0)return{list:this.value(e,r,!1),filters:n}}whereClause(e,t,n){let r=[];for(let i of n){if(!/Function/.test(i.type)){this.dynamic(e,i,"A `.filter` callback that is not an inline function","Write `.filter((item) => item.done)`.");return}let n=AD(i,`params`);if(n.length>1){this.error(e,i,`dynamic-expression`,"A `.filter` callback reads the item; its index and the array are not part of the profile.",`Remove the extra parameters.`);return}let a=new Map(e.env);n[0]!==void 0&&this.bindPattern(e,n[0],{k:`path`,path:`$${t}`},a,!1);let o={...e,env:a},s=this.functionExpression(o,i),c=s===void 0?void 0:this.predicate(o,s);if(c===void 0)return;r.push(c)}if(r.length!==0)return r.length===1?r[0]:{and:r}}eachOver(e,t,n,r,i=[],a={}){let o=AD(r,`params`);if(o.length>2){this.error(e,r,`dynamic-expression`,"`.map` callbacks read the item and its index; a third parameter is the whole array.",`Remove the third parameter.`);return}let s=new Map(e.env),c=[...e.loops],l=``,u,d=o[0];if(d!==void 0){let t=d.type===`Identifier`?jD(d,`name`)??`item`:`item`;l=this.uniqueName({...e,loops:c},a.name??t),c.push(l),this.bindPattern({...e,loops:c},d,{k:`path`,path:`$${l}`},s,!1)}else l=this.uniqueName(e,a.name??`item`),c.push(l);let f=o[1];f!==void 0&&(f.type===`Identifier`?(u=this.uniqueName({...e,loops:c},jD(f,`name`)??`index`),c.push(u),s.set(jD(f,`name`)??`index`,{k:`value`,value:{bind:`$${u}`}})):this.error(e,f,`unsupported-pattern`,`The index is a plain name.`));let p=i.length===0?void 0:this.whereClause(e,l,i);if(i.length>0&&p===void 0)return;let m={...e,env:s,loops:c,depth:e.depth+1},h=this.functionExpression(m,r);if(h===void 0)return;let g=this.content(m,h);return{each:n,as:l,...u===void 0?{}:{index:u},...p===void 0?{}:{where:p},...a.chunk===void 0?{}:{chunk:a.chunk},children:g,src:this.src(e.module,t)}}element(e,t){if(t.type===`JSXFragment`)return this.jsxChildren({...e,depth:e.depth+1},t);let n=J(t,`openingElement`),r=n===void 0?void 0:J(n,`name`);if(n===void 0||r===void 0)return[];let i=xO(r),a={...e,depth:e.depth+1};return a.depth>hO?(this.error(e,t,`nesting-limit`,`The template nests too deeply.`,`Flatten it.`),[]):/^[a-z]/.test(i)&&!i.includes(`.`)?this.intrinsic(a,t,n,i):this.component(a,t,n,i)}attributeName(e){let t=J(e,`name`);return t===void 0?``:xO(t)}intrinsic(e,t,n,r){let i=_c(r);if(i===void 0){let n=KD(r,Object.keys(gc));return this.error(e,t,`unsupported-element`,`<${r}> is not part of the supported email vocabulary.`,n===void 0?`Use one of: ${Object.keys(gc).join(`, `)}.`:`Did you mean <${n}>? Supported elements: ${Object.keys(gc).join(`, `)}.`),[]}let a={},o,s=[this.findings.locate(e.module.parsed,t)];for(let t of AD(n,`attributes`)){if(t.type===`JSXSpreadAttribute`){this.dynamic(e,t,`A spread attribute`,`Write each attribute.`);continue}let n=this.attributeName(t),c=J(t,`value`);if(n===`key`)continue;if(n===`ref`||n===`dangerouslySetInnerHTML`||/^on[A-Z]/.test(n)){let r=n===`dangerouslySetInnerHTML`;this.error(e,t,r?`dangerous-html`:n===`ref`?`unsupported-attribute`:`event-handler`,r?"`dangerouslySetInnerHTML` injects unescaped markup.":n===`ref`?"A `ref` needs a running component.":`\`${n}\` is an event handler; email clients strip scripting and Samva refuses it.`,r?`Write the markup as elements.`:`Remove it.`);continue}if(this.reservedAttributes.has(n)){this.error(e,t,`reserved-attribute`,`\`${n}\` is written only by BrandFooter from ${this.options.brandPlugin.specifier}.`,`Render <BrandFooter /> instead of marking an element as the footer.`);continue}if(n===`className`||n===`class`){let t=c===void 0?``:this.classValue(e,c);t!==void 0&&t!==``&&(a.class=t);continue}if(n===`style`){o=this.styleAttribute(e,c);continue}let l;if(c===void 0)l=!0;else if(c.type===`StringLiteral`)l=this.checkedText(e,c,jD(c,`value`)??``);else if(c.type===`JSXExpressionContainer`){let t=J(c,`expression`);l=t===void 0?void 0:this.value(e,t,!1)}else{this.error(e,c,`dynamic-expression`,`An attribute value is text, a number or a binding.`);continue}if(l!==void 0&&l!==!1&&l!==null){if(l===this.options.brandPlugin.unsubscribeUrlPlaceholder){this.error(e,t,`reserved-url`,`That URL is the unsubscribe placeholder only BrandFooter can write.`,`Render <BrandFooter /> instead.`);continue}if(SO(l)){let a=gl(r,n,l,s);if(a.text===void 0&&a.diagnostics.length===0){let a=KD(n,Object.keys({...i.attributes,id:0,title:0,lang:0,dir:0,role:0}));this.error(e,t,`unsupported-attribute`,`<${r}> does not support the ${n} attribute.`,a===void 0?`Supported: ${Object.keys(i.attributes).join(`, `)||`none`}, plus id, title, lang, dir, role, class, style, data-* and aria-*.`:`Did you mean \`${a}\`?`);continue}this.findings.items.push(...a.diagnostics)}a[n]=l}}let c=i.content===`void`?[]:this.jsxChildren(e,t);return[{...e.semantic===!0?{type:[`inline`,`link`,`image`,`break`].includes(i.layout)?`inline`:`block`,tag:r}:{el:r},...Object.keys(a).length===0?{}:{attrs:a},...o===void 0?{}:{style:o},...c.length===0?{}:{children:c},src:this.src(e.module,t)}]}classValue(e,t){let n=t.type===`JSXExpressionContainer`?J(t,`expression`):t;if(n===void 0)return;let r=this.classExpression(e,n);return r===void 0&&this.error(e,t,`dynamic-class`,`This class is built at run time, and Tailwind cannot see class names it does not read.`,'Write the classes literally, or choose between literal classes: `input.vip ? "bg-amber-100" : "bg-white"`.'),r}classExpression(e,t){let n=ND(t);switch(n.type){case`StringLiteral`:return jD(n,`value`)??``;case`NullLiteral`:return``;case`BooleanLiteral`:return``;case`Identifier`:case`MemberExpression`:{if(n.type===`Identifier`&&jD(n,`name`)===`undefined`)return``;let t=this.binding(e,n);return t?.k===`value`&&EO(t.value)?t.value:void 0}case`TemplateLiteral`:{let t=AD(n,`quasis`),r=AD(n,`expressions`),i=[];for(let[n,a]of t.entries()){let t=DO(a);t!==``&&i.push(t);let o=r[n];if(o!==void 0){let t=this.classExpression(e,o);if(t===void 0)return;i.push(t)}}return OO(i)}case`ConditionalExpression`:{let t=J(n,`test`),r=J(n,`consequent`),i=J(n,`alternate`);if(t===void 0||r===void 0||i===void 0)return;let a=this.predicate(e,t),o=this.classExpression(e,r),s=this.classExpression(e,i);return a===void 0||o===void 0||s===void 0?void 0:{if:a,then:o,else:s}}case`LogicalExpression`:{let t=J(n,`left`),r=J(n,`right`);if(jD(n,`operator`)!==`&&`||t===void 0||r===void 0)return;let i=this.predicate(e,t),a=this.classExpression(e,r);return i===void 0||a===void 0?void 0:{if:i,then:a,else:``}}case`BinaryExpression`:{let t=J(n,`left`),r=J(n,`right`);if(jD(n,`operator`)!==`+`||t===void 0||r===void 0)return;let i=this.classExpression(e,t),a=this.classExpression(e,r);return i===void 0||a===void 0?void 0:OO([i,a])}default:return}}styleAttribute(e,t){let n=t===void 0?void 0:J(t,`expression`),r=n===void 0?void 0:ND(n);if(r===void 0||r.type!==`ObjectExpression`){t!==void 0&&this.error(e,t,`invalid-style`,"`style` is an object literal of CSS properties.",`Write style={{ backgroundColor: "#fff" }}, or use Tailwind classes.`);return}return this.styleObject(e,r)}styleObject(e,t){let n=[];for(let r of AD(t,`properties`)){if(r.type!==`ObjectProperty`||r.computed===!0){this.dynamic(e,r,`A spread or computed style entry`,`Write each property.`);continue}let t=J(r,`key`),i=J(r,`value`),a=MD(t);if(a===void 0||i===void 0)continue;let o=this.value(e,i,!1);o!=null&&n.push([a,o])}return n}component(e,t,n,r){let i=r.split(`.`)[0]??r,a=e.module.imports.get(i),o=e.module.declarations.get(i),s=AD(n,`attributes`);if(a?.kind===`markup`&&a.specifier===`@samva/markup/email`&&a.imported===`IssueContent`){let n=this.options.issueContent;if(n===void 0||e.semantic!==!0||s.length>0||AD(t,`children`).some(e=>e.type!==`JSXText`||(jD(e,`value`)??``).trim()!==``))return this.error(e,t,`issue-slot`,`IssueContent needs parsed issue content and takes no props or children; its layout position must be unconditional.`,`Place one <IssueContent /> outside loops and conditions in the email layout.`),[];let r=e=>e.some(e=>typeof e==`object`&&!!e&&`type`in e&&(e.type===`component`&&(e.name===`BrandLogo`||e.name===`BrandFooter`)||r(e.children??[])));return this.options.brand===void 0&&r(n.nodes)?(this.error(e,t,`brand-unavailable`,`This issue uses brand components but no brand was resolved.`,`Supply the host-resolved brand when compiling the issue.`),[]):[{type:`block`,tag:wD,src:this.src(e.module,t)}]}if(a?.kind===`markup`||a?.kind===`brand`)return uO({lowerer:this,ctx:e,node:t,attributes:s,name:r,binding:a,brand:this.options.brand,brandPlugin:this.options.brandPlugin,channel:this.options.channel});let c;if(a?.kind===`project`){let e=this.options.project.modules.get(a.path);e!==void 0&&(c=this.exportedFunction(e,a.imported,new Set))}else o!==void 0&&(c={module:e.module,value:o.value});return c===void 0||!/Function|Arrow/.test(c.value.type)?(this.error(e,t,`unknown-component`,`<${r}> is not a component the profile can read.`,`Import it from @samva/markup/email, or from a project file that exports it as a function.`),[]):this.partial(e,t,s,r,c.module,c.value)}exportedFunction(e,t,n){let r=`${e.path}\0${t}`;if(n.has(r))return;if(n.add(r),t==="default"){let t=e.defaultExport;if(t===void 0)return;if(t.type===`Identifier`){let n=e.declarations.get(jD(t,`name`)??``);return n===void 0?void 0:{module:e,value:n.value}}return{module:e,value:t}}let i=e.exports.get(t);if(i===void 0)return;let a=e.declarations.get(i);if(a!==void 0)return{module:e,value:a.value};let o=e.imports.get(i);if(o?.kind===`project`){let e=this.options.project.modules.get(o.path);return e===void 0?void 0:this.exportedFunction(e,o.imported,n)}}attributeBindings(e,t){let n=new Map,r=!0;for(let i of t){if(i.type===`JSXSpreadAttribute`){this.dynamic(e,i,`A spread attribute`,`Write each prop.`),r=!1;continue}let t=this.attributeName(i);if(t===`key`)continue;let a=J(i,`value`);if(a===void 0){n.set(t,{k:`value`,value:!0});continue}if(a.type===`StringLiteral`){n.set(t,{k:`value`,value:this.checkedText(e,a,jD(a,`value`)??``)});continue}let o=a.type===`JSXExpressionContainer`?J(a,`expression`):void 0;if(o===void 0){this.error(e,a,`dynamic-expression`,`A prop value is text, a number, a binding or an object.`),r=!1;continue}let s=this.propBinding(e,o);s===void 0?r=!1:n.set(t,s)}return r?n:void 0}propBinding(e,t){let n=ND(t);if(n.type===`ObjectExpression`){let t=new Map;for(let r of AD(n,`properties`)){if(r.type!==`ObjectProperty`||r.computed===!0){this.dynamic(e,r,`A spread or computed entry`,`Write each field.`);return}let n=J(r,`key`),i=J(r,`value`),a=n===void 0?void 0:n.type===`Identifier`?jD(n,`name`):jD(n,`value`);if(a===void 0||i===void 0)return;let o=this.propBinding(e,i);if(o===void 0)return;t.set(a,o)}return{k:`object`,fields:t}}if(n.type===`Identifier`||n.type===`MemberExpression`)return this.binding(e,n);if(n.type===`JSXElement`||n.type===`JSXFragment`)return{k:`nodes`,nodes:this.element(e,n)};let r=this.value(e,n,!1);return r===void 0?void 0:{k:`value`,value:r}}partial(e,t,n,r,i,a){let o=`${i.path}#${a.start}`;if(e.stack.includes(o))return this.error(e,t,`recursive-partial`,`<${r}> renders itself, and the compiler inlines partials.`,"Flatten the recursion, or repeat the structure with `.map`."),[];let s=this.attributeBindings(e,n);if(s===void 0)return[];let c=this.jsxChildren(e,t);c.length>0&&s.set(`children`,{k:`nodes`,nodes:c});let l={module:i,env:new Map,stack:[...e.stack,o],loops:e.loops,depth:e.depth+1,semantic:e.semantic},u=new Map,d=AD(a,`params`)[0];if(d!==void 0){let e={k:`object`,fields:s};d.type===`Identifier`?u.set(jD(d,`name`)??`props`,e):this.bindPattern(l,d,e,u,!0)}let f={...l,env:u},p=this.functionExpression(f,a);return p===void 0?[]:this.content(f,p)}},TO=e=>e===void 0?``:e.type===`Identifier`?jD(e,`name`)??``:`…`,EO=e=>typeof e==`string`?!0:typeof e!=`object`||!e?!1:`if`in e?EO(e.then)&&EO(e.else):`concat`in e&&e.concat.every(EO),DO=e=>{let t=e.value;if(typeof t!=`object`||!t)return``;let n=t.cooked,r=t.raw;return typeof n==`string`?n:typeof r==`string`?r:``},OO=e=>{let t=[];for(let n of e){let e=t[t.length-1];if(typeof n==`string`&&typeof e==`string`)t[t.length-1]=e+n;else if(typeof n==`object`&&n&&`concat`in n)for(let e of n.concat){let n=t[t.length-1];typeof e==`string`&&typeof n==`string`?t[t.length-1]=n+e:t.push(e)}else t.push(n)}return t.length===0?``:t.length===1?t[0]:{concat:t}},kO=()=>void 0,AO=60,jO=60,MO=1024,NO=25,PO=2,Wee=1,Gee=10,Kee=1,qee=10,FO=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,IO=64,LO=/^[A-Za-z_]{1,100}$/,RO=[`navigate`,`data_exchange`],zO=e=>e.type===`JSXIdentifier`?jD(e,`name`)??``:e.type===`JSXMemberExpression`?`${zO(J(e,`object`)??e)}.${jD(J(e,`property`)??e,`name`)??``}`:``,BO=e=>{let t=J(e,`openingElement`),n=t===void 0?void 0:J(t,`name`);return n===void 0?``:zO(n)},VO=e=>{let t=J(e,`openingElement`);return t===void 0?[]:AD(t,`attributes`)},HO=(e,t,n,r)=>{let i=e.openFunction(t);if(i===void 0)return;let{ctx:a,body:o}=i,s=ND(o),c=s.type===`JSXElement`?BO(s):``,l=a.module.imports.get(c);if(s.type!==`JSXElement`||l?.kind!==`markup`||l.specifier!==r||l.imported!==n){e.lowerer.error(a,s,`wrong-channel`,`The ${n===`Sms`?`sms`:`whatsapp`} channel returns one <${n}> element imported from ${r}.`,`Write \`import { ${n} } from "${r}"\` and return <${n}>…</${n}>.`);return}return{ctx:a,node:s,local:c}},UO={name:{code:`whatsapp-template-name`,message:`Meta's name for a WhatsApp template comes from the template's handle, not from <WhatsApp>.`,fix:"Remove `name`; rename the template's handle to change its Meta name."}},WO=(e,t,n,r={})=>{let i=new Map;for(let a of VO(t.node)){if(a.type===`JSXSpreadAttribute`){e.lowerer.error(t.ctx,a,`dynamic-expression`,`A spread attribute runs code, and templates render without running code.`,`Write each attribute as a string literal.`);continue}let o=J(a,`name`),s=o===void 0?``:zO(o);if(s===`key`)continue;let c=Object.hasOwn(r,s)?r[s]:void 0;if(c!==void 0){e.lowerer.error(t.ctx,a,c.code,c.message,c.fix);continue}if(!n.includes(s)){e.lowerer.error(t.ctx,a,`unknown-attribute`,`\`${s}\` is not an attribute of this component.`,`The attributes are ${n.join(`, `)}.`);continue}let l=J(a,`value`),u=l?.type===`JSXExpressionContainer`?J(l,`expression`):l;if(u?.type!==`StringLiteral`){e.lowerer.error(t.ctx,a,`dynamic-expression`,`\`${s}\` is fixed when the template is compiled, so it is a string literal.`,`Write ${s}="…".`);continue}i.set(s,jD(u,`value`)??``)}return i},GO=(e,t,n,r,i,a)=>a.includes(i)?!0:(e.lowerer.error(t.ctx,n,`invalid-attribute`,`\`${i}\` is not a ${r} this channel accepts.`,`Use one of ${a.join(`, `)}.`),!1),KO=e=>e.every(e=>yc(e)),qO=e=>e.some(e=>yc(e)?!1:`el`in e||`raw`in e?!0:`if`in e?qO(e.then)||qO(e.else??[]):`each`in e&&qO(e.children)),JO=(e,t)=>{let n=HO(e,t,`Sms`,`@samva/markup/sms`);if(n===void 0)return;let r=WO(e,n,VD),i=VO(n.node).find(e=>jD(J(e,`name`)??e,`name`)===`category`),a=r.get(`category`);if(a!==void 0&&i!==void 0&&!GO(e,n,i,`category`,a,RD))return;let o=e.lowerer.jsxChildren(n.ctx,n.node);return qO(o)&&e.lowerer.error(n.ctx,n.node,`sms-markup`,`An SMS body is plain text, and this one contains an element.`,`Write the message as text and bindings; use a newline in the text for a line break.`),e.schema!==void 0&&e.checks.push(...nO(e.schema,o,[])),{...a===void 0?{}:{category:a},body:o}},YO=e=>typeof e==`string`?e.length:typeof e==`number`?String(e).length:typeof e==`object`&&e&&`concat`in e?e.concat.reduce((e,t)=>e+YO(t),0):0,XO={url:0,phone:0,quickReply:0,flow:0,total:0},ZO=e=>{let t=XO;for(let n of e){let e;if(`if`in n){let t=ZO(n.then),r=ZO(n.else??[]);e={url:Math.max(t.url,r.url),phone:Math.max(t.phone,r.phone),quickReply:Math.max(t.quickReply,r.quickReply),flow:Math.max(t.flow,r.flow),total:Math.max(t.total,r.total)}}else e={url:+(n.type===`url`),phone:+(n.type===`phone`),quickReply:+(n.type===`quick-reply`),flow:+(n.type===`flow`),total:1};t={url:t.url+e.url,phone:t.phone+e.phone,quickReply:t.quickReply+e.quickReply,flow:t.flow+e.flow,total:t.total+e.total}}return t},QO=e=>e.flatMap(e=>{if(`if`in e)return[{if:e.if,then:QO(e.then),...e.else===void 0?{}:{else:QO(e.else)},...e.src===void 0?{}:{src:e.src}}];switch(e.type){case`quick-reply`:return[e.text];case`url`:return[e.text,e.url];case`phone`:return[e.text,e.phone];case`copy-code`:return[e.code];case`flow`:return[e.text]}}),$O=(e,t)=>{let n=HO(e,t,`WhatsApp`,`@samva/markup/whatsapp`);if(n===void 0)return;let{lowerer:r}=e,{ctx:i}=n,a=WO(e,n,HD,UO);for(let e of[`category`,`language`])a.has(e)||r.error(i,n.node,`missing-attribute`,`<WhatsApp> needs \`${e}\`.`,e===`category`?`Write category="utility" (${zD.join(`, `)}).`:`Write language="en_US".`);let o=a.get(`category`),s=VO(n.node).find(e=>jD(J(e,`name`)??e,`name`)===`category`);if(o!==void 0&&s!==void 0&&!GO(e,n,s,`category`,o,zD))return;let c=new Map;for(let e of AD(n.node,`children`)){if(e.type===`JSXText`){(jD(e,`value`)??``).trim()!==``&&r.error(i,e,`whatsapp-structure`,`Text sits inside Header, Body, Footer or Buttons, not directly in <WhatsApp>.`,`Move it into <WhatsApp.Body>.`);continue}let t=e.type===`JSXElement`?BO(e):``,a=t.startsWith(`${n.local}.`)?t.slice(n.local.length+1):``;if(![`Header`,`Body`,`Footer`,`Buttons`].includes(a)){r.error(i,e,`whatsapp-structure`,`<WhatsApp> holds <WhatsApp.Header>, <WhatsApp.Body>, <WhatsApp.Footer> and <WhatsApp.Buttons>.`,`Wrap the content in one of them.`);continue}if(c.has(a)){r.error(i,e,`whatsapp-structure`,`<WhatsApp.${a}> appears twice.`,`A WhatsApp template has at most one of each part.`);continue}c.set(a,e)}let l=[],u=(e,t,n,a)=>{n>a&&r.findings.add(i.module.parsed,t,`whatsapp-length`,`The ${e} is at least ${n} characters, and Meta allows ${a}.`,`Shorten the ${e}.`,`warning`)},d=(e,t,n)=>{let a=r.jsxChildren(i,t);if(!KO(a)){r.error(i,t,`whatsapp-conditional`,`A WhatsApp ${e} cannot branch or contain elements: Meta registers its text once.`,`Choose the wording as a parameter in the payload, or write separate templates.`);return}return u(e,t,a.reduce((e,t)=>e+(yc(t)?YO(t):0),0),n),l.push(...a),a},f,p=c.get(`Header`);if(p!==void 0){let e=VO(p).find(e=>jD(J(e,`name`)??e,`name`)===`type`),t=e===void 0?void 0:J(e,`value`),n=t?.type===`JSXExpressionContainer`?J(t,`expression`):t,a=n?.type===`StringLiteral`?jD(n,`value`)??`text`:`text`;if(e!==void 0&&n?.type!==`StringLiteral`)r.error(i,e,`dynamic-expression`,"`type` is fixed when the template is compiled, so it is a string literal.",`Write type="image".`);else if(e!==void 0&&!BD.includes(a))r.error(i,e,`invalid-attribute`,`\`${a}\` is not a header type.`,`Use one of ${BD.join(`, `)}.`);else{let e=a,t=d(`header`,p,e===`text`?AO:1/0);t!==void 0&&(e===`text`?WD(t).params.length>1&&r.error(i,p,`whatsapp-header-variables`,`A WhatsApp header text takes at most one variable.`,`Keep one binding in the header and move the rest to the body.`):t.length!==1&&r.error(i,p,`whatsapp-header-media`,`A ${e} header is one URL.`,`Write the media URL as the only child: a literal or one binding.`),f={type:e,content:t})}}let m=[],h=c.get(`Body`);if(h===void 0)r.error(i,n.node,`whatsapp-body-required`,`A WhatsApp template needs a body.`,`Add <WhatsApp.Body>…</WhatsApp.Body>.`);else{let e=d(`body`,h,MO);m=e??[],e!==void 0&&e.length===0&&r.error(i,h,`whatsapp-body-required`,`The WhatsApp body is empty.`,`Write the message text.`)}let g=c.get(`Footer`),_=g===void 0?void 0:d(`footer`,g,jO),v=c.get(`Buttons`),y=v===void 0?void 0:tk(e,i,n.local,v);if(y!==void 0){let e=ZO(y),t=(e,t,n)=>{t>n&&r.error(i,v,`whatsapp-button-limit`,`A WhatsApp template allows ${n} ${e}, and these conditions can produce ${t}.`,`Remove ${t-n}, or split the template.`)};t(`URL buttons`,e.url,PO),t(`phone buttons`,e.phone,Wee),t(`quick-reply buttons`,e.quickReply,Gee),t(`flow buttons`,e.flow,Kee),t(`buttons in all`,e.total,qee),l.push(...QO(y))}if(e.schema!==void 0&&e.checks.push(...nO(e.schema,l,[])),o!==void 0&&a.has(`language`))return{category:o,language:a.get(`language`),...f===void 0?{}:{header:f},body:m,..._===void 0?{}:{footer:_},...y===void 0?{}:{buttons:y}}},ek=[`UrlButton`,`QuickReplyButton`,`PhoneButton`,`CopyCodeButton`,`FlowButton`],tk=(e,t,n,r)=>{let{lowerer:i}=e,a=(e,n)=>{let r=i.jsxChildren(t,e);if(!KO(r)||r.length===0){i.error(t,e,r.length===0?`whatsapp-button-text`:`whatsapp-conditional`,r.length===0?`A button needs its ${n}.`:`A button ${n} cannot branch or contain elements.`,`Write the ${n} as text between the tags.`);return}let a=OO(r);return n===`label`&&YO(a)>NO&&i.findings.add(t.module.parsed,e,`whatsapp-length`,`The button label is at least ${YO(a)} characters, and Meta allows ${NO}.`,`Shorten the label.`,`warning`),a},o=(e,n)=>{let r=i.attributeBindings(t,VO(e));if(r===void 0)return;let a=VO(e).map(e=>jD(J(e,`name`)??e,`name`));for(let r of a)r!==void 0&&r!==n&&r!==`key`&&i.error(t,e,`unknown-attribute`,`\`${r}\` is not an attribute of this button.`,n===void 0?`Remove it.`:`The attribute is ${n}.`);if(n===void 0)return;let o=r.get(n),s=o===void 0?void 0:LD(o);return s===void 0&&i.error(t,e,`missing-attribute`,`This button needs \`${n}\`.`,`Write ${n}="…" or ${n}={input.field}.`),s},s=e=>{let n=a(e,`label`),r=new Map,o=!0,s=(e,n,r,a)=>{o=!1,i.error(t,e,n,r,a)};for(let t of VO(e)){if(t.type===`JSXSpreadAttribute`){s(t,`invalid-attribute`,`A spread attribute runs code, and templates render without running code.`,`Write flow, action and screen as string literals.`);continue}let e=J(t,`name`),n=e===void 0?``:zO(e);if(n===`key`)continue;if(n!==`flow`&&n!==`action`&&n!==`screen`){s(t,`invalid-attribute`,`\`${n}\` is not an attribute of this button.`,`The attributes are flow, action and screen.`);continue}let i=J(t,`value`),a=i?.type===`JSXExpressionContainer`?J(i,`expression`):i;if(a?.type!==`StringLiteral`){s(t,`invalid-attribute`,`\`${n}\` is fixed when the template is registered, so it is a string literal, not a binding.`,`Write ${n}="…".`);continue}r.set(n,jD(a,`value`)??``)}let c=r.get(`flow`);c===void 0?o&&s(e,`missing-attribute`,"This button needs `flow`.",`Write flow="handle".`):(c.length>IO||!FO.test(c))&&s(e,`invalid-attribute`,`\`${c}\` is not a flow handle.`,`Use the lowercase kebab-case handle of flows/<handle>.json, at most ${IO} characters.`);let l=r.get(`action`)??`navigate`;RO.includes(l)||s(e,`invalid-attribute`,`\`${l}\` is not a flow action.`,`Use one of ${RO.join(`, `)}.`);let u=r.get(`screen`);if(u!==void 0&&(l===`data_exchange`?s(e,`invalid-attribute`,"A data_exchange flow has its endpoint choose the first screen, so it takes no `screen`.",`Remove screen, or use action="navigate".`):(!LO.test(u)||u===`SUCCESS`)&&s(e,`invalid-attribute`,`\`${u}\` is not a flow screen id.`,`Use the screen's id: letters and underscores, at most 100 characters, and not SUCCESS.`)),o&&c!==void 0&&n!==void 0)return{type:`flow`,text:n,flow:c,action:l,...u===void 0?{}:{screen:u}}},c=e=>{let r=BO(e);switch(r.startsWith(`${n}.`)?r.slice(n.length+1):``){case`UrlButton`:{let t=o(e,`url`),n=a(e,`label`);return t===void 0||n===void 0?void 0:{type:`url`,text:n,url:t}}case`PhoneButton`:{let t=o(e,`phone`),n=a(e,`label`);return t===void 0||n===void 0?void 0:{type:`phone`,text:n,phone:t}}case`QuickReplyButton`:{o(e,void 0);let t=a(e,`label`);return t===void 0?void 0:{type:`quick-reply`,text:t}}case`CopyCodeButton`:{let t=a(e,`code`);return t===void 0?void 0:{type:`copy-code`,code:t}}case`FlowButton`:return s(e);default:i.error(t,e,`whatsapp-structure`,`<WhatsApp.Buttons> holds ${ek.map(e=>`<WhatsApp.${e}>`).join(`, `)}.`,`Use one of the button components.`);return}},l=e=>{let n=ND(e);switch(n.type){case`JSXElement`:{let e=c(n);return e===void 0?[]:[e]}case`JSXFragment`:return u(n);case`NullLiteral`:case`BooleanLiteral`:return[];case`LogicalExpression`:{let e=J(n,`left`),r=J(n,`right`);if(jD(n,`operator`)===`&&`&&e!==void 0&&r!==void 0){let a=i.predicate(t,e),o=l(r);return a===void 0?[]:[{if:a,then:o,src:i.src(t.module,n)}]}break}case`ConditionalExpression`:{let e=J(n,`test`),r=J(n,`consequent`),a=J(n,`alternate`);if(e===void 0||r===void 0||a===void 0)return[];let o=i.predicate(t,e),s=l(r),c=l(a);return o===void 0?[]:[{if:o,then:s,...c.length===0?{}:{else:c},src:i.src(t.module,n)}]}}return i.error(t,n,`dynamic-expression`,`Buttons are fixed by the template, and this expression builds them at render time.`,"List each button; wrap one in `condition && <WhatsApp.UrlButton … />` to make it optional."),[]},u=e=>{let n=[];for(let r of AD(e,`children`))if(r.type===`JSXText`)(jD(r,`value`)??``).trim()!==``&&i.error(t,r,`whatsapp-structure`,`Text cannot sit between buttons.`,`Put the label inside the button.`);else if(r.type===`JSXExpressionContainer`){let e=J(r,`expression`);e!==void 0&&e.type!==`JSXEmptyExpression`&&n.push(...l(e))}else n.push(...l(r));return n};return u(r)},nk=e=>{let t=e.fields.get(`sms`),n=e.fields.get(`whatsapp`),r=t===void 0?void 0:JO(e,t),i=n===void 0?void 0:$O(e,n);return{...r===void 0?{}:{sms:r},...i===void 0?{}:{whatsapp:i}}},rk=65536,ik=262144,ak=(e,t,n,r,i)=>{if(e.length>i.remaining||(i.remaining-=e.length,e.length>r))return;if(n>8||!e.includes(`var(`))return e;let a=[],o=0,s=e=>(o+=e.length,o>r?!1:(a.push(e),!0)),c=0;for(;c<e.length;){let a=e.indexOf(`var(`,c);if(a<0){if(!s(e.slice(c)))return;break}if(!s(e.slice(c,a)))return;let l=0,u=-1;for(let t=a+3;t<e.length;t++)if(e[t]===`(`)l+=1;else if(e[t]===`)`&&(--l,l===0)){u=t;break}if(u<0){if(!s(e.slice(a)))return;break}let d=e.slice(a+4,u),f=d.indexOf(`,`),p=(f<0?d:d.slice(0,f)).trim(),m=f<0?void 0:d.slice(f+1).trim(),h=t[p]??m,g=h===void 0?e.slice(a,u+1):ak(h,t,n+1,r-o,i);if(g===void 0||!s(g))return;c=u+1}return a.join(``)},ok=(e,t,n=0)=>ak(e,t,n,rk,{remaining:ik})??e,sk=e=>{if(!e.includes(`calc(`))return e;let t=``,n=e;for(;n.length>0;){let e=n.indexOf(`calc(`);if(e<0){t+=n;break}t+=n.slice(0,e);let r=0,i=-1;for(let t=e+4;t<n.length;t++)if(n[t]===`(`)r+=1;else if(n[t]===`)`&&(--r,r===0)){i=t;break}if(i<0){t+=n.slice(e);break}let a=lk(n.slice(e+5,i));t+=a===void 0?n.slice(e,i+1):ck(a),n=n.slice(i+1)}return t},ck=e=>`${Math.round(e.n*1e6)/1e6}${e.n===0&&e.unit!==`%`?``:e.unit}`,lk=e=>{let t=e.match(/\(|\)|[+-]\s|[*/]|[^\s()*/]+/g);if(t===null)return;let n=0,r=()=>t[n]?.trim(),i=()=>{let e=a();for(;e!==void 0&&(r()===`+`||r()===`-`);){let t=r();n+=1;let i=a();if(i===void 0||e.unit!==i.unit)return;e={n:t===`+`?e.n+i.n:e.n-i.n,unit:e.unit}}return e},a=()=>{let e=o();for(;e!==void 0&&(r()===`*`||r()===`/`);){let t=r();n+=1;let i=o();if(i===void 0)return;if(t===`*`){if(e.unit!==``&&i.unit!==``)return;e={n:e.n*i.n,unit:e.unit===``?i.unit:e.unit}}else{if(i.unit!==``||i.n===0)return;e={n:e.n/i.n,unit:e.unit}}}return e},o=()=>{let e=t[n];if(e===void 0)return;if(e===`(`){n+=1;let e=i();return r()===`)`?(n+=1,e):void 0}let a=/^(-?(?:\d+\.?\d*|\.\d+))([a-z%]*)$/i.exec(e.trim());if(a!==null)return n+=1,{n:Number.parseFloat(a[1]),unit:(a[2]??``).toLowerCase()}},s=i();return n===t.length?s:void 0},uk=(e,t)=>sk(ok(e,t)),dk=/\(\s*([a-z-]+)\s*(<=|>=|<|>)\s*([^)]+?)\s*\)/gi,fk=e=>e.replace(dk,(e,t,n,r)=>`(${n.startsWith(`>`)?`min-`:`max-`}${t}:${r})`),pk=(e,t,n,r={})=>{let i=[...t],a={...n,...r},o=new Map;for(let t of e){let e=t.conditions.map(fk),n=e.join(`\0`),r=o.get(n);r===void 0?o.set(n,{conditions:e,rules:[t]}):r.rules.push(t)}for(let{conditions:e,rules:t}of o.values()){let r=hd(e)?a:n,o=t.map(e=>{let t=e.declarations.filter(e=>!e.property.startsWith(`--`)).map(e=>`${e.property}:${uk(e.value,r)}!important`).join(`;`);return t===``?``:`${e.selector}{${t}}`}).filter(e=>e!==``).join(``);o!==``&&i.push(e.reduceRight((e,t)=>`${t}{${e}}`,o))}return i.join(``)},mk=/var\(\s*--[\w-]+\s*(?:,[^()]*)?\)/g,hk=(e,t)=>e.replace(mk,e=>{let n=uk(e,t);return n===e?e:el(n)}),gk=(e,t,n,r,i,a)=>[+!!e,+!!t,e?-n:n,r[0],r[1],r[2],i,a],_k=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){let r=e[n]??0,i=t[n]??0;if(r!==i)return r-i}return 0},vk=(e,t)=>_k(e,t)>=0,yk=e=>{if(!Ns(e)||Array.isArray(e))return[];let t=[];for(let[n,r]of Object.entries(e)){if(r==null||typeof r!=`string`&&typeof r!=`number`)continue;let e=ul(n,r),i=/!important\s*$/i.test(e);t.push({property:cl(n),value:i?e.replace(/\s*!important\s*$/i,``):e,important:i})}return t},bk={direction:`ltr`,writingMode:`horizontal-tb`},xk=e=>{let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?n++:a===`)`?n--:/\s/.test(a)&&n===0&&(i>r&&t.push(e.slice(r,i)),r=i+1)}return r<e.length&&t.push(e.slice(r)),t},Sk=(e,t,n)=>{let r=[[e,t]],i=/^padding-(inline|block)(?:-(start|end))?$/.exec(e);if(i===null||n.writingMode!==`horizontal-tb`||![`ltr`,`rtl`].includes(n.direction)||/^(inherit|revert|revert-layer)$/.test(t)||t.includes(`var(`))return r;let a=xk(t.trim());if(a.length<1||a.length>(i[2]===void 0?2:1))return r;let o=i[1]===`block`?[`top`,`bottom`]:n.direction===`rtl`?[`right`,`left`]:[`left`,`right`];return i[2]===void 0?[[`padding-${o[0]}`,a[0]],[`padding-${o[1]}`,a[1]??a[0]]]:[[`padding-${o[i[2]===`start`?0:1]}`,a[0]]]},Ck=`sml-dark-`,wk=`sml-lock-`,Tk=e=>{let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return t.toString(36)},Ek=e=>`${Ck}${Tk(e)}`,Dk=[`top`,`right`,`bottom`,`left`],Ok=[`width`,`style`,`color`],kk=[`top-left`,`top-right`,`bottom-right`,`bottom-left`],Ak=[`source`,`slice`,`width`,`outset`,`repeat`].map(e=>`border-image-${e}`),jk=e=>{if(e===`border`)return[...Dk.flatMap(e=>Ok.map(t=>`border-${e}-${t}`)),...Ak];if(e===`border-image`)return Ak;if(e===`border-radius`)return kk.map(e=>`border-${e}-radius`);let t=/^border-(top|right|bottom|left)$/.exec(e)?.[1];if(t!==void 0)return Ok.map(e=>`border-${t}-${e}`);let n=/^border-(width|style|color)$/.exec(e)?.[1];return n===void 0?e.startsWith(`border-`)?[e]:void 0:Dk.map(e=>`border-${e}-${n}`)},Mk=(e,t)=>{if(e===t)return!0;let n=jk(e),r=jk(t);if(n!==void 0||r!==void 0)return n!==void 0&&r!==void 0&&n.some(e=>r.includes(e));let i=(e,t)=>t.startsWith(`${e}-`)||e===`font`&&t===`line-height`;return i(e,t)||i(t,e)},Nk=(e,t)=>{let n=typeof e.class==`string`||e.className===void 0?`class`:`className`,r=e[n];return{...e,[n]:typeof r==`string`&&r.trim()!==``?`${r} ${t}`:t}},Pk=e=>{let t=0,n=0;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`){r+=1;continue}i===`(`||i===`[`?t++:i===`)`||i===`]`?t=Math.max(0,t-1):(t===0&&(i===`>`||i===`+`||i===`~`)||t===0&&i===` `)&&(n=r+1)}return e.slice(n).trim()===``?void 0:n},Fk=new Set([`before`,`after`,`first-line`,`first-letter`]),Ik=e=>{let t=Pk(e);if(t===void 0)return!1;let n=e.slice(t),r=0;for(let e=0;e<n.length;e++){let t=n[e];if(t===`\\`){e+=1;continue}if(t===`(`||t===`[`)r++;else if(t===`)`||t===`]`)r=Math.max(0,r-1);else if(r!==0||t!==`:`)continue;if(n[e+1]===`:`)return!0;let i=/^:([A-Za-z-]+)/.exec(n.slice(e))?.[1]?.toLowerCase();if(i!==void 0&&Fk.has(i))return!0}return!1},Lk=(e,t)=>{let n=Pk(e);if(n===void 0)return;let r=e.slice(n),i=`.${t}`,a=0,o=-1;for(let e=0;e<r.length;e++){let t=r[e];if(t===`\\`){e+=1;continue}if(t===`(`||t===`[`)a++;else if(t===`)`||t===`]`)a=Math.max(0,a-1);else if(a===0&&t===`:`){o=e;break}}let s=o<0?`${r}${i}`:`${r.slice(0,o)}${i}${r.slice(o)}`;return`${e.slice(0,n)}${s}`},Rk=(e,t,n)=>gk(t.important,!1,e.layer,e.specificity,e.order,n),zk=(e,t)=>t.declarations.some((n,r)=>Mk(n.property,e.property)&&_k(e.key,Rk(t,n,r))>0),Bk=(e,t)=>e.reduceRight((e,t)=>`${t}{${e}}`,t),Vk=(e,t,n,r)=>{let i=new Set,a=[],o=new Set,s=dd.replace(`: `,`:`),c=(e,t,n)=>{let r=Bk(e,`${t}{${n}}`);i.has(r)||(i.add(r),a.push(r))};for(let n of t){if(Ik(n.selector))continue;let t=n.conditions.map(fk);for(let[r,i]of e){let e=i.filter(e=>zk(e,n));if(e.length===0)continue;let a=Lk(n.selector,r);if(a===void 0)continue;let l=hd(t),u=e.map(e=>`${e.property}:${e.light}!important`).join(`;`),d=e.map(e=>`${e.property}:${e.dark}!important`).join(`;`);l||c(t,a,u),c(l?t:[...t,s],a,d),o.add(r)}}for(let[i,a]of e)if(o.has(i))for(let e of t){if(Ik(e.selector))continue;let t=Lk(e.selector,i);if(t===void 0)continue;let o=e.conditions.map(fk),l=hd(o),u=t=>{let i=t===`dark`?{...n,...r}:n,o=[];for(let[n,r]of e.declarations.entries()){let s=Rk(e,r,n);if(a.some(e=>Mk(r.property,e.property)&&_k(s,e.key)>0)){o.push(`${r.property}:${uk(r.value,i)}!important`);for(let e of a)Mk(r.property,e.property)&&_k(e.key,s)>0&&o.push(`${e.property}:${t===`dark`?e.dark:e.light}!important`)}}return o.join(`;`)},d=u(l?`dark`:`light`);if(d===``||(c(o,t,d),l))continue;let f=u(`dark`);f!==d&&c([...o,s],t,f)}return a.join(``)},Hk=e=>e.size===0?``:`${dd.replace(`: `,`:`)}{${[...e].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`.${e}{${t}}`).join(``)}}`,Uk=(e,t,n={})=>{let r=[...t.diagnostics],i=Object.keys(t.darkVariables).length>0,a=new Map,o=e=>{let t=e.map(([e,t])=>`${e}:${t}!important`).join(`;`),n=Ek(t);return a.set(n,t),n},s=[],c=[],l=new Set;for(let e of t.rules){(e.inlinable?s:c).push(e);for(let t of e.classes)l.add(t)}let u=new Map,d=e=>{if(!e.some(e=>c.some(t=>!Ik(t.selector)&&zk(e,t))))return;let t=`${wk}${Tk(e.map(e=>`${e.property}:${e.light}=${e.dark}@${e.key.join(`.`)}`).join(`;`))}`;return u.set(t,e),t},f=c.filter(e=>e.declarations.some(e=>e.property===`direction`||e.property===`writing-mode`||e.property===`all`)),p=new Map,m=new Set(t.fontFaces.map(e=>e.family.toLowerCase())),h=new Map,g=(e,t,n)=>{if(m.size===0)return;let r=e===`font-family`?t:e===`font`?HC(t):void 0;r===void 0||h.has(r)||UC(r,m)&&h.set(r,n)},_=(e,t,n,r,i)=>{let a=[],o=e=>e.map(e=>{if(e.type===`Element`){let o=v(e,{element:e,parent:t,previous:[...a]},n,r,i);return a.push(e),o}return e.type===`Fragment`?Rs.Fragment({...e,children:o(e.children)}):e.type===`Raw`&&e.html.includes(`var(`)?Rs.Raw({...e,html:hk(e.html,n)}):e});return o(e)},v=(e,t,r,a,c)=>{let u=f.some(e=>{if(e.matcher===void 0||e.matcher.parts.length===0||e.matcher.parts.some(e=>e.compound.opaque))return!0;for(let n=t;n!==void 0;n=n.parent)if(fw(e.matcher,n))return!0;return!1}),m=new Map,h=(e,t)=>{let n=m.get(e.property);(n===void 0||vk(t,n.key))&&m.set(e.property,{value:e.value,key:t})};for(let e of s)if(fw(e.matcher,t))for(let[t,n]of e.declarations.entries())h(n,gk(n.important,!1,e.layer,e.specificity,e.order,t));for(let[t,n]of yk(e.props.style).entries())h(n,gk(n.important,!0,0,[0,0,0],0,t));for(let t of sw(e))!l.has(t)&&n.knownClasses?.has(t)!==!0&&p.set(t,[...p.get(t)??[],...e.origins]);let v={};for(let[e,t]of m)e.startsWith(`--`)&&(v[e]=t.value);let y=Object.keys(v).length===0?r:{...r,...v},b=Object.keys(v).length===0?a:{...a,...v},x=(e,t,n,r=t)=>{let i=m.get(e)?.value;if(i===void 0)return r;let a=uk(i,y);return a===`inherit`||a===`unset`?t:a===`initial`?n:a},S={direction:x(`direction`,c.direction,`ltr`,typeof e.props.dir==`string`?e.props.dir:e.tag===`bdi`?`auto`:c.direction),writingMode:m.has(`all`)?`unknown`:x(`writing-mode`,c.writingMode,`horizontal-tb`)},C=new Set;if(i){for(let[e,t]of m)!e.startsWith(`--`)&&t.value.includes(`var(`)&&uk(t.value,b)!==uk(t.value,y)&&C.add(e);for(let e=C.size>0;e;){e=!1;for(let t of m.keys())!t.startsWith(`--`)&&!C.has(t)&&[...C].some(e=>Mk(e,t))&&(C.add(t),e=!0)}}let w=[...m].filter(([e])=>!e.startsWith(`--`)).sort(([,e],[,t])=>_k(e.key,t.key)).map(([e,t])=>[e,uk(t.value,y),t.key[0]===1&&!C.has(e)]);for(let[t,n]of w)g(t,n,e.origins.slice(0,1));let T=new Map;for(let[e,t,n]of w)for(let[r,i]of u?[[e,t]]:Sk(e,t,S))T.delete(r),T.set(r,n?`${i}!important`:i);let E=e.props.bgcolor,D=typeof E==`string`&&E.includes(`var(`)?{...e.props,bgcolor:uk(E,y)}:e.props,O=[],k=[];if(i){for(let[e,t]of[...m].sort(([,e],[,t])=>_k(e.key,t.key))){if(!C.has(e))continue;let n=uk(t.value,b);O.push([e,n]),t.key[0]===1&&k.push({property:e,light:uk(t.value,y),dark:n,key:t.key})}if(typeof E==`string`&&E.includes(`var(`)&&!m.has(`background-color`)&&!m.has(`background`)){let e=uk(E,b);e!==uk(E,y)&&O.push([`background-color`,e])}}let A=O.length===0?void 0:o(O),j=d(k),M=A===void 0?D:Nk(D,A),N=j===void 0?M:Nk(M,j);return Rs.Element({...e,props:w.length===0?N:{...N,style:Object.fromEntries(T)},children:_(e.children,t,y,b,S)})},y={...t.variables,...t.darkVariables},b=e.type===`Element`?v(e,{element:e,parent:void 0,previous:[]},t.variables,y,bk):e.type===`Fragment`?Rs.Fragment({...e,children:_(e.children,void 0,t.variables,y,bk)}):e;for(let e of c)for(let n of e.declarations)g(n.property,uk(n.value,t.variables),[]);for(let[e,t]of h)r.push({...WC(e),origins:t});for(let[e,t]of p)r.push({code:`unmatched-class`,severity:`warning`,message:`Class ${JSON.stringify(e)} produced no styles. If it is composed at run time, the compiler cannot discover it; list it in the template's declared classes or write the style inline.`,origins:t.slice(0,1)});return{tree:b,headCss:`${pk(c,t.headAtRules,t.variables,t.darkVariables)}${Vk(u,c,t.variables,t.darkVariables)}`,darkRules:a,fontFaceCss:t.fontFaces.map(e=>e.css).join(``),diagnostics:r}},Wk=8,Gk=(e,t)=>{if(`leaf`in e){let n=e.leaf,r=e=>`leaf`in e?{leaf:n+e.leaf}:{pred:e.pred,then:r(e.then),else:r(e.else)};return r(t)}return{pred:e.pred,then:Gk(e.then,t),else:Gk(e.else,t)}},Kk=e=>{if(typeof e==`string`)return{leaf:e};if(typeof e==`object`&&e){if(`if`in e){let t=Kk(e.then),n=Kk(e.else);return t===void 0||n===void 0?void 0:{pred:e.if,then:t,else:n}}if(`concat`in e){let t={leaf:``};for(let n of e.concat){let e=Kk(n);if(e===void 0)return;t=Gk(t,e)}return t}}},qk=e=>`leaf`in e?[e.leaf]:[...qk(e.then),...qk(e.else)],Jk=(e,t,n={next:0})=>{if(`leaf`in e)return t(n.next++);let r=Jk(e.then,t,n),i=Jk(e.else,t,n);return JSON.stringify(r)===JSON.stringify(i)?r:{if:e.pred,then:r,else:i}},Yk=e=>`leaf`in e?e.leaf:{if:e.pred,then:Yk(e.then),else:Yk(e.else)},Xk=(e,t)=>t===void 0?e:e.trim()===``?t:`${e} ${t}`,Zk=(e,t,n)=>{if(n.every(e=>e===void 0))return;if(t!==void 0&&qk(t).length>1){let e=0,r=t=>`leaf`in t?{leaf:Xk(t.leaf,n[Math.min(e++,n.length-1)])}:{pred:t.pred,then:r(t.then),else:r(t.else)};return Yk(r(t))}let r=n[0];return r===void 0?e:e===void 0?r:typeof e==`string`?Xk(e,r):{concat:[e,` ${r}`]}},Qk=(e,t)=>{for(let n of e)yc(n)||(`el`in n?(t.push({kind:`el`,el:n}),Qk(n.children??[],t)):`if`in n?(Qk(n.then,t),Qk(n.else??[],t)):`each`in n?Qk(n.children,t):`raw`in n&&t.push({kind:`raw`,raw:n}))},$k=(e,t)=>t.map(t=>typeof t==`string`?t:e.value(`attr`in t?t.attr:t.text)).join(``),eA=(e,t,n)=>{let r=[];Qk([e],r);let i=new Pc,a=r.map(e=>{if(e.kind!==`el`)return;let t=e.el.attrs?.class;if(t===void 0)return;let n=Kk(t);if(n!==void 0)return n}),o=a.map(e=>e===void 0?1:qk(e).length);for(let[t,i]of o.entries())if(i>Wk){let a=r[t],o=a?.kind===`el`?n.locate(a.el.src):void 0;return n.report({code:`too-many-class-variants`,severity:`error`,message:`This class list chooses between ${i} literal lists; the compiler resolves at most ${Wk}.`,fix:`Split the choice into fewer conditions, or move part of it to a partial.`,origins:o===void 0?[]:[o]}),{root:e,headCss:``,fontFaceCss:``}}let s=Math.max(1,...o),c=(e,t,r)=>e.flatMap(e=>{if(yc(e))return[];if(`el`in e){let o=r.next++,s=a[o],l=s===void 0?void 0:qk(s),u={};for(let[t,n]of Object.entries(e.attrs??{}))t!==`class`&&(typeof n==`string`||typeof n==`number`?u[t]=n:typeof n==`object`&&n&&(u[t]=i.value(n)));l===void 0?e.attrs?.class!==void 0&&(u.class=i.value(e.attrs.class)):u.class=l[Math.min(t,l.length-1)];let d=e.style;if(Array.isArray(d)){let e={};for(let[t,n]of d)n!==null&&typeof n!=`boolean`&&(e[t]=typeof n==`number`?n:i.value(n));u.style=e}else if(typeof d==`string`&&d!==``){let e={};for(let t of d.split(`;`)){let n=t.indexOf(`:`);n>0&&(e[t.slice(0,n)]=t.slice(n+1))}u.style=e}let f=n.locate(e.src);return[Rs.Element({tag:e.el,props:u,children:c(e.children??[],t,r),origins:f===void 0?[]:[f],authored:!0})]}return`if`in e?[Rs.Fragment({children:[...c(e.then,t,r),...c(e.else??[],t,r)]})]:`each`in e?[Rs.Fragment({children:c(e.children,t,r)})]:`raw`in e?(r.next++,[Rs.Raw({html:$k(i,e.raw),text:``,origins:[]})]):[]}),l=(e,t)=>{for(let n of e)if(n.type===`Fragment`)l(n.children,t);else if(n.type===`Raw`)t.raws.push(n.html);else if(n.type===`Element`){let e=typeof n.props.class==`string`?n.props.class.split(` `):[];t.darkClasses.push(e.find(e=>e.startsWith(Ck))),t.styles.push(n.props.style===void 0?void 0:n.props.style),t.bgcolors.push(typeof n.props.bgcolor==`string`?n.props.bgcolor:void 0),l(n.children,t)}},u=[],d=``,f=``,p=new Map,m=new Set;for(let r=0;r<s;r++){let i=Uk(c([e],r,{next:0})[0]??Rs.Fragment({children:[]}),t);r===0&&(d=i.headCss,f=i.fontFaceCss);for(let[e,t]of i.darkRules)p.set(e,t);for(let e of i.diagnostics){let t=`${e.code}\0${e.message}`;m.has(t)||(m.add(t),n.report(e))}let a={styles:[],bgcolors:[],darkClasses:[],raws:[]};l([i.tree],a),u.push(a)}let h=(e,t)=>{if(e===void 0)return``;let r=Object.entries(e);if(r.length===0)return``;let a=n.locate(t.src),o=r.some(([,e])=>e.includes(``)),s=hl(Object.fromEntries(r.filter(([,e])=>!e.includes(``))),a===void 0?[]:[a]);for(let e of s.diagnostics)n.report(e);return o?r.map(([e,t])=>[e,i.toValue(t)??t]):s.css},g=0,_=0,v=0,y=e=>e.map(e=>{if(yc(e))return e;if(`el`in e){let t=g++,n=_++,r=a[t],o=u[0],s=o?.styles[n],c=r!==void 0&&qk(r).length>1?Jk(r,t=>h(u[Math.min(t,u.length-1)]?.styles[n],e)):h(s,e),l=o?.bgcolors[n],d=typeof e.attrs?.bgcolor==`string`&&l!==void 0&&l!==e.attrs.bgcolor?{...e.attrs,bgcolor:i.toValue(l)??l}:e.attrs,f=Zk(e.attrs?.class,r,u.map(e=>e.darkClasses[n])),p=f===void 0?d:{...d,class:f},m=y(e.children??[]),{style:v,children:b,attrs:x,...S}=e;return{...S,...p===void 0?{}:{attrs:p},...c===``?{}:{style:c},...m.length===0?{}:{children:m}}}if(`if`in e){let t=y(e.then),n=y(e.else??[]);return{...e,then:t,...e.else===void 0?{}:{else:n}}}if(`each`in e)return{...e,children:y(e.children)};if(`raw`in e){g++;let t=u[0]?.raws[v++];return t===void 0?e:{...e,raw:Lc(i,t)}}return e});return{root:y([e])[0]??e,headCss:`${Hk(p)}${d}`,fontFaceCss:f}},tA=`defineTemplate`,nA=[`email`,`sms`,`whatsapp`],rA=(e,t)=>{let n=e.entry,r=n.defaultExport;r?.type===`Identifier`&&(r=n.declarations.get(jD(r,`name`)??``)?.value);let i=(e,i,a=`no-template`)=>{t.add(n.parsed,r??n.parsed.program,a,e,i)};if(r===void 0||r.type!==`CallExpression`)return i(`The entry must default-export defineTemplate({ ... }).`,"Write `export default defineTemplate({ id, schema, fixtures, email })`.");let a=J(r,`callee`),o=a===void 0?void 0:jD(a,`name`),s=o===void 0?void 0:n.imports.get(o);if(o===`defineEmail`)return i("`defineEmail` runs a render function, which the static profile does not read.","Use `defineTemplate` from @samva/markup with `email: { subject, preheader, body }`.",`legacy-definition`);if(s?.kind!==`markup`||s.imported!==tA)return i(`The entry must default-export defineTemplate({ ... }) imported from @samva/markup.`,'Add `import { defineTemplate } from "@samva/markup";`.');let c=AD(r,`arguments`)[0],l=c===void 0?void 0:ND(c);if(l===void 0||l.type!==`ObjectExpression`)return i(`defineTemplate takes one object literal.`,`Write defineTemplate({ id, schema, fixtures, email }).`);let u=new Map;for(let e of AD(l,`properties`)){let r=fO(e),i=J(e,`value`);if(r===void 0||i===void 0){t.add(n.parsed,e,`dynamic-definition`,`A definition field is written out, not spread or computed.`,"Write each field as `name: value`.");continue}u.set(r,i)}return{module:n,call:r,fields:u}},iA=(e,t,n)=>{let r=ND(n);if(/Function/.test(r.type))return{module:t,fn:r};if(r.type===`Identifier`){let n=jD(r,`name`)??``,i=t.declarations.get(n);if(i!==void 0)return iA(e,t,i.value);let a=t.imports.get(n);if(a?.kind===`project`){let t=e.modules.get(a.path);if(t===void 0)return;let n=a.imported==="default"?void 0:t.exports.get(a.imported);if(a.imported==="default"&&t.defaultExport!==void 0)return iA(e,t,t.defaultExport);let r=n===void 0?void 0:t.declarations.get(n);return r===void 0?void 0:iA(e,t,r.value)}}},aA=e=>{let t=[],n=new Set,r=i=>{if(!n.has(i.path)){n.add(i.path);for(let n of i.ordered)if(n.kind===`css`)t.includes(n.path)||t.push(n.path);else{let t=e.modules.get(n.path);t!==void 0&&r(t)}}};return r(e.entry),t},oA=(e,t,n)=>{let r=!1,i=e=>e.map(e=>{if(r||yc(e))return e;if(`el`in e)return t(e)?(r=!0,n(e)):{...e,...e.children===void 0?{}:{children:i(e.children)}};if(`if`in e){let t=i(e.then),n=i(e.else??[]);return{...e,then:t,...e.else===void 0?{}:{else:n}}}return`each`in e?{...e,children:i(e.children)}:e});return{nodes:i(e),done:r}},sA={raw:[`<!--[if !mso]><!-->`]},cA={raw:[`<!--<![endif]-->`]},lA=(e,t)=>{let n=[],r=t===void 0?void 0:t.replace(/\/+$/,``)+`/`,i=e=>{if(typeof e!=`object`||!e)return;if(`el`in e){let t=e.el===`img`?e.attrs?.src:void 0;if(typeof t==`string`&&/^https?:\/\//i.test(t)){let i=/^https?:\/\/([^/?#]+)/i.exec(t)?.[1]??t;(r===void 0||!t.toLowerCase().startsWith(r.toLowerCase()))&&n.push({url:t,host:i,src:e.src})}}let t=`el`in e||`each`in e?e.children:void 0;for(let e of t??[])i(e);if(`if`in e&&`then`in e&&Array.isArray(e.then)){for(let t of e.then)i(t);if(Array.isArray(e.else))for(let t of e.else)i(t)}};return i(e),n},uA=(e,t,n={},r=[])=>({template:e.blocking?void 0:t,fixtures:n,assets:r,diagnostics:e.items}),dA=(e,t,n,r)=>{let i=(e,t={},i=r.assets)=>uA(n,e,t,i),a=r.urlFor,o={project:t,assetUrl:a},s=rA(t,n);if(s===void 0)return i(void 0);let{module:c,fields:l}=s,u=e=>l.get(e)??s.call,d=l.has(`id`)?mO(o,c,l.get(`id`)):void 0;d===void 0||!d.ok||typeof d.value!=`string`?n.add(c.parsed,u(`id`),`invalid-template-id`,`The template id is a string literal.`,`Write id: "order-shipped".`):Wu.test(d.value)||n.add(c.parsed,u(`id`),`invalid-template-id`,`Template id ${JSON.stringify(d.value)} is not lowercase kebab-case.`,`Write lowercase letters and digits joined by single hyphens, for example "order-shipped".`);let f=d!==void 0&&d.ok&&typeof d.value==`string`?d.value:``,p,m=l.get(`schema`);if(m===void 0)n.add(c.parsed,s.call,`missing-schema`,`The template declares no schema.`,"Add `schema: jsonSchema<Input>({ ... })`.");else{let t=mO(o,c,m);t.ok&&typeof t.value==`object`&&t.value!==null?p=t.value:e.schema===void 0?n.add(t.ok?c.parsed:t.module.parsed,t.ok?m:t.node,`schema-not-static`,`The schema cannot be read without running it${t.ok?``:` (${t.reason})`}.`,'Write the schema as a literal: `jsonSchema<Input>({ type: "object", properties: { … } })`, or compile with the schema a library already converted.'):p={...e.schema}}let h=()=>!0;if(p!==void 0)try{let e=Hu(Bu(p));h=e.validate,p=e.schema}catch(e){if(!(e instanceof TypeError))throw e;n.add(c.parsed,u(`schema`),`invalid-schema`,e.message,`Use only the JSON Schema keywords the README lists.`),p=void 0}let g={},_=l.get(`fixtures`);if(_===void 0)n.add(c.parsed,s.call,`missing-fixtures`,`The template declares no fixtures.`,"Add `fixtures: { default: { … } }`.");else{let e=mO(o,c,_);if(!e.ok)n.add(e.module.parsed,e.node,`fixtures-not-static`,`Fixtures are data, and this one is computed (${e.reason}).`,`Write each fixture as a literal object; an imported asset is allowed.`);else if(typeof e.value!=`object`||e.value===null||Object.keys(e.value).length===0)n.add(c.parsed,_,`missing-fixtures`,`The template declares no fixtures.`,"Declare at least one: `fixtures: { default: { … } }`.");else{let t=ND(_),r=new Map;if(t.type===`ObjectExpression`)for(let e of AD(t,`properties`)){let t=fO(e);t!==void 0&&r.set(t,J(e,`key`)??e)}for(let[t,i]of Object.entries(e.value)){if(!Uu.test(t)){n.add(c.parsed,r.get(t)??_,`invalid-fixture-name`,`Fixture key ${JSON.stringify(t)} is not one path segment.`,"Use letters, digits, `.`, `_` and `-`, starting with a letter or digit.");continue}if(g[t]=i,p!==void 0&&!h(i)){let e=h.errors?.at(-1)??h.errors?.[0];n.add(c.parsed,r.get(t)??_,`fixture-invalid`,`Fixture ${JSON.stringify(t)} does not match the schema${e===void 0?``:`: ${e.instanceLocation===`#`||e.instanceLocation===void 0?``:`${e.instanceLocation.replace(/^#/,``)} `}${e.error??`is invalid`}`}.`,`Change the fixture, or the schema, so a fixture is a payload a send could make.`)}}}}let v=l.has(`locale`)?mO(o,c,l.get(`locale`)):void 0,y=v?.ok===!0&&typeof v.value==`string`?v.value:void 0;l.has(`locale`)&&y===void 0&&n.add(c.parsed,u(`locale`),`invalid-locale`,`The locale is a string literal.`,`Write locale: "en-US".`);let b={project:t,findings:n,issueContent:e.issueContent,staticContext:o,assetUrl:a,brand:e.brand,brandPlugin:e.brandPlugin??ic},x=new wO({...b,channel:kO}),S=e=>({module:e,env:new Map,stack:[],loops:[],depth:0}),C=e=>{let r=iA(t,c,e);if(r===void 0){n.add(c.parsed,e,`not-a-function`,`A channel field is a function of the input, written in place or declared in the project.`,"Write `(input) => …`.");return}let i=S(r.module),a=new Map,o=AD(r.fn,`params`)[0];o!==void 0&&x.bindPattern(i,o,{k:`path`,path:``},a,!1);let s={...i,env:a},l=x.functionExpression(s,r.fn);return l===void 0?void 0:{ctx:s,body:l}};for(let e of l.keys())[`id`,`schema`,`fixtures`,`locale`,...nA].includes(e)||n.add(c.parsed,u(e),`unknown-field`,`\`${e}\` is not a defineTemplate field.`,`The fields are id, schema, fixtures, locale, email, sms and whatsapp.`);let w,T=[],E=l.get(`email`),D;if(E!==void 0){let i=ND(E),a=new Map;if(i.type===`ObjectExpression`)for(let e of AD(i,`properties`)){let t=fO(e),n=J(e,`value`);t!==void 0&&n!==void 0&&a.set(t,n)}else n.add(c.parsed,E,`invalid-channel`,"The email channel is an object: `{ subject, preheader, body }`.",`Write email: { subject: …, body: … }.`);for(let e of a.keys())[`subject`,`preheader`,`body`].includes(e)||n.add(c.parsed,a.get(e),`unknown-field`,`\`${e}\` is not an email field.`,`The fields are subject, preheader and body.`);let o=e=>{let t=a.get(e);if(t===void 0)return;let n=C(t);return n===void 0?void 0:x.value(n.ctx,n.body,!1)},s=a.has(`subject`)?o(`subject`):void 0;!a.has(`subject`)&&i.type===`ObjectExpression`&&n.add(c.parsed,E,`missing-subject`,`The email channel needs a subject.`,"Add `subject: (input) => …`.");let l=o(`preheader`),d,f,m=a.get(`body`);if(m===void 0&&i.type===`ObjectExpression`)n.add(c.parsed,E,`missing-body`,`The email channel needs a body.`,"Add `body: (input) => (<Email>…</Email>)`.");else if(m!==void 0){let t=C(m);if(t!==void 0){let r=x.content({...t.ctx,semantic:!0},t.body);if(e.issueContent!==void 0){let i=x.sources.indexOf(e.issueContent.file);i<0&&(i=x.sources.length,x.sources.push(e.issueContent.file));let a=CD(e.issueContent.nodes,i+1,e.brand),o=TD(r,a,t=>{let r=t?.[2]===void 0?e.entry:x.sources[t[2]-1]??e.entry;n.report({code:`issue-slot`,severity:`error`,message:`IssueContent must render unconditionally, outside loops and conditions.`,origins:[{fileName:r,lineNumber:t?.[0]??1,columnNumber:t?.[1]??1}]})});r=o.nodes,o.count!==1&&n.add(t.ctx.module.parsed,t.body,`issue-slot`,`An issue layout must render exactly one IssueContent slot after expanding partials.`,`Render one <IssueContent /> outside loops and conditions; do not discard or duplicate its children.`)}let i=Hc(r,b.brandPlugin);r.length===1&&i.length===1?(d=r[0],f=i[0]):n.blocking||n.add(t.ctx.module.parsed,t.body,`multiple-roots`,i.length===0?`The email body renders nothing.`:`The email body renders more than one root.`,`Wrap the body in a single element such as <Email>.`)}}if(s!==void 0&&d!==void 0&&f!==void 0){let i=[];r.tailwindSheet!==void 0&&i.push(r.tailwindSheet);for(let e of aA(t)){let t=r.stylesheets.get(e);t!==void 0&&i.push(t)}let a=[e.entry,...x.sources],o=t=>{if(t!==void 0)return{fileName:a[t[2]??0]??e.entry,lineNumber:t[0],columnNumber:t[1]}},m=eA(f,ED(i),{locate:o,report:e=>{n.items.push(e)}}),h=m.root;if(m.headCss!==``||m.fontFaceCss!==``){let e=[...m.headCss===``?[]:[{el:`style`,children:[m.headCss]}],...m.fontFaceCss===``?[]:[sA,{el:`style`,children:[m.fontFaceCss]},cA]],t=oA([h],e=>e.el===`head`,t=>({...t,children:[...t.children??[],...e]}));t.done?h=t.nodes[0]??h:n.report({code:`missing-head`,severity:`error`,message:`Styles that cannot be inlined — media queries, dark-scheme rules and pseudo-selectors — need a <head> to live in.`,fix:`Wrap the message in <Email>, or write those declarations as inline styles.`,origins:[]})}if(l!==void 0){let e=oA([h],e=>e.el===`body`,e=>({...e,children:[{preheader:!0},...e.children??[]]}));e.done?h=e.nodes[0]??h:n.add(c.parsed,u(`email`),`preheader-without-shell`,`A preheader is the hidden inbox preview inside <body>, and this body has no <Email> shell.`,`Wrap the body in <Email>.`)}rO([h],e=>T.push(e));for(let t of lA(h,e.assetBase)){let e=o(t.src);n.report({code:`email-external-asset`,severity:`warning`,message:`The image ${JSON.stringify(t.url)} is hosted on ${t.host}, outside the project. A hotlinked image can disappear, be blocked by the client, track recipients or slow the message.`,fix:`Add the image to the project's files and import it (import logo from './logo.png'), then use the import as the src.`,origins:e===void 0?[]:[e]})}p!==void 0&&T.push(...nO(p,[h],[s,...l===void 0?[]:[l]])),D={subject:s,...l===void 0?{}:{preheader:l},body:d,web:OD(i,r.tailwindSheet,d),presentation:{nodes:xc(f,m.root),headCss:m.headCss,fontFaceCss:m.fontFaceCss,brandPlugin:b.brandPlugin}}}}let O=nk({lowerer:x,findings:n,fields:l,module:c,openFunction:C,checks:T,schema:p}),k=[e.entry,...x.sources];for(let t of T){let r=t.src,i=k[r?.[2]??0]??e.entry;n.report({code:t.code,severity:`error`,message:t.message,...t.fix===void 0?{}:{fix:t.fix},origins:r===void 0?[{fileName:e.entry,lineNumber:1,columnNumber:1}]:[{fileName:i,lineNumber:r[0],columnNumber:r[1]}]})}return p!==void 0&&f!==``&&(D!==void 0||O.sms!==void 0||O.whatsapp!==void 0)?w={sml:2,template:f,...y===void 0?{}:{locale:y},sources:k,...D===void 0?{}:{email:D},...O.sms===void 0?{}:{sms:O.sms},...O.whatsapp===void 0?{}:{whatsapp:O.whatsapp},schema:p}:E===void 0&&!l.has(`sms`)&&!l.has(`whatsapp`)&&n.add(c.parsed,s.call,`no-channel`,`The template declares no channel.`,"Add `email`, `sms` or `whatsapp`."),i(w,g)},fA=`@samva/markup`,pA=`@samva/markup/`,mA={"@samva/markup/email/components":`@samva/markup/email`},hA=[`.tsx`,`.ts`],gA=(e,t,n)=>{let r=xD(bD(e),t.replace(/[?#].*$/,``));if(r!==void 0){if(Object.hasOwn(n,r))return r;for(let e of hA)if(Object.hasOwn(n,`${r}${e}`))return`${r}${e}`;for(let e of hA)if(Object.hasOwn(n,`${r}/index${e}`))return`${r}/index${e}`}},_A=e=>/\.[cm]?[jt]sx?$/.test(e),vA=e=>e.type===`Identifier`?[jD(e,`name`)??``]:[],yA=(e,t,n,r)=>{let i=new Map,a=new Set,o=new Set,s=!1,c=t=>{let l=i.get(t);if(l!==void 0)return l;if(o.has(t))return;let u=e[t];if(u===void 0)return;let d=typeof u==`string`?u:new TextDecoder().decode(u),f;try{f=FD(t,d)}catch(e){if(!(e instanceof PD))throw e;n.items.push({code:`syntax-error`,severity:`error`,message:e.message,origins:[{fileName:t,lineNumber:e.line,columnNumber:e.column}]}),s=!0;return}o.add(t);let p=new Map,m=[],h=new Map,g=new Map,_,v=e=>{if(e.type===`VariableDeclaration`)for(let t of AD(e,`declarations`)){let n=J(t,`id`),r=J(t,`init`);if(n!==void 0&&r!==void 0)for(let t of vA(n))h.set(t,{value:ND(r),node:e})}else if(e.type===`FunctionDeclaration`){let t=jD(J(e,`id`)??e,`name`);t!==void 0&&h.set(t,{value:e,node:e})}};for(let i of AD(f.program,`body`))switch(i.type){case`ImportDeclaration`:{let o=jD(J(i,`source`)??i,`value`)??``,c=jD(i,`importKind`)===`type`,l=AD(i,`specifiers`);if(c)break;let u=e=>jD(J(e,`local`)??e,`name`)??``,d=e=>{if(e.type===`ImportDefaultSpecifier`)return`default`;if(e.type===`ImportNamespaceSpecifier`)return`*`;let t=J(e,`imported`);return t===void 0?u(e):jD(t,`name`)??jD(t,`value`)??u(e)},h=mA[o];if(h!==void 0){n.add(f,J(i,`source`)??i,`moved-import`,`\`${o}\` moved to \`${h}\`; the imported names are unchanged.`,`Import from "${h}".`),s=!0;break}if(o===fA||o.startsWith(pA)){for(let e of l)jD(e,`importKind`)!==`type`&&p.set(u(e),{kind:`markup`,specifier:o,imported:d(e),node:e});break}if(sc(o,{brandPlugin:r.brandPlugin})!==void 0){for(let e of l)jD(e,`importKind`)!==`type`&&p.set(u(e),{kind:`brand`,specifier:o,imported:d(e),node:e});break}if(!/^\.{0,2}\//.test(o)){n.add(f,i,`non-project-import`,`\`${o}\` is not part of the project; templates import only @samva/markup and files inside the project.`,`Remove the import, or copy the code you need into a project file.`),s=!0;break}let g=gA(t,o,e);if(g===void 0&&r.lenient===!0){let e=xD(bD(t),o.replace(/[?#].*$/,``)),n=e!==void 0&&qu(e),r=e!==void 0&&(_A(e)||!/\.[a-z0-9]+$/i.test(e));if(e!==void 0&&(e.endsWith(`.css`)||n||r)){if(!e.endsWith(`.css`))for(let t of l)n?p.set(u(t),{kind:`asset`,path:e,node:t}):(a.add(u(t)),p.set(u(t),{kind:`project`,path:e,imported:d(t),node:t}));break}}if(g===void 0){n.add(f,i,`unresolved-import`,`\`${o}\` names no file in the project.`,`Check the path and the file extension.`),s=!0;break}if(g.endsWith(`.css`)){m.push({kind:`css`,path:g});break}if(qu(g)){for(let e of l)p.set(u(e),{kind:`asset`,path:g,node:e});break}if(_A(g)){m.push({kind:`script`,path:g});for(let e of l)p.set(u(e),{kind:`project`,path:g,imported:d(e),node:e});break}n.add(f,i,`unresolved-import`,`\`${o}\` is a file type templates cannot import.`,`Import a script, a stylesheet or an asset such as .png or .woff2.`),s=!0;break}case`ExportNamedDeclaration`:{let e=J(i,`declaration`);if(e!==void 0){if(v(e),e.type===`VariableDeclaration`)for(let t of AD(e,`declarations`))for(let e of vA(J(t,`id`)??t))g.set(e,e);else if(e.type===`FunctionDeclaration`){let t=jD(J(e,`id`)??e,`name`);t!==void 0&&g.set(t,t)}}else for(let e of AD(i,`specifiers`)){let t=J(e,`exported`),n=J(e,`local`),r=t===void 0?void 0:jD(t,`name`)??jD(t,`value`),i=n===void 0?void 0:jD(n,`name`);r!==void 0&&i!==void 0&&g.set(r,i)}break}case`ExportDefaultDeclaration`:{let e=J(i,`declaration`);e!==void 0&&(_=ND(e));break}case`VariableDeclaration`:case`FunctionDeclaration`:v(i)}let y={path:t,parsed:f,imports:p,ordered:m,declarations:h,exports:g,defaultExport:_};i.set(t,y),o.delete(t);for(let e of m)e.kind===`script`&&c(e.path);return y},l=c(t);if(!(l===void 0||s))return{modules:i,entry:l,unresolved:a}},bA=`template.tsx`,xA=`https://assets.invalid`,SA=new Set([`brand-unavailable`,`unmatched-class`]),CA=(e,t)=>typeof e==`string`?{[t]:e}:e,wA=(e,t={})=>{let n=t.entry??bA,r=t.brandPlugin??ic,i=new SD,a=yA(CA(e,n),n,i,{brandPlugin:r,lenient:!0});if(a===void 0)return i.items;dA({entry:n,brand:void 0,brandPlugin:r,assetBase:xA},a,i,{assets:[],stylesheets:new Map,tailwindSheet:void 0,urlFor:e=>`${xA}/${e}`});let o=[...a.unresolved];return i.items.filter(e=>!SA.has(e.code)&&!e.code.startsWith(`tailwind-`)&&!o.some(t=>e.message.includes(`<${t}`)||e.message.includes(`\`${t}\``)))},TA=e=>`${e.code}\0${e.message}`,EA=(e,t)=>{let n=new Map;for(let t of e)t.severity===`error`&&n.set(TA(t),(n.get(TA(t))??0)+1);let r=[];for(let e of t){if(e.severity!==`error`)continue;let t=n.get(TA(e))??0;t>0?n.set(TA(e),t-1):r.push(e)}return r},DA={};function OA(e,t){let n=t||DA;return kA(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function kA(e,t,n){if(jA(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return AA(e.children,t,n)}return Array.isArray(e)?AA(e,t,n):``}function AA(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=kA(e[i],t,n);return r.join(``)}function jA(e){return!!(e&&typeof e==`object`)}var MA=document.createElement(`i`);function NA(e){let t=`&`+e+`;`;MA.innerHTML=t;let n=MA.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function PA(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function FA(e,t){return e.length>0?(PA(e,e.length,0,t),e):t}var IA={}.hasOwnProperty;function LA(e){let t={},n=-1;for(;++n<e.length;)RA(t,e[n]);return t}function RA(e,t){let n;for(n in t){let r=(IA.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){IA.call(r,a)||(r[a]=[]);let e=i[a];zA(r[a],Array.isArray(e)?e:e?[e]:[])}}}function zA(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);PA(e,0,0,r)}function BA(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function VA(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var HA=$A(/[A-Za-z]/),UA=$A(/[\dA-Za-z]/),WA=$A(/[#-'*+\--9=?A-Z^-~]/);function GA(e){return e!==null&&(e<32||e===127)}var KA=$A(/\d/),qA=$A(/[\dA-Fa-f]/),JA=$A(/[!-/:-@[-`{-~]/);function YA(e){return e!==null&&e<-2}function XA(e){return e!==null&&(e<0||e===32)}function ZA(e){return e===-2||e===-1||e===32}var Jee=$A(/\p{P}|\p{S}/u),QA=$A(/\s/);function $A(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function ej(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return ZA(r)?(e.enter(n),s(r)):t(r)}function s(r){return ZA(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function tj(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&ZA(t)?(e.enter(r),c(t)):l(t)}function c(t){return ZA(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var Yee={tokenize:Xee};function Xee(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),ej(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return YA(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var nj=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){rj(this,e,t,n,!1)}addBefore(e,t,n){rj(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function rj(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var ij={tokenize:oj},aj={tokenize:sj};function oj(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new nj;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(aj,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(aj,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return YA(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new nj;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function sj(e,t,n){return ej(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function cj(e){if(e===null||XA(e)||QA(e))return 1;if(Jee(e))return 2}function lj(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var uj={name:`attention`,resolveAll:dj,tokenize:fj};function dj(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};pj(o,-a),pj(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=FA(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=FA(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=FA(r,lj(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=FA(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=FA(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),PA(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function fj(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=cj(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=cj(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function pj(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var mj={name:`autolink`,tokenize:hj};function hj(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return HA(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||UA(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||UA(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||GA(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):WA(t)?(e.consume(t),l):n(t)}function u(e){return UA(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||UA(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var gj={partial:!0,tokenize:_j};function _j(e,t,n){return r;function r(t){return ZA(t)?ej(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||YA(e)?t(e):n(e)}}var vj={continuation:{tokenize:bj},exit:xj,name:`blockQuote`,tokenize:yj};function yj(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return ZA(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function bj(e,t,n){let r=this;return i;function i(t){return ZA(t)?ej(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(vj,t,n)(r)}}function xj(e){e.exit(`blockQuote`)}var Sj={name:`characterEscape`,tokenize:Cj};function Cj(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return JA(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var wj={name:`characterReference`,tokenize:Tj};function Tj(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=UA,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=qA,u):(e.enter(`characterReferenceValue`),a=7,o=KA,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===UA&&!NA(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Ej={partial:!0,tokenize:Dj};function Dj(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Oj={concrete:!0,name:`codeFenced`,tokenize:kj};function kj(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),ZA(t)?ej(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||YA(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Ej,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||YA(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):ZA(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),ej(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||YA(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||YA(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&ZA(t)?ej(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||YA(t)?e.check(Ej,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||YA(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),ZA(t)?ej(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),ZA(t)?ej(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||YA(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var Aj={name:`codeIndented`,tokenize:Mj},jj={partial:!0,tokenize:Nj};function Mj(e,t,n){return r;function r(t){return e.enter(`codeIndented`),tj(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):YA(t)?e.attempt(jj,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||YA(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function Nj(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):YA(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):tj(e,t,a,`linePrefix`,4,4)(o)}function a(e){return YA(e)?i(e):n(e)}}var Pj={name:`codeText`,previous:Ij,resolve:Fj,tokenize:Lj};function Fj(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Ij(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Lj(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):YA(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||YA(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Rj=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&zj(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),zj(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),zj(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);zj(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);zj(this.left,t.reverse())}}}};function zj(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Bj(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Rj(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Vj(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return PA(e,0,1/0,u.slice(0)),!l}function Vj(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Hj={resolve:Wj,tokenize:Gj},Uj={partial:!0,tokenize:Kj};function Wj(e){return Bj(e),e}function Gj(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):YA(t)?e.check(Uj,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Kj(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ej(e,a,`linePrefix`)}function a(i){if(i===null||YA(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function qj(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||GA(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||YA(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||XA(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||GA(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Jj(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):YA(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||YA(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!ZA(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Yj(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):YA(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ej(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||YA(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Xj(e,t){let n;return r;function r(i){return YA(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):ZA(i)?ej(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Zj={name:`definition`,tokenize:$j},Qj={partial:!0,tokenize:eM};function $j(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Jj.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=VA(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return XA(t)?Xj(e,l)(t):l(t)}function l(t){return qj(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Qj,d,d)(t)}function d(t){return ZA(t)?ej(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||YA(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function eM(e,t,n){return r;function r(t){return XA(t)?Xj(e,i)(t):n(t)}function i(t){return Yj(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return ZA(t)?ej(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||YA(e)?t(e):n(e)}}var tM={name:`hardBreakEscape`,tokenize:nM};function nM(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return YA(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var rM={name:`headingAtx`,resolve:iM,tokenize:aM};function iM(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};PA(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function aM(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||XA(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||YA(n)?(e.exit(`atxHeading`),t(n)):ZA(n)?ej(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||XA(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var oM=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),sM=[`pre`,`script`,`style`,`textarea`],cM={concrete:!0,name:`htmlFlow`,resolveTo:uM,tokenize:dM},lM={partial:!0,tokenize:fM};function uM(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function dM(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):HA(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):HA(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return HA(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||XA(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&sM.includes(l)?(i=1,r.interrupt?t(s):O(s)):oM.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||UA(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return ZA(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||HA(t)?(e.consume(t),b):ZA(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||UA(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):ZA(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):ZA(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||YA(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||XA(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||ZA(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||YA(t)?O(t):ZA(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):YA(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(lM,R,k)(t)):t===null||YA(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Ej,A,R)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||YA(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return sM.includes(n)?(e.consume(t),L):O(t)}return HA(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||YA(t)?(e.exit(`htmlFlowData`),R(t)):(e.consume(t),L)}function R(n){return e.exit(`htmlFlow`),t(n)}}function fM(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(gj,t,n)}}var pM={name:`htmlText`,tokenize:mM};function mM(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):HA(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):HA(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):YA(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):YA(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):YA(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):YA(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return HA(t)?(e.consume(t),S):n(t)}function S(t){return t===45||UA(t)?(e.consume(t),S):C(t)}function C(t){return YA(t)?(o=C,N(t)):ZA(t)?(e.consume(t),C):M(t)}function w(t){return t===45||UA(t)?(e.consume(t),w):t===47||t===62||XA(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||HA(t)?(e.consume(t),E):YA(t)?(o=T,N(t)):ZA(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||UA(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):YA(t)?(o=D,N(t)):ZA(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):YA(t)?(o=O,N(t)):ZA(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):YA(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||XA(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||XA(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return ZA(t)?ej(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var hM={name:`labelEnd`,resolveAll:yM,resolveTo:bM,tokenize:xM},gM={tokenize:SM},_M={tokenize:CM},vM={tokenize:wM};function yM(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&PA(e,0,e.length,n),e}function bM(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=FA(o,e.slice(i+1,i+r+3)),o=FA(o,[[`enter`,l,t]]),o=FA(o,lj(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=FA(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=FA(o,e.slice(a+1)),o=FA(o,[[`exit`,s,t]]),PA(e,i,e.length,o),e}function xM(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(VA(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(gM,u,o?u:d)(t):t===91?e.attempt(_M,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(vM,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function SM(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return XA(t)?Xj(e,a)(t):a(t)}function a(t){return t===41?u(t):qj(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return XA(t)?Xj(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Yj(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return XA(t)?Xj(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function CM(e,t,n){let r=this;return i;function i(t){return Jj.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(VA(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function wM(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var TM={name:`labelStartImage`,resolveAll:hM.resolveAll,tokenize:EM};function EM(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var DM={name:`labelStartLink`,resolveAll:hM.resolveAll,tokenize:OM};function OM(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var kM={name:`lineEnding`,tokenize:AM};function AM(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),ej(e,t,`linePrefix`)}}var jM={name:`thematicBreak`,tokenize:MM};function MM(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||YA(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),ZA(t)?ej(e,s,`whitespace`)(t):s(t))}}var NM={continuation:{tokenize:LM},exit:zM,name:`list`,tokenize:IM},PM={partial:!0,tokenize:BM},FM={partial:!0,tokenize:RM};function IM(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:KA(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(jM,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return KA(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(gj,r.interrupt?n:u,e.attempt(PM,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return ZA(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function LM(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(gj,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ej(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!ZA(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(FM,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,ej(e,e.attempt(NM,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function RM(e,t,n){let r=this;return ej(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function zM(e){e.exit(this.containerState.type)}function BM(e,t,n){let r=this;return ej(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!ZA(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var VM={name:`setextUnderline`,resolveTo:HM,tokenize:UM};function HM(e,t){let n=new nj,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function UM(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),ZA(t)?ej(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||YA(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var WM={tokenize:GM};function GM(e){let t=this,n=e.attempt(gj,r,e.attempt(this.parser.constructs.flowInitial,i,ej(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Hj,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var KM={resolveAll:XM()},qM=YM(`string`),JM=YM(`text`);function YM(e){return{resolveAll:XM(e===`text`?ZM:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function XM(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function ZM(e,t){let n=new nj,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var QM=s({attentionMarkers:()=>oN,contentInitial:()=>eN,disable:()=>sN,document:()=>$M,flow:()=>nN,flowInitial:()=>tN,insideSpan:()=>aN,string:()=>rN,text:()=>iN}),$M={42:NM,43:NM,45:NM,48:NM,49:NM,50:NM,51:NM,52:NM,53:NM,54:NM,55:NM,56:NM,57:NM,62:vj},eN={91:Zj},tN={[-2]:Aj,[-1]:Aj,32:Aj},nN={35:rM,42:jM,45:[VM,jM],60:cM,61:VM,95:jM,96:Oj,126:Oj},rN={38:wj,92:Sj},iN={[-5]:kM,[-4]:kM,[-3]:kM,33:TM,38:wj,42:uj,60:[mj,pM],91:DM,92:[tM,Sj],93:hM,95:uj,96:Pj},aN={null:[uj,KM]},oN={null:[42,95]},sN={null:[]};function cN(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=FA(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=lj(a,l.events,l),l.events):[]}function f(e,t){return uN(p(e),t)}function p(e){return lN(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){YA(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&PA(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function lN(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function uN(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
67
|
+
`;break;case-3:o=`\r
|
|
68
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function dN(e){let t={constructs:LA([QM,...(e||{}).extensions||[]]),content:n(Yee),defined:[],document:n(ij),flow:n(WM),lazy:{},string:n(qM),text:n(JM)};return t;function n(e){return n;function n(n){return cN(t,e,n)}}}function fN(e){for(;!Bj(e););return e}var pN=/[\0\t\n\r]/g;function mN(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){pN.lastIndex=c;let n=pN.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var hN=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function gN(e){return e.replace(hN,_N)}function _N(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return BA(n.slice(t?2:1),t?16:10)}return NA(n)||e}function vN(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?bN(e.position):`start`in e||`end`in e?bN(e):`line`in e||`column`in e?yN(e):``}function yN(e){return xN(e&&e.line)+`:`+xN(e&&e.column)}function bN(e){return yN(e&&e.start)+`-`+yN(e&&e.end)}function xN(e){return e&&typeof e==`number`?e:1}var SN={}.hasOwnProperty;function CN(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),wN(n)(fN(dN(n).document().write(mN()(e,t,!0))))}function wN(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(W),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(ce),blockQuote:o(ie),characterEscape:E,characterReference:E,codeFenced:o(ae),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(ae,s),codeText:o(oe,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(se),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(U),hardBreakEscape:o(le),hardBreakTrailing:o(le),htmlFlow:o(ue,s),htmlFlowData:E,htmlText:o(ue,s),htmlTextData:E,image:o(de),label:s,link:o(W),listItem:o(pe),listItemValue:p,listOrdered:o(fe,f),listUnordered:o(fe),paragraph:o(me),reference:ee,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(ce),strong:o(he),thematicBreak:o(_e)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:re,autolinkProtocol:ne,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:V,characterReferenceMarkerNumeric:V,characterReferenceValue:te,characterReference:H,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(M),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(A),htmlFlowData:D,htmlText:l(j),htmlTextData:D,image:l(P),label:I,labelText:F,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:B,resourceDestinationString:L,resourceTitleString:R,resource:z,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};EN(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),SN.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||ON).call(o,void 0,e[0])}for(r.position={start:TN(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:TN(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:TN(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+vN({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||ON).call(this,e,r[0])),n.position.end=TN(e.end)}function d(){return OA(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=VA(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ge(),n.position={start:TN(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=TN(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=TN(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function F(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=gN(t),n.identifier=VA(t).toLowerCase()}function I(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function R(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function z(){this.data.inReference=void 0}function ee(){this.data.referenceType=`collapsed`}function B(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=VA(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function V(e){this.data.characterReferenceType=e.type}function te(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=BA(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=NA(t);let i=this.stack[this.stack.length-1];i.value+=r}function H(e){let t=this.stack.pop();t.position.end=TN(e.end)}function ne(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function re(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ie(){return{type:`blockquote`,children:[],position:void 0}}function ae(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function oe(){return{type:`inlineCode`,value:``,position:void 0}}function se(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function U(){return{type:`emphasis`,children:[],position:void 0}}function ce(){return{type:`heading`,depth:0,children:[],position:void 0}}function le(){return{type:`break`,position:void 0}}function ue(){return{type:`html`,value:``,position:void 0}}function de(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function W(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function fe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function pe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function me(){return{type:`paragraph`,children:[],position:void 0}}function he(){return{type:`strong`,children:[],position:void 0}}function ge(){return{type:`text`,value:``,position:void 0}}function _e(){return{type:`thematicBreak`,position:void 0}}}function TN(e){return{line:e.line,column:e.column,offset:e.offset}}function EN(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?EN(e,r):DN(e,r)}}function DN(e,t){let n;for(n in t)if(SN.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function ON(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+vN({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+vN({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+vN({start:t.start,end:t.end})+`) is still open`)}function kN(){return{enter:{mdxFlowExpression:AN,mdxTextExpression:jN},exit:{mdxFlowExpression:MN,mdxFlowExpressionChunk:NN,mdxTextExpression:MN,mdxTextExpressionChunk:NN}}}function AN(e){this.enter({type:`mdxFlowExpression`,value:``},e),this.buffer()}function jN(e){this.enter({type:`mdxTextExpression`,value:``},e),this.buffer()}function MN(e){let t=this.resume(),n=e.estree,r=this.stack[this.stack.length-1];r.type===`mdxFlowExpression`||r.type,this.exit(e),r.value=t,n&&(r.data={estree:n})}function NN(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}var PN=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),FN={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function IN(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function LN(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function RN(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function zN(e){return RN(e)||IN(e)}var BN=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function VN(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?zN:u===`decimal`?IN:LN;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&PN.includes(y)&&(_=y,v=NA(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`&&NA(y);e&&(_=y,v=e)}let S=1+l-o,C=``;if(x||n.nonTerminated!==!1){if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):zN(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(HN(e))h(7,S),C=`�`;else if(e in FN)h(6,S),C=FN[e];else{let t=``;UN(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,BN[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function HN(e){return e>=55296&&e<=57343||e>1114111}function UN(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var WN=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=vN(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};WN.prototype.file=``,WN.prototype.name=``,WN.prototype.reason=``,WN.prototype.message=``,WN.prototype.stack=``,WN.prototype.column=void 0,WN.prototype.line=void 0,WN.prototype.ancestors=void 0,WN.prototype.cause=void 0,WN.prototype.fatal=void 0,WN.prototype.place=void 0,WN.prototype.ruleId=void 0,WN.prototype.source=void 0;function GN(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:d,mdxJsxFlowTagExpressionAttribute:f,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:d,mdxJsxTextTagExpressionAttribute:f,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:m,mdxJsxFlowTagAttributeNameLocal:h,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:_,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:y,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:m,mdxJsxTextTagAttributeNameLocal:h,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:_,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:y}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new WN("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new WN(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new WN("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function d(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function p(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=VN(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function v(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function y(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new WN("Unexpected closing tag `"+S(t)+"`, expected corresponding closing tag for `"+S(r)+"` ("+vN(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,b),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function b(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new WN("Expected a closing tag for `"+S(r)+"` ("+vN({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function x(e,t){let n=this.data.mdxJsxTag;throw new WN("Expected the closing tag `"+S(n)+"` either after the end of `"+t.type+"` ("+vN(t.end)+") or another opening tag after the start of `"+t.type+"` ("+vN(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function KN(e){return e}var qN={}.hasOwnProperty,JN=Symbol(`continue`),YN=Symbol(`exit`),XN=Symbol(`skip`);function ZN(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return $N(e)&&(s.displayName=`node (`+KN(e.type)+`)`),s;function s(){let s=n?QN(n(e,t,a,o)):[];if(s[0]===YN)return s;if(s[0]!==XN){let t;for(t in e)if(qN.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if($N(r)){let e=i(r,t,a,n)();if(e[0]===YN)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if($N(r)){let e=i(r,t,void 0,n)();if(e[0]===YN)return e}}}return r?QN(r(e,t,a,o)):s}}}function QN(e){return Array.isArray(e)?e:typeof e==`number`?[JN,e]:[e]}function $N(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function eP(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=nP(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&tP(m);if(g&&!t.allowEmpty)throw new WN(`Unexpected empty expression`,{place:v(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{u=t.expression&&!g?t.acorn.parseExpressionAt(h,0,f):t.acorn.parse(h,f)}catch(e){let t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,l=t.raisedAt>=n.length+m.length||t.message===`Unterminated comment`}if(u&&t.expression&&!g){if(tP(h.slice(u.end,h.length-r.length)))u={type:`Program`,start:0,end:n.length+m.length,body:[{type:`ExpressionStatement`,expression:u,start:0,end:n.length+m.length}],sourceType:`module`,comments:[]};else{let e=v(u.end),t=Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,u=void 0}}if(u){if(u.comments=a,ZN(u,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),_(e)}),Array.isArray(s))s.push(...a);else if(typeof s==`function`)for(let e of a)s(e.type===`Block`,e.value,e.start,e.end,e.loc.start,e.loc.end);for(let e of o)e.end<=n.length||e.start-n.length>=m.length||(_(e),Array.isArray(c)?c.push(e):c(e))}return{estree:u,error:d,swallow:l};function _(e){let t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>m.length&&(r=m.length);let i=rP(p.stops,r);return i||={line:t.start.line,column:t.start.column,offset:t.start.offset},i}}function tP(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,``))}function nP(e,t){let n={value:``,stops:[]},r=-1;for(;++r<e.length;){let i=e[r];if(i[0]===`enter`){let e=i[1].type;if(e===`lineEnding`||t.includes(e)){let e=i[2].sliceStream(i[1]);for(;e.length>0&&e[0]===-1;)e.shift();let t=iP(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}function rP(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;let[r,i]=e[n-1],a=t-r;return{line:i.line,column:i.column+a,offset:i.offset+a}}function iP(e){let t=-1,n=[],r;for(;++t<e.length;){let i=e[t],a;if(typeof i==`string`)a=i;else switch(i){case-5:a=`\r`;break;case-4:a=`
|
|
69
|
+
`;break;case-3:a=`\r
|
|
70
|
+
`;break;case-2:a=` `;break;case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function aP(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=oP(n.start,r[0]||t.start),a=oP(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function oP(e,t){if(e&&typeof e==`object`){let n=`line`in e?sP(e.line):void 0,r=`column`in e?sP(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:sP(t)}}}function sP(e){return typeof e==`number`&&e>-1?e:void 0}var cP=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,lP=`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,uP=`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,dP=`#unexpected-type-in-code-expected-an-object-spread-spread`,fP=`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,pP=`#could-not-parse-expression-with-acorn`;function mP(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,h;return g;function g(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),_}function _(u){if(u===null){if(h)throw h;let e=new WN("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=cP+lP,e}if(YA(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),y;if(u===125&&p===0){let p=a?hP.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return h=p.message,e.enter(i),e.consume(u),v}return e.enter(i),v(u)}function v(t){return t===125&&p===0||t===null||YA(t)?(e.exit(i),_(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),v)}function y(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new WN("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=cP+uP,e}return ZA(t)?ej(e,_,`linePrefix`,3)(t):_(t)}}function hP(e,t,n,r,i,a,o){let s=eP(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=aP(e),n=new WN("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=cP+dP,n}if(e.expression.properties[1]){let t=new WN(`Unexpected extra content in spread: only a single spread is supported`,{place:aP(e.expression.properties[1]).start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw t.url=cP+fP,t}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=aP(e.expression.properties[0]),n=new WN("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=cP+dP,n}}if(s.error){let e=new WN(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=cP+pP,{type:`nok`,message:e}}return{type:`ok`,estree:c}}function gP(e){let t=e||{},n=t.addResult,r=t.acorn,i=t.spread,a=t.allowEmpty,o;if(a??=!0,r){if(!r.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");o=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions)}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:`mdxFlowExpression`,tokenize:s,concrete:!0}},text:{123:{name:`mdxTextExpression`,tokenize:c}}};function s(e,t,s){let c=this;return l;function l(e){return u(e)}function u(t){return mP.call(c,e,d,`mdxFlowExpression`,`mdxFlowExpressionMarker`,`mdxFlowExpressionChunk`,r,o,n,i,a)(t)}function d(t){return ZA(t)?ej(e,f,`whitespace`)(t):f(t)}function f(n){let r=c.parser.constructs.flow[60],i=(Array.isArray(r)?r:r?[r]:[]).find(function(e){return e.name===`mdxJsxFlowTag`});return n===60&&i?e.attempt(i,f,s)(n):n===null||YA(n)?t(n):s(n)}}function c(e,t){let s=this;return c;function c(c){return mP.call(s,e,t,`mdxTextExpression`,`mdxTextExpressionMarker`,`mdxTextExpressionChunk`,r,o,n,i,a,!0)(c)}}}var _P=/[$_\p{ID_Start}]/u,vP=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,yP=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,bP={};function xP(e){return e?_P.test(String.fromCodePoint(e)):!1}function SP(e,t){let n=(t||bP).jsx?yP:vP;return e?n.test(String.fromCodePoint(e)):!1}var CP=`https://github.com/micromark/micromark-extension-mdx-jsx`;function wP(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j){let M=this,N,P;return F;function F(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),I}function I(e){return XA(e)?n(e):(N=L,he(e))}function L(t){if(t===47)return e.enter(l),e.consume(t),e.exit(l),N=R,he;if(t===62)return me(t);if(t!==null&&t>=0&&xP(t))return e.enter(d),e.enter(f),e.consume(t),z;ve(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function R(t){if(t===62)return me(t);if(t!==null&&t>=0&&xP(t))return e.enter(d),e.enter(f),e.consume(t),z;ve(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function z(t){if(t!==null&&t>=0&&SP(t,{jsx:!0}))return e.consume(t),z;if(t===46||t===47||t===58||t===62||t===123||XA(t)||QA(t))return e.exit(f),N=ee,he(t);ve(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function ee(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),N=B,he;if(t===58)return e.enter(h),e.consume(t),e.exit(h),N=H,he;if(t===47||t===62||t===123||t!==null&&t>=0&&xP(t))return e.exit(d),ie(t);ve(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function B(t){if(t!==null&&t>=0&&xP(t))return e.enter(m),e.consume(t),V;ve(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function V(t){if(t!==null&&t>=0&&SP(t,{jsx:!0}))return e.consume(t),V;if(t===46||t===47||t===62||t===123||XA(t)||QA(t))return e.exit(m),N=te,he(t);ve(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function te(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),N=B,he;if(t===47||t===62||t===123||t!==null&&t>=0&&xP(t))return e.exit(d),ie(t);ve(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function H(t){if(t!==null&&t>=0&&xP(t))return e.enter(g),e.consume(t),ne;ve(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function ne(t){if(t!==null&&t>=0&&SP(t,{jsx:!0}))return e.consume(t),ne;if(t===47||t===62||t===123||XA(t)||QA(t))return e.exit(g),N=re,he(t);ve(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function re(t){if(t===47||t===62||t===123||t!==null&&t>=0&&xP(t))return e.exit(d),ie(t);ve(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ie(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),N=pe,he;if(t===62)return me(t);if(t===123)return mP.call(M,e,ae,_,v,y,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&xP(t))return e.enter(b),e.enter(x),e.enter(S),e.consume(t),oe;ve(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ae(e){return N=ie,he(e)}function oe(t){if(t!==null&&t>=0&&SP(t,{jsx:!0}))return e.consume(t),oe;if(t===47||t===58||t===61||t===62||t===123||XA(t)||QA(t))return e.exit(S),N=se,he(t);ve(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function se(t){if(t===58)return e.enter(C),e.consume(t),e.exit(C),N=U,he;if(t===61)return e.exit(x),e.enter(T),e.consume(t),e.exit(T),N=ue,he;if(t===47||t===62||t===123||XA(t)||QA(t)||t!==null&&t>=0&&xP(t))return e.exit(x),e.exit(b),N=ie,he(t);ve(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function U(t){if(t!==null&&t>=0&&xP(t))return e.enter(w),e.consume(t),ce;ve(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function ce(t){if(t!==null&&t>=0&&SP(t,{jsx:!0}))return e.consume(t),ce;if(t===47||t===61||t===62||t===123||XA(t)||QA(t))return e.exit(w),e.exit(x),N=le,he(t);ve(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function le(t){if(t===61)return e.enter(T),e.consume(t),e.exit(T),N=ue,he;if(t===47||t===62||t===123||t!==null&&t>=0&&xP(t))return e.exit(b),ie(t);ve(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function ue(t){if(t===34||t===39)return e.enter(E),e.enter(D),e.consume(t),e.exit(D),P=t,W;if(t===123)return mP.call(M,e,de,k,A,j,r,i,a,!1,!1,o)(t);ve(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function de(t){return e.exit(b),N=ie,he(t)}function W(t){return t===null&&ve(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(P)+"`"),t===P?(e.enter(D),e.consume(t),e.exit(D),e.exit(E),e.exit(b),P=void 0,N=ie,he):YA(t)?(N=W,he(t)):(e.enter(O),fe(t))}function fe(t){return t===null||t===P||YA(t)?(e.exit(O),W(t)):(e.consume(t),fe)}function pe(e){if(e===62)return me(e);ve(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function me(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function he(t){return YA(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_e):ZA(t)||QA(t)?(e.enter(`esWhitespace`),ge(t)):N(t)}function ge(t){return YA(t)?(e.exit(`esWhitespace`),he(t)):ZA(t)||QA(t)?(e.consume(t),ge):(e.exit(`esWhitespace`),N(t))}function _e(e){if(!o&&M.parser.lazy[M.now().line]){let e=new WN("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",M.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=CP+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return he(e)}function ve(e,t,n){let r=new WN(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+TP(e)+`)`)+` `+t+`, expected `+n,M.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=CP+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function TP(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function EP(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return wP.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function DP(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return wP.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return ZA(e)?ej(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||YA(e)?r(e):i(e)}}}function OP(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:DP(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:EP(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}var kP=Symbol.for(`yaml.alias`),AP=Symbol.for(`yaml.document`),jP=Symbol.for(`yaml.map`),MP=Symbol.for(`yaml.pair`),NP=Symbol.for(`yaml.scalar`),PP=Symbol.for(`yaml.seq`),FP=Symbol.for(`yaml.node.type`),IP=e=>!!e&&typeof e==`object`&&e[FP]===kP,LP=e=>!!e&&typeof e==`object`&&e[FP]===AP,RP=e=>!!e&&typeof e==`object`&&e[FP]===jP,zP=e=>!!e&&typeof e==`object`&&e[FP]===MP,BP=e=>!!e&&typeof e==`object`&&e[FP]===NP,VP=e=>!!e&&typeof e==`object`&&e[FP]===PP;function HP(e){if(e&&typeof e==`object`)switch(e[FP]){case jP:case PP:return!0}return!1}function UP(e){if(e&&typeof e==`object`)switch(e[FP]){case kP:case jP:case NP:case PP:return!0}return!1}var WP=e=>(BP(e)||HP(e))&&!!e.anchor,GP=Symbol(`break visit`),KP=Symbol(`skip children`),qP=Symbol(`remove node`);function JP(e,t){let n=XP(t);LP(e)?YP(null,e.contents,n,Object.freeze([e]))===qP&&(e.contents=null):YP(null,e,n,Object.freeze([]))}JP.BREAK=GP,JP.SKIP=KP,JP.REMOVE=qP;function YP(e,t,n,r){let i=ZP(e,t,n,r);if(UP(i)||zP(i))return QP(e,r,i),YP(e,i,n,r);if(typeof i!=`symbol`){if(HP(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=YP(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===GP)return GP;else i===qP&&(t.items.splice(e,1),--e)}}else if(zP(t)){r=Object.freeze(r.concat(t));let e=YP(`key`,t.key,n,r);if(e===GP)return GP;e===qP&&(t.key=null);let i=YP(`value`,t.value,n,r);if(i===GP)return GP;i===qP&&(t.value=null)}}return i}function XP(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function ZP(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(RP(t))return n.Map?.(e,t,r);if(VP(t))return n.Seq?.(e,t,r);if(zP(t))return n.Pair?.(e,t,r);if(BP(t))return n.Scalar?.(e,t,r);if(IP(t))return n.Alias?.(e,t,r)}function QP(e,t,n){let r=t[t.length-1];if(HP(r))r.items[e]=n;else if(zP(r))e===`key`?r.key=n:r.value=n;else if(LP(r))r.contents=n;else{let e=IP(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var $P={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},eF=e=>e.replace(/[!,[\]{}]/g,e=>$P[e]),tF=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+eF(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&UP(e.contents)){let t={};JP(e.contents,(e,n)=>{UP(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)(i!==`!!`||a!==`tag:yaml.org,2002:`)&&(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
|
|
71
|
+
`)}};tF.defaultYaml={explicit:!1,version:`1.2`},tF.defaultTags={"!!":`tag:yaml.org,2002:`};function nF(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function rF(e){let t=new Set;return JP(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function iF(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function aF(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=rF(e);let a=iF(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(BP(t.node)||HP(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function oF(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=oF(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=oF(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=oF(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=oF(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function sF(e,t,n){if(Array.isArray(e))return e.map((e,t)=>sF(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!WP(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var cF=class{constructor(e){Object.defineProperty(this,FP,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!LP(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=sF(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?oF(i,{"":o},``,o):o}},lF=class extends cF{constructor(e){super(kP),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],JP(e,{Node:(e,t)=>{(IP(t)||WP(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(sF(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=uF(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(nF(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function uF(e,t,n){if(IP(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(HP(t)){let r=0;for(let i of t.items){let t=uF(e,i,n);t>r&&(r=t)}return r}if(zP(t)){let r=uF(e,t.key,n),i=uF(e,t.value,n);return Math.max(r,i)}return 1}var dF=e=>!e||typeof e!=`function`&&typeof e!=`object`,fF=class extends cF{constructor(e){super(NP),this.value=e}toJSON(e,t){return t?.keep?this.value:sF(this.value,e,t)}toString(){return String(this.value)}};fF.BLOCK_FOLDED=`BLOCK_FOLDED`,fF.BLOCK_LITERAL=`BLOCK_LITERAL`,fF.PLAIN=`PLAIN`,fF.QUOTE_DOUBLE=`QUOTE_DOUBLE`,fF.QUOTE_SINGLE=`QUOTE_SINGLE`;var pF=`tag:yaml.org,2002:`;function mF(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function hF(e,t,n){if(LP(e)&&(e=e.contents),UP(e))return e;if(zP(e)){let t=n.schema[jP].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new lF(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=pF+t.slice(2));let l=mF(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new fF(e);return c&&(c.node=t),t}l=e instanceof Map?o[jP]:Symbol.iterator in Object(e)?o[PP]:o[jP]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new fF(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function gF(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return hF(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var _F=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,vF=class extends cF{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>UP(t)||zP(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(_F(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(HP(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,gF(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(HP(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&BP(i)?i.value:i:HP(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!zP(t))return!1;let n=t.value;return n==null||e&&BP(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return HP(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(HP(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,gF(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},yF=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function bF(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var xF=(e,t,n)=>e.endsWith(`
|
|
72
|
+
`)?bF(n,t):n.includes(`
|
|
73
|
+
`)?`
|
|
74
|
+
`+bF(n,t):(e.endsWith(` `)?``:` `)+n,SF=`flow`,CF=`block`,wF=`quoted`;function TF(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=EF(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
|
|
75
|
+
`)n===`block`&&(h=EF(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
|
|
76
|
+
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
|
|
77
|
+
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function EF(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
|
|
78
|
+
`);r=t,i=t+1,a=e[i]}return r}var DF=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),OF=e=>/^(%|---|\.\.\.)/m.test(e);function kF(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
|
|
79
|
+
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function AF(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(OF(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
|
|
80
|
+
|
|
81
|
+
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
|
|
82
|
+
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:TF(o,a,wF,DF(t,!1))}function jF(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
83
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return AF(e,t);let n=t.indent||(OF(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:TF(r,n,SF,DF(t,!1))}function MF(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=AF;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?jF:i&&!t?AF:n?jF:AF}return r(e,t)}var NF;try{NF=RegExp(`(^|(?<!
|
|
84
|
+
))
|
|
85
|
+
+(?!
|
|
86
|
+
|$)`,`g`)}catch{NF=/\n+(?!\n|$)/g}function PF({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return MF(n,r);let l=r.indent||(r.forceBlockIndent||OF(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===fF.BLOCK_FOLDED?!1:t===fF.BLOCK_LITERAL||!kF(n,c,l.length);if(!n)return u?`|
|
|
87
|
+
`:`>
|
|
88
|
+
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
|
|
89
|
+
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
|
|
90
|
+
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
|
|
91
|
+
`&&(p=p.slice(0,-1)),p.replace(NF,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
|
|
92
|
+
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
|
|
93
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=DF(r,!0);o!==`folded`&&t!==fF.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=TF(`${v}${e}${p}`,l,CF,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function FF(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
|
|
94
|
+
`)||u&&/[[\]{},]/.test(a))return MF(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
|
95
|
+
`)?MF(a,t):PF(e,t,n,r);if(!s&&!u&&i!==fF.PLAIN&&a.includes(`
|
|
96
|
+
`))return PF(e,t,n,r);if(OF(a)){if(c===``)return t.forceBlockIndent=!0,PF(e,t,n,r);if(s&&c===l)return MF(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return MF(a,t)}return s?d:TF(d,c,SF,DF(t,!1))}function IF(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==fF.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=fF.QUOTE_DOUBLE);let c=e=>{switch(e){case fF.BLOCK_FOLDED:case fF.BLOCK_LITERAL:return i||a?MF(o.value,t):PF(o,t,n,r);case fF.QUOTE_DOUBLE:return AF(o.value,t);case fF.QUOTE_SINGLE:return jF(o.value,t);case fF.PLAIN:return FF(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function LF(e,t){let n=Object.assign({blockQuote:!0,commentString:yF,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function RF(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(BP(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function zF(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(BP(e)||HP(e))&&e.anchor;a&&nF(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function BF(e,t,n,r){if(zP(e))return e.toString(t,n,r);if(IP(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=UP(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=RF(t.doc.schema.tags,a);let o=zF(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):BP(a)?IF(a,t,n,r):a.toString(t,n,r);return o?BP(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function VF({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=UP(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(HP(e)||!UP(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||HP(e)||(BP(e)?e.type===fF.BLOCK_FOLDED||e.type===fF.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=BF(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=xF(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=xF(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=xF(g,n.indent,l(f))));let _,v,y;UP(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&BP(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&VP(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=BF(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
|
|
97
|
+
`:``,v){let e=l(v);S+=`\n${bF(e,n.indent)}`}x===``&&!n.inFlow?S===`
|
|
98
|
+
`&&y&&(S=`
|
|
99
|
+
|
|
100
|
+
`):S+=`\n${n.indent}`}else if(!p&&HP(t)){let e=x[0],r=x.indexOf(`
|
|
101
|
+
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else(x===``||x[0]===`
|
|
102
|
+
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=xF(g,n.indent,l(y)):h&&i&&i(),g}function HF(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var UF=`<<`,WF={identify:e=>e===UF||typeof e==`symbol`&&e.description===UF,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new fF(Symbol(UF)),{addToJSMap:KF}),stringify:()=>UF},GF=(e,t)=>(WF.identify(t)||BP(t)&&(!t.type||t.type===fF.PLAIN)&&WF.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===WF.tag&&e.default);function KF(e,t,n){let r=JF(e,n);if(VP(r))for(let n of r.items)qF(e,t,n);else if(Array.isArray(r))for(let n of r)qF(e,t,n);else qF(e,t,r)}function qF(e,t,n){let r=JF(e,n);if(!RP(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function JF(e,t){return e&&IP(t)?t.resolve(e.doc,e):t}function YF(e,t,{key:n,value:r}){if(UP(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(GF(e,n))KF(e,t,r);else{let i=sF(n,``,e);if(t instanceof Map)t.set(i,sF(r,i,e));else if(t instanceof Set)t.add(i);else{let a=XF(n,i,e),o=sF(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function XF(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(UP(e)&&n?.doc){let t=LF(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),HF(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function ZF(e,t,n){return new QF(hF(e,void 0,n),hF(t,void 0,n))}var QF=class e{constructor(e,t=null){Object.defineProperty(this,FP,{value:MP}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return UP(n)&&(n=n.clone(t)),UP(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return YF(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?VF(this,e,t,n):JSON.stringify(this)}};function $F(e,t,n){return(t.inFlow??e.flow?tI:eI)(e,t,n)}function eI({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(UP(i))!d&&i.spaceBefore&&f.push(``),nI(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(zP(i)){let e=UP(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),nI(n,f,e.commentBefore,d))}d=!1;let s=BF(i,u,()=>o=null,()=>d=!0);o&&(s+=xF(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
|
|
103
|
+
`}}return e?(p+=`
|
|
104
|
+
`+bF(l(e),c),s&&s()):d&&o&&o(),p}function tI({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(UP(i))i.spaceBefore&&d.push(``),nI(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(zP(i)){let e=UP(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),nI(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=UP(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=BF(i,c,()=>a=null);l||=d.length>u||o.includes(`
|
|
105
|
+
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=xF(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
|
|
106
|
+
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function nI({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=bF(t(r),e);n.push(i.trimStart())}}function rI(e,t){let n=BP(t)?t.value:t;for(let r of e)if(zP(r)&&(r.key===t||r.key===n||BP(r.key)&&r.key.value===n))return r}var iI=class extends vF{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(jP,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(ZF(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=zP(e)?e:!e||typeof e!=`object`||!(`key`in e)?new QF(e,e?.value):new QF(e.key,e.value);let r=rI(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);BP(r.value)&&dF(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=rI(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=rI(this.items,e)?.value;return(!t&&BP(n)?n.value:n)??void 0}has(e){return!!rI(this.items,e)}set(e,t){this.add(new QF(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)YF(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!zP(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),$F(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},aI={collection:`map`,default:!0,nodeClass:iI,tag:`tag:yaml.org,2002:map`,resolve(e,t){return RP(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>iI.from(e,t,n)},oI=class extends vF{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(PP,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=sI(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=sI(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&BP(r)?r.value:r}has(e){let t=sI(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=sI(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];BP(r)&&dF(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(sF(e,String(r++),t));return n}toString(e,t,n){return e?$F(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(hF(a,void 0,n))}}return i}};function sI(e){let t=BP(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var cI={collection:`seq`,default:!0,nodeClass:oI,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return VP(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>oI.from(e,t,n)},lI={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),IF(e,t,n,r)}},uI={identify:e=>e==null,createNode:()=>new fF(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new fF(null),stringify:({source:e},t)=>typeof e==`string`&&uI.test.test(e)?e:t.options.nullStr},dI={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new fF(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&dI.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function fI({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var pI={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:fI},mI={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():fI(e)}},hI={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new fF(parseFloat(e)),n=e.indexOf(`.`);return n!==-1&&e[e.length-1]===`0`&&(t.minFractionDigits=e.length-n-1),t},stringify:fI},gI=e=>typeof e==`bigint`||Number.isInteger(e),_I=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function vI(e,t,n){let{value:r}=e;return gI(r)&&r>=0?n+r.toString(t):fI(e)}var yI={identify:e=>gI(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>_I(e,2,8,n),stringify:e=>vI(e,8,`0o`)},bI={identify:gI,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>_I(e,0,10,n),stringify:fI},xI={identify:e=>gI(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>_I(e,2,16,n),stringify:e=>vI(e,16,`0x`)},SI=[aI,cI,lI,uI,dI,yI,bI,xI,pI,mI,hI];function CI(e){return typeof e==`bigint`||Number.isInteger(e)}var wI=({value:e})=>JSON.stringify(e),TI=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:wI},{identify:e=>e==null,createNode:()=>new fF(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:wI},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:wI},{identify:CI,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>CI(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:wI}],EI=[aI,cI].concat(TI,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),DI={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}return t(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return``;let o=n,s;if(typeof btoa==`function`){let e=``;for(let t=0;t<o.length;++t)e+=String.fromCharCode(o[t]);s=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(t??=fF.BLOCK_LITERAL,t!==fF.QUOTE_DOUBLE){let e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(s.length/e),i=Array(n);for(let t=0,r=0;t<n;++t,r+=e)i[t]=s.substr(r,e);s=i.join(t===fF.BLOCK_LITERAL?`
|
|
107
|
+
`:` `)}return IF({comment:e,type:t,value:s},r,i,a)}};function OI(e,t){if(VP(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!zP(r)){if(RP(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new QF(new fF(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=zP(r)?r:new QF(r)}}else t(`Expected a sequence for this tag`);return e}function kI(e,t,n){let{replacer:r}=n,i=new oI(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(ZF(o,s,n))}return i}var AI={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:OI,createNode:kI},jI=class e extends oI{constructor(){super(),this.add=iI.prototype.add.bind(this),this.delete=iI.prototype.delete.bind(this),this.get=iI.prototype.get.bind(this),this.has=iI.prototype.has.bind(this),this.set=iI.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(zP(e)?(r=sF(e.key,``,t),i=sF(e.value,r,t)):r=sF(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=kI(e,t,n),i=new this;return i.items=r.items,i}};jI.tag=`tag:yaml.org,2002:omap`;var MI={collection:`seq`,identify:e=>e instanceof Map,nodeClass:jI,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=OI(e,t),r=[];for(let{key:e}of n.items)BP(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new jI,n)},createNode:(e,t,n)=>jI.from(e,t,n)};function NI({value:e,source:t},n){return t&&(e?PI:FI).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var PI={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new fF(!0),stringify:NI},FI={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new fF(!1),stringify:NI},II={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:fI},LI={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():fI(e)}},RI={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new fF(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:fI},zI=e=>typeof e==`bigint`||Number.isInteger(e);function BI(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function VI(e,t,n){let{value:r}=e;if(zI(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return fI(e)}var HI={identify:zI,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>BI(e,2,2,n),stringify:e=>VI(e,2,`0b`)},UI={identify:zI,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>BI(e,1,8,n),stringify:e=>VI(e,8,`0`)},WI={identify:zI,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>BI(e,0,10,n),stringify:fI},GI={identify:zI,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>BI(e,2,16,n),stringify:e=>VI(e,16,`0x`)},KI=class e extends iI{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=zP(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new QF(e.key,null):new QF(e,null),rI(this.items,t.key)||this.items.push(t)}get(e,t){let n=rI(this.items,e);return!t&&zP(n)?BP(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=rI(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new QF(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(ZF(e,null,n));return i}};KI.tag=`tag:yaml.org,2002:set`;var qI={collection:`map`,identify:e=>e instanceof Set,nodeClass:KI,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>KI.from(e,t,n),resolve(e,t){if(RP(e)){if(e.hasAllNullValues(!0))return Object.assign(new KI,e);t(`Set items must all have null values`)}else t(`Expected a mapping for this tag`);return e}};function JI(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function YI(e){let{value:t}=e,n=e=>e;if(typeof t==`bigint`)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return fI(e);let r=``;t<0&&(r=`-`,t*=n(-1));let i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}var XI={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>JI(e,n),stringify:YI},ZI={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>JI(e,!1),stringify:YI},QI={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(QI.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,i,a,o,s]=t.map(Number),c=t[7]?Number((t[7]+`00`).substr(1,3)):0,l=Date.UTC(n,r-1,i,a||0,o||0,s||0,c),u=t[8];if(u&&u!==`Z`){let e=JI(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``},$I=[aI,cI,lI,uI,PI,FI,HI,UI,WI,GI,II,LI,RI,DI,WF,MI,AI,qI,XI,ZI,QI],eL=new Map([[`core`,SI],[`failsafe`,[aI,cI,lI]],[`json`,EI],[`yaml11`,$I],[`yaml-1.1`,$I]]),tL={binary:DI,bool:dI,float:hI,floatExp:mI,floatNaN:pI,floatTime:ZI,int:bI,intHex:xI,intOct:yI,intTime:XI,map:aI,merge:WF,null:uI,omap:MI,pairs:AI,seq:cI,set:qI,timestamp:QI},nL={"tag:yaml.org,2002:binary":DI,"tag:yaml.org,2002:merge":WF,"tag:yaml.org,2002:omap":MI,"tag:yaml.org,2002:pairs":AI,"tag:yaml.org,2002:set":qI,"tag:yaml.org,2002:timestamp":QI};function rL(e,t,n){let r=eL.get(t);if(r&&!e)return n&&!r.includes(WF)?r.concat(WF):r.slice();let i=r;if(!i){if(Array.isArray(e))i=[];else{let e=Array.from(eL.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(WF)),i.reduce((e,t)=>{let n=typeof t==`string`?tL[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(tL).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}var iL=(e,t)=>e.key<t.key?-1:+(e.key>t.key),aL=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?rL(e,`compat`):e?rL(null,e):null,this.name=typeof i==`string`&&i||`core`,this.knownTags=r?nL:{},this.tags=rL(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,jP,{value:aI}),Object.defineProperty(this,NP,{value:lI}),Object.defineProperty(this,PP,{value:cI}),this.sortMapEntries=typeof a==`function`?a:a===!0?iL:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function oL(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push(`---`);let i=LF(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift(``);let t=a(e.commentBefore);n.unshift(bF(t,``))}let o=!1,s=null;if(e.contents){if(UP(e.contents)){if(e.contents.spaceBefore&&r&&n.push(``),e.contents.commentBefore){let t=a(e.contents.commentBefore);n.push(bF(t,``))}i.forceBlockIndent=!!e.comment,s=e.contents.comment}let t=s?void 0:()=>o=!0,c=BF(e.contents,i,()=>s=null,t);s&&(c+=xF(c,``,a(s))),(c[0]===`|`||c[0]===`>`)&&n[n.length-1]===`---`?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(BF(e.contents,i));if(e.directives?.docEnd){if(e.comment){let t=a(e.comment);t.includes(`
|
|
108
|
+
`)?(n.push(`...`),n.push(bF(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(bF(a(t),``)))}return n.join(`
|
|
109
|
+
`)+`
|
|
110
|
+
`}var sL=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,FP,{value:AP});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new tF({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[FP]:{value:AP}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=UP(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){cL(this.contents)&&this.contents.add(e)}addIn(e,t){cL(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=rF(this);e.anchor=!t||n.has(t)?iF(t||`a`,n):t}return new lF(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=aF(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=hF(e,l,p);return o&&HP(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new QF(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return cL(this.contents)?this.contents.delete(e):!1}deleteIn(e){return _F(e)?this.contents!=null&&(this.contents=null,!0):cL(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return HP(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return _F(e)?!t&&BP(this.contents)?this.contents.value:this.contents:HP(this.contents)?this.contents.getIn(e,t):void 0}has(e){return HP(this.contents)?this.contents.has(e):!1}hasIn(e){return _F(e)?this.contents!==void 0:HP(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=gF(this.schema,[e],t):cL(this.contents)&&this.contents.set(e,t)}setIn(e,t){_F(e)?this.contents=t:this.contents==null?this.contents=gF(this.schema,Array.from(e),t):cL(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new tF({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new tF({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new aL(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=sF(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?oF(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return oL(this,e)}};function cL(e){if(HP(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var lL=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},uL=class extends lL{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},dL=class extends lL{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},fL=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
|
|
111
|
+
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function pL(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function mL(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
|
|
112
|
+
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(mL(t.key)||mL(t.value))return!0}return!1;default:return!0}}function hL(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&mL(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function gL(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||BP(e)&&BP(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var _L=`All mapping items must start at the same column`;function vL({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??iI)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=pL(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,_L)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
|
|
113
|
+
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||mL(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,_L);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&hL(r.indent,u,i),n.atKey=!1,gL(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=pL(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&hL(r.indent,f,i),s=c.range[2];let l=new QF(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
|
|
114
|
+
`+_.comment:g.comment=_.comment);let e=new QF(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function yL({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??oI)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=pL(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&hL(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function bL(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var xL=`Block collections are not allowed within flow collections`,SL=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function CL({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?iI:oI))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=pL(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
|
|
115
|
+
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&mL(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];zP(t)&&(t=t.value??t.key),t.comment?t.comment+=`
|
|
116
|
+
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],SL(m)&&i(r.range,`BLOCK_IN_FLOW`,xL)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);SL(f)&&i(g.range,`BLOCK_IN_FLOW`,xL),n.atKey=!1;let _=pL(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?SL(m)&&i(v.range,`BLOCK_IN_FLOW`,xL):_.comment&&(g.comment?g.comment+=`
|
|
117
|
+
`+_.comment:g.comment=_.comment);let y=new QF(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;gL(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new iI(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=bL(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
|
|
118
|
+
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function wL(e,t,n,r,i,a){let o=n.type===`block-map`?vL(e,t,n,r,a):n.type===`block-seq`?yL(e,t,n,r,a):CL(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function TL(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===iI.tagName&&s===`map`||o===oI.tagName&&s===`seq`)return wL(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),wL(e,t,n,i,o)}let l=wL(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=UP(u)?u:new fF(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function EL(e,t,n){let r=t.offset,i=DL(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?fF.BLOCK_FOLDED:fF.BLOCK_LITERAL,o=t.source?OL(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
|
|
119
|
+
`.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
|
|
120
|
+
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===fF.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
|
|
121
|
+
`):t.length>c||r[0]===` `?(f===` `?f=`
|
|
122
|
+
`:!p&&f===`
|
|
123
|
+
`&&(f=`
|
|
124
|
+
|
|
125
|
+
`),d+=f+t.slice(c)+r,f=`
|
|
126
|
+
`,p=!0):r===``?f===`
|
|
127
|
+
`?d+=`
|
|
128
|
+
`:f=`
|
|
129
|
+
`:(d+=f+r,f=` `,p=!1)}switch(i.chomp){case`-`:break;case`+`:for(let e=s;e<o.length;++e)d+=`
|
|
130
|
+
`+o[e][0].slice(c);d[d.length-1]!==`
|
|
131
|
+
`&&(d+=`
|
|
132
|
+
`);break;default:d+=`
|
|
133
|
+
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function DL({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function OL(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function kL(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=fF.PLAIN,c=AL(a,l);break;case`single-quoted-scalar`:s=fF.QUOTE_SINGLE,c=jL(a,l);break;case`double-quoted-scalar`:s=fF.QUOTE_DOUBLE,c=NL(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=bL(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function AL(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),ML(e)}function jL(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),ML(e.slice(1,-1)).replace(/''/g,`'`)}function ML(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
|
|
134
|
+
`?a+=o:o=`
|
|
135
|
+
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function NL(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
|
|
136
|
+
`){if(i===`
|
|
137
|
+
`){let{fold:t,offset:i}=PL(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=FL[i];if(a)n+=a;else if(i===`
|
|
138
|
+
`)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
|
|
139
|
+
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=IL(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
|
|
140
|
+
`&&(a!==`\r`||e[r+2]!==`
|
|
141
|
+
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function PL(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
|
|
142
|
+
`||r===`\r`)&&(r!==`\r`||e[t+2]===`
|
|
143
|
+
`);)r===`
|
|
144
|
+
`&&(n+=`
|
|
145
|
+
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var FL={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
|
|
146
|
+
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function IL(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function LL(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?EL(e,t,r):kL(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[NP]:c?RL(e.schema,i,c,n,r):t.type===`scalar`?zL(e,i,t,r):e.schema[NP];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=BP(a)?a:new fF(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new fF(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function RL(e,t,n,r,i){if(n===`!`)return e[NP];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[NP])}function zL({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[NP];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[NP];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function BL(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var VL={composeNode:HL,composeEmptyNode:UL};function HL(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=WL(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=LL(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=TL(VL,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=UL(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!BP(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function UL(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=LL(e,{type:`scalar`,offset:BL(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function WL({options:e},{offset:t,source:n,end:r},i){let a=new lF(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=bL(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function GL(e,t,{offset:n,start:r,value:i,end:a},o){let s=new sL(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=pL(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?HL(c,i,l,o):UL(c,l.end,r,null,l,o);let u=s.contents.range[2],d=bL(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function KL(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function qL(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
|
|
147
|
+
|
|
148
|
+
`:`
|
|
149
|
+
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var JL=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=KL(e);r?this.warnings.push(new dL(i,t,n)):this.errors.push(new uL(i,t,n))},this.directives=new tF({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=qL(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(HP(i)&&!i.flow&&i.items.length>0){let e=i.items[0];zP(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:qL(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=KL(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=GL(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new uL(KL(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new uL(KL(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=bL(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new uL(KL(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new sL(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},YL=Symbol(`break visit`),XL=Symbol(`skip children`),ZL=Symbol(`remove item`);function QL(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),$L(Object.freeze([]),e,t)}QL.BREAK=YL,QL.SKIP=XL,QL.REMOVE=ZL,QL.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},QL.parentCollection=(e,t)=>{let n=QL.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function $L(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=$L(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===YL)return YL;else r===ZL&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function eR(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
|
|
150
|
+
`:case`\r
|
|
151
|
+
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function tR(e){switch(e){case void 0:case` `:case`
|
|
152
|
+
`:case`\r`:case` `:return!0;default:return!1}}var nR=new Set(`0123456789ABCDEFabcdef`),rR=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),iR=new Set(`,[]{}`),aR=new Set(` ,[]{}
|
|
153
|
+
\r `),oR=e=>!e||aR.has(e),sR=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
|
|
154
|
+
`||t===`\r`&&this.buffer[e+1]===`
|
|
155
|
+
`}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
|
|
156
|
+
`||!t&&!this.atEnd)return e+n+1}return t===`
|
|
157
|
+
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&tR(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
158
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&tR(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!tR(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&tR(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(oR),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&tR(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!==`]`&&r[0]!==`}`))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(oR),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||tR(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
|
|
159
|
+
`,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
|
|
160
|
+
`,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>tR(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
|
|
161
|
+
`:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
|
|
162
|
+
`)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.indentNext=this.blockScalarIndent===-1?t:this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
|
|
163
|
+
`,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
|
|
164
|
+
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
|
|
165
|
+
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(tR(r)||e&&iR.has(r))break;t=n}else if(tR(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
|
|
166
|
+
`?(n+=1,r=`
|
|
167
|
+
`,i=this.buffer[n+1]):t=n),i===`#`||e&&iR.has(i))break;if(r===`
|
|
168
|
+
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&iR.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(oR),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(tR(n)||t&&iR.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!tR(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(rR.has(t))t=this.buffer[++e];else if(t===`%`&&nR.has(this.buffer[e+1])&&nR.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
169
|
+
`?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
|
|
170
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},cR=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function lR(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function uR(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function dR(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function fR(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function pR(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function mR(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function hR(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!lR(t.start,`explicit-key-ind`)&&!lR(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,dR(t.value)?t.value.end?mR(t.value.end,t.sep):t.value.end=t.sep:mR(t.start,t.sep),delete t.sep)}var gR=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new sR,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=eR(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&hR(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&uR(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case`directive-line`:yield{type:`directive`,offset:this.offset,source:this.source};return;case`byte-order-mark`:case`space`:case`comment`:case`newline`:yield this.sourceToken;return;case`doc-mode`:case`doc-start`:{let e={type:`document`,offset:this.offset,start:[]};this.type===`doc-start`&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case`doc-start`:uR(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());return;case`anchor`:case`tag`:case`space`:case`comment`:case`newline`:e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type===`map-value-ind`){let t=pR(fR(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case`space`:case`comment`:case`newline`:e.props.push(this.sourceToken);return;case`scalar`:if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
|
|
171
|
+
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
172
|
+
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){mR(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(lR(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=pR(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(lR(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(dR(t.key)&&!lR(t.sep,`newline`)){let e=pR(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):lR(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!lR(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){mR(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||lR(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=pR(fR(t));hR(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
|
|
173
|
+
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
174
|
+
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=pR(fR(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=pR(fR(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function _R(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new cR||null,prettyErrors:t}}function vR(e,t={}){let{lineCounter:n,prettyErrors:r}=_R(t),i=new gR(n?.addNewLine),a=new JL(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new uL(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(fL(e,n)),o.warnings.forEach(fL(e,n))),o}var yR=[{name:`Email`,import:`@samva/markup/email`,props:[{name:`className`,type:`string`,optional:!0,description:`CSS classes applied to the primitive's content element.`},{name:`lang`,type:`string`,optional:!0},{name:`dir`,type:`"ltr" | "rtl"`,optional:!0},{name:`title`,type:`string`,optional:!0,description:`Document title; several clients use it as the fallback preview line.`},{name:`backgroundColor`,type:`string`,optional:!0,description:"The page color, painted across the whole body and, as `bgcolor`, on the wrapper table for clients that drop body styles. Defaults to the theme's `--color-background`, which switches in dark mode."},{name:`gutter`,type:`number`,optional:!0,description:"Pixels of space each side of the content, so it never touches the screen edge on a narrow viewport. Defaults to 16; `0` lets content run edge to edge."},{name:`style`,type:`EmailStyle`,optional:!0,description:`Applied to the content cell, where Yahoo and AOL keep body styling.`},{name:`children`,type:`EmailChild`,optional:!0}]},{name:`Section`,import:`@samva/markup/email`,props:[{name:`className`,type:`string`,optional:!0,description:`CSS classes applied to the primitive's content element.`},{name:`align`,type:`"left" | "center" | "right"`,optional:!0},{name:`width`,type:`number | string`,optional:!0,description:"The band's width. A pixel width (`600`) is a maximum: the band fills a narrower screen, and classic Outlook, which ignores `max-width`, draws it at that width."},{name:`bgcolor`,type:`string`,optional:!0},{name:`style`,type:`EmailStyle`,optional:!0,description:`Applied to the content cell so padding survives Outlook and Klaviyo.`},{name:`tableStyle`,type:`EmailStyle`,optional:!0},{name:`children`,type:`EmailChild`,optional:!0}]},{name:`Columns`,import:`@samva/markup/email`,props:[{name:`className`,type:`string`,optional:!0,description:`CSS classes applied to the primitive's content element.`},{name:`align`,type:`"left" | "center" | "right"`,optional:!0},{name:`width`,type:`number | string`,optional:!0},{name:`style`,type:`EmailStyle`,optional:!0},{name:`each`,type:`readonly Item[]`,optional:!0,description:"Repeat the cells for each item: `children` is then a function from an item (and its index in the row) to a `Column`. Without `per` all items share one row."},{name:`per`,type:`number`,optional:!0,description:"With `each`, the cells in a row; each chunk of items is its own `Columns` table."},{name:`stack`,type:`boolean`,optional:!0,description:"Stack the cells into one column, each full width, on a viewport narrower than 600px. On by default; `stack={false}` keeps a row of small cells (icons, a price beside a label) side by side. Clients that ignore media queries keep the row."},{name:`gap`,type:`number`,optional:!0,description:`Pixels between the cells of a row. A stacked row puts the same space between the stacked cells instead, so a gap needs no padding on the cells that would misalign them when stacked. The cells must be written out and always render.`},{name:`children`,type:`EmailChild | ((item: Item, index: number) => EmailChild)`,optional:!0,description:"`Column` elements, or with `each` a function that returns one."}]},{name:`Column`,import:`@samva/markup/email`,props:[{name:`className`,type:`string`,optional:!0,description:`CSS classes applied to the primitive's content element.`},{name:`align`,type:`"left" | "center" | "right"`,optional:!0},{name:`valign`,type:`"top" | "middle" | "bottom"`,optional:!0},{name:`width`,type:`number | string`,optional:!0},{name:`style`,type:`EmailStyle`,optional:!0},{name:`children`,type:`EmailChild`,optional:!0}]},{name:`Button`,import:`@samva/markup/email`,props:[{name:`className`,type:`string`,optional:!0,description:`CSS classes applied to the primitive's content element.`},{name:`href`,type:`string`,optional:!1},{name:`width`,type:`number`,optional:!0,description:"Pixel width of the box. Classic Outlook draws the VML shape at a fixed width, so without this it is estimated from the label and `paddingX`, and the anchor sizes to its label."},{name:`height`,type:`number`,optional:!0,description:`Pixel height; classic Outlook's VML fallback needs it.`},{name:`paddingX`,type:`number`,optional:!0,description:"Horizontal padding on each side of the label when no `width` fixes the box."},{name:`backgroundColor`,type:`string`,optional:!0},{name:`color`,type:`string`,optional:!0},{name:`borderRadius`,type:`number`,optional:!0},{name:`borderColor`,type:`string`,optional:!0},{name:`borderWidth`,type:`number`,optional:!0},{name:`fontSize`,type:`number`,optional:!0},{name:`fontFamily`,type:`string`,optional:!0},{name:`align`,type:`"left" | "center" | "right"`,optional:!0},{name:`style`,type:`EmailStyle`,optional:!0},{name:`children`,type:`EmailChild`,optional:!0,description:`The label. A string label is required for the classic Outlook fallback.`}]},{name:`Spacer`,import:`@samva/markup/email`,props:[{name:`height`,type:`number`,optional:!1}]},{name:`Divider`,import:`@samva/markup/email`,props:[{name:`className`,type:`string`,optional:!0,description:`CSS classes applied to the primitive's content element.`},{name:`color`,type:`string`,optional:!0},{name:`thickness`,type:`number`,optional:!0},{name:`style`,type:`EmailStyle`,optional:!0}]},{name:`Image`,import:`@samva/markup/email`,props:[{name:`className`,type:`string`,optional:!0,description:`CSS classes applied to the primitive's content element.`},{name:`src`,type:`string`,optional:!1},{name:`alt`,type:`string`,optional:!1,description:`Required. Use an empty string only for images that carry no meaning.`},{name:`width`,type:`number | string`,optional:!0},{name:`height`,type:`number | string`,optional:!0},{name:`align`,type:`"left" | "center" | "right"`,optional:!0},{name:`style`,type:`EmailStyle`,optional:!0}]},{name:`Link`,import:`@samva/markup/email`,props:[{name:`className`,type:`string`,optional:!0,description:`CSS classes applied to the primitive's content element.`},{name:`href`,type:`string`,optional:!1},{name:`target`,type:`string`,optional:!0},{name:`rel`,type:`string`,optional:!0},{name:`style`,type:`EmailStyle`,optional:!0},{name:`children`,type:`EmailChild`,optional:!0}]},{name:`BrandLogo`,import:`samva:brand`,props:[{name:`width`,type:`number`,optional:!0,description:`Rendered width in pixels; the height follows the image.`},{name:`alt`,type:`string`,optional:!0,description:`Defaults to the brand footer's company name.`},{name:`align`,type:`"left" | "center" | "right"`,optional:!0},{name:`className`,type:`string`,optional:!0}]},{name:`BrandFooter`,import:`samva:brand`,props:[{name:`unsubscribeLabel`,type:`string`,optional:!0,description:`Text of the unsubscribe link.`},{name:`className`,type:`string`,optional:!0}]}],bR=(e,t)=>{let n=/^(?:\uFEFF)?---[ \t]*(?:\r\n|\n|\r)/.exec(e);if(n===null)return t(`An issue requires YAML frontmatter with title, slug and topic.`,0),{markdown:e,frontmatter:void 0};let r=n[0].length,i=/^---[ \t]*(?:\r?$)/m.exec(e.slice(r));if(i===null)return t(`Close the YAML frontmatter with a line containing ---.`,0),{markdown:``,frontmatter:void 0};let a=r+i.index,o=a+i[0].length,s=e.slice(0,o).replace(/[^\r\n]/g,` `)+e.slice(o),c=vR(e.slice(r,a),{uniqueKeys:!0}),l=!1,u=(e,n=0)=>{l=!0,t(e,r+n)};for(let e of c.errors)u(e.message,e.pos[0]);for(let e of c.warnings)u(e.message,e.pos[0]);if(!RP(c.contents))return u(`Frontmatter must be a YAML mapping with title, slug and topic.`),{markdown:s,frontmatter:void 0};let d=(e,t)=>{(e.tag!==void 0||e.anchor!==void 0)&&u(`YAML tags and anchors are not supported.`,e.range?.[0]);for(let n of e.items){if(!BP(n.key)||typeof n.key.value!=`string`){u(`Frontmatter field names must be strings.`);continue}t.includes(n.key.value)||u(`Unknown frontmatter field ${JSON.stringify(n.key.value)}.`,n.key.range?.[0])}},f=(e,t,n=!1)=>{let r=e.get(t,!0);if(r!==void 0||n){if(!BP(r)||typeof r.value!=`string`||n&&r.value.trim()===``||r.tag!==void 0||r.anchor!==void 0){u(`${t} must be ${n?`a nonempty`:`a`} string.`);return}return r.value}},p=c.contents;d(p,[`title`,`slug`,`topic`,`preheader`,`seo`,`gate`]);let m=f(p,`title`,!0),h=f(p,`slug`,!0),g=f(p,`topic`,!0),_=f(p,`preheader`);h!==void 0&&!Wu.test(h)&&u(`slug must be a lowercase kebab-case identifier of at most 100 characters.`);let v,y=p.get(`seo`,!0);if(y!==void 0){if(!RP(y))u(`seo must be a mapping of title, description and image.`);else{d(y,[`title`,`description`,`image`]);let e=f(y,`title`),t=f(y,`description`),n=f(y,`image`);n!==void 0&&(!URL.canParse(n)||!/^https:\/\//i.test(n)||gl(`img`,`src`,n,[]).diagnostics.length>0||URL.canParse(n)&&(new URL(n).username!==``||new URL(n).password!==``))&&u(`seo.image must be a safe absolute https URL without credentials.`),v={...e===void 0?{}:{title:e},...t===void 0?{}:{description:t},...n===void 0?{}:{image:n}}}}let b,x=p.get(`gate`,!0);if(x!==void 0){if(!RP(x))u(`gate must be a mapping with leadIn.`);else{d(x,[`leadIn`]);let e=x.get(`leadIn`,!0);!BP(e)||typeof e.value!=`number`||!Number.isSafeInteger(e.value)||e.value<0||e.tag!==void 0||e.anchor!==void 0?u(`gate.leadIn must be a nonnegative integer counting leading top-level blocks.`):b={leadIn:e.value}}}return{markdown:s,frontmatter:l||m===void 0||h===void 0||g===void 0?void 0:{title:m,slug:h,topic:g,..._===void 0?{}:{preheader:_},...v===void 0?{}:{seo:v},...b===void 0?{}:{gate:b}}}},xR=e=>Object.hasOwn(Sc,e),SR=(e,t)=>{let n=[],r=[],i=zl(e),a=e=>{let n=Bl(i,e);return{fileName:t,lineNumber:n.line,columnNumber:n.column}},o=(e,t,r)=>{n.push({code:e,message:t,severity:`error`,origins:[a(r)]})},{markdown:s,frontmatter:c}=bR(e,(e,t)=>o(`markdown-frontmatter`,e,t)),l=e=>({nodes:n.some(e=>e.severity===`error`)?[]:e,frontmatter:c,diagnostics:n,sources:[t],sourceNodes:r}),u;try{u=CN(s,{extensions:[{disable:{null:[`htmlFlow`,`htmlText`]}},OP(),gP()],mdastExtensions:[GN(),kN()]})}catch(e){let t=Ps(e,`line`)&&typeof e.line==`number`?e.line:1,n=Ps(e,`column`)&&typeof e.column==`number`?e.column:1,r=(i[t-1]??0)+n-1,a=/<!--|<![A-Z]|<\?/.exec(s);return o(a===null?`markdown-syntax`:`markdown-html`,a===null?`Invalid static Markdown: ${String(e)}`:`Raw HTML, comments and processing instructions are not supported; use Markdown or SML components.`,a?.index??r),l([])}let d=e=>e.position?.start.offset??0,f=e=>e.position?.end.offset??d(e),p=e=>{let t=Bl(i,d(e));return[t.line,t.column,0]},m=(e,t,n,i=[],a)=>{let o=`children`in e?e.children:[],s=e.type===`text`?e:o.length===1&&o[0]?.type===`text`?o[0]:void 0,c=s===void 0?[]:[{name:`children`,value:s.value,literalType:`string`,start:d(s),end:f(s),syntax:`markdown`}];r.push({kind:t,tag:n,start:d(e),end:f(e),contentStart:a?.[0]??(o[0]===void 0?d(e):d(o[0])),contentEnd:a?.[1]??(o.length===0?f(e):f(o[o.length-1])),src:p(e),properties:[...i,...c]})},h=(e,t)=>{for(let r of e)n.push({...r,origins:[a(t)]})},g=(e,t,n,r)=>{h(gl(e,t,n,[a(r)]).diagnostics,r)},_=new Map,v=e=>{if(e.type===`definition`&&!_.has(e.identifier)&&_.set(e.identifier,e),`children`in e)for(let t of e.children)v(t)};v(u);let y=(t,n,r)=>{let i=[],a=(e,t,n,r)=>{i.push({name:e,value:t,literalType:`string`,start:n,end:r,syntax:`markdown`})},o=(t,n)=>{let r=0;for(let i=t;i<n;i++){if(e[i]===`\\`){i++;continue}if(e[i]==="`"){let t=1;for(;e[i+t]==="`";)t++;let r="`".repeat(t),a=e.indexOf(r,i+t);for(;a>=0&&a<n&&(e[a-1]==="`"||e[a+t]==="`");)a=e.indexOf(r,a+t);if(a>=0&&a<n){i=a+t-1;continue}}if(e[i]===`[`&&r++,e[i]===`]`&&--r===0)return i}return n},s=d(t)+(r?2:1);r&&`alt`in t&&a(`alt`,t.alt??``,s,o(s-1,f(t)));let c=d(n),l=f(n),u=e[c]===`<`,p=u?c+1:o(c,l)+2;for(;/\s/.test(e[p]??``)&&p<l;)p++;let m=e[p]===`<`;m&&p++;let h=p,g=0;for(;p<l;p++){let t=e[p];if(t===`\\`){p++;continue}if((u||m)&&t===`>`)break;if(!u&&!m){if(t===`(`)g++;else if(t===`)`){if(g===0)break;g--}else if(/\s/.test(t??``))break}}for(a(r?`src`:`href`,n.url,h,p),m&&p++;/\s/.test(e[p]??``)&&p<l;)p++;if(n.title!==null&&n.title!==void 0){let t=e[p]===`(`?`)`:e[p],r=++p;for(;p<l;p++){if(e[p]===`\\`){p++;continue}if(e[p]===t)break}a(`title`,n.title,r,p)}return i},b=(e,t,n)=>{let r=e.type.split(/\s*\|\s*/);if(r.includes(`boolean`)){if(t===!0||t===`true`)return!0;if(t===`false`)return!1}if(typeof t==`string`){if(r.includes(`string`))return t;if(r.includes(`number`)&&/^-?(?:\d+(?:\.\d*)?|\.\d+)$/.test(t)){let e=Number(t);if(Number.isFinite(e))return e}if(r.some(e=>e===JSON.stringify(t)))return t}o(`markdown-prop`,`${e.name} requires a static ${e.type} value.`,n)},x=(t,n)=>{let r=t.name;if(r===null||!xR(r))return o(r!==null&&/^[a-z]/.test(r)?`markdown-html`:`unknown-component`,`Unsupported tag <${r??``}>; use Markdown or a component from the SML component registry.`,d(t)),[];let i=yR.find(e=>e.name===r);if(i===void 0)return o(`markdown-prop`,`The generated prop contract is missing ${r}.`,d(t)),[];let a={},s=[],c=new Set;for(let n of t.attributes){let l=n.position?.start.offset??d(t);if(n.type!==`mdxJsxAttribute`||n.value!==null&&n.value!==void 0&&typeof n.value!=`string`){o(`markdown-expression`,`Expressions and spread attributes are not supported in SML Markdown.`,l);continue}if(c.has(n.name)){o(`markdown-prop`,`Duplicate ${n.name} attribute on <${r}>.`,l);continue}c.add(n.name);let u=i.props.find(e=>e.name===n.name&&e.name!==`children`);if(u===void 0){o(`markdown-prop`,`<${r}> does not support the ${n.name} attribute.`,l);continue}let f=b(u,n.value??!0,l);if(f===void 0)continue;a[n.name]=f,r===`BrandLogo`&&n.name===`width`&&typeof f==`number`&&g(`img`,`width`,f,l);let p=n.position?.end.offset??l+n.name.length,m=e.slice(l,p).search(/["']/);s.push({name:n.name,value:f,literalType:typeof f==`string`?`string`:typeof f==`number`?`number`:`boolean`,start:m<0?l:l+m,end:p,syntax:m<0?`boolean`:`quoted`}),typeof f==`string`&&(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f\uE000\uE001]/.test(f)&&o(`markdown-prop`,`${n.name} contains a control character or reserved token delimiter.`,l),n.name===`href`&&g(`a`,`href`,f,l),n.name===`src`&&g(`img`,`src`,f,l))}for(let e of i.props)!e.optional&&!Object.hasOwn(a,e.name)&&o(`markdown-prop`,`<${r}> requires the ${e.name} attribute.`,d(t));let l=t.children.flatMap(e=>C(e,r===`Columns`&&a.stack!==!1)),u=e.slice(d(t),f(t)),h=t.attributes[t.attributes.length-1],_=e.indexOf(`>`,h?.position?.end.offset??d(t)),v=e[_-1]===`/`?_+1:d(t)+u.lastIndexOf(`</`);return m(t,`component`,r,s,[_+1,v]),l.length>0&&!i.props.some(e=>e.name===`children`)&&o(`markdown-prop`,`<${r}> does not accept children.`,d(t)),[{type:`component`,name:r,props:a,children:l,...r===`Column`?{emailColumn:{stack:n}}:{},src:p(t)}]},S=(e,t,n,r,i,a=[])=>(m(e,t,n,a),[{type:t,tag:n,children:r,...i===void 0?{}:{attrs:i},src:p(e)}]),C=(e,t=!1)=>{let n=e=>C(e,t);switch(e.type){case`root`:return e.children.flatMap(n);case`text`:return m(e,`text`,`#text`),/[\uE000\uE001]/.test(e.value)&&o(`markdown-syntax`,`Text contains a reserved compiler token delimiter.`,d(e)),[e.value];case`paragraph`:return S(e,`block`,`p`,e.children.flatMap(n));case`heading`:return S(e,`block`,`h${e.depth}`,e.children.flatMap(n));case`blockquote`:return S(e,`block`,`blockquote`,e.children.flatMap(n));case`list`:return S(e,`block`,e.ordered?`ol`:`ul`,e.children.flatMap(n),e.ordered&&e.start!==null&&e.start!==void 0&&e.start!==1?{start:e.start}:void 0);case`listItem`:return S(e,`block`,`li`,e.children.flatMap(n));case`strong`:return S(e,`inline`,`strong`,e.children.flatMap(n));case`emphasis`:return S(e,`inline`,`em`,e.children.flatMap(n));case`inlineCode`:return S(e,`inline`,`code`,[e.value]);case`code`:return S(e,`block`,`pre`,[{type:`inline`,tag:`code`,children:[e.value],src:p(e)}]);case`break`:return S(e,`inline`,`br`,[]);case`thematicBreak`:return S(e,`block`,`hr`,[]);case`link`:case`image`:case`linkReference`:case`imageReference`:{let t=e.type===`linkReference`||e.type===`imageReference`?_.get(e.identifier):e;if(t===void 0)return o(`markdown-syntax`,`The Markdown reference has no definition.`,d(e)),[];let r=e.type===`image`||e.type===`imageReference`,i=r?{src:t.url,alt:`alt`in e?e.alt??``:``}:{href:t.url};return t.title!==null&&t.title!==void 0&&(i.title=t.title),g(r?`img`:`a`,r?`src`:`href`,t.url,d(e)),S(e,`inline`,r?`img`:`a`,`children`in e?e.children.flatMap(n):[],i,y(e,t,r))}case`definition`:return[];case`mdxJsxFlowElement`:case`mdxJsxTextElement`:return x(e,t);case`mdxFlowExpression`:case`mdxTextExpression`:return o(`markdown-expression`,`Expressions are not supported in SML Markdown; write static content.`,d(e)),[];case`html`:return o(`markdown-html`,`Raw HTML is not supported; use Markdown or SML components.`,d(e)),[];default:return o(`markdown-syntax`,`Unsupported Markdown construct ${e.type}.`,d(e)),[]}},w=C(u);if(!n.some(e=>e.severity===`error`)){let e=t=>t.flatMap(t=>{if(yc(t))return[t];if(`type`in t&&t.type===`component`&&(t.name===`BrandLogo`||t.name===`BrandFooter`))return[];let n={...t,...`children`in t&&t.children!==void 0?{children:e(t.children)}:{}},r=`src`in t&&t.src!==void 0?(i[t.src[0]-1]??0)+t.src[1]-1:0;return Hc([n],void 0,e=>h([{...e,origins:[]}],r))}),t=e(w),n=e=>{for(let t of e)if(!yc(t)){if(`el`in t){let e=t.src===void 0?0:(i[t.src[0]-1]??0)+t.src[1]-1;for(let[n,r]of Object.entries(t.attrs??{}))(typeof r==`string`||typeof r==`number`)&&g(t.el,n,r,e);Array.isArray(t.style)&&h(hl(Object.fromEntries(t.style),[a(e)]).diagnostics,e)}`children`in t&&t.children!==void 0&&n(t.children)}};n(t)}return r.sort((e,t)=>e.start-t.start||t.end-e.end),l(w)},CR=e=>Ns(e)&&`type`in e&&typeof e.type==`string`&&`start`in e&&typeof e.start==`number`&&`end`in e&&typeof e.end==`number`,wR=e=>Array.isArray(e)?e.filter(CR):[],TR=(e,t,n=null)=>{if(Array.isArray(e)){for(let r of e)TR(r,t,n);return}if(CR(e)){t(e,n);for(let[n,r]of Object.entries(e))n!==`loc`&&n!==`extra`&&n!==`comments`&&TR(r,t,e)}},ER=e=>{try{let t=_D(e,{sourceType:`module`,plugins:[`typescript`,`jsx`]});return CR(t)?t:null}catch{return null}},DR=e=>e.type===`Identifier`||e.type===`MemberExpression`&&e.computed===!1&&CR(e.object)&&DR(e.object),OR=e=>e.split(/\r\n|\n|\r|\u2028|\u2029/).map(e=>e.trim()).filter(e=>e!==``).join(` `),kR=(e,t,n,r)=>{let i=t.type===`JSXExpressionContainer`&&CR(t.expression)?t.expression:t,a=i.type===`StringLiteral`||i.type===`NumericLiteral`||i.type===`BooleanLiteral`||i.type===`JSXText`,o=n.slice(i.start,i.end),s=i.type===`JSXText`?{start:i.start+(o.length-o.trimStart().length),end:i.end-(o.length-o.trimEnd().length)}:{start:t.start,end:t.end};return{name:e,literalType:i.type===`NumericLiteral`?`number`:i.type===`BooleanLiteral`?`boolean`:`string`,kind:a?`literal`:DR(i)?`binding`:`computed`,value:a&&i.type===`JSXText`&&typeof i.value==`string`?OR(i.value):a&&(typeof i.value==`string`||typeof i.value==`number`||typeof i.value==`boolean`)?String(i.value):n.slice(i.start,i.end),start:s.start,end:s.end,syntax:r}},AR=(e,t,n)=>{if(t?.type!==`JSXElement`&&t?.type!==`JSXFragment`)return{previous:null,next:null};let r=wR(t.children).filter(e=>e.type!==`JSXText`||n.slice(e.start,e.end).trim()!==``),i=r.findIndex(t=>t.start===e.start),a=e=>e?.type===`JSXElement`?{start:e.start,end:e.end}:null;return{previous:a(r[i-1]),next:a(r[i+1])}},jR=(e,t,n)=>{if(t!==n.fileName)return null;let r=ER(e);if(r===null)return null;let i=zl(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 TR(r,(t,n)=>{if(t.type!==`JSXElement`||t.start!==o||!CR(t.openingElement))return;let r=t.openingElement,i=[];for(let t of wR(r.attributes))if(t.type===`JSXAttribute`&&CR(t.name)&&typeof t.name.name==`string`&&CR(t.value)){let n=t.value,r=n.type===`JSXExpressionContainer`&&CR(n.expression)?n.expression:null;if(t.name.name===`style`&&r?.type===`ObjectExpression`&&!wR(r.properties).some(e=>e.type===`SpreadElement`))for(let t of wR(r.properties)){if(t.type!==`ObjectProperty`||t.computed===!0||!CR(t.key)||!CR(t.value))continue;let n=t.key.type===`Identifier`?t.key.name:t.key.value;typeof n==`string`&&i.push(kR(`style.${n}`,t.value,e,`value`))}else i.push(kR(t.name.name,n,e,`attribute`))}let a=wR(t.children).filter(t=>t.type!==`JSXText`||e.slice(t.start,t.end).trim()!==``);if(a.length===1&&a[0]!==void 0&&a[0].type!==`JSXElement`&&a[0].type!==`JSXFragment`)i.unshift(kR(`children`,a[0],e,`child`));else if(a.length>1){let t=a.flatMap((t,n)=>t.type===`JSXText`?[kR(`text.${n}`,t,e,`child`)]:[]);i.unshift(...t)}s={start:t.start,end:t.end,contentStart:r.selfClosing===!0?null:r.end,contentEnd:CR(t.closingElement)?t.closingElement.start:null,tag:CR(r.name)?e.slice(r.name.start,r.name.end):`element`,properties:i,attributeInsertion:(()=>{let e=wR(r.attributes).at(-1);return e===void 0?CR(r.name)?r.name.end:r.end-1:e.end})(),hasSpread:wR(r.attributes).some(e=>e.type===`JSXSpreadAttribute`),structural:n?.type===`JSXElement`||n?.type===`JSXFragment`,...AR(t,n,e)}}),s},MR=(e,t,n,r={})=>{if(t!==n.fileName)return null;let i=SR(e,t);if(i.diagnostics.some(e=>e.severity===`error`))return null;let a=i.sourceNodes.filter(e=>e.src[0]===n.lineNumber&&e.src[1]===n.columnNumber&&e.kind!==`text`),o=r.tag===void 0?a.find(e=>e.properties.length>0)??a[0]:a.find(e=>e.tag===r.tag);return o===void 0?null:{start:o.start,end:o.end,contentStart:o.contentStart,contentEnd:o.contentEnd,tag:o.tag,attributeInsertion:o.contentStart??o.end,hasSpread:!1,structural:!1,previous:null,next:null,properties:o.properties.map(e=>({...e,value:String(e.value),kind:`literal`,syntax:e.syntax===`quoted`?`markdown-attribute`:e.syntax===`boolean`?`markdown-boolean`:`markdown`}))}},NR=/^[^\s{}<>&](?:[^{}<>&\r\n\u2028\u2029]*[^\s{}<>&])?$/,PR=(e,t,n)=>{let r=n.replace(/[\\`*_[\]<{]/g,`\\$&`).replace(/&(?=(?:[a-z][a-z\d]{1,31}|#\d{1,7}|#x[\da-f]{1,6});)/gi,`\\&`).replace(/[\r\n\t]|^ +| +$/g,e=>[...e].map(e=>`&#${e.charCodeAt(0)};`).join(``)),i=SR(e,`source.md`).sourceNodes.find(e=>e.kind===`block`&&e.properties.some(e=>e.name===`children`&&e.start===t.start&&e.end===t.end)),a=i===void 0?void 0:e.slice(i.start,t.start);a!==void 0&&/^ {0,3}$/.test(a)&&(r=r.replace(/^(?:#{1,6}(?=[ \t]|$)|>|[-+](?=[ \t]|$)|(?:-+|=+)(?=[ \t]*$)|~{3,})/,`\\$&`).replace(/^(\d{1,9})([.)])(?=[ \t]|$)/,`$1\\$2`));let o=e.slice(t.end).search(/[\r\n]/),s=e.slice(t.end,o<0?e.length:t.end+o);return a!==void 0&&/^ {0,3}#{1,6}[ \t]+$/.test(a)&&/^[ \t]*$/.test(s)&&(r=r.replace(/(^|[ \t])(#+)$/,`$1\\$2`)),r},FR=(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;if(t.syntax===`markdown`||t.syntax===`markdown-attribute`||t.syntax===`markdown-boolean`){let r=n.replaceAll(`&`,`&`).replaceAll(`"`,`"`).replaceAll(`<`,`<`).replaceAll(`{`,`{`).replaceAll(`}`,`}`).replace(/[\r\n\t]/g,e=>`&#${e.charCodeAt(0)};`),i=t.name===`children`?PR(e,t,n):n.replace(/[!-/:-@[-`{-~]/g,`\\$&`).replace(t.name===`href`||t.name===`src`?/\s/g:/[\r\n\t]|^ +| +$/g,e=>[...e].map(e=>`&#${e.charCodeAt(0)};`).join(``));return{start:t.start,end:t.end,before:e.slice(t.start,t.end),after:t.syntax===`markdown`?i:t.syntax===`markdown-boolean`?`${t.name}="${r}"`:`"${r}"`}}let r=t.literalType===`string`?JSON.stringify(n):t.literalType===`number`?String(Number(n)):n,i=e.slice(t.start,t.end),a=t.syntax===`child`&&!i.startsWith(`{`)&&NR.test(n);return{start:t.start,end:t.end,before:i,after:a?n:t.syntax===`child`||t.syntax===`attribute`&&t.literalType!==`string`?`{${r}}`:r}},IR=(e,t,n)=>({start:t.start,end:t.end,before:e.slice(t.start,t.end),after:t.syntax===`value`?n:`{${n}}`}),LR=(e,t,n)=>{let r=n.file??n.entry,i=e=>({...n.files,[r]:e}),a=EA(wA(i(e),{entry:n.entry}),wA(i(t),{entry:n.entry})),o=a[0];if(o===void 0)return null;let s=a.length>1?` (and ${a.length-1} more)`:``;return`This change leaves the static profile: ${o.message}${o.fix===void 0?``:` ${o.fix}`}${s}`},RR=(e,t,n={})=>{let r=[...t].sort((e,t)=>t.start-e.start),i=e.length,a=e;for(let t of r){if(t.start<0||t.end<t.start||t.end>i||e.slice(t.start,t.end)!==t.before)return{ok:!1,reason:`Source changed at this target. Select it again before applying the edit.`};a=a.slice(0,t.start)+t.after+a.slice(t.end),i=t.start}if(n.markdown!==void 0){let e=SR(a,n.markdown.file).diagnostics.find(e=>e.severity===`error`);return e===void 0?{ok:!0,source:a}:{ok:!1,reason:`This change is not valid SML Markdown: ${e.message}`}}if(ER(a)===null)return{ok:!1,reason:`This change is not valid TSX. Review it in Source.`};if(n.profile!==void 0&&a!==e){let t=LR(e,a,n.profile);if(t!==null)return{ok:!1,reason:t}}return{ok:!0,source:a}},zR=(e,t)=>{let n=Math.max(e.lastIndexOf(`
|
|
175
|
+
`,t-1),e.lastIndexOf(`\r`,t-1)),r=e.slice(n+1,t);return/^[ \t]*$/.test(r)?r:null},BR=(e,t)=>{if(zR(e,t.start)===null)return t;let n=/^[ \t]*(\r\n|\n|\r)/.exec(e.slice(t.end));return n===null?t:{start:t.start-(zR(e,t.start)??``).length,end:t.end+n[0].length}},VR=(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=e.slice(t.start,t.end);if(n.kind===`duplicate`){let n=zR(e,t.start);return[{start:t.end,end:t.end,before:``,after:n===null?r:`\n${n}${r}`}]}if(n.kind===`reorder`){let i=n.direction===`before`?t.previous:t.next;return i===null?null:[{start:i.start,end:i.end,before:e.slice(i.start,i.end),after:r},{start:t.start,end:t.end,before:r,after:e.slice(i.start,i.end)}]}let i=BR(e,t),a={start:i.start,end:i.end,before:e.slice(i.start,i.end),after:``};if(n.kind===`delete`)return[a];let o=n.destination.contentEnd;return o===null||o>=t.start&&o<=t.end?null:[a,{start:o,end:o,before:``,after:r}]},HR=(e,t)=>{let n=e.program;if(!CR(n))return null;for(let e of wR(n.body)){let n=e.type===`ExportNamedDeclaration`&&CR(e.declaration)?e.declaration:e;if(n.type===`VariableDeclaration`){for(let e of wR(n.declarations))if(CR(e.id)&&e.id.name===t&&CR(e.init)&&e.init.type===`ObjectExpression`)return e.init}}return null},UR=e=>{let t=ER(e);if(t===null)return[];let n=[];return TR(t,r=>{if(r.type!==`CallExpression`||!CR(r.callee)||r.callee.type!==`Identifier`||r.callee.name!==`defineTemplate`)return;let i=wR(r.arguments)[0];if(i?.type!==`ObjectExpression`)return;let a=wR(i.properties).find(e=>e.type===`ObjectProperty`&&CR(e.key)&&e.key.name===`fixtures`&&e.computed!==!0);if(a!==void 0&&CR(a.value)&&a.value.type===`ObjectExpression`)for(let r of wR(a.value.properties)){if(r.type!==`ObjectProperty`||r.computed===!0||!CR(r.key)||!CR(r.value))continue;let i=r.key.type===`Identifier`?r.key.name:r.key.value,a=r.value.type===`Identifier`&&typeof r.value.name==`string`?HR(t,r.value.name)??r.value:r.value;typeof i==`string`&&n.push({name:i,start:a.start,end:a.end,source:e.slice(a.start,a.end)})}}),n},WR=e=>e.split(/\s+/).filter(e=>e!==``),GR=(e,t,n)=>{let r=t.properties.find(e=>e.name===`className`),i=e=>{if(n.kind===`set`)return WR(n.value).join(` `);let t=WR(n.tokens);return n.kind===`add`?[...e,...t.filter(t=>!e.includes(t))].join(` `):e.filter(e=>!t.includes(e)).join(` `)};if(r===void 0){if(t.hasSpread)return{ok:!1,reason:`A spread attribute can supply className here, so a class list cannot be added safely. Edit it in Source.`};if(n.kind===`remove`)return{ok:!0,edits:[]};let e=i([]);return e===``?{ok:!0,edits:[]}:{ok:!0,edits:[{start:t.attributeInsertion,end:t.attributeInsertion,before:``,after:` className=${JSON.stringify(e)}`}]}}if(r.kind!==`literal`||r.literalType!==`string`)return{ok:!1,reason:`className is ${r.kind===`binding`?`bound to`:`computed from`} \`${r.value}\`, so editing it would discard that choice. Change the literal classes inside it in Source.`};let a=i(WR(r.value));return{ok:!0,edits:[{start:r.start,end:r.end,before:e.slice(r.start,r.end),after:JSON.stringify(a)}]}},KR=e=>Ns(e)&&typeof e.type==`string`&&typeof e.start==`number`&&typeof e.end==`number`,qR=e=>Array.isArray(e)?e.filter(KR):[],JR=(e,t)=>{let n=e[t];return KR(n)?n:null},YR=e=>{try{let t=_D(e,{sourceType:`module`,plugins:[`typescript`,`jsx`]});return KR(t)?t:null}catch{return null}},XR=(e,t)=>{if(Array.isArray(e)){for(let n of e)XR(n,t);return}if(KR(e)&&t(e)!==!1)for(let[n,r]of Object.entries(e))n!==`loc`&&n!==`extra`&&n!==`comments`&&XR(r,t)},ZR=e=>e===null?``:e.type===`JSXIdentifier`?typeof e.name==`string`?e.name:``:e.type===`JSXMemberExpression`?`${ZR(JR(e,`object`))}.${ZR(JR(e,`property`))}`:``,QR=e=>{if(e.type!==`JSXElement`)return null;let t=JR(e,`openingElement`);if(t===null)return null;let n=JR(e,`closingElement`);return{node:e,opening:t,closing:n,tag:ZR(JR(t,`name`)),children:qR(e.children),attributes:qR(t.attributes),selfClosing:t.selfClosing===!0,contentStart:t.end,contentEnd:n===null?t.end:n.start}},$R=e=>{let t=JR(e,`body`);if(t===null)return null;if(t.type===`JSXElement`)return t;if(t.type!==`BlockStatement`)return null;let n=qR(t.body).filter(e=>e.type!==`EmptyStatement`),r=n.length===1?n[0]:void 0,i=r?.type===`ReturnStatement`&&r!==void 0?JR(r,`argument`):null;return i!==null&&i.type===`JSXElement`?i:null},ez=e=>{if(e.computed===!0)return null;let t=JR(e,`key`);return t===null?null:t.type===`Identifier`?typeof t.name==`string`?t.name:null:t.type===`StringLiteral`&&typeof t.value==`string`?t.value:null},tz=(e,t)=>{let n=null;return XR(e,e=>{if(n!==null)return!1;if(e.type!==`CallExpression`)return;let r=JR(e,`callee`);if(r?.type!==`Identifier`||r.name!==`defineTemplate`)return;let i=qR(e.arguments)[0];if(i?.type!==`ObjectExpression`)return!1;for(let e of qR(i.properties)){if(ez(e)!==t)continue;let r=e.type===`ObjectMethod`?e:e.type===`ObjectProperty`?JR(e,`value`):null;if(r===null||r.type!==`ArrowFunctionExpression`&&r.type!==`FunctionExpression`&&r.type!==`ObjectMethod`)return!1;let i=$R(r),a=i===null?null:QR(i);return a!==null&&(n={root:a,parameter:qR(r.params)[0]??null}),!1}return!1}),n},nz=(e,t,n)=>{let r=n;return XR(e,e=>{if(e.type===`ImportDeclaration`){if(JR(e,`source`)?.value!==t)return!1;for(let t of qR(e.specifiers)){let e=JR(t,`imported`),i=JR(t,`local`);t.type===`ImportSpecifier`&&(e?.name===n||e?.value===n)&&(r=typeof i?.name==`string`?i.name:n)}return!1}}),r},rz=e=>{let t=e.split(/\r\n|\n|\r/),n=0;t.forEach((e,t)=>{/[^ \t]/.test(e)&&(n=t)});let r=``;return t.forEach((e,i)=>{let a=e.replace(/\t/g,` `);i!==0&&(a=a.replace(/^ +/,``)),i!==t.length-1&&(a=a.replace(/ +$/,``)),a!==``&&(r+=i===n?a:`${a} `)}),r},iz=e=>{let t=JR(e,`expression`);if(t===null)return null;if(t.type===`StringLiteral`&&typeof t.value==`string`)return t.value;if(t.type===`TemplateLiteral`&&qR(t.expressions).length===0){let e=qR(t.quasis)[0]?.value;return Ns(e)&&typeof e.cooked==`string`?e.cooked:null}return null},az=(e,t)=>{let n=e.slice(t.start,t.end).replace(/\s+/g,` `).trim();return n.length>60?`${n.slice(0,59)}…`:n},oz=(e,t)=>{let n=[],r=t.contentStart,i=``,a=e=>{n.push({kind:`text`,text:i,start:r,end:e}),i=``};for(let o of t.children){if(o.type===`JSXText`){i+=rz(typeof o.value==`string`?o.value:``);continue}if(o.type===`JSXExpressionContainer`){let e=iz(o);if(e!==null){i+=e;continue}}a(o.start),n.push({kind:`locked`,summary:az(e,o),start:o.start,end:o.end}),r=o.end}return a(t.contentEnd),n},sz=e=>!/[{}<>&\r\n\t]/.test(e),cz=(e,t,n)=>{let r=[...e],i=r.map(e=>!sz(e));if(t)for(let e=0;e<r.length&&/\s/.test(r[e]);e++)i[e]=!0;if(n)for(let e=r.length-1;e>=0&&/\s/.test(r[e]);e--)i[e]=!0;let a=``,o=``,s=!1,c=()=>{o!==``&&(a+=s?`{${JSON.stringify(o)}}`:o,o=``)};return r.forEach((e,t)=>{o!==``&&i[t]!==s&&c(),s=i[t],o+=e}),c(),a},lz=(e,t,n,r,i)=>{let a=n[r];if(a?.kind!==`text`)return{ok:!1,reason:`That part of the body is locked.`};if(a.text===i)return{ok:!0,edits:[]};if(t.selfClosing){let n=t.opening,r=n.end-2;for(;r>n.start&&/\s/.test(e[r-1]);)r--;return{ok:!0,edits:[{start:r,end:n.end,before:e.slice(r,n.end),after:`>${cz(i,!1,!1)}</${t.tag}>`}]}}let o=e.slice(a.start,a.end),s=/^\s*/.exec(o)?.[0]??``,c=/[\r\n]/.test(s)?s:``,l=o.slice(c.length),u=/\s*$/.exec(l)?.[0]??``,d=/[\r\n]/.test(u)?u:``,f=a.start+c.length,p=a.end-d.length;return{ok:!0,edits:[{start:f,end:p,before:e.slice(f,p),after:cz(i,c!==``,d!==``)}]}},uz=(e,t)=>e.attributes.find(e=>e.type===`JSXAttribute`&&ZR(JR(e,`name`))===t)??null,dz=(e,t,n)=>{let r=uz(t,n);if(r===null)return{kind:`absent`};let i=JR(r,`value`);if(i?.type===`StringLiteral`&&typeof i.value==`string`)return{kind:`literal`,value:i.value};if(i?.type===`JSXExpressionContainer`){let e=iz(i);if(e!==null)return{kind:`literal`,value:e}}return{kind:`expression`,source:az(e,i??r)}},fz=e=>/["&\\\r\n]/.test(e)?`{${JSON.stringify(e)}}`:`"${e}"`,pz=(e,t,n,r)=>({start:t,end:n,before:e.slice(t,n),after:r}),mz=(e,t,n,r)=>{let i=uz(t,n);if(i===null){if(r===void 0)return{ok:!0,edits:[]};let i=t.attributes.at(-1)?.end??JR(t.opening,`name`)?.end??t.opening.end;return{ok:!0,edits:[pz(e,i,i,` ${n}=${fz(r)}`)]}}if(dz(e,t,n).kind===`expression`)return{ok:!1,reason:`\`${n}\` reads the input. Edit it in Source.`};if(r===void 0){let n=i.start;for(;n>t.opening.start&&/\s/.test(e[n-1]);)n--;return{ok:!0,edits:[pz(e,n,i.end,``)]}}let a=JR(i,`value`);return{ok:!0,edits:a===null?[pz(e,i.end,i.end,`=${fz(r)}`)]:[pz(e,a.start,a.end,fz(r))]}},hz=` `,gz=(e,t)=>{let n=e.lastIndexOf(`
|
|
176
|
+
`,t-1)+1,r=e.slice(n,t);return/^[ \t]*$/.test(r)?r:null},_z=(e,t)=>{let n=gz(e,t.start),r=/^[ \t]*(\r?\n)/.exec(e.slice(t.end));return n===null||r===null?pz(e,t.start,t.end,``):pz(e,t.start-n.length,t.end+r[0].length,``)},vz=(e,t,n,r)=>{let i=gz(e,t.start);return n===`before`?pz(e,t.start,t.start,i===null?r:`${r}\n${i}`):pz(e,t.end,t.end,i===null?r:`\n${i}${r}`)},yz=(e,t,n)=>{let r=new Set,i=e=>{if(n?.type===`Identifier`&&typeof n.name==`string`){let t=RegExp(`\\b${n.name}((?:\\??\\.[A-Za-z_$][\\w$]*)+)`,`g`);for(let n of e.matchAll(t))r.add(n[1].replace(/\?/g,``).slice(1))}else if(n?.type===`ObjectPattern`)for(let t of qR(n.properties)){let n=JR(t,`key`);n?.type===`Identifier`&&typeof n.name==`string`&&RegExp(`\\b${n.name}\\b`).test(e)&&r.add(n.name)}};return XR(t.node,t=>{t.type===`JSXExpressionContainer`&&iz(t)===null&&i(e.slice(t.start,t.end))}),[...r].sort()},bz=e=>{let t=YR(e);if(t===null)return null;let n=tz(t,`sms`);return n===null||n.root.tag!==nz(t,`@samva/markup/sms`,`Sms`)?null:{...n,tree:t}},xz=e=>{let t=bz(e);if(t!==null)return{category:dz(e,t.root,`category`),segments:oz(e,t.root),variables:yz(e,t.root,t.parameter)}},Sz=(e,t)=>{let n=bz(e);return n===null?{ok:!1,reason:`The SMS body is not editable here.`}:t.kind===`category`?t.value!==void 0&&!RD.includes(t.value)?{ok:!1,reason:`\`${t.value}\` is not an SMS category.`}:mz(e,n.root,`category`,t.value):lz(e,n.root,oz(e,n.root),t.segment,t.text)},Cz={"quick-reply":`QuickReplyButton`,url:`UrlButton`,phone:`PhoneButton`,"copy-code":`CopyCodeButton`},wz={"quick-reply":`Reply`,url:`Visit site`,phone:`Call us`,"copy-code":`CODE`},Tz=(e,t)=>{if(!e.startsWith(`${t}.`))return null;let n=e.slice(t.length+1);return Object.keys(Cz).find(e=>Cz[e]===n)??null},Ez=e=>{let t=YR(e);if(t===null)return null;let n=tz(t,`whatsapp`),r=nz(t,`@samva/markup/whatsapp`,`WhatsApp`);if(n===null||n.root.tag!==r)return null;let i=e=>{for(let t of n.root.children){let n=QR(t);if(n?.tag===`${r}.${e}`)return n}return null};return{...n,local:r,header:i(`Header`),body:i(`Body`),footer:i(`Footer`),buttons:i(`Buttons`)}},Dz=(e,t)=>{if(t.buttons===null)return[];let n=[];for(let r of t.buttons.children){if(r.type===`JSXText`&&rz(String(r.value??``))===``)continue;let i=QR(r),a=i===null?null:Tz(i.tag,t.local);if(i===null||a===null){n.push({row:{kind:`locked`,summary:az(e,r)},node:r});continue}let o=oz(e,i),s=o[0];n.push({node:r,row:o.length===1&&s?.kind===`text`?{kind:`editable`,type:a,text:s.text,url:dz(e,i,`url`),phone:dz(e,i,`phone`)}:{kind:`locked`,summary:az(e,r)}})}return n},Oz=e=>{let t=Ez(e);if(t===null||t.body===null)return;let{root:n}=t;return{language:dz(e,n,`language`),category:dz(e,n,`category`),header:t.header===null?void 0:oz(e,t.header),headerType:t.header===null?{kind:`absent`}:dz(e,t.header,`type`),body:oz(e,t.body),footer:t.footer===null?void 0:oz(e,t.footer),buttons:Dz(e,t).map(({row:e})=>e),variables:yz(e,n,t.parameter)}},kz=(e,t,n,r)=>{let i=`${e}.${Cz[t]}`;return`<${i}${t===`url`&&r.url!==void 0?` url=${fz(r.url)}`:t===`phone`&&r.phone!==void 0?` phone=${fz(r.phone)}`:``}>${cz(n,!1,!1)}</${i}>`},Az=(e,t)=>kz(e,t,wz[t],{url:`https://example.com`,phone:`+15555550100`}),jz=(e,t,n,r,i)=>{let a=t[n];if(a===null){if(n===`body`||i===``||r!==0)return{ok:!0,edits:[]};let a=`${t.local}.${n===`header`?`Header`:`Footer`}`,o=`<${a}>${cz(i,!1,!1)}</${a}>`;return{ok:!0,edits:[vz(e,n===`header`?t.body.node:t.buttons?.node??t.body.node,n===`header`?`before`:`after`,o)]}}let o=oz(e,a);return n!==`body`&&i===``&&o.length===1?{ok:!0,edits:[_z(e,a.node)]}:lz(e,a,o,r,i)},Mz=(e,t)=>{let n=Ez(e);if(n===null||n.body===null)return{ok:!1,reason:`The WhatsApp body is not editable here.`};let{root:r,local:i}=n;switch(t.kind){case`attribute`:return t.name===`category`&&!zD.includes(t.value)?{ok:!1,reason:`Choose a WhatsApp category.`}:mz(e,r,t.name,t.value);case`headerType`:return n.header===null?{ok:!1,reason:`Add the header text before choosing its type.`}:BD.includes(t.value)?mz(e,n.header,`type`,t.value===`text`?void 0:t.value):{ok:!1,reason:`\`${t.value}\` is not a header type.`};case`text`:return jz(e,n,t.part,t.segment,t.text);case`buttonAdd`:{let r=Az(i,t.type),a=n.buttons;if(a===null){let t=n.footer??n.body,a=`${i}.Buttons`,o=gz(e,t.node.start),s=o===null?`<${a}>${r}</${a}>`:`<${a}>\n${o}${hz}${r}\n${o}</${a}>`;return{ok:!0,edits:[vz(e,t.node,`after`,s)]}}if(a.selfClosing){let t=`${i}.Buttons`,n=gz(e,a.node.start),o=n===null?`<${t}>${r}</${t}>`:`<${t}>\n${n}${hz}${r}\n${n}</${t}>`;return{ok:!0,edits:[pz(e,a.node.start,a.node.end,o)]}}let o=a.children.findLast(e=>e.type!==`JSXText`||rz(String(e.value??``))!==``);if(o!==void 0)return{ok:!0,edits:[vz(e,o,`after`,r)]};let s=gz(e,a.node.start);return{ok:!0,edits:[pz(e,a.contentStart,a.contentEnd,s===null?r:`\n${s}${hz}${r}\n${s}`)]}}}let a=Dz(e,n),o=a[t.button];if(o===void 0||n.buttons===null)return{ok:!1,reason:`That button no longer exists.`};if(t.kind===`buttonRemove`)return{ok:!0,edits:[_z(e,a.length===1?n.buttons.node:o.node)]};let s=QR(o.node);if(o.row.kind===`locked`||s===null)return{ok:!1,reason:`That button is locked. Edit it in Source.`};switch(t.kind){case`buttonText`:return lz(e,s,oz(e,s),0,t.text);case`buttonAttribute`:return mz(e,s,t.name,t.value);default:{let{row:n}=o,r=e=>e.kind===`literal`?e.value:void 0,a=kz(i,t.type,n.text,{url:r(n.url)??`https://example.com`,phone:r(n.phone)??`+15555550100`});return{ok:!0,edits:[pz(e,o.node.start,o.node.end,a)]}}}},Nz=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})),Pz=o(((e,t)=>{t.exports=Nz()})),Fz={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Iz={...Fz,position:`fixed`,top:0,left:0},Zee={...Fz,position:`absolute`},Lz={};function Rz(e,t){let n=G.useRef(Lz);return n.current===Lz&&(n.current=e(t)),n}function zz(e,t,n,r){let i=Rz(Bz).current;return $ee(i,e,t,n,r)&&Vz(i,[e,t,n,r]),i.callback}function Qee(e){let t=Rz(Bz).current;return ete(t,e)&&Vz(t,e),t.callback}function Bz(){return{callback:null,cleanup:null,refs:[]}}function $ee(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function ete(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Vz(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 tte(e){let t=G.useRef(!0);t.current&&(t.current=!1,e())}function nte(e){let[t,n]=G.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function Hz(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function Uz({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=G.useRef(e!==void 0),[a,o]=G.useState(t);return[i&&e!==void 0?e:a,G.useCallback(e=>{i||o(e)},[])]}var Y=typeof document<`u`?G.useLayoutEffect:()=>{},Wz={...G},Gz=Wz.useInsertionEffect,rte=Gz&&Gz!==Wz.useLayoutEffect?Gz:e=>e();function X(e){let t=Rz(ite).current;return t.next=e,rte(t.effect),t.trampoline}function ite(){let e={next:void 0,callback:ate,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function ate(){}function Kz(e){let t=Rz(ote,e).current;return t.next=e,Y(t.effect),t}function ote(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function ste(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 qz=ste(`https://base-ui.com/production-error`,`Base UI`),cte=o((e=>{var t=d();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 u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Jz=o(((e,t)=>{t.exports=cte()})),lte=o((e=>{var t=d(),n=Jz();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}})),ute=o(((e,t)=>{t.exports=lte()})),dte=19;function Yz(e){return dte>=e}var Xz=[],Zz=void 0;function fte(){return Zz}function pte(e){Xz.push(e)}function Qz(e){let t=(t,n)=>{let r=Rz(mte).current,i;try{Zz=r;for(let e of Xz)e.before(r);i=e(t,n);for(let e of Xz)e.after(r);r.didInitialize=!0}finally{Zz=void 0}return i};return t.displayName=e.displayName||e.name,t}function $z(e){return G.forwardRef(Qz(e))}function mte(){return{didInitialize:!1}}var eB=Jz(),hte=ute(),gte=Yz(19)?rB:iB;function tB(e,t,n,r,i){return gte(e,t,n,r,i)}function nB(e,t,n,r,i){let a=G.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,eB.useSyncExternalStore)(e.subscribe,a,a)}pte({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,eB.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function rB(e,t,n,r,i){let a=fte();if(!a)return nB(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 iB(e,t,n,r,i){return(0,hte.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var aB=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 tB(this,e,t,n,r)}};function oB(){}var sB=Object.freeze([]),cB=Object.freeze({}),lB=class extends aB{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){G.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){G.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 G.useDebugValue(e),tB(this,this.selectors[e],t,n,r)}useContextCallback(e,t){G.useDebugValue(e);let n=X(t??oB);this.context[e]=n}useStateSetter(e){let t=G.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)}})}};function uB(){return typeof window<`u`}function dB(e){return mB(e)?(e.nodeName||``).toLowerCase():`#document`}function fB(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pB(e){return((mB(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function mB(e){return uB()?e instanceof Node||e instanceof fB(e).Node:!1}function hB(e){return uB()?e instanceof Element||e instanceof fB(e).Element:!1}function gB(e){return uB()?e instanceof HTMLElement||e instanceof fB(e).HTMLElement:!1}function _B(e){return!uB()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof fB(e).ShadowRoot}function vB(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=kB(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function yB(e){return/^(table|td|th)$/.test(dB(e))}function bB(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var xB=/transform|translate|scale|rotate|perspective|filter/,SB=/paint|layout|strict|content/,CB=e=>!!e&&e!==`none`,wB;function TB(e){let t=hB(e)?kB(e):e;return CB(t.transform)||CB(t.translate)||CB(t.scale)||CB(t.rotate)||CB(t.perspective)||!DB()&&(CB(t.backdropFilter)||CB(t.filter))||xB.test(t.willChange||``)||SB.test(t.contain||``)}function EB(e){let t=jB(e);for(;gB(t)&&!OB(t);){if(TB(t))return t;if(bB(t))return null;t=jB(t)}return null}function DB(){return wB??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),wB}function OB(e){return/^(html|body|#document)$/.test(dB(e))}function kB(e){return fB(e).getComputedStyle(e)}function AB(e){return hB(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jB(e){if(dB(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||_B(e)&&e.host||pB(e);return _B(t)?t.host:t}function MB(e){let t=jB(e);return OB(t)?(e.ownerDocument||e).body:gB(t)&&vB(t)?t:MB(t)}function NB(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=MB(e),i=r===e.ownerDocument?.body,a=fB(r);if(i){let e=PB(a);return t.concat(a,a.visualViewport||[],vB(r)?r:[],e&&n?NB(e):[])}return t.concat(r,NB(r,[],n))}function PB(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function FB(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function IB(e){return e?.ownerDocument||document}function LB(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function RB(e){G.useEffect(e,sB)}var zB=null;globalThis.requestAnimationFrame;var BB=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)}},VB=class e{static create(){return new e}static request(e){return BB.request(e)}static cancel(e){return BB.cancel(e)}currentId=zB;request(e){this.cancel(),this.currentId=BB.request(()=>{this.currentId=zB,e()})}cancel=()=>{this.currentId!==zB&&(BB.cancel(this.currentId),this.currentId=zB)};disposeEffect=()=>this.cancel};function HB(){let e=Rz(VB.create).current;return RB(e.disposeEffect),e}var UB=0,WB=class e{static create(){return new e}currentId=UB;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=UB,t()},e)}isStarted(){return this.currentId!==UB}clear=()=>{this.currentId!==UB&&(clearTimeout(this.currentId),this.currentId=UB)};disposeEffect=()=>this.clear};function GB(){let e=Rz(WB.create).current;return RB(e.disposeEffect),e}function KB(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:qB,platform:JB,maxTouchPoints:YB}=KB(),XB=qB.toLowerCase(),ZB=JB.toLowerCase(),QB=/^i(os$|p)/.test(ZB)||ZB===`macintel`&&YB>1,$B=`android`,eV=ZB===$B||XB.includes($B),tV=!QB&&ZB.startsWith(`mac`);ZB.startsWith(`win`),!eV&&/^(linux|chrome os)/.test(ZB);var nV=tV||QB,rV=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!rV&&XB.includes(`firefox`),!rV&&XB.includes(`chrom`);var iV=nV,aV=/jsdom|happydom/.test(XB);function oV(e){e.preventDefault(),e.stopPropagation()}function sV(e){return`nativeEvent`in e}function cV(e){return e.pointerType===``&&e.isTrusted?!0:eV&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function lV(e){return aV?!1:!eV&&e.width===0&&e.height===0||eV&&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 uV(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function dV(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function fV(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function pV(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&_B(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function mV(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var hV=`data-base-ui-focusable`,gV=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,_V=`ArrowLeft`,vV=`ArrowRight`,yV=`ArrowUp`,bV=`ArrowDown`,xV=`data-starting-style`,SV=`data-ending-style`,CV={[xV]:``},wV={[SV]:``},TV={transitionStatus(e){return e===`starting`?CV:e===`ending`?wV:null}},EV=`data-open`,DV=`data-closed`,OV=`data-anchor-hidden`,kV=`data-popup-open`,AV=`data-pressed`,jV={[kV]:``},MV={[kV]:``,[AV]:``},NV={[EV]:``},PV={[DV]:``},FV={[OV]:``},IV={open(e){return e?jV:null}},LV={open(e){return e?MV:null}},RV={open(e){return e?NV:PV},anchorHidden(e){return e?FV:null}},zV={...RV,...TV},BV=`data-trigger-disabled`;function VV(e,t){if(!hB(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(BV);for(let[,e]of t.entries())if(pV(e,n))return!e.hasAttribute(BV);return!1}function HV(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 UV(e){return e.matches(`html,body`)}function WV(e){return gB(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function GV(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${gV}`)!=null}function KV(e){return e?e.getAttribute(`role`)===`combobox`&&WV(e):!1}function qV(e){if(!e||aV)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function JV(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function YV(e,t){return t!=null&&!uV(t)?0:typeof e==`function`?e():e}function XV(e,t,n){let r=YV(e,n);return typeof r==`number`?r:r?.[t]}function ZV(e){return typeof e==`function`?e():e}function QV(e,t){return t||e===`click`||e===`mousedown`}function $V(e){return e?.includes(`mouse`)&&e!==`mousedown`}var eH=`none`,tH=`trigger-press`,nH=`trigger-hover`,rH=`trigger-focus`,iH=`outside-press`,aH=`item-press`,oH=`close-press`,sH=`focus-out`,cH=`escape-key`,lH=`close-watcher`,uH=`list-navigation`,dH=`cancel-open`,fH=`sibling-open`,pH=`disabled`,mH=`missing`,hH=`initial`,gH=`imperative-action`,_H=`swipe`,vH=`window-resize`;function yH(e,t,n,r){let i=!1,a=!1,o=r??cB;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=Pz(),bH=G.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new WB,currentIdRef:{current:null},currentContextRef:{current:null}});function xH(e,t){e.current=t.current}function SH(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}=G.useContext(bH),[f,p]=G.useState(!1),m=G.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:XV(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,yH(eH))):(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,xH(o,c),d.clear()}},[l,a,o,i,c,d]),G.useMemo(()=>({activeIdRef:a,hasProvider:u,delayRef:o,isInstantPhase:f}),[a,u,o,f])}var CH=G.forwardRef(function(e,t){let[n,r]=G.useState();Y(()=>{iV&&rV&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,Z.jsx)(`span`,{...e,ref:t,style:Iz,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),wH=Math.min,TH=Math.max,EH=Math.round,DH=Math.floor,OH=e=>({x:e,y:e}),kH={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function AH(e,t,n){return TH(e,wH(t,n))}function jH(e,t){return typeof e==`function`?e(t):e}function MH(e){return e.split(`-`)[0]}function NH(e){return e.split(`-`)[1]}function PH(e){return e===`x`?`y`:`x`}function FH(e){return e===`y`?`height`:`width`}function IH(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function LH(e){return PH(IH(e))}function RH(e,t,n){n===void 0&&(n=!1);let r=NH(e),i=LH(e),a=FH(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=qH(o)),[o,qH(o)]}function zH(e){let t=qH(e);return[BH(e),t,BH(t)]}function BH(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var VH=[`left`,`right`],HH=[`right`,`left`],UH=[`top`,`bottom`],WH=[`bottom`,`top`];function GH(e,t,n){switch(e){case`top`:case`bottom`:return n?t?HH:VH:t?VH:HH;case`left`:case`right`:return t?UH:WH;default:return[]}}function KH(e,t,n,r){let i=NH(e),a=GH(MH(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(BH)))),a}function qH(e){let t=MH(e);return kH[t]+e.slice(t.length)}function JH(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function YH(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:JH(e)}function XH(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 ZH(e,t){return t<0||t>=e.length}function QH(e,t){return eU(e.current,{disabledIndices:t})}function $H(e,t){return eU(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function eU(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&&tU(e,a,r));return a}function tU(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!rU(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function nU(e){return e.visibility===`hidden`||e.visibility===`collapse`}function rU(e,t=e?kB(e):null){return!e||!e.isConnected||!t||nU(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var iU=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function aU(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return _B(n)?n.host:null}function oU(e){for(let t of Array.from(e.children))if(dB(t)===`summary`)return t;return null}function sU(e,t){let n=oU(t);return!!n&&(e===n||pV(n,e))}function cU(e){let t=e?dB(e):``;return e!=null&&e.matches(iU)&&(t!==`summary`||e.parentElement!=null&&dB(e.parentElement)===`details`&&oU(e.parentElement)===e)&&(t!==`details`||oU(e)==null)&&(t!==`input`||e.type!==`hidden`)}function lU(e){if(!cU(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=aU(t)){let n=t!==e,r=dB(t)===`slot`;if(t.hasAttribute(`inert`)||n&&dB(t)===`details`&&!t.open&&!sU(e,t)||t.hasAttribute(`hidden`)||!r&&!uU(t,n))return!1}return!0}function uU(e,t){let n=kB(e);return t?n.display!==`none`:rU(e,n)}function dU(e){let t=e.tabIndex;if(t<0){let t=dB(e);if(t===`details`||t===`audio`||t===`video`||gB(e)&&e.isContentEditable)return 0}return t}function fU(e){if(dB(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function pU(e,t){let n=fU(e);if(!n)return!0;let r=t.find(e=>{let t=fU(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=fU(e);return t?.name===n.name&&t.form===n.form})===n}function mU(e){if(gB(e)&&dB(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return gB(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function hU(e,t){mU(e).forEach(e=>{cU(e)&&t.push(e),hU(e,t)})}function gU(e,t,n){mU(e).forEach(e=>{gB(e)&&e.matches(t)&&n.push(e),gU(e,t,n)})}function _U(e){return lU(e)&&dU(e)>=0}function vU(e){let t=[];return hU(e,t),t.filter(lU)}function yU(e){let t=vU(e);return t.filter(e=>dU(e)>=0&&pU(e,t))}function bU(e,t){let n=yU(e),r=n.length;if(r===0)return;let i=fV(IB(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function xU(e){return bU(IB(e).body,1)||e}function SU(e){return bU(IB(e).body,-1)||e}function CU(e,t){if(!e)return null;let n=yU(IB(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 wU(e){return CU(e,1)}function TU(e){return CU(e,-1)}function EU(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!pV(n,r)}function DU(e){yU(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function OU(e){let t=[];gU(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 kU(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...kU(e,t.id,n)])}function AU(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 jU(e){return`data-base-ui-${e}`}var MU=0;function NU(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(MU);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),oB;let o=requestAnimationFrame(a);return MU=o,()=>{MU===o&&(cancelAnimationFrame(o),MU=0)}}var PU={inert:new WeakMap,"aria-hidden":new WeakMap},FU=`data-base-ui-inert`,IU={inert:new WeakSet,"aria-hidden":new WeakSet},LU=new WeakMap,RU=0;function zU(e){return IU[e]}function BU(e){return e?_B(e)?e.host:BU(e.parentNode):null}var VU=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=BU(t);return e.contains(n)?n:null}).filter(e=>e!=null),HU=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},UU=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{dB(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function WU(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=VU(t,e),l=i?UU(t,HU(c),new Set(c)):[],u=[],d=[];if(a){let e=PU[a],n=zU(a);s=n,o=e;let r=VU(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);UU(t,HU(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=(LU.get(e)||0)+1;LU.set(e,t),d.push(e),t===1&&e.setAttribute(FU,``)}),RU+=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=(LU.get(e)||0)-1;LU.set(e,t),t||e.removeAttribute(FU)}),--RU,RU||(PU.inert=new WeakMap,PU[`aria-hidden`]=new WeakMap,IU.inert=new WeakSet,IU[`aria-hidden`]=new WeakSet,LU=new WeakMap)}}function GU(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=IB(e[0]).body;return WU(e,a,n,r,{mark:i})}var KU=0;function qU(e,t=`mui`){let[n,r]=G.useState(e),i=e||n;return G.useEffect(()=>{n??(KU+=1,r(`${t}-${KU}`))},[n,t]),i}var JU=Wz.useId;function YU(e,t){if(JU!==void 0){let n=JU();return e??(t?`${t}-${n}`:n)}return qU(e,t)}function XU(e){if(!G.isValidElement(e))return null;let t=e,n=t.props;return(Yz(19)?n?.ref:t.ref)??null}function ZU(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function QU(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 $U(e,t){return typeof e==`function`?e(t):e}function eW(e,t){return typeof e==`function`?e(t):e}var tW={};function nW(e,t,n,r,i){if(!n&&!r&&!i&&!e)return iW(t);let a=iW(e);return t&&(a=aW(a,t)),n&&(a=aW(a,n)),r&&(a=aW(a,r)),i&&(a=aW(a,i)),a}function rW(e){if(e.length===0)return tW;if(e.length===1)return iW(e[0]);let t=iW(e[0]);for(let n=1;n<e.length;n+=1)t=aW(t,e[n]);return t}function iW(e){return lW(e)?{...uW(e,tW)}:oW(e)}function aW(e,t){return lW(t)?uW(t,e):sW(e,t)}function oW(e){let t={...e};for(let e in t){let n=t[e];cW(e,n)&&(t[e]=fW(n))}return t}function sW(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=ZU(e.style,r);break;case`className`:e[n]=mW(e.className,r);break;default:e[n]=cW(n,r)?dW(e[n],r):r}}return e}function cW(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 lW(e){return typeof e==`function`}function uW(e,t){return lW(e)?e(t):e??tW}function dW(e,t){return t?e?(...n)=>{let r=n[0];if(hW(r)){let i=r;pW(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:fW(t):e}function fW(e){return e&&((...t)=>{let n=t[0];return hW(n)&&pW(n),e(...t)})}function pW(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function mW(e,t){return t?e?t+` `+e:t:e}function hW(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function gW(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=bW(r));let i=_W(t,n,r);if(n.enabled===!1)return null;let a=n.state??cB;return xW(e,r,i,a)}function _W(e,t,n){let{className:r,style:i}=e,{state:a=cB,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?$U(r,a):void 0,d=l?eW(i,a):void 0,f=l?QU(a,c):cB,p=l&&s?vW(s):void 0,m=l?ZU(f,p)??{}:cB;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?Qee([m.ref,XU(n),...o]):zz(m.ref,XU(n),o):zz(null,null)),l?(u!==void 0&&(m.className=mW(m.className,u)),d!==void 0&&(m.style=ZU(m.style,d)),m):cB}function vW(e){return Array.isArray(e)?rW(e):nW(void 0,e)}var yW=Symbol.for(`react.lazy`);function bW(e){if(e?.$$typeof!==yW)return e;let t=G.Children.toArray(e)[0];return G.isValidElement(t)?t:e}function xW(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=nW(n,t.props);return e.ref=n.ref,G.cloneElement(t,e)}if(e&&typeof e==`string`)return SW(e,n);throw Error(qz(8))}function SW(e,t){return e===`button`?(0,G.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,G.createElement)(`img`,{alt:``,...t,key:t.key}):G.createElement(e,t)}var CW={style:{transition:`none`}},wW=`data-base-ui-click-trigger`,TW=`data-base-ui-swipe-ignore`,EW=`data-swipe-ignore`,DW=`[${TW}]`;`${EW}`;var OW={fallbackAxisSide:`none`},kW={fallbackAxisSide:`end`},AW={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},jW=l(h(),1),MW=G.createContext(null),NW=()=>G.useContext(MW),PW=jU(`portal`);function FW(e={}){let{ref:t,container:n,componentProps:r=cB,elementProps:i}=e,a=YU(),o=NW()?.portalNode,[s,c]=G.useState(null),[l,u]=G.useState(null),d=X(e=>{e!==null&&u(e)}),f=G.useRef(null);Y(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(mB(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=gW(`div`,r,{ref:[t,d],props:[{id:a,[PW]:``},i]}),m=s&&p?jW.createPortal(p,s):null;return{node:l,nodeId:G.isValidElement(p)?p.props.id:void 0,subtree:m}}var IW=G.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}=FW({container:o,ref:t,componentProps:e,elementProps:c}),f=G.useRef(null),p=G.useRef(null),m=G.useRef(null),h=G.useRef(null),[g,_]=G.useState(null),v=G.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;G.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&EU(e)&&(e.type===`focusin`?v.current&&=(OU(l),!1):(DU(l),v.current=!0))}return FB(LB(l,`focusin`,e,!0),LB(l,`focusout`,e,!0))},[l,y]),Y(()=>{l&&b===!0&&v.current&&(OU(l),v.current=!1)},[b,l]);let S=G.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,Z.jsxs)(G.Fragment,{children:[d,(0,Z.jsxs)(MW.Provider,{value:S,children:[x&&l&&(0,Z.jsx)(CH,{"data-type":`outside`,ref:f,onFocus:e=>{EU(e,l)?m.current?.focus():SU(g?g.domReference:null)?.focus()}}),x&&l&&(0,Z.jsx)(`span`,{role:s,"aria-owns":u,style:AW}),l&&jW.createPortal(a,l),x&&l&&(0,Z.jsx)(CH,{"data-type":`outside`,ref:p,onFocus:e=>{EU(e,l)?h.current?.focus():(xU(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,yH(`focus-out`,e.nativeEvent)))}})]})]})});function LW(){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 RW=class{nodesRef={current:[]};events=LW();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)}},zW=G.createContext(null),BW=G.createContext(null),VW=()=>G.useContext(zW)?.id||null,HW=e=>{let t=G.useContext(BW);return e??t};function UW(e){let t=YU(),n=HW(e),r=VW();return Y(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function WW(e){let{children:t,id:n}=e,r=VW();return(0,Z.jsx)(zW.Provider,{value:G.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function GW(e){let{children:t,externalTree:n}=e,r=Rz(()=>n??new RW).current;return(0,Z.jsx)(BW.Provider,{value:r,children:t})}function KW(e){return e==null?e:`current`in e?e.current:e}function qW(e,t){let n=fB(mV(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 JW=20,YW=[];function XW(){YW=YW.filter(e=>e.deref()?.isConnected)}function ZW(e){XW(),e&&dB(e)!==`body`&&(YW.push(new WeakRef(e)),YW.length>JW&&(YW=YW.slice(-20)))}function QW(){return XW(),YW[YW.length-1]?.deref()}function $W(e){return e?_U(e)?e:yU(e)[0]||e:null}function eG(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=vU(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return _U(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 tG(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=X(()=>b.current.floatingContext?.nodeId),S=i===!1,C=KV(_)&&S,w=Kz(i),T=Kz(a),E=Kz(l),D=Kz(g),O=HW(p),k=NW(),A=G.useRef(!1),j=G.useRef(!1),M=G.useRef(!1),N=G.useRef(null),P=G.useRef(``),F=G.useRef(``),I=G.useRef(null),L=G.useRef(null),R=zz(I,f,k?.beforeInsideRef),z=zz(L,k?.afterInsideRef),ee=GB(),B=GB(),V=HB(),te=k!=null,H=JV(v),ne=X((e=H)=>e?yU(e):[]),re=X(()=>m?.().filter(e=>e!=null)??[]);G.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&pV(H,fV(IB(H)))&&ne().length===0&&!C&&oV(e)}return LB(IB(H),`keydown`,e)},[r,H,s,C,ne]),G.useEffect(()=>{if(r||!g)return;let e=IB(H);function t(){M.current=!1}function n(e){let t=mV(e),n=re(),r=pV(v,t)||pV(_,t)||pV(k?.portalNode,t)||n.some(e=>e===t||pV(e,t));M.current=!r,F.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(j.current=!0,B.start(0,()=>{j.current=!1}))}function i(){F.current=`keyboard`}return FB(LB(e,`pointerdown`,n,!0),LB(e,`pointerup`,t,!0),LB(e,`pointercancel`,t,!0),LB(e,`keydown`,i,!0),t)},[r,v,_,H,g,k,B,re]),G.useEffect(()=>{if(r||!c)return;let e=IB(H);function t(){j.current=!0,B.start(0,()=>{j.current=!1})}function n(e){let t=mV(e);_U(t)&&(N.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=mV(t);s&&n==null&&i!=null&&pV(v,i)&&ZW(i),queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=re(),f=n?.hasAttribute(jU(`focus-guard`))&&[I.current,L.current,k?.beforeInsideRef.current,k?.afterInsideRef.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,KW(d),KW(u)].includes(n),p=!(pV(_,n)||pV(v,n)||pV(n,v)||pV(k?.portalNode,n)||l.some(e=>e===n||pV(e,n))||c.hasMatchingElement(e=>pV(e,n))||f||O&&(kU(O.nodesRef.current,a).find(e=>pV(e.context?.elements.floating,n)||pV(e.context?.elements.domReference,n))||AU(O.nodesRef.current,a).find(e=>[e.context?.elements.floating,JV(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&H&&eG(H),o&&r!==_&&!rU(i)&&fV(e)===e.body){if(gB(H)&&(H.focus(),o===`popup`)){V.request(()=>{H.focus()});return}let e=ne(),t=N.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||H;gB(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!s)&&n&&p&&!j.current&&(C||n!==QW())&&(A.current=!0,h.setOpen(!1,yH(sH,t)))})}function a(){M.current||(b.current.insideReactTree=!0,ee.start(0,()=>{b.current.insideReactTree=!1}))}let l=gB(_)?_:null;if(v||l)return FB(l&&LB(l,`focusout`,i),l&&LB(l,`pointerdown`,t),v&&LB(v,`focusin`,n),v&&LB(v,`focusout`,i),v&&k&&LB(v,`focusout`,a,!0))},[r,_,v,H,s,O,k,h,c,o,ne,C,x,b,ee,B,V,u,d,re]),G.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(k?.portalNode?.querySelectorAll(`[${jU(`portal`)}]`)||[]),t=(O?AU(O.nodesRef.current,x()):[]).find(e=>KV(e.context?.elements.domReference||null))?.context?.elements.domReference,n=GU([v,...e,I.current,L.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,...re(),t,KW(d),KW(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),i=GU([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,k,C,O,x,u,d,re]),Y(()=>{if(!g||r||!gB(H))return;P.current=``,F.current=``;let e=IB(H),t=fV(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(E.current||``):n;if(r===void 0||r===!1||pV(H,t))return;let i=null,a=()=>(i??=ne(H),i[0]||H),o;o=r===!0||r===null?a():KW(r),o||=a();let s=pV(H,fV(e));NU(o,{preventScroll:o===H,shouldFocus(){if(!D.current)return!1;if(s)return!0;let t=fV(e);return!(t!==o&&pV(H,t))}})})},[r,g,H,ne,w,E,D]),Y(()=>{if(r||!H)return;let e=IB(H),t=fV(e),n=E.current==null;ZW(t);function i(e){if(e.open||(P.current=qW(e.nativeEvent,F.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(A.current=!0),e.reason===`outside-press`){if(e.nested)A.current=!1;else if(cV(e.nativeEvent)||lV(e.nativeEvent))A.current=!1;else{let e=!1;IB(H).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?A.current=!1:A.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.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&&dB(t)!==`body`?t:null,s=n?o||a:a||o;return s||=QW()||null,typeof i==`boolean`?s:KW(i)||s||null}return()=>{y.off(`openchange`,i);let t=fV(e),n=re(),r=pV(v,t)||n.some(e=>e===t||pV(e,t))||O&&kU(O.nodesRef.current,x(),!1).some(e=>pV(e.context?.elements.floating,t)),o=T.current,s=P.current,c=a(s);queueMicrotask(()=>{let n=$W(c),i=typeof o!=`boolean`;if(o&&!A.current&&gB(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}A.current=!1})}},[r,v,H,T,E,y,O,_,x,re]),Y(()=>{if(!rV||g||!v)return;let e=fV(IB(v));gB(e)&&WV(e)&&pV(v,e)&&e.blur()},[g,v]),Y(()=>{if(!r&&k)return k.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{k.setFocusManagerState(null)}},[r,k,s,g,h,c,_]),Y(()=>{if(!r&&H)return eG(H),()=>{queueMicrotask(XW)}},[r,H]);let ie=!r&&(!s||!C)&&(te||s);return(0,Z.jsxs)(G.Fragment,{children:[ie&&(0,Z.jsx)(CH,{"data-type":`inside`,ref:R,onFocus:e=>{if(s){let e=ne();NU(e[e.length-1])}else k?.portalNode&&(A.current=!1,EU(e,k.portalNode)?xU(_)?.focus():KW(d??k.beforeOutsideRef)?.focus())}}),n,ie&&(0,Z.jsx)(CH,{"data-type":`inside`,ref:z,onFocus:e=>{s?NU(ne()[0]):k?.portalNode&&(c&&(A.current=!0),EU(e,k.portalNode)?SU(_)?.focus():KW(u??k.afterOutsideRef)?.focus())}})]})}function nG(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=tH}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=G.useRef(void 0),f=HB(),p=GB(),m=G.useMemo(()=>{function e(e,t,n,r){let i=yH(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=uV(e.pointerType,!0)&&lV(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||uV(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=mV(o);if(WV(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}uV(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 G.useMemo(()=>n?{reference:m}:cB,[n,m])}function rG(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 iG(e){return e!=null&&e.clientX!=null}function aG(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=G.useRef(!1),u=G.useRef(null),[d,f]=G.useState(),[p,m]=G.useState([]),h=X(e=>{i.set(`positionReference`,e)}),g=X((e,t,n)=>{l.current||(!c.current.openEvent||iG(c.current.openEvent))&&i.set(`positionReference`,rG(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),_=X(e=>{a?u.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),v=uV(d)?o:a;G.useEffect(()=>{if(!n){h(s);return}if(!v)return;function e(){u.current?.(),u.current=null}let t=fB(o);function r(t){let n=mV(t);pV(o,n)?e():g(t.clientX,t.clientY)}return!c.current.openEvent||iG(c.current.openEvent)?u.current=LB(t,`mousemove`,r):h(s),e},[v,n,o,c,s,i,g,h,p]),G.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),G.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),G.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let y=G.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return G.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function oG(){return!1}function sG(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function cG(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=oG,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=HW(c),h=X(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=X(()=>a),{escapeKey:y,outsidePress:b}=sG(s),x=G.useRef(!1),S=G.useRef(!1),C=G.useRef(!1),w=G.useRef(!1),T=G.useRef(!1),E=G.useRef(``),D=G.useRef(null),O=GB(),k=GB(),A=X(()=>{k.clear(),f.current.insideReactTree=!1}),j=X(e=>{let t=f.current.floatingContext?.nodeId;return(m?kU(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),M=X(e=>HV(e,l.select(`floatingElement`))||HV(e,l.select(`domReferenceElement`))),N=X(e=>{o()&&l.setOpen(!1,yH(tH,e.nativeEvent))}),P=X(e=>{if(!u||!n||!r||e.key!==`Escape`||T.current||!y&&j(`__escapeKeyBubbles`))return;let t=yH(cH,sV(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),F=X(()=>{f.current.insideReactTree=!0,k.start(0,A)}),I=X(e=>{if(!u||!n||e.button!==0)return;let t=mV(e.nativeEvent);pV(l.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),L=X(e=>{u&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});G.useEffect(()=>{function e(e){e.open||(w.current=!1)}return p.on(`openchange`,e),()=>{p.off(`openchange`,e)}},[p]),G.useEffect(()=>{if(!u||!n)return u||(w.current=!1),A;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;let e=new WB,t=new WB,i=IB(d);function a(){e.clear(),T.current=!0}function o(){e.start(rV?5:0,()=>{T.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=E.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 k(e){let t=f.current.floatingContext?.nodeId,n=m&&kU(m.nodesRef.current,t).some(t=>HV(e,t.context?.elements.floating));return M(e)||n}function N(e){if(h(e)){e.type!==`click`&&!M(e)&&(t.clear(),C.current=!1),A();return}if(f.current.insideReactTree){A();return}let n=mV(e),r=`[${jU(`inert`)}]`,i=hB(n)?n.getRootNode():null,a=Array.from((_B(i)?i:IB(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>pV(e,n))))return;let s=hB(n)?n:null;for(;s&&!OB(s);){let e=jB(s);if(OB(e)||!hB(e))break;s=e}if(!(a.length&&hB(n)&&!UV(n)&&!pV(n,l.select(`floatingElement`))&&a.every(e=>!pV(s,e)))){if(gB(n)&&!(`touches`in e)){let t=OB(n),r=kB(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(!k(e)){if(p()===`intentional`){if(e.detail!==0&&!cV(e)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}(typeof g!=`function`||g(e))&&(j(`__outsidePressBubbles`)||(l.setOpen(!1,yH(iH,e)),A()))}}}function F(e){p()===`sloppy`&&e.pointerType!==`touch`&&l.select(`open`)&&n&&!M(e)&&N(e)}function I(e){if(p()!==`sloppy`||!l.select(`open`)||!n||M(e))return;let t=e.touches[0];t&&(D.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=mV(e);if(!n)return;let r=LB(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function z(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?F(e):N(e)})}function ee(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(!k(e)){if(n){s();return}(typeof g!=`function`||g(e))&&(t.clear(),C.current=!0,A())}}}function B(e){if(p()!==`sloppy`||!D.current||M(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(N(e),O.clear(),D.current=null)}function V(e){L(e,B)}function te(e){p()===`sloppy`&&D.current&&!M(e)&&(D.current.dismissOnTouchEnd&&N(e),O.clear(),D.current=null)}function H(e){L(e,te)}let ne=FB(r&&FB(LB(i,`keydown`,P),LB(i,`compositionstart`,a),LB(i,`compositionend`,o)),_&&FB(LB(i,`click`,z,!0),LB(i,`pointerdown`,z,!0),LB(i,`pointerup`,ee,!0),LB(i,`pointercancel`,ee,!0),LB(i,`mousedown`,z,!0),LB(i,`mouseup`,ee,!0),LB(i,`touchstart`,R,{capture:!0,passive:!0}),LB(i,`touchmove`,V,{capture:!0,passive:!0}),LB(i,`touchend`,H,{capture:!0,passive:!0})));return()=>{ne(),e.clear(),t.clear(),c(),C.current=!1,A()}},[f,d,r,_,g,u,n,y,b,P,A,v,j,M,m,l,O]);let R=G.useMemo(()=>({onKeyDown:P,onPointerDown:N,onClick:N}),[P,N]),z=G.useMemo(()=>({onKeyDown:P,onPointerDown:L,onMouseDown:L,onClickCapture:F,onMouseDownCapture(e){F(),I(e)},onPointerDownCapture(e){F(),I(e)},onMouseUpCapture:F,onTouchEndCapture:F,onTouchMoveCapture:F}),[P,F,I,L]);return G.useMemo(()=>n?{reference:R,floating:z,trigger:R}:{},[n,R,z])}function lG(e,t,n){let{reference:r,floating:i}=e,a=IH(t),o=LH(t),s=FH(o),c=MH(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=NH(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function uG(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}=jH(t,e),p=YH(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=XH(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=XH(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 dG=50,fG=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:uG},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=lG(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<dG&&(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}=lG(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},pG=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}=jH(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=MH(r),_=IH(o),v=MH(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[qH(o)]:zH(o)),x=p!==`none`;!d&&x&&b.push(...KH(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=RH(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`||_===IH(t)||T.every(e=>IH(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=IH(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{}}}},mG=new Set([`left`,`top`]);async function hG(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=MH(n),s=NH(n),c=IH(n)===`y`,l=mG.has(o)?-1:1,u=a&&c?-1:1,d=jH(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 gG=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 hG(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}}}}},_G=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}=jH(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=IH(i),p=PH(f),m=u[p],h=u[f],g=(e,t)=>AH(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}}}}}},vG=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}=jH(e,t),u={x:n,y:r},d=IH(i),f=PH(d),p=u[f],m=u[d],h=jH(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=mG.has(MH(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}}}},yG=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}=jH(e,t),c=await i.detectOverflow(t,s),l=MH(n),u=NH(n),d=IH(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=wH(p-c[m],g),y=wH(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*TH(c.left,c.right):S=p-2*TH(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 bG(e){let t=kB(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=gB(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=EH(n)!==a||EH(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function xG(e){return hB(e)?e:e.contextElement}function SG(e){let t=xG(e);if(!gB(t))return OH(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=bG(t),o=(a?EH(n.width):n.width)/r,s=(a?EH(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var CG=OH(0);function wG(e){let t=fB(e);return!DB()||!t.visualViewport?CG:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function TG(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===fB(e)}function EG(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=xG(e),o=OH(1);t&&(r?hB(r)&&(o=SG(r)):o=SG(e));let s=TG(a,n,r)?wG(a):OH(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=fB(a),t=hB(r)?fB(r):r,n=e,i=PB(n);for(;i&&t!==n;){let e=SG(i),t=i.getBoundingClientRect(),r=kB(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=fB(i),i=PB(n)}}return XH({width:u,height:d,x:c,y:l})}function DG(e,t){let n=AB(e).scrollLeft;return t?t.left+n:EG(pB(e)).left+n}function OG(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-DG(e,n),y:n.top+t.scrollTop}}function kG(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=pB(r),s=t?bB(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=OH(1),u=OH(0),d=gB(r);if((d||!a)&&((dB(r)!==`body`||vB(o))&&(c=AB(r)),d)){let e=EG(r);l=SG(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?OG(o,c):OH(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 AG(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function jG(e){let t=AB(e),n=e.ownerDocument.body,r=TH(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=TH(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+DG(e),o=-t.scrollTop;return kB(n).direction===`rtl`&&(a+=TH(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var MG=25;function NG(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=fB(e),a=pB(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!DB()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(DG(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<=MG&&(s-=o)}return{width:s,height:c,x:l,y:u}}function PG(e,t){let n=EG(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=SG(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function FG(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=NG(e,n,t);else if(t===`document`)r=jG(pB(e));else if(hB(t))r=PG(t,n);else{let n=wG(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return XH(r)}function IG(e,t){let n=t.get(e);if(n)return n;let r=NB(e,[],!1).filter(e=>hB(e)&&dB(e)!==`body`),i=null,a=kB(e).position===`fixed`,o=a?jB(e):e;for(;hB(o)&&!OB(o);){let e=kB(o),t=TB(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=jB(o)}return t.set(e,r),r}function LG(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?bB(t)?[]:IG(t,this._c):[].concat(n),r],o=FG(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=FG(t,a[e],i);s=TH(n.top,s),c=wH(n.right,c),l=wH(n.bottom,l),u=TH(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function RG(e){let{width:t,height:n}=bG(e);return{width:t,height:n}}function zG(e,t,n){let r=gB(t),i=pB(t),a=n===`fixed`,o=EG(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=OH(0);if((r||!a)&&((dB(t)!==`body`||vB(i))&&(s=AB(t)),r)){let e=EG(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=DG(i));let l=i&&!r&&!a?OG(i,s):OH(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 BG(e){return kB(e).position===`static`}function VG(e,t){if(!gB(e)||kB(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return pB(e)===n&&(n=n.ownerDocument.body),n}function HG(e,t){let n=fB(e);if(bB(e))return n;if(!gB(e)){let t=jB(e);for(;t&&!OB(t);){if(hB(t)&&!BG(t))return t;t=jB(t)}return n}let r=VG(e,t);for(;r&&yB(r)&&BG(r);)r=VG(r,t);return r&&OB(r)&&BG(r)&&!TB(r)?n:r||EB(e)||n}var UG=async function(e){let t=this.getOffsetParent||HG,n=this.getDimensions,r=await n(e.floating);return{reference:zG(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function WG(e){return kB(e).direction===`rtl`}var GG={convertOffsetParentRelativeRectToViewportRelativeRect:kG,getDocumentElement:pB,getClippingRect:LG,getOffsetParent:HG,getElementRects:UG,getClientRects:AG,getDimensions:RG,getScale:SG,isElement:hB,isRTL:WG};function KG(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qG(e,t,n){let r=null,i,a=pB(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=DH(d),h=DH(a.clientWidth-(u+f)),g=DH(a.clientHeight-(d+p)),_=DH(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:TH(0,wH(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!KG(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=fB(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function JG(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=xG(e),u=i||a?[...l?NB(l):[],...t?NB(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?qG(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?EG(e):null;c&&g();function g(){let t=EG(e);h&&!KG(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 YG=gG,XG=_G,ZG=pG,QG=yG,$G=vG,eK=(e,t,n)=>{let r=new Map,i=n??{},a={...GG,...i.platform,_c:r};return fG(e,t,{...i,platform:a})},tK=typeof document<`u`?G.useLayoutEffect:function(){};function nK(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(!nK(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)&&!nK(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function rK(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function iK(e,t){let n=rK(e);return Math.round(t*n)/n}function aK(e){let t=G.useRef(e);return tK(()=>{t.current=e}),t}function oK(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]=G.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=G.useState(r);nK(f,r)||p(r);let[m,h]=G.useState(null),[g,_]=G.useState(null),v=G.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=G.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=G.useRef(null),C=G.useRef(null),w=G.useRef(u),T=c!=null,E=aK(c),D=aK(i),O=aK(l),k=G.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),eK(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!nK(w.current,t)&&(w.current=t,jW.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);tK(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=G.useRef(!1);tK(()=>(A.current=!0,()=>{A.current=!1}),[]),tK(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=G.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=G.useMemo(()=>({reference:b,floating:x}),[b,x]),N=G.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=iK(M.floating,u.x),r=iK(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...rK(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return G.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var sK=(e,t)=>{let n=YG(e);return{name:n.name,fn:n.fn,options:[e,t]}},cK=(e,t)=>{let n=XG(e);return{name:n.name,fn:n.fn,options:[e,t]}},lK=(e,t)=>({fn:$G(e).fn,options:[e,t]}),uK=(e,t)=>{let n=ZG(e);return{name:n.name,fn:n.fn,options:[e,t]}},dK=(e,t)=>{let n=QG(e);return{name:n.name,fn:n.fn,options:[e,t]}},fK={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},pK=class extends lB{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:LW(),nested:n,triggerElements:i},fK),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&dV(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 mK(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=G.useRef(null);r===void 0&&f.current===null&&(f.current=new pK({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};hB(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 hK(e,t=!1,n=!1,r=!1){let[i,a]=G.useState(e&&t?`idle`:void 0),[o,s]=G.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=VB.request(()=>{a(`ending`)});return()=>{VB.cancel(e)}}},[e,o,i,n]),Y(()=>{if(!e||t)return;let n=VB.request(()=>{a(void 0)});return()=>{VB.cancel(n)}},[t,e]),Y(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=VB.request(()=>{a(`idle`)});return()=>{VB.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}var gK=null;function _K(e){if(!gK){let e=[];gK=e,queueMicrotask(()=>{gK=null,jW.flushSync(()=>{for(let t of e)t()})})}gK.push(e)}function vK(e,t=!1,n=!1){let r=HB();return X((i,a=null)=>{r.cancel();let o=KW(e);if(o==null)return;let s=o,c=()=>{if(!n){jW.flushSync(i);return}_K(()=>{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=xV;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 yK(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=X(a),s=vK(r,n,i);G.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var bK={tabIndex:-1,[hV]:``};function xK(e){return t=>t!==`touch`||e.current}function SK(e,t=!1){let n=YU(),r=VW()!=null,i=Rz(()=>e(n,r)).current;return mK({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function CK({handle:e,store:t}){return Y(()=>e.attachStore(t),[e,t]),null}function wK(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function TK(e,t){let n=G.useRef(null);return X(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),wK(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),wK(t))})}function EK(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 DK(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function OK(e,t,n,r={}){let i=n.reason,a=i===nH,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=DK(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=EK(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?jW.flushSync(l):l()}function kK(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=TK(e,n),o=X(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=X(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 AK(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=G.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=yH(eH);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 jK(e,t,n,r){let{mounted:i,setMounted:a,transitionStatus:o}=hK(e,!1,!1,r),s=t.useState(`preventUnmountingOnClose`),c=!e&&s;t.useSyncedValues({mounted:i,transitionStatus:o,preventUnmountingOnClose:c});let l=X(()=>{a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return yK({enabled:i&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:o}}function MK(e,t){e.useSyncedValues(t),Y(()=>()=>{e.update({activeTriggerProps:cB,inactiveTriggerProps:cB,popupProps:cB})},[e])}function NK(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 PK=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 FK(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new pK({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:cB,inactiveTriggerProps:cB,popupProps:cB}}var IK=e=>e.triggerIdProp??e.activeTriggerId,LK=e=>e.openProp??e.open,RK=e=>(e.popupElement?.id??e.floatingId)||void 0;function zK(e,t){return t!==void 0&&LK(e)&&IK(e)===t}function BK(e,t){return zK(e,t)?!0:t!==void 0&&LK(e)&&IK(e)==null&&e.triggerCount===1}var VK={open:LK,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:IK,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:RK,isTriggerActive:(e,t)=>t!==void 0&&IK(e)===t,isOpenedByTrigger:(e,t)=>zK(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&IK(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>BK(e,t)?RK(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function HK(e){let t=G.useCallback(t=>e===void 0?oB:e.subscribeStore(t),[e]),n=G.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,eB.useSyncExternalStore)(t,n,()=>e?.serverStore)}function UK(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=YU(),a=VW()!=null,o=Rz(()=>new pK({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new PK,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=hB(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 WK(e){return GK(e,e.rootContext)}function GK(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]=G.useState(null),[d,f]=G.useState(void 0),[p,m]=G.useState(void 0),h=G.useRef(null),g=HW(r),_=G.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),v=oK({...e,elements:{..._,...l&&{reference:l}}}),y=hB(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=G.useCallback(e=>{let t=hB(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),v.refs.setReference(t)},[v.refs]),S=G.useCallback(e=>{(hB(e)||e===null)&&(h.current=e,f(e)),(hB(v.refs.reference.current)||v.refs.reference.current===null||e!==null&&!hB(e))&&v.refs.setReference(e)},[v.refs,f]),C=G.useCallback(e=>{m(e),v.refs.setFloating(e)},[v.refs]),w=G.useMemo(()=>({...v.refs,setReference:S,setFloating:C,setPositionReference:x,domReference:h}),[v.refs,S,C,x]),T=G.useMemo(()=>({...v.elements,domReference:o}),[v.elements,o]),E=G.useMemo(()=>({...v,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:w,elements:T,nodeId:n,rootStore:t}),[v,w,T,n,t,s,c]);return Y(()=>{o&&(h.current=o)},[o]),Y(()=>{t.context.dataRef.current.floatingContext=E;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=E)}),G.useMemo(()=>({...v,context:E,refs:w,elements:T,rootStore:t}),[v,w,T,E,t])}var KK=tV&&rV;function qK(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=G.useRef(!1),c=G.useRef(null),l=G.useRef(!0),u=GB();G.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=fB(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&gB(e)&&e===fV(IB(e))&&(s.current=!0,c.current=e)}function a(){l.current=!0}function o(){l.current=!1}return FB(LB(t,`blur`,r),KK&&LB(t,`keydown`,a,!0),KK&&LB(t,`pointerdown`,o,!0))},[i,n]),G.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);hB(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=G.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=mV(t.nativeEvent);if(hB(a)){if(KK&&!t.relatedTarget){if(!l.current&&!WV(a))return}else if(!qV(a))return}let o=VV(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,yH(rH,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,yH(rH,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=hB(n)&&n.hasAttribute(jU(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=fV(IB(e));(n||t!==e)&&(pV(o.current.floatingContext?.refs.floating.current,t)||pV(e,t)||a||VV(n??t,i.context.triggerElements)||i.setOpen(!1,yH(rH,r)))})}}},[o,r,i,u]);return G.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var JK=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 WB,this.restTimeout=new WB,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},YK=new WeakMap;function XK(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&YK.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),YK.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function ZK(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=YK.get(n);a&&a!==e&&XK(a),XK(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,YK.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function QK(e){let t=e.context.dataRef.current,n=Rz(()=>t.hoverInteractionState??JK.create()).current;return t.hoverInteractionState||=n,RB(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function $K(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=HW(),d=VW(),f=QK(a),p=GB(),m=X(()=>QV(l.current.openEvent?.type,f.interactedInside)),h=X(()=>$V(l.current.openEvent?.type)),g=X(()=>{XK(f)});Y(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),G.useEffect(()=>g,[g]),Y(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&hB(c)&&s){let e=c,t=s,n=IB(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 ZK(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),G.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&kU(u.nodesRef.current,d).length>0)}function t(e){let t=XV(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,yH(nH,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=mV(e);if(!GV(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(VV(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&hB(o)&&kU(u.nodesRef.current,r,!1).some(e=>pV(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,yH(nH,t)),u.events.emit(`floating.closed`,t)})}let y=s;return FB(y&&LB(y,`mouseenter`,c),y&&LB(y,`mouseleave`,_),y&&LB(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var eq={current:null};function tq(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=eq,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=HW(l),y=QK(h),b=G.useRef(!1),x=Kz(i),S=Kz(r),C=Kz(o),w=Kz(n),T=Kz(p),E=Kz(f),D=X(()=>QV(g.current.openEvent?.type,y.interactedInside)),O=X(()=>T.current?.()!==!1),k=X((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!pV(e,t);if(!hB(n))return!1;let i=n;return r.hasMatchingElement(e=>pV(e,i))&&(!e||!pV(e,i))}),A=X(()=>{y.handler&&=(IB(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),j=X(()=>{XK(y)});return u&&(y.handleCloseOptions=i?.__options),G.useEffect(()=>A,[A]),G.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===nH,A(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,A]),G.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=XV(S.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{h.setOpen(!1,yH(nH,e)),v?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),h.setOpen(!1,yH(nH,e)),v?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!hB(t))return;function r(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!uV(y.pointerType))return;let t=ZV(C.current),n=XV(S.current,`open`,y.pointerType),r=mV(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(hB(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(pV(e,r)){s=e;break}}hB(i)&&hB(o)&&!h.context.triggerElements.hasElement(i)&&pV(i,o)&&(s=o);let c=s!=null&&k(o,s,r),l=h.select(`open`),u=E.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&b.current,f=!c&&hB(s)&&hB(o)&&pV(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){O()&&h.setOpen(!0,yH(nH,e,s));return}p||(n?y.openChangeTimeout.start(n,()=>{g&&O()&&h.setOpen(!0,yH(nH,e,s))}):g&&O()&&h.setOpen(!0,yH(nH,e,s)))}function i(t){if(D()){j();return}A();let n=IB(h.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!VV(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(){j(),A(),w.current&&!D()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,y.handler),y.handler(t);return}(y.pointerType!==`touch`||!pV(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){pV(t,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let l=m?LB(t,`mouseout`,o):void 0;return s?FB(LB(t,`mousemove`,r,{once:!0}),LB(t,`mouseenter`,r),LB(t,`mouseleave`,i),l):FB(LB(t,`mouseenter`,r),LB(t,`mouseleave`,i),l)},[A,j,g,S,h,n,x,y,u,k,D,a,s,C,c,v,w,d,E,O,m]),G.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=k(r,n,e.target);if(a&&!uV(y.pointerType))return;if(i&&o&&y.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=y.handleCloseOptions?.getScope?.()??n.ownerDocument.body;ZK(y,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=ZV(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,D())return;let e=h.select(`open`);!y.blockMouseMove&&(!e||o)&&O()&&h.setOpen(!0,yH(nH,t,n))}y.pointerType===`touch`?jW.flushSync(()=>{c()}):o&&i?c():(y.restTimeoutPending=!0,y.restTimeout.start(s,c))}}},[n,y,D,k,a,h,C,O])}var nq=`Escape`;function rq(e){return rV&&e.movementX===0&&e.movementY===0}function iq(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function aq(e,t){return iq(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function oq(e,t,n){return iq(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function sq(e,t,n){return iq(t,n?e===_V:e===vV,e===bV)}function cq(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===nq:iq(t,n?e===vV:e===_V,e===yV)}function lq(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`),T=C.useState(`floatingElement`),E=C.useState(`domReferenceElement`),D=C.context.dataRef,O=JV(T),k=KV(E),A=Kz(O),j=VW(),M=HW(b),N=G.useRef(f),P=G.useRef(o??-1),F=G.useRef(null),I=G.useRef(!0),L=X(e=>{i(P.current===-1?null:P.current,e)}),R=G.useRef(!!T),z=G.useRef(w),ee=G.useRef(!1),B=G.useRef(!1),V=G.useRef(null),te=Kz(h),H=Kz(w),ne=Kz(o),re=Kz(y),ie=HB(),ae=HB(),oe=X(()=>{function e(e){d?M?.events.emit(`virtualfocus`,e):V.current=NU(e,{sync:ee.current,preventScroll:!0})}let t=n.current[P.current],r=B.current;t&&e(t),(ee.current?e=>e():e=>ie.request(e))(()=>{let i=n.current[P.current]||t;i&&(t||e(i),de&&(r||!I.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Y(()=>{D.current.orientation=g},[D,g]),Y(()=>{a&&(w&&T?(P.current=o??-1,N.current&&o!=null&&(B.current=!0,L())):R.current&&(P.current=-1,L()))},[a,w,T,o,L]),Y(()=>{if(a){if(!w){ee.current=!1;return}if(T){if(r==null){if(ee.current=!1,ne.current!=null)return;if(R.current&&(P.current=-1,oe()),(!z.current||!R.current)&&N.current&&(F.current!=null||N.current===!0&&F.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ae.request(e):queueMicrotask)(t),e+=1):(P.current=F.current==null||oq(F.current,g,u)||l?QH(n):$H(n),F.current=null,L())};t()}}else ZH(n.current,r)||(P.current=r,oe(),B.current=!1)}}},[a,w,T,r,ne,l,n,g,u,L,oe,ae]),Y(()=>{if(!a||T||!M||d||!R.current)return;let e=M.nodesRef.current,t=e.find(e=>e.id===j)?.context?.elements.floating,n=fV(IB(E??t??null)),r=e.some(e=>e.context&&pV(e.context.elements.floating,n));t&&!r&&I.current&&t.focus({preventScroll:!0})},[a,T,E,M,j,d]),Y(()=>{z.current=w,R.current=!!T}),Y(()=>{w||(F.current=null,N.current=f)},[w,f]);let se=r!=null,U=X(e=>{if(!H.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(P.current!==t||r!==t)&&(P.current=t,L(e))}),ce=X(()=>_??M?.nodesRef.current.find(e=>e.id===j)?.context?.dataRef?.current.orientation),le=X(()=>QH(n,te.current)),ue=X(e=>{if(I.current=!1,ee.current=!0,e.which===229||!H.current&&e.currentTarget===A.current)return;if(l&&cq(e.key,g,u,S)){aq(e.key,ce())||oV(e),C.setOpen(!1,yH(uH,e.nativeEvent)),gB(E)&&(d?M?.events.emit(`virtualfocus`,E):E.focus());return}let t=P.current,r=QH(n,h),i=$H(n,h);if(k||(e.key===`Home`&&(oV(e),P.current=r,L(e)),e.key===`End`&&(oV(e),P.current=i,L(e))),x!=null){let t=x(e,P.current,n,g,c,u,h,r,i);if(t!=null&&(P.current=t,L(e)),g===`both`)return}if(aq(e.key,g)){if(oV(e),w&&!d&&fV(e.currentTarget.ownerDocument)===e.currentTarget){P.current=oq(e.key,g,u)?r:i,L(e);return}oq(e.key,g,u)?c?t>=i?s&&t!==n.current.length?P.current=-1:(ee.current=!1,P.current=r):P.current=eU(n.current,{startingIndex:t,disabledIndices:h}):P.current=Math.min(i,eU(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?P.current=n.current.length:(ee.current=!1,P.current=i):P.current=eU(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):P.current=Math.max(r,eU(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),ZH(n.current,P.current)&&(P.current=-1),L(e)}}),de=G.useMemo(()=>({onFocus(e){ee.current=!0,U(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){rq(e)||(ee.current=!0,B.current=!1,p&&U(e))},onPointerLeave(e){if(!H.current||!I.current||e.pointerType===`touch`)return;ee.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&re.current&&(V.current?.(),V.current=null,P.current=-1,L(e),!d)){let e=A.current,t=fV(IB(e));e&&pV(e,t)&&e.focus({preventScroll:!0})}}}),[U,H,A,p,n,L,re,d]),W=G.useMemo(()=>d&&w&&se&&{"aria-activedescendant":`${v}-${r}`},[d,w,se,v,r]),fe=G.useMemo(()=>({...k?{}:W,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&w&&!d){let t=mV(e.nativeEvent);if(t&&!pV(A.current,t))return;oV(e),C.setOpen(!1,yH(sH,e.nativeEvent)),gB(E)&&E.focus();return}ue(e)},onPointerMove(e){rq(e)||(I.current=!0)}}),[W,ue,A,k,C,w,d,E]),pe=G.useMemo(()=>{function e(e){C.setOpen(!0,yH(uH,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&cV(e.nativeEvent)&&(N.current=!d)}function n(e){N.current=f,f===`auto`&&lV(e.nativeEvent)&&(N.current=!0)}return{onKeyDown(t){let n=C.select(`open`);I.current=!1;let r=t.key.startsWith(`Arrow`),i=sq(t.key,ce(),u),a=aq(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=aq(t.key,ce());F.current=l&&e?null:t.key}if(l){i&&(oV(t),n?(P.current=le(),L(t)):e(t));return}a&&(ne.current!=null&&(P.current=ne.current),oV(t),!n&&m?e(t):ue(t),n&&L(t))}},onFocus(e){C.select(`open`)&&!d&&(P.current=-1,L(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[ue,f,le,l,L,C,m,g,ce,u,ne,d]),me=G.useMemo(()=>({...W,...pe}),[W,pe]);return G.useMemo(()=>a?{reference:me,floating:fe,item:de,trigger:pe}:{},[a,me,fe,pe,de])}function uq(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=GB(),m=G.useRef(``),h=G.useRef(u??i??-1),g=G.useRef(null),_=X(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!rU(n)||n?.matches(`:disabled`)?!1:o==null||!tU(sB,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===` `&&(oV(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!==` `&&(oV(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=X(e=>{let t=e.relatedTarget,n=d.select(`domReferenceElement`),r=d.select(`floatingElement`);pV(n,t)||pV(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=G.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return G.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var dq=.1,fq=dq*dq,pq=.5;function mq(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function hq(e,t,n,r,i,a,o,s,c,l){let u=!1;return mq(e,t,n,r,i,a)&&(u=!u),mq(e,t,i,a,o,s)&&(u=!u),mq(e,t,o,s,c,l)&&(u=!u),mq(e,t,c,l,n,r)&&(u=!u),u}function gq(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function _q(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 vq(e={}){let{blockPointerEvents:t=!1}=e,n=new WB,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*fq;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=mV(r),g=r.type===`mouseleave`,_=pV(u,h),v=pV(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&hB(r.relatedTarget)&&pV(u,r.relatedTarget))return;function y(){return!!(s&&kU(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=_q(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=_q(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=_q(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=_q(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!gq(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?pq/2:pq*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+pq+1,o=C||T?S.bottom-pq:S.top,s=C?T?S.bottom-pq:S.top:S.bottom-pq;M=hq(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?pq/2:pq*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-pq,o=C||T?S.top+pq:S.bottom,s=C?T?S.top+pq:S.bottom:S.top+pq;M=hq(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?pq/2:pq*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+pq+1,o=w||E?S.right-pq:S.left,s=w?E?S.right-pq:S.left:S.right-pq;M=hq(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?pq/2:pq*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-pq,o=w||E?S.left+pq:S.right,s=w?E?S.left+pq:S.right:S.left+pq;M=hq(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 yq=G.createContext(void 0),bq=G.createContext(void 0),xq=G.createContext(void 0);function Sq(){let e=G.useContext(yq);if(e===void 0)throw Error(qz(60));return e}function Cq(){let e=G.useContext(bq);if(e===void 0)throw Error(qz(101));return e}function wq(){let e=G.useContext(xq);if(e===void 0)throw Error(qz(61));return e}var Tq=`data-valid`,Eq=`data-invalid`,Dq={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Oq={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},kq={valid(e){return e===null?null:e?{[Tq]:``}:{[Eq]:``}}},Aq={invalid:void 0,name:void 0,validityData:{state:Dq,errors:[],error:``,value:``,initialValue:null},setValidityData:oB,disabled:void 0,setTouched:oB,setDirty:oB,setFilled:oB,setFocused:oB,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:Oq,registerFieldControl:oB,validation:{getValidationProps:(e,t=cB)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:oB,getInputControl:()=>null,commit:async()=>{},change:oB}},jq=G.createContext(Aq);function Mq(e=!0){let t=G.useContext(jq);if(t.setValidityData===oB&&!e)throw Error(qz(28));return t}function Nq(e,t,n,r,i=!0,a){let{registerFieldControl:o}=Mq(),s=Rz(()=>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])}function Pq(e){return YU(e,`base-ui`)}var Fq=G.createContext({controlId:void 0,registerControlId:oB,resetControlId:oB,labelId:void 0,setLabelId:oB,messageIds:[],setMessageIds:oB,getDescriptionProps:e=>e});function Iq(){return G.useContext(Fq)}function Lq(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=Iq(),o=Pq(),s=Rz(()=>Symbol()),c=G.useRef(!1),l=G.useRef(!1),u=X(()=>{c.current&&i!==oB&&(c.current=!1,i(s.current,void 0))});return Y(()=>{if(!n||i===oB){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 Rq(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 zq=(e,t)=>Object.is(e,t);function Bq(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Vq(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!Rq(e,t,(e,t)=>Bq(e,t,n)):e!==t}function Hq(e,t,n){return e?e.some(e=>e!==void 0&&Bq(t,e,n)):!1}function Uq(e,t,n){return e?e.findIndex(e=>e!==void 0&&Bq(e,t,n)):-1}function Wq(e,t){if(t!==zq)return n=>Hq(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 Gq(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(Wq(t,n)):Uq(e,t,n);return i===-1?null:i}function Kq(e,t,n,r,i,a){return Hq(r,t,i)?a!=null&&e>a&&Hq(r,n[a],i)?a:e:e===a?Gq(n,r,i,!0):a}function qq(e,t,n){return e.filter(e=>!Bq(t,e,n))}function Jq(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function Yq(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function Xq(e){return Yq(e?.[0])}function Zq(e){return Xq(e)?e.flatMap(e=>e.items):e}function Qq(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(Xq(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 $q(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 Jq(e)}function eJ(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?Jq(e.value):Jq(e)}function tJ(e,t,n){function r(){return $q(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=Zq(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 nJ(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,Z.jsx)(G.Fragment,{children:tJ(r,t,n)},i)),e),[])}var rJ={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:eJ(t,r)!==``},hasNullItemLabel:(e,t)=>t?Qq(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=>Bq(t,e,n)):Bq(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},iJ=G.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:oB,validationMode:`onSubmit`,submitCountRef:{current:0}});function aJ(){return G.useContext(iJ)}function oJ(e,t){let n=G.useRef(e),r=X(t);Y(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function sJ(e){let t=G.useRef(``),n=G.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:G.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 cJ(e,t){let{onClick:n,onPointerDown:r}=sJ(X((n,r)=>{(typeof e==`function`?e():e)||t(r||(QB?`touch`:``))}));return G.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function lJ(e){let[t,n]=G.useState(null),r=cJ(e,n);return oJ(e,t=>{t&&!e&&n(null)}),G.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function uJ(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function dJ(e,t){return Math.max(0,e-t)}function fJ(e,t){if(t<=0)return 0;let n=uJ(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 pJ(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=zq,highlightItemOnHover:C=!0,children:w}=e,{clearErrors:T}=aJ(),{setDirty:E,setTouched:D,setFocused:O,validityData:k,setFilled:A,name:j,disabled:M,validation:N,validationMode:P}=Mq(),F=Lq({id:t}),I=M||d,L=j??c,[R,z]=Uz({controlled:n,default:y?r??sB:r,name:`Select`,state:`value`}),[ee,B]=Uz({controlled:a,default:o,name:`Select`,state:`open`}),V=G.useRef([]),te=G.useRef([]),H=G.useRef(null),ne=G.useRef(null),re=G.useRef(0),ie=G.useRef(null),ae=G.useRef([]),oe=G.useRef(!1),se=G.useRef(null),U=G.useRef(null),ce=G.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),le=G.useRef(!1),ue=G.useRef(R),{mounted:de,setMounted:W,transitionStatus:fe}=hK(ee),{openMethod:pe,triggerProps:me}=lJ(ee),he=Rz(()=>new lB({id:F,labelId:void 0,modal:m,multiple:y,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,value:R,open:ee,mounted:de,transitionStatus:fe,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:cB,triggerProps:cB,triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:oB,setOpen:oB,handleScrollArrowVisibility:oB,onOpenChangeComplete:oB,listRef:V,popupRef:H,scrollHandlerRef:ne,scrollArrowsMountedCountRef:re,valueRef:ie,valuesRef:ae,labelsRef:te,typingRef:oe,selectionRef:ce,firstItemTextRef:se,selectedItemTextRef:U,alignItemWithTriggerActiveRef:le,initialValueRef:ue},rJ)).current,ge=he.useState(`activeIndex`),_e=he.useState(`selectedIndex`),ve=he.useState(`triggerElement`),ye=he.useState(`positionerElement`),be=nte(pe),xe=pe??be,Se=G.useMemo(()=>y?``:eJ(R,x),[y,R,x]),Ce=G.useMemo(()=>y&&Array.isArray(R)?R.map(e=>eJ(e,x)):eJ(R,x),[y,R,x]);Nq(Kz(ve),F,R,X(()=>Ce),!I,c);let we=y?Array.isArray(R)&&R.length>0:R!=null&&Se!==``;Y(()=>{A(we)},[we,A]),Y(function(){let e=Gq(ae.current,R,S,y);e===null&&(U.current=null),!ee&&he.set(`selectedIndex`,e)},[y,ee,R,S,he]),oJ(R,()=>{T(L),E(Vq(R,k.initialValue,S)),N.change(R)});let Te=X((e,t)=>{s?.(e,t),!t.isCanceled&&(B(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(D(!0),O(!1),P===`onBlur`&&N.commit(R)))}),Ee=X(()=>{W(!1),he.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)});yK({enabled:!h,open:ee,ref:H,onComplete(){ee||Ee()}}),G.useImperativeHandle(h,()=>({unmount:Ee}),[Ee]);let De=X((e,t)=>{i?.(e,t),!t.isCanceled&&z(e)}),Oe=X(e=>{let t=dJ(e.scrollHeight,e.clientHeight),n=fJ(e.scrollTop,t),r=n>0,i=n<t;he.set(`scrollUpArrowVisible`,r),he.set(`scrollDownArrowVisible`,i)}),ke=UK({open:ee,onOpenChange:Te,elements:{reference:ve,floating:ye}}),Ae=nG(ke,{enabled:!I,event:`mousedown`}),je=cG(ke),Me=lq(ke,{enabled:!I,listRef:V,activeIndex:ge,selectedIndex:_e,disabledIndices:sB,onNavigate(e){(e!==null||ee)&&he.set(`activeIndex`,e)},focusItemOnHover:C}),Ne=uq(ke,{enabled:!I&&(ee||!f&&!y),listRef:te,activeIndex:ge,selectedIndex:_e,disabledIndices:e=>Hz(V.current[e]),onMatch(e){ee?he.set(`activeIndex`,e):De(ae.current[e],yH(eH))},onTyping(e){oe.current=e}}),Pe=G.useMemo(()=>nW(Ne.reference,Me.reference,je.reference,Ae.reference,me),[Ae.reference,Ne.reference,Me.reference,je.reference,me]),Fe=G.useMemo(()=>nW(bK,Ne.floating,Me.floating,je.floating),[Ne.floating,Me.floating,je.floating]),Ie=Me.item??cB;he.useContextCallback(`setValue`,De),he.useContextCallback(`setOpen`,Te),he.useContextCallback(`handleScrollArrowVisibility`,Oe),he.useContextCallback(`onOpenChangeComplete`,_),tte(()=>{he.update({popupProps:Fe,triggerProps:Pe})}),he.useSyncedValues({id:F,modal:m,multiple:y,value:R,open:ee,mounted:de,transitionStatus:fe,popupProps:Fe,triggerProps:Pe,items:v,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,openMethod:xe});let Le=G.useMemo(()=>({disabled:I,readOnly:f,required:p,multiple:y,highlightItemOnHover:C,itemProps:Ie}),[I,f,p,y,C,Ie]),Re=zz(g,N.inputRef),ze=y?void 0:L,Be=G.useMemo(()=>!y||!Array.isArray(R)||!L?null:R.map(e=>{let t=eJ(e,x);return(0,Z.jsx)(`input`,{type:`hidden`,form:l,name:L,value:t,disabled:I},t)}),[y,R,l,L,x,I]);return(0,Z.jsxs)(yq.Provider,{value:he,children:[(0,Z.jsx)(bq.Provider,{value:Le,children:(0,Z.jsx)(xq.Provider,{value:ke,children:w})}),(0,Z.jsx)(`input`,{...N.getValidationProps(I,{onFocus(){he.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||I||f)return;let t=e.currentTarget.value,n=yH(eH,e.nativeEvent);function r(){if(y)return;let e=t.toLowerCase(),r=ae.current.findIndex(t=>eJ(t,x).toLowerCase()===e||$q(t,b).toLowerCase()===e);r===-1&&(r=ae.current.findIndex((t,n)=>{let r=te.current[n];return r!=null&&r.toLowerCase()===e}));let i=ae.current[r];i!=null&&De(i,n)}he.set(`forceMount`,!0),queueMicrotask(r)}}),id:F&&ze==null?`${F}-hidden-input`:void 0,form:l,name:ze,autoComplete:u,value:Se,disabled:I,required:p&&!(y&&we),readOnly:f,ref:Re,style:L?Zee:Iz,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Be]})}function mJ(e,t){return e??t}var hJ=5;function gJ(e,t){let n=_J(t);return e.clientX>=n.left-hJ&&e.clientX<=n.right+hJ&&e.clientY>=n.top-hJ&&e.clientY<=n.bottom+hJ}function _J(e){let t=e.getBoundingClientRect(),n=fB(e);if(aV)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 vJ=G.createContext(void 0);function yJ(e=!1){let t=G.useContext(vJ);if(t===void 0&&!e)throw Error(qz(16));return t}function bJ(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:G.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 xJ(e,t,{detail:n=0}={}){e.dispatchEvent(new(fB(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function SJ(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=G.useRef(null),s=yJ(!0),c=a??s!==void 0,{props:l}=bJ({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=G.useCallback(()=>{let e=o.current;CJ(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Y(u,[u]),{getButtonProps:G.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return nW({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(pW(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=CJ(r),s=!i&&wJ(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(),xJ(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),xJ(r,e)))},onKeyUp(e){if(!t){if(pW(e),a?.(e),e.target===e.currentTarget&&i&&c&&CJ(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),xJ(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:X(e=>{o.current=e,u()})}}function CJ(e){return gB(e)&&e.tagName===`BUTTON`}function wJ(e){return gB(e)&&e.tagName===`A`&&!!e.href}var TJ=`data-popup-side`,EJ=400,DJ={...LV,...kq,popupSide:e=>e?{[TJ]:e}:null,value:()=>null},OJ=G.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}=Mq(),{labelId:h}=Iq(),g=Sq(),{readOnly:_,required:v,disabled:y}=Cq(),b=m||y||a,x=g.useState(`open`),S=g.useState(`mounted`),C=g.useState(`value`),w=g.useState(`triggerProps`),T=g.useState(`positionerElement`),E=g.useState(`listElement`),D=g.useState(`popupSide`),O=g.useState(`id`),k=g.useState(`labelId`),A=g.useState(`hasSelectedValue`),j=S&&T?D:null,M=i??O,N=mJ(h,k);Lq({id:i});let P=Kz(T),F=G.useRef(null),{getButtonProps:I,buttonRef:L}=SJ({disabled:b,native:o}),R=g.useStateSetter(`triggerElement`),z=GB(),ee=GB(),B=GB();G.useEffect(()=>{if(x)return B.start(EJ,()=>{g.context.selectionRef.current.allowUnselectedMouseUp=!0,g.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{B.clear()};g.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},ee.clear()},[x,g,ee,B]);let V=nW(w,{id:M,role:`combobox`,"aria-expanded":x,"aria-haspopup":`listbox`,"aria-controls":x?E?.id??JV(T)?.id:void 0,"aria-labelledby":N,"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,yH(eH,e.nativeEvent)),z.start(0,()=>{g.set(`forceMount`,!0)})},onBlur(e){pV(T,e.relatedTarget)||(l(!0),u(!1),d===`onBlur`&&f.commit(C))},onMouseDown(e){if(x)return;let t=IB(e.currentTarget);function n(e){if(!F.current)return;let t=e.target;pV(F.current,t)||pV(P.current,t)||gJ(e,F.current)||g.context.setOpen(!1,yH(dH,e))}ee.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,I),te=f.getValidationProps(b,V);te.role=`combobox`;let H={...p,open:x,disabled:b,value:C,readOnly:_,popupSide:j,placeholder:!A};return gW(`button`,e,{ref:[t,F,L,R],state:H,stateAttributesMapping:DJ,props:te})}),kJ={value:()=>null},AJ=G.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=Sq(),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)?nJ(l,u,d):tJ(l,u,d)),gW(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:kJ})}),jJ=G.forwardRef(function(e,t){let n=Sq(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,Z.jsx)(IW,{ref:t,...e}):null});function MJ(e){return Yz(19)?e:e?`true`:void 0}var NJ=G.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function PJ(){return G.useContext(NJ)}function FJ(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=X(i),[,o]=G.useState(!1),s=Rz(LJ).current,c=Rz(IJ).current,l=G.useRef(0),u=G.useRef(!0),d=G.useRef(null),f=G.useRef(null),p=X(()=>{u.current||(u.current=!0,o(e=>!e))}),m=X((e,t)=>{c.set(e,t),p()}),h=X(e=>{c.delete(e),p()}),g=X(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(!BJ(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&VJ(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=zJ(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=X(()=>{let[e,t]=RJ(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=X(e=>(s.add(e),()=>{s.delete(e)})),b=G.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,Z.jsx)(NJ.Provider,{value:b,children:t})}function IJ(){return new Map}function LJ(){return new Set}function RJ(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)=>VJ(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 zJ(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function BJ(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 VJ(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var HJ=G.createContext(void 0);function UJ(){return G.useContext(HJ)?.direction??`ltr`}var WJ=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`}=jH(e,t)||{};if(l==null)return{};let f=YH(u),p={x:n,y:r},m=LH(i),h=FH(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=AH(k,j,A),N=!c.arrow&&NH(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}}}),GJ=(e,t)=>{let{name:n,fn:r}=WJ(e);return{name:n,fn:r,options:[e,t]}},KJ={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}}}},qJ={sideX:`left`,sideY:`top`},JJ=`--available-width`,YJ=`--available-height`,XJ=`--anchor-width`,ZJ=`--anchor-height`,QJ=`--transform-origin`,$J=JJ,eY=YJ;function tY(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 nY(e,t,n){let{rects:r,placement:i}=e;return{side:tY(t,MH(i),n),align:NH(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function rY(e){return iY(e,WK)}function iY(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]=G.useState(null);!g&&C!==null&&w(null);let T=_.side||`flip`,E=_.align||`flip`,D=_.fallbackAxisSide||`end`,O=v?.crossAxis??!1,k=v?.rootBoundary,A=typeof n==`function`?n:void 0,j=X(A),M=A?j:n,N=Kz(n),P=Kz(g),F=UJ()===`rtl`,I=C||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":F?`left`:`right`,"inline-start":F?`right`:`left`}[i],L=o===`center`?I:`${I}-${o}`,R=l;typeof R==`number`?R={top:R,right:R,bottom:R,left:R}:R&&={top:R.top||0,right:R.right||0,bottom:R.bottom||0,left:R.left||0};let z=+(i===`bottom`),ee=+(i===`top`),B=+(i===`right`),V=+(i===`left`),te={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:R},H=G.useRef(null),ne=Kz(a),re=Kz(s),ie=typeof a==`function`?0:a,ae=typeof s==`function`?0:s,oe=[];p&&oe.push(p),oe.push(sK(e=>{let t=nY(e,i,F),n=typeof ne.current==`function`?ne.current(t):ne.current,r=typeof re.current==`function`?re.current(t):re.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ie,ae,F,i]));let se=E===`none`&&T!==`shift`,U=!se&&(u||O||T===`shift`),ce=T===`none`?null:uK({...te,padding:{top:R.top+1+z,right:R.right+1+V,bottom:R.bottom+1+ee,left:R.left+1+B},mainAxis:!O&&T===`flip`,crossAxis:E===`flip`&&`alignment`,fallbackAxisSideDirection:D}),le=se?null:cK({...te,rootBoundary:k,mainAxis:E!==`none`,crossAxis:U,limiter:u||O?void 0:lK(e=>{if(!H.current)return{};let{width:t,height:n}=H.current.getBoundingClientRect(),r=IH(MH(e.placement)),i=r===`y`?t:n,a=r===`y`?R.left+R.right:R.top+R.bottom;return{offset:i/2+a/2}})},[te,u,O,k,R,E]);T===`shift`||E===`shift`||o===`center`?oe.push(le,ce):oe.push(ce,le),oe.push(dK({...te,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!P.current)return;let i=e.style;i.setProperty($J,`${t}px`),i.setProperty(eY,`${n}px`);let a=fB(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(XJ,`${u}px`),i.setProperty(ZJ,`${d}px`)}}),GJ(e=>({element:H.current||IB(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=MH(r),u=NH(r),d=IH(l)===`y`,f=H.current,p=typeof a==`function`?a(nY(e,i,F)):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 U&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(QJ,d?`${m} ${h}`:`${h} ${m}`),{}}},KJ,b),Y(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let ue=G.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:de,elements:W,x:fe,y:pe,middlewareData:me,update:he,placement:ge,context:_e,isPositioned:ve,floatingStyles:ye}=t({rootContext:h,open:m?g:void 0,placement:L,middleware:oe,strategy:r,whileElementsMounted:m?void 0:(...e)=>JG(...e,ue),nodeId:y,externalTree:S}),{sideX:be,sideY:xe}=me.adaptiveOrigin||qJ,Se=ve?r:`fixed`,Ce=G.useMemo(()=>{let e;return e=ve?b?{position:Se,[be]:fe,[xe]:pe}:{...ye,position:Se}:{position:Se,top:0,left:0},e[$J]=`100vw`,e[eY]=`100vh`,ve||(e.opacity=0),e},[b,Se,be,fe,xe,pe,ye,ve]),we=G.useRef(null);Y(()=>{if(!g)return;let e=N.current,t=typeof e==`function`?e():e,n=(aY(t)?t.current:t)||null;n!==we.current&&(de.setPositionReference(n),we.current=n)},[g,de,M,N]),G.useEffect(()=>{if(!g)return;let e=N.current;typeof e!=`function`&&aY(e)&&e.current!==we.current&&(de.setPositionReference(e.current),we.current=e.current)},[g,de,M,N]),G.useEffect(()=>{if(m&&g&&W.reference&&W.floating)return JG(W.reference,W.floating,he,ue)},[m,g,W,he,ue]);let Te=MH(ge),Ee=tY(i,Te,F),De=NH(ge)||`center`,Oe=!!me.hide?.referenceHidden;Y(()=>{x&&g&&ve&&Te!==I&&w(Te)},[x,g,ve,Te,I]);let ke=G.useMemo(()=>({position:`absolute`,top:me.arrow?.y,left:me.arrow?.x}),[me.arrow]),Ae=me.arrow?.centerOffset!==0;return G.useMemo(()=>({positionerStyles:Ce,arrowStyles:ke,arrowRef:H,arrowUncentered:Ae,side:Ee,align:De,physicalSide:Te,anchorHidden:Oe,refs:de,context:_e,isPositioned:ve,update:he}),[Ce,ke,H,Ae,Ee,De,Te,Oe,de,_e,ve,he])}function aY(e){return e!=null&&`current`in e}var oY=G.createContext(void 0);function sY(){let e=G.useContext(oY);if(!e)throw Error(qz(59));return e}var cY=G.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 lY(e,t){e&&Object.assign(e.style,t)}var uY={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`};function dY(e){return e===`starting`?CW:cB}function fY(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),gW(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},dY(r),i],stateAttributesMapping:RV})}var pY={},mY={},hY=``;function gY(e,t){return vB(e)?e:t}function _Y(e,t,n){return/hidden|clip/.test(e.getComputedStyle(gY(t,n)).overflowY)}function vY(e){if(typeof document>`u`)return!1;let t=IB(e);return fB(t).innerWidth-t.documentElement.clientWidth>0}function yY(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=IB(e),n=t.documentElement,r=t.body,i=gY(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 bY(e){let t=IB(e),n=t.documentElement,r=t.body,i=gY(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 xY(e){let t=IB(e),n=t.documentElement,r=t.body,i=fB(n),a=0,o=0,s=!1,c=VB.create();if(rV&&(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,pY={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},hY=n.style.scrollBehavior,mY={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=gY(n,r);if(s=yY(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,pY),Object.assign(r.style,mY),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=hY)}function d(){u(),c.request(l)}l();let f=LB(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var SY=new class{lockCount=0;restore=null;timeoutLock=WB.create();timeoutUnlock=WB.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=IB(e),n=t.documentElement,r=t.body,i=fB(n);if(_Y(i,n,r)){let t=new i.MutationObserver(()=>{_Y(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=QB||!vY(e);this.restore=a?bY(e):xY(e)}};function CY(e=!0,t=null){Y(()=>{if(e)return SY.acquire(t)},[e,t])}var wY=20;function TY(e,t,n,r){let[i,a]=G.useState(!1);Y(()=>{if(!e||!t||n==null){a(!1);return}let r=IB(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-wY)},[e,t,n]),CY(e&&(!t||i),r)}var EY={position:`fixed`},DY=G.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=OW,style:_,...v}=e,y=Sq(),b=wq(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`modal`),w=y.useState(`value`),T=y.useState(`openMethod`),E=y.useState(`positionerElement`),D=y.useState(`triggerElement`),O=y.useState(`isItemEqualToValue`),k=y.useState(`transitionStatus`),A=G.useRef(null),j=G.useRef(null),[M,N]=G.useState(h),P=S&&M&&T!==`touch`;!S&&M!==h&&N(h),G.useImperativeHandle(y.context.alignItemWithTriggerActiveRef,()=>P),TY((P||C)&&x,T===`touch`,E,D);let F=rY({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??P,collisionAvoidance:g,keepMounted:!0}),I=P?`none`:F.side,L=P?EY:F.positionerStyles,R={open:x,side:I,align:F.align,anchorHidden:F.anchorHidden};Y(()=>{y.set(`popupSide`,F.side)},[y,F.side]);let z=fY(e,R,{styles:L,transitionStatus:k,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x}),ee=G.useRef(0),B=X(e=>{if(y.context.valuesRef.current.length===0)return;let t=ee.current;ee.current=e.size;let n=yH(eH);if(t!==0&&!y.state.multiple&&w!==null&&Uq(y.context.valuesRef.current,w,O)===-1){let e=y.context.initialValueRef.current,t=e!=null&&Uq(y.context.valuesRef.current,e,O)!==-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=>Uq(y.context.valuesRef.current,e,O)!==-1);e.length!==w.length&&(y.context.setValue(e,n),e.length===0&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null))}if(x&&P){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};lY(E,e),lY(y.context.popupRef.current,e)}}),V=G.useMemo(()=>({...F,side:I,alignItemWithTriggerActive:P,setControlledAlignItemWithTrigger:N,scrollUpArrowRef:A,scrollDownArrowRef:j}),[F,I,P,N]);return(0,Z.jsx)(FJ,{elementsRef:y.context.listRef,labelsRef:y.context.labelsRef,onMapChange:B,children:(0,Z.jsxs)(oY.Provider,{value:V,children:[S&&C&&(0,Z.jsx)(cY,{inert:MJ(!x),cutout:D}),z]})})}),OY=`base-ui-disable-scrollbar`,kY={className:OY,getElement(e){return(0,Z.jsx)(`style`,{nonce:e,href:OY,precedence:`base-ui:low`,children:`.${OY}{scrollbar-width:none}.${OY}::-webkit-scrollbar{display:none}`})}},AY=G.createContext(void 0);function jY(e){let t=G.useContext(AY);if(t===void 0&&!e)throw Error(qz(69));return t}var MY=`ArrowUp`,NY=`ArrowDown`,PY=`ArrowLeft`,FY=`ArrowRight`,IY=new Set([MY,NY,PY,FY,`Home`,`End`]),LY=[`Shift`,`Control`,`Alt`,`Meta`];function RY(e){return gB(e)&&e.tagName===`INPUT`}function zY(e){return!!(RY(e)&&e.selectionStart!=null||gB(e)&&e.tagName===`TEXTAREA`)}function BY(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=VY(e,t,`left`),a=HY(e),o=HY(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=VY(e,t,`top`),r=HY(e),i=HY(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 VY(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 HY(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 UY=G.createContext(void 0),WY={disableStyleElements:!1};function GY(){return G.useContext(UY)??WY}var KY=`--transform-origin`,qY={...RV,...TV},JY=G.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=Sq(),{multiple:c,readOnly:l,highlightItemOnHover:u}=Cq(),d=wq(),{side:f,align:p,alignItemWithTriggerActive:m,isPositioned:h,setControlledAlignItemWithTrigger:g}=sY(),_=jY(!0)!=null,v=UJ(),{nonce:y,disableStyleElements:b}=GY(),x=s.useState(`id`),S=s.useState(`open`),C=s.useState(`openMethod`),w=s.useState(`mounted`),T=s.useState(`popupProps`),E=s.useState(`transitionStatus`),D=s.useState(`triggerElement`),O=s.useState(`positionerElement`),k=s.useState(`listElement`),A=G.useRef(!1),j=G.useRef(!1),M=G.useRef({}),N=HB(),P=X(e=>{if(!O||!s.context.popupRef.current||!j.current)return;let t=O.style.top===`0px`,n=O.style.bottom===`0px`;if(A.current||!m||!t&&!n){s.context.handleScrollArrowVisibility(e);return}let r=ZY(O),i=QY(O.getBoundingClientRect().height,`y`,r),a=IB(O),o=fB(O),c=o.getComputedStyle(O),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=YY(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,h=XY(e),g=null,_=e=>{O.style.height=`${e}px`},v=t?h-p:p,y=Math.min(i+v,f);if(v<=1){let n=uJ(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?h:0,f-(i+n)<=1&&(A.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=uJ(g,0,XY(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(A.current=!0),s.context.handleScrollArrowVisibility(e)});G.useImperativeHandle(s.context.scrollHandlerRef,()=>P,[P]),yK({open:S,ref:s.context.popupRef,onComplete(){S&&s.context.onOpenChangeComplete(!0)}});let F={open:S,transitionStatus:E,side:f,align:p};Y(()=>{O&&s.context.popupRef.current&&!Object.keys(M.current).length&&(M.current={top:O.style.top||`0`,left:O.style.left||`0`,right:O.style.right,height:O.style.height,bottom:O.style.bottom,minHeight:O.style.minHeight,maxHeight:O.style.maxHeight,marginTop:O.style.marginTop,marginBottom:O.style.marginBottom})},[s,O]),Y(()=>{S||m||(j.current=!1,A.current=!1,lY(O,M.current))},[S,m,O]),Y(()=>{let e=s.context.popupRef.current;if(!S||!D||!O||!e||m&&!h||s.state.transitionStatus===`ending`)return;if(j.current=!0,e.style.removeProperty(KY),!m){N.request(()=>s.context.handleScrollArrowVisibility(k||e));return}let t=tX(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=fB(O),i=r.getComputedStyle(O),a=r.getComputedStyle(e),o=IB(D),c=ZY(D),l=$Y(D.getBoundingClientRect(),c),d=$Y(O.getBoundingClientRect(),c),f=l.height,p=k||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),_=parseFloat(i.marginTop)||10,y=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=YY(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,j=0;if(t&&n){let e=$Y(n.getBoundingClientRect(),c);T=$Y(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;j=T.top-d.top+T.height/2-r}let N=w+j+y+h,P=Math.min(S,N),F=S-_-y,I=N-P,L=C-5;O.style.left=`${uJ(E,5,L-d.width)}px`,O.style.height=`${P}px`,O.style.maxHeight=`none`,O.style.marginTop=`${_}px`,O.style.marginBottom=`${y}px`,e.style.height=`100%`;let R=XY(p),z=I>=R-1;z&&(P=Math.min(S,d.height)-(I-R));let ee=l.top<20||l.bottom>S-20||Math.ceil(P)+1<Math.min(m,b),B=(r.visualViewport?.scale??1)!==1&&rV;if(ee||B){lY(O,M.current),g(!1);return}let V=Math.max(b,P);if(z){let e=Math.max(0,S-N);O.style.top=d.height>=F?`0`:`${e}px`,O.style.height=`${P}px`,p.scrollTop=XY(p)}else O.style.bottom=`0`,p.scrollTop=I;if(T){let t=d.top,n=d.height,r=T.top+T.height/2,i=uJ(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(KY,`50% ${i}%`)}(V===S||P>=x)&&(A.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,O,D,m,g,N,k,u,v,h]),G.useEffect(()=>{if(!m||!O||!S)return;let e=fB(O);function t(e){s.context.setOpen(!1,yH(vH,e))}return LB(e,`resize`,t)},[s,m,O,S]);let I={...k?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":c||void 0,"aria-readonly":l||void 0,id:`${x}-list`},onKeyDown(e){_&&IY.has(e.key)&&e.stopPropagation()},onScroll(e){k||P(e.currentTarget)},...m&&{style:k?{height:`100%`}:uY},className:!k&&m?kY.className:void 0},L=gW(`div`,e,{ref:[t,s.context.popupRef],state:F,stateAttributesMapping:qY,props:[T,I,dY(E),o]});return(0,Z.jsxs)(G.Fragment,{children:[!b&&kY.getElement(y),(0,Z.jsx)(tG,{context:d,modal:!1,disabled:!w,openInteractionType:C,returnFocus:a,restoreFocus:!0,children:L})]})});function YY(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function XY(e){return dJ(e.scrollHeight,e.clientHeight)}function ZY(e){return GG.getScale(e)}function QY(e,t,n){return e/n[t]}function $Y(e,t){return XH({x:QY(e.x,`x`,t),y:QY(e.y,`y`,t),width:QY(e.width,`x`,t),height:QY(e.height,`y`,t)})}var eX=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function tX(e){let{style:t}=e,n={};for(let[e,r]of eX)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of eX){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}function nX(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=PJ(),u=G.useRef(-1),[d,f]=G.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=G.useRef(null),h=G.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 rX=G.createContext(void 0);function iX(){let e=G.useContext(rX);if(!e)throw Error(qz(57));return e}var aX=G.memo(G.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=G.useRef(null),d=nX({guess:!0,label:o,textRef:u}),f=Sq(),{itemProps:p,multiple:m,disabled:h,readOnly:g}=Cq(),_=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=G.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=Kq(C,a,f.context.valuesRef.current,e,S,t),r=n===C,C===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&Bq(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 T=G.useRef(`mouse`),E=G.useRef(!1),{getButtonProps:D,buttonRef:O}=SJ({disabled:_,focusableWhenDisabled:!0,native:c,composite:!0}),k={disabled:_,selected:b,highlighted:v};function A(e){if(h||g)return;let t=f.state.value;if(m){let n=Array.isArray(t)?t:[],r=b?qq(n,a,S):[...n,a];f.context.setValue(r,yH(aH,e))}else f.context.setValue(a,yH(aH,e)),f.context.setOpen(!1,yH(aH,e))}function j(){f.context.selectionRef.current.dragY=0}let M={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=T.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&cV(e.nativeEvent)&&(n!==void 0||v),i=t&&!r&&!E.current;E.current=!1,!(_||i)&&A(e.nativeEvent)},onPointerEnter(e){T.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){T.current=e.pointerType,E.current=!0,j()},onMouseUp(){if(j(),_||T.current===`touch`||E.current)return;let e=!f.context.selectionRef.current.allowSelectedMouseUp&&b,t=!f.context.selectionRef.current.allowUnselectedMouseUp&&!b;e||t||(E.current=!0,w.current?.click(),E.current=!1)}},N=gW(`div`,e,{ref:[O,t,d.ref,w],state:k,props:[p,M,l,D]}),P=G.useMemo(()=>({selected:b,index:C,textRef:u,selectedByFocus:x}),[b,C,u,x]);return(0,Z.jsx)(rX.Provider,{value:P,children:N})})),oX=G.memo(G.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=iX(),a=Sq(),{render:o,className:s,style:c,...l}=e;return gW(`div`,e,{ref:[G.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]),t,r],props:l})})),sX=e=>Symbol.iterator in e,cX=e=>`entries`in e,lX=(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},uX=(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 dX(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:sX(e)&&sX(t)?cX(e)&&cX(t)?lX(e,t):uX(e,t):lX({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function fX(e){let t=G.useRef(void 0);return n=>{let r=e(n);return dX(t.current,r)?t.current:t.current=r}}function pX(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=pX(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function mX(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=pX(e))&&(r&&(r+=` `),r+=t);return r}var hX=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},gX=(e,t)=>({classGroupId:e,validator:t}),_X=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),vX=`-`,yX=[],bX=`arbitrary..`,xX=e=>{let t=wX(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return CX(e);let n=e.split(vX);return SX(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?hX(i,t):t:i||yX}return n[e]||yX}}},SX=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=SX(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(vX):e.slice(t).join(vX),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},CX=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?bX+r:void 0})(),wX=e=>{let{theme:t,classGroups:n}=e;return TX(n,t)},TX=(e,t)=>{let n=_X();for(let r in e){let i=e[r];EX(i,n,r,t)}return n},EX=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];DX(i,t,n,r)}},DX=(e,t,n,r)=>{if(typeof e==`string`){OX(e,t,n);return}if(typeof e==`function`){kX(e,t,n,r);return}AX(e,t,n,r)},OX=(e,t,n)=>{let r=e===``?t:jX(t,e);r.classGroupId=n},kX=(e,t,n,r)=>{if(MX(e)){EX(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(gX(n,e))},AX=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];EX(o,jX(t,a),n,r)}},jX=(e,t)=>{let n=e,r=t.split(vX),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=_X(),n.nextPart.set(t,i)),n=i}return n},MX=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,NX=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},PX=`!`,FX=`:`,IX=[],LX=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),RX=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===FX){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(PX)?(c=s.slice(0,-1),l=!0):s.startsWith(PX)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return LX(t,l,c,u)};if(t){let e=t+FX,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):LX(IX,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},zX=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},BX=e=>({cache:NX(e.cacheSize),parseClassName:RX(e),sortModifiers:zX(e),postfixLookupClassGroupIds:VX(e),...xX(e)}),VX=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},HX=/\s+/,UX=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(HX),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+PX:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},WX=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=GX(n))&&(i&&(i+=` `),i+=r);return i},GX=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=GX(e[r]))&&(n&&(n+=` `),n+=t);return n},KX=(e,...t)=>{let n,r,i,a,o=o=>(n=BX(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=UX(e,n);return i(e,a),a};return a=o,(...e)=>a(WX(...e))},qX=[],JX=e=>{let t=t=>t[e]||qX;return t.isThemeGetter=!0,t.themeKey=e,t},YX=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,XX=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ZX=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,QX=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$X=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,eZ=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,tZ=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nZ=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,rZ=e=>ZX.test(e),iZ=e=>!!e&&!Number.isNaN(Number(e)),aZ=e=>!!e&&Number.isInteger(Number(e)),oZ=e=>e.endsWith(`%`)&&iZ(e.slice(0,-1)),sZ=e=>QX.test(e),cZ=()=>!0,lZ=e=>$X.test(e)&&!eZ.test(e),uZ=()=>!1,dZ=e=>tZ.test(e),fZ=e=>nZ.test(e),pZ=e=>!gZ(e)&&!wZ(e),mZ=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),hZ=e=>MZ(e,IZ,uZ),gZ=e=>YX.test(e),_Z=e=>MZ(e,LZ,lZ),vZ=e=>MZ(e,RZ,iZ),yZ=e=>MZ(e,BZ,cZ),bZ=e=>MZ(e,zZ,uZ),xZ=e=>MZ(e,PZ,uZ),SZ=e=>MZ(e,FZ,fZ),CZ=e=>MZ(e,VZ,dZ),wZ=e=>XX.test(e),TZ=e=>NZ(e,LZ),EZ=e=>NZ(e,zZ),DZ=e=>NZ(e,PZ),OZ=e=>NZ(e,IZ),kZ=e=>NZ(e,FZ),AZ=e=>NZ(e,VZ,!0),jZ=e=>NZ(e,BZ,!0),MZ=(e,t,n)=>{let r=YX.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},NZ=(e,t,n=!1)=>{let r=XX.exec(e);return r?r[1]?t(r[1]):n:!1},PZ=e=>e===`position`||e===`percentage`,FZ=e=>e===`image`||e===`url`,IZ=e=>e===`length`||e===`size`||e===`bg-size`,LZ=e=>e===`length`,RZ=e=>e===`number`,zZ=e=>e===`family-name`,BZ=e=>e===`number`||e===`weight`,VZ=e=>e===`shadow`,HZ=KX(()=>{let e=JX(`color`),t=JX(`font`),n=JX(`text`),r=JX(`font-weight`),i=JX(`tracking`),a=JX(`leading`),o=JX(`breakpoint`),s=JX(`container`),c=JX(`spacing`),l=JX(`radius`),u=JX(`shadow`),d=JX(`inset-shadow`),f=JX(`text-shadow`),p=JX(`drop-shadow`),m=JX(`blur`),h=JX(`perspective`),g=JX(`aspect`),_=JX(`ease`),v=JX(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),wZ,gZ],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[wZ,gZ,c],T=()=>[rZ,`full`,`auto`,...w()],E=()=>[aZ,`none`,`subgrid`,wZ,gZ],D=()=>[`auto`,{span:[`full`,aZ,wZ,gZ]},aZ,wZ,gZ],O=()=>[aZ,`auto`,wZ,gZ],k=()=>[`auto`,`min`,`max`,`fr`,wZ,gZ],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[rZ,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[s,rZ,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[rZ,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,wZ,gZ],L=()=>[...b(),DZ,xZ,{position:[wZ,gZ]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],z=()=>[`auto`,`cover`,`contain`,OZ,hZ,{size:[wZ,gZ]}],ee=()=>[oZ,TZ,_Z],B=()=>[``,`none`,`full`,l,wZ,gZ],V=()=>[``,iZ,TZ,_Z],te=()=>[`solid`,`dashed`,`dotted`,`double`],H=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ne=()=>[iZ,oZ,DZ,xZ],re=()=>[``,`none`,m,wZ,gZ],ie=()=>[`none`,iZ,wZ,gZ],ae=()=>[`none`,iZ,wZ,gZ],oe=()=>[iZ,wZ,gZ],se=()=>[rZ,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[sZ],breakpoint:[sZ],color:[cZ],container:[sZ],"drop-shadow":[sZ],ease:[`in`,`out`,`in-out`],font:[pZ],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[sZ],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[sZ],shadow:[sZ],spacing:[`px`,iZ],text:[sZ],"text-shadow":[sZ],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,rZ,gZ,wZ,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,wZ,gZ]}],"container-named":[mZ],columns:[{columns:[iZ,`auto`,gZ,wZ,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[aZ,`auto`,wZ,gZ]}],basis:[{basis:[rZ,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[iZ,rZ,`auto`,`initial`,`none`,gZ]}],grow:[{grow:[``,iZ,wZ,gZ]}],shrink:[{shrink:[``,iZ,wZ,gZ]}],order:[{order:[aZ,`first`,`last`,`none`,wZ,gZ]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...N()]}],"font-size":[{text:[`base`,n,TZ,_Z]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,jZ,yZ]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,oZ,gZ]}],"font-family":[{font:[EZ,bZ,t]}],"font-features":[{"font-features":[gZ]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,wZ,gZ]}],"line-clamp":[{"line-clamp":[iZ,`none`,wZ,vZ]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,wZ,gZ]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,wZ,gZ]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...te(),`wavy`]}],"text-decoration-thickness":[{decoration:[iZ,`from-font`,`auto`,wZ,_Z]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[iZ,`auto`,wZ,gZ]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[aZ,wZ,gZ]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,wZ,gZ]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,wZ,gZ]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:z()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},aZ,wZ,gZ],radial:[``,wZ,gZ],conic:[``,aZ,wZ,gZ]},kZ,SZ]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-bs":[{"border-bs":V()}],"border-w-be":[{"border-be":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":V()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...te(),`hidden`,`none`]}],"divide-style":[{divide:[...te(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...te(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[iZ,wZ,gZ]}],"outline-w":[{outline:[``,iZ,TZ,_Z]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`inner`,`none`,u,AZ,CZ]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,AZ,CZ]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:V()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[iZ,_Z]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,AZ,CZ]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[iZ,wZ,gZ]}],"mix-blend":[{"mix-blend":[...H(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":H()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[iZ]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[wZ,gZ]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[iZ]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,wZ,gZ]}],filter:[{filter:[``,`none`,wZ,gZ]}],blur:[{blur:re()}],brightness:[{brightness:[iZ,wZ,gZ]}],contrast:[{contrast:[iZ,wZ,gZ]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,AZ,CZ]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,iZ,wZ,gZ]}],"hue-rotate":[{"hue-rotate":[iZ,wZ,gZ]}],invert:[{invert:[``,iZ,wZ,gZ]}],saturate:[{saturate:[iZ,wZ,gZ]}],sepia:[{sepia:[``,iZ,wZ,gZ]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,wZ,gZ]}],"backdrop-blur":[{"backdrop-blur":re()}],"backdrop-brightness":[{"backdrop-brightness":[iZ,wZ,gZ]}],"backdrop-contrast":[{"backdrop-contrast":[iZ,wZ,gZ]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,iZ,wZ,gZ]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[iZ,wZ,gZ]}],"backdrop-invert":[{"backdrop-invert":[``,iZ,wZ,gZ]}],"backdrop-opacity":[{"backdrop-opacity":[iZ,wZ,gZ]}],"backdrop-saturate":[{"backdrop-saturate":[iZ,wZ,gZ]}],"backdrop-sepia":[{"backdrop-sepia":[``,iZ,wZ,gZ]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,wZ,gZ]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[iZ,`initial`,wZ,gZ]}],ease:[{ease:[`linear`,`initial`,_,wZ,gZ]}],delay:[{delay:[iZ,wZ,gZ]}],animate:[{animate:[`none`,v,wZ,gZ]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,wZ,gZ]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":[`scale-3d`],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[wZ,gZ,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:se()}],"translate-x":[{"translate-x":se()}],"translate-y":[{"translate-y":se()}],"translate-z":[{"translate-z":se()}],"translate-none":[`translate-none`],zoom:[{zoom:[aZ,wZ,gZ]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,wZ,gZ]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,wZ,gZ]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[iZ,TZ,_Z,vZ]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function UZ(e){return gW(e.defaultTagName??`div`,e,e)}var WZ=G.createContext(void 0);function GZ(){return G.useContext(WZ)}function KZ(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=yJ(),{ref:i,index:a}=nX(e),o=n===a,s=G.useRef(null),c=zz(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 qZ(e){let{render:t,className:n,style:r,state:i=cB,props:a=sB,refs:o=sB,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=KZ({metadata:s});return gW(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}var JZ=G.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=Pq(u||void 0),h=GZ(),g=h?.value??[],_=(i||h?.disabled)??!1,[v,y]=Uz({controlled:h?m!==void 0&&g.indexOf(m)>-1:s,default:r,name:`Toggle`,state:`pressed`}),{getButtonProps:b,buttonRef:x}=SJ({disabled:_,native:d}),S={disabled:_,pressed:v},C=[x,t],w=[{"aria-pressed":v,onClick(e){let t=!v,n=yH(eH,e.nativeEvent);o?.(t,n),!n.isCanceled&&(m&&h?.setGroupValue?.(m,t,n),!n.isCanceled&&y(t))}},p,b],T=gW(`button`,e,{enabled:!h,state:S,ref:C,props:w}),E=G.useMemo(()=>({disabled:_,focusableWhenDisabled:!1}),[_]);return h?(0,Z.jsx)(qZ,{tag:`button`,render:c,className:n,style:f,metadata:E,state:S,refs:C,props:w}):T}),YZ=`data-composite-item-active`;function XZ(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=sB}=e,[p,m]=G.useState(0),h=r!=null,g=G.useRef(null),_=zz(g,c),v=G.useRef([]),y=G.useRef(!1),b=G.useRef(null),x=o??p,S=X((e,t=!1)=>{if(b.current=v.current[e]??null,(s??m)(e),t){let t=v.current[e];BY(g.current,t,a,n)}}),C=X(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||tU(e,x,d)?S(ZZ(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(tU(t,x,d)){let e=eU(t,{disabledIndices:d});ZH(t,e)||S(e)}BY(g.current,r,a,n)});Y(()=>{if(d==null||o!=null||!y.current)return;let e=v.current;if(tU(e,x,d)){let t=eU(e,{disabledIndices:d});ZH(e,t)||S(t)}},[d,o,x,v,S]);let w=X((e,t,n)=>i?i(e,t,n,v):n),T=X(e=>{let o=e.key===`Home`||e.key===`End`;if(!IY.has(e.key)||!l&&o||QZ(e,f)||!g.current)return;let s=a===`rtl`,c=s?PY:FY,p=s?FY:PY,m=n===`vertical`?NY:c,_=n===`vertical`?MY:p,y=mV(e.nativeEvent);if(y!=null&&zY(y)&&!Hz(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=QH(v,d),T=$H(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=eU(v.current,{startingIndex:b,decrement:D,disabledIndices:d})),b!==x&&!ZH(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=mV(e.nativeEvent);t&&n!=null&&zY(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:T},highlightedIndex:x,onHighlightedIndexChange:S,elementsRef:v,onMapChange:C,relayKeyboardEvent:T}}function ZZ(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!tU(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function QZ(e,t){for(let n of LY)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function $Z(e){let{render:t,className:n,style:r,refs:i=sB,props:a=sB,state:o=cB,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:T,elementsRef:E,onMapChange:D,relayKeyboardEvent:O}=XZ({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:UJ(),disabledIndices:v,modifierKeys:y}),k=gW(x,e,{state:o,ref:i,props:[C,...a,S],stateAttributesMapping:s}),A=G.useMemo(()=>({highlightedIndex:w,onHighlightedIndexChange:T,highlightItemOnHover:b,relayKeyboardEvent:O}),[w,T,b,O]);return(0,Z.jsx)(vJ.Provider,{value:A,children:(0,Z.jsx)(FJ,{elementsRef:E,onMapChange:e=>{h?.(e),D(e)},children:k})})}var eQ=G.createContext(void 0);function tQ(){return G.useContext(eQ)}var nQ=G.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=jY(!0),m=tQ(),h=n??sB,g=c!==void 0||n!==void 0,_=(p?.disabled??!1)||(m?.disabled??!1)||r,[v,y]=Uz({controlled:c,default:h,name:`ToggleGroup`,state:`value`}),b=X((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=G.useMemo(()=>({disabled:_,setGroupValue:b,value:v,isValueInitialized:g}),[_,b,v,g]),C={role:`group`},w=gW(`div`,e,{enabled:!!p,state:x,ref:t,props:[C,f]});return(0,Z.jsx)(WZ.Provider,{value:S,children:p?w:(0,Z.jsx)($Z,{render:u,className:l,style:d,state:x,refs:[t],props:[C,f],loopFocus:i,enableHomeAndEndKeys:!0,orientation:o})})}),rQ=G.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=SJ({disabled:i,focusableWhenDisabled:a,native:o});return gW(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),iQ=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,aQ=mX,oQ=(e,t)=>n=>{if(t?.variants==null)return aQ(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=iQ(t)||iQ(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return aQ(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},sQ=G.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFocused:y,setFilled:b,validationMode:x,validation:S}=Mq(),{clearErrors:C,elementRef:w,submitCountRef:T}=aJ(),E=h||s,D=m??a,O={...p,disabled:E},{labelId:k}=Iq(),A=Lq({id:i}),[j]=Uz({controlled:o,default:l,name:`FieldControl`,state:`value`}),M=o!==void 0,N=M?j:void 0,P=N==null?void 0:String(N),F=X(()=>S.inputRef.current?.value);Nq(S.inputRef,A,P,F,!E,a),Y(()=>{let e=P??S.inputRef.current?.value;e!==void 0&&b(e!==``)},[P,S.inputRef,b]),oJ(P,()=>{P!==void 0&&(C(D),_(P!==(v.initialValue??``)),S.change(P))});let I=G.useRef(null),L=GB();return Y(()=>{u&&I.current===fV(IB(I.current))&&y(!0)},[u,y]),gW(`input`,e,{ref:[t,I],state:O,props:[{id:A,disabled:E,name:D,ref:S.inputRef,"aria-labelledby":k,autoFocus:u,...M?{value:N}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=yH(eH,e.nativeEvent);c?.(t,n),!M&&(_(t!==(v.initialValue??``)),b(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(C(D),S.change(t)))},onFocus(){y(!0)},onBlur(e){if(g(!0),y(!1),x===`onBlur`){let t=e.currentTarget.value;S.commit(t),M&&queueMicrotask(()=>{let e=S.inputRef.current?.value;e!==void 0&&e!==t&&e!==(v.initialValue??``)&&S.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){g(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===w.current&&!e.defaultPrevented){let t=e.currentTarget,n=T.current;L.start(0,()=>{T.current===n&&S.commit(t.value)})}else S.commit(t)}}},f,e=>S.getValidationProps(E,e)],stateAttributesMapping:kq})}),cQ=G.forwardRef(function(e,t){return(0,Z.jsx)(sQ,{ref:t,...e})}),lQ=G.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return gW(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})}),uQ=G.createContext(void 0);function dQ(e){let t=G.useContext(uQ);if(t===void 0&&!e)throw Error(qz(72));return t}var fQ={...VK,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},pQ=class extends lB{constructor(e,t,n){let r=new PK;super(mQ(e,r,t,n),hQ(r),fQ)}setOpen=(e,t)=>{OK(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,yH(tH,e))}};function mQ(e,t,n,r=!1){return{...FK(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 hQ(e){return{popupRef:G.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var gQ=Qz(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=SK((e,t)=>new pQ({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}),AK(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=jK(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=G.useRef(null);Y(()=>{m&&t&&p.setOpen(!1,yH(pH))},[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]),G.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,yH(gH))}),[y,p]);let T=h||_||!t&&a!==`none`;return(0,Z.jsxs)(uQ.Provider,{value:p,children:[l&&(0,Z.jsx)(CK,{handle:l,store:p}),T&&(0,Z.jsx)(_Q,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function _Q({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=cG(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=aG(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=G.useMemo(()=>nW(a.reference,i.reference),[a.reference,i.reference]);return MK(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??cB}),null}var vQ=G.createContext(void 0);function yQ(){return G.useContext(vQ)}var bQ=`data-base-ui-tooltip-trigger`;function xQ(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(hB(n))return n}}let t=e.target;return hB(t)?t:null}function SQ(e){let t=e;for(;t;){let e=t.closest(`[${bQ}]`);if(e)return e;let n=t.getRootNode();t=`host`in n&&hB(n.host)?n.host:null}return null}var CQ=$z(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=dQ(!0),m=HK(a)??p;if(!m)throw Error(qz(82));let h=Pq(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=G.useRef(null),b=u??0,{registerTrigger:x,isMountedByThisTrigger:S}=kK(h,y,m,{payload:o,closeOnClick:l,closeDelay:b}),C=yQ(),{activeIdRef:w,delayRef:T,isInstantPhase:E,hasProvider:D}=SH(v,{open:_}),O=QK(v);m.useSyncedValue(`isInstantPhase`,E);let k=m.useState(`disabled`),A=s??k,j=Kz(A),M=m.useState(`trackCursorAxis`),N=m.useState(`disableHoverablePopup`),P=G.useRef(!1),F=GB(),I=G.useRef(void 0);function L(){return D&&w.current!=null?0:c??C??600}function R(e){let t=y.current;if(!t||!e)return!1;let n=SQ(e);return n!==null&&n!==t&&pV(t,n)}function z(e){let t=R(e);return P.current=t,t&&(O.openChangeTimeout.clear(),O.restTimeout.clear(),O.restTimeoutPending=!1,F.clear()),t}let ee=tq(v,{enabled:!A,mouseOnly:!0,move:!1,handleClose:!N&&M!==`both`?vq():null,restMs:L,delay(){return u==null&&D?{close:XV(T.current,`close`)}:{close:b}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!P.current}}),B=qK(v,{enabled:!A}).reference,V=e=>{let t=P.current,n=xQ(e),r=z(n),i=y.current,a=i&&n&&pV(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,yH(nH,e));return}if(t&&!r&&a&&!j.current&&!m.select(`open`)&&i&&uV(I.current)){let t=()=>{!P.current&&!j.current&&!m.select(`open`)&&m.setOpen(!0,yH(nH,e,i))},n=L();n===0?(F.clear(),t()):F.start(n,t)}},te=m.useState(`triggerProps`,S);return gW(`button`,e,{state:{open:_},ref:[t,x,y],props:[ee,B,S||M!==`none`?te:void 0,{onMouseOver(e){V(e.nativeEvent)},onFocus(e){R(xQ(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){P.current=!1,F.clear(),I.current=void 0},onPointerEnter(e){I.current=e.pointerType},onPointerDown(e){I.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,[BV]:A?``:void 0,[bQ]:A?void 0:``},f],stateAttributesMapping:IV})}),wQ=G.createContext(void 0);function TQ(){let e=G.useContext(wQ);if(e===void 0)throw Error(qz(70));return e}var EQ=G.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=FW({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,Z.jsxs)(G.Fragment,{children:[l,c&&jW.createPortal(n,c)]})}),DQ=G.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return dQ().useState(`mounted`)||n?(0,Z.jsx)(wQ.Provider,{value:n,children:(0,Z.jsx)(EQ,{ref:t,...r})}):null}),OQ=G.createContext(void 0);function kQ(){let e=G.useContext(OQ);if(e===void 0)throw Error(qz(71));return e}var AQ=G.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=kW,style:g,..._}=e,v=dQ(),y=TQ(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),D=rY({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`)}),O=fY(e,G.useMemo(()=>({open:b,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,D.side,D.align,D.anchorHidden,S,T]),{styles:D.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,Z.jsx)(OQ.Provider,{value:D,children:O})}),jQ=G.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=dQ(),{side:s,align:c}=kQ(),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`);yK({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),$K(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return gW(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[bK,f,dY(d),a],stateAttributesMapping:zV})}),MQ=G.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=dQ(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=kQ();return gW(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:RV})});function NQ(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,disabled:i}=e,[a,o]=Uz({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=hK(a,!0,!0),u=Pq(),[d,f]=G.useState(),p=d===null?void 0:d??u,m=X(e=>{let t=!a,n=yH(tH,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return G.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 PQ=G.createContext(void 0);function FQ(){let e=G.useContext(PQ);if(e===void 0)throw Error(qz(15));return e}var IQ=`data-open`,LQ=`data-closed`,RQ=xV,zQ=`data-panel-open`,BQ={[IQ]:``},VQ={[LQ]:``},HQ={open(e){return e?{[zQ]:``}:null}},UQ={open(e){return e?BQ:VQ},...TV},WQ=G.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=X(o),d=NQ({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=G.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=G.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=gW(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:UQ});return(0,Z.jsx)(PQ.Provider,{value:p,children:m})}),GQ={...HQ,...TV},KQ=G.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=FQ(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:d,...f}=e,{getButtonProps:p,buttonRef:m}=SJ({disabled:c,focusableWhenDisabled:!0,native:u});return gW(`button`,e,{state:a,ref:[t,m],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},f,p],stateAttributesMapping:GQ})}),qQ={height:void 0,width:void 0};function JQ(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,d=G.useRef(null),f=G.useRef(null),[p,m]=G.useState(qQ),h=G.useRef(qQ),g=G.useRef(!1),_=G.useRef(s),v=G.useRef(!1),[y,b]=G.useState(!1),x=G.useRef(null),S=zz(t,d),C=Kz(s),w=vK(d),T=!s&&!a,E=y?`idle`:u,D=s&&(_.current||v.current),O=!s&&a&&f.current===`css-animation`&&p.height===void 0&&p.width===void 0?h.current:p,k=n&&T&&f.current!==`css-animation`,A=X((e,t=!0)=>{t&&(h.current=e),m(e)}),j=X(()=>{x.current?.(),x.current=null}),M=X(e=>{j(),x.current=()=>{x.current=null,e()}}),N=X(()=>{s&&a&&f.current===`css-animation`&&(v.current=!0)});Y(()=>{y&&u!==`starting`&&b(!1)},[y,u]),G.useEffect(()=>()=>{N(),j()},[N,j]),Y(()=>{let e=d.current;if(!e)return;!s&&x.current&&j();let t=XQ(e,D);if(f.current=t,s&&u===`idle`&&_.current&&t===`css-animation`){h.current=YQ(e);return}if(s&&u===`starting`){let n=g.current;if(g.current=!1,t===`none`){A(YQ(e)),b(!0);return}if(t===`css-transition`){let t=$Q(e);if(A(YQ(e)),!n)return t;let r=QQ(e,`transition-duration`,`0s`);return M(r),b(!0),t}A(YQ(e));let r=QQ(e,`animation-name`,`none`);if(!n){r();return}let i=QQ(e,`animation-duration`,`0s`);r(),M(i),b(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(_.current=!1,v.current=!1,t===`none`){A(qQ,!1),c(!1);return}A(YQ(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=YQ(e);if(!(n.height>0||n.width>0)){c(!1);return}A(n),t===`css-animation`&&QQ(e,`animation-name`,`none`)()},[a,s,j,A,c,M,D,u]),yK({enabled:s&&a&&E===`idle`,open:!0,ref:d,onComplete(){s&&A(qQ,!1)}}),G.useEffect(()=>{if(s||!a||E!==`ending`||!d.current)return;let e=new AbortController,t=-1;function n(){C.current||(c(!1),A(qQ,!1))}return t=VB.request(()=>{w(n,e.signal)}),()=>{VB.cancel(t),e.abort()}},[C,a,s,E,w,A,c]),Y(()=>{let e=d.current;e&&n&&T&&e.setAttribute(`hidden`,`until-found`)},[T,n]),G.useEffect(function(){let e=d.current;if(!e)return;function t(e){let t=yH(eH,e);o(!0,t),!t.isCanceled&&(g.current=!0,l(!0))}return LB(e,`beforematch`,t)},[o,l]);let P=i||n||a||s;return{height:O.height,props:{...k?{[RQ]:``}:void 0,hidden:T,id:r},ref:S,shouldPreventOpenAnimation:D,shouldRender:P,transitionStatus:E,width:O.width}}function YQ(e){return{height:e.scrollHeight,width:e.scrollWidth}}function XQ(e,t){let n=fB(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&ZQ(n.animationDuration),i=ZQ(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function ZQ(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function QQ(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 $Q(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=VB.request(n);return()=>{VB.cancel(r),n()}}var e$=`--collapsible-panel-height`,t$=`--collapsible-panel-width`,n$=G.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:_}=FQ(),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}=JQ({externalRef:t,hiddenUntilFound:v,id:x,keepMounted:y,mounted:u,onOpenChange:d,open:f,setMounted:p,setOpen:h,transitionStatus:_}),k={...g,transitionStatus:D},A=eW(s,k),j=gW(`div`,{...e,style:void 0},{state:k,ref:w,props:[C,{style:{[e$]:S===void 0?`auto`:`${S}px`,[t$]:O===void 0?`auto`:`${O}px`}},c,A?{style:A}:void 0,T?{style:{animationName:`none`}}:void 0],stateAttributesMapping:UQ});return E?j:null}),r$=G.createContext(void 0);function i$(){let e=G.useContext(r$);if(e===void 0)throw Error(qz(53));return e}function a$(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 o$=`data-has-overflow-x`,s$=`data-has-overflow-y`,c$=`data-overflow-x-start`,l$=`data-overflow-x-end`,u$=`data-overflow-y-start`,d$=`data-overflow-y-end`,f$=e=>t=>t?{[e]:``}:null,p$={hasOverflowX:f$(o$),hasOverflowY:f$(s$),overflowXStart:f$(c$),overflowXEnd:f$(l$),overflowYStart:f$(u$),overflowYEnd:f$(d$),cornerHidden:()=>null},m$=`--scroll-area-corner-height`,h$=`--scroll-area-corner-width`,g$=`data-orientation`,_$={x:0,y:0},v$={width:0,height:0},y$={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},b$={x:!0,y:!0,corner:!0},x$=G.forwardRef(function(e,t){let{render:n,className:r,overflowEdgeThreshold:i,style:a,...o}=e,{xStart:s,xEnd:c,yStart:l,yEnd:u}=S$(i),d=Pq(),f=GB(),p=GB(),{nonce:m,disableStyleElements:h}=GY(),[g,_]=G.useState(!1),[v,y]=G.useState(!1),[b,x]=G.useState(!1),[S,C]=G.useState(!1),[w,T]=G.useState(!1),[E,D]=G.useState(v$),[O,k]=G.useState(v$),[A,j]=G.useState(y$),[M,N]=G.useState(b$),P=G.useRef(null),F=G.useRef(null),I=G.useRef(null),L=G.useRef(null),R=G.useRef(null),z=G.useRef(null),ee=G.useRef(null),B=G.useRef(null),V=G.useRef(0),te=G.useRef(0),H=G.useRef(0),ne=G.useRef(0),re=G.useRef(`vertical`),ie=G.useRef(_$),ae=G.useRef(null);function oe(e){let t=e?x:y,n=e?f:p;t(!0),n.start(500,()=>{t(!1)})}let se=X(e=>{let t=e.x-ie.current.x,n=e.y-ie.current.y;ie.current=e,n!==0&&oe(!0),t!==0&&oe(!1)}),U=X(()=>{let e=F.current;e&&ae.current===null&&(ae.current=e.style.scrollSnapType,e.style.scrollSnapType=`none`)}),ce=X(e=>{if(e.button!==0||B.current!==null&&(re.current===`vertical`?R.current:z.current)?.hasPointerCapture(B.current))return;B.current=e.pointerId,V.current=e.clientY,te.current=e.clientX,re.current=e.currentTarget.getAttribute(g$);let t=F.current;t&&(H.current=t.scrollTop,ne.current=t.scrollLeft,U()),(re.current===`vertical`?R.current:z.current)?.setPointerCapture(e.pointerId)}),le=X(e=>{if(e.pointerId!==B.current)return;B.current=null,(re.current===`vertical`?x:y)(!1),ae.current!==null&&(F.current&&(F.current.style.scrollSnapType=ae.current),ae.current=null);let t=re.current===`vertical`?R.current:z.current;t?.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId)}),ue=X(e=>{if(e.pointerId!==B.current)return;if(e.buttons%2==0){le(e);return}let t=F.current;if(!t)return;let n=re.current===`vertical`,r=n?R.current:z.current,i=n?I.current:L.current;if(!r||!i)return;let a=n?`y`:`x`,o=a$(i,`padding`,a),s=a$(r,`margin`,a),c=n?r.offsetHeight:r.offsetWidth,l=(n?i.offsetHeight:i.offsetWidth)-c-o-s,u=n?e.clientY-V.current:e.clientX-te.current,d=l<=0?0:u/l,f=n?t.scrollHeight:t.scrollWidth,p=n?t.clientHeight:t.clientWidth,m=(n?H.current:ne.current)+d*(f-p);n?t.scrollTop=m:t.scrollLeft=m,e.preventDefault(),oe(n)});function de(e){C(e.pointerType===`touch`)}function W(e){if(de(e),e.pointerType!==`touch`){let t=pV(P.current,e.target);_(t)}}let fe=G.useMemo(()=>({scrolling:v||b,hasOverflowX:!M.x,hasOverflowY:!M.y,overflowXStart:A.xStart,overflowXEnd:A.xEnd,overflowYStart:A.yStart,overflowYEnd:A.yEnd,cornerHidden:M.corner}),[v,b,M.x,M.y,M.corner,A]),pe={role:`presentation`,onPointerEnter:W,onPointerMove:W,onPointerDown:de,onPointerLeave(){_(!1)},style:{position:`relative`,[m$]:`${E.height}px`,[h$]:`${E.width}px`}},me=gW(`div`,e,{state:fe,ref:[t,P],props:[pe,o],stateAttributesMapping:p$}),he=G.useMemo(()=>({handlePointerDown:ce,handlePointerMove:ue,handlePointerUp:le,handleScroll:se,disableViewportSnap:U,cornerSize:E,setCornerSize:D,thumbSize:O,setThumbSize:k,hasMeasuredScrollbar:w,setHasMeasuredScrollbar:T,touchModality:S,cornerRef:ee,scrollingX:v,scrollingY:b,hovering:g,setHovering:_,viewportRef:F,scrollbarYRef:I,scrollbarXRef:L,thumbYRef:R,thumbXRef:z,rootId:d,hiddenState:M,setHiddenState:N,overflowEdges:A,setOverflowEdges:j,viewportState:fe,overflowEdgeThreshold:{xStart:s,xEnd:c,yStart:l,yEnd:u}}),[ce,ue,le,se,U,E,O,w,S,v,b,g,d,M,A,fe,s,c,l,u]);return(0,Z.jsxs)(r$.Provider,{value:he,children:[!h&&kY.getElement(m),me]})});function S$(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 C$=G.createContext(void 0),w$=`--scroll-area-overflow-x-start`,T$=`--scroll-area-overflow-x-end`,E$=`--scroll-area-overflow-y-start`,D$=`--scroll-area-overflow-y-end`,O$=`--scroll-area-thumb-height`,k$=`--scroll-area-thumb-width`,A$=[w$,T$,E$,D$],j$=!1;function M$(){j$||rV||(typeof CSS<`u`&&`registerProperty`in CSS&&A$.forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),j$=!0)}var N$=G.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}=i$(),T=UJ(),E=G.useRef(!0),D=G.useRef([NaN,NaN,NaN,NaN]),O=GB(),k=GB(),A=X(()=>{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,E=D.current,O=Number.isNaN(E[0]);if(E[0]=y,E[1]=h,E[2]=b,E[3]=_,O&&v(!0),h===0||_===0)return;let k=P$(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=fJ(T===`rtl`?-w:w,P),L=P-I);let R=A?0:fJ(x,F),z=A?0:F-R,ee=j?0:b,B=A?0:y,V=0,te=0;!j&&!A&&(V=t?.offsetWidth||0,te=n?.offsetHeight||0);let H=f.width===0&&f.height===0,ne=H?V:0,re=H?te:0,ie=a$(n,`padding`,`x`),ae=a$(t,`padding`,`y`),oe=a$(i,`margin`,`x`),se=a$(r,`margin`,`y`),U=ee-ie-oe,ce=B-ae-se,le=n?Math.min(n.offsetWidth-ne,U):U,ue=t?Math.min(t.offsetHeight-re,ce):ce,de=Math.max(16,le*M),W=Math.max(16,ue*N);if(m(e=>F$(e,{width:de,height:W})),t&&r){let e=I$(r,O$,x,F,h,W,t.offsetHeight-W-ae-se);r.style.transform=`translate3d(0,${e}px,0)`}if(n&&i){let e=n.offsetWidth-de-ie-oe,t=I$(i,k$,T===`rtl`?-w:w,P,_,de,e);i.style.transform=`translate3d(${T===`rtl`?-t:t}px,0,0)`}let fe=[I,L,R,z];A$.forEach((t,n)=>{e.style.setProperty(t,`${fe[n]}px`)}),a&&p(e=>F$(e,{width:V,height:te})),g(e=>F$(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=>F$(e,pe))});Y(()=>{M$()},[]),Y(()=>{queueMicrotask(A)},[A,_,T,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=D.current;if(n[0]===e.clientHeight&&n[1]===e.scrollHeight&&n[2]===e.clientWidth&&n[3]===e.scrollWidth)return}A()});return n.observe(e),k.start(0,()=>{let t=e.getAnimations({subtree:!0});t.length!==0&&Promise.allSettled(t.map(e=>e.finished)).then(A).catch(()=>{})}),()=>{n.disconnect(),k.clear()}},[A,o,k]);function j(){E.current=!1}let M={role:`presentation`,...h&&{"data-id":`${h}-viewport`},tabIndex:_.x&&_.y?-1:0,className:kY.className,style:{overflow:`scroll`},onScroll(){o.current&&(A(),(b||!E.current)&&y({x:o.current.scrollLeft,y:o.current.scrollTop}),O.start(100,()=>{E.current=!0}))},onWheel:j,onPointerMove:j,onPointerEnter:j,onKeyDown:j},N=gW(`div`,e,{ref:[t,o],state:w,props:[M,a],stateAttributesMapping:p$}),P=G.useMemo(()=>({computeThumbPosition:A}),[A]);return(0,Z.jsx)(C$.Provider,{value:P,children:N})});function P$(e){let t=e.clientHeight>=e.scrollHeight,n=e.clientWidth>=e.scrollWidth;return{y:t,x:n,corner:t||n}}function F$(e,t){for(let n in t)if(e[n]!==t[n])return t;return e}function I$(e,t,n,r,i,a,o){let s=uJ(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 L$=G.createContext(void 0);function R$(){let e=G.useContext(L$);if(e===void 0)throw Error(qz(54));return e}var z$=G.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}=i$(),T=i===`vertical`,E={...w,hovering:c,scrolling:T?u:l,orientation:i},D=UJ(),O=!C&&!a,k=T?d.y:d.x,A=a||!k;G.useEffect(()=>{if(!A)return;let e=m.current,t=T?f.current:p.current;if(!t)return;function n(t){if(!e||t.ctrlKey)return;let n=!T,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&&D===`rtl`?-a:0,s=n&&D===`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 LB(t,`wheel`,n,{passive:!1})},[D,y,T,p,f,A,m]);let j={...x&&{"data-id":`${x}-scrollbar`},"aria-hidden":!0,onPointerDown(e){if(e.button!==0)return;let t=mV(e.nativeEvent),n=T?h.current:g.current;if(n&&pV(n,t))return;let r=m.current;if(!r)return;let i=T?f.current:p.current;if(!n||!i)return;let a=T?`y`:`x`,o=a$(n,`margin`,a),s=a$(i,`padding`,a),c=T?n.offsetHeight:n.offsetWidth,l=i.getBoundingClientRect(),u=T?e.clientY-l.top-c/2-s+o/2:e.clientX-l.left-c/2-s+o/2,d=T?r.scrollHeight:r.scrollWidth,v=T?r.clientHeight:r.clientWidth,x=(T?i.offsetHeight:i.offsetWidth)-c-s-o;if(x<=0)return;let S=u/x,C=d-v;b(),T?r.scrollTop=S*C:r.scrollLeft=D===`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:O?`hidden`:void 0,...T?{top:0,bottom:`var(${m$})`,insetInlineEnd:0,[O$]:`${S.height}px`}:{insetInlineStart:0,insetInlineEnd:`var(${h$})`,bottom:0,[k$]:`${S.width}px`}}},M=gW(`div`,e,{ref:[t,T?f:p],state:E,props:[j,s],stateAttributesMapping:p$});return A?(0,Z.jsx)(L$.Provider,{value:i,children:M}):null}),B$=G.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}=i$(),m=R$(),h=m===`vertical`;return gW(`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]})}),V$=G.createContext(void 0);function H$(e){let t=G.useContext(V$);if(!e&&t===void 0)throw Error(qz(27));return t}var U$=G.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=H$(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return gW(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:zV,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),W$=G.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=H$(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=SJ({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,yH(oH,e.nativeEvent))}return gW(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),G$=G.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=H$(),c=Pq(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),gW(`p`,e,{ref:t,props:[{id:c},o]})}),K$=G.createContext(void 0);function q$(){let e=G.useContext(K$);if(e===void 0)throw Error(qz(26));return e}var J$=`--nested-dialogs`,Y$=`data-nested-dialog-open`,X$={...RV,...TV,nestedDialogOpen(e){return e?{[Y$]:``}:null}},Z$=G.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=H$(),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`);q$(),yK({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?xK(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=gW(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...bK,hidden:!m,onKeyDown(e){IY.has(e.key)&&e.stopPropagation()},style:{[J$]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:X$});return(0,Z.jsx)(tG,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),Q$=G.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=H$(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,Z.jsx)(K$.Provider,{value:n,children:(0,Z.jsxs)(IW,{ref:t,...r,children:[a&&o===!0&&(0,Z.jsx)(cY,{ref:i.context.internalBackdropRef,inert:MJ(!s)}),e.children]})}):null});function $$({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]=G.useState(0),[u,d]=G.useState(0),f=c===0,p=cG(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=mV(t);if(f&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||pV(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:f});return CY(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]),MK(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:u}),null}var e1={...VK,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},t1=class extends lB{constructor(e,t,n){let r=new PK,i=n1(e,r,t,n);super(i,r1(r),e1)}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(EK(this.state,e,t.trigger)))}};function n1(e,t,n,r=!1){return{...FK(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 r1(e){return{popupRef:G.createRef(),backdropRef:G.createRef(),internalBackdropRef:G.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function i1(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=H$(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=SK((e,t)=>new t1({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`);NK(b,x),AK(b);let{forceUnmount:w}=jK(x,b);G.useImperativeHandle(l,()=>({unmount:w,close:()=>b.setOpen(!1,yH(gH))}),[w,b]);let T=x||S;return(0,Z.jsxs)(V$.Provider,{value:b,children:[u&&(0,Z.jsx)(CK,{handle:u,store:b}),T&&(0,Z.jsx)($$,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:C}):n]})}var a1=Qz(function(e){return i1(`dialog`,e)}),o1=G.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=q$(),c=H$(),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 gW(`div`,e,{enabled:s||p,state:{open:l,nested:u,transitionStatus:d,nestedDialogOpen:f>0},ref:[t,m],stateAttributesMapping:X$,props:[{role:`presentation`,hidden:!p,style:{pointerEvents:l?void 0:`none`},children:a},o]})}),s1=G.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=H$(),c=Pq(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),gW(`h2`,e,{ref:t,props:[{id:c},o]})}),c1=$z(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=H$(!0),f=HK(l)??d;if(!f)throw Error(qz(79));let p=Pq(s),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`triggerPopupId`,p),_=G.useRef(null),{registerTrigger:v,isMountedByThisTrigger:y}=kK(p,_,f,{payload:c}),{getButtonProps:b,buttonRef:x}=SJ({disabled:a,native:o}),S=nG(m),C=cJ(()=>f.select(`open`),e=>{f.set(`openMethod`,e)}),w={disabled:a,open:h},T=f.useState(`triggerProps`,y);return gW(`button`,e,{state:w,ref:[x,t,v,_],props:[S.reference,T,C,{[wW]:``,id:p,"aria-haspopup":`dialog`,"aria-expanded":h,"aria-controls":g},u,b],stateAttributesMapping:IV})}),l1=G.createContext(void 0);function u1(e=!0){let t=G.useContext(l1);if(t===void 0&&!e)throw Error(qz(25));return t}var d1=G.createContext(void 0);function f1(e){let t=G.useContext(d1);if(t===void 0&&!e)throw Error(qz(33));return t}var p1=G.createContext(void 0);function m1(e){let t=G.useContext(p1);if(t===void 0&&!e)throw Error(qz(36));return t}function h1(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=u1(!0),f=d!==void 0;return G.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:aH})},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&&!tV&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&c.type===`regular-item`&&xJ(s.current,e,{detail:1})}}),[t,n,r,l,i,u,a,o,s,d,f,c])}var g1={type:`regular-item`};function _1(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=G.useRef(null),{getButtonProps:d,buttonRef:f}=SJ({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=h1({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=G.useCallback(e=>nW(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=zz(u,f);return G.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var v1=`data-checked`,y1=`data-unchecked`,b1={checked(e){return e?{[v1]:``}:{[y1]:``}},...TV},x1=G.createContext(void 0);function S1(){let e=G.useContext(x1);if(e===void 0)throw Error(qz(31));return e}var C1=G.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=G.useState(void 0),c=gW(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,Z.jsx)(x1.Provider,{value:s,children:c})}),w1=G.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Pq(a),c=S1();return Y(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),gW(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})}),T1=G.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=nX({guess:!0,label:a}),f=f1(!0),p=Pq(i),{store:m}=m1(),h=m.useState(`disabled`),g=s||h,_=m.useState(`isActive`,d.index),v=m.useState(`itemProps`),{getItemProps:y,itemRef:b}=_1({closeOnClick:c,disabled:g,highlighted:_,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:g1});return gW(`div`,e,{state:{disabled:g,highlighted:_},props:[v,u,y],ref:[b,t,d.ref]})}),E1=G.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=m1(),{side:c,align:l}=f1(),u=jY(!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`),T=s.useState(`openMethod`),E=_.type===`context-menu`;yK({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),G.useEffect(()=>{function e(e){s.setOpen(!1,yH(e.reason,e.domEvent))}return x.events.on(`close`,e),()=>{x.events.off(`close`,e)}},[x.events,s]),$K(b,{enabled:C&&!w&&!E&&_.type!==`menubar`,closeDelay:S});let D=s.useStateSetter(`popupElement`),O=gW(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,D],stateAttributesMapping:zV,props:[p,{onKeyDown(e){u&&IY.has(e.key)&&e.stopPropagation()}},dY(f),o,{"data-rootownerid":y}]}),k=_.type===void 0||E;return(g||_.type===`menubar`&&v!==`outside-press`)&&(k=!0),(0,Z.jsx)(tG,{context:b,openInteractionType:T,modal:E,disabled:!m,returnFocus:a===void 0?k: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:O})}),D1=G.createContext(void 0);function O1(){let e=G.useContext(D1);if(e===void 0)throw Error(qz(32));return e}var k1=G.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=m1();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,Z.jsx)(D1.Provider,{value:n,children:(0,Z.jsx)(IW,{ref:t,...r,portalOwnerRole:o})})}),A1=G.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=OW,style:g,..._}=e,{store:v}=m1(),y=O1(),b=u1(!0),x=v.useState(`parent`),S=v.useState(`floatingRootContext`),C=v.useState(`floatingTreeRoot`),w=v.useState(`mounted`),T=v.useState(`open`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`activeTriggerElement`),k=v.useState(`transitionStatus`),A=v.useState(`positionerElement`),j=v.useState(`instantType`),M=v.useState(`adaptiveOrigin`),N=v.useState(`lastOpenChangeReason`),P=v.useState(`floatingNodeId`),F=v.useState(`floatingParentNodeId`),I=S.useState(`domReferenceElement`),L=G.useRef(null),R=vK(A),z=n,ee=c,B=l,V=s,te=h;x.type===`context-menu`&&(z=n??x.context?.anchor,V??=`start`,!o&&V!==`center`&&(B=e.alignOffset??2,ee=e.sideOffset??-5));let H=o,ne=V;x.type===`menu`?(H??=`inline-end`,ne??=`start`,te=e.collisionAvoidance??kW):x.type===`menubar`&&(H??=x.context.orientation===`vertical`?`inline-end`:`bottom`,ne??=`start`);let re=x.type===`context-menu`,ie=rY({anchor:z,floatingRootContext:S,positionMethod:b?`fixed`:r,mounted:w,side:H,sideOffset:ee,align:ne,alignOffset:B,arrowPadding:re?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:P,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:te,shift:re?{crossAxis:!(`side`in te&&te.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:C,adaptiveOrigin:M});G.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===P&&v.set(`hoverEnabled`,!1),e.nodeId!==P&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,yH(fH)))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[v,C.events,P]),G.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,yH(t))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[C.events,v]);let ae=GB();G.useEffect(()=>{T||ae.clear()},[T,ae]),G.useEffect(()=>{function e(e){if(T&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&O&&O!==e.target){let e=v.select(`closeDelay`);e>0?ae.isStarted()||ae.start(e,()=>{v.setOpen(!1,yH(fH))}):v.setOpen(!1,yH(fH))}else ae.clear()}}return C.events.on(`itemhover`,e),()=>{C.events.off(`itemhover`,e)}},[C.events,T,O,v,ae]),G.useEffect(()=>{let e={open:T,nodeId:P,parentNodeId:F,reason:v.select(`lastOpenChangeReason`)};C.events.emit(`menuopenchange`,e)},[C.events,T,v,P,F]),Y(()=>{let e=I,t=L.current;if(e&&(L.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return R(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[I,R,v]);let oe={open:T,side:ie.side,align:ie.align,anchorHidden:ie.anchorHidden,nested:x.type===`menu`,instant:j},se=x.type===`menubar`&&x.context.modal;TY(T&&(se||E&&N!==`trigger-hover`),D===`touch`,A,O);let U=fY(e,oe,{styles:ie.positionerStyles,transitionStatus:k,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!w,inert:!T}),ce=w&&x.type!==`menu`&&(x.type!==`menubar`&&E&&N!==`trigger-hover`||x.type===`menubar`&&x.context.modal),le=null;return x.type===`menubar`?le=x.context.contentElement:x.type===void 0&&(le=O),(0,Z.jsxs)(d1.Provider,{value:ie,children:[ce&&(0,Z.jsx)(cY,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:MJ(!T),cutout:le}),(0,Z.jsx)(WW,{id:P,children:(0,Z.jsx)(FJ,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:U})})]})}),j1=G.createContext(void 0);function M1(){let e=G.useContext(j1);if(e===void 0)throw Error(qz(34));return e}var N1=G.memo(G.forwardRef(function(e,t){let{render:n,className:r,value:i,defaultValue:a,onValueChange:o,disabled:s=!1,style:c,"aria-labelledby":l,...u}=e,[d,f]=G.useState(void 0),[p,m]=Uz({controlled:i,default:a,name:`MenuRadioGroup`}),h=X((e,t)=>{o?.(e,t),!t.isCanceled&&m(e)}),g=gW(`div`,e,{state:{disabled:s},ref:t,props:{role:`group`,"aria-labelledby":l??d,"aria-disabled":s||void 0,...u}}),_=G.useMemo(()=>({value:p,setValue:h,disabled:s}),[p,h,s]);return(0,Z.jsx)(x1.Provider,{value:f,children:(0,Z.jsx)(j1.Provider,{value:_,children:g})})})),P1=G.createContext(void 0);function F1(){let e=G.useContext(P1);if(e===void 0)throw Error(qz(35));return e}var I1=G.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,value:l,style:u,...d}=e,f=nX({guess:!0,label:a}),p=f1(!0),m=Pq(i),{store:h}=m1(),g=h.useState(`isActive`,f.index),_=h.useState(`itemProps`),{value:v,setValue:y,disabled:b}=M1(),x=h.useState(`disabled`),S=s||b||x,C=v===l,{getItemProps:w,itemRef:T}=_1({closeOnClick:c,disabled:S,highlighted:g,id:m,store:h,nativeButton:o,nodeId:p?.context.nodeId,itemMetadata:g1}),E=G.useMemo(()=>({disabled:S,highlighted:g,checked:C}),[S,g,C]);function D(e){let t=yH(aH,e.nativeEvent,void 0,{preventUnmountOnClose:oB});y(l,t)}let O=gW(`div`,e,{state:E,stateAttributesMapping:b1,props:[_,{role:`menuitemradio`,"aria-checked":C,onClick:D},d,w],ref:[T,t,f.ref]});return(0,Z.jsx)(P1.Provider,{value:E,children:O})}),L1=G.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=F1(),c=G.useRef(null),{transitionStatus:l,mounted:u,setMounted:d}=hK(s.checked);return yK({batch:!0,enabled:!s.checked,open:s.checked,ref:c,onComplete(){s.checked||d(!1)}}),gW(`span`,e,{state:{checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l},stateAttributesMapping:b1,ref:[t,c],props:{"aria-hidden":!0,...o},enabled:a||u})}),R1=G.createContext(null);function z1(e){let t=G.useContext(R1);if(t===null&&!e)throw Error(qz(5));return t}var B1={...VK,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`)}},V1=class extends lB{constructor(e,t,n=!1){let r=new PK,i=U1(r,t,n,e);super(i,H1(r),B1),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 H1(e){return{positionerRef:G.createRef(),popupRef:G.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:G.createRef(),beforeContentFocusGuardRef:G.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function U1(e,t,n=!1,r){return{...FK(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 RW,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:cB,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var W1=G.createContext(void 0);function G1(){return G.useContext(W1)}var K1=Qz(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=u1(!0),_=m1(!0),v=z1(!0),y=G1(),b=G.useMemo(()=>y&&_?{type:`menu`,store:_.store}:v?{type:`menubar`,context:v}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,v,y]),x=YU(),S=YU(),C=VW(),w=b.type===`menu`?b.store:void 0,T=(n??a)&&w?.state.transitionStatus===`starting`,E=Rz(()=>T?w?.state.instantType:void 0).current,D=q1({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:E},S,C!=null);D.useControlledProp(`openProp`,n),D.useControlledProp(`triggerIdProp`,p),D.useContextCallback(`onOpenChangeComplete`,i);let O=D.useState(`floatingTreeRoot`),k=UW(O),A=D.useState(`open`),j=D.useState(`activeTriggerElement`),M=D.useState(`positionerElement`),N=D.useState(`hoverEnabled`),P=D.useState(`disabled`),F=D.useState(`lastOpenChangeReason`),I=D.useState(`parent`),L=D.useState(`activeIndex`),R=D.useState(`payload`),z=D.useState(`floatingParentNodeId`),ee=G.useRef(null),B=G.useRef(I.type!==`context-menu`),V=GB(),te=G.useRef(!0),H=GB(),ne=z!=null,{openMethod:re,triggerProps:ie}=lJ(A);D.useSyncedValues({disabled:o,highlightItemOnHover:h,modal:I.type===void 0?s:void 0,openMethod:re,rootId:x}),AK(D);let{forceUnmount:ae,transitionStatus:oe}=jK(A,D,()=>{D.set(`allowMouseEnter`,!1)},T),se=vK(D.context.popupRef);G.useEffect(()=>{if(E===void 0)return;let e=()=>{D.state.instantType===E&&D.set(`instantType`,void 0)};if(!A){e();return}if(oe!==void 0)return;if(D.context.popupRef.current==null){e();return}let t=new AbortController;return se(e,t.signal),()=>{t.abort()}},[E,A,oe,se,D]),Y(()=>{g&&!_?D.update({parent:{type:`context-menu`,context:g},floatingNodeId:k,floatingParentNodeId:C}):_&&D.update({floatingNodeId:k,floatingParentNodeId:C})},[g,_,k,C,D]),G.useEffect(()=>{if(A||(ee.current=null),I.type===`context-menu`){if(!A){V.clear(),B.current=!1;return}V.start(500,()=>{B.current=!0})}},[V,A,I.type]),Y(()=>{!A&&!N&&D.set(`hoverEnabled`,!0)},[A,N,D]);let U=X((e,t)=>{let n=t.reason;if(!e&&!D.select(`open`)||A===e&&t.trigger===j&&F===n)return;let i=DK(t);if(!e&&t.trigger==null&&(t.trigger=j??void 0),r?.(e,t),t.isCanceled)return;D.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!te.current)return;e&&n===`trigger-focus`?(te.current=!1,H.start(300,()=>{te.current=!0})):(te.current=!0,H.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0,s=!e&&(n===`escape-key`||n==null);ee.current=t.event;let c=EK(D.state,e,t.trigger,i());c.openChangeReason=n,c.instantType=I.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,D.update(c)}),ce=mK({popupStore:D,floatingRootContext:D.state.floatingRootContext,floatingId:S,nested:C!=null,onOpenChange:U}),le=ce.context.events;Y(()=>{let e=({open:e,eventDetails:t})=>U(e,t);return le.on(`setOpen`,e),()=>{le?.off(`setOpen`,e)}},[le,U]);let ue=G.useCallback(()=>{D.setOpen(!1,yH(gH))},[D]);G.useImperativeHandle(u,()=>({unmount:ae,close:ue}),[ae,ue]);let de;I.type===`context-menu`&&(de=I.context),G.useImperativeHandle(de?.positionerRef,()=>M,[M]),G.useImperativeHandle(de?.actionsRef,()=>({setOpen:U}),[U]);let W=cG(ce,{enabled:!P,bubbles:{escapeKey:d&&I.type===`menu`},outsidePress(){return I.type!==`context-menu`||ee.current?.type===`contextmenu`||B.current},externalTree:ne?O:void 0}),fe=UJ(),pe=G.useCallback(e=>{D.select(`activeIndex`)!==e&&D.set(`activeIndex`,e)},[D]),me=lq(ce,{enabled:!P,listRef:D.context.itemDomElements,activeIndex:L,nested:I.type!==void 0,loopFocus:c,orientation:l,parentOrientation:I.type===`menubar`?I.context.orientation:void 0,rtl:fe===`rtl`,disabledIndices:sB,onNavigate:pe,openOnArrowKeyDown:I.type!==`context-menu`,externalTree:ne?O:void 0,focusItemOnHover:h}),he=G.useCallback(e=>{D.context.typingRef.current=e},[D]),ge=uq(ce,{enabled:!P,listRef:D.context.itemLabels,elementsRef:D.context.itemDomElements,activeIndex:L,resetMs:500,onMatch:e=>{A&&e!==L&&D.set(`activeIndex`,e)},onTyping:he}),_e=G.useMemo(()=>{let e=nW(ge.reference,me.reference,W.reference,{onMouseMove(){D.set(`allowMouseEnter`,!0)}},ie);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=A,e},[D,ge.reference,me.reference,W.reference,ie,A]),ve=G.useMemo(()=>{let e=nW(me.trigger,W.trigger,ie);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[me.trigger,W.trigger,ie]);Rz(()=>(D.update({inactiveTriggerProps:ve}),null)),MK(D,{floatingRootContext:ce,activeTriggerProps:_e,inactiveTriggerProps:ve,popupProps:G.useMemo(()=>nW(bK,{id:S,role:`menu`,"aria-orientation":l===`horizontal`?`horizontal`:void 0,"aria-labelledby":j?.id,onMouseMove(){D.set(`allowMouseEnter`,!0),I.type===`menu`&&D.set(`hoverEnabled`,!1)},onClick(){D.select(`hoverEnabled`)&&D.set(`hoverEnabled`,!1)},onKeyDown(e){let t=D.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},ge.floating,me.floating,W.floating),[j,S,l,I.type,D,ge.floating,me.floating,W.floating]),itemProps:me.item??cB});let ye=G.useMemo(()=>({store:D,parent:b}),[D,b]),be=(0,Z.jsxs)(p1.Provider,{value:ye,children:[f&&(0,Z.jsx)(CK,{handle:f,store:D}),typeof t==`function`?t({payload:R}):t]});return I.type===void 0||I.type===`context-menu`?(0,Z.jsx)(GW,{externalTree:O,children:be}):be});function q1(e,t,n){return Rz(()=>new V1(e,t,n)).current}function J1(e){if(gB(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!OB(e))return J1(jB(e))}function Y1(e,t){let n=G.useRef(null);function r(t){jW.flushSync(()=>{e.setOpen(!1,yH(sH,t.nativeEvent,t.currentTarget))}),TU(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&EU(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{jW.flushSync(()=>{e.setOpen(!1,yH(sH,n.nativeEvent,n.currentTarget))});let i=wU(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&pV(r,i);){let e=i;if(i=xU(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function X1(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=G.useRef(!1);return G.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,IB(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:cB,[t,n,r])}var Z1=$z(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=m1(!0),h=HK(d)??m?.store;if(!h)throw Error(qz(85));let g=Pq(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=G.useRef(null),S=$1(),C=yJ(!0),w=HW(),T=G.useMemo(()=>w??new RW,[w]),{registerTrigger:E,isMountedByThisTrigger:D}=kK(g,x,h,{payload:f,closeDelay:u,parent:S,floatingTreeRoot:T,floatingNodeId:UW(T),floatingParentNodeId:VW(),keyboardEventRelay:C?.relayKeyboardEvent}),O=S.type===`menubar`,k=h.useState(`disabled`),A=a||k||O&&S.context.disabled,{getButtonProps:j,buttonRef:M}=SJ({disabled:A,native:o});G.useEffect(()=>{!y&&S.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,S.type]);let N=G.useRef(null),P=GB(),F=X(e=>{if(!N.current)return;P.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;pV(N.current,t)||pV(h.select(`positionerElement`),t)||t===N.current||(t==null||J1(t)!==h.select(`rootId`))&&(gJ(e,N.current)||T.events.emit(`close`,{domEvent:e,reason:dH}))});G.useEffect(()=>{y&&h.select(`lastOpenChangeReason`)===`trigger-hover`&&IB(N.current).addEventListener(`mouseup`,F,{once:!0})},[y,F,h]);let I=O&&S.context.hasSubmenuOpen,L=tq(v,{enabled:(c??I)&&!A&&(!O||I&&!D),handleClose:vq({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:S.type===void 0?l:void 0,delay:{close:u},triggerElementRef:x,externalTree:T,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),R=Q1(y,h.select(`lastOpenChangeReason`)),z=nG(v,{enabled:!A,event:y&&O?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:S.type===void 0&&R}),ee=qK(v,{enabled:!A&&I}),B=X1({open:y,enabled:O,mouseDownAction:`open`}),V=G.useMemo(()=>nW(ee.reference,z.reference),[ee.reference,z.reference]),te=h.useState(`triggerProps`,D),{preFocusGuardRef:H,handlePreFocusGuardFocus:ne,handleFocusTargetFocus:re}=Y1(h,x),ie={disabled:A,open:y},ae=[N,t,M,E,x],oe=[V,L??cB,te,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(P.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),IB(e.currentTarget).addEventListener(`mouseup`,F,{once:!0}))}},O?{role:`menuitem`}:{},B,p,j],se=gW(`button`,e,{enabled:!O,stateAttributesMapping:LV,state:ie,ref:ae,props:oe});return O?(0,Z.jsx)(qZ,{tag:`button`,render:n,className:r,style:i,state:ie,refs:ae,props:oe,stateAttributesMapping:LV}):y?(0,Z.jsxs)(G.Fragment,{children:[(0,Z.jsx)(CH,{ref:H,onFocus:ne},`${g}-pre-focus-guard`),(0,Z.jsx)(G.Fragment,{children:se},g),(0,Z.jsx)(CH,{ref:h.context.triggerFocusTargetRef,onFocus:re},`${g}-post-focus-guard`)]}):(0,Z.jsx)(G.Fragment,{children:se},g)});function Q1(e,t){let n=GB(),[r,i]=G.useState(!1);return Y(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function $1(){let e=z1(!0);return G.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}function e0(e){let[t,n]=G.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=G.useRef(null),i=G.useRef(null),a=G.useRef(null),o=G.useRef(null),s=G.useRef(!0),c=G.useRef(null),l=YU(),u=G.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)(l1.Provider,{value:u,children:(0,Z.jsx)(p1.Provider,{value:void 0,children:(0,Z.jsx)(K1,{...e})})})}var t0=500,n0=G.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}=u1(!1),{store:m}=m1(!1),h=m.useState(`open`),g=m.useState(`disabled`),_=G.useRef(null),v=G.useRef(null),y=GB(),b=GB(),x=G.useRef(!1),S=G.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,yH(tH,n)),b.start(t0,()=>{x.current=!0})}function w(e){if(g)return;d.current=!0,oV(e),C(e.clientX,e.clientY,e.nativeEvent);let t=IB(_.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=mV(e);pV(u.current,t)||p&&t&&J1(t)===p||s.current?.setOpen(!1,yH(dH,e))},{once:!0,signal:n.signal})}function T(){y.clear(),v.current=null}function E(e){if(g){T();return}if(d.current=!1,e.touches.length!==1){T();return}e.stopPropagation();let t=e.touches[0],n={x:t.clientX,y:t.clientY};v.current=n,y.start(t0,()=>{C(n.x,n.y,e.nativeEvent)})}function D(e){if(e.touches.length!==1){T();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)&&T()}}return G.useEffect(()=>()=>{S.current?.abort()},[]),G.useEffect(()=>{function e(e){if(g)return;let t=mV(e);(pV(_.current,t)||pV(c.current,t)||pV(l.current,t))&&e.preventDefault()}return LB(IB(_.current),`contextmenu`,e)},[l,g,c]),gW(`div`,e,{state:{open:h},ref:[_,t],props:[{onContextMenu:w,onTouchStart:E,onTouchMove:D,onTouchEnd:T,onTouchCancel:T,style:{WebkitTouchCallout:`none`}},a],stateAttributesMapping:LV})}),r0=A1;function i0(e){return i1(`alert-dialog`,e)}var a0=G.createContext(void 0);function o0(e){let t=G.useContext(a0);if(t===void 0&&!e)throw Error(qz(47));return t}var s0={...VK,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},c0=class extends lB{constructor(e,t,n){let r=new PK;super(l0(e,r,t,n),u0(r),s0)}setOpen=(e,t)=>{let n=t.reason===nH,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=DK(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=EK(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)}),jW.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function l0(e,t,n,r=!1){let i={...FK(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 u0(e){return{popupRef:G.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:G.createRef(),beforeContentFocusGuardRef:G.createRef(),stickIfOpenTimeout:new WB,triggerElements:e}}var d0=Qz(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=p0(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),NK(u,d),AK(u);let{forceUnmount:m}=jK(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o}),G.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),G.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,yH(gH))}),[m,u]);let h=d||f;return(0,Z.jsxs)(a0.Provider,{value:u,children:[s&&(0,Z.jsx)(CK,{handle:s,store:u}),h&&(0,Z.jsx)(m0,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function f0(e){return o0(!0)?(0,Z.jsx)(d0,{props:e}):(0,Z.jsx)(GW,{children:(0,Z.jsx)(d0,{props:e})})}function p0(e,t){let n=SK((e,n)=>new c0(t,e,n));return G.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function m0({store:e,modal:t}){let n=cG(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return MK(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var h0=$z(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=o0(!0),h=HK(s)??m;if(!h)throw Error(qz(74));let g=Pq(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=G.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=kK(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),w=h.useState(`openChangeReason`),T=h.useState(`stickIfOpen`),E=h.useState(`openMethod`),D=h.useState(`focusManagerModal`),O=tq(v,{enabled:!a&&l&&(E!==`touch`||w!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:vq(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),k=nG(v,{stickIfOpen:T}),A=cJ(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),j=h.useState(`triggerProps`,C),{getButtonProps:M,buttonRef:N}=SJ({disabled:a,native:o}),P={open(e){return e&&w===`trigger-press`?LV.open(e):IV.open(e)}},{preFocusGuardRef:F,handlePreFocusGuardFocus:I,handleFocusTargetFocus:L}=Y1(h,x),R=gW(`button`,e,{state:{disabled:a,open:y},ref:[N,t,S,x],props:[k.reference,O,j,A,{[wW]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,M],stateAttributesMapping:P}),z=(0,Z.jsx)(G.Fragment,{children:R},g);return C&&!D?(0,Z.jsxs)(G.Fragment,{children:[(0,Z.jsx)(CH,{ref:F,onFocus:I}),z,(0,Z.jsx)(CH,{ref:h.context.triggerFocusTargetRef,onFocus:L})]}):z}),g0=G.createContext(void 0);function _0(){let e=G.useContext(g0);if(e===void 0)throw Error(qz(45));return e}var v0=G.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return o0().useState(`mounted`)||n?(0,Z.jsx)(g0.Provider,{value:n,children:(0,Z.jsx)(IW,{ref:t,...r})}):null}),y0=G.createContext(void 0);function b0(){let e=G.useContext(y0);if(!e)throw Error(qz(46));return e}var x0=G.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=kW,..._}=e,v=o0(),y=_0(),b=UW(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=v.useState(`adaptiveOrigin`),M=G.useRef(null),N=vK(O),P=rY({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:j}),F=x.useState(`domReferenceElement`);Y(()=>{let e=F,t=M.current;if(e&&(M.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return N(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[F,N,v]);let I=E===!0&&w!==`trigger-hover`;TY(C&&I,D===`touch`,O,T);let L=v.useStateSetter(`positionerElement`),R=fY(e,{open:C,side:P.side,align:P.align,anchorHidden:P.anchorHidden,instant:k},{styles:P.positionerStyles,transitionStatus:A,props:_,refs:[t,L],hidden:!S,inert:!C});return(0,Z.jsxs)(y0.Provider,{value:P,children:[S&&I&&(0,Z.jsx)(cY,{inert:MJ(!C),cutout:T}),(0,Z.jsx)(WW,{id:b,children:R})]})}),S0=G.createContext(void 0);function C0(){let[e,t]=G.useState(0),n=X(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:G.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var w0=G.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=o0(),l=b0(),u=jY(!0)!=null,{context:d,hasClosePart:f}=C0(),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`);yK({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),$K(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?xK(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=gW(`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`,...bK,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&IY.has(e.key)&&e.stopPropagation()}},dY(g),s],stateAttributesMapping:zV});return(0,Z.jsx)(tG,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:gB(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,Z.jsx)(S0.Provider,{value:d,children:M})})}),T0=G.createContext(void 0);function E0(){let e=G.useContext(T0);if(e===void 0)throw Error(qz(64));return e}var D0=`data-activation-direction`,O0={tabActivationDirection:e=>({[D0]:e})},k0=G.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,style:c,...l}=e,u=e.defaultValue!==void 0,d=G.useRef([]),[f,p]=G.useState(()=>new Map),[m,h]=Uz({controlled:s,default:r,name:`Tabs`,state:`value`}),g=s!==void 0,[_,v]=G.useState(()=>new Map),y=G.useRef(void 0),b=G.useCallback(e=>A0(_,e),[_]),[x,S]=G.useState(()=>({previousValue:m,tabActivationDirection:`none`})),{previousValue:C,tabActivationDirection:w}=x,T=w,E=!1;C!==m&&(T=j0(C,m,a,_),E=C!=null&&m!=null&&b(m)==null);let D=E?C:m,O=C!==D||w!==T;Y(()=>{O&&S({previousValue:D,tabActivationDirection:T})},[D,O,T]);let k=X((e,t)=>{t.activationDirection=j0(m,e,a,_),i?.(e,t),!t.isCanceled&&h(e)}),A=X((e,t)=>{i?.(e,yH(t,void 0,void 0,{activationDirection:`none`}))}),j=X((e,t)=>(p(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{p(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),M=G.useCallback(e=>f.get(e),[f]),N=G.useCallback(e=>{for(let t of _.values())if(e===t.value)return t.id},[_]),P=G.useMemo(()=>({getTabElementBySelectedValue:b,getTabIdByPanelValue:N,getTabPanelIdByValue:M,onValueChange:k,orientation:a,registerMountedTabPanel:j,setTabMap:v,tabActivationDirection:T,value:m}),[b,N,M,k,a,j,v,T,m]),F=G.useMemo(()=>{for(let e of _.values())if(e.value===m)return e},[_,m]),I=G.useMemo(()=>{for(let e of _.values())if(!e.disabled)return e.value},[_]),L=G.useRef(!u),R=G.useRef(r),z=G.useRef(u),ee=G.useRef(!1);Y(()=>{if(g)return;function e(e,t){h(e),S({previousValue:e,tabActivationDirection:`none`}),A(e,t),L.current=!1}if(_.size===0){ee.current&&m!==null&&!y.current?.isConnected&&e(null,mH);return}ee.current=!0,y.current=_.keys().next().value;let t=F?.disabled,n=F==null&&m!==null;if(!t&&m===R.current&&(z.current=!1),z.current&&t&&m===R.current)return;let r=L.current;if(t||n){let n=I??null;if(m===n){L.current=!1;return}let i=mH;r?i=hH:t&&(i=pH),e(n,i);return}r&&F!=null&&(A(m,hH),L.current=!1)},[I,g,A,F,h,_,m]);let B=gW(`div`,e,{state:{orientation:a,tabActivationDirection:T},ref:t,props:l,stateAttributesMapping:O0});return(0,Z.jsx)(T0.Provider,{value:P,children:(0,Z.jsx)(FJ,{elementsRef:d,children:B})})});function A0(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function j0(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=A0(r,e),c=A0(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var M0=G.createContext(void 0);function N0(){let e=G.useContext(M0);if(e===void 0)throw Error(qz(65));return e}var P0=G.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...l}=e,{value:u,getTabPanelIdByValue:d,onValueChange:f,orientation:p,tabActivationDirection:m}=E0(),{activateOnFocus:h,registerTabResizeObserverElement:g,tabsListElement:_}=N0(),{highlightedIndex:v,onHighlightedIndexChange:y}=yJ(),b=Pq(o),{compositeProps:x,compositeRef:S,index:C}=KZ({metadata:G.useMemo(()=>({disabled:r,id:b,value:a}),[r,b,a])}),w=a===u,T=G.useRef(!1),E=G.useRef(null),D=X(e=>{E.current?.(),E.current=e?g(e):null});Y(()=>{if(T.current){T.current=!1;return}if(!(w&&C>-1&&v!==C))return;let e=_;if(e!=null){let t=fV(IB(e));if(t&&pV(e,t))return}r||y(C)},[w,C,v,y,r,_]);let{getButtonProps:O,buttonRef:k}=SJ({disabled:r,native:s,focusableWhenDisabled:!0}),A=d(a),j=G.useRef(!1),M=G.useRef(!1);function N(e){f(a,yH(eH,e.nativeEvent,void 0,{activationDirection:`none`}))}function P(e){w||r||N(e)}function F(e){w||r||h&&(!j.current||M.current)&&N(e)}function I(e){if(w||r)return;j.current=!0,M.current=e.button===0;let t=IB(e.currentTarget);function n(){j.current=!1,M.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return gW(`button`,e,{state:{disabled:r,active:w,orientation:p,tabActivationDirection:m},ref:[t,k,S,D],props:[x,{role:`tab`,"aria-controls":A,"aria-selected":w,id:b,onClick:P,onFocus:F,onPointerDown:I,[YZ]:w?``:void 0,onKeyDownCapture(){T.current=!0}},l,O],stateAttributesMapping:O0})});function F0(e,t){let n=(t??fB(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 I0=`data-index`,L0={...O0,...TV},R0=G.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:u,tabActivationDirection:d,registerMountedTabPanel:f}=E0(),p=Pq(),{ref:m,index:h}=nX(),g=r===c,{mounted:_,transitionStatus:v,setMounted:y}=hK(g),b=!_,x=l(r),S={hidden:b,orientation:u,tabActivationDirection:d,transitionStatus:v},C=G.useRef(null),w=gW(`div`,e,{state:S,ref:[t,m,C],props:[{"aria-labelledby":x,hidden:b,id:p,role:`tabpanel`,tabIndex:g?0:-1,inert:MJ(!g),[I0]:h},s],stateAttributesMapping:L0});return yK({open:g,ref:C,onComplete(){g||y(!1)}}),Y(()=>{if(!(p==null||b&&!a))return f(r,p)},[b,a,r,p,f]),a||_?w:null}),z0=G.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=E0(),[d,f]=G.useState(0),[p,m]=G.useState(null),h=G.useRef(new Set),g=G.useRef(new Set),_=G.useRef(null);Y(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{h.current.forEach(e=>{e()})});return _.current=e,p&&e.observe(p),g.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),_.current=null}},[p]);let v=X(e=>(h.current.add(e),()=>{h.current.delete(e)})),y=X(e=>(g.current.add(e),_.current?.observe(e),()=>{g.current.delete(e),_.current?.unobserve(e)})),b={orientation:c,tabActivationDirection:u},x={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},S=G.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:v,registerTabResizeObserverElement:y,tabsListElement:p}),[n,v,y,p]);return(0,Z.jsx)(M0.Provider,{value:S,children:(0,Z.jsx)($Z,{render:a,className:r,style:o,state:b,refs:[t,m],props:[x,s],stateAttributesMapping:O0,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:sB})})}),B0=`--nested-drawers`,V0=`--drawer-height`,H0=`--drawer-frontmost-height`,U0=`--drawer-swipe-movement-x`,W0=`--drawer-swipe-movement-y`,G0=`--drawer-snap-point-offset`,K0=`--drawer-swipe-strength`,q0=`--drawer-swipe-progress`,J0=G.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=H$(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return gW(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:zV,props:[{role:`presentation`,hidden:!u,style:{pointerEvents:c?void 0:`none`,userSelect:`none`,WebkitUserSelect:`none`,[q0]:`0`,[K0]:`1`}},o],enabled:a||!l})}),Y0=W$,X0=`data-drawer-content`,Z0=G$,Q0=G.createContext(void 0);function $0(){return G.useContext(Q0)}var e2=`data-expanded`,t2=`data-nested-drawer-open`,n2=`data-nested-drawer-swiping`,r2=`data-swipe-dismiss`,i2=`data-swipe-direction`,a2=`data-swiping`,o2=G.createContext(void 0);function s2(e){let t=G.useContext(o2);if(e!==!0&&t===void 0)throw Error(qz(90));return t}function c2(e,t){let n=e+t;return n>=0?t:-Math.sqrt(-n)-e}function l2(e,t,n){if(!Number.isFinite(t)||t<=0)return null;if(typeof e==`number`)return Number.isFinite(e)?e<=1?uJ(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 u2(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 d2(){let e=H$(),{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:i}=s2(),a=e.useState(`viewportElement`),[o,s]=G.useState(0),[c,l]=G.useState(16),u=X(()=>{let e=IB(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=G.useMemo(()=>{if(!t||t.length===0||o<=0||i<=0)return[];let e=Math.min(i,o),n=t.map(t=>{let n=l2(t,o,c);if(n===null)return null;let r=uJ(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:G.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=l2(n,o,c);if(r===null)return;let a=uJ(r,0,t);return d[u2(d.map(e=>e.height),a)]},[n,i,d,c,o])?.offset??null}}var f2=G.createContext(null);function p2(){return G.useContext(f2)}var m2=!1;function h2(){m2||=(typeof CSS<`u`&&`registerProperty`in CSS&&([U0,W0,G0].forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),[{name:q0,initialValue:`0`},{name:K0,initialValue:`1`}].forEach(({name:e,initialValue:t})=>{try{CSS.registerProperty({name:e,syntax:`<number>`,inherits:!1,initialValue:t})}catch{}})),!0)}var g2={...zV,expanded(e){return e?{[e2]:``}:null},nestedDrawerOpen(e){return e?{[t2]:``}:null},nestedDrawerSwiping(e){return e?{[n2]:``}:null},swipeDirection(e){return{[i2]:e}},swiping(e){return e?{[a2]:``}:null}},_2=G.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=H$(),l=c.context.popupRef,{swipeDirection:u,frontmostHeight:d,hasNestedDrawer:f,nestedSwiping:p,nestedSwipeProgressStore:m,onPopupHeightChange:h,notifyParentFrontmostHeight:g,notifyParentHasNestedDrawer:_}=s2(),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`),T=c.useState(`nestedOpenDrawerCount`),E=c.useState(`transitionStatus`),D=c.useState(`open`),O=c.useState(`openMethod`),k=c.useState(`titleElementId`),A=c.useState(`role`),j=b.useState(`floatingId`),M=s.id??j,N=p2();q$();let{snapPoints:P,activeSnapPoint:F,activeSnapPointOffset:I}=d2(),L=T>0,R=N?.swiping??!1,z=N?.swipeStrength??null,[ee,B]=G.useState(0),V=G.useRef(0),te=X(()=>{let e=l.current;if(!e)return;let t=e.offsetHeight;if(V.current>0&&d>V.current&&t>V.current)return;if(V.current>0&&f){let e=V.current;B(e),h(e);return}let n=t;n!==V.current&&(V.current=n,B(n),h(n))});Y(()=>{if(!C){V.current=0,B(0),h(0);return}let e=l.current;if(!e||(h2(),te(),typeof ResizeObserver!=`function`))return;let t=new ResizeObserver(te);return t.observe(e),()=>{t.disconnect()}},[te,C,L,h,l]),Y(()=>{let e=()=>{let e=l.current;if(!e)return;let t=m.getSnapshot();t>0?e.style.setProperty(q0,`${t}`):e.style.setProperty(q0,`0`)};e();let t=m.subscribe(e),n=l.current;return()=>{t(),n&&n.style.setProperty(q0,`0`)}},[m,l]),Y(()=>{if(D)return g?.(d),()=>{g?.(0)}},[d,D,g]),Y(()=>{if(_)return _(D||E===`ending`),()=>{_(!1)}},[_,D,E]),yK({open:D,ref:l,onComplete(){D&&c.context.onOpenChangeComplete?.(!0)}});let H=o===void 0?l:o,ne=c.useStateSetter(`popupElement`),re={open:D,nested:w,transitionStatus:E,expanded:F===1,nestedDrawerOpen:L,nestedDrawerSwiping:p,swipeDirection:u,swiping:R},ie;ee&&(f||E===`ending`)&&(ie=`${ee}px`);let ae=P&&P.length>0&&(u===`down`||u===`up`),oe=null;ae&&I!==null&&(oe=u===`up`?-I:I);let se=N?N.getDragStyles():cB;if(ae&&u===`down`){let e=I??0,t=Number.parseFloat(String(se[W0]));se=R&&Number.isFinite(t)?{...se,transform:void 0,[W0]:`${c2(e,t)}px`}:{...se,transform:void 0}}let U=gW(`div`,e,{state:re,props:[x,{id:M,"aria-labelledby":k,"aria-describedby":v,role:A,...bK,hidden:!C,onKeyDown(e){IY.has(e.key)&&e.stopPropagation()},style:{...se,[q0]:`0`,[B0]:T,[V0]:ie,[G0]:typeof oe==`number`?`${oe}px`:`0px`,[H0]:d?`${d}px`:void 0,[K0]:typeof z==`number`&&Number.isFinite(z)&&z>0?`${z}`:`1`}},s],ref:[t,l,ne],stateAttributesMapping:g2});return(0,Z.jsx)(tG,{context:b,openInteractionType:O,disabled:!C,closeOnFocusOut:!y,initialFocus:H,returnFocus:a,modal:S!==!1,restoreFocus:`popup`,children:U})}),v2=Q$,y2,b2;function x2(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=s2(!0),y=v?.onNestedSwipeProgressChange,b=v?.onNestedFrontmostHeightChange,x=v?.onNestedSwipingChange,S=v?.onNestedDrawerPresenceChange,[C,w]=G.useState(0),[T,E]=G.useState(0),[D,O]=G.useState(!1),[k,A]=G.useState(!1),[j]=G.useState(S2),M=g===void 0?m?.[0]??null:g,N=h!==void 0,[P,F]=Uz({controlled:h,default:M,name:`Drawer`,state:`snapPoint`}),I=G.useRef(!1),L=G.useRef(!1),R=X((e,t)=>{let n=t??yH(`none`);_?.(e,n),!n.isCanceled&&F(e)}),z=G.useMemo(()=>N||!m||m.length===0?P:P===null||!m.some(e=>Object.is(e,P))?M:P,[P,N,M,m]),ee=X(e=>{w(e),!I.current&&e>0&&E(e)}),B=X(e=>{if(e>0){I.current=!0,E(e);return}I.current=!1,C>0&&E(C)}),V=X(e=>{O(e)}),te=X(e=>{j.set(e),y?.(e)}),H=X(e=>{A(e),x?.(e)}),ne=X((e,t)=>{i?.(e,t),!t.isCanceled&&!e&&m&&m.length>0&&R(M,yH(t.reason,t.event,t.trigger))}),re=G.useMemo(()=>({swipeDirection:f,swipeAreaActiveRef:L,snapToSequentialPoints:p,snapPoints:m,activeSnapPoint:z,setActiveSnapPoint:R,frontmostHeight:T,popupHeight:C,hasNestedDrawer:D,nestedSwiping:k,nestedSwipeProgressStore:j,onNestedDrawerPresenceChange:V,onPopupHeightChange:ee,onNestedFrontmostHeightChange:B,onNestedSwipingChange:H,onNestedSwipeProgressChange:te,notifyParentFrontmostHeight:b,notifyParentSwipingChange:x,notifyParentSwipeProgressChange:y,notifyParentHasNestedDrawer:S}),[z,T,D,k,j,S,y,x,b,V,B,te,H,ee,C,R,m,p,L,f]),ie=i1(`drawer`,{open:n,defaultOpen:r,onOpenChange:ne,onOpenChangeComplete:a,disablePointerDismissal:o,modal:s,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d,children:typeof t==`function`?e=>(0,Z.jsxs)(G.Fragment,{children:[y2||=(0,Z.jsx)(C2,{}),t(e)]}):(0,Z.jsxs)(G.Fragment,{children:[b2||=(0,Z.jsx)(C2,{}),t]})});return(0,Z.jsx)(o2.Provider,{value:re,children:ie})}function S2(){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 C2(){let e=$0(),t=H$(!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]),G.useEffect(()=>{if(!i||!s||!eV)return;let e=fB(o).CloseWatcher;if(!e)return;function n(e){t.select(`open`)&&t.setOpen(!1,yH(lH,e))}let r=new e,a=LB(r,`close`,n);return()=>{a(),r.destroy()}},[t,s,i,o]),null}function w2(e,t=!1){let{overflowY:n}=kB(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}function T2(e,t=!1){let{overflowX:n}=kB(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientWidth>0:e.scrollWidth>e.clientWidth}function E2(e,t,n=!1){return t===`vertical`?w2(e,n):T2(e,n)}function D2(e,t,n){let r=e;for(;gB(r)&&r!==t&&!OB(r);){for(let e of n)if(E2(r,e))return!0;r=jB(r)}return!1}function O2(e,t,n=`vertical`,r=!1){let i=gB(e)?e:null;for(;gB(i)&&i!==t&&!OB(i);){if(E2(i,n,r))return i;i=jB(i)}return E2(t,n,r)?t:null}function k2(e,t,n){return typeof e?.elementFromPoint==`function`?e.elementFromPoint(t,n):null}var A2=40,j2=10,M2=1,N2=50,P2=16,F2=80,I2=`button,a,input,select,textarea,label,[role="button"]`;function L2(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 R2(e){return Number.isFinite(e)&&e>0?e:null}function z2(e,t){return`translate3d(${e.x}px,${e.y}px,0) scale(${t})`}function B2(e){return e%2==1}function V2(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 H2(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=I2,_=n.length===1?n[0]:void 0,v=Math.max(0,typeof c==`number`?c:A2),y=n.includes(`left`),b=n.includes(`right`),x=n.includes(`up`),S=n.includes(`down`),C=y||b,w=x||S,T=G.useMemo(()=>{let e=[];return w&&e.push(`vertical`),C&&e.push(`horizontal`),e},[C,w]),[E,D]=G.useState(void 0),[O,k]=G.useState(!1),[A,j]=G.useState(!1),M=G.useRef({x:0,y:0}),N=G.useRef({x:0,y:0}),P=G.useRef(null),F=G.useRef({x:0,y:0,scale:1}),I=G.useRef(void 0),L=G.useRef(0),R=G.useRef(!1),z=G.useRef({x:0,y:0}),ee=G.useRef(null),B=G.useRef(!1),V=G.useRef(!1),te=G.useRef(null),H=G.useRef(!1),ne=G.useRef(!1),re=G.useRef({width:0,height:0}),ie=G.useRef(0),ae=G.useRef(v),oe=G.useRef(null),se=G.useRef(null),U=G.useRef(null),ce=G.useRef({x:0,y:0}),le=G.useRef(null),ue=G.useRef(!1),de=G.useRef(null),W=X(e=>{ue.current!==e&&(ue.current=e,k(e),m?.(e))});function fe(e){if(!e)return;let t=r.current,n=oe.current;if(!t||!n)return;let i=n({element:t,direction:e});ae.current=Math.max(0,i)}let pe=X((e,t)=>{let n=Number.isFinite(e)?uJ(e,0,1):0,r=n!==ie.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)&&(ie.current=n,t?le.current=t:r&&(le.current=null),u?.(n,t))}),me=X(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=N.current,s=F.current,c=o.x-s.x,l=o.y-s.y;e&&(n.transform=z2(o,s.scale)),n.setProperty(i.x,`${c}px`),n.setProperty(i.y,`${l}px`)});function he(e,t){if(t===null)return;let n=U.current;if(n&&t>n.time){let r=Math.max(t-n.time,P2);ce.current={x:(e.x-n.x)/r,y:(e.y-n.y)/r}}U.current={x:e.x,y:e.y,time:t}}let ge=G.useCallback(()=>{D(void 0),W(!1),j(!1),pe(0),ae.current=v,oe.current=null,M.current={x:0,y:0},N.current={x:0,y:0},F.current={x:0,y:0,scale:1},I.current=void 0,L.current=0,R.current=!1,z.current={x:0,y:0},ee.current=null,B.current=!1,P.current=null,V.current=!1,te.current=null,H.current=!1,ne.current=!1,re.current={width:0,height:0},se.current=null,U.current=null,ce.current={x:0,y:0},le.current=null,me(!1)},[W,v,me,pe]);function _e(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 ve(e){return`touches`in e||e.pointerType===`touch`}function ye(e,t){let n=r.current?.getRootNode();return k2(n,e.x,e.y)??mV(t)}function be(e,t){let n=n=>{let r=O2(e,t,n),i=IB(r);return r===i.body||r===i.documentElement?null:r};return C&&!w?n(`horizontal`):w&&!C?n(`vertical`):n(`vertical`)??n(`horizontal`)}function xe(e,t,n){H.current=!1;let i=ve(e),a=ye(t,e.nativeEvent),l=IB(r.current).body,u=i&&l?be(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&&T.length>0&&!(n?.ignoreScrollableAncestors??!1)&&D2(a,p,T))return!1;if(R.current=!1,I.current=void 0,L.current=0,M.current=t,se.current=R2(e.timeStamp),z.current=t,P.current=t,ae.current=v,oe.current=typeof c==`function`?c:null,p){re.current={width:p.offsetWidth,height:p.offsetHeight},fe(_);let t=F0(p);F.current=t,N.current={x:t.x,y:t.y},he({x:t.x,y:t.y},se.current),`touches`in e||V2(p,e.pointerId,`setPointerCapture`)}return f?.(e.nativeEvent),W(!0),ee.current=null,B.current=!0,pe(0),me(!0),!0}function Se(){Ce(),H.current=!1,P.current=null}function Ce(){V.current=!1,te.current=null}function we(e){if(Se(),!ue.current)return;W(!1),ee.current=null;let t=F.current;N.current={x:t.x,y:t.y},D(void 0),ne.current=!1,me(!1);let n=r.current;n&&V2(n,e.pointerId,`releasePointerCapture`),pe(0,{deltaX:0,deltaY:0,direction:void 0}),d?.(e.nativeEvent)}function Te(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 Ee(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 De=X(e=>{if(!t||e.defaultPrevented||e.nativeEvent.defaultPrevented||!(`touches`in e)&&e.button!==0)return;let n=_e(e);n&&(V.current=!0,te.current=n,H.current=!1,ne.current=!(`touches`in e),(!a||a(n,{nativeEvent:e.nativeEvent,direction:_}))&&xe(e,n)&&Ce())});function Oe(e,n,r){if(!t||!ue.current)return;let i=mV(e.nativeEvent);if(ve(e)&&!H.current){let t=e.currentTarget;if(be(i,t))return}if(`touches`in e||e.preventDefault(),B.current&&(B.current=!1,h)){M.current=n;let t=R2(e.timeStamp);t!==null&&(se.current=t)}let a=n.x,o=n.y,s=r.x,c=r.y;(c<0&&o>z.current.y||c>0&&o<z.current.y)&&(z.current={x:z.current.x,y:o}),(s<0&&a>z.current.x||s>0&&a<z.current.x)&&(z.current={x:a,y:z.current.y});let l=a-M.current.x,u=o-M.current.y,d=o-z.current.y,f=a-z.current.x,p=ee.current;p===null&&C&&w&&Math.sqrt(l*l+u*u)>=M2&&(p=Math.abs(l)>Math.abs(u)?`horizontal`:`vertical`,ee.current=p);let m;if(!I.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)&&(I.current=m,L.current=L2(m,l,u),D(m),fe(m));else{let e=I.current,t=L2(e,f,d);t>ae.current?(R.current=!1,D(e)):!(y&&b)&&!(x&&S)&&L.current-t>=j2&&(R.current=!0)}let g=Te(l,u),v=F.current.x,T=F.current.y;p===`horizontal`?C&&(v+=g.x):(p===`vertical`||C&&(v+=g.x),w&&(T+=g.y));let E=N.current,O=v!==E.x||T!==E.y;N.current={x:v,y:T},O&&me(!0),he({x:v,y:T},R2(e.timeStamp));let k=v-F.current.x,A=T-F.current.y,j={deltaX:k,deltaY:A,direction:I.current},P=0,V=_??I.current;if(V){let e=V===`left`||V===`right`?re.current.width:re.current.height,t=F.current.scale||1,n=L2(V,k,A);e>0&&t>0&&n>0&&(P=n/(e*t))}pe(P,j)}let ke=X(e=>{if(!t)return;let i=N.current,a=F.current,o=i.x-a.x,s=i.y-a.y,c={deltaX:o,deltaY:s,direction:I.current};if(!ue.current){Se(),pe(0,c);return}W(!1),ee.current=null,Se(),ne.current=!1;let u=r.current;u&&(`touches`in e||V2(u,e.pointerId,`releasePointerCapture`));let d=o,f=s,m=se.current,h=R2(e.timeStamp),g=m!==null&&h!==null&&h>m?h-m:0,v=g>0?Math.max(g,N2):0,y=v>0?d/v:0,b=v>0?f/v:0,x=ce.current.x,S=ce.current.y,C=U.current;if(C&&h!==null&&h>=C.time){let e=h-C.time;if(e<=F2){let t=Math.max(e,P2),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:I.current,deltaX:d,deltaY:f,velocityX:y,velocityY:b,releaseVelocityX:x,releaseVelocityY:S}),T=typeof w==`boolean`;if(R.current&&!T){N.current={x:a.x,y:a.y},D(void 0),me(!1),pe(0,c);return}let E=!1,O;if(T)E=w,O=I.current??_;else for(let e of n)if(L2(e,d,f)>ae.current){E=!0,O=e;break}E&&O?(D(O),j(!0),me(!1),l?.(e.nativeEvent,{direction:O})):(N.current={x:a.x,y:a.y},D(void 0),me(!1),pe(0,c))}),Ae=X(e=>{let t=_e(e);if(!t)return;let n=!1;if(!(`touches`in e)){let t=B2(e.buttons);if(t&&(ne.current=!0),e.buttons!==0&&!t){we(e);return}if(e.buttons===0&&ne.current){if(!ue.current){ke(e);return}n=!0}}if(!O&&V.current){if(!ve(e)&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)){Se();return}if(!a||a(t,{nativeEvent:e.nativeEvent,direction:_})){let n=te.current,i=!1;if(ve(e)){let a=r.current;if(n&&a){let r=ye(t,e.nativeEvent),o=IB(a).body,s=o?be(r,o):null;if(s&&(pV(a,s)||pV(s,a))){let e=Ee(s,t.x-n.x,t.y-n.y);if(e===!1)return;e===!0&&(i=!0)}}}xe(e,t,{ignoreScrollableTarget:i,ignoreScrollableAncestors:i})&&(n&&i?(Ce(),M.current=n,z.current=n,P.current=n,B.current=!1):(Ce(),H.current=!1))}}let i=P.current,o=i===null?{x:0,y:0}:{x:t.x-i.x,y:t.y-i.y};P.current=t,Oe(e,t,o),n&&!(`touches`in e)&&ke(e)}),je=X((e,t)=>{Ae({touches:e.touches,currentTarget:t,nativeEvent:e,defaultPrevented:e.defaultPrevented,timeStamp:e.timeStamp})}),Me=G.useCallback(()=>{let e=ue.current,t=N.current,n=F.current,r=t.x-n.x,a=t.y-n.y;return!e&&r===0&&a===0&&!A?{[i.x]:`0px`,[i.y]:`0px`}:{transition:e?`none`:void 0,transform:e?z2(t,n.scale):void 0,[i.x]:`${r}px`,[i.y]:`${a}px`}},[A,i]);return{swiping:O,swipeDirection:E,dragDismissed:A,getPointerProps:G.useCallback(()=>t?{onPointerDown:De,onPointerMove:Ae,onPointerUp:ke,onPointerCancel:ke}:{},[t,ke,Ae,De]),getTouchProps:G.useCallback(()=>t?{onTouchStart:De,onTouchMove:Ae,onTouchEnd:ke,onTouchCancel:ke}:{},[t,ke,Ae,De]),moveNative:je,getDragStyles:Me,reset:ge}}var U2=s1,W2=`data-nested-dialog-open`,G2=G.createContext(void 0);function K2(){return G.useContext(G2)}var q2=10,J2=.5,Y2=.5,X2=300,Z2=4,Q2=.2,$2=4,e4=80,t4=360,n4=.1,r4=6,i4=2,a4=`[${X0}]`,o4=G.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=H$(),c=s.context.popupRef,l=s.context.backdropRef,{swipeDirection:u,notifyParentSwipingChange:d,notifyParentSwipeProgressChange:f,frontmostHeight:p,snapToSequentialPoints:m,swipeAreaActiveRef:h}=s2(),g=$0(),{snapPoints:_,resolvedSnapPoints:v,activeSnapPoint:y,activeSnapPointOffset:b,setActiveSnapPoint:x,popupHeight:S}=d2(),C=s.useState(`open`),w=s.useState(`mounted`),T=s.useState(`nested`),E=s.useState(`nestedOpenDrawerCount`),D=s.useState(`viewportElement`),O=s.useState(`popupElement`),k=g?.visualStateStore,A=E>0,j=u===`left`||u===`right`?`horizontal`:`vertical`,M=j===`vertical`,N=M?`horizontal`:`vertical`,[P,F]=G.useState(null),I=G.useRef(void 0),L=G.useRef(null),R=HB(),z=G.useRef(!1),ee=G.useRef(!1),B=G.useRef(``),V=G.useRef(!1),te=G.useRef(!1),H=G.useRef(null),ne=K2(),re=G.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]),ie=G.useMemo(()=>!re||b===null?null:uJ((b-re.minOffset)/re.range,0,1),[b,re]),ae=G.useMemo(()=>_&&_.length>0&&(u===`down`||u===`up`)?u===`down`?[`down`,`up`]:[`up`,`down`]:[u],[_,u]),oe=X(e=>{c.current?.toggleAttribute(r2,e),l.current?.toggleAttribute(r2,e)}),se=X(()=>{oe(!1),c.current?.removeAttribute(SV),F(null)}),U=X(()=>{ee.current&&(ee.current=!1,d?.(!1))}),ce=X((e,t,n)=>{let r=C&&!T&&t,i=r?e:0,a=C&&t?e:0;n&&f&&(f(a),a<=0&&U()),k?.set({swipeProgress:i,frontmostHeight:i>0?p:0});let o=l.current;if(!o)return;let s=r&&i>0;o.style.setProperty(q0,s?`${i}`:`0`),s&&p>0?o.style.setProperty(V0,`${p}px`):o.style.removeProperty(V0)});function le(e,t,n,r,i,a,o,s){let c=u4(e,t);if(c<=0)return null;let l=((t===`down`||t===`up`)&&_&&_.length>0?b??0:0)+L2(t,n,r),u=Math.max(0,c-l);if(u<=0)return null;let d=L2(t,o,s),f=Math.abs(d)>0?d:L2(t,i,a);return f<=Q2?null:n4+(uJ(u/uJ(f,Q2,$2),e4,t4)-e4)/280*.9}function ue(e){if(ee.current||!e)return;let t=L2(e.direction??u,e.deltaX,e.deltaY);Math.abs(t)<q2||(ee.current=!0,d?.(!0))}let de=H2({enabled:w&&!A,directions:ae,elementRef:s.context.popupRef,ignoreSelectorWhenTouch:!1,ignoreScrollableAncestors:!0,movementCssVars:{x:U0,y:W0},onSwipeStart(e){if(`touches`in e||e.pointerType===`touch`)return;let t=c.current,n=IB(t).getSelection?.();if(!n||n.isCollapsed)return;let r=hB(n.anchorNode)?n.anchorNode:n.anchorNode?.parentElement,i=hB(n.focusNode)?n.focusNode:n.focusNode?.parentElement;(pV(t,r)||pV(t,i))&&n.removeAllRanges()},onSwipingChange(e){z.current=e,s4(s.context.backdropRef.current,e),!e&&!f&&U()},swipeThreshold({element:e,direction:t}){return d4(e,t)},canStart(e,t){let n=s.context.popupRef.current;if(!n)return!1;let r=n.ownerDocument,i=k2(n.getRootNode(),e.x,e.y);if(!i||!pV(n,i))return!1;let a=t.nativeEvent;return!((`touches`in a||a.pointerType===`touch`)&&h4(r,n))},onProgress(e,t){let n=z.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(W0,`${c2(b??0,t.deltaY)}px`))}let i=e;if(re&&S>0){let e=b??re.minOffset;n&&t&&Number.isFinite(t.deltaY)?i=(e=>uJ((e-re.minOffset)/re.range,0,1))(uJ(e+t.deltaY,0,S)):ie!==null&&(i=ie)}n||(f?.(0),U()),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){se();return}let d=l;function f(e){U(),oe(!0),d.style.removeProperty(`transition`),d.setAttribute(SV,``),jW.flushSync(()=>{F(le(d,e,t,n,i,a,o,c))})}if(!_||_.length===0){if(!r){se();return}let e=L2(r,t,n);if(e<=0)return se(),!1;if(L2(r,i,a)>=J2)return f(r),!0;let o=e>d4(d,r);return o?f(r):se(),o}if(u!==`down`&&u!==`up`){se();return}if(!S)return se(),!1;if(v.length===0){se();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)>=q2){let e=Math.sign(w);e!==0&&e!==h&&(w=C)}let T=b??0,E=uJ(T+p,0,S),D=Math.abs(w)>=Y2?uJ(w,-4,Z2)*X2:0,O=m?E:uJ(E+D,0,S),k=yH(_H,e),A=()=>(ce(0,!0,!0),se(),!1),j=e=>(x(e.value,k),A()),M=e=>r?(x(null,k),k.isCanceled?A():(I.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=u2(t,T),r=e[u2(t,O)],i=Math.sign(w),a=h!==0&&i!==0&&i===h&&Math.abs(w)>=Y2,o=O;if(a){let t=uJ(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[u2(v.map(e=>e.offset),O)];return w>=J2&&p>0||Math.abs(O-S)<Math.abs(O-N.offset)?M(N):j(N)},onDismiss(e){k?.set({swipeProgress:0,frontmostHeight:0});let t=s.context.backdropRef.current;t&&(t.style.setProperty(q0,`0`),t.style.removeProperty(V0));let n=yH(_H,e);if(s.setOpen(!1,n),n.isCanceled){let t=I.current;t!==void 0&&x(t,yH(_H,e)),I.current=void 0,L.current?.(),se();return}if(s.select(`open`)){let t=e;R.request(()=>{if(s.select(`open`)){let e=I.current;e!==void 0&&x(e,yH(_H,t)),I.current=void 0,se(),L.current?.()}else I.current=void 0});return}I.current=void 0,oe(!0)}}),W=de.getPointerProps(),fe=de.getTouchProps(),{moveNative:pe,reset:me}=de;L.current=me,G.useEffect(()=>{let e=D??O;if(!e)return;let t=e,n=IB(t);function r(e,r,i){let a=M?i.clientY-r.lastY:i.clientX-r.lastX;if(e.touches.length===2||h4(n,t)||!C||!w||A||y4(r,e,i,M))return;let o=r.scrollTarget;if(!o||o===n.documentElement||o===n.body){e.cancelable&&e.preventDefault(),e.stopPropagation(),pe(e,t);return}if(!b4(o,j)){e.cancelable&&e.preventDefault(),e.stopPropagation();return}if(a!==0){let t=C4(o,j,u,a);r.allowSwipe?e.cancelable&&e.preventDefault():e.cancelable&&t?(r.allowSwipe=!0,e.preventDefault()):r.allowSwipe=!1}r.allowSwipe===!0&&(e.stopPropagation(),pe(e,t))}function i(e){if(ne?.onTouchMove(e),te.current)return;let t=H.current,n=e.touches[0];n&&t&&(r(e,t,n),v4(t,n))}return LB(n,`touchmove`,i,{passive:!1,capture:!0})},[w,A,C,O,M,j,u,pe,D,ne]),Y(()=>{re&&!de.swiping&&ce(!C||T?0:ie??0,!0,!1)},[ce,p,T,f,C,ie,re,de.swiping,s,k]),Y(()=>{if(f)return C||f(0),()=>{f(0)}},[f,C]),Y(()=>{C&&(h.current||me(),se())},[se,C,me,h]),Y(()=>{let e=l.current;return()=>{k?.set({swipeProgress:0,frontmostHeight:0}),s4(e,!1);let t=l.current;t!==e&&s4(t,!1),U()}},[l,U,k]);let he=G.useMemo(()=>({swiping:de.swiping,getDragStyles:de.getDragStyles,swipeStrength:P??null,setSwipeDismissed:oe}),[oe,de.getDragStyles,de.swiping,P]);function ge(e){te.current=e,H.current=null}function _e(){ge(!1),B.current=``,V.current=!1}function ve(e){return B.current=``,e.pointerType!==`touch`}return(0,Z.jsx)(o1,{ref:t,className:r,style:i,render:n,...nW(o,{onPointerDown(e){if(B.current=e.pointerType,V.current=e.pointerType===`pen`,!C||!w||A)return;let t=k2(e.currentTarget.getRootNode(),e.clientX,e.clientY);c4(t)||l4(t)||e.pointerType!==`touch`&&W.onPointerDown?.(e)},onPointerMove(e){e.pointerType!==`touch`&&W.onPointerMove?.(e)},onPointerUp(e){ve(e)&&W.onPointerUp?.(e)},onPointerCancel(e){ve(e)&&W.onPointerCancel?.(e)},onTouchStart(e){if(B.current===`pen`&&V.current){V.current=!1,ge(!1);return}if(!C||!w||A){ge(!1);return}let t=e.touches[0];if(!t)return;if(_4(e)){ge(!1);return}let n=e.currentTarget,r=k2(n.getRootNode(),t.clientX,t.clientY),i=mV(e.nativeEvent),a=hB(i)?i:n;if(!pV(n,a)){ge(!0);return}if(ne?.onTouchStart(e),c4(r)){ge(!0);return}te.current=!1;let o=O2(a,n,j),s=O2(a,n,N)!=null,c=null;o&&(c=S4(o,j,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},fe.onTouchStart?.(e)},onTouchEnd(e){ne?.onTouchEnd(e),_e(),fe.onTouchEnd?.(e)},onTouchCancel(e){ne?.onTouchCancel(),_e(),fe.onTouchCancel?.(e)},[W2]:void 0}),children:(0,Z.jsx)(f2.Provider,{value:he,children:a})})});function s4(e,t){e?.toggleAttribute(a2,t)}function c4(e){return!!e?.closest(DW)}function l4(e){return!!e?.closest(a4)}function u4(e,t){return t===`left`||t===`right`?e.offsetWidth:e.offsetHeight}function d4(e,t){return Math.max(u4(e,t)*.5,q2)}function f4(e,t){return e instanceof t.HTMLInputElement&&e.type===`range`}function p4(e){return e.tagName===`INPUT`||e.tagName===`TEXTAREA`}function m4(e,t){let n=hB(e.anchorNode)?e.anchorNode:e.anchorNode?.parentElement,r=hB(e.focusNode)?e.focusNode:e.focusNode?.parentElement;return e.containsNode(t,!0)||pV(t,n)||pV(t,r)}function h4(e,t){let n=fV(e);if(n&&pV(t,n)&&p4(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:m4(r,t)}function g4(e,t){return e.composedPath().some(e=>f4(e,t))}function _4(e){return g4(e.nativeEvent,fB(e.currentTarget))}function v4(e,t){e.lastX=t.clientX,e.lastY=t.clientY}function y4(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>=r4&&s>o+i4?(e.preserveNativeCrossAxisScroll=!0,!0):o>=r4?(e.drawerAxisAttributed=!0,!1):!0}function b4(e,t){return x4(e,t).max>0}function x4(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 S4(e,t,n){let r=w4(n,t),{offset:i,max:a}=x4(e,t);return r?i<=0:i>=a}function C4(e,t,n,r){return(w4(n,t)?r>0:r<0)&&S4(e,t,n)}function w4(e,t){return t===`vertical`?e===`down`:e===`right`}var T4=(0,G.createContext)(void 0),E4=e=>({className:t})=>(0,G.createElement)(Os,{icon:e,"aria-hidden":!0,...t===void 0?{}:{className:t}}),D4={alignCenter:E4(xs),alignLeft:E4(Ss),alignRight:E4(Cs),arrowLeft:E4(To),arrowUp:E4(ko),arrowsExpand:E4(Co),arrowsToCenter:E4(Do),bulletList:E4(Jo),buttonCursor:E4(Lo),chatBubble:E4(jo),check:E4(ws),checkList:E4(No),chevronDown:E4(So),chevronLeft:E4(wo),chevronRight:E4(Eo),chevronUp:E4(Oo),clock:E4(Po),code:E4(vs),compare:E4(Ho),dividerY:E4(ms),download:E4(zo),duplicate:E4(Io),envelope:E4(Zo),eye:E4(Es),files:E4(Bo),frame:E4(Vo),gridLayoutRows:E4(qo),heading1:E4(Uo),image:E4(Wo),layers:E4(Go),link:E4(Yo),message:E4(Qo),mobile:E4(gs),minus:E4($o),monitor:E4(Fo),moon:E4(es),moreHorizontal:E4(ts),openExternal:E4(Xo),paintBrush:E4(rs),palette:E4(ns),paragraph:E4(cs),pin:E4(ls),plus:E4(xo),redo:E4(us),refresh:E4(ds),reset:E4(fs),rule:E4(_s),search:E4(ps),sidebarLeft:E4(as),sidebarLeftHide:E4(is),sidebarRight:E4(ss),sidebarRightHide:E4(os),sliders:E4(hs),spacer:E4(Ao),sparkle:E4(ys),sun:E4(bs),textColumns:E4(Ko),trash:E4(Ro),undo:E4(Ts),xmark:E4(Mo)},O4=(0,G.createContext)(D4),k4=O4.Provider,A4=()=>(0,G.useContext)(O4),j4=(0,G.createContext)(null);function M4(){let e=(0,G.useContext)(j4);if(e===null)throw Error(`useEditorBundle must be used within an EditorProvider`);return e}function Q(e){return Ms(M4().store,e)}function N4(){return M4().store}var P4=e=>`${e.fileName}:${e.lineNumber}:${e.columnNumber}`,F4=e=>e.occurrences>1?`${e.tag} ${e.occurrence} of ${e.occurrences}`:e.tag,I4=(e,t)=>{let n=e.origins[0];if(n===void 0)return F4(e);let r=t.split(`
|
|
177
|
+
`)[n.lineNumber-1];return r===void 0?F4(e):r.slice(Math.max(0,n.columnNumber-1)).match(/<([A-Za-z][A-Za-z0-9_.:-]*)/)?.[1]??F4(e)},L4=(e,t)=>{let n=t.slice(e.start,e.end).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,` `).replace(/<[^>]+>/g,` `).replace(/ /gi,` `).replace(/&/gi,`&`).replace(/</gi,`<`).replace(/>/gi,`>`).replace(/"/gi,`"`).replace(/'/gi,`'`).replace(/\s+/g,` `).trim();if(n!==``)return n.length>72?`${n.slice(0,69).trimEnd()}…`:n},R4=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},z4=e=>{let t=Xc(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}},B4=(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},V4=(e,t)=>[...B4(e,t),t].flatMap(t=>{let n=e.index.get(t);return n===void 0?[]:[{instancePath:t,label:F4(n)}]}),H4={html:`Email`,h1:`Heading`,h2:`Heading`,h3:`Heading`,h4:`Heading`,h5:`Heading`,h6:`Heading`,p:`Text`,span:`Text`,strong:`Bold text`,em:`Italic text`,a:`Link`,img:`Image`,div:`Box`,ul:`List`,ol:`List`,li:`List item`,hr:`Divider`,table:`Table`,td:`Cell`,button:`Button`,br:`Line break`},U4=(e,t)=>{if(e.tag===`html`)return`Email`;let n=I4(e,t);return/^[A-Z]/.test(n)?n.split(`.`).at(-1)??n:H4[n]??H4[e.tag]??n},W4=e=>e.occurrences>1?`${e.occurrence} of ${e.occurrences}`:void 0,G4=e=>e.origins.length===0?e.instancePath:e.origins.map(e=>`${e.fileName}:${e.lineNumber}:${e.columnNumber}`).join(`>`),K4=e=>{let t=[];for(let n of e){let e=t.at(-1);e!==void 0&&G4(e.selection)===G4(n.selection)?t[t.length-1]={...e,copies:e.copies+1}:t.push(n)}return t},q4=e=>{let t=n=>{let r=e.nodes.get(n);if(r===void 0)return[];let i=K4(r.children.flatMap(e=>t(e.instancePath)));return r.selection.authored?[{instancePath:n,selection:r.selection,children:i,copies:1}]:i};return e.roots.flatMap(e=>t(e.instancePath))},J4=(e,t)=>{let n=[],r=e.index.get(t)?.parentPath;for(;r!==void 0;){let t=e.index.get(r);if(t===void 0)break;t.authored&&t.tag!==`html`&&n.unshift(t),r=t.parentPath}return n},Y4=(e,t)=>{let n=t;for(;n!==void 0;){let t=e.index.get(n);if(t===void 0)return;if(t.authored)return t;n=t.parentPath}},X4=e=>{let t=/@theme\s*\{([\s\S]*?)\}/.exec(e)?.[1]??``,n=[];for(let e of t.matchAll(/--color-([a-z0-9-]+)\s*:\s*([^;]+);/gi)){let t=e[1],r=e[2];t!==void 0&&!n.some(e=>e.name===t)&&n.push({name:t,value:r?.trim()})}return n},Z4=new Set([`left`,`center`,`right`,`justify`,`start`,`end`,`xs`,`sm`,`base`,`lg`,`xl`,`2xl`,`3xl`,`4xl`,`5xl`,`6xl`,`transparent`,`current`,`inherit`,`clip`,`ellipsis`,`wrap`,`nowrap`,`balance`,`pretty`]),Q4=e=>{let t=new Set;for(let n of e.matchAll(/(?:^|[\s"'`])(?:text|bg|border)-([a-z][a-z0-9-]*)(?=[\s"'`]|$)/g)){let e=n[1];e!==void 0&&!Z4.has(e)&&!/^\d/.test(e)&&t.add(e)}return[...t]},$4=e=>e.split(/\s+/).filter(e=>e!==``),e3=e=>e.replace(/([a-z])([A-Z])/g,`$1 $2`).split(` `).map((e,t)=>t===0?e.charAt(0).toUpperCase()+e.slice(1):e.length===1?e.toUpperCase():e.toLowerCase()).join(` `),t3={kind:`document`},n3={kind:`envelope`},r3=e=>new TextEncoder().encode(e).length,i3=e=>Math.max(1,Math.round(e/1024)),a3=e=>e.sentBytes??r3(e.html),o3=e=>e.channel===`email`&&e.render?.sentBytes!==void 0?`sent`:`preview`,s3=e=>e.render===null?0:e.channel===`email`?i3(a3(e.render)):e.channel===`sms`?i3(r3(e.render.text)):i3(r3(JSON.stringify(e.render))),c3=(e,t)=>({outline:e.channel===`email`&&e.render!==null?z4(e.render.selections):null,sizeKb:s3(e),sizeSource:o3(e),checks:b3(e,t)}),l3=(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}),u3=(e,t)=>e.tag===t.tag&&e.authored===t.authored&&e.occurrence===t.occurrence&&e.occurrences===t.occurrences&&l3(e,t),d3=(e,t,n)=>{if(e.kind!==`element`)return e;if(t===null||t.channel!==`email`)return t3;let{render:r,fixture:i}=t;if(r===null||i===null)return t3;let a=r.selections.find(t=>t.instancePath===e.instancePath);if(a===void 0)return t3;if(e.revision===r.revision&&e.fixture===i)return e;let o=n?.index.get(e.instancePath);return o===void 0||!u3(o,a)?t3:{kind:`element`,instancePath:e.instancePath,revision:r.revision,fixture:i}},f3=(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!==e.channel)throw Error(`Host sent a ${t.channel} 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,...t.channel===`email`?{incompatibilities:t.incompatibilities}:{}}},p3=104448,m3=e=>e.severity===`error`?`error`:e.severity===`warning`?`warn`:`info`,h3=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(`-`,` `),g3=(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])=>_3(`${t}:${e}`,[...n.values()]))},_3=(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:m3(i),label:i.compatibility?.title??h3(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}},v3=e=>{let t=a3(e),n=e.sentBytes===void 0?`The preview HTML is`:`The email as sent is`;return t<=p3?{id:`size:gmail-clip`,severity:`ok`,label:`Gmail clipping`,detail:`${n} ${Math.ceil(t/1024)} KB, under Gmail's 102 KB clipping threshold.`}:{id:`size:gmail-clip`,severity:`warn`,label:`Gmail clipping risk`,detail:`${n} ${Math.ceil(t/1024)} KB, above Gmail's 102 KB clipping threshold.`}},y3={id:`build:no-render`,severity:`error`,label:`No render`,detail:`The template entry did not produce a render at this revision.`},b3=(e,t)=>{let n=[...g3(e.diagnostics,`diagnostic`),...e.channel===`email`?g3(e.incompatibilities,`compat`):[]];return e.render===null?[...n.length===0?[y3]:n,...t]:e.channel===`email`?[...n,v3(e.render),...t]:[...n,...t]},x3=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}},S3=(e,t,n)=>`${e} ${e===1?t:n}`,C3=e=>{let{errorCount:t,warnCount:n,info:r}=x3(e),i=r.filter(e=>e.diagnostics?.some(e=>e.compatibility?.assessment===`unverified`)),a=[];t>0&&a.push({severity:`error`,text:S3(t,`error`,`errors`)}),n>0&&a.push({severity:`warn`,text:S3(n,`warning`,`warnings`)}),i.length>0&&a.push({severity:`info`,text:S3(i.length,`tip`,`tips`)});let o=a.map(e=>e.text).join(` · `);return a.length===0&&(o=e.length===0?`No checks yet`:`No issues found`),{parts:a,text:o,tone:t>0?`error`:n>0?`warning`:`neutral`}},w3=(e,t)=>{let n=Math.max(0,Math.round((e-t)/1e3));if(n<45)return`just now`;let r=Math.round(n/60);if(r<60)return`${r} min ago`;let i=Math.round(r/60);return i<24?`${i} h ago`:`${Math.round(i/24)} d ago`},T3=(e,t,n,r,i={})=>{let a=MR(e,t,n,i);if(a===null)return{ok:!1,reason:`This content changed. Select it again before editing.`};let o=r.kind===`text`?`children`:r.name,s=r.kind===`text`?r.text:r.value,c=a.properties.find(e=>e.name===o);if(c===void 0)return{ok:!1,reason:r.kind===`text`?`This content includes formatting. Choose a single piece of text to edit.`:`This setting cannot be edited here.`};let l=FR(e,c,s);if(l===null)return{ok:!1,reason:`That value does not fit this setting.`};let u=RR(e,[l],{markdown:{file:t}}),d=`This change cannot keep the text and formatting intact. Try different text.`;if(!u.ok||MR(u.source,t,n,i)?.properties.find(e=>e.name===o)?.value!==s)return{ok:!1,reason:d};let f=e=>SR(e,t).sourceNodes.map(e=>[e.kind,e.tag,e.properties.map(e=>e.name)]);return JSON.stringify(f(e))===JSON.stringify(f(u.source))?{ok:!0,edits:l.before===l.after?[]:[l]}:{ok:!1,reason:d}},E3=e=>M(e,`_tag`)&&e._tag===`DocumentUnavailable`&&M(e,`reason`)&&typeof e.reason==`string`,D3=e=>E3(e)?e.reason:e instanceof Error?e.message:`The document session failed.`,O3=(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(E3(e)){t.onStorageError(e.reason),i=!1,f(e);return}r=[],o=!0,t.onConflict();break}}u===c&&(o&&(r=[]),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(D3(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(D3(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}}},k3=e=>{let t=e.origins[0];return t===void 0||!e.authored?null:`${t.fileName}:${t.lineNumber}:${t.columnNumber}#${e.occurrence}`},A3=(e,t,n)=>{let r=e.find(e=>e.instancePath===n);if(r===void 0)return null;let i=r.origins[0];if(i===void 0)return null;let a=k3(r)??`${i.fileName}:${i.lineNumber}:${i.columnNumber}#${r.occurrence}`;return t.find(e=>k3(e)===a)?.instancePath??null},j3=[`source`,`design`,`review`,`checks`],M3={desktop:600,mobile:375},N3=`samva.editor.leftWidth`,P3=`samva.editor.assistantWidth`,F3=`samva.editor.rightWidth`,I3=`samva.editor.chatCollapsed`,L3=`samva.editor.workTabs`,R3=`samva.editor.workTab`,z3=260,B3=420,V3=320,H3=200,U3=420,W3=260,G3=440,K3={status:`idle`},q3=`Apply or reset your Design edits before editing the source.`,J3=e=>`Design: ${e} ${e===1?`edit`:`edits`}`,Y3=e=>(e.designDraft?.edits.length??0)>0||e.designApply.status===`applying`||e.designSettling,X3=e=>e.designDraft?.edits.length??0,Z3=e=>{try{return localStorage.getItem(e)}catch{return null}},Q3=(e,t)=>{try{localStorage.setItem(e,t)}catch{}},$3=(e,t)=>{let n=Z3(e);if(n===null)return t;let r=Number(n);return Number.isFinite(r)?r:t},e6=(e,t)=>Q3(e,String(t)),t6=e=>j3.some(t=>t===e),n6=()=>{let e=Z3(L3);if(e===null)return[];let t=new Set(e.split(`,`));return j3.filter(e=>t.has(e))},r6=e=>{let t=Z3(R3);return t6(t)&&e.includes(t)?t:`preview`},i6=e=>Math.min(640,Math.max(280,Math.round(e))),a6=e=>e===`fit`?e:Math.min(200,Math.max(50,Math.round(e))),o6=e=>e!==null&&e.channel===`email`?e.render:null,s6=(e,t)=>{let n,r,i,a=0,o,s=0,c=!1,l,u=t=>e.access!==`editable`||t.doc?.access.kind===`readonly`||t.lifecycleBusy||t.previewRefreshing,d=t=>t!==null&&e.access===`editable`&&e.sourceAccess===`editable`&&t.access.kind!==`readonly`,f=(e,t,n)=>({doc:t,pendingAuthoredSource:n,...c3(t,e.hostChecks),render:o6(t),selection:d3(e.selection,t,e.outline)}),p=As((i,m)=>{let h=(t,n=!1)=>{let r=m(),{doc:i,render:a,selection:o}=r;if(e.access!==`editable`||i?.access.kind===`readonly`||r.previewRefreshing||r.lifecycleBusy&&!c||!r.editable||!r.sourceEditable||r.hostBusy||r.conflict||r.pendingAuthoredSource!==null||i?.channel!==`email`||i.fixture===null||a===null||a.revision!==i.rev||n&&(o.kind!==`element`||o.instancePath!==t||o.revision!==a.revision||o.fixture!==i.fixture)||r.lifecycleCapability?.status!==`ready`)return null;let s=a.selections.find(e=>e.instancePath===t),l=s?.origins.find(e=>e.fileName.endsWith(`.md`));return s===void 0||l===void 0?null:{doc:i,render:a,fixture:i.fixture,origin:l,tag:s.tag,api:r.lifecycleCapability.api}},g=`This content changed. Select it again before editing.`,_=new Map,v=e=>i({sourceEditError:e}),y=e=>{_.clear(),v(e)},b=(e,t)=>new Promise(n=>{let r=()=>{let{doc:n,render:r}=m();return n?.rev===e&&n.fixture===t&&r?.revision===e},i=e=>{clearTimeout(a),o(),l=void 0,n(e)},a=setTimeout(()=>i(!1),2e3),o=p.subscribe(()=>{r()&&i(!0)});l=()=>i(!1),r()&&i(!0)}),x=()=>{if(c||o!==void 0)return;let e=_.entries().next();if(e.done===!0)return;let[t,r]=e.value;_.delete(t);let i=h(t);if(i===null||i.doc.rev!==r.revision||i.fixture!==r.fixture||i.tag!==r.tag||i.origin.fileName!==r.file)return v(g),x();if(!k.beginLifecycle())return y(g);c=!0;let a=s;n.flushSaves().then(async()=>{if(a!==s)return;let e=await i.api.inspect();if(a!==s)return;if(h(t)===null||m().render!==i.render||m().doc?.fixture!==r.fixture||e.rev!==r.revision)return v(g);let n=e.files.find(e=>e.path===r.file);if(n?.content==null||n.binary===!0||n.status===`deleted`)return v(`This content is unavailable. Select it again before editing.`);let o=T3(n.content,n.path,i.origin,{kind:`text`,text:r.text},{tag:r.tag});if(!o.ok)return v(o.reason);if(o.edits.length===0)return;let c=RR(n.content,o.edits,{markdown:{file:n.path}});if(!c.ok)return v(`This change cannot keep the text and formatting intact.`);let l=await i.api.updateFile({path:n.path,baseRev:e.rev,content:c.source});if(a!==s)return;let u=await b(l.rev,r.fixture);if(a===s){if(!u)return y(`Couldn't save this change. Try again.`);for(let[t,n]of _)n.revision===e.rev&&_.set(t,{...n,revision:l.rev})}}).catch(()=>{a===s&&y(`Couldn't save this change. Try again.`)}).finally(()=>{a===s&&(c=!1,k.endLifecycle(),x())})},S=(e,t)=>{let r=m();r.doc!==null&&(i({doc:{...r.doc,origin:{...r.doc.origin,authoredSource:e}},pendingAuthoredSource:e,sourceEditError:null}),n.enqueueAuthoredSource(e,{coalesceKey:t?.coalesceKey??`authored-source`}))},C=()=>{i({designSettling:!0}),n.flushSaves().then(()=>{let e=m();!e.conflict&&e.storageError===null&&i({designSettling:!1})},()=>{})},w=(e,t)=>{let n=m();if(n.doc===null||n.designApply.status===`applying`)return;let r=(e===`undo`?t.edits:t.undone).at(-1);if(r!==void 0){if(n.doc.origin.authoredSource!==(e===`undo`?r.after:r.before)){i({sourceEditError:`Your edits conflict with a newer change. Your current work is kept. Review the saved versions.`});return}i({designDraft:e===`undo`?{...t,edits:t.edits.slice(0,-1),undone:[...t.undone,r]}:{...t,undone:t.undone.slice(0,-1),edits:[...t.edits,r]},designCompare:!1,designApply:K3}),S(e===`undo`?r.before:r.after),C()}},T=e=>{let t=m(),n=t.designDraft===null||t.designDraft.edits.length===0,r=n?{baseSource:e.before,baseRender:t.render,edits:[],undone:[]}:t.designDraft,a=r.edits.at(-1),o=e.key!==void 0&&a?.key===e.key&&a.after===e.before;i({...n?{redoHistory:[]}:{},canvasMode:`design`,designCompare:!1,designApply:K3,designDraft:{...r,edits:o?[...r.edits.slice(0,-1),{label:e.label,before:a.before,after:e.after,key:e.key}]:[...r.edits,{label:e.label,before:e.before,after:e.after,key:e.key}],undone:[]}}),S(e.after,{coalesceKey:e.key})},E=e=>{let t=m();if(u(t)||!t.sourceEditable||t.conflict||t.doc===null)return;let n=t.designDraft;if(n!==null&&(e===`undo`?n.edits.length>0:n.undone.length>0)){w(e,n);return}let r=e===`undo`?t.undoHistory:t.redoHistory,a=r.at(-1);if(a!==void 0){if(t.doc.origin.authoredSource!==(e===`undo`?a.after:a.before)){i({sourceEditError:`History conflicts with a newer change. Your current work is kept. Review the saved versions.`});return}i(e===`undo`?{designDraft:null,undoHistory:r.slice(0,-1),redoHistory:[...t.redoHistory,a]}:{redoHistory:r.slice(0,-1),undoHistory:[...t.undoHistory,a]}),S(e===`undo`?a.before:a.after)}},D=()=>(Q3(I3,`false`),{chatCollapsed:!1,focusedPane:`assistant`}),O=n6(),k={inspectMarkdown:async e=>{let t=h(e,!0);if(t===null)return null;let n=s;return t.api.inspect().then(r=>{if(n!==s||m().render!==t.render||h(e,!0)===null||r.rev!==t.doc.rev)return null;let i=r.files.find(e=>e.path===t.origin.fileName);return i?.content==null||i.binary===!0||i.status===`deleted`?null:MR(i.content,i.path,t.origin,{tag:t.tag})},()=>(n===s&&i({sourceEditError:`Couldn't read this content. Try again.`}),null))},editMarkdownText:(e,t)=>{let n=h(e,!0);if(n===null){i({sourceEditError:`This content cannot be edited right now. Select it again to retry.`});return}i({sourceEditError:null}),_.set(e,{file:n.origin.fileName,tag:n.tag,fixture:n.fixture,revision:n.doc.rev,text:t}),o!==void 0&&clearTimeout(o),o=setTimeout(()=>{o=void 0,x()},300)},requestSourceAssistance:e=>i({assistantOriginIndex:e,rightCollapsed:!1,...D()}),requestDiagnosticAssistance:e=>{let t=m();t.doc===null||u(t)||t.pendingAuthoredSource!==null||t.conflict||i({diagnosticAssistance:{id:(t.diagnosticAssistance?.id??0)+1,revision:t.doc.rev,check:e},rightCollapsed:!1,...D()})},openSource:()=>{i({workspaceView:`source`}),k.openWorkTab(`source`)},undo:()=>E(`undo`),redo:()=>E(`redo`),applySourceEdit:e=>{let t=m();if(u(t)||!t.sourceEditable||t.conflict||t.doc===null)return;if(t.doc.rev!==e.revision||t.doc.origin.authoredSource!==e.source||t.pendingAuthoredSource!==null&&e.coalesceKey===void 0){i({sourceEditError:`That edit is stale. The preview moved on. Reselect the element and try again.`});return}let n=RR(e.source,e.edits,{profile:{entry:t.doc.origin.file}});if(!n.ok){i({sourceEditError:n.reason});return}if(n.source===e.source)return;if(e.design!==void 0){if(t.hostBusy){i({sourceEditError:`Design waits for the assistant to finish.`});return}T({before:e.source,after:n.source,label:e.design.label,key:e.coalesceKey});return}if(X3(t)>0){i({sourceEditError:q3});return}let r=t.undoHistory.at(-1);i({designDraft:null,undoHistory:e.coalesceKey!==void 0&&r?.key===e.coalesceKey&&r.after===e.source?[...t.undoHistory.slice(0,-1),{before:r.before,after:n.source,key:e.coalesceKey}]:[...t.undoHistory,{before:e.source,after:n.source,key:e.coalesceKey}],redoHistory:[]}),S(n.source,{coalesceKey:e.coalesceKey})},replaceAuthoredSource:e=>{let t=m();if(!(u(t)||!t.sourceEditable||t.doc===null||e===t.doc.origin.authoredSource||t.conflict)){if(X3(t)>0){i({sourceEditError:q3});return}i({designDraft:null,undoHistory:[...t.undoHistory,{before:t.doc.origin.authoredSource,after:e}],redoHistory:[]}),S(e)}},viewFixture:e=>{let t=m(),n=t.fixtureCapability;n?.status===`ready`&&t.doc!==null&&!t.fixtureBusy&&t.doc.fixtures.includes(e)&&t.doc.fixture!==e&&(i({fixtureBusy:!0,fixtureError:null}),n.api.view(e).then(()=>i({fixtureBusy:!1}),()=>i({fixtureBusy:!1,fixtureError:`Couldn't render the ${e} fixture.`})))},setPreviewTarget:t=>{(t!==`web`||e.render!==void 0)&&m().previewTarget!==t&&i({previewTarget:t})},selectFromPage:e=>{let{pageRender:t,render:n}=m();if(t===null||n===null||t.revision!==n.revision)return;let r=A3(t.selections,n.selections,e);k.select(r)},reload:()=>{m().lifecycleBusy||(i({conflict:!1,storageError:null,fixtureError:null,designSettling:!1}),n.reload())},flushSaves:()=>n.flushSaves(),beginLifecycle:()=>{let t=m();return t.lifecycleBusy||t.doc===null||e.access!==`editable`||t.doc.access.kind===`readonly`?!1:(i({lifecycleBusy:!0}),!0)},endLifecycle:()=>i({lifecycleBusy:!1}),adoptLifecycleSnapshot:e=>{n.adoptRev(e.rev),i(t=>{if(t.doc===null)return{conflict:!1};let n={...t.doc,rev:e.rev,origin:{...t.doc.origin,authoredSource:e.authoredSource}},r=e.authoredSource!==t.doc.origin.authoredSource;return{...f(t,n,null),sourceEditable:d(n),conflict:!1,...r?{designDraft:null,designCompare:!1}:{}}})},retrySave:()=>{u(m())||(n.retrySave(),m().designSettling&&C())},select:e=>{i(t=>{if(e===null)return{selection:t3};let{render:n,doc:r}=t;if(n===null||r?.channel!==`email`||r.fixture===null||!n.selections.some(t=>t.instancePath===e))return{selection:t3};let i=new Set(t.collapsedLayers);if(t.outline!==null)for(let n of B4(t.outline,e))i.delete(n);return{assistantOriginIndex:0,selection:{kind:`element`,instancePath:e,revision:n.revision,fixture:r.fixture},collapsedLayers:i}});let{selection:t}=m();t.kind===`element`&&r?.({instancePath:t.instancePath,revision:t.revision,fixture:t.fixture})},selectDocument:()=>i({selection:t3}),selectEnvelope:()=>i({selection:n3}),toggleLeft:()=>i(e=>({leftCollapsed:!e.leftCollapsed})),toggleRight:()=>i(e=>({rightCollapsed:!e.rightCollapsed})),openWorkTab:e=>{let t=m(),n=e===`preview`||t.workTabs.includes(e)?t.workTabs:j3.filter(n=>n===e||t.workTabs.includes(n));(n!==t.workTabs||t.activeWorkTab!==e)&&(Q3(L3,n.join(`,`)),Q3(R3,e),i({workTabs:n,activeWorkTab:e}))},closeWorkTab:e=>{let t=m(),n=t.workTabs.indexOf(e);if(n===-1)return;let r=t.workTabs.filter(t=>t!==e),a=t.activeWorkTab===e?t.workTabs[n-1]??`preview`:t.activeWorkTab;Q3(L3,r.join(`,`)),Q3(R3,a),i({workTabs:r,activeWorkTab:a})},setChatCollapsed:e=>{m().chatCollapsed!==e&&(Q3(I3,String(e)),i({chatCollapsed:e}))},setFocusedPane:e=>{let t=m();(t.focusedPane!==e||e===`preview`&&t.previewUnseen)&&i(e===`preview`?{focusedPane:e,previewUnseen:!1}:{focusedPane:e})},openReview:()=>{k.openWorkTab(`review`),i({focusedPane:`preview`,previewUnseen:!1})},refreshPreview:()=>{let e=m();e.doc===null||e.pendingAuthoredSource!==null||e.metadataSaving||e.conflict||e.lifecycleBusy||(i({previewEpoch:e.previewEpoch+1,previewRefreshing:!0}),n.reload())},setWorkspaceView:e=>i({workspaceView:e}),setLeftWidth:e=>{let t=Math.min(U3,Math.max(H3,Math.round(e)));e6(N3,t),i({leftWidth:t})},setAssistantWidth:e=>{let t=i6(e);e6(P3,t),i({assistantWidth:t})},setRightWidth:e=>{let t=Math.min(G3,Math.max(W3,Math.round(e)));e6(F3,t),i({rightWidth:t})},setPreviewDevice:e=>i({previewDevice:e}),setCanvasZoom:e=>{let t=a6(e);m().canvasZoom!==t&&i({canvasZoom:t})},setLayoutMode:e=>{if(m().layoutMode!==e){if(e===`wide`){i({layoutMode:e,leftCollapsed:!1,rightCollapsed:!1,canvasZoom:100,previewUnseen:!1});return}if(e===`standard`){i({layoutMode:e,leftCollapsed:!1,rightCollapsed:!0,canvasZoom:`fit`});return}i({layoutMode:e,leftCollapsed:!0,rightCollapsed:!0,canvasZoom:`fit`})}},setRenameActive:e=>i({renameActive:e}),rename:t=>{let n=m();if(u(n)||e.access!==`editable`||e.metadataAccess===`readonly`)return;let r=e.writer,a=n.doc;if(a===null)return;let o=t.trim()||`Untitled template`;o!==a.name&&(i(e=>e.doc===null?e:{doc:{...e.doc,name:o},metadataSaving:!0,metadataError:null}),r.save({kind:`metadata`,patch:{name:o}}).then(()=>i({metadataSaving:!1}),()=>{i(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=m();if(u(n)||e.access!==`editable`||e.metadataAccess===`readonly`)return;let r=e.writer,a=n.doc;a!==null&&(i(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}),r.save({kind:`metadata`,patch:t}).then(()=>i({metadataSaving:!1}),()=>{i(e=>({doc:e.doc===null?e.doc:{...e.doc,metadata:a.metadata},metadataSaving:!1,metadataError:`Couldn't save the sender defaults.`}))}))},toggleLayerExpand:e=>i(t=>{let n=new Set(t.collapsedLayers);return n.has(e)?n.delete(e):n.add(e),{collapsedLayers:n}}),ancestryOf:e=>{let{outline:t}=m();return t===null?[]:B4(t,e)},breadcrumbOf:e=>{let{outline:t}=m();return t===null?[]:V4(t,e)},setHovered:e=>i({hoveredCandidatePath:e}),setCanvasMode:e=>{let t=m();t.canvasMode!==e&&(t.canvasMode===`design`&&Y3(t)||e===`design`&&t.hostBusy||i({canvasMode:e,designDraft:e===`design`?t.designDraft:null,designCompare:!1,designApply:K3,hoveredCandidatePath:null}))},resetDesign:()=>{let e=m(),t=e.designDraft;if(!(t===null||t.edits.length===0||u(e)||!e.sourceEditable||e.conflict||e.doc===null)){if(e.doc.origin.authoredSource!==t.edits.at(-1)?.after){i({sourceEditError:`Your edits conflict with a newer change, so they can't be reset here. Review the saved versions.`});return}i({designDraft:null,designCompare:!1,designApply:K3}),S(t.baseSource),C()}},setDesignCompare:e=>{let t=m(),n=t.designDraft!==null&&t.designDraft.edits.length>0&&t.designDraft.baseRender!==null,r=e&&n;t.designCompare!==r&&i({designCompare:r})},applyDesign:()=>{let e=m(),t=e.designDraft;if(t===null||t.edits.length===0||e.designApply.status===`applying`||e.hostBusy)return;let r=t.edits.length,a=e.versionsCapability?.status===`ready`?e.versionsCapability.api:void 0;k.beginLifecycle()&&(i({designApply:{status:`applying`},designCompare:!1}),n.flushSaves().then(async n=>{let o=m();if(o.doc===null||o.conflict||o.storageError!==null||o.doc?.origin.authoredSource!==t.edits.at(-1)?.after){i({designApply:{status:`failed`,reason:`Your edits haven't reached the draft, so no version was saved.`}});return}let s=o.doc,c=a===void 0?n:await a.save(n,{message:J3(r)}),l=m().doc;a!==void 0&&(l?.rev===n||l?.rev===c)&&l.origin.authoredSource===s.origin.authoredSource&&k.adoptLifecycleSnapshot({rev:c,authoredSource:s.origin.authoredSource}),i(e=>({designDraft:null,designApply:K3,undoHistory:[...e.undoHistory,{before:t.baseSource,after:s.origin.authoredSource}],redoHistory:[]})),e.telemetry?.({name:`design.apply`,data:{edits:r}})}).catch(e=>i({designApply:{status:`failed`,reason:e instanceof Error&&e.message!==``?e.message:`The version could not be saved.`}})).finally(()=>k.endLifecycle()))},addPin:e=>{let t=m(),{render:n,doc:r,outline:o}=t;if(n===null||r?.channel!==`email`||r.fixture===null)return;let s=o?.index.get(e)??n.selections.find(t=>t.instancePath===e);if(s===void 0)return;let c=s.origins[0];a+=1,i({pins:[...t.pins,{id:`pin-${a}`,number:t.pins.length+1,instancePath:e,revision:n.revision,fixture:r.fixture,tag:s.tag,label:[U4(s,r.origin.authoredSource),W4(s)].filter(e=>e!==void 0).join(` `),origin:c===void 0?null:{fileName:c.fileName,lineNumber:c.lineNumber,columnNumber:c.columnNumber},note:``}]})},removePin:e=>{let t=m();t.pins.some(t=>t.id===e)&&i({pins:t.pins.filter(t=>t.id!==e).map((e,t)=>e.number===t+1?e:{...e,number:t+1})})},clearPins:()=>{m().pins.length>0&&i({pins:[]})},setPinNote:(e,t)=>i(n=>({pins:n.pins.map(n=>n.id===e?{...n,note:t}:n)})),setHostBusy:e=>{m().hostBusy!==e&&i({hostBusy:e})},setHostChecks:e=>{Object.is(m().hostChecks,e)||i(t=>({hostChecks:e,checks:t.doc===null?e:b3(t.doc,e)}))}};return{sourceEditError:null,assistantOriginIndex: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,sizeKb:0,sizeSource:`preview`,checks:t.hostChecks,hostChecks:t.hostChecks,lifecycleCapability:e.lifecycle,versionsCapability:e.versions,telemetry:e.telemetry,assetsCapability:e.assets,fixtureCapability:e.fixtures,pageAvailable:e.render!==void 0,previewTarget:`email`,pageRender:null,pageError:null,fixtureBusy:!1,fixtureError:null,diagnosticAssistance:null,selection:t3,renameActive:!1,collapsedLayers:new Set,leftCollapsed:!1,rightCollapsed:!1,workTabs:O,activeWorkTab:r6(O),chatCollapsed:Z3(I3)===`true`,focusedPane:t.initialPane??`assistant`,previewUnseen:!1,previewEpoch:0,previewRefreshing:!1,leftWidth:$3(N3,z3),assistantWidth:i6($3(P3,B3)),rightWidth:$3(F3,V3),previewDevice:`desktop`,canvasZoom:100,layoutMode:`wide`,metadataSaving:!1,metadataError:null,lifecycleBusy:!1,conflict:!1,storageError:null,draftSavedAt:null,hoveredCandidatePath:null,canvasMode:`point`,designDraft:null,designApply:K3,designCompare:!1,designSettling:!1,pins:[],hostBusy:!1,actions:k}}),m=(e,t)=>{p.setState(n=>{if(n.doc===null)return n;let r=t?n.pendingAuthoredSource:null,i=f3(n.doc,e,r),a=e.authoredSource!==void 0&&e.authoredSource===i.origin.authoredSource,o=e.origin!==`self`&&n.layoutMode!==`wide`&&n.focusedPane===`assistant`;return{...f(n,i,a?null:r),...o?{previewUnseen:!0}:{}}})};n=O3(e,{onInitial:t=>{p.setState(n=>({...f(n,t,null),previewRefreshing:!1,editable:e.access===`editable`&&t.access.kind!==`readonly`,sourceEditable:d(t),readonlyReason:t.access.kind===`readonly`?t.access.reason:null}))},onPersistedRevision:e=>{p.setState(t=>t.doc===null?t:{doc:{...t.doc,rev:e},draftSavedAt:Date.now()})},onSelfAck:e=>m(e,!0),onForeignChange:(e,t)=>{if(t){p.setState(t=>t.doc===null?t:{doc:{...t.doc,rev:e.rev},sourceEditable:!1,conflict:!0});return}m(e,!1),p.setState(e=>({sourceEditable:d(e.doc)}))},onConflict:()=>p.setState({conflict:!0,sourceEditable:!1}),onStorageError:e=>p.setState({storageError:e}),onSessionError:e=>p.setState({storageError:e,previewRefreshing:!1})}),p.subscribe((e,t)=>{e.pins!==t.pins&&i?.(e.pins)});let h=0,g=(t,n)=>{let r=e.render,{doc:i}=t;if(r===void 0||t.previewTarget!==`web`||i===null)return;let a=t.render?.revision??null,o=i.fixture;if(n!==null&&n.previewTarget===`web`&&n.previewEpoch===t.previewEpoch&&n.render?.revision===a&&n.doc?.fixture===o)return;if(o===null||a===null){p.setState({pageRender:null,pageError:null});return}h+=1;let s=h;r(i.origin.file,o,`web`).then(e=>{if(s!==h)return;let t=e!==null&&mo(e)?e:null,n=t!==null&&t.revision===p.getState().render?.revision;p.setState({pageRender:n?t:null,pageError:n?null:`Couldn't render the web page.`})},()=>{s===h&&p.setState({pageRender:null,pageError:`Couldn't render the web page.`})})};return p.subscribe((e,t)=>g(e,t)),{host:e,store:p,spine:{...n,dispose:()=>{s+=1,l?.(),o!==void 0&&clearTimeout(o),o=void 0,p.setState({lifecycleBusy:!1}),n.dispose()}},setUserSelectListener:e=>{r=e},setPinsListener:e=>{i=e}}},c6=[];function l6({host:e,checks:t=c6,icons:n,onSelectElement:r,onPinsChange:i,initialPane:a,preparePreviewDocument:o,children:s}){let[c,l]=(0,G.useState)(()=>s6(e,{hostChecks:t,initialPane:a}));c.host!==e&&l(s6(e,{hostChecks:t,initialPane:a})),(0,G.useEffect)(()=>(c.spine.open(),()=>c.spine.dispose()),[c]),(0,G.useEffect)(()=>{c.store.getState().actions.setHostChecks(t)},[c,t]),(0,G.useLayoutEffect)(()=>(c.setUserSelectListener(r),()=>c.setUserSelectListener(void 0)),[c,r]),(0,G.useLayoutEffect)(()=>(c.setPinsListener(i),()=>c.setPinsListener(void 0)),[c,i]);let u=(0,G.useMemo)(()=>n===void 0?D4:{...D4,...n},[n]);return(0,Z.jsx)(j4.Provider,{value:c,children:(0,Z.jsx)(T4.Provider,{value:o,children:(0,Z.jsx)(k4,{value:u,children:s})})})}function $(...e){return HZ(mX(e))}var u6=e=>{let t=({className:t})=>{let n=A4()[e];return(0,Z.jsx)(n,{...t===void 0?{}:{className:t}})};return t.displayName=`EditorIcon(${e})`,t},d6=u6(`arrowsExpand`);u6(`arrowsToCenter`);var f6=u6(`bulletList`),p6=u6(`buttonCursor`),m6=u6(`chevronDown`),h6=u6(`chevronLeft`),g6=u6(`chevronRight`),_6=u6(`chevronUp`),v6=u6(`dividerY`),y6=u6(`download`),b6=u6(`envelope`),x6=u6(`eye`);u6(`files`);var S6=u6(`frame`),C6=u6(`gridLayoutRows`),w6=u6(`heading1`),T6=u6(`image`),E6=u6(`layers`),D6=u6(`mobile`),O6=u6(`monitor`),k6=u6(`palette`),A6=u6(`paragraph`),j6=u6(`sidebarLeft`),M6=u6(`sidebarLeftHide`),N6=u6(`sidebarRight`),P6=u6(`sidebarRightHide`);u6(`sliders`);var F6=u6(`sparkle`),I6=u6(`textColumns`),L6=u6(`xmark`),R6=u6(`check`),z6=u6(`checkList`),B6=u6(`clock`),V6=u6(`code`),H6=u6(`compare`),U6=u6(`minus`),W6=u6(`moreHorizontal`),G6=u6(`openExternal`),K6=u6(`plus`),q6=u6(`refresh`),J6=u6(`search`),Y6=u6(`chatBubble`),X6=u6(`arrowUp`),Z6=u6(`duplicate`),Q6=u6(`paintBrush`),$6=u6(`pin`),e8=u6(`redo`),t8=u6(`reset`),n8=u6(`trash`),r8=u6(`undo`),i8=u6(`alignCenter`),a8=u6(`alignLeft`),o8=u6(`alignRight`),s8=u6(`rule`),c8=u6(`spacer`),l8=u6(`link`);function u8(e,{className:t,render:n,...r},i){let a=typeof t==`function`?t(i.state):t,o={"data-slot":e,...i.props};for(let[e,t]of Object.entries(r)){let n=o[e];o[e]=/^on[A-Z]/.test(e)&&typeof n==`function`&&typeof t==`function`?(...e)=>{t(...e),n(...e)}:t}return o.className=$(i.className,a),UZ({render:n,state:i.state,defaultTagName:i.tag??`div`,props:o})}var d8=`focus-visible:border-ring focus-visible:ring-ring/50 outline-none focus-visible:ring-3`,f8=$(`border-input dark:bg-input/30 placeholder:text-muted-foreground min-h-8 w-full min-w-0 rounded-lg border bg-transparent px-2.5 py-1 text-sm transition-colors`,`disabled:bg-input/50 dark:disabled:bg-input/80 disabled:cursor-not-allowed`,d8),p8=`bg-muted text-muted-foreground gap-0.5 rounded-lg p-[3px]`,m8=$(`h-full min-w-0 rounded-md! border border-transparent px-2 text-xs text-foreground/60 hover:bg-transparent hover:text-foreground`,`aria-pressed:bg-background aria-pressed:text-foreground aria-pressed:shadow-sm`,`dark:text-muted-foreground dark:aria-pressed:border-input dark:aria-pressed:bg-input/30 dark:aria-pressed:text-foreground`),h8=$(`opacity-0 transition-opacity duration-150`,`group-hover/row:opacity-100 group-has-[:focus-visible]/row:opacity-100 focus-visible:opacity-100`,`[@media(hover:none)]:opacity-100`),g8=`border-border flex h-11 shrink-0 items-center border-b`,_8=$(`border-border-subtle bg-surface-inset text-muted-foreground inline-flex h-6 min-w-0 max-w-44 shrink-0 items-center gap-1 rounded-md border px-2 text-xs font-medium whitespace-nowrap outline-none`,d8),v8=$(_8,`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground data-popup-open:bg-muted data-popup-open:text-foreground`),y8=new Set([`frame.start`,`document.switcher`,`rail.assistant`,`rail.review`,`statusbar.headline`]),b8=e=>{let t=new Set,n=new Map;for(let r of e){if(t.has(r.id))throw Error(`Editor contribution id "${r.id}" is used twice.`);t.add(r.id);let e=n.get(r.slot)??[];if(y8.has(r.slot)&&e.length>0)throw Error(`Editor region "${r.slot}" holds one contribution; "${e[0].id}" and "${r.id}" both target it.`);e.push(r),n.set(r.slot,e)}let r=n.get(`toolbar.actions`);if(r!==void 0){let e=e=>e.slot===`toolbar.actions`?e.order:void 0;n.set(`toolbar.actions`,r.toSorted((t,n)=>{let r=e(t),i=e(n);return r===void 0||i===void 0?r===i?0:r===void 0?1:-1:r-i}))}let i=e=>(n.get(e)??[]).filter(t=>t.slot===e);return{all:i,one:e=>i(e)[0]}},x8=(0,G.createContext)(b8([])),S8=x8.Provider,C8=e=>(0,G.useContext)(x8).one(e),w8=e=>(0,G.useContext)(x8).all(e),T8=(0,G.createContext)(null),E8=T8.Provider;function D8(){let e=C8(`rail.assistant`),t=C8(`rail.review`),n=(0,G.useContext)(T8),r=N4(),{doc:i,render:a,outline:o,selection:s,originIndex:c,checks:l,diagnosticAssistance:u,layout:d,canFix:f,designOn:p,designPending:m,designApplying:h,designWaits:g,pins:_}=Q(fX(e=>({doc:e.doc,render:e.render,outline:e.outline,selection:e.selection,originIndex:e.assistantOriginIndex,checks:e.checks,diagnosticAssistance:e.diagnosticAssistance,layout:e.layoutMode,designOn:e.canvasMode===`design`,designPending:X3(e),designApplying:e.designApply.status===`applying`,designWaits:Y3(e),pins:e.pins,canFix:e.sourceEditable&&!e.conflict&&e.pendingAuthoredSource===null&&!e.lifecycleBusy})));if(e===void 0||n===null)return null;let v=x3(l),y=s.kind===`element`?o?.index.get(s.instancePath)??null:null,b=y===null||s.kind!==`element`?null:{originIndex:c,instancePath:y.instancePath,fixture:s.fixture,label:F4(y)},x=i?.channel===`email`?i.fixture:null,S=o===null||x===null||a===null||i===null?[]:R4(o).map(({depth:e,node:t})=>{let n=L4(t.selection,a.html);return{instancePath:t.instancePath,fixture:x,...t.selection.origins[c]===void 0?{}:{originIndex:c},label:I4(t.selection,i.origin.authoredSource),...n===void 0?{}:{detail:n},depth:e,active:s.kind===`element`&&s.instancePath===t.instancePath}});return{panel:e.render({flushSaves:()=>r.getState().actions.flushSaves(),exportHtml:n.exportHtml,canExport:n.canExport,openReview:t===void 0?void 0:()=>r.getState().actions.openReview(),removePin:e=>r.getState().actions.removePin(e),clearPins:()=>r.getState().actions.clearPins(),workspace:{draftRevision:i?.rev??null,saveVersionStatus:n.saveVersionStatus,checks:{errors:v.errorCount,warnings:v.warnCount,findings:v.actionable,canFix:f},diagnosticAssistance:u,design:{on:p,pending:m,applying:h,waiting:g},pins:_,pointedElement:b,availableInstancePaths:o===null?[]:[...o.index.keys()],layout:d,layers:S}}),header:e.header??null}}function O8({hidden:e=!1,...t}){let n=D8(),r=Q(e=>e.assistantWidth),i=Q(e=>e.layoutMode)!==`wide`,a=u8(`editor-assistant-dock`,{"aria-label":`Assistant`,hidden:e,"data-editor-rail":`left`,"data-testid":`agent-column`,style:i?void 0:{width:r},...t},{state:{focused:i,hidden:e},tag:`aside`,className:$(`bg-background min-h-0 min-w-0 flex-col overflow-hidden`,e?`hidden`:`flex`,i?`h-full w-full flex-1`:`border-border h-full shrink-0 border-r`),props:{children:n===null?null:(0,Z.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,style:i?void 0:{width:r,maxWidth:`100%`},children:[(0,Z.jsxs)(`div`,{"data-slot":`editor-assistant-dock-header`,className:$(g8,`gap-2 px-3`),children:[(0,Z.jsx)(F6,{className:`text-primary size-4 shrink-0`}),(0,Z.jsx)(`p`,{className:`text-foreground truncate text-sm font-medium`,children:`Assistant`}),n.header!==null&&(0,Z.jsx)(`div`,{className:`ml-auto shrink-0`,children:n.header})]}),(0,Z.jsx)(`div`,{"data-slot":`editor-assistant-dock-body`,className:$(`flex min-h-0 flex-1 flex-col`,i&&`mx-auto w-full max-w-3xl`),children:n.panel})]})}});return n===null?null:a}function k8(){let e=D8(),{rightCollapsed:t,rightWidth:n,layoutMode:r}=Q(fX(e=>({rightCollapsed:e.rightCollapsed,rightWidth:e.rightWidth,layoutMode:e.layoutMode})));if(e===null)return null;let 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`,style:{width:t?0:n,maxWidth:i?`calc(100% - 48px)`:void 0},className:$(`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.panel})})})}var A8=(0,G.createContext)(void 0),j8=()=>(0,G.useContext)(A8);function M8({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:$(`border border-[color:var(--editor-well-border)] bg-[var(--editor-well-bg)] shadow-[var(--editor-well-shadow)]`,`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`)})]})}function N8(){let e=Q(e=>e.doc),t=Q(e=>X3(e)>0),n=Q(e=>e.sourceEditable)&&!t,{replaceAuthoredSource:r}=Q(e=>e.actions);return e===null?(0,Z.jsx)(`div`,{className:`text-muted-foreground grid flex-1 place-items-center text-sm`,children:`Loading…`}):(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:(0,Z.jsx)(M8,{label:`Authored TSX · ${e.origin.file}${t?` · apply or reset your Design edits to edit it`:``}`,source:e.origin.authoredSource,editable:n,testId:`source-workspace.authored-tsx`,onChange:n?r:void 0})})}function P8(e){let t=N4(),{applySourceEdit:n}=Q(e=>e.actions);return(0,G.useCallback)((r,i)=>{let{doc:a}=t.getState();if(a===null)return;let o=a.origin.authoredSource,s=e(o,r);if(!s.ok){t.setState({sourceEditError:s.reason});return}s.edits.length!==0&&n({revision:a.rev,source:o,edits:s.edits,coalesceKey:i})},[n,e,t])}function F8(e,t){return`${e}-view-tab-${t}`}var I8=$(m8,`px-3 text-[13px] capitalize`);function L8({value:e,onChange:t,children:n,panelId:r,idBase:i}){let a=(0,G.useId)(),o=i??a,s=`${o}-view-panel`;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{"data-slot":`editor-workspace-view`,className:`border-border bg-background flex h-11 shrink-0 items-center border-b px-3`,children:(0,Z.jsx)(nQ,{role:`tablist`,"aria-label":`Workspace view`,value:[e],onValueChange:e=>{let n=e[0];(n===`visual`||n===`source`)&&t(n)},className:$(p8,`flex h-8 items-center`),children:[`visual`,`source`].map(t=>(0,Z.jsx)(JZ,{id:F8(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}`,"data-editor-control":``,className:$(I8,`aria-selected:bg-background aria-selected:text-foreground aria-selected:shadow-sm dark:aria-selected:border-input dark:aria-selected:bg-input/30`),children:t},t))})}),r===void 0&&(0,Z.jsx)(`div`,{role:`tabpanel`,id:s,"aria-labelledby":F8(o,e),className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:n})]})}function R8({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]})}function z8({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 B8({summary:e}){return(0,Z.jsx)(`span`,{title:`Locked expression. Edit it in Source.`,"data-testid":`channel-workspace.locked-chip`,className:`border-border bg-surface-inset text-muted-foreground inline-flex max-w-full shrink-0 truncate rounded-md border border-dashed px-1.5 py-0.5 font-mono text-[11.5px]`,children:e})}function V8({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 H8({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))})}function U8({text:e,className:t}){let n=Kc(e);return(0,Z.jsxs)(`p`,{"data-testid":`sms-counter`,className:$(`text-muted-foreground`,t),children:[n.encoding.toUpperCase(),` · `,n.characterCount,` character`,n.characterCount===1?``:`s`,` · `,n.segmentCount,` segment`,n.segmentCount===1?``:`s`]})}function W8({reason:e}){return e===null?null:(0,Z.jsx)(`p`,{role:`alert`,"data-testid":`channel-workspace.edit-refusal`,className:`border-status-error/30 bg-status-error/5 text-status-error rounded-lg border px-3 py-2 text-[12px]`,children:e})}var G8=`none`;function K8({segments:e,editable:t,onChange:n}){let r=(0,G.useRef)(!1);return(0,Z.jsx)(`div`,{className:`bg-muted text-foreground rounded-[18px] px-4 py-3 text-[14px] whitespace-pre-wrap`,children:e.map((e,i)=>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-${i}`):(0,Z.jsx)(`span`,{role:`textbox`,"aria-label":`SMS message preview segment ${i+1}`,"data-testid":`sms-workspace.preview-segment.${i+1}`,"aria-multiline":`true`,contentEditable:t?`plaintext-only`:!1,suppressContentEditableWarning:!0,onCompositionStart:()=>{r.current=!0},onCompositionEnd:e=>{r.current=!1,n(i,e.currentTarget.textContent??``)},onInput:e=>{r.current||n(i,e.currentTarget.textContent??``)},className:`focus:bg-background focus-visible:ring-ring/50 rounded-sm outline-none focus-visible:ring-[3px]`,children:e.text},`text-${i}`))})}function q8({form:e,editable:t,onEdit:n}){let r=j8(),i=e.category.kind===`literal`?e.category.value:void 0;return(0,Z.jsxs)(`div`,{className:`grid gap-4`,children:[(0,Z.jsx)(R8,{label:`Category`,children:(0,Z.jsxs)(pJ,{value:i??G8,disabled:!t||e.category.kind===`expression`,onValueChange:e=>n({kind:`category`,value:_o.find(t=>t.value===e)?.value}),children:[(0,Z.jsx)(OJ,{"data-testid":`sms-workspace.category`,className:f8,children:(0,Z.jsx)(AJ,{})}),(0,Z.jsx)(jJ,{container:r,children:(0,Z.jsx)(DY,{sideOffset:4,className:`z-[120]`,children:(0,Z.jsxs)(JY,{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)(aX,{value:G8,"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)(oX,{children:`Not set`})}),_o.map(e=>(0,Z.jsx)(aX,{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)(oX,{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((e,r)=>e.kind===`locked`?(0,Z.jsx)(z8,{summary:e.summary},`locked-${r}`):(0,Z.jsx)(`textarea`,{"aria-label":`Message body segment ${r+1}`,"data-testid":`sms-workspace.body-segment.${r+1}`,value:e.text,disabled:!t,onChange:e=>n({kind:`text`,segment:r,text:e.target.value},`sms-${r}`),rows:5,className:`${f8} resize-y py-2`},`text-${r}`))]}),(0,Z.jsx)(H8,{variables:e.variables})]})}function J8(){let e=Q(e=>e.doc),t=Q(e=>e.sourceEditable),n=Q(e=>e.sourceEditError),[r,i]=(0,G.useState)(`visual`),a=P8(Sz),o=e?.origin.authoredSource??``,s=(0,G.useMemo)(()=>xz(o),[o]),c=e?.channel===`sms`?e.render:null;return(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:(0,Z.jsx)(L8,{value:r,onChange:i,children:r===`source`?(0,Z.jsx)(N8,{}):(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:[(0,Z.jsx)(`aside`,{className:`samva-editor-scroll border-border bg-background w-[380px] shrink-0 overflow-y-auto border-r p-4`,children:(0,Z.jsxs)(`div`,{className:`grid gap-4`,children:[(0,Z.jsx)(V8,{diagnostics:e?.diagnostics??[]}),(0,Z.jsx)(W8,{reason:n}),s===void 0?(0,Z.jsxs)(`p`,{className:`text-muted-foreground text-[12.5px]`,children:[`The SMS body is not a `,(0,Z.jsx)(`code`,{children:`<Sms>`}),` written in place, so it is edited in Source.`]}):(0,Z.jsx)(q8,{form:s,editable:t,onEdit:a})]})}),(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===void 0?(0,Z.jsx)(`div`,{className:`bg-muted text-muted-foreground rounded-[18px] px-4 py-3 text-[14px] whitespace-pre-wrap`,children:c?.text||`Message preview`}):(0,Z.jsx)(K8,{segments:s.segments,editable:t,onChange:(e,t)=>a({kind:`text`,segment:e,text:t},`sms-${e}`)}),c!==null&&(0,Z.jsx)(U8,{text:c.text,className:`mt-4 text-center text-[11.5px]`})]})}),(0,Z.jsx)(k8,{})]})})})}var Y8=[{kind:`text`,text:``,start:0,end:0}],X8=e=>e.kind===`literal`?e.value:e.kind===`expression`?e.source:``;function Z8({value:e,options:t,disabled:n,ariaLabel:r,onChange:i}){let a=j8();return(0,Z.jsxs)(pJ,{value:e,disabled:n,onValueChange:e=>{let n=t.find(t=>t.value===e);n!==void 0&&i(n.value)},children:[(0,Z.jsx)(OJ,{"aria-label":r,className:f8,children:(0,Z.jsx)(AJ,{})}),(0,Z.jsx)(jJ,{container:a,children:(0,Z.jsx)(DY,{sideOffset:4,className:`z-[120]`,children:(0,Z.jsx)(JY,{className:`samva-editor-shell border-border bg-surface-elevated min-w-[var(--anchor-width)] rounded-lg border p-1 shadow-[var(--shadow-lg)]`,children:t.map(e=>(0,Z.jsx)(aX,{value:e.value,className:`data-highlighted:bg-muted rounded-md px-2.5 py-1.5 text-[13px] outline-none`,children:(0,Z.jsx)(oX,{children:e.label})},e.value))})})})]})}function Q8({label:e,part:t,segments:n,editable:r,onEdit:i}){let a=n??Y8,o=`whatsapp-workspace.slot.${e.toLowerCase()}`;return(0,Z.jsxs)(`div`,{className:`grid gap-1.5 text-[12.5px]`,children:[(0,Z.jsx)(`span`,{className:`text-foreground font-medium`,children:e}),(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:a.map((n,a)=>n.kind===`locked`?(0,Z.jsx)(B8,{summary:n.summary},`locked-${a}`):(0,Z.jsx)(`input`,{"aria-label":a===0?e:`${e} ${a+1}`,value:n.text,disabled:!r,"data-testid":a===0?o:`${o}.${a+1}`,onChange:e=>i({kind:`text`,part:t,segment:a,text:e.target.value},`whatsapp-${t}-${a}`),className:`${f8} min-w-[8ch] flex-1`},`text-${a}`))})]})}function $8({ariaLabel:e,state:t,editable:n,onChange:r,testId:i}){return(0,Z.jsx)(`input`,{"aria-label":e,"data-testid":i,value:X8(t),disabled:!n||t.kind===`expression`,title:t.kind===`expression`?`Read from the input. Edit it in Source.`:void 0,onChange:e=>r(e.target.value),className:f8})}function e5({buttons:e,editable:t,onEdit:n}){let[r,i]=(0,G.useState)(`quick-reply`);return(0,Z.jsxs)(`div`,{className:`grid gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-[12.5px] font-medium`,children:`Buttons`}),e.map((e,r)=>e.kind===`locked`?(0,Z.jsx)(z8,{summary:e.summary},`locked-${r}`):(0,Z.jsxs)(`div`,{className:`border-border grid gap-2 rounded-lg border p-3`,children:[(0,Z.jsx)(Z8,{value:e.type,options:bo,disabled:!t,ariaLabel:`Button ${r+1} type`,onChange:e=>n({kind:`buttonType`,button:r,type:e})}),(0,Z.jsx)(`input`,{"aria-label":`Button ${r+1} label`,value:e.text,disabled:!t,onChange:e=>n({kind:`buttonText`,button:r,text:e.target.value},`whatsapp-button-${r}-text`),className:f8}),e.type===`url`&&(0,Z.jsx)($8,{ariaLabel:`Button ${r+1} URL`,state:e.url,editable:t,onChange:e=>n({kind:`buttonAttribute`,button:r,name:`url`,value:e},`whatsapp-button-${r}-url`)}),e.type===`phone`&&(0,Z.jsx)($8,{ariaLabel:`Button ${r+1} phone`,state:e.phone,editable:t,onChange:e=>n({kind:`buttonAttribute`,button:r,name:`phone`,value:e},`whatsapp-button-${r}-phone`)}),t&&(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Remove button ${r+1}`,onClick:()=>n({kind:`buttonRemove`,button:r}),className:`text-muted-foreground hover:text-status-error justify-self-end text-[11.5px]`,children:`Remove`})]},`button-${r}`)),t&&(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(Z8,{value:r,options:bo,disabled:!1,ariaLabel:`New button type`,onChange:i}),(0,Z.jsx)(`button`,{type:`button`,"data-testid":`whatsapp-workspace.add-button`,onClick:()=>n({kind:`buttonAdd`,type:r}),className:`border-border hover:bg-muted shrink-0 rounded-lg border px-3 text-[12px]`,children:`Add`})]})]})}function t5({form:e,editable:t,onEdit:n}){let r=X8(e.category),i=e.headerType.kind===`literal`?e.headerType.value:`text`;return(0,Z.jsxs)(`div`,{className:`grid gap-4`,children:[(0,Z.jsx)(R8,{label:`Language`,children:(0,Z.jsx)($8,{ariaLabel:`Language`,state:e.language,editable:t,onChange:e=>n({kind:`attribute`,name:`language`,value:e},`whatsapp-language`)})}),(0,Z.jsx)(R8,{label:`Category`,children:(0,Z.jsx)(Z8,{value:r,options:vo,disabled:!t||e.category.kind!==`literal`,onChange:e=>n({kind:`attribute`,name:`category`,value:e})})}),(0,Z.jsx)(R8,{label:`Header type`,children:(0,Z.jsx)(Z8,{value:i,options:yo,disabled:!t||e.header===void 0||e.headerType.kind===`expression`,onChange:e=>n({kind:`headerType`,value:e})})}),(0,Z.jsx)(Q8,{label:`Header`,part:`header`,segments:e.header,editable:t,onEdit:n}),(0,Z.jsxs)(`div`,{className:`grid gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-[12.5px] font-medium`,children:`Body`}),e.body.map((e,r)=>e.kind===`locked`?(0,Z.jsx)(z8,{summary:e.summary},`body-locked-${r}`):(0,Z.jsx)(`textarea`,{"aria-label":`Body segment ${r+1}`,"data-testid":`whatsapp-workspace.body.${r+1}`,value:e.text,disabled:!t,onChange:e=>n({kind:`text`,part:`body`,segment:r,text:e.target.value},`whatsapp-body-${r}`),rows:4,className:`${f8} resize-y py-2`},`body-text-${r}`))]}),(0,Z.jsx)(Q8,{label:`Footer`,part:`footer`,segments:e.footer,editable:t,onEdit:n}),(0,Z.jsx)(e5,{buttons:e.buttons,editable:t,onEdit:n}),(0,Z.jsx)(H8,{variables:e.variables})]})}function n5({label:e,part:t,segments:n,editable:r,placeholder:i,className:a,onEdit:o}){return(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-1`,children:(n??Y8).map((n,s)=>n.kind===`locked`?(0,Z.jsx)(B8,{summary:n.summary},`locked-${s}`):(0,Z.jsx)(`input`,{"aria-label":s===0?`${e} preview`:`${e} preview ${s+1}`,"data-testid":s===0?`whatsapp-workspace.preview.${e.toLowerCase()}`:`whatsapp-workspace.preview.${e.toLowerCase()}.${s+1}`,value:n.text,readOnly:!r,placeholder:i,onChange:e=>o({kind:`text`,part:t,segment:s,text:e.target.value},`whatsapp-${t}-${s}`),className:`placeholder:text-muted-foreground/60 min-w-0 flex-1 bg-transparent outline-none ${a} ${r?`focus-visible:ring-ring/50 rounded-sm focus-visible:ring-2`:`cursor-default`}`},`text-${s}`))})}var r5=e=>e.type===`copy-code`?`Copy code`:e.text;function i5({form:e,editable:t,render:n,onEdit:r}){let i=e.headerType.kind===`literal`?e.headerType.value:`text`;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)(n5,{label:`Header`,part:`header`,segments:e.header,editable:t&&i===`text`,placeholder:i===`text`?`Add header`:`${i} header`,className:`mb-1 font-semibold`,onEdit:r}),(0,Z.jsx)(`div`,{className:`grid gap-1`,children:e.body.map((e,n)=>e.kind===`locked`?(0,Z.jsx)(B8,{summary:e.summary},`body-locked-${n}`):(0,Z.jsx)(`textarea`,{"aria-label":`Body preview segment ${n+1}`,"data-testid":`whatsapp-workspace.body-preview.${n+1}`,value:e.text,readOnly:!t,placeholder:`Write your message`,rows:Math.max(1,e.text.split(`
|
|
178
|
+
`).length),onChange:e=>r({kind:`text`,part:`body`,segment:n,text:e.target.value},`whatsapp-body-${n}`),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-${n}`))}),(0,Z.jsx)(n5,{label:`Footer`,part:`footer`,segments:e.footer,editable:t,placeholder:`Add footer`,className:`text-muted-foreground mt-2 text-[11.5px]`,onEdit:r}),(n?.buttons??[]).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:r5(e)},`${r5(e)}-${t}`))]}),(0,Z.jsxs)(`p`,{className:`text-muted-foreground mt-4 text-center text-[11.5px] capitalize`,children:[n?.category??(X8(e.category)||`utility`),` template`]})]})}function a5(){let e=Q(e=>e.doc),t=Q(e=>e.sourceEditable),n=Q(e=>e.sourceEditError),[r,i]=(0,G.useState)(`visual`),a=P8(Mz),o=e?.origin.authoredSource??``,s=(0,G.useMemo)(()=>Oz(o),[o]),c=e?.channel===`whatsapp`?e.render:null;return(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:(0,Z.jsx)(L8,{value:r,onChange:i,children:r===`source`?(0,Z.jsx)(N8,{}):(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:[(0,Z.jsx)(`aside`,{className:`samva-editor-scroll border-border bg-background w-[400px] shrink-0 overflow-y-auto border-r p-4`,children:(0,Z.jsxs)(`div`,{className:`grid gap-4`,children:[(0,Z.jsx)(V8,{diagnostics:e?.diagnostics??[]}),(0,Z.jsx)(W8,{reason:n}),s===void 0?(0,Z.jsxs)(`p`,{className:`text-muted-foreground text-[12.5px]`,children:[`The WhatsApp body is not a `,(0,Z.jsx)(`code`,{children:`<WhatsApp>`}),` written in place with a body, so it is edited in Source.`]}):(0,Z.jsx)(t5,{form:s,editable:t,onEdit:a})]})}),(0,Z.jsx)(`main`,{className:`samva-editor-workspace samva-editor-scroll min-w-0 flex-1 overflow-auto p-8`,children:s!==void 0&&(0,Z.jsx)(i5,{form:s,editable:t,render:c,onEdit:a})}),(0,Z.jsx)(k8,{})]})})})}var o5=oQ(`focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 active:not-aria-[haspopup]:translate-y-px [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground`,destructive:`bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function s5({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,Z.jsx)(rQ,{"data-slot":`button`,className:$(o5({variant:t,size:n,className:e})),...r})}var c5=e=>({top:e.top,left:e.left,width:e.width,height:e.height}),l5=(e,t)=>{let n=e.querySelectorAll(`[${qc}="${CSS.escape(t)}"]`),r=null;for(let e of n){let t=c5(e.getBoundingClientRect());if(r??=t,t.width>0&&t.height>0)return t}return r},u5=`a[href],button,input[type="button"],input[type="submit"],input[type="image"]`,d5=e=>e!==null&&`closest`in e&&typeof e.closest==`function`,f5=e=>d5(e)&&e.closest(u5)!==null,p5=e=>d5(e)?e.closest(`[data-samva-instance]`)?.getAttribute(`data-samva-instance`)??null:null,m5=[50,67,75,90,100,110,125,150,175,200],h5=e=>m5.find(t=>t>e+.5)??200,g5=e=>m5.findLast(t=>t<e-.5)??50,_5=(e,t)=>e*Math.exp(-t*.01),v5=e=>!(e.metaKey||e.ctrlKey)||e.altKey?null:e.key===`=`||e.key===`+`?`in`:e.key===`-`||e.key===`_`?`out`:e.key===`0`?`reset`:null,y5=e=>e.ctrlKey||e.metaKey,b5=`html,body{margin:0;padding:0;overflow:hidden}`,x5=[`[data-samva-overlay] .samva-tb-anchor{position:fixed;z-index:2147483647;pointer-events:auto}`,`[data-samva-overlay] .samva-tb{display:flex;align-items:center;gap:2px;padding:3px;border-radius:9px;background:var(--editor-canvas-toolbar-bg);color:var(--editor-canvas-toolbar-fg);box-shadow:inset 0 0 0 1px rgba(255,255,255,.14),0 0 0 1px rgba(0,0,0,.08),0 6px 18px rgba(0,0,0,.22);font:500 11.5px/1 ui-sans-serif,system-ui,sans-serif;white-space:nowrap}`,`[data-samva-overlay] .samva-tb button{all:unset;box-sizing:border-box;display:inline-grid;place-items:center;width:26px;height:26px;border-radius:6px;cursor:pointer;color:inherit}`,`[data-samva-overlay] .samva-tb button:hover{background:rgba(255,255,255,.14)}`,`[data-samva-overlay] .samva-tb button:focus-visible{outline:2px solid var(--editor-canvas-hover);outline-offset:-2px}`,`[data-samva-overlay] .samva-tb button:disabled{opacity:.35;cursor:default;background:none}`,`[data-samva-overlay] .samva-tb svg{width:14px;height:14px}`,`[data-samva-overlay] .samva-tb-label{padding:0 6px 0 7px;max-width:180px;overflow:hidden;text-overflow:ellipsis}`,`[data-samva-overlay] .samva-tb-sep{width:1px;height:14px;margin:0 2px;background:rgba(255,255,255,.22)}`,`[data-samva-overlay] .samva-pin{position:fixed;z-index:2147483647;box-sizing:border-box;width:20px;height:20px;border-radius:999px;background:var(--editor-canvas-selected);color:var(--editor-canvas-selected-fg);font:700 10px/20px ui-sans-serif,system-ui,sans-serif;text-align:center;box-shadow:0 0 0 2px #fff,0 2px 6px rgba(0,0,0,.3);pointer-events:none}`].join(``),S5=e=>e!==null&&`closest`in e&&typeof e.closest==`function`&&e.closest(`[data-samva-overlay]`)!==null,C5={"--editor-canvas-hover":`#93c5fd`,"--editor-canvas-selected":`#2563eb`,"--editor-canvas-selected-fg":`#fff`,"--editor-canvas-generated":`#a855f7`,"--editor-canvas-toolbar-bg":`#18181b`,"--editor-canvas-toolbar-fg":`#fafafa`},w5=e=>`:root{${Object.entries(C5).map(([t,n])=>`${t}:${e[t]?.trim()||n}`).join(`;`)}}`,T5=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(C5).map(e=>(n.style.color=`var(${e})`,[e,getComputedStyle(n).color])));return n.remove(),r},E5=/@media\s*\(\s*prefers-color-scheme:\s*dark\s*\)/g,D5=(e,t)=>e.replace(E5,t===`dark`?`@media all`:`@media not all`),O5=e=>e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.button!==0,k5=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},A5=({document_:e,mount:t,width:n,dark:r,overlay:i,onSelect:a,onHover:o,onContextMenu:s,onZoomGesture:c,canEditText:l,onEditText:u,title:d=`Email canvas`,testId:f=`canvas.frame`})=>{let p=(0,G.useRef)(null),[m,h]=(0,G.useState)(null),g=(0,G.useRef)({onSelect:a,onHover:o,onContextMenu:s,onZoomGesture:c,canEditText:l,onEditText:u});return(0,G.useLayoutEffect)(()=>{g.current={onSelect:a,onHover:o,onContextMenu:s,onZoomGesture:c,canEditText:l,onEditText:u}},[a,o,s,c,l,u]),(0,G.useLayoutEffect)(()=>{let n=p.current;if(n===null)return;let r=n.contentDocument;if(r===null)return;let i,a=null,o=()=>{a===null&&(a=requestAnimationFrame(()=>{a=null,k5(n)}))},s=new ResizeObserver(o),c=new MutationObserver(o),l=()=>{let e=r.head.querySelector(`style[data-samva-editor-chrome]`);e===null&&(e=r.createElement(`style`),e.dataset.samvaEditorChrome=``,r.head.appendChild(e)),e.textContent=`${b5}${x5}${w5(T5(n))}`},u=()=>{r.open(),r.write(e),r.close(),i=t?.(r),l(),h(r.body),s.disconnect(),s.observe(r.body),c.disconnect(),c.observe(r.body,{childList:!0,subtree:!0}),k5(n)},d=e=>{S5(e.target)||(!O5(e)&&f5(e.target)&&e.preventDefault(),g.current.onSelect?.(p5(e.target)))},f=e=>{let{canEditText:t,onEditText:n}=g.current,i=p5(e.target);if(i===null||t?.(i)!==!0||n===void 0)return;let a=r.querySelector(`[${qc}="${CSS.escape(i)}"]`);if(a===null||a.children.length>0)return;e.preventDefault();let o=a.textContent??``,s=!1;a.contentEditable=`plaintext-only`,a.focus();let c=r.createRange();c.selectNodeContents(a);let l=r.getSelection();l?.removeAllRanges(),l?.addRange(c);let u=()=>{a.removeEventListener(`keydown`,d),a.removeEventListener(`blur`,u),a.removeAttribute(`contenteditable`);let e=a.textContent??``;s?a.textContent=o:e!==o&&n(i,e)},d=e=>{e.key===`Enter`&&!e.shiftKey?(e.preventDefault(),a.blur()):e.key===`Escape`&&(e.preventDefault(),s=!0,a.blur())};a.addEventListener(`keydown`,d),a.addEventListener(`blur`,u)},m=e=>{S5(e.target)||g.current.onHover?.(p5(e.target))},_=()=>g.current.onHover?.(null),v=e=>{let t=g.current.onContextMenu;if(t===void 0||S5(e.target))return;e.preventDefault();let r=n.getBoundingClientRect(),i=n.clientWidth===0?1:r.width/n.clientWidth,a=n.clientHeight===0?1:r.height/n.clientHeight;t({instancePath:p5(e.target),clientX:r.left+e.clientX*i,clientY:r.top+e.clientY*a})},y=e=>{let t=g.current.onZoomGesture;t!==void 0&&y5(e)&&(e.preventDefault(),t({kind:`wheel`,deltaY:e.deltaY}))},b=e=>{let t=g.current.onZoomGesture,n=v5(e);t!==void 0&&n!==null&&(e.preventDefault(),t({kind:`key`,direction:n}))},x=()=>{r.addEventListener(`click`,d),r.addEventListener(`dblclick`,f),r.addEventListener(`mousemove`,m),r.addEventListener(`mouseleave`,_),r.addEventListener(`contextmenu`,v),r.addEventListener(`wheel`,y,{passive:!1}),r.addEventListener(`keydown`,b)},S=()=>{r.removeEventListener(`click`,d),r.removeEventListener(`dblclick`,f),r.removeEventListener(`mousemove`,m),r.removeEventListener(`mouseleave`,_),r.removeEventListener(`contextmenu`,v),r.removeEventListener(`wheel`,y),r.removeEventListener(`keydown`,b)};u(),x();let C=new MutationObserver(l);return C.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>{S(),s.disconnect(),c.disconnect(),C.disconnect(),a!==null&&cancelAnimationFrame(a),i?.()}},[e,t]),(0,Z.jsx)(`iframe`,{ref:p,"data-testid":f,title:d,sandbox:`allow-same-origin`,style:{width:n,height:0,display:`block`,border:`none`,background:r?`#0a0a0a`:`var(--editor-canvas-document-bg, #fff)`,colorScheme:r?`dark`:`light`},children:m!==null&&i!==void 0?(0,jW.createPortal)(i,m):null})},j5=({html:e,forceColorScheme:t,epoch:n=0,...r})=>{let i=(0,G.useContext)(T4),a=t===void 0?e:D5(e,t),o=(0,G.useMemo)(()=>i?.(a),[a,i]),[s,c]=(0,G.useState)({prepare:i,generation:0});s.prepare!==i&&c({prepare:i,generation:s.generation+1});let l=o?.html??a;return(0,Z.jsx)(A5,{document_:l,mount:o?.mount,dark:t===`dark`,...r},`${n}:${s.generation}:${t??``}:${e}`)},M5=(e,t,n)=>({position:`fixed`,top:e.top,left:e.left,width:e.width,height:e.height,outline:`${n}px solid ${t}`,outlineOffset:n>1?2:-n,pointerEvents:`none`,zIndex:2147483646}),N5=36,P5=[],F5=({renderRevision:e,selected:t,hovered:n,toolbar:r,pins:i=P5})=>{let a=(0,G.useRef)(null),o=(0,G.useRef)(null),[s,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(null),[d,f]=(0,G.useState)(null),[p,m]=(0,G.useState)([]),h=t?.instancePath??null,g=n?.instancePath??null,[_,v]=(0,G.useState)(0);(0,G.useLayoutEffect)(()=>{let e=a.current?.ownerDocument.body;if(e===void 0||typeof ResizeObserver>`u`)return;let t=e.ownerDocument.defaultView,n=()=>v(e=>e+1),r=new ResizeObserver(n);return r.observe(e),e.ownerDocument.fonts?.ready.then(n),t?.addEventListener(`load`,n,!0),()=>{r.disconnect(),t?.removeEventListener(`load`,n,!0)}},[]),(0,G.useLayoutEffect)(()=>{let e=a.current?.ownerDocument;e!==void 0&&(u(h===null?null:l5(e,h)),f(g===null||g===h?null:l5(e,g)),m(i.flatMap(t=>{let n=l5(e,t.instancePath);return n===null?[]:[{number:t.number,box:n}]})))},[e,h,g,i,_]);let y=r!=null;return(0,G.useLayoutEffect)(()=>{let e=o.current;if(!y||e===null||l===null){c(null);return}let t=e.ownerDocument.documentElement.clientWidth;c(Math.max(4,Math.min(l.left,t-e.offsetWidth-4)))},[y,l]),(0,Z.jsxs)(`div`,{ref:a,"data-samva-overlay":!0,style:{position:`fixed`,inset:0,pointerEvents:`none`},children:[d===null?null:(0,Z.jsx)(`div`,{style:M5(d,`var(--editor-canvas-hover)`,1)}),l!==null&&t!==null?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{style:M5(l,t.authored?`var(--editor-canvas-selected)`:`var(--editor-canvas-generated)`,2)}),r==null?(0,Z.jsx)(`div`,{"data-samva-chip":!0,style:{position:`fixed`,top:Math.max(0,l.top-18),left:l.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?F4(t):`${F4(t)} · generated`}):(0,Z.jsx)(`div`,{ref:o,className:`samva-tb-anchor`,style:{top:l.top>=N5?l.top-N5:l.top+l.height+6,left:s??Math.max(4,l.left)},children:r})]}):null,p.map(({number:e,box:t})=>(0,Z.jsx)(`span`,{className:`samva-pin`,"data-samva-pin":e,style:{top:Math.max(2,t.top-8),left:Math.max(2,t.left-8)},children:e},e))]})},I5=({page:e,selectedEmailPath:t,emailSelections:n,width:r,epoch:i,onSelect:a,onZoomGesture:o,canEditText:s,onEditText:c})=>{let[l,u]=(0,G.useState)(null),d=(0,G.useMemo)(()=>t===null?null:A3(n,e.selections,t),[n,e.selections,t]),f=t=>t===null?null:e.selections.find(e=>e.instancePath===t)??null;return(0,Z.jsx)(j5,{html:e.html,width:r,epoch:i,title:`Web page canvas`,testId:`canvas.page-frame`,onSelect:a,onHover:u,onZoomGesture:o,canEditText:s,onEditText:c,overlay:(0,Z.jsx)(F5,{renderRevision:e.revision,selected:f(d),hovered:f(l)})})},L5=(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=jR(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=FR(t,s,`_blank`);c!==null&&r.set(c.start,c)}return[...r.values()].sort((e,t)=>e.start-t.start)};function R5({check:e}){let t=C8(`rail.assistant`)!==void 0,{doc:n,sourceEditable:r,pending:i,conflict:a,lifecycleBusy:o}=Q(fX(e=>({doc:e.doc,sourceEditable:e.sourceEditable,pending:e.pendingAuthoredSource!==null,conflict:e.conflict,lifecycleBusy:e.lifecycleBusy}))),s=Q(e=>e.actions.applySourceEdit),c=Q(e=>e.actions.requestDiagnosticAssistance);if(n===null||!r)return null;let l=L5(e,n.origin.authoredSource,n.origin.file);if(l.length===0&&!t)return null;let u=e.diagnostics?.some(e=>mw(e.code)),d=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:d,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":u?`check.upgrade-with-assistant`:`check.fix-with-assistant`,disabled:d,className:`border-border hover:bg-muted rounded border px-2 py-1 text-[11.5px] disabled:opacity-50`,onClick:()=>c(e),children:u?`Upgrade with Assistant`:`Fix with Assistant`})]})}var z5={risk:`Known risk`,unverified:`Needs verification`,degradation:`Expected differences`,"not-applicable":`Not affected`};function B5({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,` ·`,` `,z5[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(P4).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]})]})}var V5=oQ(`h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function H5({className:e,variant:t=`default`,render:n,...r}){return UZ({defaultTagName:`span`,props:nW({className:$(V5({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}function U5({className:e,type:t,...n}){return(0,Z.jsx)(cQ,{type:t,"data-slot":`input`,className:$(`dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,e),...n})}function W5({className:e,orientation:t=`horizontal`,...n}){return(0,Z.jsx)(lQ,{"data-slot":`separator`,orientation:t,className:$(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...n})}var G5=oQ(`hover:text-foreground aria-pressed:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[state=on]:bg-muted gap-1 rounded-lg text-sm font-medium transition-all [&_svg:not([class*='size-'])]:size-4 group/toggle inline-flex items-center justify-center whitespace-nowrap outline-none hover:bg-muted focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,outline:`border-input hover:bg-muted border bg-transparent`},size:{default:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,sm:`h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}});function K5({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,Z.jsx)(JZ,{"data-slot":`toggle`,className:$(G5({variant:t,size:n,className:e})),...r})}function q5({className:e,...t}){return(0,Z.jsx)(`kbd`,{"data-slot":`kbd`,className:$(`bg-muted text-muted-foreground in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 h-5 w-fit min-w-5 gap-1 rounded-sm px-1 font-sans text-xs font-medium [&_svg:not([class*='size-'])]:size-3 pointer-events-none inline-flex items-center justify-center select-none`,e),...t})}var J5=G.createContext({size:`default`,variant:`default`,spacing:2,orientation:`horizontal`});function Y5({className:e,variant:t,size:n,spacing:r=2,orientation:i=`horizontal`,children:a,...o}){let s=G.useMemo(()=>({variant:t,size:n,spacing:r,orientation:i}),[t,n,r,i]);return(0,Z.jsx)(nQ,{"data-slot":`toggle-group`,"data-variant":t,"data-size":n,"data-spacing":r,"data-orientation":i,style:{"--gap":r},className:$(`rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] data-vertical:flex-col data-vertical:items-stretch`,e),...o,children:(0,Z.jsx)(J5.Provider,{value:s,children:a})})}function X5({className:e,children:t,variant:n=`default`,size:r=`default`,...i}){let a=G.useContext(J5);return(0,Z.jsx)(JZ,{"data-slot":`toggle-group-item`,"data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:$(`group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg shrink-0 focus:z-10 focus-visible:z-10 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t`,G5({variant:a.variant||n,size:a.size||r}),e),...i,children:t})}function Z5({...e}){return(0,Z.jsx)(gQ,{"data-slot":`tooltip`,...e})}function Q5({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){let s=j8();return(0,Z.jsx)(DQ,{container:s,children:(0,Z.jsx)(AQ,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,Z.jsxs)(jQ,{"data-slot":`tooltip-content`,className:$(`data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs has-data-[slot=kbd]:pr-1.5 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 z-50 w-fit max-w-xs origin-(--transform-origin) bg-foreground text-background`,e),...o,children:[a,(0,Z.jsx)(MQ,{className:`bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}function $5({name:e,className:t}){return(0,Z.jsx)(H5,{variant:`outline`,className:$(`rounded-md font-mono`,t),children:`{{${e}}}`})}function e7({children:e}){return(0,Z.jsx)(`div`,{"data-slot":`editor-group-label`,className:`text-muted-foreground mb-2 flex items-center justify-between font-mono text-[10.5px] font-medium tracking-[0.08em] uppercase`,children:e})}function t7({children:e,className:t,testId:n}){return(0,Z.jsx)(H5,{variant:`outline`,"data-testid":n,className:$(`h-6 max-w-44 justify-start rounded-md font-mono font-normal`,t),children:(0,Z.jsx)(`span`,{className:`truncate`,children:e})})}function n7({label:e,shortcut:t,side:n=`bottom`,disabled:r,children:i}){return(0,Z.jsxs)(Z5,{disabled:r,children:[(0,Z.jsx)(CQ,{render:i}),(0,Z.jsxs)(Q5,{role:`tooltip`,side:n,sideOffset:6,children:[e,t!==void 0&&(0,Z.jsx)(q5,{children:t})]})]})}function r7({ariaLabel:e,options:t,value:n,onChange:r,size:i=`default`,className:a,testId:o}){return(0,Z.jsx)(Y5,{"aria-label":e,value:[n],"data-testid":o,spacing:0,onValueChange:e=>{let n=t.find(t=>t.value===e[0]);n!==void 0&&r(n.value)},className:$(p8,i===`sm`?`h-7`:`h-8`,a),children:t.map(e=>{let t=(0,Z.jsx)(X5,{value:e.value,"aria-label":e.title,"data-testid":e.testId,"data-editor-control":``,className:m8,children:e.label},e.value);return e.title===void 0?t:(0,Z.jsx)(n7,{label:e.title,children:t},e.value)})})}var i7=e=>`${e} ${e===1?`edit`:`edits`}`,a7=e=>`${e} ${e===1?`pin`:`pins`}`,o7=`bg-popover text-popover-foreground ring-foreground/10 pointer-events-auto rounded-lg shadow-md ring-1`;function s7(e){let{mode:t,pending:n,waiting:r,editable:i,emailReady:a,hostBusy:o}=Q(fX(e=>({mode:e.canvasMode,pending:X3(e),waiting:Y3(e),editable:e.sourceEditable,emailReady:e.render!==null,hostBusy:e.hostBusy}))),{setCanvasMode:s}=Q(e=>e.actions),c=C8(`rail.assistant`)!==void 0,l=t===`design`,u=!a||(l?r:o||!i),d=!a||t!==`pin`&&r,f=l?n>0?`Apply or reset your edits to leave Design`:r?`Design is saving your last change`:`Leave Design`:o?`Design waits for the assistant to finish`:i?`Edit the email directly`:`This template is read-only`;return u8(`editor-canvas-mode-switch`,{role:`group`,"aria-label":`Canvas mode`,...e},{state:{mode:t,pending:n,locked:u},className:`flex shrink-0 items-center gap-0.5`,props:{children:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(n7,{label:f,children:(0,Z.jsxs)(K5,{size:`sm`,pressed:l,"aria-disabled":u||void 0,onPressedChange:()=>{u||s(l?`point`:`design`)},"data-testid":`preview-bar.design`,"data-editor-control":``,className:`text-muted-foreground aria-pressed:text-foreground gap-1.5 px-2 aria-disabled:cursor-default aria-disabled:opacity-60 @max-[34rem]/preview-bar:px-1.5`,children:[(0,Z.jsx)(Q6,{}),(0,Z.jsx)(`span`,{className:`@max-[34rem]/preview-bar:sr-only`,children:`Design`}),n>0&&(0,Z.jsxs)(H5,{"data-testid":`preview-bar.design-count`,className:`h-4 min-w-4 px-1 text-[10.5px] tabular-nums`,children:[n,(0,Z.jsx)(`span`,{className:`sr-only`,children:` staged`})]})]})}),c&&(0,Z.jsx)(n7,{label:t===`pin`?`Stop pinning`:r?`Apply or reset your edits to pin`:`Pin parts of the email for the chat`,children:(0,Z.jsx)(K5,{size:`sm`,"aria-label":`Pin`,pressed:t===`pin`,"aria-disabled":d||void 0,onPressedChange:()=>{d||s(t===`pin`?`point`:`pin`)},"data-testid":`preview-bar.pin`,"data-editor-control":``,className:`text-muted-foreground aria-pressed:text-foreground px-1.5 aria-disabled:cursor-default aria-disabled:opacity-60`,children:(0,Z.jsx)($6,{})})})]})}})}function c7(e){let{pending:t,undone:n,apply:r,compare:i,comparable:a,versions:o,hostBusy:s}=Q(fX(e=>({pending:X3(e),undone:e.designDraft?.undone.length??0,apply:e.designApply,compare:e.designCompare,comparable:e.designDraft?.baseRender!=null,versions:e.versionsCapability?.status===`ready`,hostBusy:e.hostBusy}))),{undo:c,redo:l,resetDesign:u,setDesignCompare:d,applyDesign:f}=Q(e=>e.actions),[p,m]=(0,G.useState)(!1),h=r.status===`applying`,g=r.status===`failed`,_=p&&t>0,v=t===0||h||s,y=h?`Saving the version…`:g?`Couldn’t save the version`:t===0?`No edits yet`:`${i7(t)} staged`,b=_?(0,Z.jsxs)(`div`,{role:`group`,"aria-label":`Reset edits`,"data-slot":`editor-design-dock-confirm`,"data-testid":`design-dock.reset-confirm`,className:`flex items-center gap-1 pl-3`,children:[(0,Z.jsxs)(`span`,{className:`text-foreground mr-1 text-xs font-medium`,children:[`Reset `,t===1?`this edit`:`all ${t} edits`,`?`]}),(0,Z.jsx)(s5,{variant:`ghost`,size:`sm`,"data-testid":`design-dock.reset-cancel`,"data-editor-control":``,onClick:()=>m(!1),children:`Cancel`}),(0,Z.jsx)(s5,{variant:`destructive`,size:`sm`,"data-testid":`design-dock.reset-confirm-button`,"data-editor-control":``,onClick:()=>{m(!1),u()},children:`Reset`})]}):(0,Z.jsxs)(`div`,{role:`toolbar`,"aria-label":`Design edits`,"data-slot":`editor-design-dock-bar`,"data-testid":`design-dock`,"data-pending":t,"data-state":r.status,className:`flex items-center gap-0.5`,children:[(0,Z.jsx)(`span`,{"data-slot":`editor-design-dock-status`,"data-testid":`design-dock.status`,"aria-live":`polite`,className:$(`px-2.5 text-xs whitespace-nowrap tabular-nums @max-[24rem]/design-bar:sr-only`,t===0?`text-muted-foreground`:`text-foreground font-medium`,g&&`text-destructive`),children:y}),(0,Z.jsx)(n7,{label:`Undo`,side:`top`,children:(0,Z.jsx)(s5,{variant:`ghost`,size:`icon-sm`,"aria-label":`Undo`,"data-testid":`design-dock.undo`,"data-editor-control":``,disabled:t===0||h,onClick:c,children:(0,Z.jsx)(r8,{})})}),(0,Z.jsx)(n7,{label:`Redo`,side:`top`,children:(0,Z.jsx)(s5,{variant:`ghost`,size:`icon-sm`,"aria-label":`Redo`,"data-testid":`design-dock.redo`,"data-editor-control":``,disabled:n===0||h,onClick:l,children:(0,Z.jsx)(e8,{})})}),(0,Z.jsx)(n7,{label:`Reset all edits`,side:`top`,children:(0,Z.jsx)(s5,{variant:`ghost`,size:`icon-sm`,"aria-label":`Reset all edits`,"data-testid":`design-dock.reset`,"data-editor-control":``,disabled:t===0||h,onClick:()=>m(!0),children:(0,Z.jsx)(t8,{})})}),(0,Z.jsx)(n7,{label:i?`Show your edits`:`Compare with before your edits`,side:`top`,children:(0,Z.jsx)(K5,{size:`sm`,"aria-label":`Compare with before your edits`,pressed:i,onPressedChange:d,"data-testid":`design-dock.compare`,"data-editor-control":``,disabled:t===0||!a||h,className:`min-w-7 px-0`,children:(0,Z.jsx)(H6,{})})}),(0,Z.jsx)(W5,{orientation:`vertical`,className:`mx-0.5 h-4!`}),(0,Z.jsx)(n7,{label:s?`Apply waits for the assistant to finish`:o?`Save these edits as one version`:`Keep these edits`,side:`top`,children:(0,Z.jsx)(s5,{size:`sm`,"data-testid":`design-dock.apply`,"data-editor-control":``,"aria-disabled":v||void 0,onClick:()=>{v||f()},className:`aria-disabled:cursor-default aria-disabled:opacity-50`,children:h?`Applying…`:g?`Try again`:t>1?`Apply ${t} edits`:`Apply`})})]});return u8(`editor-design-dock`,e,{state:{pending:t,apply:r.status,compare:i,confirming:_},className:`ml-auto flex min-w-0 items-center gap-2`,props:{children:(0,Z.jsxs)(Z.Fragment,{children:[g&&!_&&(0,Z.jsxs)(`p`,{role:`alert`,"data-slot":`editor-design-dock-error`,"data-testid":`design-dock.error`,className:`text-destructive max-w-xs truncate text-xs`,title:r.reason,children:[r.reason,` Your edits are kept.`]}),b]})}})}function l7(e){let{pins:t,pinning:n}=Q(fX(e=>({pins:e.pins,pinning:e.canvasMode===`pin`}))),{removePin:r,clearPins:i,setPinNote:a}=Q(e=>e.actions),[o,s]=(0,G.useState)(!0),[c,l]=(0,G.useState)(!1),u=t.length,d=c&&u>0,f=u>0||n,p=u===0?(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,Z.jsx)($6,{className:`text-primary size-3.5`}),(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`Click a part of the email to pin it for the chat`})]}):d?(0,Z.jsxs)(`div`,{className:`flex h-9 items-center gap-1 pr-1 pl-3`,children:[(0,Z.jsxs)(`span`,{"data-testid":`pin-tray.clear-confirm`,className:`text-foreground flex-1 text-xs font-medium`,children:[`Remove all `,u,`?`]}),(0,Z.jsx)(s5,{variant:`ghost`,size:`sm`,"data-testid":`pin-tray.clear-cancel`,"data-editor-control":``,onClick:()=>l(!1),children:`Cancel`}),(0,Z.jsx)(s5,{variant:`destructive`,size:`sm`,"data-testid":`pin-tray.clear-confirm-button`,"data-editor-control":``,onClick:()=>{l(!1),i()},children:`Remove all`})]}):(0,Z.jsxs)(`div`,{className:`flex h-9 items-center gap-1 pr-1 pl-1`,children:[(0,Z.jsxs)(s5,{variant:`ghost`,size:`sm`,"aria-expanded":o,"data-testid":`pin-tray.toggle`,"data-editor-control":``,onClick:()=>s(!o),className:`min-w-0 flex-1 justify-start gap-1.5 px-2`,children:[o?(0,Z.jsx)(m6,{className:`text-muted-foreground`}):(0,Z.jsx)(_6,{className:`text-muted-foreground`}),a7(u),(0,Z.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`for the chat`})]}),(0,Z.jsx)(n7,{label:`Remove all pins`,side:`top`,children:(0,Z.jsx)(s5,{variant:`ghost`,size:`icon-sm`,"aria-label":`Remove all pins`,"data-testid":`pin-tray.clear`,"data-editor-control":``,onClick:()=>l(!0),className:`text-muted-foreground`,children:(0,Z.jsx)(L6,{})})})]}),m=u8(`editor-pin-tray`,{"aria-label":`Pins`,"data-testid":`pin-tray`,"data-count":u,...e},{state:{count:u,open:o,confirming:d,pinning:n},tag:`section`,className:$(o7,`w-[min(26rem,calc(100%-1.5rem))] overflow-hidden`),props:{children:(0,Z.jsxs)(Z.Fragment,{children:[p,u>0&&o&&(0,Z.jsx)(`ol`,{"data-slot":`editor-pin-tray-list`,className:`border-border m-0 max-h-48 list-none overflow-y-auto border-t p-1`,children:t.map(e=>(0,Z.jsxs)(`li`,{"data-slot":`editor-pin-tray-row`,"data-testid":`pin-tray.row.${e.number}`,className:`group/row hover:bg-muted/50 flex items-center gap-2 rounded-md py-0.5 pr-0.5 pl-1.5`,children:[(0,Z.jsx)(`span`,{className:`bg-primary text-primary-foreground grid size-5 shrink-0 place-items-center rounded-full text-[10.5px] font-semibold tabular-nums`,children:e.number}),(0,Z.jsx)(H5,{variant:`secondary`,className:`max-w-[9rem] shrink-0 truncate rounded-md font-mono text-[11px] font-normal`,children:e.label}),(0,Z.jsx)(U5,{"aria-label":`Note for pin ${e.number}`,"data-testid":`pin-tray.note.${e.number}`,value:e.note,placeholder:`Add a note`,onChange:t=>a(e.id,t.target.value),className:`hover:border-input h-7 min-w-0 flex-1 border-transparent bg-transparent px-1.5 text-xs shadow-none md:text-xs dark:bg-transparent`}),(0,Z.jsx)(n7,{label:`Remove pin ${e.number}`,side:`top`,children:(0,Z.jsx)(s5,{variant:`ghost`,size:`icon-xs`,"aria-label":`Remove pin ${e.number}`,"data-testid":`pin-tray.remove.${e.number}`,"data-editor-control":``,onClick:()=>r(e.id),className:$(`text-muted-foreground`,h8),children:(0,Z.jsx)(L6,{})})})]},e.id))})]})}});return f?m:null}function u7({selection:e}){let{entry:t,source:n,revision:r,rev:i,ready:a}=Q(fX(e=>({entry:e.doc?.origin.file??null,source:e.doc?.origin.authoredSource??null,revision:e.render?.revision??null,rev:e.doc?.rev??null,ready:e.sourceEditable&&!e.conflict&&!e.lifecycleBusy&&!e.hostBusy&&e.pendingAuthoredSource===null}))),{applySourceEdit:o,select:s}=Q(e=>e.actions),c=Q(t=>[U4(e,t.doc?.origin.authoredSource??``),W4(e)].filter(e=>e!==void 0).join(` `)),l=e.origins[0],u=(0,G.useMemo)(()=>l===void 0||t===null||n===null||l.fileName!==t?null:jR(n,t,l),[l,t,n]),d=Q(e=>e.outline),f=d===null?void 0:J4(d,e.instancePath).at(-1)?.instancePath,p=a&&u!==null&&n!==null&&r===i,m=(e,t)=>{if(!p||r===null)return;let i=VR(n,u,e);i!==null&&o({revision:r,source:n,edits:i,design:{label:t}})},h=u===null&&l!==void 0&&l.fileName!==t?`Written in ${l.fileName}. Edit it from the properties.`:void 0,g=e=>(0,Z.jsx)(s5,{variant:`ghost`,size:`icon-xs`,"aria-label":e.label,title:e.enabled?e.label:h??e.label,"data-testid":`design-toolbar.${e.testId}`,disabled:!e.enabled,onClick:e.onClick,children:e.children});return(0,Z.jsxs)(`div`,{className:`samva-tb`,role:`toolbar`,"aria-label":`Selected element`,"data-testid":`design-toolbar`,children:[(0,Z.jsx)(`span`,{className:`samva-tb-label`,children:c}),(0,Z.jsx)(`span`,{className:`samva-tb-sep`,"aria-hidden":!0}),g({label:`Select the element around it`,testId:`parent`,enabled:f!==void 0,onClick:()=>{f!==void 0&&s(f)},children:(0,Z.jsx)(X6,{})}),g({label:`Move earlier`,testId:`move-earlier`,enabled:p&&u.previous!==null,onClick:()=>m({kind:`reorder`,direction:`before`},`Move block earlier`),children:(0,Z.jsx)(_6,{})}),g({label:`Move later`,testId:`move-later`,enabled:p&&u.next!==null,onClick:()=>m({kind:`reorder`,direction:`after`},`Move block later`),children:(0,Z.jsx)(m6,{})}),g({label:`Duplicate`,testId:`duplicate`,enabled:p&&u.structural,onClick:()=>m({kind:`duplicate`},`Duplicate block`),children:(0,Z.jsx)(Z6,{})}),g({label:`Delete`,testId:`delete`,enabled:p&&u.structural,onClick:()=>m({kind:`delete`},`Delete block`),children:(0,Z.jsx)(n8,{})})]})}var d7=e=>e===void 0?`No default sender`:e.name?`${e.name} <${e.email}>`:e.email;function f7(){return(0,Z.jsx)(H5,{variant:`outline`,title:`Overridable per send`,className:`text-muted-foreground`,children:`default`})}function p7({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 m7(){let{doc:e,render:t,selected:n,layoutMode:r}=Q(fX(e=>({doc:e.doc,render:e.render,selected:e.selection.kind===`envelope`,layoutMode:e.layoutMode}))),{selectEnvelope:i}=Q(e=>e.actions),[a,o]=(0,G.useState)(!1),s=(0,G.useRef)(null),c=(0,G.useRef)(!1),l=e?.metadata.fromDefault,u=e?.metadata.replyToDefault??[],d=t?.subject??``,f=t?.preheader??``,p=r===`compact`||r===`narrow`;return(0,G.useEffect)(()=>{p&&!a&&c.current&&(c.current=!1,s.current?.focus())},[p,a]),(0,Z.jsxs)(WQ,{open:!p||a,onOpenChange:e=>{e||(c.current=!0),o(e)},children:[p&&!a&&(0,Z.jsxs)(KQ,{ref:s,"aria-label":`Expand envelope`,"data-testid":`envelope.expand`,onClick:e=>{e.stopPropagation(),i()},className:$(`bg-card mb-4 flex h-11 w-full items-center gap-3 rounded-xl border border-border px-3 text-left 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 font-mono text-[10.5px] font-medium 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)(m6,{className:`text-muted-foreground size-4 shrink-0`})]}),(0,Z.jsx)(n$,{children:(0,Z.jsxs)(`div`,{onClick:e=>{e.stopPropagation(),i()},"data-slot":`editor-envelope`,className:$(`bg-card text-card-foreground mb-6 cursor-pointer overflow-hidden rounded-xl border shadow-xs transition-shadow`,n?`border-accent-email shadow-[0_0_0_1px_var(--accent-email)]`:`border-border hover:border-sel-mid`),children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between px-4 pt-2.5 pb-1`,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:text-foreground -mx-1 rounded px-1 font-mono text-[10.5px] font-medium tracking-[0.08em] uppercase`,children:`Envelope`}),p&&(0,Z.jsx)(KQ,{"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)(_6,{className:`size-3.5`})})]}),(0,Z.jsxs)(`div`,{className:`divide-border divide-y text-[13px]`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground w-16 shrink-0 font-mono text-[10.5px] font-medium tracking-[0.08em] uppercase`,children:`From`}),(0,Z.jsx)(`span`,{className:`text-muted-foreground min-w-0 flex-1 truncate`,children:d7(l)}),(0,Z.jsx)(f7,{})]}),(0,Z.jsxs)(`div`,{"data-testid":`envelope.reply-to-row`,className:`flex items-center gap-3 px-4 py-2`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground w-16 shrink-0 font-mono text-[10.5px] font-medium tracking-[0.08em] 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)(f7,{})]}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground w-16 shrink-0 font-mono text-[10.5px] font-medium tracking-[0.08em] uppercase`,children:`Subject`}),(0,Z.jsx)(p7,{value:d,placeholder:`No subject`,testId:`envelope.subject-value`})]}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground w-16 shrink-0 font-mono text-[10.5px] font-medium tracking-[0.08em] uppercase`,children:`Preview`}),(0,Z.jsx)(p7,{value:f,placeholder:`No preview text`,testId:`envelope.preview-value`})]})]})]})})]})}function h7({...e}){return(0,Z.jsx)(WQ,{"data-slot":`collapsible`,...e})}function g7({...e}){return(0,Z.jsx)(KQ,{"data-slot":`collapsible-trigger`,...e})}function _7({...e}){return(0,Z.jsx)(n$,{"data-slot":`collapsible-content`,...e})}function v7({checks:e,editable:t=!1}){let{actionable:n}=x3(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)(B5,{check:e,actions:t?(0,Z.jsx)(R5,{check:e}):void 0},e.id)),(0,Z.jsx)(y7,{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 y7({checks:e,editable:t=!1}){let n=j8(),r=Object.fromEntries(Object.keys(z5).map(t=>[t,e.filter(e=>e.diagnostics?.some(e=>e.compatibility?.assessment===t)).length])),[i,a]=(0,G.useState)(`all`),[o,s]=(0,G.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?[]:[_3(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)(a1,{onOpenChange:e=>{e&&(a(r.unverified>0?`unverified`:`all`),s(`all`))},children:[(0,Z.jsx)(c1,{"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)(Q$,{container:n,children:[(0,Z.jsx)(U$,{className:`fixed inset-0 z-[130] bg-black/30`}),(0,Z.jsxs)(Z$,{"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)(s1,{className:`text-lg font-semibold`,children:`Compatibility report`}),(0,Z.jsx)(W$,{"data-testid":`checks.report.close`,"aria-label":`Close compatibility report`,className:`text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:ring-ring/50 inline-flex size-[30px] items-center justify-center rounded-[7px] outline-none focus-visible:ring-[3px]`,children:(0,Z.jsx)(L6,{className:`size-[15px]`})})]}),(0,Z.jsx)(G$,{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(z5).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(z5).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)(B5,{check:e,actions:t?(0,Z.jsx)(R5,{check:e}):void 0})},e.id))})]})]})]})}var b7=`email-component-degradation`,x7=e=>`${e.fileName}:${e.lineNumber}:${e.columnNumber}`,S7=[],C7=(e,t)=>{let n=new Map;for(let t of e)for(let e of t.diagnostics??[]){if(e.code!==b7||e.compatibility?.assessment!==`degradation`)continue;let t=/^<([^>]+)>/.exec(e.message)?.[1];if(t===void 0)continue;let r=n.get(t)??{note:e.compatibility.title,origins:new Set};for(let t of e.occurrences??[e.origins]){let e=t[0];e!==void 0&&r.origins.add(x7(e))}n.set(t,r)}return[...n].map(([e,{note:n,origins:r}])=>{let i=t.filter(e=>{let t=e.origins[0];return e.authored&&t!==void 0&&r.has(x7(t))});return{component:e,note:n,count:i.length,first:i[0]?.instancePath??null}})},w7=()=>{let e=Q(e=>e.checks),t=Q(e=>e.render?.selections??S7);return(0,G.useMemo)(()=>C7(e,t),[e,t])};function T7(e){let t=w7(),{setPreviewTarget:n,select:r}=Q(fX(e=>({setPreviewTarget:e.actions.setPreviewTarget,select:e.actions.select}))),i=e=>{n(`email`),r(e)};return u8(`editor-email-differences`,{"aria-label":`Email differences`,"data-testid":`checks.email-differences`,...e},{state:{count:t.length},tag:`section`,className:`space-y-2`,props:{children:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`h3`,{className:`text-foreground text-[13px] font-semibold`,children:`Email differences`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Some parts of this page are simpler in email.`})]}),t.length===0?(0,Z.jsx)(`p`,{"data-testid":`checks.email-differences.empty`,className:`text-muted-foreground text-xs`,children:`This looks the same in email and on the web.`}):(0,Z.jsx)(`ul`,{className:`border-border-subtle divide-border-subtle divide-y rounded-md border`,children:t.map(e=>(0,Z.jsxs)(`li`,{"data-slot":`editor-email-differences-row`,"data-testid":`checks.email-differences.row`,className:`group/row flex items-start gap-2 px-2.5 py-2`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`text-foreground flex items-baseline gap-1.5 text-xs font-medium`,children:[(0,Z.jsx)(`span`,{children:e.component}),e.count>0&&(0,Z.jsx)(`span`,{className:`text-muted-foreground font-normal tabular-nums`,children:e.count===1?`1 place`:`${e.count} places`})]}),(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-0.5 text-xs`,children:e.note})]}),e.first!==null&&(0,Z.jsx)(s5,{variant:`ghost`,size:`sm`,"data-testid":`checks.email-differences.show`,"data-editor-control":``,"aria-label":`Show ${e.component} in the email`,onClick:()=>i(e.first),className:$(`shrink-0`,h8),children:`Show`})]},e.component))})]})}})}function E7(){let e=Q(e=>e.checks),t=Q(e=>e.pageAvailable),n=Q(e=>e.sourceEditable);return(0,Z.jsxs)(`div`,{"data-slot":`editor-checks-panel`,className:`space-y-5`,children:[t&&(0,Z.jsx)(T7,{}),(0,Z.jsx)(v7,{checks:e,editable:n})]})}function D7({className:e,size:t=`default`,...n}){return(0,Z.jsxs)(`div`,{className:$(`group/native-select relative w-fit has-[select:disabled]:opacity-50`,e),"data-slot":`native-select-wrapper`,"data-size":t,children:[(0,Z.jsx)(`select`,{"data-slot":`native-select`,"data-size":t,className:`border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-8 w-full min-w-0 appearance-none rounded-lg border bg-transparent py-1 pr-8 pl-2.5 text-sm transition-colors outline-none select-none focus-visible:ring-3 disabled:pointer-events-none disabled:cursor-not-allowed aria-invalid:ring-3 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[size=sm]:py-0.5`,...n}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`native-select-icon`,className:`text-muted-foreground pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 select-none`,children:(0,Z.jsx)(m6,{className:`size-full`})})]})}function O7({className:e,...t}){return(0,Z.jsx)(`option`,{"data-slot":`native-select-option`,className:$(`bg-[Canvas] text-[CanvasText]`,e),...t})}var k7=`theme.css`,A7=`starter.css`,j7=`samva:brand`,M7=`@import "./${A7}";`,N7=/@import(?![\w-])/iy,P7=(e,t)=>{let n=e[t],r=t+1;for(;r<e.length;){let t=e[r];if(t===`\\`)r+=2;else if(t===n||t===`
|
|
179
|
+
`)return r+1;else r+=1}return e.length},F7=(e,t)=>{let n=e.indexOf(`*/`,t+2);return n===-1?e.length:n+2},I7=e=>{let t=``,n=0;for(;n<e.length;)if(e.startsWith(`/*`,n))n=F7(e,n),t+=` `;else if(e[n]===`"`||e[n]===`'`){let r=P7(e,n);t+=e.slice(n,r),n=r}else t+=e[n],n+=1;return t},L7=e=>{let t=e[0];if(!(t!==`"`&&t!==`'`||e.length<2||e.at(-1)!==t))return e.slice(1,-1)},R7=e=>{let t=I7(e).trim(),n=/^url\(\s*(.*?)\s*\)$/is.exec(t);if(n!==null){let e=n[1]??``;return L7(e)??(/^[^\s"'()]+$/.test(e)?e:void 0)}return L7(t)},z7=e=>{let t=[],n=0,r=0;for(;r<e.length;){let i=e[r];if(i===`/`&&e[r+1]===`*`){r=F7(e,r);continue}if(i===`"`||i===`'`){r=P7(e,r);continue}if(i===`{`)n+=1;else if(i===`}`)n=Math.max(0,n-1);else if(i===`@`&&n===0&&(N7.lastIndex=r,N7.test(e))){let n=N7.lastIndex,i=n;for(;i<e.length&&e[i]!==`;`;)e.startsWith(`/*`,i)?i=F7(e,i):e[i]===`"`||e[i]===`'`?i=P7(e,i):i+=1;let a=Math.min(i+1,e.length);t.push({start:r,target:R7(e.slice(n,i)),end:a}),r=a;continue}r+=1}return t},B7=e=>{if(e===j7)return{slug:null};let t=`${j7}/`;if(e===void 0||!e.startsWith(t))return;let n=e.slice(t.length);return n.length===0?void 0:{slug:n}},V7=e=>{let t=e?.replace(/[?#].*$/,``);return t===`./starter.css`||t===`/starter.css`},H7=e=>{for(let{target:t}of z7(e)){let e=B7(t);if(e!==void 0)return e}return null},U7=(e,t)=>{let n=e.theme??``,r=z7(n).find(({target:e})=>V7(e));if(r!==void 0)return`${n.slice(0,r.end)}\n${t}${n.slice(r.end)}`;let i=[...e.starter?[M7]:[],t].join(`
|
|
180
|
+
`);return n.length===0?`${i}\n`:`${i}\n${n.startsWith(`
|
|
181
|
+
`)?``:`
|
|
182
|
+
`}${n}`},W7=(e,t)=>{let n=e.theme??``,r=`@import "${G7(t)}";`,i=z7(n).filter(({target:e})=>B7(e)!==void 0);return i.length===0?U7(e,r):i.reduceRight((e,{start:t,end:n},i)=>`${e.slice(0,t)}${i===0?r:``}${e.slice(n)}`,n)},G7=e=>e.isDefault?j7:`${j7}/${e.slug}`,K7=/(\b(?:from|import)\s*\(?\s*)(["'])samva:brand(?:\/[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?)?\2/g,_te=(e,t)=>e.replace(K7,(e,n,r)=>`${n}${r}${G7(t)}${r}`),vte=(e,t)=>{if(e===void 0)return{kind:`pending`};let n=t??[],r=n.find(({isDefault:e})=>e)??null;if(e===null)return{kind:`none`,defaultBrand:r,brands:n};if(t===null)return{kind:`pending`};let i=e.slug===null?r:t.find(({slug:t})=>t===e.slug);return i==null?{kind:`missing`,slug:e.slug,brands:t}:{kind:`brand`,brand:i,brands:t}},yte=new Set([`p`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`span`,`a`,`li`,`strong`,`em`,`Link`,`Button`,`Text`,`Heading`]),bte=new Set([`Section`,`Container`,`Column`,`Row`,`div`,`td`,`table`,`Box`,`Card`]),q7=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`8`,`10`,`12`,`16`],xte=[{value:`font-normal`,label:`Regular`},{value:`font-medium`,label:`Medium`},{value:`font-semibold`,label:`Semibold`},{value:`font-bold`,label:`Bold`}],J7=/^text-(\[\d+(?:\.\d+)?px\]|xs|sm|base|lg|xl|[2-9]xl)$/,Ste=[`xs`,`sm`,`base`,`lg`,`xl`,`2xl`,`3xl`,`4xl`,`5xl`,`6xl`],Y7=/^text-(left|center|right|justify)$/,X7=/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black)$/,Cte=e=>e.filter(e=>!e.includes(`:`));function wte(e){let t=Q(e=>e.lifecycleCapability),[n,r]=(0,G.useState)(null);return(0,G.useEffect)(()=>{if(t?.status!==`ready`)return;let e=!1;return t.api.inspect().then(t=>{let n=t.files.find(e=>e.path===k7);!e&&n?.content!=null&&r(X4(n.content))},()=>{}),()=>{e=!0}},[t]),n!==null&&n.length>0?n:Q4(e).map(e=>({name:e,value:void 0}))}function Z7({label:e,children:t,hint:n,value:r}){return(0,Z.jsxs)(`div`,{"data-slot":`editor-design-field`,className:`flex flex-col gap-1.5`,children:[(0,Z.jsxs)(`span`,{className:`flex items-baseline justify-between gap-2 text-xs`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:e}),r!==void 0&&(0,Z.jsx)(`span`,{"data-slot":`editor-design-field-value`,className:`text-foreground truncate font-mono text-[11px]`,children:r})]}),t,n!==void 0&&(0,Z.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:n})]})}function Q7({title:e,children:t}){return(0,Z.jsxs)(`section`,{"data-slot":`editor-design-group`,"aria-label":e,className:`border-border/70 flex flex-col gap-3 border-b py-3.5`,children:[(0,Z.jsx)(e7,{children:e}),t]})}function $7({value:e,onCommit:t,testId:n,ariaLabel:r,type:i=`text`,disabled:a,placeholder:o,className:s}){let[c,l]=(0,G.useState)(e),u=()=>{c!==e&&t(c)};return(0,Z.jsx)(U5,{type:i,"aria-label":r,"data-testid":n,value:c,disabled:a,placeholder:o,onChange:e=>l(e.target.value),onBlur:u,onKeyDown:e=>{e.key===`Enter`&&u()},className:$(`h-8 text-[13px] md:text-[13px]`,s)})}var e9=e=>{let t=e.trim();if(t===``||/^\{\s*(["'`])\s*\1\s*\}$/.test(t)||/^\{\s*" "\s*\}$/.test(t))return null;let n=/^<([A-Za-z][\w.]*)/.exec(t)?.[1];if(n!==void 0)return n;let r=t.replace(/^\{|\}$/g,``).trim();return r.split(`.`).at(-1)??r},Tte=(e,t,n)=>{let r=t.properties.filter(e=>e.syntax===`child`&&(e.name===`children`||e.name.startsWith(`text.`))).toSorted((e,t)=>e.start-t.start),i=t.contentStart,a=t.contentEnd;if(i===null||a===null)return r.map(e=>e.kind===`literal`?{kind:`text`,field:e}:{kind:`chip`,label:e9(`{${e.value}}`)??e.value});let o=[],s=i,c=t=>{let r=e.slice(s,t),i=n?/\{[^{}]*\}|<[A-Za-z][\s\S]*?(?:\/>|<\/[^>]+>)/g:/\{[^{}]*\}/g;for(let e of r.match(i)??[]){let t=e9(e);t!==null&&o.push({kind:`chip`,label:t})}};for(let e of r)c(e.start),o.push(e.kind===`literal`?{kind:`text`,field:e}:{kind:`chip`,label:e9(`{${e.value}}`)??e.value}),s=e.end;return c(a),o};function Ete({source:e,entrySource:t,target:n,available:r,commit:i,onRefused:a}){let o=wte(t),s=n.tag,c=yte.has(s),l=bte.has(s),u=s===`img`||s===`Image`,d=n.properties.find(e=>e.name===`className`),f=!n.hasSpread&&(d===void 0||d.kind===`literal`&&d.literalType===`string`),p=Cte($4(d?.kind===`literal`?d.value:``)),m=$4(d?.kind===`literal`?d.value:``),h=new Set(o.map(e=>e.name)),g=o.toSorted((e,t)=>n9(e.name)-n9(t.name)),_=(t,r)=>{let o=GR(e,n,{kind:`set`,value:t.join(` `)});o.ok?o.edits.length>0&&i(o.edits,r):a(o.reason)},v=(e,t,n)=>_([...m.filter(t=>t.includes(`:`)||!e(t)),...t],n),y=(t,n,r)=>{let o=FR(e,t,n);o===null?a(`That value doesn't fit ${e3(t.name)}.`):i([o],r)},b=Tte(e,n,c),x=e=>n.properties.find(t=>t.name===e),S=n.properties.filter(e=>e.syntax!==`child`&&e.name!==`className`&&!(u&&[`alt`,`width`,`height`,`src`].includes(e.name))),C=e=>p.find(t=>t.startsWith(`${e}-`)&&h.has(t.slice(e.length+1))),w=e=>p.find(t=>RegExp(`^${e}-\\[#`).test(t)),T=e=>t=>t.startsWith(`${e}-`)&&h.has(t.slice(e.length+1))||RegExp(`^${e}-\\[#`).test(t),E=[...new Set([...[...t.matchAll(/text-\[(\d+(?:\.\d+)?)px\]/g)].map(e=>`text-[${e[1]}px]`),...Ste.filter(e=>RegExp(`(?:^|[\\s"'\`])text-${e}(?=[\\s"'\`])`).test(t)).map(e=>`text-${e}`)])].toSorted((e,t)=>r9(e)-r9(t)),D=p.find(e=>J7.test(e)),O=p.find(e=>X7.test(e)),k=p.find(e=>Y7.test(e))?.slice(5)??`left`,A=(e,t)=>{let n=e=>p.find(t=>t.startsWith(`${e}-`))?.slice(e.length+1);if(t===`t`||t===`b`)return n(`${e}${t}`)??n(`${e}y`)??n(e)??``;let[r,i]=t===`x`?[`l`,`r`]:[`t`,`b`],a=n(`${e}${t}`)??n(e);if(a!==void 0)return a;let o=n(`${e}${r}`);return o!==void 0&&o===n(`${e}${i}`)?o:``},j=(e,t,n,r)=>{let i={x:[`${e}x`,`${e}l`,`${e}r`],y:[`${e}y`,`${e}t`,`${e}b`],t:[`${e}t`],b:[`${e}b`]}[t],a=m.filter(e=>e.includes(`:`)||!i.some(t=>e.startsWith(`${t}-`))),o=a.find(t=>t.startsWith(`${e}-`)),s=(t===`y`||t===`t`||t===`b`?`y`:`x`)==`x`?`y`:`x`,c=(e,t)=>{a.some(t=>t.startsWith(`${e}-`))||a.push(`${e}-${t}`)};if(o!==void 0){let n=o.slice(e.length+1);a=a.filter(e=>e!==o),c(`${e}${s}`,n),t===`t`&&c(`${e}b`,n),t===`b`&&c(`${e}t`,n)}let l=a.find(t=>t.startsWith(`${e}y-`));if((t===`t`||t===`b`)&&l!==void 0){let n=l.slice(e.length+2);a=a.filter(e=>e!==l),c(`${e}${t===`t`?`b`:`t`}`,n)}n!==``&&a.push(`${e}${t}-${n}`),_(a,r)},M=(e,t,n,i)=>{let a=A(e,t),o=q7.includes(a)||a===``?q7:[a,...q7];return(0,Z.jsx)(Z7,{label:n,children:(0,Z.jsxs)(D7,{size:`sm`,"aria-label":n,"data-testid":i,value:a,disabled:!r,onChange:r=>j(e,t,r.target.value,`Change ${n.toLowerCase()}`),className:`w-full`,children:[(0,Z.jsx)(O7,{value:``,children:`None`}),o.map(e=>(0,Z.jsx)(O7,{value:e,children:Ote(e)},e))]})})},N=(e,t,n)=>{let i=C(e),o=w(e);return(0,Z.jsxs)(Z7,{label:t,value:i===void 0?o===void 0?`Not set`:o.slice(e.length+2,-1):i.slice(e.length+1),children:[(0,Z.jsx)(`div`,{"data-slot":`editor-design-swatches`,"data-testid":n,className:`flex flex-wrap items-center gap-2 py-0.5`,children:[{name:``,value:void 0},...g].map(a=>{let s=a.name===``?null:`${e}-${a.name}`,c=s===null?i===void 0&&o===void 0:i===s,l=s===null?`Not set`:a.name;return(0,Z.jsx)(n7,{label:l,side:`top`,children:(0,Z.jsx)(K5,{"aria-label":`${t}: ${l}`,pressed:c,"data-testid":`${n}.${s===null?`none`:a.name}`,disabled:!r,onPressedChange:()=>{c||v(T(e),s===null?[]:[s],`Change ${t.toLowerCase()}`)},className:`ring-offset-background aria-pressed:ring-ring size-5 min-w-0 rounded-full p-0 hover:bg-transparent aria-pressed:bg-transparent aria-pressed:ring-2 aria-pressed:ring-offset-2`,children:(0,Z.jsx)(`span`,{"aria-hidden":!0,className:$(`size-5 rounded-full border border-black/15 dark:border-white/20`,s===null&&`border-muted-foreground/60 border-dashed`),style:{background:s===null?`linear-gradient(135deg, transparent 44%, var(--muted-foreground) 44%, var(--muted-foreground) 56%, transparent 56%)`:a.value??`repeating-linear-gradient(45deg, var(--muted), var(--muted) 3px, transparent 3px, transparent 6px)`}})})},l)})}),(0,Z.jsxs)(h7,{children:[(0,Z.jsxs)(g7,{"data-testid":`${n}.custom-toggle`,className:`text-muted-foreground hover:text-foreground group/custom flex items-center gap-1 text-[11px] outline-none`,children:[(0,Z.jsx)(g6,{className:`size-3 transition-transform group-data-[panel-open]/custom:rotate-90`}),`Custom color`]}),(0,Z.jsx)(_7,{className:`pt-1.5`,children:(0,Z.jsx)($7,{ariaLabel:`${t} hex`,testId:`${n}.custom`,value:o?.slice(e.length+2,-1)??``,placeholder:`#b4532a`,disabled:!r,onCommit:n=>{let r=n.trim();if(r!==``&&!/^#[0-9a-f]{3,8}$/i.test(r)){a(`A custom color is a hex value such as #b4532a.`);return}v(T(e),r===``?[]:[`${e}-[${r}]`],`Change ${t.toLowerCase()}`)}})})]})]})},P=b.some(e=>e.kind===`text`);return(0,Z.jsxs)(`div`,{"data-slot":`editor-design-properties-controls`,"data-testid":`design-properties`,className:`flex flex-col`,children:[(c||b.some(e=>e.kind===`text`))&&b.length>0&&(0,Z.jsx)(Q7,{title:`Content`,children:(0,Z.jsxs)(`div`,{"data-testid":`design-properties.content`,className:`flex flex-wrap items-center gap-1.5`,children:[b.map((e,t)=>e.kind===`chip`?(0,Z.jsx)(n7,{label:`Filled in from the data each send. Change it in Source.`,children:(0,Z.jsx)(H5,{variant:`secondary`,"data-testid":`design-properties.binding`,className:`w-fit rounded-md font-mono text-[11px] font-normal`,children:e.label})},`chip-${t}`):(0,Z.jsx)($7,{ariaLabel:`Text`,testId:`design-properties.text.${e.field.name}`,value:e.field.value,disabled:!r,onCommit:t=>y(e.field,t,`Edit text`),className:`min-w-40 flex-1`},`${e.field.name}`)),!P&&(0,Z.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`This content comes from the data. Change how it's written in Source.`})]})}),u&&(0,Z.jsxs)(Q7,{title:`Image`,children:[x(`alt`)?.kind===`literal`&&(0,Z.jsx)(Z7,{label:`Description`,hint:`Read aloud, and shown when images are off.`,children:(0,Z.jsx)($7,{ariaLabel:`Image description`,testId:`design-properties.alt`,value:x(`alt`)?.value??``,disabled:!r,onCommit:e=>y(x(`alt`),e,`Edit image description`)})}),(0,Z.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:[`width`,`height`].map(e=>{let t=x(e);return t?.kind===`literal`?(0,Z.jsx)(Z7,{label:`${e3(e)} (px)`,children:(0,Z.jsx)($7,{type:`number`,ariaLabel:e3(e),testId:`design-properties.${e}`,value:t.value,disabled:!r,onCommit:n=>y(t,n,`Change image ${e}`)})},e):null})})]}),S.length>0&&(0,Z.jsx)(Q7,{title:`Settings`,children:(0,Z.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:S.map(e=>e.kind===`literal`?(0,Z.jsx)(Z7,{label:t9(e),children:(0,Z.jsx)($7,{type:e.literalType===`number`?`number`:`text`,ariaLabel:e3(e.name),testId:`design-properties.prop.${e.name}`,value:e.value,disabled:!r,onCommit:t=>y(e,t,`Change ${e3(e.name).toLowerCase()}`)})},e.name):(0,Z.jsx)(Z7,{label:t9(e),children:(0,Z.jsx)(H5,{variant:`secondary`,className:`w-fit rounded-md font-mono text-[11px] font-normal`,children:e9(`{${e.value}}`)??e.value})},e.name))})}),(c||l)&&!f&&(0,Z.jsx)(`p`,{"data-testid":`design-properties.computed`,className:`text-muted-foreground py-3 text-xs`,children:`This element's styles are worked out in the template, so they're changed in Source.`}),(c||l)&&f&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Q7,{title:`Color`,children:[N(`text`,`Text color`,`design-properties.color.text`),l&&N(`bg`,`Background`,`design-properties.color.bg`)]}),c&&(0,Z.jsx)(Q7,{title:`Type`,children:(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,Z.jsx)(Z7,{label:`Size`,children:(0,Z.jsxs)(D7,{size:`sm`,"aria-label":`Size`,"data-testid":`design-properties.size`,value:D??``,disabled:!r,onChange:e=>v(e=>J7.test(e),e.target.value===``?[]:[e.target.value],`Change text size`),className:`w-full`,children:[(0,Z.jsx)(O7,{value:``,children:`Default`}),[...new Set([...D===void 0?[]:[D],...E])].map(e=>(0,Z.jsx)(O7,{value:e,children:Dte(e)},e))]})}),(0,Z.jsx)(Z7,{label:`Weight`,children:(0,Z.jsxs)(D7,{size:`sm`,"aria-label":`Weight`,"data-testid":`design-properties.weight`,value:O??``,disabled:!r,onChange:e=>v(e=>X7.test(e),e.target.value===``?[]:[e.target.value],`Change text weight`),className:`w-full`,children:[(0,Z.jsx)(O7,{value:``,children:`Default`}),xte.map(e=>(0,Z.jsx)(O7,{value:e.value,children:e.label},e.value))]})})]})}),(0,Z.jsxs)(Q7,{title:`Layout`,children:[(0,Z.jsx)(Z7,{label:`Alignment`,children:(0,Z.jsx)(r7,{ariaLabel:`Alignment`,testId:`design-properties.align`,size:`sm`,value:k,onChange:e=>r&&v(e=>Y7.test(e),[`text-${e}`],`Change alignment`),options:[{value:`left`,title:`Align left`,label:(0,Z.jsx)(a8,{className:`size-3.5`}),testId:`design-properties.align.left`},{value:`center`,title:`Align center`,label:(0,Z.jsx)(i8,{className:`size-3.5`}),testId:`design-properties.align.center`},{value:`right`,title:`Align right`,label:(0,Z.jsx)(o8,{className:`size-3.5`}),testId:`design-properties.align.right`}]})}),(0,Z.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:l?(0,Z.jsxs)(Z.Fragment,{children:[M(`p`,`x`,`Padding sides`,`design-properties.padding-x`),M(`p`,`y`,`Padding top and bottom`,`design-properties.padding-y`)]}):(0,Z.jsxs)(Z.Fragment,{children:[M(`m`,`t`,`Space above`,`design-properties.margin-top`),M(`m`,`b`,`Space below`,`design-properties.margin-bottom`)]})})]})]})]})}var t9=e=>e.literalType===`number`&&/width|height|padding|radius|size|margin|gap/i.test(e.name)?`${e3(e.name)} (px)`:e3(e.name),n9=e=>{let t=e.replace(/-foreground$/,``);return[`background`,`foreground`,`card`,`popover`,`muted`].includes(t)?0:[`primary`,`secondary`,`accent`,`destructive`].includes(t)?1:[`border`,`input`,`ring`].includes(t)?2:3},r9=e=>{let t=/\[(\d+(?:\.\d+)?)px\]/.exec(e)?.[1];return t===void 0?{xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48,"6xl":60}[e.slice(5)]??0:Number(t)},Dte=e=>`${r9(e)} px`,Ote=e=>{let t=/^\[(.+)\]$/.exec(e)?.[1];if(t!==void 0)return t;let n=Number(e);return Number.isFinite(n)?`${n*4} px`:e},kte=$(`border-border bg-background text-foreground w-full rounded border px-2 py-1.5 text-xs`,d8);function Ate({selection:e}){let{inspectMarkdown:t,editMarkdownText:n}=Q(e=>e.actions),r=Q(e=>e.sourceEditError),i=Q(e=>e.lifecycleBusy),a=Q(e=>e.render?.revision),[o,s]=(0,G.useState)(`loading`),c=(0,G.useRef)(null);return(0,G.useEffect)(()=>{if(i)return;let n=!1;return t(e.instancePath).then(e=>{if(n)return;let t=e?.properties.find(e=>e.name===`children`),r=t===void 0?null:t.value;(c.current===null||r===c.current)&&(c.current=null,s(r))}),()=>{n=!0}},[t,e.instancePath,i,a]),(0,Z.jsx)(`div`,{"data-slot":`editor-element-controls`,className:`pb-3`,children:o===`loading`?(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-3 text-xs`,children:`Reading the text.`}):o===null?(0,Z.jsx)(`p`,{"data-testid":`markdown.unavailable`,className:`text-muted-foreground mt-3 text-xs`,children:`This part has no text to edit here.`}):(0,Z.jsxs)(`div`,{className:`mt-3 space-y-1.5`,children:[(0,Z.jsxs)(`label`,{className:`block text-xs`,children:[`Text`,(0,Z.jsx)(`textarea`,{"data-testid":`markdown.text`,className:$(kte,`mt-1 min-h-20`),value:o,onChange:t=>{c.current=t.target.value,s(t.target.value),n(e.instancePath,t.target.value)}})]}),(0,Z.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Changes save as you type, and also update the web page and the email.`}),r!==null&&(0,Z.jsx)(`p`,{"data-testid":`markdown.error`,role:`alert`,className:`text-destructive text-xs`,children:r})]})})}var i9=$(`border-border bg-background text-foreground w-full rounded border px-2 py-1.5 text-xs`,d8),a9=$(`border-border hover:bg-muted rounded border px-2 py-1 text-xs disabled:opacity-50`,d8);function jte({field:e,source:t,propose:n,apply:r}){let i=`Edit ${o9(e.name).toLowerCase()}`,a=()=>{let n=FR(t,e,o);n!==null&&r(n,i)},[o,s]=(0,G.useState)(e.value),[c,l]=(0,G.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:[o9(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:i9,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&a()}}):(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:a9,disabled:FR(t,e,o)===null,onClick:a,children:`Update`}),(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:i9,value:c,onChange:e=>l(e.target.value)}),(0,Z.jsx)(`button`,{"data-testid":`source.property.${e.name}.review`,type:`button`,className:a9,onClick:()=>n(IR(t,e,c)),children:`Review expression diff`})]})]})}var o9=e=>e===`children`||e.startsWith(`text.`)?`Text`:e===`className`?`Style classes`:e,Mte=e=>e instanceof Error&&e.message!==``?e.message:`The host could not save this.`;function Nte(e){let t=Q(e=>e.lifecycleCapability),{flushSaves:n}=Q(e=>e.actions),[r,i]=(0,G.useState)(null);return(0,G.useEffect)(()=>{if(e===null||t?.status!==`ready`)return;let r=!1;return n().then(()=>t.api.inspect()).then(e=>{if(r)return;let t={};for(let n of e.files)n.binary!==!0&&n.status!==`deleted`&&n.content!==null&&(t[n.path]=n.content);i(t)}).catch(()=>{r||i(`failed`)}),()=>{r=!0}},[e,t,n]),e===null?{status:`entry`}:t?.status===`ready`?r===null?{status:`loading`}:r===`failed`?{status:`unavailable`}:{status:`ready`,files:r,api:t.api}:{status:`unavailable`}}function Pte(e){return e.assistant?`Edits wait for the assistant to finish.`:e.busy?`Waiting for the latest source to render.`:e.file!==null&&e.project===`loading`?`Reading ${e.file}.`:e.file!==null&&e.project===`unavailable`?`This element is written in ${e.file}, outside the template entry, and this host cannot edit project files from here. Open Source or ask the agent.`:e.resolved?`This source is read-only.`:`This origin cannot be resolved in its file. Open its source or ask the agent.`}function Fte(e,t){return`${e.occurrences>1?`This element renders ${e.occurrences} times here (a loop or a repeated component), so one edit changes all ${e.occurrences}.`:`This changes this element.`}${t?` It is written in a partial, so every template that uses the partial changes too.`:``} Fixture items remain separate data.`}function Ite({selection:e}){let{doc:t,pending:n,revision:r,editable:i,storeError:a,lifecycleBusy:o,hostBusy:s}=Q(fX(e=>({doc:e.doc,pending:e.pendingAuthoredSource,revision:e.render?.revision,editable:e.sourceEditable,storeError:e.sourceEditError,lifecycleBusy:e.lifecycleBusy,hostBusy:e.hostBusy}))),{applySourceEdit:c,openSource:l,requestSourceAssistance:u,beginLifecycle:d,endLifecycle:f}=Q(e=>e.actions),{flushSaves:p}=Q(e=>e.actions),m=C8(`rail.assistant`)!==void 0,[h,g]=(0,G.useState)(0),[_,v]=(0,G.useState)(null),[y,b]=(0,G.useState)(null),[x,S]=(0,G.useState)(!1),[C,w]=(0,G.useState)(``),[T,E]=(0,G.useState)(`<p>New content</p>`),[D,O]=(0,G.useState)(``),[k,A]=(0,G.useState)(null),[j,M]=(0,G.useState)(null),N=e.origins[h],P=t?.origin.file,F=N!==void 0&&N.fileName!==P,I=Nte(F?N.fileName:null);if(t===null||P===void 0)return null;let L=t.origin.authoredSource,R=F&&N!==void 0?I.status===`ready`?I.files[N.fileName]??null:null:L,z=N===void 0||R===null?null:jR(R,N.fileName,N),ee=F?{entry:P,file:N.fileName,files:{...I.status===`ready`?I.files:{},[P]:L}}:{entry:P},B=i&&n===null&&!o&&!s&&!x&&r===t.rev&&z!==null&&R!==null,V=(e,t)=>{let n=RR(R??``,e,{profile:ee});return{edits:e,label:t,refusal:n.ok?null:n.reason}},te=(e,t)=>{if(R===null)return;if(b(null),v(null),!F){c({revision:r??``,source:R,edits:e,design:{label:t}});return}let n=RR(R,e,{profile:ee});if(!n.ok){b(n.reason);return}I.status===`ready`&&d()&&(S(!0),p().then(e=>I.api.updateFile({path:N.fileName,baseRev:e,content:n.source})).catch(e=>b(Mte(e))).finally(()=>{f(),S(!1)}))},H=(e,t)=>{te([e],t),M(null)},ne=y??a,re=z?.properties.find(e=>e.name===`className`),ie=z===null||R===null||re?.kind===`literal`?null:(()=>{let e=GR(R,z,{kind:`add`,tokens:`x`});return e.ok?null:e.reason})(),ae=e.origins.length>1;return(0,Z.jsxs)(`div`,{"data-slot":`editor-element-controls`,className:`pb-3`,children:[F&&(0,Z.jsxs)(`p`,{"data-testid":`source.partial-warning`,className:`border-border bg-muted text-foreground mt-3 rounded-lg border p-2.5 text-xs`,children:[`This is written in a shared part (`,N.fileName,`). Edits here save straight away and change every template that uses it.`]}),(e.occurrences>1||ae&&h>0)&&(0,Z.jsx)(`p`,{"data-testid":`source.scope-note`,className:`text-muted-foreground mt-3 text-xs`,children:ae&&h>0?`Changes this call site, including every loop iteration it produces. Fixture items remain separate data.`:Fte(e,F)}),B?(0,Z.jsx)(Ete,{source:R,entrySource:L,target:z,available:B,commit:te,onRefused:b},`${h}`):(0,Z.jsx)(`p`,{"data-testid":`source.unavailable`,className:`text-muted-foreground mt-3 text-xs`,children:Pte({assistant:s,busy:n!==null||x||o,file:F?N.fileName:null,project:I.status,resolved:z!==null})}),(0,Z.jsxs)(h7,{"data-testid":`source.advanced`,className:`border-border/70 border-b`,children:[(0,Z.jsxs)(g7,{"data-testid":`source.advanced-toggle`,className:`text-muted-foreground hover:text-foreground group/advanced flex w-full items-center gap-1.5 py-3 font-mono text-[10.5px] font-medium tracking-[0.08em] uppercase outline-none`,children:[(0,Z.jsx)(g6,{className:`size-3 transition-transform group-data-[panel-open]/advanced:rotate-90`}),`Advanced`]}),(0,Z.jsxs)(_7,{keepMounted:!0,className:`pb-3 data-[closed]:hidden`,children:[(0,Z.jsx)(`p`,{className:`text-muted-foreground mb-2 text-xs`,children:`The element's raw props and classes. The whole template is in Source.`}),ae&&(0,Z.jsxs)(`label`,{className:`block text-xs`,children:[`Edit scope`,(0,Z.jsx)(`select`,{"aria-label":`Edit scope`,"data-testid":`source.scope`,className:i9,value:h,onChange:e=>{g(Number(e.target.value)),M(null)},children:e.origins.map((e,t)=>(0,Z.jsxs)(`option`,{value:t,children:[t===0?`Element`:`Call site ${t}`,` · `,P4(e)]},t))})]}),B?(0,Z.jsxs)(Z.Fragment,{children:[z.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.`}),z.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.`}),z.properties.filter(e=>!z.hasSpread||e.syntax===`child`).map(e=>(0,Z.jsx)(jte,{field:e,source:R,apply:H,propose:t=>M(V([t],`Edit ${o9(e.name).toLowerCase()} expression`))},`${t.rev}:${R}:${h}:${e.name}`)),ie!==null&&(0,Z.jsx)(`p`,{"data-testid":`source.class-refusal`,className:`text-muted-foreground mt-3 text-xs`,children:ie}),ie===null&&(0,Z.jsxs)(`div`,{className:`mt-3`,children:[(0,Z.jsxs)(`label`,{className:`block text-xs`,children:[re===void 0?`Style classes · literal`:`Add style classes`,(0,Z.jsx)(`input`,{"aria-label":`Style classes`,"data-testid":`source.classes`,className:i9,value:C,onChange:e=>w(e.target.value)})]}),(0,Z.jsx)(`button`,{"data-testid":`source.classes-add`,type:`button`,className:a9,disabled:C.trim()===``,onClick:()=>{let e=GR(R,z,{kind:`add`,tokens:C});e.ok?te(e.edits,`Add style classes`):b(e.reason),w(``)},children:re===void 0?`Add styles`:`Add classes`})]}),(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:T,className:i9,onChange:e=>E(e.target.value)}),(0,Z.jsx)(`button`,{"data-testid":`source.review-insert`,type:`button`,className:a9,disabled:z.contentEnd===null,onClick:()=>{let e=VR(R,z,{kind:`insert`,tsx:T});A(e===null?null:V(e,`Insert content`))},children:`Review insert`}),` `,(0,Z.jsx)(`button`,{"data-testid":`source.review-delete`,type:`button`,className:a9,disabled:!z.structural,onClick:()=>{let e=VR(R,z,{kind:`delete`});A(e===null?null:V(e,`Delete block`))},children:`Review delete`}),` `,(0,Z.jsx)(`button`,{"data-testid":`source.review-duplicate`,type:`button`,className:a9,disabled:!z.structural,onClick:()=>{let e=VR(R,z,{kind:`duplicate`});A(e===null?null:V(e,`Duplicate block`))},children:`Review duplicate`}),` `,(0,Z.jsx)(`button`,{"data-testid":`source.review-move-up`,type:`button`,className:a9,disabled:z.previous===null,onClick:()=>{let e=VR(R,z,{kind:`reorder`,direction:`before`});A(e===null?null:V(e,`Move block earlier`))},children:`Move earlier`}),` `,(0,Z.jsx)(`button`,{"data-testid":`source.review-move-down`,type:`button`,className:a9,disabled:z.next===null,onClick:()=>{let e=VR(R,z,{kind:`reorder`,direction:`after`});A(e===null?null:V(e,`Move block later`))},children:`Move later`}),!F&&(0,Z.jsxs)(Z.Fragment,{children:[(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:D,className:i9,onChange:e=>O(e.target.value),children:[(0,Z.jsx)(`option`,{value:``,children:`Choose destination`}),t.channel===`email`&&t.render?.selections.filter(e=>e.authored&&e.tag!==`html`).map(e=>(0,Z.jsxs)(`option`,{value:e.instancePath,children:[U4(e,L),e.origins[0]===void 0?``:` · line ${e.origins[0].lineNumber}`]},e.instancePath))]})]}),(0,Z.jsx)(`button`,{"data-testid":`source.review-move`,type:`button`,className:a9,disabled:!z.structural||D===``,onClick:()=>{let e=(t.channel===`email`?t.render?.selections.find(e=>e.instancePath===D):void 0)?.origins[0],n=e===void 0?null:jR(R,P,e),r=n===null?null:VR(R,z,{kind:`move`,destination:n});A(r===null?null:V(r,`Move block`)),v(r===null?`This destination cannot accept the selected block. Choose another source container or use Source.`:null)},children:`Review move`})]}),_!==null&&(0,Z.jsx)(`p`,{role:`alert`,className:`text-status-error text-xs`,children:_}),k!==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:k.edits.map(e=>`- ${e.before}\n+ ${e.after}`).join(`
|
|
183
|
+
`)}),k.refusal!==null&&(0,Z.jsx)(`p`,{"data-testid":`source.structure-refusal`,className:`text-status-error text-xs`,children:k.refusal}),(0,Z.jsx)(`button`,{"data-testid":`source.apply-structure`,type:`button`,className:a9,disabled:k.refusal!==null,onClick:()=>{te(k.edits,k.label),A(null)},children:`Use this change`}),` `,(0,Z.jsx)(`button`,{type:`button`,className:a9,onClick:()=>A(null),children:`Cancel`})]})]}),j!==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:j.edits.map(e=>`- ${e.before}\n+ ${e.after}`).join(`
|
|
184
|
+
`)}),j.refusal!==null&&(0,Z.jsx)(`p`,{"data-testid":`source.proposal-refusal`,className:`text-status-error text-xs`,children:j.refusal}),(0,Z.jsx)(`button`,{"data-testid":`source.apply-reviewed`,type:`button`,className:a9,disabled:j.refusal!==null,onClick:()=>{te(j.edits,j.label),M(null)},children:`Use this change`}),` `,(0,Z.jsx)(`button`,{type:`button`,className:a9,onClick:()=>M(null),children:`Cancel`})]})]}):null]})]}),ne!==null&&(0,Z.jsx)(`p`,{"data-testid":`source.edit-error`,className:`text-status-error mt-2 text-xs`,children:ne}),(0,Z.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,Z.jsx)(`button`,{type:`button`,className:a9,onClick:l,children:`Open source`}),m&&(0,Z.jsx)(`button`,{type:`button`,className:a9,onClick:()=>u(h),children:`Ask agent`})]})]})}function Lte(){let{undo:e,redo:t,error:n,editable:r}=Q(fX(e=>({undo:e.undoHistory.length+(e.designDraft?.edits.length??0),redo:e.redoHistory.length+(e.designDraft?.undone.length??0),error:e.sourceEditError,editable:e.sourceEditable}))),i=Q(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:a9,disabled:!r||e===0,onClick:i.undo,children:`Undo`}),(0,Z.jsx)(`button`,{"data-testid":`source.redo`,type:`button`,className:a9,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 Rte(){let e=Q(e=>e.doc),t=Q(e=>e.pendingAuthoredSource),n=Q(e=>e.sourceEditable),{applySourceEdit:r,openSource:i}=Q(e=>e.actions),[a,o]=(0,G.useState)(null),[s,c]=(0,G.useState)(!1);if(e?.channel!==`email`)return null;let l=UR(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)(e7,{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:a9,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:i9,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:a9,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:a9,onClick:()=>{r({revision:e.rev,source:e.origin.authoredSource,edits:[{start:l.start,end:l.end,before:l.source,after:a}],design:{label:`Edit fixture data`}}),o(null),c(!1)},children:`Use this change`}),` `,(0,Z.jsx)(`button`,{type:`button`,className:a9,onClick:()=>{o(null),c(!1)},children:`Cancel`})]})]})]})}function zte({selection:e}){let t=Q(e=>`${e.doc?.rev}:${e.doc?.origin.authoredSource}:${e.doc?.channel===`email`?e.doc.fixture:``}`);return e.origins[0]?.fileName.endsWith(`.md`)===!0?(0,Z.jsx)(Ate,{selection:e},e.instancePath):(0,Z.jsx)(Ite,{selection:e},t)}function Bte(){let e=Q(e=>`${e.doc?.rev}:${e.doc?.origin.authoredSource}:${e.doc?.channel===`email`?e.doc.fixture:``}`);return(0,Z.jsx)(Rte,{},e)}var Vte=[],Hte=[],Ute=[];function s9({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 Wte(){let e=Q(e=>e.doc?.variables??Hte);return e.length===0?null:(0,Z.jsxs)(`div`,{className:`border-border-subtle border-b py-3`,children:[(0,Z.jsx)(e7,{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)($5,{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 preview shows the values of the fixture selected above it.`})]})}function Gte(){return(0,Z.jsx)(`div`,{className:`py-3`,children:(0,Z.jsx)(E7,{})})}function Kte({checks:e}){let{deviceWidth:t,entryFile:n,fixture:r,fixtures:i}=Q(fX(e=>({deviceWidth:M3[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:Vte})));return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`border-border-subtle border-b py-3`,children:[(0,Z.jsx)(e7,{children:`Document`}),(0,Z.jsx)(s9,{label:`Width`,children:(0,Z.jsxs)(t7,{children:[t,` `,(0,Z.jsx)(`span`,{className:`text-placeholder text-[10.5px]`,children:`px`})]})}),n!==null&&(0,Z.jsx)(s9,{label:`Entry`,children:(0,Z.jsx)(t7,{children:n})}),r!==null&&(0,Z.jsx)(s9,{label:`Fixture`,title:`${i.length} declared`,children:(0,Z.jsx)(t7,{children:r})})]}),(0,Z.jsx)(Bte,{},`${r}:${n}`),(0,Z.jsx)(Wte,{}),e&&(0,Z.jsx)(Gte,{})]})}function c9({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:$(`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`,d8)})}function qte(){let e=Q(e=>e.doc),t=Q(e=>e.metadataError),{saveMetadata:n}=Q(e=>e.actions),r=e?.metadata.fromDefault,[i,a]=(0,G.useState)(r?.name??``),[o,s]=(0,G.useState)(r?.email??``),[c,l]=(0,G.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)(e7,{children:`Defaults · per send`}),(0,Z.jsx)(s9,{label:`From name`,children:(0,Z.jsx)(c9,{value:i,onChange:a,onCommit:u,placeholder:`Sender name`})}),(0,Z.jsx)(s9,{label:`From email`,children:(0,Z.jsx)(c9,{type:`email`,value:o,onChange:s,onCommit:u,placeholder:`you@domain.com`,testId:`inspector.envelope.from-email`})}),(0,Z.jsx)(s9,{label:`Reply-To`,children:(0,Z.jsx)(c9,{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 Jte(){let e=Q(e=>e.metadataEditable),t=Q(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)(e7,{children:`Rendered`}),(0,Z.jsx)(s9,{label:`Subject`,children:(0,Z.jsx)(t7,{children:t?.subject??`No subject`})}),(0,Z.jsx)(s9,{label:`Preview`,children:(0,Z.jsx)(t7,{children:t?.preheader??`No preview text`})})]}),e?(0,Z.jsx)(qte,{}):(0,Z.jsx)(`p`,{className:`text-muted-foreground py-3 text-xs`,children:`This host does not edit sender defaults.`})]})}function Yte({selection:e}){let t=Q(e=>e.render?.selections??Ute),n=Q(e=>e.render?.html??``),{select:r}=Q(e=>e.actions),i=e.origins[0],a=e.origins.slice(1),o=Zc(t,e),s=Qc(t,e);return(0,Z.jsxs)(`div`,{"data-slot":`editor-element-inspector`,"data-instance-path":e.instancePath,children:[o.length>1&&(0,Z.jsxs)(`div`,{"data-slot":`editor-element-copies`,className:`border-border/70 border-b py-3`,children:[(0,Z.jsx)(e7,{children:`Copies`}),(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-0.5 p-0`,children:o.map((t,i)=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(s5,{variant:`ghost`,size:`sm`,"data-testid":`inspector.iteration.${t.instancePath}`,"aria-current":t.instancePath===e.instancePath||void 0,onClick:()=>r(t.instancePath),className:$(`w-full justify-start gap-2 px-2 text-left text-[12.5px] font-normal`,t.instancePath===e.instancePath&&`bg-muted text-foreground font-medium`),children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground w-4 tabular-nums`,children:i+1}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:L4(t,n)??`Copy ${i+1}`})]})},t.instancePath))})]}),(0,Z.jsx)(zte,{selection:e},`${e.instancePath}:${e.start}:${e.end}`),(0,Z.jsxs)(h7,{"data-slot":`editor-element-details`,className:`py-1`,children:[(0,Z.jsxs)(g7,{"data-testid":`inspector.details-toggle`,className:`text-muted-foreground hover:text-foreground group/details flex w-full items-center gap-1.5 py-2 font-mono text-[10.5px] font-medium tracking-[0.08em] uppercase outline-none`,children:[(0,Z.jsx)(g6,{className:`size-3 transition-transform group-data-[panel-open]/details:rotate-90`}),`Where it's written`]}),(0,Z.jsxs)(_7,{keepMounted:!0,className:`pb-3 data-[closed]:hidden`,children:[i===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)(s9,{label:`Written at`,children:(0,Z.jsx)(t7,{testId:`inspector.authoring.origin`,children:P4(i)})}),(0,Z.jsx)(s9,{label:`Kind`,title:e.authored?`This element was written in the template.`:`A compiler primitive produced this element; the authoring above is the call that asked for it.`,children:(0,Z.jsx)(t7,{testId:`inspector.element.provenance`,children:e.authored?`Authored`:`Generated`})}),(0,Z.jsx)(s9,{label:`Rendered as`,children:(0,Z.jsx)(t7,{testId:`inspector.element.tag`,children:e.tag})}),(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.`}),s.length>o.length&&(0,Z.jsxs)(`p`,{"data-testid":`inspector.authoring.definition-scope`,className:`text-muted-foreground mt-1 text-[11.5px]`,children:[s.length,` elements across the whole render come from it, through more than one call site.`]})]}),a.length>0&&(0,Z.jsxs)(`div`,{className:`mt-3`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`Inside, innermost first`}),(0,Z.jsx)(`ol`,{className:`m-0 mt-1 flex list-none flex-col gap-1 p-0`,children:a.map((e,t)=>(0,Z.jsx)(`li`,{"data-testid":`inspector.call-site.${t}`,className:`text-foreground font-mono text-[11.5px] break-all`,children:P4(e)},`${P4(e)}:${t}`))})]})]})]})]})}function l9({embedded:e=!1,checks:t=!0}={}){let{outline:n,selection:r,rightCollapsed:i,rightWidth:a,layoutMode:o}=Q(fX(e=>({outline:e.outline,selection:e.selection,rightCollapsed:e.rightCollapsed,rightWidth:e.rightWidth,layoutMode:e.layoutMode}))),{select:s,selectDocument:c,toggleRight:l}=Q(e=>e.actions),u=r.kind===`element`?n?.index.get(r.instancePath)??null:null,d=r.kind===`envelope`?`envelope`:u===null?`document`:`element`,f=Q(e=>e.doc?.origin.authoredSource??``),p=u===null||n===null?[]:J4(n,u.instancePath).slice(-2).map(e=>({instancePath:e.instancePath,label:U4(e,f)})),m=u===null?void 0:W4(u),h=!e&&(o===`compact`||o===`narrow`);return(0,Z.jsx)(`aside`,{"aria-label":`Inspector`,"data-testid":`inspector`,"aria-hidden":!e&&i?!0:void 0,inert:!e&&i?!0:void 0,"data-editor-rail":`right`,style:{width:e?`100%`:i?0:a,maxWidth:h?`calc(100% - 48px)`:void 0},className:$(`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&&i&&`border-l-0`),children:(0,Z.jsxs)(`div`,{className:`flex h-full min-w-0 flex-col`,style:{width:e?`100%`:a,maxWidth:`100%`},children:[(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:d===`document`?(0,Z.jsx)(`span`,{className:`text-foreground truncate px-1 font-semibold`,children:`Document`}):d===`envelope`?(0,Z.jsx)(`span`,{className:`text-foreground truncate px-1 font-semibold`,children:`Envelope`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(s5,{variant:`ghost`,size:`xs`,onClick:c,"data-testid":`inspector.document`,className:`text-muted-foreground shrink-0 px-1 font-normal`,children:`Email`}),p.map(e=>(0,Z.jsxs)(`span`,{className:`contents`,children:[(0,Z.jsx)(g6,{className:`text-placeholder size-3 shrink-0`}),(0,Z.jsx)(s5,{variant:`ghost`,size:`xs`,onClick:()=>s(e.instancePath),className:`text-muted-foreground max-w-[88px] truncate px-1 font-normal`,children:e.label})]},e.instancePath)),(0,Z.jsx)(g6,{className:`text-placeholder size-3 shrink-0`}),(0,Z.jsx)(`span`,{"data-testid":`inspector.element-name`,className:`text-foreground truncate px-1 font-semibold`,children:u===null?``:U4(u,f)})]})}),u!==null&&(m!==void 0||!u.authored)&&(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-[10.5px] font-medium tabular-nums`,children:u.authored?m:`Generated`}),!e&&(0,Z.jsx)(n7,{label:`Collapse inspector`,side:`bottom`,children:(0,Z.jsx)(s5,{variant:`ghost`,size:`icon-sm`,"aria-label":`Collapse inspector`,"data-testid":`inspector.collapse`,onClick:l,className:`text-muted-foreground ml-auto`,children:(0,Z.jsx)(P6,{})})})]})}),(0,Z.jsxs)(x$,{"data-samva-scroll-area":`inspector`,className:`relative min-h-0 flex-1`,children:[(0,Z.jsx)(N$,{className:`size-full`,children:(0,Z.jsxs)(`div`,{className:`samva-inspector-content pb-4`,children:[d===`document`&&(0,Z.jsx)(Kte,{checks:t}),d===`envelope`&&(0,Z.jsx)(Jte,{}),u!==null&&(0,Z.jsx)(Yte,{selection:u})]})}),(0,Z.jsx)(z$,{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)(B$,{className:`relative flex-1 rounded-full bg-[var(--editor-scrollbar-thumb)] hover:bg-[var(--editor-scrollbar-thumb-hover)]`})})]})]})})}var Xte=$(`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 Zte({children:e,ancestors:t,onSelect:n,onOpenChange:r,portalContainer:i,open:a,anchor:o}){return(0,Z.jsxs)(e0,{open:a,onOpenChange:r,children:[(0,Z.jsx)(n0,{render:e}),(0,Z.jsx)(k1,{container:i,children:(0,Z.jsx)(r0,{anchor:o,sideOffset:2,children:(0,Z.jsxs)(E1,{"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)(T1,{className:Xte,"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 u9({...e}){return(0,Z.jsx)(K1,{"data-slot":`dropdown-menu`,...e})}function d9({...e}){return(0,Z.jsx)(Z1,{"data-slot":`dropdown-menu-trigger`,...e})}function f9({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){let o=j8();return(0,Z.jsx)(k1,{container:o,children:(0,Z.jsx)(A1,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,Z.jsx)(E1,{"data-slot":`dropdown-menu-content`,className:$(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden`,i),...a})})})}function p9({...e}){return(0,Z.jsx)(C1,{"data-slot":`dropdown-menu-group`,...e})}function m9({className:e,inset:t,...n}){return(0,Z.jsx)(w1,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:$(`text-muted-foreground px-1.5 py-1 text-xs font-medium data-inset:pl-7`,e),...n})}function h9({className:e,inset:t,variant:n=`default`,...r}){return(0,Z.jsx)(T1,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:$(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md px-1.5 py-1 text-sm data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...r})}function Qte({...e}){return(0,Z.jsx)(N1,{"data-slot":`dropdown-menu-radio-group`,...e})}function g9({className:e,children:t,inset:n,...r}){return(0,Z.jsxs)(I1,{"data-slot":`dropdown-menu-radio-item`,"data-inset":n,className:$(`focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...r,children:[(0,Z.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-radio-item-indicator`,children:(0,Z.jsx)(L1,{children:(0,Z.jsx)(R6,{})})}),t]})}function _9({className:e,...t}){return(0,Z.jsx)(lQ,{"data-slot":`dropdown-menu-separator`,className:$(`bg-border -mx-1 my-1 h-px`,e),...t})}var v9=(0,G.createContext)({hostBusy:!1,openInNewTab:void 0,showChecks:void 0}),$te=v9.Provider,y9=()=>(0,G.useContext)(v9);function ene({...e}){return(0,Z.jsx)(i0,{"data-slot":`alert-dialog`,...e})}function tne({container:e,...t}){let n=j8();return(0,Z.jsx)(Q$,{"data-slot":`alert-dialog-portal`,container:e??n,...t})}function nne({className:e,...t}){return(0,Z.jsx)(U$,{"data-slot":`alert-dialog-overlay`,className:$(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50`,e),...t})}function rne({className:e,size:t=`default`,...n}){return(0,Z.jsxs)(tne,{children:[(0,Z.jsx)(nne,{}),(0,Z.jsx)(Z$,{"data-slot":`alert-dialog-content`,"data-size":t,className:$(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-popover text-popover-foreground ring-foreground/10 gap-4 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none`,e),...n})]})}function ine({className:e,...t}){return(0,Z.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:$(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function ane({className:e,...t}){return(0,Z.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:$(`bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function one({className:e,...t}){return(0,Z.jsx)(s1,{"data-slot":`alert-dialog-title`,className:$(`text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2 font-heading`,e),...t})}function b9({className:e,...t}){return(0,Z.jsx)(G$,{"data-slot":`alert-dialog-description`,className:$(`text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3`,e),...t})}function sne({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,Z.jsx)(W$,{"data-slot":`alert-dialog-cancel`,className:$(``,e),render:(0,Z.jsx)(s5,{variant:t,size:n}),...r})}function x9({...e}){return(0,Z.jsx)(f0,{"data-slot":`popover`,...e})}function S9({...e}){return(0,Z.jsx)(h0,{"data-slot":`popover-trigger`,...e})}function C9({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,...a}){let o=j8();return(0,Z.jsx)(v0,{container:o,children:(0,Z.jsx)(x0,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,Z.jsx)(w0,{"data-slot":`popover-content`,className:$(`bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 flex flex-col gap-2.5 rounded-lg p-2.5 text-sm shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 z-50 w-72 origin-(--transform-origin) outline-hidden`,e),...a})})})}var w9=e=>M(e,`reason`)&&typeof e.reason==`string`?e.reason:e instanceof Error?e.message:String(e),cne=e=>e.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}),lne=`hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground relative flex w-full cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-left text-sm outline-none select-none`,T9=({children:e,testId:t})=>(0,Z.jsx)(`p`,{"data-testid":t,className:`text-muted-foreground px-1.5 py-2 text-[12.5px]`,children:e});function E9({testId:e,title:t,detail:n,marked:r,hint:i,onSelect:a}){return(0,Z.jsx)(`div`,{className:`group/row relative`,children:(0,Z.jsxs)(`button`,{type:`button`,"data-testid":e,"data-editor-control":``,onClick:a,className:lne,children:[(0,Z.jsx)(`span`,{className:`flex size-3.5 shrink-0 items-center justify-center`,children:r?(0,Z.jsx)(R6,{className:`size-3.5`}):null}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col items-start`,children:[(0,Z.jsx)(`span`,{className:`w-full truncate text-[13px]`,children:t}),(0,Z.jsx)(`span`,{className:`text-muted-foreground w-full truncate text-[11.5px]`,children:n})]}),i?(0,Z.jsx)(`span`,{"aria-hidden":!0,className:$(`text-muted-foreground pointer-events-none shrink-0 text-[11.5px]`,h8),children:`Restore`}):null]})})}function une(){let e=Q(e=>e.lifecycleCapability),t=Q(e=>e.doc!==null),n=Q(e=>e.editable),{beginLifecycle:r,endLifecycle:i,flushSaves:a,adoptLifecycleSnapshot:o}=Q(e=>e.actions),[s,c]=(0,G.useState)(!1),l=(0,G.useRef)(0),[u,d]=(0,G.useState)({status:`loading`}),[f,p]=(0,G.useState)(``),[m,h]=(0,G.useState)(null),[g,_]=(0,G.useState)(!1),[v,y]=(0,G.useState)(null),b=e?.status===`ready`?e.api:null;if(b===null||!t)return null;let x=u.status===`ready`?u.state:null,S=x?.dirty??!1,C=()=>{let e=++l.current;d({status:`loading`}),a().then(()=>b.inspect()).then(t=>{l.current===e&&d({status:`ready`,state:t})}).catch(t=>{l.current===e&&d({status:`failed`,message:w9(t)})})},w=e=>{c(e),e?(p(``),C()):l.current++},T=e=>{c(!1),x!==null&&(e.commit!==x.baseCommit||x.dirty)&&(y(null),h({commit:e.commit,message:e.message,blocked:x.dirty||x.conflicts.length>0}))},E=()=>{m===null||m.blocked||g||!n||r()&&(_(!0),y(null),a().then(async e=>{let t=await b.inspect();if(t.dirty||t.conflicts.length>0){d({status:`ready`,state:t}),h({...m,blocked:!0});return}o(await b.restore({commit:m.commit,baseRev:e})),h(null)}).catch(e=>y(w9(e))).finally(()=>{i(),_(!1)}))},D=f.trim().toLowerCase(),O=x?.commits.filter(({message:e})=>e.toLowerCase().includes(D)),k=D===``||`latest`.includes(D);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(x9,{open:s,onOpenChange:w,children:[(0,Z.jsx)(n7,{label:`Versions`,children:(0,Z.jsx)(S9,{"data-slot":`editor-version-picker`,render:(0,Z.jsx)(s5,{variant:`ghost`,size:`sm`,"aria-label":`Versions`,"data-testid":`preview-bar.versions`,"data-editor-control":``,disabled:g,className:`text-muted-foreground shrink-0 gap-1 px-2`}),children:g?`Restoring…`:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1 @max-[28rem]/preview-bar:hidden`,children:[`Latest`,(0,Z.jsx)(m6,{})]}),(0,Z.jsx)(B6,{className:`hidden size-3.5 @max-[28rem]/preview-bar:inline-flex`})]})})}),(0,Z.jsxs)(C9,{side:`bottom`,align:`start`,sideOffset:6,"data-testid":`preview-bar.versions-popup`,className:`w-72 gap-0 p-1`,children:[(0,Z.jsxs)(`label`,{className:`border-border flex items-center gap-2 border-b px-2 pb-1.5`,children:[(0,Z.jsx)(J6,{className:`text-muted-foreground size-3.5 shrink-0`}),(0,Z.jsx)(`input`,{type:`text`,value:f,onChange:e=>p(e.currentTarget.value),placeholder:`Search versions`,"aria-label":`Search versions`,"data-testid":`preview-bar.versions-search`,"data-editor-control":``,className:`placeholder:text-muted-foreground h-7 w-full min-w-0 bg-transparent text-sm outline-none`})]}),(0,Z.jsxs)(`div`,{className:`samva-editor-scroll max-h-72 overflow-y-auto pt-1`,children:[u.status===`loading`?(0,Z.jsx)(T9,{children:`Loading versions…`}):null,u.status===`failed`?(0,Z.jsxs)(`div`,{className:`flex flex-col items-start gap-2 px-1.5 py-2`,children:[(0,Z.jsx)(`p`,{role:`alert`,className:`text-destructive text-sm`,children:u.message}),(0,Z.jsx)(s5,{variant:`outline`,size:`sm`,"data-testid":`preview-bar.versions-retry`,"data-editor-control":``,onClick:C,children:`Try again`})]}):null,x!==null&&O!==void 0?(0,Z.jsxs)(Z.Fragment,{children:[k?(0,Z.jsx)(E9,{testId:`preview-bar.version-latest`,title:`Latest`,detail:S?`Unsaved changes`:`Saved`,marked:!0,hint:!1,onSelect:()=>c(!1)}):null,O.map(e=>{let t=e.commit===x.baseCommit,n=[t?`Current`:null,cne(e.committedAt),e.isPublished?`Published`:null].filter(e=>e!==null).join(` · `);return(0,Z.jsx)(E9,{testId:`preview-bar.version.${e.commit}`,title:e.message,detail:n,marked:!1,hint:!(t&&!x.dirty),onSelect:()=>T(e)},e.commit)}),!k&&O.length===0?(0,Z.jsx)(T9,{testId:`preview-bar.versions-empty`,children:`No versions match`}):null]}):null]})]})]}),(0,Z.jsx)(ene,{open:m!==null,onOpenChange:e=>{!e&&!g&&h(null)},children:(0,Z.jsxs)(rne,{"data-testid":`preview-bar.restore-dialog`,children:[(0,Z.jsxs)(ine,{children:[(0,Z.jsx)(one,{children:`Restore this version?`}),(0,Z.jsx)(b9,{children:`“${m?.message??``}” replaces the draft. Newer versions stay in the list, so you can restore them again.`}),n?null:(0,Z.jsx)(b9,{"data-testid":`preview-bar.restore-readonly`,children:`This template is read-only, so its versions can be viewed but not restored.`}),n&&m?.blocked?(0,Z.jsx)(b9,{children:`Save a version first, so your unsaved changes stay in the list.`}):null,v===null?null:(0,Z.jsx)(`p`,{role:`alert`,className:`text-destructive text-sm`,children:v})]}),(0,Z.jsxs)(ane,{children:[(0,Z.jsx)(sne,{"data-testid":`preview-bar.restore-cancel`,"data-editor-control":``,disabled:g,children:`Cancel`}),(0,Z.jsx)(s5,{"data-testid":`preview-bar.restore-confirm`,"data-editor-control":``,disabled:g||!n||m?.blocked===!0,onClick:E,children:g?`Restoring…`:`Restore`})]})]})})]})}var dne=[];function D9({testId:e,className:t}){let{fixtures:n,fixture:r,busy:i,available:a}=Q(fX(e=>({fixtures:e.doc?.fixtures??dne,fixture:e.doc?.fixture??null,busy:e.fixtureBusy,available:e.fixtureCapability?.status===`ready`}))),{viewFixture:o}=Q(e=>e.actions);return!a||r===null||n.length<2?null:(0,Z.jsx)(n7,{label:`Sample data the preview shows`,children:(0,Z.jsx)(`span`,{"data-editor-control":``,className:`inline-flex min-w-0`,children:(0,Z.jsx)(D7,{size:`sm`,"aria-label":`Fixture`,"data-slot":`editor-fixture-select`,"data-testid":e,value:r,disabled:i,onChange:e=>o(e.target.value),className:$(`max-w-40 min-w-0 [&_select]:text-xs [&_select]:font-medium`,t),children:n.map(e=>(0,Z.jsx)(O7,{value:e,children:e},e))})})})}function fne(){let{sizeKb:e,sizeSource:t,deviceWidth:n,rendered:r}=Q(fX(e=>({sizeKb:e.sizeKb,sizeSource:e.sizeSource,deviceWidth:M3[e.previewDevice],rendered:e.render!==null})));return r?t===`sent`?{text:`${n} px · ${e} KB`,help:`Width shown, and the size of the email as sent`}:{text:`${n} px · ${e} KB preview`,help:`Width shown, and the size of this preview. The email as sent can be smaller.`}:{text:`${n} px`,help:`Width shown`}}function pne({viewMenu:e,...t}){let{device:n,target:r,pageAvailable:i,working:a,canRefresh:o}=Q(fX(e=>({device:e.previewDevice,pageAvailable:e.pageAvailable,target:e.pageAvailable?e.previewTarget:`email`,working:e.fixtureBusy||e.pendingAuthoredSource!==null||e.previewRefreshing,canRefresh:e.doc!==null&&e.pendingAuthoredSource===null&&!e.metadataSaving&&!e.conflict&&!e.lifecycleBusy}))),{setPreviewDevice:s,setPreviewTarget:c,refreshPreview:l,openWorkTab:u}=Q(e=>e.actions),{hostBusy:d,openInNewTab:f}=y9(),p=r===`web`,m=p?void 0:f,h=w7().length,g=fne(),_=a||d;return u8(`editor-preview-bar`,{"data-testid":`preview-bar`,...t},{state:{busy:_},className:$(g8,`bg-background @container/preview-bar relative gap-1.5 px-2`),props:{children:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(une,{}),(0,Z.jsxs)(`div`,{"data-slot":`editor-preview-bar-center`,className:`flex min-w-0 flex-1 items-center justify-center gap-1.5`,children:[i&&(0,Z.jsx)(`span`,{"data-slot":`editor-preview-bar-target`,className:`inline-flex @max-[28rem]/preview-bar:hidden`,children:(0,Z.jsx)(r7,{ariaLabel:`Preview as`,value:r,onChange:c,size:`sm`,options:[{value:`email`,testId:`preview-bar.target.email`,label:`Email`},{value:`web`,testId:`preview-bar.target.web`,label:`Web`}]})}),(0,Z.jsx)(r7,{ariaLabel:`Preview width`,value:n,onChange:s,size:`sm`,options:[{value:`desktop`,title:`Desktop width`,testId:`canvas.device.desktop`,label:(0,Z.jsx)(O6,{className:`size-3.5`})},{value:`mobile`,title:`Phone width`,testId:`canvas.device.mobile`,label:(0,Z.jsx)(D6,{className:`size-3.5`})}]}),(0,Z.jsx)(D9,{testId:`preview-bar.fixture`}),p&&h>0&&(0,Z.jsxs)(s5,{variant:`outline`,size:`sm`,"data-slot":`editor-preview-bar-differences`,"data-testid":`preview-bar.differences`,"data-editor-control":``,onClick:()=>u(`checks`),className:`text-muted-foreground shrink-0 @max-[28rem]/preview-bar:hidden`,children:[h,` differ in email`]})]}),!p&&(0,Z.jsx)(s7,{}),!p&&(0,Z.jsx)(n7,{label:g.help,children:(0,Z.jsx)(`span`,{tabIndex:0,"data-slot":`editor-preview-bar-size`,"data-testid":`preview-bar.size`,className:`text-muted-foreground focus-visible:ring-ring/50 shrink-0 rounded-md px-1.5 text-xs leading-7 tabular-nums outline-none focus-visible:ring-3 @max-[28rem]/preview-bar:hidden`,children:g.text})}),m!==void 0&&(0,Z.jsx)(`span`,{className:`inline-flex @max-[28rem]/preview-bar:hidden`,children:(0,Z.jsx)(n7,{label:`Open in a new tab`,children:(0,Z.jsx)(s5,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open in a new tab`,"data-testid":`preview-bar.open`,"data-editor-control":``,onClick:m,className:`text-muted-foreground`,children:(0,Z.jsx)(G6,{})})})}),(0,Z.jsx)(n7,{label:o?`Refresh the preview`:`Refresh waits for your latest edit`,children:(0,Z.jsx)(s5,{variant:`ghost`,size:`icon-sm`,"aria-label":`Refresh the preview`,"data-testid":`preview-bar.refresh`,"data-editor-control":``,disabled:!o,onClick:l,className:`text-muted-foreground`,children:(0,Z.jsx)(q6,{})})}),(0,Z.jsx)(`span`,{className:$(`inline-flex`,e===void 0&&`hidden @max-[28rem]/preview-bar:inline-flex`),children:(0,Z.jsxs)(u9,{children:[(0,Z.jsx)(d9,{render:(0,Z.jsx)(s5,{variant:`ghost`,size:`icon-sm`,"aria-label":`More preview options`,"data-testid":`preview-bar.more`,"data-editor-control":``,className:`text-muted-foreground`}),children:(0,Z.jsx)(W6,{})}),(0,Z.jsxs)(f9,{align:`end`,className:`w-60`,children:[i&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(p9,{children:[(0,Z.jsx)(m9,{children:`Preview as`}),(0,Z.jsxs)(Qte,{value:r,onValueChange:e=>{(e===`email`||e===`web`)&&c(e)},children:[(0,Z.jsx)(g9,{value:`email`,"data-editor-control":``,children:`Email`}),(0,Z.jsx)(g9,{value:`web`,"data-editor-control":``,children:`Web`})]}),p&&h>0&&(0,Z.jsxs)(h9,{"data-editor-control":``,onClick:()=>u(`checks`),children:[h,` differ in email`]})]}),(0,Z.jsx)(_9,{})]}),!p&&(0,Z.jsxs)(p9,{children:[(0,Z.jsx)(m9,{children:`Preview`}),(0,Z.jsx)(`div`,{className:`text-muted-foreground px-1.5 pb-1.5 text-xs tabular-nums`,children:g.text}),m!==void 0&&(0,Z.jsxs)(h9,{"data-editor-control":``,onClick:m,children:[(0,Z.jsx)(G6,{}),`Open in a new tab`]})]}),e!==void 0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(_9,{}),e]})]})]})}),_&&(0,Z.jsx)(`span`,{role:`progressbar`,"aria-label":`Updating the preview`,"data-slot":`editor-preview-bar-progress`,"data-testid":`preview-bar.progress`,className:`pointer-events-none absolute inset-x-0 -bottom-px h-0.5 overflow-hidden`,children:(0,Z.jsx)(`span`,{className:`samva-editor-progress bg-primary absolute inset-y-0 w-2/5`})})]})}})}function mne(){let{stale:e,fixtureError:t}=Q(fX(e=>({stale:e.doc?.channel===`email`&&e.doc.preview.status===`stale`?e.doc.preview.reason:null,fixtureError:e.fixtureError}))),{showChecks:n}=y9(),r=e===null?t:`Showing the last preview that worked. Your latest edit has a problem: ${e}`;return r===null?null:(0,Z.jsxs)(`div`,{role:`status`,"data-slot":`editor-preview-notice`,"data-testid":e===null?`canvas.fixture-error`:`canvas.preview-stale`,className:`border-status-warning/35 bg-status-warning/10 text-foreground flex min-h-9 shrink-0 items-center gap-2 border-b px-3 py-1.5 text-xs`,children:[(0,Z.jsx)(`span`,{className:`bg-status-warning size-1.5 shrink-0 rounded-full`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1`,children:r}),e!==null&&n!==void 0&&(0,Z.jsx)(s5,{variant:`outline`,size:`sm`,onClick:n,"data-testid":`canvas.preview-stale.checks`,"data-editor-control":``,className:`bg-background shrink-0`,children:`Show checks`})]})}function O9({embedded:e=!1}={}){let{checks:t,doc:n,readonlyReason:r,rightCollapsed:i,rightWidth:a}=Q(fX(e=>({checks:e.checks,doc:e.doc,readonlyReason:e.readonlyReason,rightCollapsed:e.rightCollapsed,rightWidth:e.rightWidth}))),{toggleRight:o}=Q(e=>e.actions);return!e&&i?null:(0,Z.jsxs)(`aside`,{"data-editor-rail":`right`,style:{width:e?`100%`:a},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.jsx)(n7,{label:`Collapse inspector`,side:`bottom`,children:(0,Z.jsx)(s5,{variant:`ghost`,size:`icon-sm`,"aria-label":`Collapse inspector`,onClick:o,className:`text-muted-foreground ml-auto`,children:(0,Z.jsx)(P6,{})})})]}),(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:r}),n!==null&&(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-3 font-mono text-[11.5px] break-all`,children:n.origin.file}),(0,Z.jsx)(`div`,{className:`border-border-subtle mt-5 border-t pt-4`,children:(0,Z.jsx)(v7,{checks:t})})]})]})}var hne=()=>typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform)?`⌘`:`Ctrl+`;function k9({percent:e,...t}){let n=Q(e=>e.canvasZoom===`fit`),{setCanvasZoom:r}=Q(e=>e.actions),i=hne(),a=Math.round(e);return u8(`editor-zoom-control`,{role:`group`,"aria-label":`Zoom`,"data-testid":`canvas.zoom-control`,...t},{state:{fit:n,percent:a},className:`bg-popover text-popover-foreground ring-foreground/10 absolute bottom-3 left-1/2 z-20 flex -translate-x-1/2 items-center gap-0.5 rounded-lg p-1 shadow-md ring-1`,props:{children:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(n7,{label:`Zoom out`,shortcut:`${i}−`,side:`top`,children:(0,Z.jsx)(s5,{variant:`ghost`,size:`icon-sm`,"aria-label":`Zoom out`,"data-testid":`canvas.zoom-out`,"data-editor-control":``,disabled:a<=50,onClick:()=>r(g5(e)),children:(0,Z.jsx)(U6,{})})}),(0,Z.jsx)(n7,{label:`Actual size`,shortcut:`${i}0`,side:`top`,children:(0,Z.jsxs)(s5,{variant:`ghost`,size:`sm`,"aria-label":`Zoom ${a}%. Show at actual size`,"data-testid":`canvas.zoom-value`,"data-editor-control":``,onClick:()=>r(100),className:`min-w-13 px-1.5 font-normal tabular-nums`,children:[a,`%`]})}),(0,Z.jsx)(n7,{label:`Zoom in`,shortcut:`${i}+`,side:`top`,children:(0,Z.jsx)(s5,{variant:`ghost`,size:`icon-sm`,"aria-label":`Zoom in`,"data-testid":`canvas.zoom-in`,"data-editor-control":``,disabled:a>=200,onClick:()=>r(h5(e)),children:(0,Z.jsx)(K6,{})})}),(0,Z.jsx)(W5,{orientation:`vertical`,className:`mx-0.5 h-4!`}),(0,Z.jsx)(n7,{label:`Fit the email to the pane`,side:`top`,children:(0,Z.jsx)(K5,{size:`sm`,pressed:n,onPressedChange:e=>{e&&r(`fit`)},"data-testid":`canvas.zoom`,"data-editor-control":``,className:`px-2 text-xs`,children:`Fit`})})]})}})}function A9({pointing:e=!1,active:t=!0,viewMenu:n,...r}){let{doc:i,render:a,outline:o,selection:s,previewDevice:c,canvasZoom:l,previewEpoch:u,canvasMode:d,beforeEdits:f,pins:p,sourceEditable:m,previewTarget:h,pageRender:g,pageError:_}=Q(fX(e=>({doc:e.doc,render:e.render,outline:e.outline,selection:e.selection,previewDevice:e.previewDevice,canvasZoom:e.canvasZoom,previewEpoch:e.previewEpoch,canvasMode:e.canvasMode,beforeEdits:e.designCompare?e.designDraft?.baseRender??null:null,pins:e.pins,sourceEditable:e.sourceEditable,previewTarget:e.pageAvailable?e.previewTarget:`email`,pageRender:e.pageRender,pageError:e.pageError}))),v=N4(),{select:y,selectDocument:b,selectFromPage:x,setHovered:S,setCanvasZoom:C}=Q(e=>e.actions),w=Q(e=>e.hoveredCandidatePath===null?null:e.outline?.index.get(e.hoveredCandidatePath)??null),T=j8(),E=w8(`canvas.overlay`),D=(0,G.useRef)(null),[O,k]=(0,G.useState)(1),[A,j]=(0,G.useState)([]),[M,N]=(0,G.useState)(!1),[P,F]=(0,G.useState)(null),I=s.kind===`element`?o?.index.get(s.instancePath)??null:null,L=d===`design`,R=(0,G.useCallback)(e=>{let{canvasMode:t,actions:n,outline:r}=v.getState(),i=t===`point`||e===null||r===null?e:Y4(r,e)?.instancePath??e;t===`pin`?i!==null&&n.addPin(i):n.select(i)},[v]),z=i?.channel===`email`?i.fixture:null,ee=a?.revision??null,B=(0,G.useMemo)(()=>p.filter(e=>e.fixture===z&&e.revision===ee).map(e=>({number:e.number,instancePath:e.instancePath})),[p,z,ee]),V=c===`mobile`?375:600;(0,G.useLayoutEffect)(()=>{let e=D.current;if(e===null||typeof ResizeObserver>`u`)return;let t=()=>{let t=Math.max(240,e.clientWidth-80);k(Math.min(1,Math.max(.5,t/V)))};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[V]);let te=l===`fit`?O:l/100,H=te*100,ne=(0,G.useRef)(H);(0,G.useLayoutEffect)(()=>{ne.current=H},[H]);let re=(0,G.useCallback)(e=>{let t=ne.current;e.kind===`wheel`?C(_5(t,e.deltaY)):e.direction===`in`?C(h5(t)):e.direction===`out`?C(g5(t)):C(100)},[C]);(0,G.useEffect)(()=>{let e=D.current;if(e===null||!t)return;let n=e=>{y5(e)&&(e.preventDefault(),re({kind:`wheel`,deltaY:e.deltaY}))};return e.addEventListener(`wheel`,n,{passive:!1}),()=>e.removeEventListener(`wheel`,n)},[t,re]),(0,G.useEffect)(()=>{if(!t)return;let e=D.current?.closest(`[data-samva-editor-theme]`);if(e==null)return;let n=t=>{let n=v5(t);n!==null&&t.target instanceof Node&&e.contains(t.target)&&(t.preventDefault(),re({kind:`key`,direction:n}))};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[t,re]);let ie=(0,G.useCallback)(t=>{if(e||v.getState().canvasMode===`pin`||o===null||t.instancePath===null){N(!1);return}let n=[...B4(o,t.instancePath),t.instancePath].toReversed().flatMap(e=>{let t=o.index.get(e);return t===void 0?[]:[{instancePath:e,label:F4(t),generated:!t.authored}]});if(n.length===0){N(!1);return}y(t.instancePath),j(n);let{clientX:r,clientY:i}=t;F({getBoundingClientRect:()=>DOMRect.fromRect({x:r,y:i})}),queueMicrotask(()=>N(!0))},[o,e,y,v]),ae=(0,G.useCallback)(e=>{e===null?y(null):x(e)},[y,x]),oe=(0,G.useCallback)(e=>{let{pageRender:t,render:n,editable:r,sourceEditable:i,lifecycleCapability:a}=v.getState();if(t===null||n===null||t.revision!==n.revision||!r||!i||a?.status!==`ready`)return!1;let o=A3(t.selections,n.selections,e);return n.selections.find(e=>e.instancePath===o)?.origins.some(e=>e.fileName.endsWith(`.md`))===!0},[v]),se=(0,G.useCallback)((e,t)=>{let{pageRender:n,render:r}=v.getState();if(n===null||r===null||n.revision!==r.revision)return;let i=A3(n.selections,r.selections,e);i!==null&&(x(e),v.getState().actions.editMarkdownText(i,t))},[x,v]),U=Q(e=>e.sourceEditError),ce=h===`web`,le=g!==null&&_===null&&a!==null?(0,Z.jsx)(I5,{page:g,selectedEmailPath:s.kind===`element`?s.instancePath:null,emailSelections:a.selections,width:V,epoch:u,onSelect:ae,onZoomGesture:t?re:void 0,canEditText:oe,onEditText:se}):null,ue=f===null?a===null?null:(0,Z.jsx)(j5,{html:a.html,width:V,epoch:u,onSelect:R,onHover:S,onZoomGesture:t?re:void 0,onContextMenu:e?void 0:ie,overlay:(0,Z.jsx)(F5,{renderRevision:a.revision,selected:d===`pin`?null:I,hovered:w,toolbar:L&&I!==null?(0,Z.jsx)(u7,{selection:I}):void 0,pins:B})}):(0,Z.jsx)(j5,{html:f.html,width:V,epoch:u}),de=ce?le:ue,W=(0,Z.jsxs)(Z.Fragment,{children:[(i===null||i.channel===`email`)&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(pne,{viewMenu:n}),(0,Z.jsx)(mne,{})]}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{"data-canvas-mode":d,className:`samva-editor-workspace relative flex min-h-0 min-w-0 flex-1 flex-col`,children:[E.length>0&&(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:E.map(e=>(0,Z.jsx)(G.Fragment,{children:e.render()},e.id))}),(0,Z.jsx)(`div`,{ref:D,"data-samva-canvas-viewport":!0,className:$(`samva-editor-scroll relative flex-1 [scrollbar-gutter:stable] overflow-auto px-10 pt-10 pb-24 [overflow-anchor:none]`,(p.length>0||d===`pin`)&&`pb-64`),onClick:b,children:i===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":l===`fit`?`fit`:String(l),style:{width:V,zoom:te},onClick:e=>e.stopPropagation(),children:[!ce&&(0,Z.jsx)(m7,{}),ce&&U!==null&&(0,Z.jsx)(`p`,{role:`alert`,"data-testid":`canvas.page-save-error`,className:`bg-destructive/10 text-destructive mb-2 rounded-md px-3 py-2 text-xs`,children:U}),de===null?ce?(0,Z.jsx)(gne,{}):(0,Z.jsx)(_ne,{}):e||ce?de:(0,Z.jsx)(Zte,{ancestors:A,onSelect:y,portalContainer:T,anchor:P??void 0,open:M,onOpenChange:e=>N(e&&A.length>0),children:de})]})}),f!==null&&(0,Z.jsx)(`div`,{"data-testid":`canvas.compare-badge`,className:`pointer-events-none absolute inset-x-0 top-3 z-10 flex justify-center`,children:(0,Z.jsx)(`span`,{className:`bg-popover text-popover-foreground ring-foreground/10 rounded-lg px-3 py-1 text-xs font-medium shadow-md ring-1`,children:`Before your edits`})}),i!==null&&(p.length>0||d===`pin`)&&(0,Z.jsx)(`div`,{className:$(`pointer-events-none absolute inset-x-0 z-20 flex flex-col items-center gap-2 px-3`,L?`bottom-16`:`bottom-15`),children:(0,Z.jsx)(l7,{})}),i!==null&&!L&&(0,Z.jsx)(k9,{percent:H}),i!==null&&L&&(0,Z.jsxs)(`div`,{"data-slot":`editor-design-bar`,className:`border-border bg-background @container/design-bar flex h-11 shrink-0 items-center justify-between gap-2 border-t px-2`,children:[(0,Z.jsx)(k9,{percent:H,className:`static translate-x-0 rounded-none bg-transparent p-0 shadow-none ring-0 @max-[34rem]/design-bar:hidden`}),(0,Z.jsx)(c7,{})]})]}),e&&L&&(0,Z.jsx)(`div`,{"data-slot":`editor-design-properties`,"data-testid":`canvas.design-properties`,className:`border-border hidden w-[300px] shrink-0 border-l @min-[44rem]/work-pane:flex`,children:m?(0,Z.jsx)(l9,{embedded:!0,checks:!1}):(0,Z.jsx)(O9,{embedded:!0})})]})]});return u8(`editor-canvas`,{...r},{state:{zoom:l===`fit`?`fit`:String(l),device:c,target:h},className:`flex min-h-0 min-w-0 flex-1 flex-col`,props:{children:W}})}function gne(){return(0,Z.jsxs)(`div`,{"data-testid":`canvas.page-unbuilt`,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:`No preview yet`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-1`,children:`The web page isn't ready. Switch to Email to keep working.`})]})}function _ne(){let e=Q(fX(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)(B5,{check:e,actions:(0,Z.jsx)(R5,{check:e})})},e.id))})]})}var vne={body:b6,div:S6,table:C6,tbody:C6,tr:C6,td:I6,th:I6,h1:w6,h2:w6,h3:w6,h4:w6,h5:w6,h6:w6,p:A6,span:A6,a:l8,button:p6,img:T6,hr:v6,br:d6,ul:f6,ol:f6,li:f6},yne=e=>vne[e.toLowerCase()]??S6,bne={Section:C6,Container:C6,Spacer:c8,Divider:s8,Button:p6,Columns:I6,Column:I6,Link:l8},xne=(e,t)=>bne[e]??yne(t),Sne=(e,t)=>{let n=L4(e,t)?.replace(/\u200b|\u00ad|\u034f/g,``).trim();if(n===void 0||n===``)return;let r=n.length/2,i=n.slice(0,Math.floor(r)).trim();return i!==``&&n.slice(Math.ceil(r)).trim().startsWith(i.slice(0,12))?i:n};function j9({node:e,depth:t}){let{selectedPath:n,collapsedLayers:r,authoredSource:i,html:a}=Q(fX(e=>({selectedPath:e.selection.kind===`element`?e.selection.instancePath:null,collapsedLayers:e.collapsedLayers,authoredSource:e.doc?.origin.authoredSource??``,html:e.render?.html??``}))),{select:o,toggleLayerExpand:s,setHovered:c}=Q(e=>e.actions),l=e.children.length>0,u=!r.has(e.instancePath),d=n===e.instancePath,{selection:f}=e,p=U4(f,i),m=e.copies>1?`×${e.copies}`:void 0,h=l&&u?void 0:Sne(f,a);return(0,Z.jsxs)(`li`,{children:[(0,Z.jsx)(`div`,{className:`group relative`,style:{paddingLeft:t*12},onMouseEnter:()=>c(e.instancePath),onMouseLeave:()=>c(null),children:(0,Z.jsxs)(`div`,{"data-slot":`editor-layer`,"data-selected":d||void 0,className:$(`flex h-[30px] w-full items-center gap-1.5 rounded-md pr-2 pl-1 text-left transition-colors`,d?`bg-muted text-foreground`:`text-foreground hover:bg-muted/60`),children:[l?(0,Z.jsx)(s5,{variant:`ghost`,size:`icon-xs`,"aria-expanded":u,"data-testid":`left-rail.layer.toggle`,"aria-label":`${u?`Collapse`:`Expand`} ${p}`,className:$(`text-muted-foreground size-5 shrink-0 transition-transform hover:bg-transparent`,u&&`rotate-90`),onClick:t=>{t.stopPropagation(),s(e.instancePath)},children:(0,Z.jsx)(g6,{className:`size-3`})}):(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`size-5 shrink-0`}),(0,Z.jsxs)(s5,{variant:`ghost`,size:`sm`,"data-layer-instance-path":e.instancePath,"data-layer-name":p,"data-testid":`layers.node.${e.instancePath}`,onClick:()=>o(e.instancePath),className:`h-full min-w-0 flex-1 justify-start gap-2 rounded-md px-1 text-left font-normal hover:bg-transparent dark:hover:bg-transparent`,children:[(0,G.createElement)(xne(p,f.tag),{className:$(`size-[15px] shrink-0`,d?`text-foreground`:`text-muted-foreground`)}),(0,Z.jsx)(`span`,{className:`shrink-0 text-[12.5px] font-medium`,children:p}),h!==void 0&&(0,Z.jsx)(`span`,{className:`text-muted-foreground min-w-0 flex-1 truncate text-[12px]`,children:h}),m!==void 0&&(0,Z.jsx)(`span`,{className:`text-muted-foreground ml-auto shrink-0 text-[11px] tabular-nums`,children:m})]})]})}),l&&u&&(0,Z.jsx)(`ul`,{className:`m-0 list-none p-0`,children:e.children.map(e=>(0,Z.jsx)(j9,{node:e,depth:t+1},e.instancePath))})]})}function M9(){let e=Q(e=>e.outline),t=(0,G.useMemo)(()=>e===null?[]:q4(e),[e]);if(e===null)return(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.`});let n=t.length===1&&t[0]?.selection.tag===`html`?t[0].children:t;return(0,Z.jsx)(`ul`,{className:`m-0 list-none p-0`,children:n.map(e=>(0,Z.jsx)(j9,{node:e,depth:0},e.instancePath))})}function Cne(){let{leftCollapsed:e,leftWidth:t,layoutMode:n}=Q(fX(e=>({leftCollapsed:e.leftCollapsed,leftWidth:e.leftWidth,layoutMode:e.layoutMode}))),{toggleLeft:r}=Q(e=>e.actions),i=n===`compact`||n===`narrow`;return(0,Z.jsx)(`aside`,{"aria-label":`Layers`,"aria-hidden":e||void 0,inert:e||void 0,"data-editor-rail":`left`,style:{width:e?0:t,maxWidth:i?`calc(100% - 48px)`:void 0},className:$(`flex h-full shrink-0 flex-col overflow-hidden border-r border-border bg-background transition-[width,transform,box-shadow] duration-180 ease-out`,i&&`absolute inset-y-0 left-0 z-40 shadow-[var(--shadow-floating)]`,e&&`border-r-0`),children:(0,Z.jsxs)(`div`,{className:`flex h-full min-w-0 flex-col`,style:{width:t,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.jsx)(n7,{label:`Collapse layers`,side:`bottom`,children:(0,Z.jsx)(s5,{variant:`ghost`,size:`icon-sm`,"aria-label":`Collapse layers`,"data-testid":`left-rail.collapse`,onClick:r,className:`text-muted-foreground ml-auto`,children:(0,Z.jsx)(M6,{})})})]}),(0,Z.jsxs)(x$,{"data-samva-scroll-area":`layers`,className:`relative min-h-0 flex-1`,children:[(0,Z.jsx)(N$,{className:`size-full`,children:(0,Z.jsx)(`div`,{className:`px-2 pt-2.5 pb-5`,children:(0,Z.jsx)(M9,{})})}),(0,Z.jsx)(z$,{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)(B$,{className:`relative flex-1 rounded-full bg-[var(--editor-scrollbar-thumb)] hover:bg-[var(--editor-scrollbar-thumb-hover)]`})})]})]})})}var wne=8,Tne=24,Ene=0,Dne=1e4,One={assistant:`Resize chat`,left:`Resize layers panel`,right:`Resize inspector`},kne={assistant:`agent-column.resize`,left:`left-rail.resize`,right:`inspector.resize`},N9=()=>{document.body.style.cursor=``,document.body.style.userSelect=``};function P9({side:e,...t}){let n=N4(),r=Q(t=>e===`assistant`?t.assistantWidth:e===`left`?t.leftWidth:t.rightWidth),{setAssistantWidth:i,setChatCollapsed:a,setLeftWidth:o,setRightWidth:s}=Q(e=>e.actions),c=(0,G.useRef)(!1),[l,u]=(0,G.useState)(!1),d=(0,G.useCallback)(()=>{c.current&&(c.current=!1,u(!1),N9())},[]);(0,G.useEffect)(()=>()=>{c.current&&N9()},[]);let f=t=>{if(e===`assistant`){let{chatCollapsed:e}=n.getState();if(t<140){a(!0);return}e&&a(!1),i(t)}else e===`left`?o(t):s(t)},p=e=>{(e.pointerType!==`mouse`||e.button===0)&&(e.preventDefault(),e.currentTarget.setPointerCapture?.(e.pointerId),c.current=!0,u(!0),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`)},m=t=>{if(!c.current)return;let n=t.currentTarget.parentElement;if(n===null)return;let r=n.getBoundingClientRect();f(e===`right`?r.right-t.clientX:t.clientX-r.left)},h=t=>{let n=t.shiftKey?Tne:wne,i=e===`right`?`ArrowLeft`:`ArrowRight`,a=e===`right`?`ArrowRight`:`ArrowLeft`,o;if(t.key===i)o=r+n;else if(t.key===a)o=r-n;else if(t.key===`Home`)o=e===`assistant`?280:Ene;else if(t.key===`End`)o=e===`assistant`?640:Dne;else return;t.preventDefault(),f(o)};return u8(`editor-divider`,{...t},{state:{side:e,dragging:l},className:$(`relative z-10 -mx-1.5 w-3 shrink-0 cursor-col-resize touch-none outline-none`,`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`,`data-[dragging]:before:w-0.5 data-[dragging]:before:bg-accent-email`,`focus-visible:before:w-0.5 focus-visible:before:bg-accent-email`,d8),props:{"data-editor-resize":e,role:`separator`,"aria-orientation":`vertical`,"aria-label":One[e],"aria-valuenow":r,"aria-valuemin":e===`assistant`?280:void 0,"aria-valuemax":e===`assistant`?640:void 0,"data-testid":kne[e],tabIndex:0,onPointerDown:p,onPointerMove:m,onPointerUp:d,onPointerCancel:d,onLostPointerCapture:d,onKeyDown:h}})}var F9=(0,G.createContext)(null),Ane=F9.Provider,I9=()=>{let e=(0,G.useContext)(F9);if(e===null)throw Error(`Editor chrome parts must be rendered inside EditorRoot`);return e};function jne(){let e=Q(e=>e.sourceEditable);return(0,Z.jsx)(`div`,{"data-slot":`editor-design-panel`,"data-testid":`design-panel`,className:`@container/design flex min-h-0 min-w-0 flex-1`,children:(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col @min-[36rem]/design:flex-row`,children:[(0,Z.jsxs)(`section`,{"aria-label":`Layers`,"data-slot":`editor-layers`,className:`border-border flex max-h-[40%] min-h-0 shrink-0 flex-col border-b @min-[36rem]/design:max-h-none @min-[36rem]/design:w-72 @min-[36rem]/design:border-r @min-[36rem]/design:border-b-0`,children:[(0,Z.jsx)(`h2`,{className:`text-muted-foreground px-3 pt-3 pb-1 font-mono text-[10.5px] font-medium tracking-[0.08em] uppercase`,children:`Layers`}),(0,Z.jsxs)(x$,{"data-samva-scroll-area":`layers`,className:`relative min-h-0 flex-1`,children:[(0,Z.jsx)(N$,{className:`size-full`,children:(0,Z.jsx)(`div`,{className:`px-2 pb-4`,children:(0,Z.jsx)(M9,{})})}),(0,Z.jsx)(z$,{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)(B$,{className:`relative flex-1 rounded-full bg-[var(--editor-scrollbar-thumb)] hover:bg-[var(--editor-scrollbar-thumb-hover)]`})})]})]}),(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:e?(0,Z.jsx)(l9,{embedded:!0,checks:!1}):(0,Z.jsx)(O9,{embedded:!0})})]})})}var L9={preview:{label:`Preview`,hint:`The email`,Icon:x6},source:{label:`Source`,hint:`The template's code`,Icon:V6},design:{label:`Design`,hint:`Layers and properties`,Icon:E6},review:{label:`Review`,hint:`Changes to look over`,Icon:H6},checks:{label:`Checks`,hint:`Clients, size and links`,Icon:z6}};function Mne(){let{errorCount:e,warnCount:t}=Q(fX(e=>{let t=x3(e.checks);return{errorCount:t.errorCount,warnCount:t.warnCount}})),n=e+t;return n===0?null:(0,Z.jsx)(H5,{variant:e>0?`destructive`:`secondary`,"data-testid":`work-pane.checks-badge`,className:`h-4 min-w-4 px-1 tabular-nums`,children:n})}function R9(){let e=Q(e=>e.workTabs),t=Q(e=>e.actions.openWorkTab),n=C8(`rail.review`)??null;return(0,Z.jsxs)(p9,{children:[(0,Z.jsx)(m9,{children:`Open a view`}),j3.filter(e=>e!==`review`||n!==null).map(n=>{let{label:r,hint:i,Icon:a}=L9[n];return(0,Z.jsxs)(h9,{"data-testid":`work-pane.add.${n}`,"data-editor-control":``,onClick:()=>t(n),className:`py-1.5`,children:[(0,Z.jsx)(a,{className:`text-muted-foreground`}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,Z.jsx)(`span`,{children:r}),(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:i})]}),e.includes(n)&&(0,Z.jsx)(R6,{className:`text-muted-foreground`})]},n)})]})}var z9=$(o5({variant:`ghost`,size:`sm`}),`text-muted-foreground data-active:bg-muted data-active:text-foreground shrink-0 text-[13px]`);function Nne({split:e,visible:t=!0,...n}){let{workTabs:r,activeWorkTab:i,chatCollapsed:a,narrow:o}=Q(fX(e=>({workTabs:e.workTabs,activeWorkTab:e.activeWorkTab,chatCollapsed:e.chatCollapsed,narrow:e.layoutMode===`narrow`}))),{openWorkTab:s,closeWorkTab:c,setChatCollapsed:l}=Q(e=>e.actions),u=C8(`rail.review`)??null,d=r.filter(e=>e!==`review`||u!==null),f=i!==`preview`&&!d.includes(i)?`preview`:i,p=a?`Show chat`:`Collapse chat`,m=o&&d.length===0;return u8(`editor-work-pane`,{"aria-label":`Work pane`,"data-testid":`work-pane`,...n},{state:{tab:f,split:e},tag:`section`,className:`bg-background @container/work-pane flex min-h-0 min-w-0 flex-1 flex-col`,props:{children:(0,Z.jsxs)(k0,{value:f,onValueChange:e=>{(e===`preview`||j3.some(t=>t===e))&&s(e)},className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[!m&&(0,Z.jsxs)(`div`,{"data-slot":`editor-work-pane-header`,className:$(`border-border flex h-11 shrink-0 items-center border-b`,`gap-1 px-2`),children:[e&&(0,Z.jsx)(n7,{label:p,children:(0,Z.jsx)(s5,{variant:`ghost`,size:`icon-sm`,"aria-label":p,"aria-pressed":a,"data-testid":`work-pane.toggle-chat`,"data-editor-control":``,onClick:()=>l(!a),className:`text-muted-foreground mr-0.5`,children:a?(0,Z.jsx)(j6,{}):(0,Z.jsx)(M6,{})})}),(0,Z.jsxs)(z0,{"data-slot":`editor-work-pane-tabs`,"aria-label":`Work pane views`,className:$(`samva-editor-scroll-hidden flex h-full min-w-0 items-center gap-1 overflow-x-auto`,o&&`px-2`),children:[(0,Z.jsxs)(P0,{value:`preview`,"data-slot":`editor-work-pane-tab`,"data-testid":`work-pane.tab.preview`,"data-editor-control":``,"aria-label":o?`Preview`:void 0,className:$(z9,o&&`px-2`),children:[(0,Z.jsx)(x6,{}),o?null:`Preview`]}),d.map(e=>{let{label:t,Icon:n}=L9[e];return(0,Z.jsxs)(`span`,{"data-slot":`editor-work-pane-tab-group`,className:`group/row relative inline-flex shrink-0 items-center`,children:[(0,Z.jsxs)(P0,{value:e,"data-slot":`editor-work-pane-tab`,"data-testid":`work-pane.tab.${e}`,"data-editor-control":``,"aria-label":o?t:void 0,className:$(z9,o?`px-2`:`pr-7`),children:[(0,Z.jsx)(n,{}),o?null:t,e===`review`&&u?.badge,e===`checks`&&(0,Z.jsx)(Mne,{})]}),(0,Z.jsx)(s5,{variant:`ghost`,size:`icon-xs`,"aria-label":`Close ${t}`,"data-slot":`editor-work-pane-tab-close`,"data-testid":`work-pane.close.${e}`,"data-editor-control":``,onClick:()=>c(e),className:$(`text-muted-foreground size-5 rounded-sm`,o?`relative`:`absolute right-1`,h8,`group-has-[[data-active]]/row:opacity-100`),children:(0,Z.jsx)(L6,{className:`size-3`})})]},e)})]}),(0,Z.jsxs)(u9,{children:[(0,Z.jsx)(n7,{label:`Add a view`,children:(0,Z.jsx)(d9,{"data-slot":`editor-work-pane-add`,render:(0,Z.jsx)(s5,{variant:`ghost`,size:`icon-sm`,"aria-label":`Add a view`,"data-testid":`work-pane.add`,"data-editor-control":``,className:`text-muted-foreground`}),children:(0,Z.jsx)(K6,{})})}),(0,Z.jsx)(f9,{"data-testid":`work-pane.add-menu`,className:`w-60`,children:(0,Z.jsx)(R9,{})})]})]}),(0,Z.jsx)(R0,{value:`preview`,keepMounted:!0,"data-slot":`editor-work-pane-panel`,"data-testid":`work-pane.panel.preview`,className:`flex min-h-0 min-w-0 flex-1 outline-none`,children:(0,Z.jsx)(A9,{pointing:!0,active:t&&f===`preview`,viewMenu:m?(0,Z.jsx)(R9,{}):void 0})}),f===`source`&&(0,Z.jsx)(R0,{value:`source`,"data-slot":`editor-work-pane-panel`,className:`flex min-h-0 min-w-0 flex-1 outline-none`,children:(0,Z.jsx)(N8,{})}),f===`design`&&(0,Z.jsx)(R0,{value:`design`,"data-slot":`editor-work-pane-panel`,className:`flex min-h-0 min-w-0 flex-1 outline-none`,children:(0,Z.jsx)(jne,{})}),f===`review`&&u!==null&&(0,Z.jsx)(R0,{value:`review`,"data-slot":`editor-work-pane-panel`,"data-testid":`work-pane.panel.review`,className:`samva-editor-scroll min-h-0 flex-1 overflow-y-auto px-4 pt-4 pb-6 outline-none`,children:u.content}),f===`checks`&&(0,Z.jsx)(R0,{value:`checks`,"data-slot":`editor-work-pane-panel`,"data-testid":`work-pane.panel.checks`,className:`samva-editor-scroll min-h-0 flex-1 overflow-y-auto outline-none`,children:(0,Z.jsx)(`div`,{className:`max-w-2xl px-4 pt-4 pb-8`,children:(0,Z.jsx)(E7,{})})})]})}})}function Pne(){let e=Q(e=>e.sourceEditable),t=Q(e=>e.leftCollapsed),n=Q(e=>e.rightCollapsed),r=Q(e=>e.layoutMode),i=Q(e=>e.chatCollapsed),a=Q(e=>e.focusedPane),o=C8(`rail.assistant`)!==void 0,s=Q(e=>e.workspaceView),c=N4(),l=e=>c.setState({workspaceView:e}),{idBase:u}=I9();if(o){let e=r!==`wide`,t=e?a!==`assistant`:i;return(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:(0,Z.jsxs)(`div`,{className:`relative flex min-h-0 min-w-0 flex-1`,"data-agent-workspace-layout":e?`focused`:`split`,children:[(0,Z.jsx)(`div`,{id:`${u}-pane-assistant`,role:e?`tabpanel`:void 0,"aria-labelledby":e?`${u}-tab-assistant`:void 0,hidden:t,className:$(!e&&`contents`,e&&`flex h-full min-h-0 min-w-0 flex-1`),children:(0,Z.jsx)(O8,{hidden:t})}),!e&&!i&&(0,Z.jsx)(P9,{side:`assistant`}),(0,Z.jsx)(`div`,{id:`${u}-pane-preview`,role:e?`tabpanel`:void 0,"aria-labelledby":e?`${u}-tab-preview`:void 0,hidden:e&&a!==`preview`,className:`flex min-h-0 min-w-0 flex-1`,children:(0,Z.jsx)(Nne,{split:!e,visible:!e||a===`preview`})})]})})}return(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,Z.jsx)(Lte,{}),(0,Z.jsx)(L8,{value:s,onChange:l,children:s===`source`?(0,Z.jsx)(N8,{}):(0,Z.jsxs)(`div`,{className:`relative flex min-h-0 min-w-0 flex-1`,children:[(0,Z.jsx)(Cne,{}),!t&&(0,Z.jsx)(P9,{side:`left`}),(0,Z.jsx)(A9,{}),!n&&(0,Z.jsx)(P9,{side:`right`}),e?(0,Z.jsx)(l9,{}):(0,Z.jsx)(O9,{})]})})]})}var Fne=RegExp(`\\s${qc}="[^"]*"`,`g`),Ine=e=>e.replace(Fne,``),Lne=e=>{let t=e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``);return t===``?`email`:t},B9=(e,t)=>{let n=new Blob([Ine(e)],{type:`text/html;charset=utf-8`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`${Lne(t)}.html`,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(r)},V9=`image/png,image/jpeg,image/gif,image/webp,.woff2`,Rne=1048576,zne=(e,t)=>{let n=e?.lastIndexOf(`/`)??-1;return`${e===void 0||n<0?``:e.slice(0,n+1)}assets/${t}`},Bne=e=>{let t=e.lastIndexOf(`.`);return t>e.lastIndexOf(`/`)?e.slice(t):``},Vne=e=>M(e,`_tag`)&&e._tag===`ProjectFileExists`,H9=e=>M(e,`reason`)&&typeof e.reason==`string`?e.reason:`The template project operation failed.`,Hne=e=>e.isPublished?`Published`:e.isHead?`Current saved version`:`Saved version`;function Une({file:e,content:t,busy:n,onChange:r,onApply:i,onReplace:a}){let o=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)(`div`,{className:`space-y-3`,"data-testid":`lifecycle-sheet.binary-file`,children:e.status===`deleted`?(0,Z.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Removed from the draft. Save a version to keep this change.`}):(0,Z.jsxs)(Z.Fragment,{children:[(e.status===`added`||e.status===`modified`)&&(0,Z.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Unsaved until you save a version.`}),(0,Z.jsx)(`button`,{type:`button`,disabled:n,"data-testid":`lifecycle-sheet.replace-file`,onClick:a,className:$(`border-border hover:bg-muted rounded-md border px-3 py-2 text-xs disabled:opacity-50`,d8),children:`Replace file`})]})}):o?(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:$(`bg-primary text-primary-foreground rounded-md px-3 py-2 text-xs font-medium disabled:opacity-50`,d8),children:`Apply file`})]})]})}function Wne({conflict:e,busy:t,onResolve:n}){let[r,i]=(0,G.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:$(`border-border hover:bg-muted rounded-md border px-3 py-2 text-xs`,d8),children:`Keep draft`}),(0,Z.jsx)(`button`,{type:`button`,disabled:t,onClick:()=>n(`main`),className:$(`border-border hover:bg-muted rounded-md border px-3 py-2 text-xs`,d8),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:$(`bg-primary text-primary-foreground rounded-md px-3 py-2 text-xs font-medium`,d8),children:`Use edited source`})]})]})}function Gne({open:e,onClose:t,onLockedAction:n}){return e?(0,Z.jsx)(Kne,{onClose:t,onLockedAction:n}):null}function Kne({onClose:e,onLockedAction:t}){let n=j8(),r=Q(e=>e.doc),i=Q(e=>e.lifecycleCapability),{beginLifecycle:a,endLifecycle:o,flushSaves:s,adoptLifecycleSnapshot:c}=Q(e=>e.actions),l=r!==null&&i?.status===`ready`,[u,d]=(0,G.useState)(null),[f,p]=(0,G.useState)(null),[m,h]=(0,G.useState)(null),[g,_]=(0,G.useState)({}),[v,y]=(0,G.useState)(()=>l?`loading`:null),b=(0,G.useRef)(null),x=(0,G.useRef)(null),[S,C]=(0,G.useState)(null),[w,T]=(0,G.useState)(null),[E,D]=(0,G.useState)(null),[O,k]=(0,G.useState)(l);if(l!==O&&(k(l),l&&(y(`loading`),d(null),T(null),D(null),p(null),h(null),_({}),C(null))),(0,G.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||T(H9(t))}).finally(()=>{e||y(null)}),()=>{e=!0}},[r,s,i]),i===void 0)return null;if(i.status===`locked`)return(0,Z.jsx)(a1,{open:!0,onOpenChange:t=>!t&&e(),children:(0,Z.jsxs)(Q$,{container:n,children:[(0,Z.jsx)(U$,{className:`fixed inset-0 z-[110] bg-[var(--editor-backdrop,rgb(0_0_0/0.28))]`}),(0,Z.jsx)(o1,{className:`fixed inset-0 z-[111] grid place-items-center p-4`,children:(0,Z.jsxs)(Z$,{className:`border-border bg-popover w-full max-w-lg rounded-xl border p-5 shadow-[var(--shadow-floating)]`,children:[(0,Z.jsx)(s1,{className:`text-base font-semibold`,children:`Publishing is unavailable`}),(0,Z.jsx)(G$,{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:$(`bg-primary text-primary-foreground mt-4 inline-flex rounded-md px-3 py-2 text-sm font-medium`,d8),href:i.upsell.cta.href,onClick:e=>{t!==void 0&&(e.preventDefault(),t())},children:i.upsell.cta.label}),(0,Z.jsx)(W$,{className:$(`border-border hover:bg-muted mt-4 ml-2 inline-flex rounded-md border px-3 py-2 text-sm font-medium`,d8),children:`Close`})]})})]})});let A=u?.commits.find(({commit:e})=>e===f),j=u?.files.find(({path:e})=>e===m),M=j?.content??``,N=j===void 0?void 0:g[j.path],P=N?.baseContent===M?N.content:M,F=u?.files.some(e=>{let t=g[e.path],n=e.content??``;return t?.baseContent===n&&t.content!==n})??!1,I=u!==null&&!u.dirty&&u.conflicts.length===0&&!F,L=u?.commits.find(({commit:e})=>e===u.baseCommit),R=I&&u?.baseCommit===u.remoteHead,z=async()=>d(await i.api.inspect()),ee=()=>{u!==null&&R&&v===null&&a()&&(y(`publish`),T(null),i.api.publish({baseRev:u.rev,commit:u.baseCommit}).then(async()=>{await z(),D(`Published the current saved version.`)}).catch(e=>T(H9(e))).finally(()=>{o(),y(null)}))},B=()=>{u!==null&&A!==void 0&&!A.isHead&&I&&v===null&&a()&&(y(`restore`),T(null),s().then(e=>i.api.restore({commit:A.commit,baseRev:e})).then(async e=>{c(e),await z(),p(null),D(`Restored the saved version to the draft. Save a version to keep this restore.`)}).catch(e=>T(H9(e))).finally(()=>{o(),y(null)}))},V=(e,t)=>{u!==null&&v===null&&a()&&(y(`resolve`),T(null),s().then(n=>i.api.resolveConflict({path:e.path,baseRev:n,resolution:t})).then(t=>{d(t),D(`Resolved ${e.path}.`)}).catch(e=>T(H9(e))).finally(()=>{o(),y(null)}))},te=(e,t)=>{u!==null&&v===null&&(y(`file`),T(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}),D(`Updated ${e.path}.`)}).catch(e=>T(H9(e))).finally(()=>y(null)))},H=(e,t,n)=>{u!==null&&v===null&&(y(`file`),T(null),D(null),C(null),i.api.putAsset({path:e,baseRev:u.rev,bytes:t,replace:n}).then(t=>{d(t),h(e),D(`${n?`Replaced`:`Added`} ${e}. Save a version to keep this change.`)}).catch(n=>{Vne(n)?C({path:e,bytes:t}):T(H9(n))}).finally(()=>y(null)))},ne=e=>{let t=b.current;t!==null&&(x.current=e===null?null:{replacePath:e},t.accept=e===null?V9:Bne(e),t.value=``,t.click())},re=e=>{let t=x.current;if(x.current=null,e===void 0||u===null)return;if(e.size>Rne){D(null),T(`${e.name} is larger than 1 MB. Choose a smaller file.`);return}let n=r?.origin.kind===`tsx`?r.origin.file:void 0,i=t?.replacePath??zne(n,e.name);e.arrayBuffer().then(e=>{let n=new Uint8Array(e);if(t===null&&u.files.some(e=>e.path===i)){T(null),D(null),C({path:i,bytes:n});return}H(i,n,t!==null)}).catch(e=>T(H9(e)))};return(0,Z.jsx)(x2,{open:!0,onOpenChange:t=>!t&&e(),swipeDirection:`right`,children:(0,Z.jsxs)(v2,{container:n,children:[(0,Z.jsx)(J0,{className:`fixed inset-0 z-[110] bg-[var(--editor-backdrop,rgb(0_0_0/0.28))]`}),(0,Z.jsx)(o4,{className:`pointer-events-none fixed inset-0 z-[111] flex justify-end`,children:(0,Z.jsxs)(_2,{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)(U2,{className:`text-base font-semibold`,children:`Publish and saved versions`}),(0,Z.jsx)(Z0,{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)(Y0,{"data-testid":`lifecycle-sheet.close`,className:$(`hover:bg-muted rounded-md px-2 py-1 text-sm`,d8),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…`}),w!==null&&(0,Z.jsx)(`p`,{className:`text-status-error text-sm`,role:`alert`,children:w}),E!==null&&(0,Z.jsx)(`p`,{className:`text-status-success text-sm`,role:`status`,"data-testid":`lifecycle-sheet.notice`,children:E}),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:L?.message??`Current saved version`})]}),(0,Z.jsx)(`button`,{type:`button`,onClick:ee,disabled:!R||v!==null,"data-testid":`lifecycle-sheet.confirm-publish`,className:$(`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-ring/50 outline-none focus-visible:ring-3`),children:v===`publish`?`Publishing…`:`Publish saved version`})]}),!I&&(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.`}),I&&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.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Project files`}),(0,Z.jsx)(`button`,{type:`button`,disabled:v!==null,"data-testid":`lifecycle-sheet.add-file`,onClick:()=>ne(null),className:$(`border-border hover:bg-muted rounded-md border px-3 py-1.5 text-xs disabled:opacity-50`,`focus-visible:border-ring focus-visible:ring-ring/50 outline-none focus-visible:ring-3`),children:`Add file`}),(0,Z.jsx)(`input`,{ref:b,type:`file`,accept:V9,hidden:!0,"data-testid":`lifecycle-sheet.add-file-input`,onChange:e=>re(e.target.files?.[0])})]}),(0,Z.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Add PNG, JPEG, GIF, or WebP images and WOFF2 fonts up to 1 MB.`}),S!==null&&(0,Z.jsxs)(`div`,{className:`border-status-warning/45 space-y-3 rounded-lg border p-3`,"data-testid":`lifecycle-sheet.replace-prompt`,children:[(0,Z.jsxs)(`p`,{className:`text-xs`,children:[(0,Z.jsx)(`span`,{className:`font-mono`,children:S.path}),` already exists. Replace it with the file you chose?`]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(`button`,{type:`button`,disabled:v!==null,"data-testid":`lifecycle-sheet.confirm-replace`,onClick:()=>H(S.path,S.bytes,!0),className:$(`bg-primary text-primary-foreground rounded-md px-3 py-2 text-xs font-medium disabled:opacity-50`,`focus-visible:border-ring focus-visible:ring-ring/50 outline-none focus-visible:ring-3`),children:`Replace file`}),(0,Z.jsx)(`button`,{type:`button`,disabled:v!==null,onClick:()=>C(null),className:$(`border-border hover:bg-muted rounded-md border px-3 py-2 text-xs`,`focus-visible:border-ring focus-visible:ring-ring/50 outline-none focus-visible:ring-3`),children:`Cancel`})]})]}),(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:$(`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-ring/50 outline-none focus-visible:ring-3`,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))}),j!==void 0&&(0,Z.jsx)(Une,{file:j,content:P,busy:v!==null,onChange:e=>_(t=>{if(e===M){let{[j.path]:e,...n}=t;return n}return{...t,[j.path]:{baseContent:M,content:e}}}),onApply:e=>te(j,e),onReplace:()=>ne(j.path)},`${j.path}:${j.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)(Wne,{conflict:e,busy:v!==null,onResolve:t=>V(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:$(`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-ring/50 outline-none focus-visible:ring-3`),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:Hne(e)})]},e.commit))})]}),A!==void 0&&!A.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 “`,A.message,`” into the current draft. Save a version when you want to keep the restored draft.`]})]}),(0,Z.jsx)(`button`,{type:`button`,onClick:B,disabled:!I||v!==null,"data-testid":`lifecycle-sheet.restore`,className:$(`border-border hover:bg-muted rounded-md border px-3 py-2 text-sm`,`focus-visible:border-ring focus-visible:ring-ring/50 outline-none focus-visible:ring-3`),children:v===`restore`?`Restoring…`:`Restore this version`})]})]})]})]})})]})})}function qne({container:e,children:t}){return(0,Z.jsx)(A8,{value:e,children:t})}var Jne={desktop:600,mobile:375},Yne=`▤`,Xne=`Copy code`;function Zne({open:e,onClose:t}){return e?(0,Z.jsx)(Qne,{onClose:t}):null}function Qne({onClose:e}){let t=j8(),{doc:n,render:r,checks:i,previewDevice:a}=Q(fX(e=>({doc:e.doc,render:e.render,checks:e.checks,previewDevice:e.previewDevice}))),[o,s]=(0,G.useState)(`preview`),[c,l]=(0,G.useState)(a),[u,d]=(0,G.useState)(`light`),[f,p]=(0,G.useState)(n?.channel);n?.channel!==f&&(p(n?.channel),s(`preview`));let[m,h]=(0,G.useState)(a);if(a!==m&&(h(a),s(`preview`),l(a),d(`light`)),n===null)return null;let g=n.metadata.fromDefault,_=(e,t)=>({value:e,label:t,testId:`preview-overlay.view.${e}`}),v=n.channel===`email`?[_(`preview`,`Preview`),_(`html`,`HTML`),_(`text`,`Text`),_(`source`,`TSX`)]:n.channel===`sms`?[_(`preview`,`Preview`),_(`text`,`Text`),_(`source`,`TSX`)]:[_(`preview`,`Preview`),_(`payload`,`Payload`),_(`source`,`TSX`)],y=o===`source`?n.origin.authoredSource:o===`html`&&r!==null?r.html:o===`text`&&r!==null?r.text:o===`text`&&n.channel===`sms`&&n.render!==null?n.render.text:o===`payload`&&n.channel===`whatsapp`&&n.render!==null?JSON.stringify(n.render,null,2):``;return(0,Z.jsx)(a1,{open:!0,onOpenChange:t=>!t&&e(),children:(0,Z.jsx)(Q$,{container:t,children:(0,Z.jsxs)(Z$,{className:`samva-editor-shell fixed inset-0 z-[100] flex flex-col bg-[var(--editor-canvas-bg)] outline-none`,children:[(0,Z.jsx)(s1,{className:`sr-only`,children:`Template preview`}),(0,Z.jsx)(G$,{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)(r7,{ariaLabel:`Preview format`,testId:`preview-overlay.format-group`,value:o,onChange:e=>s(e),options:v}),(0,Z.jsx)(`span`,{className:`hidden flex-1 sm:block`}),n.channel===`email`&&o===`preview`&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(r7,{ariaLabel:`Preview width`,testId:`preview-overlay.width-group`,value:c,onChange:e=>l(e),options:[{value:`desktop`,label:`Desktop`,testId:`preview-overlay.device.desktop`},{value:`mobile`,label:`Mobile`,testId:`preview-overlay.device.mobile`}]}),(0,Z.jsx)(r7,{ariaLabel:`Preview color scheme`,testId:`preview-overlay.color-scheme-group`,value:u,onChange:e=>d(e),options:[{value:`light`,label:`Light`,testId:`preview-overlay.scheme.light`},{value:`dark`,label:`Dark`,testId:`preview-overlay.scheme.dark`}]}),(0,Z.jsx)(y7,{checks:i})]}),(0,Z.jsx)(W$,{"data-testid":`preview-overlay.close`,"aria-label":`Close preview`,title:`Close (Esc)`,className:`text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:ring-ring/50 ml-auto inline-flex size-[30px] items-center justify-center rounded-[7px] outline-none focus-visible:ring-[3px]`,children:(0,Z.jsx)(L6,{className:`size-[15px]`})})]}),o===`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:$(`mx-auto mb-3.5 max-w-full truncate text-[12.5px] text-muted-foreground transition-[width] duration-180`,c===`mobile`?`w-[375px]`:`w-[600px]`),children:[g!==void 0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`b`,{className:`text-foreground font-semibold`,children:g.name??g.email}),g.name===void 0?null:(0,Z.jsxs)(Z.Fragment,{children:[` <`,g.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:$(`mx-auto h-[calc(100%-2rem)] max-w-full transition-[width] duration-180 ease-out`,c===`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)(j5,{html:r.html,width:Jne[c],forceColorScheme:u})})]}):(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:n.channel===`sms`&&n.render!==null?(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:n.render.text}),(0,Z.jsx)(U8,{text:n.render.text,className:`mt-4 text-center text-xs`})]}):n.channel===`whatsapp`&&n.render!==null?(0,Z.jsxs)(`div`,{className:`bg-surface-inset rounded-xl p-3.5`,children:[n.render.header!==void 0&&n.render.header.text!==``&&(0,Z.jsx)(`p`,{className:`mb-1 font-semibold`,children:n.render.header.text}),(0,Z.jsx)(`p`,{className:`whitespace-pre-wrap`,children:n.render.body}),n.render.footer!==void 0&&n.render.footer!==``&&(0,Z.jsx)(`p`,{className:`text-muted-foreground mt-2 text-xs`,children:n.render.footer}),n.render.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`?Xne:e.type===`flow`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{"aria-hidden":`true`,children:[Yne,` `]}),e.text]}):e.text},`${e.type}-${t}`))]}):(0,Z.jsx)(`pre`,{className:`text-status-error whitespace-pre-wrap`,children:`The current draft did not build, so there is nothing to 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:y})})]})})})}function $ne({saveVersionStatus:e,saveVersionState:t,onSaveVersion:n,saveVersionBusy:r,saveVersionBlocked:i,guestHeadline:a,part:o}){let{doc:s,checks:c,sizeKb:l,layoutMode:u,assistantWidth:d,chatCollapsed:f}=Q(fX(e=>({doc:e.doc,checks:e.checks,sizeKb:e.sizeKb,layoutMode:e.layoutMode,assistantWidth:e.assistantWidth,chatCollapsed:e.chatCollapsed}))),p=C8(`rail.assistant`)!==void 0,{selectDocument:m,openWorkTab:h,setFocusedPane:g}=Q(e=>e.actions),_=Q(e=>e.sourceEditable),v=Q(e=>e.pendingAuthoredSource),y=Q(fX(e=>({storageError:e.storageError,conflict:e.conflict}))),[b,x]=(0,G.useState)(!1),S=C3(c),C=S.text,w=u===`narrow`,T=p&&u===`wide`&&!f,E=p&&(s===null||s.channel===`email`),D=t===`error`||y.storageError!==null||y.conflict?`Couldn't save version`:v!==null||r===!0?`Saving…`:void 0,O=(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{"data-slot":`editor-status-bar-dot`,"data-tone":S.tone,className:$(`size-1.5 shrink-0 rounded-full`,S.tone===`error`?`bg-status-error`:S.tone===`warning`?`bg-status-warning`:`bg-muted-foreground`)}),a===void 0&&!w?(0,Z.jsx)(`span`,{"data-testid":`statusbar.checks-summary`,children:S.parts.length===0?S.text:S.parts.map((e,t)=>(0,Z.jsxs)(`span`,{children:[t>0&&` · `,(0,Z.jsx)(`span`,{className:$(e.severity===`error`&&`text-status-error`),children:e.text})]},e.severity))}):null]});return u8(`editor-status-bar`,{...o},{state:{layout:u,save:t??`unavailable`},tag:`footer`,className:`border-border bg-background text-muted-foreground z-30 flex h-8 shrink-0 items-stretch border-t text-xs whitespace-nowrap`,props:{children:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{"data-slot":`editor-status-bar-start`,style:T?{minWidth:d}:void 0,className:$(`flex shrink-0 items-center gap-3 px-2`,T&&`pr-3`),children:[E?(0,Z.jsx)(s5,{variant:`ghost`,size:`xs`,"data-testid":`statusbar.checks-trigger`,"data-editor-control":``,"aria-label":w?C:void 0,onClick:()=>{h(`checks`),g(`preview`)},className:`text-muted-foreground font-normal`,children:O}):(0,Z.jsxs)(x9,{open:b,onOpenChange:x,children:[(0,Z.jsx)(S9,{render:(0,Z.jsx)(s5,{variant:`ghost`,size:`xs`,"data-testid":`statusbar.checks-trigger`,"data-editor-control":``,"aria-label":w?C:void 0,onClick:()=>m(),className:`text-muted-foreground font-normal`}),children:O}),(0,Z.jsx)(C9,{side:`top`,align:`start`,sideOffset:8,"data-testid":`statusbar.checks-popup`,className:`max-h-[min(560px,70vh)] w-[360px] overflow-y-auto p-3.5`,children:(0,Z.jsx)(v7,{checks:c,editable:_})})]}),a===void 0?!w&&(0,Z.jsx)(ere,{loading:s===null}):(0,Z.jsx)(`span`,{"data-testid":`statusbar.guest`,className:`min-w-0 truncate`,children:D??a})]}),!T&&(0,Z.jsx)(W5,{orientation:`vertical`,className:`my-2.5`}),(0,Z.jsxs)(`div`,{"data-slot":`editor-status-bar-end`,className:`flex min-w-0 flex-1 items-center gap-1 px-2`,children:[a===void 0?(0,Z.jsx)(`span`,{"aria-live":`polite`,"data-testid":`statusbar.save-version`,"data-save-version-state":t??`unavailable`,className:`px-1`,children:e}):(0,Z.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"data-testid":`statusbar.save-version`,"data-save-version-state":t??`unavailable`,children:D??e??a}),n!==void 0&&(0,Z.jsx)(s5,{variant:`ghost`,size:`xs`,onClick:n,disabled:r===!0||i===!0,"data-testid":`topbar.save-version`,"data-editor-control":``,"aria-label":`Save the current draft as a version`,title:`Save this draft as a version (⌘/Ctrl+S)`,className:`text-foreground`,children:r===!0?`Saving…`:e===`Couldn’t save version`?`Retry`:`Save version`}),(0,Z.jsx)(`span`,{className:`flex-1`}),!w&&s!==null&&s.channel!==`email`&&(0,Z.jsxs)(`span`,{className:`px-1`,children:[l,` KB · `,s.channel.toUpperCase()]})]})]})}})}function ere({loading:e}){let{savedAt:t,saving:n,failed:r}=Q(fX(e=>({savedAt:e.draftSavedAt,saving:e.pendingAuthoredSource!==null,failed:e.storageError!==null||e.conflict}))),i=tre(t!==null);if(e)return(0,Z.jsx)(`span`,{children:`Loading…`});let a=`Draft`;return r?a=`Draft · couldn’t save`:n?a=`Draft · saving…`:t!==null&&(a=`Draft · saved ${w3(i,t)}`),(0,Z.jsx)(`span`,{"data-testid":`statusbar.draft`,"aria-live":`polite`,className:`shrink-0`,children:a})}function tre(e){let[t,n]=(0,G.useState)(()=>Date.now());return(0,G.useEffect)(()=>{if(!e)return;let t=setInterval(()=>n(Date.now()),3e4);return()=>clearInterval(t)},[e]),t}var nre=e=>e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey;function U9({brand:e}){if(e?.color===void 0)return(0,Z.jsx)(k6,{className:`size-3.5 shrink-0`});let t={backgroundColor:e.color};return(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`editor-brand-swatch`,style:t,className:`ring-foreground/15 size-3 shrink-0 rounded-full ring-1`})}function rre({source:e,onUseBrand:t}){let n=Q(e=>e.doc?.rev??null),r=Q(e=>e.editable&&e.lifecycleCapability?.status===`ready`),i=(0,G.useRef)(e.readTheme);(0,G.useEffect)(()=>{i.current=e.readTheme});let[a,o]=(0,G.useState)(void 0),[s,c]=(0,G.useState)({state:`idle`,name:``});(0,G.useEffect)(()=>{if(n===null)return;let e=!1;return i.current().then(t=>{e||o(H7(t.theme??``))},()=>void 0),()=>{e=!0}},[n]);let l=vte(a,e.brands);if(l.kind===`pending`)return(0,Z.jsxs)(`div`,{className:`flex min-w-0 shrink items-center gap-1`,children:[(0,Z.jsxs)(`span`,{"data-testid":`topbar.brand-pending`,"aria-busy":`true`,className:_8,children:[(0,Z.jsx)(k6,{className:`size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate`,children:`Brand`})]}),e.status]});let u=l.kind===`brand`?l.brand:null,d=l.kind===`none`?l.defaultBrand:null,f=d===null?l.brands:l.brands.filter(({slug:e})=>e!==d.slug),p=r&&t!==void 0?e=>{c({state:`busy`,name:e.name}),t(e).then(()=>c({state:`idle`,name:e.name}),()=>c({state:`error`,name:e.name}))}:void 0,m=e.manageLink?.(),h=f.length>0||d!==null||m!==void 0,g=`No brand`,_=`topbar.brand-none`,v;l.kind===`brand`?(g=l.brand.name,_=`topbar.brand`,v=`Brand: ${l.brand.name}`):l.kind===`missing`&&(g=`Brand not found`,_=`topbar.brand-missing`,v=l.slug===null?`This organization has no default brand.`:`This organization has no brand “${l.slug}”.`);let y=s.state===`busy`,b=(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(U9,{brand:u}),(0,Z.jsx)(`span`,{className:`truncate`,children:g})]}),x=l.kind===`missing`?`text-status-warning`:void 0;return(0,Z.jsxs)(`div`,{className:`flex min-w-0 shrink items-center gap-1`,children:[h?(0,Z.jsxs)(u9,{children:[(0,Z.jsxs)(d9,{"data-testid":_,"data-editor-control":``,"aria-label":v??g,title:v,"aria-busy":y||void 0,className:$(v8,x),children:[b,(0,Z.jsx)(m6,{className:`size-3 shrink-0`})]}),(0,Z.jsxs)(f9,{align:`start`,className:`w-56`,"data-testid":`topbar.brand-menu`,children:[d!==null&&(0,Z.jsxs)(h9,{"data-testid":`topbar.brand-use`,disabled:p===void 0||y,title:`Theme this template with ${d.name}`,onClick:()=>p?.(d),children:[(0,Z.jsx)(U9,{brand:d}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[`Use `,d.name]})]}),f.map(e=>{let t=u?.slug===e.slug;return(0,Z.jsxs)(h9,{"data-testid":`topbar.brand-option.${e.slug}`,"aria-current":t||void 0,disabled:p===void 0||y,onClick:()=>{t||p?.(e)},children:[(0,Z.jsx)(U9,{brand:e}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),t&&(0,Z.jsx)(R6,{className:`text-muted-foreground size-3.5`})]},e.slug)}),m!==void 0&&(0,Z.jsxs)(Z.Fragment,{children:[(f.length>0||d!==null)&&(0,Z.jsx)(_9,{}),(0,Z.jsx)(h9,{"data-testid":`topbar.brand-manage`,render:(0,Z.jsx)(`a`,{href:m.href}),onClick:e=>{m.navigate!==void 0&&nre(e)&&(e.preventDefault(),m.navigate())},children:`Manage brands`})]})]})]}):(0,Z.jsx)(`span`,{"data-testid":_,title:v,className:$(_8,x),children:b}),s.state===`error`&&(0,Z.jsxs)(`span`,{role:`alert`,className:`text-status-error truncate text-xs`,children:[`Couldn’t use `,s.name]}),e.status]})}var W9=[`assistant`,`preview`];function ire({compact:e=!1,...t}){let{focusedPane:n,previewUnseen:r}=Q(fX(e=>({focusedPane:e.focusedPane,previewUnseen:e.previewUnseen}))),i=Q(e=>e.actions.setFocusedPane),{idBase:a}=I9(),o=r&&n!==`preview`;return u8(`editor-pane-switch`,{...t},{state:{pane:n,unseen:o},className:`flex min-w-0`,props:{children:(0,Z.jsx)(Y5,{role:`tablist`,"aria-label":`Editor pane`,value:[n],spacing:0,onValueChange:e=>{let t=W9.find(t=>t===e[0]);t!==void 0&&i(t)},className:$(p8,`grid h-8 w-full grid-cols-2`,e&&`w-auto`),children:W9.map(t=>(0,Z.jsxs)(X5,{value:t,id:`${a}-tab-${t}`,role:`tab`,"aria-selected":n===t,"aria-controls":`${a}-pane-${t}`,"aria-pressed":void 0,"aria-label":e?t===`assistant`?`Chat`:`Preview`:void 0,"data-pressed":n===t?``:void 0,"data-testid":`agent-workspace.tab.${t}`,"data-editor-control":``,className:$(m8,e?`px-2.5`:`gap-1.5 px-3 text-[13px]`,`aria-selected:bg-background aria-selected:text-foreground aria-selected:shadow-sm dark:aria-selected:border-input dark:aria-selected:bg-input/30`),children:[t===`assistant`?(0,Z.jsx)(Y6,{className:`size-3.5`}):(0,Z.jsx)(x6,{className:`size-3.5`}),e?null:t===`assistant`?`Chat`:`Preview`,t===`preview`&&o&&(0,Z.jsx)(`span`,{"data-testid":`agent-workspace.preview-updated`,className:`bg-primary size-1.5 rounded-full`,children:(0,Z.jsx)(`span`,{className:`sr-only`,children:`, updated`})})]},t))})}})}function are({leading:e,extraActions:t,onBack:n,onUndo:r,onRedo:i,canUndo:a=!1,canRedo:o=!1,onPreview:s,onLifecycle:c,channelSwitcher:l,exportEnabled:u,onExport:d,renameEnabled:f=!0,brand:p,onUseBrand:m,part:h}){let{doc:g,render:_,pendingAuthoredSource:v,lifecycleCapability:y,editable:b,readonlyReason:x,renameActive:S,metadataError:C,layoutMode:w}=Q(fX(e=>({doc:e.doc,render:e.render,pendingAuthoredSource:e.pendingAuthoredSource,lifecycleCapability:e.lifecycleCapability,editable:e.editable,readonlyReason:e.readonlyReason,renameActive:e.renameActive,metadataError:e.metadataError,layoutMode:e.layoutMode}))),{rename:T,setRenameActive:E}=Q(e=>e.actions),D=(0,G.useRef)(null),O=g?.name??`Untitled template`;(0,G.useEffect)(()=>{if(S&&D.current){D.current.focus();let e=document.createRange();e.selectNodeContents(D.current);let t=window.getSelection();t?.removeAllRanges(),t?.addRange(e)}},[S]);let k=u===!0&&g?.channel===`email`&&_!==null&&v===null,A=w===`compact`||w===`narrow`,j=w===`standard`,M=g!==null&&g.channel!==`email`,N=!M,P=()=>{k&&g!==null&&_!==null&&(B9(_.html,g.name),d?.())},F=C8(`rail.assistant`)!==void 0,I=w===`narrow`,L=A,R=b&&y!==void 0?(0,Z.jsx)(n7,{label:y.status===`locked`?y.upsell.reason:`Publish and view history`,children:(0,Z.jsx)(s5,{size:`sm`,onClick:c,"data-testid":`topbar.publish`,"data-editor-control":``,children:`Publish`})}):null;return u8(`editor-top-bar`,{...h},{state:{layout:w},tag:`header`,className:`border-border bg-background z-30 flex h-12 min-w-0 shrink-0 items-center gap-2 border-b px-3`,props:{children:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{"data-slot":`editor-top-bar-title`,className:`flex min-w-0 flex-1 items-center gap-1.5`,children:[e!==void 0&&(0,Z.jsx)(`div`,{className:`shrink-0`,children:e}),n!==void 0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(n7,{label:`Back to templates`,children:(0,Z.jsxs)(s5,{variant:`ghost`,size:I?`icon-sm`:`sm`,onClick:n,"aria-label":`Back to templates`,"data-testid":`topbar.back`,"data-editor-control":``,className:`text-muted-foreground`,children:[(0,Z.jsx)(h6,{}),I?null:`Templates`]})}),(0,Z.jsx)(W5,{orientation:`vertical`,className:`mx-0.5 h-4!`})]}),(0,Z.jsx)(`span`,{ref:D,"data-testid":`topbar.name`,"data-slot":`editor-top-bar-name`,contentEditable:b&&f,suppressContentEditableWarning:!0,spellCheck:!1,title:b&&f?`Click to rename`:x??`This template name is fixed.`,className:$(`min-w-0 truncate rounded-md px-1.5 py-1 text-sm font-medium whitespace-nowrap outline-none`,I?`max-w-full`:`max-w-72 min-w-24`,`hover:bg-muted focus-visible:ring-ring/50 focus-visible:bg-background focus-visible:ring-3`),onFocus:()=>{b&&f&&E(!0)},onBlur:e=>{b&&f&&(E(!1),T(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}),C!==null&&(0,Z.jsx)(`span`,{role:`alert`,className:`text-destructive truncate text-xs`,children:C}),I?null:l===void 0?(0,Z.jsx)(`span`,{"data-slot":`editor-top-bar-channel`,className:$(_8,`capitalize`),children:g?.channel??`email`}):(0,Z.jsx)(`div`,{className:$(`min-w-0 shrink-0`,A&&`[&_[data-channel-button]]:px-1.5 [&_[data-channel-label]]:hidden`),children:l}),!b&&g!==null&&(0,Z.jsx)(H5,{variant:`secondary`,title:x??`This template is read-only.`,"data-testid":`topbar.readonly-badge`,children:`Read-only`}),p!==void 0&&N&&!I&&(0,Z.jsx)(rre,{source:p,onUseBrand:m})]}),F&&w!==`wide`&&N&&(0,Z.jsx)(ire,{compact:I,className:I?`shrink-0`:`w-56 shrink-0`}),(0,Z.jsxs)(`div`,{"data-slot":`editor-top-bar-actions`,className:$(`flex shrink-0 items-center justify-end gap-1`,!L&&`flex-1`),children:[!L&&r!==void 0&&(0,Z.jsx)(s5,{variant:`ghost`,size:`sm`,"data-testid":`topbar.undo`,"data-editor-control":``,onClick:r,disabled:!a,children:`Undo`}),!L&&i!==void 0&&(0,Z.jsx)(s5,{variant:`ghost`,size:`sm`,"data-testid":`topbar.redo`,"data-editor-control":``,onClick:i,disabled:!o,children:`Redo`}),!L&&M&&(0,Z.jsx)(D9,{testId:`topbar.fixture`}),!L&&(0,Z.jsx)(W5,{orientation:`vertical`,className:`mx-1 h-4!`}),!I&&(0,Z.jsx)(n7,{label:`Preview template`,children:(0,Z.jsxs)(s5,{variant:`ghost`,size:j||L?`icon-sm`:`sm`,"aria-label":`Preview template`,"data-testid":`topbar.preview`,"data-editor-control":``,onClick:s,children:[(0,Z.jsx)(x6,{}),j||L?null:`Preview`]})}),!L&&u===!0&&(0,Z.jsx)(n7,{label:k?`Export rendered HTML`:`Export waits for the latest render`,children:(0,Z.jsxs)(s5,{variant:`ghost`,size:j?`icon-sm`:`sm`,"aria-label":`Export HTML`,"data-testid":`topbar.export`,"data-editor-control":``,onClick:P,disabled:!k,children:[(0,Z.jsx)(y6,{}),j?null:`Export HTML`]})}),!I&&t,L&&M&&(0,Z.jsx)(D9,{testId:`topbar.fixture`}),L&&(0,Z.jsxs)(u9,{children:[(0,Z.jsx)(d9,{render:(0,Z.jsx)(s5,{variant:`ghost`,size:`icon-sm`,"aria-label":`More actions`,"data-testid":`topbar.more`,"data-editor-control":``}),children:(0,Z.jsx)(W6,{})}),(0,Z.jsxs)(f9,{align:`end`,className:`w-48`,children:[r!==void 0&&(0,Z.jsx)(h9,{"data-testid":`topbar.undo`,"data-editor-control":``,disabled:!a,onClick:r,children:`Undo`}),i!==void 0&&(0,Z.jsx)(h9,{"data-testid":`topbar.redo`,"data-editor-control":``,disabled:!o,onClick:i,children:`Redo`}),I&&(0,Z.jsx)(_9,{}),I&&(0,Z.jsxs)(h9,{"data-testid":`topbar.preview`,onClick:s,children:[(0,Z.jsx)(x6,{}),`Preview template`]}),u===!0&&(0,Z.jsxs)(h9,{"data-testid":`topbar.export`,"data-editor-control":``,disabled:!k,onClick:P,children:[(0,Z.jsx)(y6,{}),`Export HTML`]})]})]}),I&&t,R]})]})}})}var ore=[],sre=e=>e>=1280?`wide`:e>=980?`standard`:e>=720?`compact`:`narrow`;function cre(){let e=Q(e=>e.conflict),{reload:t}=Q(e=>e.actions);return!Q(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 lre(){let e=Q(e=>e.storageError),t=Q(e=>e.conflict),{retrySave:n}=Q(e=>e.actions);return!Q(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 ure(){let e=Q(e=>e.doc);return e===null||e.channel===`email`?(0,Z.jsx)(Pne,{}):e.channel===`sms`?(0,Z.jsx)(J8,{}):(0,Z.jsx)(a5,{})}var dre=/\.[cm]?[jt]sx?$/;function fre({height:e=`100dvh`,contributions:t=ore,brand:n,onBack:r,exportable:i,renameEnabled:a,onLockedLifecycle:o,previewBusy:s=!1,onOpenPreview:c,children:l,...u}){let d=Q(e=>e.leftCollapsed),f=Q(e=>e.rightCollapsed),p=Q(e=>e.layoutMode),m=Q(e=>e.doc?.rev??null),h=Q(e=>e.undoHistory.length+(e.designDraft?.edits.length??0)),g=Q(e=>e.redoHistory.length+(e.designDraft?.undone.length??0)),_=Q(e=>e.sourceEditable),v=Q(e=>e.doc),y=Q(e=>e.render),b=Q(e=>e.pendingAuthoredSource),x=Q(e=>e.lifecycleBusy),S=Q(e=>e.conflict),C=Q(e=>e.storageError),w=(0,G.useMemo)(()=>b8(t),[t]),T=w.one(`frame.start`),E=w.one(`statusbar.headline`),D=w.one(`rail.assistant`)!==void 0,{flushSaves:O,beginLifecycle:k,endLifecycle:A,adoptLifecycleSnapshot:j,toggleLeft:M,toggleRight:N,setLayoutMode:P,undo:F,redo:I,openWorkTab:L,setFocusedPane:R,setHostBusy:z}=Q(e=>e.actions);(0,G.useEffect)(()=>z(s),[s,z]);let ee=Q(e=>e.versionsCapability),B=Q(e=>e.telemetry),V=ee?.status===`ready`?ee.api:void 0,te=(0,G.useMemo)(()=>V===void 0?void 0:e=>V.save(e),[V]),H=(0,G.useMemo)(()=>V===void 0?void 0:()=>V.savedRevision(),[V]),ne=()=>B?.({name:`preview`}),re=()=>B?.({name:`export`}),[ie,ae]=(0,G.useState)(!1),[oe,se]=(0,G.useState)(!1),[U,ce]=(0,G.useState)(`idle`),[le,ue]=(0,G.useState)(null),[de,W]=(0,G.useState)(null),fe=N4(),pe=(0,G.useId)();(0,G.useEffect)(()=>{if(H===void 0||m===null)return;let e=!0;return H().then(t=>{e&&W(t===m?t:null)}).catch(()=>{e&&W(null)}),()=>{e=!1}},[m,H]);let me=(0,G.useRef)(null),he=(0,G.useRef)(()=>{}),ge=(0,G.useRef)(null),_e=(0,G.useRef)(null),ve=i===!0&&v?.channel===`email`&&y!==null&&b===null,ye=()=>{ve&&v!==null&&y!==null&&(B9(y.html,v.name),re?.())},be=()=>{if(te===void 0)return Promise.resolve();if(X3(fe.getState())>0)return fe.getState().actions.applyDesign(),Promise.resolve();if(me.current!==null)return me.current;if(!k())return Promise.resolve();let e=()=>{},t=new Promise(t=>{e=t});return me.current=t,ce(`saving`),fe.getState().actions.flushSaves().then(async e=>{let t=fe.getState().doc,n=await te(e),r=fe.getState().doc;t!==null&&(r?.rev===e||r?.rev===n)&&r.origin.authoredSource===t.origin.authoredSource&&fe.getState().actions.adoptLifecycleSnapshot({rev:n,authoredSource:t.origin.authoredSource}),ue(n),ce(`idle`)}).catch(()=>ce(`error`)).finally(()=>{A(),me.current===t&&(me.current=null),e()}),t};(0,G.useEffect)(()=>{he.current=be});let xe=n===void 0||te===void 0?void 0:async e=>{let t=fe.getState().lifecycleCapability;if(t?.status!==`ready`)return;let r=await fe.getState().actions.flushSaves(),i=await n.readTheme(),a=await t.api.inspect(),o=W7(i,e);o!==i.theme&&(r=(await t.api.updateFile({path:k7,baseRev:r,content:o})).rev);for(let n of a.files){if(n.binary===!0||n.content===null||!dre.test(n.path))continue;let i=_te(n.content,e);i!==n.content&&(r=(await t.api.updateFile({path:n.path,baseRev:r,content:i})).rev)}await be()},Se=`idle`;U===`saving`?Se=`saving`:U===`error`?Se=`error`:m!==null&&(le===m||de===m)&&b===null&&!S&&C===null&&(Se=`saved`);let Ce;te!==void 0&&(Ce=`Unsaved changes`,Se===`saving`?Ce=`Saving version…`:Se===`saved`?Ce=`Saved version`:Se===`error`&&(Ce=`Couldn’t save version`));let we={flushSaves:O,beginLifecycle:k,endLifecycle:A,adoptLifecycleSnapshot:j,undo:F,redo:I,canUndo:_&&h>0,canRedo:_&&g>0,preview:()=>{ae(!0),ne?.()},exportHtml:ye,canExport:ve},Te=(0,G.useMemo)(()=>({hostBusy:s,openInNewTab:c,showChecks:D?()=>{L(`checks`),R(`preview`)}:void 0}),[D,c,L,s,R]),Ee=w.all(`toolbar.leading`).map(e=>(0,Z.jsx)(G.Fragment,{children:e.render()},e.id)),De=w.all(`toolbar.actions`).map(e=>(0,Z.jsx)(G.Fragment,{children:e.render(we)},e.id)),Oe=w.one(`document.switcher`)?.render(we);(0,G.useEffect)(()=>{if(te===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(),he.current())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[te]),(0,G.useLayoutEffect)(()=>{let e=ge.current;if(e===null||typeof ResizeObserver>`u`)return;let t,n=e=>{let n=sre(e);n!==t&&(t=n,P(n))};n(e.getBoundingClientRect().width);let r=new ResizeObserver(([e])=>{e!==void 0&&n(e.contentRect.width)});return r.observe(e),()=>r.disconnect()},[P]);let ke=(p===`compact`||p===`narrow`)&&(!d||!f);(0,G.useEffect)(()=>{if(!ke)return;let e=e=>{e.key===`Escape`&&(d||M(),f||N())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[d,ke,f,M,N]);let Ae={leading:Ee.length===0?void 0:Ee,extraActions:De.length===0?void 0:De,onBack:T===void 0?r:void 0,onPreview:()=>{ae(!0),ne?.()},onLifecycle:()=>se(!0),onUndo:F,onRedo:I,canUndo:_&&h>0,canRedo:_&&g>0,channelSwitcher:Oe,exportEnabled:i,renameEnabled:a,onExport:re,brand:n,onUseBrand:xe},je=E===void 0||E.saveVersion,Me={saveVersionStatus:je?Ce:void 0,saveVersionState:te===void 0?void 0:Se,onSaveVersion:je&&te!==void 0?be:void 0,saveVersionBusy:Se===`saving`,saveVersionBlocked:x,guestHeadline:E?.headline},Ne=u8(`editor`,{...u},{state:{layout:p,docked:D,busy:x},className:`samva-editor-shell flex min-w-0 flex-1 flex-col overflow-hidden`,props:{"data-samva-editor-theme":`host`,inert:x,"aria-busy":x,children:l}});return(0,Z.jsx)(S8,{value:w,children:(0,Z.jsx)(E8,{value:{exportHtml:ye,canExport:ve,saveVersionStatus:te===void 0?`unavailable`:Se},children:(0,Z.jsx)($te,{value:Te,children:(0,Z.jsx)(Ane,{value:{topBar:Ae,statusBar:Me,overlayOpen:ke,idBase:pe},children:(0,Z.jsx)(qne,{container:_e,children:(0,Z.jsxs)(`div`,{ref:ge,className:`samva-editor-frame flex`,style:{height:e},children:[T?.render(),Ne,(0,Z.jsx)(Zne,{open:ie,onClose:()=>ae(!1)}),(0,Z.jsx)(Gne,{open:oe,onClose:()=>se(!1),onLockedAction:o}),(0,Z.jsx)(`div`,{ref:_e,"data-samva-editor-portal-root":!0,className:`samva-editor-shell`})]})})})})})})}function pre(e){let t=Q(e=>e.layoutMode),n=Q(e=>e.leftCollapsed),r=Q(e=>e.rightCollapsed),i=C8(`rail.assistant`)!==void 0,{toggleLeft:a,toggleRight:o}=Q(e=>e.actions),{overlayOpen:s}=I9();return u8(`editor-workspace`,{...e},{state:{layout:t},className:`samva-editor-body relative flex min-h-0 min-w-0 flex-1 overflow-hidden`,props:{children:(0,Z.jsxs)(Z.Fragment,{children:[s&&(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:()=>{n||a(),r||o()}}),n&&!i&&(0,Z.jsx)(G9,{label:`Show layers and blocks`,testId:`shell.show-left`,side:`left`,onClick:a}),r&&!i&&(0,Z.jsx)(G9,{label:`Show inspector`,testId:`shell.show-right`,side:`right`,onClick:o}),(0,Z.jsx)(ure,{}),(0,Z.jsx)(cre,{}),(0,Z.jsx)(lre,{})]})}})}function G9({label:e,testId:t,side:n,onClick:r}){let i=n===`left`?j6:N6;return(0,Z.jsx)(n7,{label:e,side:n===`left`?`right`:`left`,children:(0,Z.jsx)(s5,{variant:`outline`,size:`icon-sm`,"aria-label":e,"data-testid":t,onClick:r,className:$(`absolute top-3 z-20 shadow-sm`,n===`left`?`left-3`:`right-3`),children:(0,Z.jsx)(i,{className:`size-4`})})})}function mre(e){let{topBar:t}=I9();return(0,Z.jsx)(are,{...t,part:e})}function hre(e){let{statusBar:t}=I9();return(0,Z.jsx)($ne,{...t,part:e})}function gre(e){return(0,Z.jsxs)(fre,{...e,children:[(0,Z.jsx)(mre,{}),(0,Z.jsx)(pre,{}),(0,Z.jsx)(hre,{})]})}function K9({name:e,className:t}){let n=A4()[e];return(0,Z.jsx)(n,{...t===void 0?{}:{className:t}})}function _re({label:e,icon:t,title:n,upsell:r,onAction:i,testId:a}){let[o,s]=(0,G.useState)(!1),c=j8();return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(n7,{label:r.reason,children:(0,Z.jsxs)(s5,{variant:`ghost`,size:`sm`,"aria-label":e,"data-testid":a,"data-editor-control":``,onClick:()=>s(!0),children:[t,e]})}),(0,Z.jsx)(x2,{open:o,onOpenChange:s,swipeDirection:`right`,children:(0,Z.jsxs)(v2,{container:c,children:[(0,Z.jsx)(J0,{className:`fixed inset-0 z-[110] bg-[var(--editor-backdrop,rgb(0_0_0/0.28))]`}),(0,Z.jsx)(o4,{className:`pointer-events-none fixed inset-0 z-[111] flex justify-end`,children:(0,Z.jsxs)(_2,{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.jsx)(Z0,{className:`sr-only`,children:r.reason}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between px-5 pt-4 pb-3`,children:[(0,Z.jsx)(U2,{className:`text-[15px] font-semibold`,children:n}),(0,Z.jsx)(Y0,{type:`button`,"aria-label":`Close ${e.toLowerCase()} panel`,"data-testid":a===void 0?void 0:`${a}.close`,className:`text-muted-foreground hover:bg-muted hover:text-foreground rounded-md p-1.5`,children:(0,Z.jsx)(L6,{className:`size-[15px]`})})]}),(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:r.reason}),(0,Z.jsx)(`a`,{href:r.cta.href,onClick:e=>{i!==void 0&&(e.preventDefault(),i())},"data-testid":a===void 0?void 0:`${a}.cta`,className:o5(),children:r.cta.label})]})]})})]})})]})}var q9=(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()},J9=e=>e.fixture,Y9=(e,t,n,r)=>({rev:t,origin:n,...r===void 0?{}:{authoredSource:r},...e}),vre=(e,t,n)=>ca(function*(){let r=yield*Fa(),i=new EventSource(q9(`events`,{id:e,client:t}));yield*ha(()=>aa(()=>i.close())),i.addEventListener(`samva:change`,t=>{let i=JSON.parse(t.data);i.id===e&&(n.rev=i.rev,n.fixture=J9(i),i.authoredSource!==void 0&&(n.authoredSource=i.authoredSource),Ia(r,Y9(i,i.rev,i.origin,i.authoredSource)))});let a=()=>fetch(q9(`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||J9(e)!==n.fixture)&&(n.rev=e.rev,n.authoredSource=t,n.fixture=J9(e),Ia(r,Y9(e,e.rev,`external`,t)))}).catch(()=>{}),o=!1,s;i.addEventListener(`open`,()=>{if(!o){o=!0,s?.(oa);return}a()}),i.addEventListener(`error`,()=>{!o&&i.readyState!==EventSource.OPEN&&s?.(new go({reason:`editor event stream failed to open`}))}),yield*sa(e=>{if(i.readyState===EventSource.OPEN)return o=!0,e(oa);s=e});let c=yield*na({try:()=>fetch(q9(`document`,{id:e,client:t})),catch:e=>new go({reason:String(e)})});if(!c.ok)return yield*new go({reason:`open failed (${c.status})`});let l=yield*na({try:()=>c.json(),catch:e=>new go({reason:String(e)})});return n.rev=l.rev,n.authoredSource=l.origin.authoredSource,n.fixture=J9(l),{initial:l,changes:oo(r)}}),yre=(e,t)=>({view:n=>ca(function*(){let r=yield*na({try:()=>fetch(q9(`fixture`,{id:e,client:t}),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({fixture:n})}),catch:e=>new go({reason:String(e)})});if(r.ok)return;let i=`view fixture failed (${r.status})`;return yield*new go({reason:yield*na({try:()=>r.json(),catch:()=>new go({reason:i})}).pipe(fa(e=>e.error??i))})})}),bre=(e,t)=>({save:n=>ca(function*(){if(n.kind!==`authoredSource`)return yield*new go({reason:`Local metadata is declared in source.`});let r=yield*na({try:()=>fetch(q9(`document`,{id:e,client:t}),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(n)}),catch:e=>new go({reason:String(e)})}),i=yield*na({try:()=>r.json(),catch:e=>new go({reason:String(e)})});return r.status===409?yield*new ho({expectedRev:n.baseRev,actualRev:i.actualRev??n.baseRev}):!r.ok||i.rev===void 0?yield*new go({reason:i.error??`Local source save failed.`}):{rev:i.rev}})}),xre=({id:e})=>{let t=crypto.randomUUID();return{contractVersion:po,access:`editable`,sourceAccess:`editable`,metadataAccess:`readonly`,writer:bre(e,t),document:{open:vre(e,t,{rev:``})},fixtures:{status:`ready`,api:yre(e,t)}}},X9=e=>new URL(`api/${e}`,window.location.href).toString(),Z9=async e=>{let t=await fetch(X9(e));if(!t.ok)throw Error(`${e} failed (${t.status})`);return t.json()},Sre=()=>{let[e,t]=(0,G.useState)(()=>typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches);return(0,G.useEffect)(()=>{document.documentElement.classList.toggle(`dark`,e)},[e]),()=>t(e=>!e)};function Q9({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)(K9,{name:`arrowLeft`,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)(K9,{name:`moon`,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)(K9,{name:`sun`,className:`size-[16px]`})})]})}var $9={authenticatedLabel:`Authenticated`,authenticatedTitle:`The host provides authenticated capabilities.`};function Cre({template:e,authenticated:t,editorAffordances:n,onBack:r,onToggleTheme:i}){let a=n.publishingInstructions,o=(0,G.useMemo)(()=>fo(xre({id:e.id})),[e.id]);return(0,Z.jsx)(l6,{host:o,children:(0,Z.jsx)(`div`,{className:`relative h-dvh`,children:(0,Z.jsx)(gre,{contributions:[{slot:`frame.start`,id:`project-rail`,render:()=>(0,Z.jsx)(Q9,{onBack:r,onToggleTheme:i})},...t&&a!==void 0?[{slot:`toolbar.actions`,id:`send`,render:()=>(0,Z.jsx)(_re,{label:`Send`,title:`Send “${e.name}”`,upsell:a,testId:`vite-editor.send`})}]:[]],onBack:r,renameEnabled:!1})})},`${e.id}:${e.channel}`)}var wre={email:{icon:`envelope`,label:`Email`,className:`bg-sel-soft text-accent-email`},sms:{icon:`message`,label:`SMS`,className:`bg-muted text-primary`},whatsapp:{icon:`chatBubble`,label:`WhatsApp`,className:`bg-status-success/10 text-status-success`}};function Tre({catalog:e,authenticated:t,editorAffordances:n,onOpen:r,onToggleTheme:i}){return(0,Z.jsxs)(`div`,{className:`flex h-dvh`,children:[(0,Z.jsx)(Q9,{onToggleTheme:i}),(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. 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?n.authenticatedTitle:`Local editing only.`,children:t?n.authenticatedLabel:`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 n=wre[e.channel];return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>r(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 ${n.className}`,children:(0,Z.jsx)(K9,{name:n.icon,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:n.label}),(0,Z.jsx)(`span`,{className:`block`,children:`Editable source`})]})]})},e.id)})]})]})})]})}function Ere(){let e=Sre(),[t,n]=(0,G.useState)(!1),[r,i]=(0,G.useState)($9),[a,o]=(0,G.useState)(null),[s,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(null);(0,G.useEffect)(()=>{let e=!0,t=()=>Z9(`templates`).then(t=>{e&&(o(t),c(null))});Promise.all([Z9(`capabilities`).then(t=>{e&&(n(!!t.authenticated),i(t.editorAffordances??$9))}),t()]).catch(t=>{e&&c(String(t))});let r=new EventSource(X9(`catalog-events`));return r.addEventListener(`samva:catalog`,()=>{t().catch(t=>{e&&c(String(t))})}),()=>{e=!1,r.close()}},[]);let d=a?.templates.find(e=>e.id===l)??null;return l!==null&&a!==null&&d===null&&u(null),s===null?a===null?(0,Z.jsx)(`div`,{className:`text-muted-foreground grid h-dvh place-items-center text-[13px]`,children:`Loading templates…`}):d===null?(0,Z.jsx)(Tre,{catalog:a,authenticated:t,editorAffordances:r,onOpen:e=>u(e.id),onToggleTheme:e}):(0,Z.jsx)(Cre,{template:d,authenticated:t,editorAffordances:r,onBack:()=>u(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: `,s]})}(0,co.createRoot)(document.getElementById(`root`)).render((0,Z.jsx)(G.StrictMode,{children:(0,Z.jsx)(Ere,{})}));
|