@opencraw/studio 0.0.30 → 0.0.32

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.
Files changed (39) hide show
  1. package/dist/document-view/pdf-view.mapper.d.ts +2 -0
  2. package/dist/index.d.ts +2 -2
  3. package/dist/index.esm.js +447 -31
  4. package/dist/page-snapshot/blocked-page.algorithm.d.ts +10 -0
  5. package/dist/page-snapshot/consent-banner.algorithm.d.ts +23 -0
  6. package/dist/page-snapshot/detect-url.use-case.d.ts +13 -0
  7. package/dist/page-snapshot/index.d.ts +2 -0
  8. package/dist/page-snapshot/inline-assets.mapper.d.ts +29 -0
  9. package/dist/page-snapshot/take-snapshot.use-case.d.ts +2 -0
  10. package/dist/recipe-workspace/import-document.use-case.d.ts +5 -3
  11. package/dist/src/document-view/pdf-view.mapper.d.ts +2 -0
  12. package/dist/src/index.d.ts +2 -2
  13. package/dist/src/page-snapshot/blocked-page.algorithm.d.ts +10 -0
  14. package/dist/src/page-snapshot/consent-banner.algorithm.d.ts +23 -0
  15. package/dist/src/page-snapshot/detect-url.use-case.d.ts +13 -0
  16. package/dist/src/page-snapshot/index.d.ts +2 -0
  17. package/dist/src/page-snapshot/inline-assets.mapper.d.ts +29 -0
  18. package/dist/src/page-snapshot/take-snapshot.use-case.d.ts +2 -0
  19. package/dist/src/recipe-workspace/import-document.use-case.d.ts +5 -3
  20. package/dist/src/studio-api/command.contract.d.ts +11 -0
  21. package/dist/src/studio-api/detect-url-view.contract.d.ts +24 -0
  22. package/dist/src/studio-api/index.d.ts +4 -2
  23. package/dist/src/studio-api/infer-selector-view.contract.d.ts +14 -0
  24. package/dist/src/studio-api/pdf-view.contract.d.ts +3 -0
  25. package/dist/src/studio-api/snapshot-view.contract.d.ts +1 -0
  26. package/dist/src/studio-server/detect-url.handler.d.ts +10 -0
  27. package/dist/studio-api/command.contract.d.ts +11 -0
  28. package/dist/studio-api/detect-url-view.contract.d.ts +24 -0
  29. package/dist/studio-api/index.d.ts +4 -2
  30. package/dist/studio-api/infer-selector-view.contract.d.ts +14 -0
  31. package/dist/studio-api/pdf-view.contract.d.ts +3 -0
  32. package/dist/studio-api/snapshot-view.contract.d.ts +1 -0
  33. package/dist/studio-server/detect-url.handler.d.ts +10 -0
  34. package/dist/ui/assets/index-DQ3QLedY.js +42 -0
  35. package/dist/ui/assets/{pdf-Dt4HqIG1.js → pdf-DJOnIZdZ.js} +1 -1
  36. package/dist/ui/index.html +11 -2
  37. package/dist/ui/opencraw-logo.svg +28 -0
  38. package/package.json +3 -3
  39. package/dist/ui/assets/index-DrJpOP0X.js +0 -38
@@ -0,0 +1,42 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return D(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var te=/\/+/g;function ne(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function re(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 ie(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,ie(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ne(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(te,`$&/`)+`/`),ie(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(te,`$&/`)+`/`)+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+ne(a,u),c+=ie(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+ne(a,u++),c+=ie(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ie(re(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 A(e,t,n){if(e==null)return e;var r=[],i=0;return ie(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ae(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 oe=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 se(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,oe)}catch(e){oe(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ce(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 se(ce.bind(null,e))}var j={map:A,forEach:function(e,t,n){A(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return A(e,function(){t++}),t},toArray:function(e){return A(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=j,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=ce,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ae}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=se,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,ee());else{var t=n(l);t!==null&&te(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&&te(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ee():S=!1}}}var ee;if(typeof y==`function`)ee=function(){y(D)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,k=O.port2;O.port1.onmessage=D,ee=function(){k.postMessage(null)}}else ee=function(){_(D,0)};function te(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,te(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,ee()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),m=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,ee=Symbol.for(`react.element`),O=Symbol.for(`react.transitional.element`),k=Symbol.for(`react.portal`),te=Symbol.for(`react.fragment`),ne=Symbol.for(`react.strict_mode`),re=Symbol.for(`react.profiler`),ie=Symbol.for(`react.consumer`),A=Symbol.for(`react.context`),ae=Symbol.for(`react.forward_ref`),oe=Symbol.for(`react.suspense`),se=Symbol.for(`react.suspense_list`),ce=Symbol.for(`react.memo`),j=Symbol.for(`react.lazy`),le=Symbol.for(`react.activity`),ue=Symbol.for(`react.legacy_hidden`),de=Symbol.for(`react.memo_cache_sentinel`),fe=Symbol.for(`react.view_transition`),pe=Symbol.for(`react.recoverable`),me=Symbol.iterator;function he(e){return typeof e!=`object`||!e?null:(e=me&&e[me]||e[`@@iterator`],typeof e==`function`?e:null)}var ge=Symbol.for(`react.client.reference`);function _e(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ge?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case te:return`Fragment`;case re:return`Profiler`;case ne:return`StrictMode`;case oe:return`Suspense`;case se:return`SuspenseList`;case le:return`Activity`;case fe:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case k:return`Portal`;case A:return e.displayName||`Context`;case ie:return(e._context.displayName||`Context`)+`.Consumer`;case ae:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ce:return t=e.displayName||null,t===null?_e(e.type)||`Memo`:t;case j:t=e._payload,e=e._init;try{return _e(e(t))}catch{}}return null}var ve=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye={pending:!1,data:null,method:null,action:null},be=[],xe=-1;function Se(e){return{current:e}}function Ce(e){0>xe||(e.current=be[xe],be[xe]=null,xe--)}function we(e,t){xe++,be[xe]=e.current,e.current=t}var Te=Se(null),Ee=Se(null),De=Se(null),Oe=Se(null);function ke(e,t){switch(we(De,t),we(Ee,e),we(Te,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Sp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Sp(t),e=Cp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Ce(Te),we(Te,e)}function Ae(){Ce(Te),Ce(Ee),Ce(De)}function je(e){var t=e.memoizedState;t!==null&&(vh._currentValue=t.memoizedState,we(Oe,e)),t=Te.current;var n=Cp(t,e.type);t!==n&&(we(Ee,e),we(Te,n))}function Me(e){Ee.current===e&&(Ce(Te),Ce(Ee)),Oe.current===e&&(Ce(Oe),vh._currentValue=ye)}var Ne,Pe;function Fe(e){if(Ne===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ne=t&&t[1]||``,Pe=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+Ne+e+Pe}var Ie=!1;function Le(e,t){if(!e||Ie)return``;Ie=!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{Ie=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Fe(n):``}function Re(e,t){switch(e.tag){case 26:case 27:case 5:return Fe(e.type);case 16:return Fe(`Lazy`);case 13:return e.child!==t&&t!==null?Fe(`Suspense Fallback`):Fe(`Suspense`);case 19:return Fe(`SuspenseList`);case 0:case 15:return Le(e.type,!1);case 11:return Le(e.type.render,!1);case 1:return Le(e.type,!0);case 31:return Fe(`Activity`);case 30:return Fe(`ViewTransition`);default:return``}}function ze(e){try{var t=``,n=null;do t+=Re(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var Be=Object.prototype.hasOwnProperty,Ve=t.unstable_scheduleCallback,He=t.unstable_cancelCallback,Ue=t.unstable_shouldYield,We=t.unstable_requestPaint,Ge=t.unstable_now,Ke=t.unstable_getCurrentPriorityLevel,qe=t.unstable_ImmediatePriority,Je=t.unstable_UserBlockingPriority,Ye=t.unstable_NormalPriority,Xe=t.unstable_LowPriority,Ze=t.unstable_IdlePriority,Qe=t.log,$e=t.unstable_setDisableYieldValue,et=null,P=null;function tt(e){if(typeof Qe==`function`&&$e(e),P&&typeof P.setStrictMode==`function`)try{P.setStrictMode(et,e)}catch{}}var nt=Math.clz32?Math.clz32:it,F=Math.log,rt=Math.LN2;function it(e){return e>>>=0,e===0?32:31-(F(e)/rt|0)|0}var at=256,ot=262144,st=4194304;function ct(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 lt(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=ct(n))):i=ct(o):i=ct(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ct(n))):i=ct(o)):i=ct(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 ut(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function dt(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-nt(n),i=1<<r;t|=e[r],n&=~i}return t}function ft(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 pt(){var e=st;return st<<=1,!(st&62914560)&&(st=4194304),e}function mt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ht(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function gt(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-nt(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&&_t(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function _t(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-nt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function vt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-nt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function yt(e,t){var n=t&-t;return n=n&42?1:bt(n),(n&(e.suspendedLanes|t))===0?n:0}function bt(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 xt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function St(){var e=N.p;return e===0?(e=window.event,e===void 0?32:Ph(e.type)):e}function Ct(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var wt=Math.random().toString(36).slice(2),Tt=`__reactFiber$`+wt,Et=`__reactProps$`+wt,Dt=`__reactContainer$`+wt,Ot=`__reactEvents$`+wt,kt=`__reactListeners$`+wt,At=`__reactHandles$`+wt,jt=`__reactResources$`+wt,Mt=`__reactMarker$`+wt,Nt=`__reactLoad$`+wt;function Pt(e){delete e[Tt],delete e[Et],delete e[kt],delete e[At]}function Ft(e){var t;if(t=e[Tt])return t;for(var n=e.parentNode;n;){if(t=n[Dt]||n[Tt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Cm(e);e!==null;){if(n=e[Tt])return n;e=Cm(e)}return t}e=n,n=e.parentNode}return null}function It(e){if(e=e[Tt]||e[Dt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Lt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Rt(e){var t=e[jt];return t||=e[jt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function zt(e){e[Mt]=!0}function Bt(e){e[Nt]=void 0}var Vt=new Set,Ht={};function Ut(e,t){Wt(e,t),Wt(e+`Capture`,t)}function Wt(e,t){for(Ht[e]=t,e=0;e<t.length;e++)Vt.add(t[e])}var Gt=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]*$`),Kt={},qt={};function Jt(e){return Be.call(qt,e)?!0:Be.call(Kt,e)?!1:Gt.test(e)?qt[e]=!0:(Kt[e]=!0,!1)}var Yt=!1;function Xt(){var e=Yt;return Yt=!1,e}function Zt(e,t,n){if(Jt(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 Qt(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 $t(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 en(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function tn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function nn(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 rn(e){if(!e._valueTracker){var t=tn(e)?`checked`:`value`;e._valueTracker=nn(e,t,``+e[t])}}function an(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=tn(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var on=/[\n"\\]/g;function sn(e){return e.replace(on,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function cn(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=``+en(t)):e.value!==``+en(t)&&(e.value=``+en(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):un(e,en(n)):o===`number`&&e.value==t?un(e,en(e.value)):un(e,en(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=``+en(s):e.removeAttribute(`name`)}function ln(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)){rn(e);return}n=n==null?``:``+en(n),t=t==null?n:``+en(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),rn(e)}function un(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function dn(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=``+en(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 fn(e,t,n){if(t!=null&&(t=``+en(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+en(n)}function pn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ve(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=en(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),rn(e)}function mn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var hn=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 gn(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||hn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function _n(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]=``,Yt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(gn(e,a,r),Yt=!0)}else for(var o in t)t.hasOwnProperty(o)&&gn(e,o,t[o])}function vn(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 yn=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`]]),bn=/^[\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 I(e){return bn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function xn(){}var Sn=null;function Cn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wn=null,Tn=null;function En(e){var t=It(e);if(t&&(e=t.stateNode)){var n=e[Et]||null;a:switch(e=t.stateNode,t.type){case`input`:if(cn(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="`+sn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Et]||null;if(!a)throw Error(i(90));cn(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&&an(r)}break a;case`textarea`:fn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&dn(e,!!n.multiple,t,!1)}}}var Dn=!1;function On(e,t,n){if(Dn)return e(t,n);Dn=!0;try{return e(t)}finally{if(Dn=!1,(wn!==null||Tn!==null)&&(Jd(),wn&&(t=wn,e=Tn,Tn=wn=null,En(t),e)))for(t=0;t<e.length;t++)En(e[t])}}function kn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Et]||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 An=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,jn=!1;if(An)try{var Mn={};Object.defineProperty(Mn,"passive",{get:function(){jn=!0}}),window.addEventListener(`test`,Mn,Mn),window.removeEventListener(`test`,Mn,Mn)}catch{jn=!1}var Nn=null,Pn=null,Fn=null;function In(){if(Fn)return Fn;var e,t=Pn,n=t.length,r,i=`value`in Nn?Nn.value:Nn.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 Fn=i.slice(e,1<r?1-r:void 0)}function Ln(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 Rn(){return!0}function zn(){return!1}function Bn(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)?Rn:zn,this.isPropagationStopped=zn,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=Rn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Rn)},persist:function(){},isPersistent:Rn}),t}var Vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hn=Bn(Vn),Un=D({},Vn,{view:0,detail:0}),Wn=Bn(Un),Gn,Kn,qn,Jn=D({},Un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ar,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!==qn&&(qn&&e.type===`mousemove`?(Gn=e.screenX-qn.screenX,Kn=e.screenY-qn.screenY):Kn=Gn=0,qn=e),Gn)},movementY:function(e){return`movementY`in e?e.movementY:Kn}}),Yn=Bn(Jn),Xn=Bn(D({},Jn,{dataTransfer:0})),Zn=Bn(D({},Un,{relatedTarget:0})),Qn=Bn(D({},Vn,{animationName:0,elapsedTime:0,pseudoElement:0})),$n=Bn(D({},Vn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),er=Bn(D({},Vn,{data:0})),tr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},nr={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`},rr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function ir(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rr[e])?!!t[e]:!1}function ar(){return ir}var or=Bn(D({},Un,{key:function(e){if(e.key){var t=tr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Ln(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?nr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ar,charCode:function(e){return e.type===`keypress`?Ln(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Ln(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),sr=Bn(D({},Jn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),cr=Bn(D({},Vn,{submitter:0})),lr=Bn(D({},Un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ar})),ur=Bn(D({},Vn,{propertyName:0,elapsedTime:0,pseudoElement:0})),dr=Bn(D({},Jn,{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})),fr=Bn(D({},Vn,{newState:0,oldState:0,source:0})),pr=[9,13,27,32],mr=An&&`CompositionEvent`in window,hr=null;An&&`documentMode`in document&&(hr=document.documentMode);var gr=An&&`TextEvent`in window&&!hr,_r=An&&(!mr||hr&&8<hr&&11>=hr),vr=` `,yr=!1;function br(e,t){switch(e){case`keyup`:return pr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function xr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Sr=!1;function Cr(e,t){switch(e){case`compositionend`:return xr(t);case`keypress`:return t.which===32?(yr=!0,vr):null;case`textInput`:return e=t.data,e===vr&&yr?null:e;default:return null}}function wr(e,t){if(Sr)return e===`compositionend`||!mr&&br(e,t)?(e=In(),Fn=Pn=Nn=null,Sr=!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 _r&&t.locale!==`ko`?null:t.data;default:return null}}var Tr={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 Er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Tr[e.type]:t===`textarea`}function Dr(e,t,n,r){wn?Tn?Tn.push(r):Tn=[r]:wn=r,t=ap(t,`onChange`),0<t.length&&(n=new Hn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Or=null,kr=null;function Ar(e){Zf(e,0)}function jr(e){if(an(Lt(e)))return e}function Mr(e,t){if(e===`change`)return t}var Nr=!1;if(An){var Pr;if(An){var Fr=`oninput`in document;if(!Fr){var Ir=document.createElement(`div`);Ir.setAttribute(`oninput`,`return;`),Fr=typeof Ir.oninput==`function`}Pr=Fr}else Pr=!1;Nr=Pr&&(!document.documentMode||9<document.documentMode)}function Lr(){Or&&(Or.detachEvent(`onpropertychange`,Rr),kr=Or=null)}function Rr(e){if(e.propertyName===`value`&&jr(kr)){var t=[];Dr(t,kr,e,Cn(e)),On(Ar,t)}}function zr(e,t,n){e===`focusin`?(Lr(),Or=t,kr=n,Or.attachEvent(`onpropertychange`,Rr)):e===`focusout`&&Lr()}function Br(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return jr(kr)}function Vr(e,t){if(e===`click`)return jr(t)}function L(e,t){if(e===`input`||e===`change`)return jr(t)}function Hr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Ur=typeof Object.is==`function`?Object.is:Hr;function Wr(e,t){if(Ur(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(!Be.call(t,i)||!Ur(e[i],t[i]))return!1}return!0}function Gr(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 Kr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function qr(e,t){var n=Kr(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=Kr(n)}}function Jr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Yr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Gr(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=Gr(e.document)}return t}function Xr(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 Zr=An&&`documentMode`in document&&11>=document.documentMode,Qr=null,$r=null,ei=null,ti=!1;function ni(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ti||Qr==null||Qr!==Gr(r)||(r=Qr,`selectionStart`in r&&Xr(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}),ei&&Wr(ei,r)||(ei=r,r=ap($r,`onSelect`),0<r.length&&(t=new Hn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Qr)))}function ri(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ii={animationend:ri(`Animation`,`AnimationEnd`),animationiteration:ri(`Animation`,`AnimationIteration`),animationstart:ri(`Animation`,`AnimationStart`),transitionrun:ri(`Transition`,`TransitionRun`),transitionstart:ri(`Transition`,`TransitionStart`),transitioncancel:ri(`Transition`,`TransitionCancel`),transitionend:ri(`Transition`,`TransitionEnd`)},ai={},oi={};An&&(oi=document.createElement(`div`).style,`AnimationEvent`in window||(delete ii.animationend.animation,delete ii.animationiteration.animation,delete ii.animationstart.animation),`TransitionEvent`in window||delete ii.transitionend.transition);function si(e){if(ai[e])return ai[e];if(!ii[e])return e;var t=ii[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in oi)return ai[e]=t[n];return e}var ci=si(`animationend`),li=si(`animationiteration`),ui=si(`animationstart`),di=si(`transitionrun`),fi=si(`transitionstart`),pi=si(`transitioncancel`),mi=si(`transitionend`),hi=new Map,gi=`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(` `);gi.push(`scrollEnd`);function _i(e,t){hi.set(e,t),Ut(t,[e])}var vi=0;function yi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=kd.identifierPrefix;var n=vi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function bi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ld;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 xi(e,t){return e=bi(e),t=bi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var R=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)},Si=[],Ci=0,wi=0;function Ti(){for(var e=Ci,t=wi=Ci=0;t<e;){var n=Si[t];Si[t++]=null;var r=Si[t];Si[t++]=null;var i=Si[t];Si[t++]=null;var a=Si[t];if(Si[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&&ki(n,i,a)}}function Ei(e,t,n,r){Si[Ci++]=e,Si[Ci++]=t,Si[Ci++]=n,Si[Ci++]=r,wi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Di(e,t,n,r){return Ei(e,t,n,r),Ai(e)}function Oi(e,t){return Ei(e,null,null,t),Ai(e)}function ki(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-nt(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ai(e){if(50<Rd)throw Rd=0,zd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ji={};function Mi(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 Ni(e,t,n,r){return new Mi(e,t,n,r)}function Pi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fi(e,t){var n=e.alternate;return n===null?(n=Ni(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 Ii(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 Li(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Pi(r)&&(s=1);else if(typeof r==`string`)s=ih(e,n,Te.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case le:return e=Ni(31,n,t,a),e.elementType=le,e.lanes=o,e;case te:return Ri(n.children,a,o,t);case ne:s=8,a|=24;break;case re:return e=Ni(12,n,t,a|2),e.elementType=re,e.lanes=o,e;case oe:return e=Ni(13,n,t,a),e.elementType=oe,e.lanes=o,e;case se:return e=Ni(19,n,t,a),e.elementType=se,e.lanes=o,e;case ue:case fe:return e=a|32,e=Ni(30,n,t,e),e.elementType=fe,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case A:s=10;break a;case ie:s=9;break a;case ae:s=11;break a;case ce:s=14;break a;case j:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ni(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ri(e,t,n,r){return e=Ni(7,e,r,t),e.lanes=n,e}function zi(e,t,n){return e=Ni(6,e,null,t),e.lanes=n,e}function Bi(e){var t=Ni(18,null,null,0);return t.stateNode=e,t}function Vi(e,t,n){return t=Ni(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Hi=new WeakMap;function Ui(e,t){if(typeof e==`object`&&e){var n=Hi.get(e);return n===void 0?(t={value:e,source:t,stack:ze(t)},Hi.set(e,t),t):n}return{value:e,source:t,stack:ze(t)}}var Wi=[],Gi=0,Ki=null,qi=0,Ji=[],Yi=0,Xi=null,Zi=1,Qi=``;function $i(e,t){Wi[Gi++]=qi,Wi[Gi++]=Ki,Ki=e,qi=t}function ea(e,t,n){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Xi=e;var r=Zi;e=Qi;var i=32-nt(r)-1;r&=~(1<<i),n+=1;var a=32-nt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Zi=1<<32-nt(t)+i|n<<i|r,Qi=a+e}else Zi=1<<a|n<<i|r,Qi=e}function ta(e){e.return!==null&&($i(e,1),ea(e,1,0))}function na(e){for(;e===Ki;)Ki=Wi[--Gi],Wi[Gi]=null,qi=Wi[--Gi],Wi[Gi]=null;for(;e===Xi;)Xi=Ji[--Yi],Ji[Yi]=null,Qi=Ji[--Yi],Ji[Yi]=null,Zi=Ji[--Yi],Ji[Yi]=null}function ra(e,t){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Zi=t.id,Qi=t.overflow,Xi=e}var ia=null,aa=null,oa=!1,sa=null,ca=!1,la=Error(i(519));function ua(e){throw ga(Ui(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),la}function da(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Tt]=e,t[Et]=r,n){case`dialog`:Qf(`cancel`,t),Qf(`close`,t);break;case`iframe`:case`object`:case`embed`:Qf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Yf.length;n++)Qf(Yf[n],t);break;case`source`:Qf(`error`,t);break;case`img`:case`image`:case`link`:Qf(`error`,t),Qf(`load`,t);break;case`details`:Qf(`toggle`,t);break;case`input`:Qf(`invalid`,t),ln(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Qf(`invalid`,t);break;case`textarea`:Qf(`invalid`,t),pn(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||dp(t.textContent,n)?(r.popover!=null&&(Qf(`beforetoggle`,t),Qf(`toggle`,t)),r.onScroll!=null&&Qf(`scroll`,t),r.onScrollEnd!=null&&Qf(`scrollend`,t),r.onClick!=null&&(t.onclick=xn),t=!0):t=!1,t||ua(e,!0)}function fa(e){for(ia=e.return;ia;)switch(ia.tag){case 5:case 31:case 13:ca=!1;return;case 27:case 3:ca=!0;return;default:ia=ia.return}}function pa(e){if(e!==ia)return!1;if(!oa)return fa(e),oa=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Tp(e.type,e.memoizedProps)),n=!n),n&&aa&&ua(e),fa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));aa=Sm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));aa=Sm(e)}else t===27?(t=aa,Np(e.type)?(e=xm,xm=null,aa=e):aa=t):aa=ia?bm(e.stateNode.nextSibling):null;return!0}function ma(){aa=ia=null,oa=!1}function ha(){var e=sa;return e!==null&&(xd===null?xd=e:xd.push.apply(xd,e),sa=null),e}function ga(e){sa===null?sa=[e]:sa.push(e)}var _a=Se(null),va=null,ya=null;function ba(e,t,n){we(_a,t._currentValue),t._currentValue=n}function xa(e){e._currentValue=_a.current,Ce(_a)}function Sa(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 Ca(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),Sa(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),Sa(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),Sa(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 wa(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;Ur(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Oe.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[vh]:e.push(vh))}a=a.return}return e!==null&&Ca(t,e,n,r),t.flags|=262144,e!==null}function Ta(e){for(e=e.firstContext;e!==null;){if(!Ur(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ea(e){va=e,ya=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Da(e){return ka(va,e)}function Oa(e,t){return va===null&&Ea(e),ka(e,t)}function ka(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ya===null){if(e===null)throw Error(i(308));ya=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ya=ya.next=t;return n}var Aa=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()})}},ja=t.unstable_scheduleCallback,Ma=t.unstable_NormalPriority,Na={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pa(){return{controller:new Aa,data:new Map,refCount:0}}function Fa(e){e.refCount--,e.refCount===0&&ja(Ma,function(){e.controller.abort()})}function Ia(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 La=null;function Ra(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var za=null,Ba=0,Va=0,Ha=null;function Ua(e,t){if(za===null){var n=za=[];Ba=0,Va=Wf(),Ha={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ba++,t.then(Wa,Wa),t}function Wa(){if(--Ba===0&&(La=null,za!==null)){Ha!==null&&(Ha.status=`fulfilled`);var e=za;za=null,Va=0,Ha=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ga(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 Ka=M.S;M.S=function(e,t){if(wd=Ge(),typeof t==`object`&&t&&typeof t.then==`function`&&Ua(e,t),La!==null)for(var n=Af;n!==null;)Ia(n,La),n=n.next;if(n=e.types,n!==null){for(var r=Af;r!==null;)Ia(r,n),r=r.next;if(Va!==0){r=La,r===null&&(r=La=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ka!==null&&Ka(e,t)};var qa=Se(null);function Ja(){var e=qa.current;return e===null?ad.pooledCache:e}function Ya(e,t){t===null?we(qa,qa.current):we(qa,t.pool)}function Xa(){var e=Ja();return e===null?null:{parent:Na._currentValue,pool:e}}var Za=Error(i(460)),Qa=Error(i(474)),$a=Error(i(542)),eo={then:function(){}};function to(e){return e=e.status,e===`fulfilled`||e===`rejected`}function no(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(xn,xn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,oo(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(xn,xn);else{if(e=ad,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,oo(e),e}throw io=t,Za}}function ro(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(io=e,Za):e}}var io=null;function ao(){if(io===null)throw Error(i(459));var e=io;return io=null,e}function oo(e){if(e===Za||e===$a)throw Error(i(483))}var so=null,co=0;function lo(e){var t=co;return co+=1,so===null&&(so=[]),no(so,e,t)}function uo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function fo(e,t){throw t.$$typeof===ee?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function po(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=Fi(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=zi(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===te?(e=d(e,t,n.props.children,r,n.key),uo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===j&&ro(i)===t.type)?(t=a(t,n.props),uo(t,n),t.return=e,t):(t=Li(n.type,n.key,n.props,null,e.mode,r),uo(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=Vi(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=Ri(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=zi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case O:return n=Li(t.type,t.key,t.props,null,e.mode,n),uo(n,t),n.return=e,n;case k:return t=Vi(t,e.mode,n),t.return=e,t;case j:return t=ro(t),f(e,t,n)}if(ve(t)||he(t))return t=Ri(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,lo(t),n);if(t.$$typeof===A)return f(e,Oa(e,t),n);fo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case O:return n.key===i?l(e,t,n,r):null;case k:return n.key===i?u(e,t,n,r):null;case j:return n=ro(n),p(e,t,n,r)}if(ve(n)||he(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,lo(n),r);if(n.$$typeof===A)return p(e,t,Oa(e,n),r);fo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case O:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case k:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case j:return r=ro(r),m(e,t,n,r,i)}if(ve(r)||he(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,lo(r),i);if(r.$$typeof===A)return m(e,t,n,Oa(t,r),i);fo(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),oa&&$i(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 oa&&$i(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)}),oa&&$i(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),oa&&$i(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 oa&&$i(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)}),oa&&$i(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===te&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case O:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===te){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),uo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===j&&ro(l)===r.type){n(e,r.sibling),c=a(r,o.props),uo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===te?(c=Ri(o.props.children,e.mode,c,o.key),uo(c,o),c.return=e,e=c):(c=Li(o.type,o.key,o.props,null,e.mode,c),uo(c,o),c.return=e,e=c)}return s(e);case k:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Vi(o,e.mode,c),c.return=e,e=c}return s(e);case j:return o=ro(o),_(e,r,o,c)}if(ve(o))return h(e,r,o,c);if(he(o)){if(l=he(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,lo(o),c);if(o.$$typeof===A)return _(e,r,Oa(e,o),c);fo(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=zi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{co=0;var i=_(e,t,n,r);return so=null,i}catch(t){if(t===Za||t===$a)throw t;var a=Ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var mo=po(!0),ho=po(!1),go=!1;function _o(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vo(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 yo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function bo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,id&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ai(e),ki(e,null,n),t}return Ei(e,r,t,n),Ai(e)}function xo(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,vt(e,n)}}function So(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 Co=!1;function wo(){if(Co){var e=Ha;if(e!==null)throw e}}function To(e,t,n,r){Co=!1;var i=e.updateQueue;go=!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?(sd&f)===f:(r&f)===f){f!==0&&f===Va&&(Co=!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:go=!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),hd|=o,e.lanes=o,e.memoizedState=d}}function Eo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Do(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Eo(n[e],t)}var Oo=Se(null),ko=Se(0);function Ao(e,t){e=pd,we(ko,e),we(Oo,t),pd=e|t.baseLanes}function jo(){we(ko,pd),we(Oo,Oo.current)}function Mo(){pd=ko.current,Ce(Oo),Ce(ko)}var No=Se(null),Po=null;function Fo(e){var t=e.alternate;we(Bo,Bo.current&1),we(No,e),Po===null&&(t===null||Oo.current!==null||t.memoizedState!==null)&&(Po=e)}function Io(e){we(Bo,Bo.current),we(No,e),Po===null&&(Po=e)}function Lo(e){e.tag===22?(we(Bo,Bo.current),we(No,e),Po===null&&(Po=e)):Ro()}function Ro(){we(Bo,Bo.current),we(No,No.current)}function zo(e){Ce(No),Po===e&&(Po=null),Ce(Bo)}var Bo=Se(0);function Vo(e,t){we(No,No.current),we(Bo,t)}function Ho(e){Ce(Bo),Ce(No),Po===e&&(Po=null)}function Uo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||_m(n)||vm(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 Wo=0,Go=null,Ko=null,qo=null,Jo=!1,Yo=!1,Xo=!1,Zo=0,Qo=0,$o=null,es=0;function ts(){throw Error(i(321))}function ns(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ur(e[n],t[n]))return!1;return!0}function rs(e,t,n,r,i,a){return Wo=a,Go=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?vc:yc,Xo=!1,a=n(r,i),Xo=!1,Yo&&(a=as(t,n,r,i)),is(e),a}function is(e){M.H=_c;var t=Ko!==null&&Ko.next!==null;if(Wo=0,qo=Ko=Go=null,Jo=!1,Qo=0,$o=null,t)throw Error(i(300));e===null||Ic||(e=e.dependencies,e!==null&&Ta(e)&&(Ic=!0))}function as(e,t,n,r){Go=e;var a=0;do{if(Yo&&($o=null),Qo=0,Yo=!1,25<=a)throw Error(i(301));if(a+=1,qo=Ko=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}M.H=bc,o=t(n,r)}while(Yo);return o}function os(){var e=M.H,t=e.useState()[0];return t=typeof t.then==`function`?ps(t):t,e=e.useState()[0],(Ko===null?null:Ko.memoizedState)!==e&&(Go.flags|=1024),t}function ss(){var e=Zo!==0;return Zo=0,e}function cs(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ls(e){if(Jo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Jo=!1}Wo=0,qo=Ko=Go=null,Yo=!1,Qo=Zo=0,$o=null}function us(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qo===null?Go.memoizedState=qo=e:qo=qo.next=e,qo}function ds(){if(Ko===null){var e=Go.alternate;e=e===null?null:e.memoizedState}else e=Ko.next;var t=qo===null?Go.memoizedState:qo.next;if(t!==null)qo=t,Ko=e;else{if(e===null)throw Go.alternate===null?Error(i(467)):Error(i(310));Ko=e,e={memoizedState:Ko.memoizedState,baseState:Ko.baseState,baseQueue:Ko.baseQueue,queue:Ko.queue,next:null},qo===null?Go.memoizedState=qo=e:qo=qo.next=e}return qo}function fs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ps(e){var t=Qo;return Qo+=1,$o===null&&($o=[]),e=no($o,e,t),t=Go,(qo===null?t.memoizedState:qo.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?vc:yc),e}function ms(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ps(e);if(e.$$typeof===pe)return;if(e.$$typeof===A)return Da(e)}throw Error(i(438,String(e)))}function hs(e){var t=null,n=Go.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Go.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=fs(),Go.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]=de;return t.index++,n}function gs(e,t){return typeof t==`function`?t(e):t}function _s(e){return vs(ds(),Ko,e)}function vs(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?(Wo&f)===f:(sd&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===Va&&(d=!0);else if((Wo&p)===p){u=u.next,p===Va&&(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,Go.lanes|=p,hd|=p;f=u.action,Xo&&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,Go.lanes|=f,hd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Ur(o,e.memoizedState)&&(Ic=!0,d&&(n=Ha,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 z(e){var t=ds(),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);Ur(o,t.memoizedState)||(Ic=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ys(e,t,n){var r=Go,a=ds(),o=oa;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Ur((Ko||a).memoizedState,n);if(s&&(a.memoizedState=n,Ic=!0),a=a.queue,Ws(Ss.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||qo!==null&&!!(qo.memoizedState.tag&1),zs(e?9:8,{destroy:void 0},xs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,ad===null)throw Error(i(349));o||Wo&127||bs(r,t,n)}return n}function bs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Go.updateQueue,t===null?(t=fs(),Go.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function xs(e,t,n,r){t.value=n,t.getSnapshot=r,Cs(t)&&ws(e)}function Ss(e,t,n){return n(function(){Cs(t)&&ws(e)})}function Cs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ur(e,n)}catch{return!0}}function ws(e){var t=Oi(e,2);t!==null&&Ud(t,e,2)}function Ts(e){var t=us();if(typeof e==`function`){var n=e;if(e=n(),Xo){tt(!0);try{n()}finally{tt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gs,lastRenderedState:e},t}function Es(e,t,n,r){return e.baseState=n,vs(e,Ko,typeof r==`function`?r:gs)}function Ds(e,t,n,r,a){if(mc(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)}};M.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Os(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Os(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=M.T,o={};o.types=a===null?null:a.types,M.T=o;try{var s=n(i,r),c=M.S;c!==null&&c(o,s),ks(e,t,s)}catch(n){js(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),M.T=a}}else try{a=n(i,r),ks(e,t,a)}catch(n){js(e,t,n)}}function ks(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){As(e,t,n)},function(n){return js(e,t,n)}):As(e,t,n)}function As(e,t,n){t.status=`fulfilled`,t.value=n,Ms(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Os(e,n)))}function js(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ms(t),t=t.next;while(t!==r)}e.action=null}function Ms(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ns(e,t){return t}function Ps(e,t){if(oa){var n=ad.formState;if(n!==null){a:{var r=Go;if(oa){if(aa){b:{for(var i=aa,a=ca;i.nodeType!==8;){if(!a){i=null;break b}if(i=bm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){aa=bm(i.nextSibling),r=i.data===`F!`;break a}}ua(r)}r=!1}r&&(t=n[0])}}return n=us(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ns,lastRenderedState:t},n.queue=r,n=dc.bind(null,Go,r),r.dispatch=n,r=Ts(!1),a=pc.bind(null,Go,!1,r.queue),r=us(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ds.bind(null,Go,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Fs(e){return Is(ds(),Ko,e)}function Is(e,t,n){if(t=vs(e,t,Ns)[0],e=_s(gs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ps(t)}catch(e){throw e===Za?$a:e}else r=t;t=ds();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Go.flags|=2048,zs(9,{destroy:void 0},Ls.bind(null,i,n),null)),[r,a,e]}function Ls(e,t){e.action=t}function Rs(e){var t=ds(),n=Ko;if(n!==null)return Is(t,n,e);ds(),t=t.memoizedState,n=ds();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function zs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Go.updateQueue,t===null&&(t=fs(),Go.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 Bs(){return ds().memoizedState}function Vs(e,t,n,r){var i=us();Go.flags|=e,i.memoizedState=zs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Hs(e,t,n,r){var i=ds();r=r===void 0?null:r;var a=i.memoizedState.inst;Ko!==null&&r!==null&&ns(r,Ko.memoizedState.deps)?i.memoizedState=zs(t,a,n,r):(Go.flags|=e,i.memoizedState=zs(1|t,a,n,r))}function Us(e,t){Vs(8390656,8,e,t)}function Ws(e,t){Hs(2048,8,e,t)}function Gs(e){Go.flags|=4;var t=Go.updateQueue;if(t===null)t=fs(),Go.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ks(e){var t=ds().memoizedState;return Gs({ref:t,nextImpl:e}),function(){if(id&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function qs(e,t){return Hs(4,2,e,t)}function Js(e,t){return Hs(4,4,e,t)}function B(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 Ys(e,t,n){n=n==null?null:n.concat([e]),Hs(4,4,B.bind(null,t,e),n)}function Xs(){}function Zs(e,t){var n=ds();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ns(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Qs(e,t){var n=ds();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ns(t,r[1]))return r[0];if(r=e(),Xo){tt(!0);try{e()}finally{tt(!1)}}return n.memoizedState=[r,t],r}function $s(e,t,n){return n===void 0||Wo&1073741824&&!(sd&261930)?e.memoizedState=t:(e.memoizedState=n,e=Vd(),Go.lanes|=e,hd|=e,n)}function ec(e,t,n,r){return Ur(n,t)?n:Oo.current===null?!(Wo&106)||Wo&1073741824&&!(sd&261930)?(Ic=!0,e.memoizedState=n):(e=Vd(),Go.lanes|=e,hd|=e,t):(e=$s(e,n,r),Ur(e,t)||(Ic=!0),e)}function tc(e,t,n,r,i){var a=N.p;N.p=a!==0&&8>a?a:8;var o=M.T,s={};s.types=o===null?null:o.types,M.T=s,pc(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?fc(e,t,Ga(c,r),Bd(e)):fc(e,t,r,Bd(e))}catch(n){fc(e,t,{then:function(){},status:`rejected`,reason:n},Bd())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function nc(){}function rc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ic(e).queue;tc(e,a,t,ye,n===null?nc:function(){return ac(e),n(r)})}function ic(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gs,lastRenderedState:ye},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ac(e){var t=ic(e);t.next===null&&(t=e.alternate.memoizedState),fc(e,t.next.queue,{},Bd())}function oc(){return Da(vh)}function sc(){return ds().memoizedState}function cc(){return ds().memoizedState}function lc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Bd();e=yo(n);var r=bo(t,e,n);r!==null&&(Ud(r,t,n),xo(r,t,n)),t={cache:Pa()},e.payload=t;return}t=t.return}}function uc(e,t,n){var r=Bd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},mc(e)?hc(t,n):(n=Di(e,t,n,r),n!==null&&(Ud(n,e,r),gc(n,t,r)))}function dc(e,t,n){fc(e,t,n,Bd())}function fc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(mc(e))hc(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,Ur(s,o))return Ei(e,t,i,0),ad===null&&Ti(),!1}catch{}if(n=Di(e,t,i,r),n!==null)return Ud(n,e,r),gc(n,t,r),!0}return!1}function pc(e,t,n,r){if(r={lane:2,revertLane:Wf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},mc(e)){if(t)throw Error(i(479))}else t=Di(e,n,r,2),t!==null&&Ud(t,e,2)}function mc(e){var t=e.alternate;return e===Go||t!==null&&t===Go}function hc(e,t){Yo=Jo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function gc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vt(e,n)}}var _c={readContext:Da,use:ms,useCallback:ts,useContext:ts,useEffect:ts,useImperativeHandle:ts,useLayoutEffect:ts,useInsertionEffect:ts,useMemo:ts,useReducer:ts,useRef:ts,useState:ts,useDebugValue:ts,useDeferredValue:ts,useTransition:ts,useSyncExternalStore:ts,useId:ts,useHostTransitionStatus:ts,useFormState:ts,useActionState:ts,useOptimistic:ts,useMemoCache:ts,useCacheRefresh:ts,useEffectEvent:ts},vc={readContext:Da,use:ms,useCallback:function(e,t){return us().memoizedState=[e,t===void 0?null:t],e},useContext:Da,useEffect:Us,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Vs(4194308,4,B.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vs(4194308,4,e,t)},useInsertionEffect:function(e,t){Vs(4,2,e,t)},useMemo:function(e,t){var n=us();t=t===void 0?null:t;var r=e();if(Xo){tt(!0);try{e()}finally{tt(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=us();if(n!==void 0){var i=n(t);if(Xo){tt(!0);try{n(t)}finally{tt(!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=uc.bind(null,Go,e),[r.memoizedState,e]},useRef:function(e){var t=us();return e={current:e},t.memoizedState=e},useState:function(e){e=Ts(e);var t=e.queue,n=dc.bind(null,Go,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Xs,useDeferredValue:function(e,t){return $s(us(),e,t)},useTransition:function(){var e=Ts(!1);return e=tc.bind(null,Go,e.queue,!0,!1),us().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Go,a=us();if(oa){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ad===null)throw Error(i(349));sd&127||bs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Us(Ss.bind(null,r,o,e),[e]),r.flags|=2048,zs(9,{destroy:void 0},xs.bind(null,r,o,n,t),null),n},useId:function(){var e=us(),t=ad.identifierPrefix;if(oa){var n=Qi,r=Zi;n=(r&~(1<<32-nt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Zo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=es++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:oc,useFormState:Ps,useActionState:Ps,useOptimistic:function(e){var t=us();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=pc.bind(null,Go,!0,n),n.dispatch=t,[e,t]},useMemoCache:hs,useCacheRefresh:function(){return us().memoizedState=lc.bind(null,Go)},useEffectEvent:function(e){var t=us(),n={impl:e};return t.memoizedState=n,function(){if(id&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},yc={readContext:Da,use:ms,useCallback:Zs,useContext:Da,useEffect:Ws,useImperativeHandle:Ys,useInsertionEffect:qs,useLayoutEffect:Js,useMemo:Qs,useReducer:_s,useRef:Bs,useState:function(){return _s(gs)},useDebugValue:Xs,useDeferredValue:function(e,t){return ec(ds(),Ko.memoizedState,e,t)},useTransition:function(){var e=_s(gs)[0],t=ds().memoizedState;return[typeof e==`boolean`?e:ps(e),t]},useSyncExternalStore:ys,useId:sc,useHostTransitionStatus:oc,useFormState:Fs,useActionState:Fs,useOptimistic:function(e,t){return Es(ds(),Ko,e,t)},useMemoCache:hs,useCacheRefresh:cc,useEffectEvent:Ks},bc={readContext:Da,use:ms,useCallback:Zs,useContext:Da,useEffect:Ws,useImperativeHandle:Ys,useInsertionEffect:qs,useLayoutEffect:Js,useMemo:Qs,useReducer:z,useRef:Bs,useState:function(){return z(gs)},useDebugValue:Xs,useDeferredValue:function(e,t){var n=ds();return Ko===null?$s(n,e,t):ec(n,Ko.memoizedState,e,t)},useTransition:function(){var e=z(gs)[0],t=ds().memoizedState;return[typeof e==`boolean`?e:ps(e),t]},useSyncExternalStore:ys,useId:sc,useHostTransitionStatus:oc,useFormState:Rs,useActionState:Rs,useOptimistic:function(e,t){var n=ds();return Ko===null?(n.baseState=e,[e,n.queue.dispatch]):Es(n,Ko,e,t)},useMemoCache:hs,useCacheRefresh:cc,useEffectEvent:Ks};function xc(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 Sc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Bd(),i=yo(r);i.payload=t,n!=null&&(i.callback=n),t=bo(e,i,r),t!==null&&(Ud(t,e,r),xo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Bd(),i=yo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=bo(e,i,r),t!==null&&(Ud(t,e,r),xo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Bd(),r=yo(n);r.tag=2,t!=null&&(r.callback=t),t=bo(e,r,n),t!==null&&(Ud(t,e,n),xo(t,e,n))}};function Cc(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?!Wr(n,r)||!Wr(i,a):!0}function wc(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&&Sc.enqueueReplaceState(t,t.state,null)}function Tc(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 Ec(e){R(e)}function Dc(e){console.error(e)}function Oc(e){R(e)}function kc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ac(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 jc(e,t,n){return n=yo(n),n.tag=3,n.payload={element:null},n.callback=function(){kc(e,t)},n}function Mc(e){return e=yo(e),e.tag=3,e}function Nc(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(){Ac(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ac(t,n,r),typeof i!=`function`&&(Dd===null?Dd=new Set([this]):Dd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Pc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&wa(t,n,a,!0),n=No.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Po===null?tf():n.alternate===null&&md===0&&(md=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===eo?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),wf(e,r,a)),!1;case 22:return n.flags|=65536,r===eo?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)),wf(e,r,a)),!1}throw Error(i(435,n.tag))}return wf(e,r,a),tf(),!1}if(oa)return t=No.current,t===null?(r!==la&&(t=Error(i(423),{cause:r}),ga(Ui(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ui(r,n),a=jc(e.stateNode,r,a),So(e,a),md!==4&&(md=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==la&&(e=Error(i(422),{cause:r}),ga(Ui(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ui(o,n),bd===null?bd=[o]:bd.push(o),md!==4&&(md=2),t===null)return!0;r=Ui(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=jc(n.stateNode,r,e),So(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`&&(Dd===null||!Dd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Mc(a),Nc(a,e,n,r),So(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Fc=Error(i(461)),Ic=!1;function Lc(e,t,n,r){t.child=e===null?ho(t,null,n,r):mo(t,e.child,n,r)}function Rc(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 Ea(t),r=rs(e,t,n,o,a,i),s=ss(),e!==null&&!Ic?(cs(e,t,i),dl(e,t,i)):(oa&&s&&ta(t),t.flags|=1,Lc(e,t,r,i),t.child)}function zc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Pi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Bc(e,t,a,r,i)):(e=Li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!fl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Wr:n,n(o,r)&&e.ref===t.ref)return dl(e,t,i)}return t.flags|=1,e=Fi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Bc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Wr(a,r)&&e.ref===t.ref){if(Ic=!1,t.pendingProps=r=a,fl(e,i))e.flags&131072&&(Ic=!0);else return t.lanes=e.lanes,dl(e,t,i)}}return V(e,t,n,r,i)}function Vc(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 Uc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ya(t,a===null?null:a.cachePool),a===null?jo():Ao(t,a),Lo(t);else return r=t.lanes=536870912,Uc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ya(t,null),jo(),Ro()):(Ya(t,a.cachePool),Ao(t,a),Ro(),t.memoizedState=null);return Lc(e,t,i,n),t.child}function Hc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Uc(e,t,n,r,i){var a=Ja();return a=a===null?null:{parent:Na._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ya(t,null),jo(),Lo(t),e!==null&&wa(e,t,r,!0),t.childLanes=i,null}function Wc(e,t){return t=nl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Gc(e,t,n){return mo(t,e.child,null,n),e=Wc(t,t.pendingProps),e.flags|=2,zo(t),t.memoizedState=null,e}function Kc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(oa){if(r.mode===`hidden`)return e=Wc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Hc(null,e);if(Io(t),(e=aa)?(e=gm(e,ca),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,aa=null)):e=null,e===null)throw ua(t);return t.lanes=536870912,null}return Wc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Io(t),a){if(t.flags&256)t.flags&=-257,t=Gc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Ic||wa(e,t,n,!1),a=(n&e.childLanes)!==0,Ic||a){if(Oo.current===null){if(r=ad,r!==null&&(s=yt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Oi(e,s),Ud(r,e,s),Fc;tf()}t=Gc(e,t,n)}else e=o.treeContext,aa=bm(s.nextSibling),ia=t,oa=!0,sa=null,ca=!1,e!==null&&ra(t,e),t=Wc(t,r),t.flags|=134221824;return t}return e=Fi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function qc(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 V(e,t,n,r,i){return Ea(t),n=rs(e,t,n,r,void 0,i),r=ss(),e!==null&&!Ic?(cs(e,t,i),dl(e,t,i)):(oa&&r&&ta(t),t.flags|=1,Lc(e,t,n,i),t.child)}function Jc(e,t,n,r,i,a){return Ea(t),t.updateQueue=null,n=as(t,r,n,i),is(e),r=ss(),e!==null&&!Ic?(cs(e,t,a),dl(e,t,a)):(oa&&r&&ta(t),t.flags|=1,Lc(e,t,n,a),t.child)}function Yc(e,t,n,r,i){if(Ea(t),t.stateNode===null){var a=ji,o=n.contextType;typeof o==`object`&&o&&(a=Da(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Sc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},_o(t),o=n.contextType,a.context=typeof o==`object`&&o?Da(o):ji,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(xc(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&&Sc.enqueueReplaceState(a,a.state,null),To(t,r,a,i),wo(),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=Tc(n,s);a.props=c;var l=a.context,u=n.contextType;o=ji,typeof u==`object`&&u&&(o=Da(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)&&wc(t,a,r,o),go=!1;var f=t.memoizedState;a.state=f,To(t,r,a,i),wo(),l=t.memoizedState,s||f!==l||go?(typeof d==`function`&&(xc(t,n,d,r),l=t.memoizedState),(c=go||Cc(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,vo(e,t),o=t.memoizedProps,u=Tc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ji,typeof l==`object`&&l&&(c=Da(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)&&wc(t,a,r,c),go=!1,f=t.memoizedState,a.state=f,To(t,r,a,i),wo();var p=t.memoizedState;o!==d||f!==p||go||e!==null&&e.dependencies!==null&&Ta(e.dependencies)?(typeof s==`function`&&(xc(t,n,s,r),p=t.memoizedState),(u=go||Cc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ta(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,qc(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=mo(t,e.child,null,i),t.child=mo(t,null,n,i)):Lc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=dl(e,t,i),e}function Xc(e,t,n,r){return ma(),t.flags|=256,Lc(e,t,n,r),t.child}var Zc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qc(e){return{baseLanes:e,cachePool:Xa()}}function $c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=vd),e}function el(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Bo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(oa){if(i?Fo(t):Ro(),(e=aa)?(e=gm(e,ca),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,aa=null)):e=null,e===null)throw ua(t);return t.lanes=vm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Ro(),i=t.mode,a=nl({mode:`hidden`,children:a},i),r=Ri(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Qc(n),r.childLanes=$c(e,o,n),t.memoizedState=Zc,Hc(null,r)):(Fo(t),tl(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return il(e,t,a,o,r,c,s,n)}return i?(Ro(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Fi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ri(i,a,n,null),i.flags|=2):i=Fi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Hc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Qc(n):(a=i.cachePool,a===null?a=Xa():(s=Na._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=$c(e,o,n),t.memoizedState=Zc,Hc(e.child,r)):(Fo(t),n=e.child,e=n.sibling,n=Fi(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 tl(e,t){return t=nl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function nl(e,t){return e=Ni(22,e,null,t),e.lanes=0,e}function rl(e,t,n){return mo(t,e.child,null,n),e=tl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function il(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Fo(t),t.flags&=-257,rl(e,t,c)):t.memoizedState===null?(Ro(),o=a.fallback,s=t.mode,a=nl({mode:`visible`,children:a.children},s),o=Ri(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,mo(t,e.child,null,c),a=t.child,a.memoizedState=Qc(c),a.childLanes=$c(e,r,c),t.memoizedState=Zc,Hc(null,a)):(Ro(),t.child=e.child,t.flags|=128,null);if(Fo(t),vm(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,ga({value:a,source:null,stack:null})),rl(e,t,c)}if(Ic||wa(e,t,c,!1),r=(c&e.childLanes)!==0,Ic||r){if(Oo.current!==null)return rl(e,t,c);if(r=ad,r!==null&&(a=yt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Oi(e,a),Ud(r,e,a),Fc;return _m(o)||tf(),rl(e,t,c)}return _m(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,aa=bm(o.nextSibling),ia=t,oa=!0,sa=null,ca=!1,e!==null&&ra(t,e),t=tl(t,a.children),t.flags|=134221824,t)}function al(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Sa(e.return,t,n)}function ol(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Uo(n)===null&&(t=e),e=e.sibling}return t}function sl(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 cl(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 ll(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Bo.current;if(t.flags&128)return Vo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Vo(t,o),i===`backwards`&&e!==null?(cl(e),Lc(e,t,r,n),cl(e)):Lc(e,t,r,n),r=oa?qi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&al(e,n,t);else if(e.tag===19)al(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=ol(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,cl(t)),sl(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&&Uo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}sl(t,!0,n,null,a,r);break;case`together`:sl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=ol(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),sl(t,!1,i,n,a,r)}return t.child}function ul(e,t,n){var r=t.pendingProps;return ba(t,t.type,r.value),Lc(e,t,r.children,n),t.child}function dl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),hd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(wa(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=Fi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function fl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ta(e)))}function pl(e,t,n){switch(t.tag){case 3:ke(t,t.stateNode.containerInfo),ba(t,Na,e.memoizedState.cache),ma();break;case 27:case 5:je(t);break;case 4:ke(t,t.stateNode.containerInfo);break;case 10:ba(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Io(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Fo(t),t.flags|=128,null;r=wa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?el(e,t,n):(Fo(t),e=dl(e,t,n),e===null?null:e.sibling)}Fo(t);break;case 19:if(t.flags&128)return ll(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(wa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return ll(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Vo(t,Bo.current),r)break;return null;case 22:return t.lanes=0,Vc(e,t,n,t.pendingProps);case 24:ba(t,Na,e.memoizedState.cache)}return dl(e,t,n)}function ml(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Ic=!0;else{if(!fl(e,n)&&!(t.flags&128))return Ic=!1,pl(e,t,n);Ic=!!(e.flags&131072)}}else Ic=!1,oa&&t.flags&1048576&&ea(t,qi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ro(t.elementType),t.type=e,typeof e==`function`)Pi(e)?(r=Tc(e,r),t.tag=1,t=Yc(null,t,e,r,n)):(t.tag=0,t=V(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ae){t.tag=11,t=Rc(null,t,e,r,n);break a}if(a===ce){t.tag=14,t=zc(null,t,e,r,n);break a}if(a===A){t.tag=10,t.type=e,t=ul(null,t,n);break a}}throw t=_e(e)||e,Error(i(306,t,``))}}return t;case 0:return V(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Tc(r,t.pendingProps),Yc(e,t,r,a,n);case 3:a:{if(ke(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,vo(e,t),To(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ba(t,Na,r),r!==o.cache&&Ca(t,[Na],n,!0),wo(),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=Xc(e,t,r,n);break a}if(r!==a){a=Ui(Error(i(424)),t),ga(a),t=Xc(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(aa=bm(e.firstChild),ia=t,oa=!0,sa=null,ca=!0,n=ho(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ma(),r===a){t=dl(e,t,n);break a}Lc(e,t,r,n)}t=t.child}return t;case 26:return qc(e,t),e===null?(n=Wm(t.type,null,t.pendingProps,null))?t.memoizedState=n:oa||(t.stateNode=wp(t.type,t.pendingProps,De.current,t)):t.memoizedState=Wm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return je(t),e===null&&oa&&(r=t.stateNode=Em(t.type,t.pendingProps,De.current),ia=t,ca=!0,a=aa,Np(t.type)?(xm=a,aa=bm(r.firstChild)):aa=a),Lc(e,t,t.pendingProps.children,n),qc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&oa&&((a=r=aa)&&(r=mm(r,t.type,t.pendingProps,ca),r===null?a=!1:(t.stateNode=r,ia=t,aa=bm(r.firstChild),ca=!1,a=!0)),a||ua(t)),je(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Tp(a,o)?r=null:s!==null&&Tp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=rs(e,t,os,null,null,n),vh._currentValue=a),qc(e,t),Lc(e,t,r,n),t.child;case 6:return e===null&&oa&&((e=n=aa)&&(n=hm(n,t.pendingProps,ca),n===null?e=!1:(t.stateNode=n,ia=t,aa=null,e=!0)),e||ua(t)),null;case 13:return el(e,t,n);case 4:return ke(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=mo(t,null,r,n):Lc(e,t,r,n),t.child;case 11:return Rc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,qc(e,t),Lc(e,t,r,n),t.child;case 8:return Lc(e,t,t.pendingProps.children,n),t.child;case 12:return Lc(e,t,t.pendingProps.children,n),t.child;case 10:return ul(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Ea(t),a=Da(a),r=r(a),t.flags|=1,Lc(e,t,r,n),t.child;case 14:return zc(e,t,t.type,t.pendingProps,n);case 15:return Bc(e,t,t.type,t.pendingProps,n);case 19:return ll(e,t,n);case 31:return Kc(e,t,n);case 22:return Vc(e,t,n,t.pendingProps);case 24:return Ea(t),r=Da(Na),e===null?(a=Ja(),a===null&&(a=ad,o=Pa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},_o(t),ba(t,Na,a)):((e.lanes&n)!==0&&(vo(e,t),To(t,null,null,n),wo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ba(t,Na,r),r!==a.cache&&Ca(t,[Na],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ba(t,Na,r))),Lc(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:oa&&ta(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:qc(e,t),Lc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function hl(e){e.flags|=4}function gl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?ah(t,r):ah(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(Qd())e.flags|=8192;else throw io=eo,Qa}}else e.flags&=-16777217}function _l(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!oh(t)){if(Qd())e.flags|=8192;else throw io=eo,Qa}}function vl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:pt(),e.lanes|=t,yd|=t)}function yl(e,t){if(!oa)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 bl(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 xl(e,t,n){var r=t.pendingProps;switch(na(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bl(t),null;case 1:return bl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),xa(Na),Ae(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(pa(t)?hl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ha())),bl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(hl(t),o===null?(bl(t),gl(t,a,null,r,n)):(bl(t),_l(t,o))):o?o===e.memoizedState?(bl(t),t.flags&=-16777217):(hl(t),bl(t),_l(t,o)):(e=e.memoizedProps,e!==r&&hl(t),bl(t),gl(t,a,e,r,n)),null;case 27:if(Me(t),n=De.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return bl(t),t.subtreeFlags&=-33554433,null}e=Te.current,pa(t)?da(t,e):(e=Em(a,r,n),t.stateNode=e,hl(t))}return bl(t),t.subtreeFlags&=-33554433,null;case 5:if(Me(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return bl(t),t.subtreeFlags&=-33554433,null}if(o=Te.current,pa(t))da(t,o);else{var s=xp(De.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[Tt]=t,o[Et]=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(mp(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&&hl(t)}}return bl(t),t.subtreeFlags&=-33554433,gl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=De.current,pa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ia,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Tt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||dp(e.nodeValue,n)),e||ua(t,!0)}else e=xp(e).createTextNode(r),e[Tt]=t,t.stateNode=e}return bl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=pa(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[Tt]=t}else ma(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bl(t),e=!1}else n=ha(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(zo(t),t):(zo(t),null);if(t.flags&128)throw Error(i(558))}return bl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=pa(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[Tt]=t}else ma(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bl(t),a=!1}else a=ha(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(zo(t),t):(zo(t),null)}return zo(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),vl(t,t.updateQueue),bl(t),null);case 4:return Ae(),e===null&&tp(t.stateNode.containerInfo),t.flags|=67108864,bl(t),null;case 10:return xa(t.type),bl(t),null;case 19:if(Ho(t),r=t.memoizedState,r===null)return bl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)yl(r,!1);else{if(md!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Uo(e),o!==null){for(t.flags|=128,yl(r,!1),e=o.updateQueue,t.updateQueue=e,vl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ii(n,e),n=n.sibling;return Vo(t,Bo.current&1|2),oa&&$i(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ge()>Td&&(t.flags|=128,a=!0,yl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Uo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,vl(t,e),yl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!oa)return bl(t),null}else 2*Ge()-r.renderingStartTime>Td&&n!==536870912&&(t.flags|=128,a=!0,yl(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=Ge(),e.sibling=null,o=Bo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||oa?Vo(t,o):(n=o,we(No,t),we(Bo,n),Po===null&&(Po=t)),oa&&$i(t,r.treeForkCount),e}return bl(t),null;case 22:case 23:return zo(t),Mo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(bl(t),t.subtreeFlags&6&&(t.flags|=8192)):bl(t),n=t.updateQueue,n!==null&&vl(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&&Ce(qa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),xa(Na),bl(t),null;case 25:return null;case 30:return t.flags|=33554432,bl(t),null}throw Error(i(156,t.tag))}function Sl(e,t){switch(na(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xa(Na),Ae(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Me(t),null;case 31:if(t.memoizedState!==null){if(zo(t),t.alternate===null)throw Error(i(340));ma()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(zo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ma()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ho(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 Ae(),null;case 10:return xa(t.type),null;case 22:case 23:return zo(t),Mo(),e!==null&&Ce(qa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return xa(Na),null;case 25:return null;default:return null}}function Cl(e,t){switch(na(t),t.tag){case 3:xa(Na),Ae();break;case 26:case 27:case 5:Me(t);break;case 4:Ae();break;case 31:t.memoizedState!==null&&zo(t);break;case 13:zo(t);break;case 19:Ho(t);break;case 10:xa(t.type);break;case 22:case 23:zo(t),Mo(),e!==null&&Ce(qa);break;case 24:xa(Na)}}function wl(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){Cf(t,t.return,e)}}function Tl(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){Cf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Cf(t,t.return,e)}}function El(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Do(t,n)}catch(t){Cf(e,e.return,t)}}}function Dl(e,t,n){n.props=Tc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Cf(e,t,n)}}function Ol(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=yi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Gp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Kp(e);h(e.child,!1,lm,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){Cf(e,t,n)}}function kl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Cf(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){Cf(e,t,n)}else n.current=null}}function Al(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++)dm(e.stateNode,t[n])}function jl(e){for(var t=e.return;t!==null&&(Pl(t)&&dm(e.stateNode,t.stateNode),!Nl(t));)t=t.return}function Ml(e){for(var t=e.return;t!==null&&(Pl(t)&&fm(e.stateNode,t.stateNode),!Nl(t));)t=t.return}function Nl(e){return e.tag===5||e.tag===3||e.tag===27}function Pl(e){return e&&e.tag===7&&e.stateNode!==null}function Fl(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){Cf(e,e.return,t)}}function Il(e,t,n){try{var r=e.stateNode;gp(r,e.type,n,t),r[Et]=t}catch(t){Cf(e,e.return,t)}}function Ll(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Np(e.type)||e.tag===4}function Rl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ll(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&&Np(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 zl(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=xn)),Al(e,r),Yt=!0;else if(i!==4&&(i===27&&(Al(e,r),r=null,Np(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(zl(e,t,n,r),e=e.sibling;e!==null;)zl(e,t,n,r),e=e.sibling}function Bl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Al(e,r),Yt=!0;else if(i!==4&&(i===27&&(Al(e,r),r=null,Np(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Bl(e,t,n,r),e=e.sibling;e!==null;)Bl(e,t,n,r),e=e.sibling}function Vl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);mp(t,r,n),t[Tt]=e,t[Et]=n}catch(t){Cf(e,e.return,t)}}var Hl=!1,Ul=null;function Wl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Hl=!0)}var Gl=null;function Kl(){var e=Gl;return Gl=null,e}var ql=0;function Jl(e,t,n,r,i){return ql=0,Yl(e.child,t,n,r,i)}function Yl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=zp(o);r.push(s),s.view&&(a=!0)}else a||zp(o).view&&(a=!0);Hl=!0,Ip(o,ql===0?t:t+`_`+ql,n),ql++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Yl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Xl(e,t){for(;e!==null;)e.tag===5?Lp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Xl(e.child,t)),e=e.sibling}function Zl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Zl(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=xi(t.default,t.share),t!==`none`&&(Jl(e,n,t,null,!1)||Xl(e.child,!1))}e=e.sibling}}function Ql(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=yi(r,n),a=xi(r.default,n.paired?r.share:r.enter);a===`none`?Zl(e):Jl(e,i,a,null,!1)?(Zl(e),n.paired||t||Hd(e,r.onEnter)):Xl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e,t),e=e.sibling;else Zl(e)}function $l(e){if(Ul!==null&&Ul.size!==0){var t=Ul;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=xi(n.default,n.share);if(a!==`none`&&(Jl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Hd(e,n.onShare)):Xl(e.child,!1)),t.delete(r),t.size===0)break}}}$l(e)}e=e.sibling}}}function eu(e){if(e.tag===30){var t=e.memoizedProps,n=yi(t,e.stateNode),r=Ul===null?void 0:Ul.get(n),i=xi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Jl(e,n,i,null,!1)?r===void 0?Hd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Ul.delete(n),Hd(e,t.onShare)):Xl(e.child,!1)),Ul!==null&&$l(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)eu(e),e=e.sibling;else Ul!==null&&$l(e)}function tu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=yi(t,e.stateNode);t=xi(t.default,t.update),e.flags&=-5,t!==`none`&&Jl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&tu(e);e=e.sibling}}function nu(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,Xl(e.child,!1))}nu(e)}e=e.sibling}}function ru(e){if(e.tag===30)e.stateNode.paired=null,Xl(e.child,!1),nu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ru(e),e=e.sibling;else nu(e)}function iu(e){for(e=e.child;e!==null;)e.tag===30?Xl(e.child,!1):e.subtreeFlags&33554432&&iu(e),e=e.sibling}function au(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&ql<a.length){var l=a[ql],u=zp(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&&Ip(c,ql===0?n:n+`_`+ql,i),s&&e.flags&4||(Gl===null&&(Gl=[]),Gl.push(c,ql===0?r:r+`_`+ql,t.memoizedProps)),ql++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:au(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function ou(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=yi(n,r),a=xi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Bp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;ql=0,i=au(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Hd(e,n.onUpdate))}else e.subtreeFlags&33554432&&ou(e,t);e=e.sibling}}var su=!1,cu=!1,lu=!1,uu=!1,du=typeof WeakSet==`function`?WeakSet:Set,fu=null,pu=!1,mu=!1,hu=!1,gu=!1;function _u(e,t,n){if(e=e.containerInfo,yp=Dh,e=Yr(e),Xr(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(bp={focusedElem:e,selectionRange:r},Dh=!1,n=(n&335544064)===n,fu=t,t=n?9270:1024;fu!==null;){if(e=fu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&eu(r[a]);if(e.alternate===null&&e.flags&2)n&&Wl(e),vu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&eu(r),vu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Wl(e),vu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,fu=r):(n&&tu(e),vu(n))}}Ul=null}function vu(e){for(;fu!==null;){var t=fu,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=Tc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Cf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)pm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:pm(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=yi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=xi(a.default,a.update),a!==`none`&&Jl(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,fu=r;break}fu=t.return}}function yu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:zu(e,n),r&4&&wl(5,n);break;case 1:if(zu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Cf(n,n.return,e)}else{var i=Tc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Cf(n,n.return,e)}}}r&64&&El(n),r&512&&Ol(n,n.return);break;case 3:if(zu(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{Do(e,t)}catch(e){Cf(n,n.return,e)}}break;case 27:t===null&&r&4&&Vl(n);case 26:case 5:zu(e,n),t===null&&r&4&&Fl(n),r&512&&Ol(n,n.return);break;case 12:zu(e,n);break;case 31:zu(e,n),r&4&&Ou(e,n);break;case 13:zu(e,n),r&4&&ku(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Df.bind(null,n),ym(e,n))));break;case 22:if(r=n.memoizedState!==null||su,!r){var a=t!==null&&t.memoizedState!==null||cu;t=su,i=cu,su=r,(cu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Vu(e,n,r)):zu(e,n),su=t,cu=i}break;case 30:zu(e,n),r&512&&Ol(n,n.return);break;case 7:r&512&&Ol(n,n.return);default:zu(e,n)}}function bu(e,t){for(e=e.child;e!==null;)xu(e,t),e=e.sibling}function xu(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){Cf(e,e.return,t)}Su(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Yt=!0}catch(t){Cf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Fp(s,!0):Fp(e.stateNode,!1)}catch(t){Cf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&bu(e,t);break;default:bu(e,t)}}function Su(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:xu(n,r);break a;case 22:n.memoizedState===null&&Su(n,r);break a;default:Su(n,r)}}e=e.sibling}}function Cu(e){var t=e.alternate;t!==null&&(e.alternate=null,Cu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Pt(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 wu=null,Tu=!1;function Eu(e,t,n){for(n=n.child;n!==null;)Du(e,t,n),n=n.sibling}function Du(e,t,n){if(P&&typeof P.onCommitFiberUnmount==`function`)try{P.onCommitFiberUnmount(et,n)}catch{}switch(n.tag){case 26:cu||kl(n,t),Eu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!cu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:cu||kl(n,t),Ml(n);var r=wu,i=Tu;Np(n.type)&&(wu=n.stateNode,Tu=!1),Eu(e,t,n),Dm(n.stateNode,n.type,n.memoizedProps),wu=r,Tu=i;break;case 5:cu||kl(n,t),Ml(n);case 6:if(n.tag===6&&Ml(n),r=wu,i=Tu,wu=null,Eu(e,t,n),wu=r,Tu=i,wu!==null){if(Tu)try{(wu.nodeType===9?wu.body:wu.nodeName===`HTML`?wu.ownerDocument.body:wu).removeChild(n.stateNode),Yt=!0}catch(e){Cf(n,t,e)}else try{wu.removeChild(n.stateNode),Yt=!0}catch(e){Cf(n,t,e)}}break;case 18:wu!==null&&(Tu?(e=wu,Pp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),$h(e)):Pp(wu,n.stateNode));break;case 4:r=wu,i=Tu,wu=n.stateNode.containerInfo,Tu=!0,Eu(e,t,n),wu=r,Tu=i;break;case 0:case 11:case 14:case 15:Tl(2,n,t),cu||Tl(4,n,t),Eu(e,t,n);break;case 1:cu||(kl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Dl(n,t,r)),Eu(e,t,n);break;case 21:Eu(e,t,n);break;case 22:cu=(r=cu)||n.memoizedState!==null,Eu(e,t,n),cu=r;break;case 30:kl(n,t),Eu(e,t,n);break;case 7:cu||kl(n,t),Eu(e,t,n);break;default:Eu(e,t,n)}}function Ou(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{$h(e)}catch(e){Cf(t,t.return,e)}}}function ku(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{$h(e)}catch(e){Cf(t,t.return,e)}}function Au(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new du),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new du),t;default:throw Error(i(435,e.tag))}}function ju(e,t){var n=Au(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Of.bind(null,e,t);t.then(r,r)}})}function Mu(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(Np(l.type)){wu=l.stateNode,Tu=!1;break a}break;case 5:wu=l.stateNode,Tu=!1;break a;case 3:case 4:wu=l.stateNode.containerInfo,Tu=!0;break a}l=l.return}if(wu===null)throw Error(i(160));Du(s,c,o),wu=null,Tu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Pu(t,e,n),t=t.sibling}var Nu=null;function Pu(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}Mu(t,e,n),Fu(e),a&4&&(Tl(3,e,e.return),wl(3,e),Tl(5,e,e.return));break;case 1:Mu(t,e,n),Fu(e),a&512&&(cu||r===null||kl(r,r.return)),a&64&&su&&(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=Nu,Mu(t,e,n),Fu(e),a&512&&(cu||r===null||kl(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(su)e.stateNode=wp(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[Mt]||r[Tt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),mp(r,t,n),r[Tt]=e,zt(r),t=r;break a;case`link`:if(o=nh(`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),mp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=nh(`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),mp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[Tt]=e,zt(r),t=r}e.stateNode=t}}else su||rh(o,e.type,e.stateNode)}else e.stateNode=Zm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Il(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||cu||t.parentNode.removeChild(t)):a.count--,n===null?su||rh(o,e.type,e.stateNode):Zm(o,n,e.memoizedProps))}break;case 27:Mu(t,e,n),Fu(e),a&512&&(cu||r===null||kl(r,r.return)),r!==null&&a&4&&Il(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=lu,lu=!1,Mu(t,e,n),lu=o,Fu(e),a&512&&(cu||r===null||kl(r,r.return)),e.flags&32){t=e.stateNode;try{mn(t,``),Yt=!0}catch(t){Cf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Il(e,t,r===null?t:r.memoizedProps)),a&1024&&(uu=!0);break;case 6:if(Mu(t,e,n),Fu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Yt=!0}catch(t){Cf(e,e.return,t)}}break;case 3:if(Yt=!1,th=null,o=Nu,Nu=jm(t.containerInfo),Mu(t,e,n),Nu=o,Fu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{$h(t.containerInfo)}catch(t){Cf(e,e.return,t)}uu&&(uu=!1,Iu(e)),Yt=!1;break;case 4:a=lu,lu=su,r=Xt(),o=Nu,Nu=jm(e.stateNode.containerInfo),Mu(t,e,n),Fu(e),Nu=o,Yt&&mu&&(hu=!0),Yt=r,lu=a;break;case 12:Mu(t,e,n),Fu(e);break;case 31:Mu(t,e,n),Fu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ju(e,t)));break;case 13:Mu(t,e,n),Fu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Cd=Ge()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ju(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=su,l=cu,u=lu;su=c||o,lu=u||o,cu=l||s,Mu(t,e,n),cu=l,lu=u,su=c,Fu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||su||cu||(t=s||cu,n=su,r=cu,su=o||su,cu=t,Bu(e,2),su=n,cu=r),!o&&lu||bu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,ju(e,n))));break;case 19:Mu(t,e,n),Fu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ju(e,t)));break;case 30:a&512&&(cu||r===null||kl(r,r.return)),a=Xt(),o=mu,s=(n&335544064)===n,c=e.memoizedProps,mu=s&&xi(c.default,c.update)!==`none`,Mu(t,e,n),Fu(e),s&&r!==null&&Yt&&(e.flags|=4),mu=o,Yt=a;break;case 21:break;case 7:a&512&&(cu||r===null||kl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Mu(t,e,n),Fu(e)}}function Fu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ll(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Pl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Nl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Bl(e,Rl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(mn(l,``),n.flags&=-33),Bl(e,Rl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;zl(e,Rl(e),u,s);break;default:throw Error(i(161))}}catch(t){Cf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Iu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Iu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Dh=!0,t.reset(),Dh=!1),e=e.sibling}}function Lu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Ru(t,e),t=t.sibling;else ou(t,!1)}function Ru(e,t){var n=e.alternate;if(n===null)Ql(e,!1);else switch(e.tag){case 3:if(gu=pu=!1,Kl(),Lu(t,e),!pu&&!hu){if(e=Gl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Lp(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`})),gu=!0}Gl=null;break;case 5:Lu(t,e);break;case 4:r=pu,pu=!1,Lu(t,e),pu&&(hu=!0),pu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Lu(t,e):Ql(e,!1));break;case 30:r=pu,i=Kl(),pu=!1,Lu(t,e),pu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=yi(a,o),o=yi(n.memoizedProps,o);var s=xi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,ql=0,t=au(e,n,t,o,s,a,!0),ql!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Hd(e,e.memoizedProps.onUpdate),Gl=i):i!==null&&(i.push.apply(i,Gl),Gl=i),pu=e.flags&32?!0:r;break;default:Lu(t,e)}}function zu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)yu(e,t.alternate,t),t=t.sibling}function Bu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Tl(4,n,n.return),Bu(n,r);break;case 1:kl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Dl(n,n.return,i),Bu(n,r);break;case 27:r&2&&Dm(n.stateNode,n.type,n.memoizedProps);case 5:kl(n,n.return),n.tag!==5&&n.tag!==27||Ml(n),Bu(n,r);break;case 6:Ml(n);break;case 26:kl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||cu||i.parentNode.removeChild(i),Bu(n,r);break;case 22:n.memoizedState===null&&Bu(n,r);break;case 30:kl(n,n.return),Bu(n,r);break;case 7:kl(n,n.return);default:Bu(n,r)}e=e.sibling}}function Vu(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:Vu(i,a,n),wl(4,a);break;case 1:if(Vu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Cf(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++)Eo(l[i],c)}catch(e){Cf(r,r.return,e)}}s&&o&64&&El(a),Ol(a,a.return);break;case 27:n&2&&Vl(a);case 5:a.tag!==5&&a.tag!==27||jl(a),Vu(i,a,n),s&&r===null&&o&4&&Fl(a),Ol(a,a.return);break;case 6:jl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||su||rh(jm(c.ownerDocument),a.type,c),Vu(i,a,n),s&&r===null&&o&4&&Fl(a),Ol(a,a.return);break;case 12:Vu(i,a,n);break;case 31:Vu(i,a,n),s&&o&4&&Ou(i,a);break;case 13:Vu(i,a,n),s&&o&4&&ku(i,a);break;case 22:a.memoizedState===null&&Vu(i,a,n),Ol(a,a.return);break;case 30:Vu(i,a,n),Ol(a,a.return);break;case 7:Ol(a,a.return);default:Vu(i,a,n)}t=t.sibling}}function Hu(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&&Fa(n))}function Uu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Fa(e))}function Wu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Gu(e,t,n,r),t=t.sibling;else i&&iu(t)}function Gu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&ru(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Wu(e,t,n,r),a&2048&&wl(9,t);break;case 1:Wu(e,t,n,r);break;case 3:Wu(e,t,n,r),i&&gu&&(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&&Fa(a)));break;case 12:if(a&2048){Wu(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){Cf(t,t.return,e)}}else Wu(e,t,n,r);break;case 31:Wu(e,t,n,r);break;case 13:Wu(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&&ru(t),o._visibility&2?Wu(e,t,n,r):(o._visibility|=2,Ku(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&ru(s),o._visibility&2?Wu(e,t,n,r):qu(e,t)),a&2048&&Hu(s,t);break;case 24:Wu(e,t,n,r),a&2048&&Uu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Xl(a.child,!0),Xl(t.child,!0))),Wu(e,t,n,r);break;default:Wu(e,t,n,r)}}function Ku(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:Ku(a,o,s,c,i),wl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ku(a,o,s,c,i)):u._visibility&2?Ku(a,o,s,c,i):qu(a,o),i&&l&2048&&Hu(o.alternate,o);break;case 24:Ku(a,o,s,c,i),i&&l&2048&&Uu(o.alternate,o);break;default:Ku(a,o,s,c,i)}t=t.sibling}}function qu(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:qu(n,r),i&2048&&Hu(r.alternate,r);break;case 24:qu(n,r),i&2048&&Uu(r.alternate,r);break;default:qu(n,r)}t=t.sibling}}var Ju=8192;function Yu(e,t,n){if(e.subtreeFlags&Ju)for(e=e.child;e!==null;)Xu(e,t,n),e=e.sibling}function Xu(e,t,n){switch(e.tag){case 26:Yu(e,t,n),e.flags&Ju&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&ch(n,e)):lh(n,Nu,e.memoizedState,e.memoizedProps));break;case 5:Yu(e,t,n),e.flags&Ju&&(e=e.stateNode,(t&335544128)===t&&ch(n,e));break;case 3:case 4:var r=Nu;Nu=jm(e.stateNode.containerInfo),Yu(e,t,n),Nu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ju,Ju=16777216,Yu(e,t,n),Ju=r):Yu(e,t,n));break;case 30:if((e.flags&Ju)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Ul===null&&(Ul=new Map),Ul.set(r,i)}Yu(e,t,n);break;default:Yu(e,t,n)}}function Zu(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 Qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fu=r,td(r,e)}Zu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)$u(e),e=e.sibling}function $u(e){switch(e.tag){case 0:case 11:case 15:Qu(e),e.flags&2048&&Tl(9,e,e.return);break;case 3:Qu(e);break;case 12:Qu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ed(e)):Qu(e);break;default:Qu(e)}}function ed(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fu=r,td(r,e)}Zu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Tl(8,t,t.return),ed(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ed(t));break;default:ed(t)}e=e.sibling}}function td(e,t){for(;fu!==null;){var n=fu;switch(n.tag){case 0:case 11:case 15:Tl(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:Fa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,fu=r;else a:for(n=e;fu!==null;){r=fu;var i=r.sibling,a=r.return;if(Cu(r),r===n){fu=null;break a}if(i!==null){i.return=a,fu=i;break a}fu=a}}}var nd={getCacheForType:function(e){var t=Da(Na),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Da(Na).controller.signal}},rd=typeof WeakMap==`function`?WeakMap:Map,id=0,ad=null,od=null,sd=0,cd=0,ld=null,ud=!1,dd=!1,fd=!1,pd=0,md=0,hd=0,gd=0,_d=0,vd=0,yd=0,bd=null,xd=null,Sd=!1,Cd=0,wd=0,Td=1/0,Ed=null,Dd=null,Od=0,kd=null,Ad=null,jd=0,Md=0,Nd=null,Pd=null,Fd=null,Id=null,Ld=null,Rd=0,zd=null;function Bd(){return id&2&&sd!==0?sd&-sd:M.T===null?St():Wf()}function Vd(){if(vd===0){if(!(sd&536870912)||oa){var e=ot;ot<<=1,!(ot&3932160)&&(ot=262144),vd=e}else vd=536870912}return e=No.current,e!==null&&(e.flags|=32),vd}function Hd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Gp(yi(e.memoizedProps,n))),Id===null&&(Id=[]),Id.push(t.bind(null,r))}}function Ud(e,t,n){(e===ad&&(cd===2||cd===9)||e.cancelPendingCommit!==null)&&(Xd(e,0),qd(e,sd,vd,!1)),ht(e,n),(!(id&2)||e!==ad)&&(e===ad&&(!(id&2)&&(gd|=n),md===4&&qd(e,sd,vd,!1)),If(e))}function Wd(e,t,n){if(id&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ut(e,t),a=r?af(e,t):nf(e,t,!0),o=r;do{if(a===0){dd&&!r&&qd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Kd(n)){a=nf(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=bd;var l=c.current.memoizedState.isDehydrated;if(l&&(Xd(c,s).flags|=256),s=nf(c,s,!1),s!==2&&s!==6){if(fd&&!l){c.errorRecoveryDisabledLanes|=o,gd|=o,a=4;break a}o=xd,xd=a,o!==null&&(xd===null?xd=o:xd.push.apply(xd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Xd(e,0),qd(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:qd(r,t,vd,!ud);break a;case 2:xd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Cd+300-Ge(),10<a)){if(qd(r,t,vd,!ud),lt(r,0,!0)!==0)break a;jd=t,r.timeoutHandle=Dp(Gd.bind(null,r,n,xd,Ed,Sd,t,vd,gd,yd,ud,o,`Throttled`,-0,0),a);break a}Gd(r,n,xd,Ed,Sd,t,vd,gd,yd,ud,o,null,-0,0)}break}while(1);If(e)}function Gd(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:xn},Ul=null,Xu(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=ph.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?Cd-Ge():(a&4194048)===a?wd-Ge():0,m=dh(d,m),m!==null)){jd=a,e.cancelPendingCommit=m(ff.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),qd(e,a,o,!l);return}ff(e,t,a,n,r,i,o,s,c,l,u,d)}function Kd(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(!Ur(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 qd(e,t,n,r){t=dt(e,t),t&=~_d,t&=~gd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-nt(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&_t(e,n,t)}function Jd(){return id&6?!0:(Lf(0,!1),!1)}function Yd(){if(od!==null){if(cd===0)var e=od.return;else e=od,ya=va=null,ls(e),so=null,co=0,e=od;for(;e!==null;)Cl(e.alternate,e),e=e.return;od=null}}function Xd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Op(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),jd=0,Yd(),ad=e,od=n=Fi(e.current,null),sd=t,cd=0,ld=null,ud=!1,dd=ut(e,t),fd=!1,yd=vd=_d=gd=hd=md=0,xd=bd=null,Sd=!1,pd=dt(e,t),Ti(),n}function Zd(e,t){Go=null,M.H=_c,t===Za||t===$a?(t=ao(),cd=3):t===Qa?(t=ao(),cd=4):cd=t===Fc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ld=t,od===null&&(md=1,kc(e,Ui(t,e.current)))}function Qd(){var e=No.current;return e===null?!0:(sd&4194048)===sd?Po===null:(sd&62914560)===sd||sd&536870912?e===Po:!1}function $d(){var e=M.H;return M.H=_c,e===null?_c:e}function ef(){var e=M.A;return M.A=nd,e}function tf(){md=4,ud||(sd&4194048)!==sd&&No.current!==null||(dd=!0),!(hd&134217727)&&!(gd&134217727)||ad===null||qd(ad,sd,vd,!1)}function nf(e,t,n){var r=id;id|=2;var i=$d(),a=ef();(ad!==e||sd!==t)&&(Ed=null,Xd(e,t)),t=!1;var o=md;a:do try{if(cd!==0&&od!==null){var s=od,c=ld;switch(cd){case 8:Yd(),o=6;break a;case 3:case 2:case 9:case 6:No.current===null&&(t=!0);var l=cd;if(cd=0,ld=null,lf(e,s,c,l),n&&dd){o=0;break a}break;default:l=cd,cd=0,ld=null,lf(e,s,c,l)}}rf(),o=md;break}catch(t){Zd(e,t)}while(1);return t&&e.shellSuspendCounter++,ya=va=null,id=r,M.H=i,M.A=a,od===null&&(ad=null,sd=0,Ti()),o}function rf(){for(;od!==null;)sf(od)}function af(e,t){var n=id;id|=2;var r=$d(),a=ef();ad!==e||sd!==t?(Ed=null,Td=Ge()+500,Xd(e,t)):dd=ut(e,t);a:do try{if(cd!==0&&od!==null){t=od;var o=ld;b:switch(cd){case 1:cd=0,ld=null,lf(e,t,o,1);break;case 2:case 9:if(to(o)){cd=0,ld=null,cf(t);break}t=function(){cd!==2&&cd!==9||ad!==e||(cd=7),If(e)},o.then(t,t);break a;case 3:cd=7;break a;case 4:cd=5;break a;case 7:to(o)?(cd=0,ld=null,cf(t)):(cd=0,ld=null,lf(e,t,o,7));break;case 5:var s=null;switch(od.tag){case 26:s=od.memoizedState;case 5:case 27:var c=od;if(s?oh(s):c.stateNode.complete){cd=0,ld=null;var l=c.sibling;if(l!==null)od=l;else{var u=c.return;u===null?od=null:(od=u,uf(u))}break b}}cd=0,ld=null,lf(e,t,o,5);break;case 6:cd=0,ld=null,lf(e,t,o,6);break;case 8:Yd(),md=6;break a;default:throw Error(i(462))}}of();break}catch(t){Zd(e,t)}while(1);return ya=va=null,M.H=r,M.A=a,id=n,od===null?(ad=null,sd=0,Ti(),md):0}function of(){for(;od!==null&&!Ue();)sf(od)}function sf(e){var t=ml(e.alternate,e,pd);e.memoizedProps=e.pendingProps,t===null?uf(e):od=t}function cf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Jc(n,t,t.pendingProps,t.type,void 0,sd);break;case 11:t=Jc(n,t,t.pendingProps,t.type.render,t.ref,sd);break;case 5:ls(t);var r=t;r===ia&&(oa?(fa(r),r.tag===5&&r.stateNode!=null&&(aa=r.stateNode)):(fa(r),oa=!0));default:Cl(n,t),t=od=Ii(t,pd),t=ml(n,t,pd)}e.memoizedProps=e.pendingProps,t===null?uf(e):od=t}function lf(e,t,n,r){ya=va=null,ls(t),so=null,co=0;var i=t.return;try{if(Pc(e,i,t,n,sd)){md=1,kc(e,Ui(n,e.current)),od=null;return}}catch(t){if(i!==null)throw od=i,t;md=1,kc(e,Ui(n,e.current)),od=null;return}t.flags&32768?(oa||r===1?e=!0:dd||sd&536870912?e=!1:(ud=e=!0,(r===2||r===9||r===3||r===6)&&(r=No.current,r!==null&&r.tag===13&&(r.flags|=16384))),df(t,e)):uf(t)}function uf(e){var t=e;do{if(t.flags&32768){df(t,ud);return}e=t.return;var n=xl(t.alternate,t,pd);if(n!==null){od=n;return}if(t=t.sibling,t!==null){od=t;return}od=t=e}while(t!==null);md===0&&(md=5)}function df(e,t){do{var n=Sl(e.alternate,e);if(n!==null){n.flags&=32767,od=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){od=e;return}od=e=n}while(e!==null);md=6,od=null}function ff(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do bf();while(Od!==0);if(id&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===ad&&(od=ad=null,sd=0),Ad=t,kd=e,jd=n,Nd=a,Pd=r,pf(e,t,n,s,c,l,f)}}function pf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Md=s,s|=wi,gt(e,n,s,r,i,a),Id=null,(n&335544064)===n?(Ld=Ra(e),r=10262):(Ld=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,kf(Ye,function(){return xf(),null})):(e.callbackNode=null,e.callbackPriority=0),Hl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=M.T,M.T=null,i=N.p,N.p=2,a=id,id|=4;try{_u(e,t,n)}finally{id=a,N.p=i,M.T=r}}Od=1,Hl?Fd=Up(o,e.containerInfo,Ld,gf,_f,hf,vf,xf,mf,null,null):(gf(),_f(),vf())}function mf(e){if(Od!==0){var t=kd.onRecoverableError;t(e,{componentStack:null})}}function hf(){Od===3&&(Od=0,Ru(Ad,kd),Od=4)}function gf(){if(Od===1){Od=0;var e=kd,t=Ad,n=jd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=M.T,M.T=null;var i=N.p;N.p=2;var a=id;id|=4;try{mu=hu=!1,Pu(t,e,n),n=bp;var o=Yr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Jr(s.ownerDocument.documentElement,s)){if(c!==null&&Xr(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 _=qr(s,h),v=qr(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}}Dh=!!yp,bp=yp=null}finally{id=a,N.p=i,M.T=r}}e.current=t,Od=2}}function _f(){if(Od===2){Od=0;var e=kd,t=Ad,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=id;id|=4;try{yu(e,t.alternate,t)}finally{id=i,N.p=r,M.T=n}}Od=3}}function vf(){if(Od===4||Od===3){Od=0;var e=Fd;Fd=null,We();var t=kd,n=Ad,r=jd,i=Pd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Od=5:(Od=0,Ad=kd=null,yf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Dd=null),xt(r),n=n.stateNode,P&&typeof P.onCommitFiberRoot==`function`)try{P.onCommitFiberRoot(et,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=M.T,a=N.p,N.p=2,M.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{M.T=n,N.p=a}}if(i=Id,o=Ld,Ld=null,i!==null&&(Id=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);jd&3&&bf(),If(t),a=t.pendingLanes,r&261930&&a&42?t===zd?Rd++:(Rd=0,zd=t):(Rd=0,zd=null),Lf(0,!1)}}function yf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Fa(t)))}function bf(){return Fd!==null&&(Fd.skipTransition(),Fd=null),gf(),_f(),vf(),xf()}function xf(){if(Od!==5)return!1;var e=kd,t=Md;Md=0;var n=xt(jd),r=M.T,a=N.p;try{N.p=32>n?32:n,M.T=null,n=Nd,Nd=null;var o=kd,s=jd;if(Od=0,Ad=kd=null,jd=0,id&6)throw Error(i(331));var c=id;if(id|=4,$u(o.current),Gu(o,o.current,s,n),id=c,Lf(0,!1),P&&typeof P.onPostCommitFiberRoot==`function`)try{P.onPostCommitFiberRoot(et,o)}catch{}return!0}finally{N.p=a,M.T=r,yf(e,t)}}function Sf(e,t,n){t=Ui(n,t),t=jc(e.stateNode,t,2),e=bo(e,t,2),e!==null&&(ht(e,2),If(e))}function Cf(e,t,n){if(e.tag===3)Sf(e,e,n);else for(;t!==null;){if(t.tag===3){Sf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Dd===null||!Dd.has(r))){e=Ui(n,e),n=Mc(2),r=bo(t,n,2),r!==null&&(Nc(n,r,t,e),ht(r,2),If(r));break}}t=t.return}}function wf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new rd;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)||(fd=!0,i.add(n),e=Tf.bind(null,e,t,n),t.then(e,e))}function Tf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ad===e&&(sd&n)===n&&(md===4||md===3&&(sd&62914560)===sd&&300>Ge()-Cd?id&2?_d|=n:Xd(e,0):_d|=n,yd===sd&&(yd=0)),If(e)}function Ef(e,t){t===0&&(t=pt()),e=Oi(e,t),e!==null&&(ht(e,t),If(e))}function Df(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ef(e,n)}function Of(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),Ef(e,n)}function kf(e,t){return Ve(e,t)}var Af=null,jf=null,Mf=!1,Nf=!1,Pf=!1,Ff=0;function If(e){e!==jf&&e.next===null&&(jf===null?Af=jf=e:jf=jf.next=e),Nf=!0,Mf||(Mf=!0,Uf())}function Lf(e,t){if(!Pf&&Nf){Pf=!0;do for(var n=!1,r=Af;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-nt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Hf(r,a))}else a=sd,a=lt(r,r===ad?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ut(r,a)||(n=!0,Hf(r,a))}r=r.next}while(n);Pf=!1}}function Rf(){zf()}function zf(){Nf=Mf=!1;var e=0;Ff!==0&&H()&&(e=Ff);for(var t=Ge(),n=null,r=Af;r!==null;){var i=r.next,a=Bf(r,t);a===0?(r.next=null,n===null?Af=i:n.next=i,i===null&&(jf=n)):(n=r,(e!==0||a&3)&&(Nf=!0)),r=i}Od!==0&&Od!==5||Lf(e,!1),Ff!==0&&(Ff=0)}function Bf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-nt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ft(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=ad,n=sd,n=lt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(cd===2||cd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&He(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ut(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&He(r),xt(n)){case 2:case 8:n=Je;break;case 32:n=Ye;break;case 268435456:n=Ze;break;default:n=Ye}return r=Vf.bind(null,e),n=Ve(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&He(r),e.callbackPriority=2,e.callbackNode=null,2}function Vf(e,t){if(Od!==0&&Od!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(bf()&&e.callbackNode!==n)return null;var r=sd;return r=lt(e,e===ad?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Wd(e,r,t),Bf(e,Ge()),e.callbackNode!=null&&e.callbackNode===n?Vf.bind(null,e):null)}function Hf(e,t){if(bf())return null;Wd(e,t,!0)}function Uf(){jp(function(){id&6?Ve(qe,Rf):zf()})}function Wf(){if(Ff===0){var e=Va;e===0&&(e=at,at<<=1,!(at&261888)&&(at=256)),Ff=e}return Ff}function Gf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:I(e)}function Kf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Gf((i[Et]||null).action),o=r.submitter;o&&(t=(t=o[Et]||null)?Gf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Hn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Ff!==0){var e=new FormData(i,o);rc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),rc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var qf=0;qf<gi.length;qf++){var Jf=gi[qf];_i(Jf.toLowerCase(),`on`+(Jf[0].toUpperCase()+Jf.slice(1)))}_i(ci,`onAnimationEnd`),_i(li,`onAnimationIteration`),_i(ui,`onAnimationStart`),_i(`dblclick`,`onDoubleClick`),_i(`focusin`,`onFocus`),_i(`focusout`,`onBlur`),_i(di,`onTransitionRun`),_i(fi,`onTransitionStart`),_i(pi,`onTransitionCancel`),_i(mi,`onTransitionEnd`),Wt(`onMouseEnter`,[`mouseout`,`mouseover`]),Wt(`onMouseLeave`,[`mouseout`,`mouseover`]),Wt(`onPointerEnter`,[`pointerout`,`pointerover`]),Wt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ut(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ut(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ut(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ut(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ut(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ut(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Yf=`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(` `),Xf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Yf));function Zf(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){R(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){R(e)}i.currentTarget=null,a=c}}}}function Qf(e,t){var n=t[Ot];n===void 0&&(n=t[Ot]=new Set);var r=e+`__bubble`;n.has(r)||(np(t,e,2,!1),n.add(r))}function $f(e,t,n){var r=0;t&&(r|=4),np(n,e,r,t)}var ep=`_reactListening`+Math.random().toString(36).slice(2);function tp(e){if(!e[ep]){e[ep]=!0,Vt.forEach(function(t){t!==`selectionchange`&&(Xf.has(t)||$f(t,!1,e),$f(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ep]||(t[ep]=!0,$f(`selectionchange`,!1,t))}}function np(e,t,n,r){switch(Ph(t)){case 2:var i=Oh;break;case 8:i=kh;break;default:i=Ah}n=i.bind(null,t,n,e),i=void 0,!jn||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 rp(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=Ft(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}On(function(){var r=a,i=Cn(n),s=[];a:{var c=hi.get(e);if(c!==void 0){var l=Hn,u=e;switch(e){case`keypress`:if(Ln(n)===0)break a;case`keydown`:case`keyup`:l=or;break;case`focusin`:u=`focus`,l=Zn;break;case`focusout`:u=`blur`,l=Zn;break;case`beforeblur`:case`afterblur`:l=Zn;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=Yn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Xn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=lr;break;case ci:case li:case ui:l=Qn;break;case mi:l=ur;break;case`scroll`:case`scrollend`:l=Wn;break;case`wheel`:l=dr;break;case`copy`:case`cut`:case`paste`:l=$n;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=sr;break;case`submit`:l=cr;break;case`toggle`:case`beforetoggle`:l=fr}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=kn(m,p),g!=null&&d.push(ip(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!==Sn&&(u=n.relatedTarget||n.fromElement)&&(Ft(u)||u[Dt]))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?Ft(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=Yn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=sr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Lt(c),h=l==null?u:Lt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Ft(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,op):null,c!==null&&sp(s,u,c,d,!1),l!==null&&f!==null&&sp(s,f,l,d,!0)))}a:{if(c=r?Lt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Mr;else if(Er(c)){if(Nr)_=L;else{_=Br;var v=zr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&vn(r.elementType)&&(_=Mr):_=Vr;if(_&&=_(e,r)){Dr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Lt(r):window,e){case`focusin`:(Er(v)||v.contentEditable===`true`)&&(Qr=v,$r=r,ei=null);break;case`focusout`:ei=$r=Qr=null;break;case`mousedown`:ti=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ti=!1,ni(s,n,i);break;case`selectionchange`:if(Zr)break;case`keydown`:case`keyup`:ni(s,n,i)}var y;if(mr)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 Sr?br(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(_r&&n.locale!==`ko`&&(Sr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Sr&&(y=In()):(Nn=i,Pn=`value`in Nn?Nn.value:Nn.textContent,Sr=!0)),v=ap(r,b),0<v.length&&(b=new er(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=xr(n),y!==null&&(b.data=y)))),(y=gr?Cr(e,n):wr(e,n))&&(b=ap(r,`onBeforeInput`),0<b.length&&(v=new er(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Kf(s,e,r,n,i)}Zf(s,t)})}function ip(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ap(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=kn(e,n),i!=null&&r.unshift(ip(e,i,a)),i=kn(e,t),i!=null&&r.push(ip(e,i,a))),e.tag===3)return r;e=e.return}return[]}function op(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function sp(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=kn(n,a),l!=null&&o.unshift(ip(n,l,c))):i||(l=kn(n,a),l!=null&&o.push(ip(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var cp=/\r\n?/g,lp=/\u0000|\uFFFD/g;function up(e){return(typeof e==`string`?e:``+e).replace(cp,`
9
+ `).replace(lp,``)}function dp(e,t){return t=up(t),up(e)===t}function fp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&mn(e,``+r);else return;break;case`className`:Qt(e,`class`,r);break;case`tabIndex`:Qt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Qt(e,n,r);break;case`style`:_n(e,r,o);return;case`data`:if(t!==`object`){Qt(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=I(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`&&fp(e,t,`name`,a.name,a,null),fp(e,t,`formEncType`,a.formEncType,a,null),fp(e,t,`formMethod`,a.formMethod,a,null),fp(e,t,`formTarget`,a.formTarget,a,null)):(fp(e,t,`encType`,a.encType,a,null),fp(e,t,`method`,a.method,a,null),fp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=I(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=xn);return;case`onScroll`:r!=null&&Qf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Qf(`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=I(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`:Qf(`beforetoggle`,e),Qf(`toggle`,e),Zt(e,`popover`,r);break;case`xlinkActuate`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Zt(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=yn.get(n)||n,Zt(e,n,r);else return}Yt=!0}function pp(e,t,n,r,a,o){switch(n){case`style`:_n(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`)mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)mn(e,``+r);else return;break;case`onScroll`:r!=null&&Qf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Qf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=xn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Ht.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[Et]||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}Yt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Zt(e,n,r)}return}Yt=!0}function mp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Qf(`error`,e),Qf(`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:fp(e,t,o,s,n,null)}}a&&fp(e,t,`srcSet`,n.srcSet,n,null),r&&fp(e,t,`src`,n.src,n,null);return;case`input`:Qf(`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:fp(e,t,r,d,n,null)}}ln(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Qf(`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:fp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&dn(e,!!r,n,!0):dn(e,!!r,t,!1);return;case`textarea`:for(s in Qf(`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:fp(e,t,s,c,n,null)}pn(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:fp(e,t,l,r,n,null)}return;case`dialog`:Qf(`beforetoggle`,e),Qf(`toggle`,e),Qf(`cancel`,e),Qf(`close`,e);break;case`iframe`:case`object`:Qf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Yf.length;r++)Qf(Yf[r],e);break;case`image`:Qf(`error`,e),Qf(`load`,e);break;case`details`:Qf(`toggle`,e);break;case`embed`:case`source`:case`link`:Qf(`error`,e),Qf(`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:fp(e,t,u,r,n,null)}return;default:if(vn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&pp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&fp(e,t,c,r,n,null))}var hp={};function gp(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)||fp(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&&(Yt=!0),o=m;break;case`name`:m!==f&&(Yt=!0),a=m;break;case`checked`:m!==f&&(Yt=!0),u=m;break;case`defaultChecked`:m!==f&&(Yt=!0),d=m;break;case`value`:m!==f&&(Yt=!0),s=m;break;case`defaultValue`:m!==f&&(Yt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&fp(e,t,p,m,r,f)}}cn(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)||fp(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&&(Yt=!0),p=o;break;case`defaultValue`:o!==l&&(Yt=!0),c=o;break;case`multiple`:o!==l&&(Yt=!0),s=o;default:o!==l&&fp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?dn(e,!!n,n?[]:``,!1):dn(e,!!n,t,!0)):dn(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:fp(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&&(Yt=!0),p=a;break;case`defaultValue`:a!==o&&(Yt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&fp(e,t,s,a,r,o)}fn(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:fp(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&&(Yt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:fp(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)&&fp(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:fp(e,t,u,p,r,m)}return;default:if(vn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&pp(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||pp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&fp(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||fp(e,t,f,p,r,m)}function _p(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function vp(){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&&_p(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&&_p(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 yp=null,bp=null;function xp(e){return e.nodeType===9?e:e.ownerDocument}function Sp(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 Cp(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 wp(e,t,n,r){return n=xp(n).createElement(e),n[Tt]=r,n[Et]=t,mp(n,e,t),zt(n),n}function Tp(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 Ep=null;function H(){var e=window.event;return e&&e.type===`popstate`?e!==Ep&&(Ep=e,!0):(Ep=null,!1)}var Dp=typeof setTimeout==`function`?setTimeout:void 0,Op=typeof clearTimeout==`function`?clearTimeout:void 0,kp=typeof Promise==`function`?Promise:void 0,Ap=typeof requestAnimationFrame==`function`?requestAnimationFrame:Dp,jp=typeof queueMicrotask==`function`?queueMicrotask:kp===void 0?Dp:function(e){return kp.resolve(null).then(e).catch(Mp)};function Mp(e){setTimeout(function(){throw e})}function Np(e){return e===`head`}function Pp(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),$h(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Om(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Om(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Om(e.ownerDocument.body)}n=i}while(n);$h(t)}function Fp(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 Ip(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 Lp(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 Rp(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 zp(e){return Rp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Bp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Rp(t,n,e)}function Vp(e){return e.documentElement.clientHeight}function Hp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Up(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`&&(Vp(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+=sh(f),u>uh){s.length=o;break}f=new Promise(Hp.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 Wp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Wp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Wp.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},Wp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Gp(e){return{name:e,group:new Wp(`group`,e),imagePair:new Wp(`image-pair`,e),old:new Wp(`old`,e),new:new Wp(`new`,e)}}function Kp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Kp.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(Zp(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=Yp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,qp,e,s,r)}this._eventListeners=a}};function qp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Kp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Zp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Yp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Jp,e,n,i),r.splice(t,1),a!==null&&a()}};function Jp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Yp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Xp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Zp(e,t,n,r){if(e.length===0)return-1;r=Xp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Xp(a.optionsOrUseCapture)===r)return i}return-1}Kp.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,Yp(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,Yp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Kp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Qp,e,void 0,void 0)};function Qp(e,t){return e.tag!==6&&(e=b(e),wm(e,t))}Kp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,$p,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Qp(t[n],e);n--);};function $p(e,t){return t.push(e),!1}Kp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=xp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,em,e,void 0,void 0))};function em(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Kp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,tm,e,void 0,void 0)};function tm(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}Kp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,nm,e,void 0,void 0);for(var n=t=0;n<rm.length;n++){var r=rm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):rm[t++]=r}rm.length=t}};function nm(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var rm=[],im=!1;function am(e,t,n){rm.push({fragmentInstance:e,observer:t,instance:n}),im||(im=!0,Tm(function(){im=!1;var e=rm;rm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Kp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,om,e,void 0,void 0),e};function om(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}Kp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Kp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,$p,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||sm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function sm(e,t,n,r,i){var a=Ft(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function cm(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)}Kp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,$p,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),cm(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),cm(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function lm(e,t){return e=b(e),um(e,t),!1}function um(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function dm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Yp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<rm.length;i++){var a=rm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(rm[r++]=a)}rm.length=r,n.observe(e)}),um(e,t))}function fm(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,Yp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?am(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function pm(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`:pm(n),Pt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function mm(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[Mt])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=bm(e.nextSibling),e===null)break}return null}function hm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=bm(e.nextSibling),e===null))return null;return e}function gm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=bm(e.nextSibling),e===null))return null;return e}function _m(e){return e.data===`$?`||e.data===`$~`}function vm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function ym(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 bm(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 xm=null;function Sm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return bm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Cm(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 wm(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 Tm(e){Ap(function(){Ap(function(t){return e(t)})})}function Em(e,t,n){switch(t=xp(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 Dm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&fp(e,t,r,null,hp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===xn&&(e.onclick=null),Pt(e)}function Om(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Pt(e)}var km=new Map,Am=new Set;function jm(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 Mm=N.d;N.d={f:Nm,r:Pm,D:Lm,C:Rm,L:zm,m:Bm,X:Hm,S:Vm,M:Um};function Nm(){var e=Mm.f(),t=Jd();return e||t}function Pm(e){var t=It(e);t!==null&&t.tag===5&&t.type===`form`?ac(t):Mm.r(e)}var Fm=typeof document>`u`?null:document;function Im(e,t,n){var r=Fm;if(r&&typeof t==`string`&&t){var i=sn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Am.has(i)||(Am.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),mp(t,`link`,e),zt(t),r.head.appendChild(t)))}}function Lm(e){Mm.D(e),Im(`dns-prefetch`,e,null)}function Rm(e,t){Mm.C(e,t),Im(`preconnect`,e,t)}function zm(e,t,n){Mm.L(e,t,n);var r=Fm;if(r&&e&&t){var i=`link[rel="preload"][as="`+sn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+sn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+sn(n.imageSizes)+`"]`)):i+=`[href="`+sn(e)+`"]`;var a=i;switch(t){case`style`:a=Gm(e);break;case`script`:a=Ym(e)}if(!(km.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),km.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Km(a))||t===`script`&&r.querySelector(Xm(a))))){var o=r.createElement(`link`);mp(o,`link`,e),t===`style`&&(o[Nt]=!0,o.onload=o.onerror=function(){Bt(o)}),zt(o),r.head.appendChild(o)}}}function Bm(e,t){Mm.m(e,t);var n=Fm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+sn(r)+`"][href="`+sn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Ym(e)}if(!km.has(a)&&(e=D({rel:`modulepreload`,href:e},t),km.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Xm(a)))return}r=n.createElement(`link`),mp(r,`link`,e),zt(r),n.head.appendChild(r)}}}function Vm(e,t,n){Mm.S(e,t,n);var r=Fm;if(r&&e){var i=Rt(r).hoistableStyles,a=Gm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Km(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=km.get(a))&&$m(e,n);var c=o=r.createElement(`link`);zt(c),mp(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,Qm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Hm(e,t){Mm.X(e,t);var n=Fm;if(n&&e){var r=Rt(n).hoistableScripts,i=Ym(e),a=r.get(i);a||(a=n.querySelector(Xm(i)),a||(e=D({src:e,async:!0},t),(t=km.get(i))&&eh(e,t),a=n.createElement(`script`),zt(a),mp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Um(e,t){Mm.M(e,t);var n=Fm;if(n&&e){var r=Rt(n).hoistableScripts,i=Ym(e),a=r.get(i);a||(a=n.querySelector(Xm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=km.get(i))&&eh(e,t),a=n.createElement(`script`),zt(a),mp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Wm(e,t,n,r){var a=(a=De.current)?jm(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=Gm(n.href),t=Rt(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=Gm(n.href);var o=Rt(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(Km(e)))?o._p||(s.instance=o,s.state.loading=5):(o=km.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},km.set(e,o)),Jm(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=Ym(n),t=Rt(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 Gm(e){return`href="`+sn(e)+`"`}function Km(e){return`link[rel="stylesheet"][`+e+`]`}function qm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Jm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Nt]){r.loading=1;return}}else t=e.createElement(`link`),t[Nt]=!0,t.onload=t.onerror=Bt.bind(null,t),mp(t,`link`,n),zt(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 Ym(e){return`[src="`+sn(e)+`"]`}function Xm(e){return`script[async]`+e}function Zm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+sn(n.href)+`"]`);if(r)return t.instance=r,zt(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`),zt(r),mp(r,`style`,a),Qm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Gm(n.href);var o=e.querySelector(Km(a));if(o)return t.state.loading|=4,t.instance=o,zt(o),o;r=qm(n),(a=km.get(a))&&$m(r,a),o=(e.ownerDocument||e).createElement(`link`),zt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),mp(o,`link`,r),t.state.loading|=4,Qm(o,n.precedence,e),t.instance=o;case`script`:return o=Ym(n.src),(a=e.querySelector(Xm(o)))?(t.instance=a,zt(a),a):(r=n,(a=km.get(o))&&(r=D({},n),eh(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),zt(a),mp(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,Qm(r,n.precedence,e));return t.instance}function Qm(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 $m(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function eh(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var th=null;function nh(e,t,n){if(th===null){var r=new Map,i=th=new Map;i.set(n,r)}else i=th,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[Mt]||a[Tt]||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 rh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function ih(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 ah(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function oh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function sh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ch(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=sh(t),e.suspenseyImages.push(t)),e=mh.bind(e),t.decode().then(e,e))}function lh(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=Gm(r.href),a=t.querySelector(Km(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ph.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,zt(a);return}a=t.ownerDocument||t,r=qm(r),(i=km.get(i))&&$m(r,i),a=a.createElement(`link`),zt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),mp(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=ph.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var uh=0;function dh(e,t){return e.stylesheets&&e.count===0&&gh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&gh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&uh===0&&(uh=62500*vp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&gh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>uh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function fh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)gh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ph(){this.count--,fh(this)}function mh(){this.imgCount--,fh(this)}var hh=null;function gh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,hh=new Map,t.forEach(_h,e),hh=null,ph.call(e))}function _h(e,t){if(!(t.state.loading&4)){var n=hh.get(e);if(n)var r=n.get(null);else{n=new Map,hh.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=ph.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 vh={$$typeof:A,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function yh(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=mt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.hiddenUpdates=mt(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 bh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new yh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ni(3,null,null,t),e.current=a,a.stateNode=e,t=Pa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},_o(a),e}function xh(e){return e?(e=ji,e):ji}function Sh(e,t,n,r,i,a){i=xh(i),r.context===null?r.context=i:r.pendingContext=i,r=yo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=bo(e,r,t),n!==null&&(Ud(n,e,t),xo(n,e,t))}function Ch(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function wh(e,t){Ch(e,t),(e=e.alternate)&&Ch(e,t)}function Th(e){if(e.tag===13||e.tag===31){var t=Oi(e,67108864);t!==null&&Ud(t,e,67108864),wh(e,67108864)}}function Eh(e){if(e.tag===13||e.tag===31){var t=Bd();t=bt(t);var n=Oi(e,t);n!==null&&Ud(n,e,t),wh(e,t)}}var Dh=!0;function Oh(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,Ah(e,t,n,r)}finally{N.p=a,M.T=i}}function kh(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,Ah(e,t,n,r)}finally{N.p=a,M.T=i}}function Ah(e,t,n,r){if(Dh){var i=jh(r);if(i===null)rp(e,t,r,Mh,n),Uh(e,r);else if(Gh(i,e,t,n,r))r.stopPropagation();else if(Uh(e,r),t&4&&-1<Hh.indexOf(e)){for(;i!==null;){var a=It(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ct(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-nt(o);s.entanglements[1]|=c,o&=~c}If(a),!(id&6)&&(Td=Ge()+500,Lf(0,!1))}}break;case 31:case 13:s=Oi(a,2),s!==null&&Ud(s,a,2),Jd(),wh(a,2)}if(a=jh(r),a===null&&rp(e,t,r,Mh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else rp(e,t,r,null,n)}}function jh(e){return e=Cn(e),Nh(e)}var Mh=null;function Nh(e){if(Mh=null,e=Ft(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 Mh=e,null}function Ph(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(Ke()){case qe:return 2;case Je:return 8;case Ye:case Xe:return 32;case Ze:return 268435456;default:return 32}default:return 32}}var Fh=!1,Ih=null,Lh=null,Rh=null,zh=new Map,Bh=new Map,Vh=[],Hh=`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 Uh(e,t){switch(e){case`focusin`:case`focusout`:Ih=null;break;case`dragenter`:case`dragleave`:Lh=null;break;case`mouseover`:case`mouseout`:Rh=null;break;case`pointerover`:case`pointerout`:zh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Bh.delete(t.pointerId)}}function Wh(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=It(t),t!==null&&Th(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Gh(e,t,n,r,i){switch(t){case`focusin`:return Ih=Wh(Ih,e,t,n,r,i),!0;case`dragenter`:return Lh=Wh(Lh,e,t,n,r,i),!0;case`mouseover`:return Rh=Wh(Rh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return zh.set(a,Wh(zh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Bh.set(a,Wh(Bh.get(a)||null,e,t,n,r,i)),!0}return!1}function Kh(e){var t=Ft(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,Ct(e.priority,function(){Eh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Ct(e.priority,function(){Eh(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 qh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=jh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Sn=r,n.target.dispatchEvent(r),Sn=null}else return t=It(n),t!==null&&Th(t),e.blockedOn=n,!1;t.shift()}return!0}function Jh(e,t,n){qh(e)&&n.delete(t)}function Yh(){Fh=!1,Ih!==null&&qh(Ih)&&(Ih=null),Lh!==null&&qh(Lh)&&(Lh=null),Rh!==null&&qh(Rh)&&(Rh=null),zh.forEach(Jh),Bh.forEach(Jh)}function Xh(e,n){e.blockedOn===n&&(e.blockedOn=null,Fh||(Fh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Yh)))}var Zh=null;function Qh(e){Zh!==e&&(Zh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Zh===e&&(Zh=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(Nh(r||n)===null)continue;break}var a=It(n);a!==null&&(e.splice(t,3),t-=3,rc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function $h(e){function t(t){return Xh(t,e)}Ih!==null&&Xh(Ih,e),Lh!==null&&Xh(Lh,e),Rh!==null&&Xh(Rh,e),zh.forEach(t),Bh.forEach(t);for(var n=0;n<Vh.length;n++){var r=Vh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Vh.length&&(n=Vh[0],n.blockedOn===null);)Kh(n),n.blockedOn===null&&Vh.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[Et]||null;if(typeof a==`function`)o||Qh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Et]||null)s=o.formAction;else if(Nh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Qh(n)}}}function eg(){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 tg(e){this._internalRoot=e}ng.prototype.render=tg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;Sh(n,Bd(),e,t,null,null)},ng.prototype.unmount=tg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Sh(e.current,2,null,e,null,null),Jd(),t[Dt]=null}};function ng(e){this._internalRoot=e}ng.prototype.unstable_scheduleHydration=function(e){if(e){var t=St();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Vh.length&&t!==0&&t<Vh[n].priority;n++);Vh.splice(n,0,e),n===0&&Kh(e)}};var rg=n.version;if(rg!==`19.3.0`)throw Error(i(527,rg,`19.3.0`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var ig={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var ag=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ag.isDisabled&&ag.supportsFiber)try{et=ag.inject(ig),P=ag}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ec,s=Dc,c=Oc;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=bh(e,1,!1,null,null,n,r,null,o,s,c,eg),e[Dt]=t.current,tp(e),new tg(t)}})),g=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),v=o(((e,t)=>{t.exports=_()}));function y(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var b=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,x=y(function(e){return b.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91});function S(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function C(e){var t=document.createElement(`style`);return t.setAttribute(`data-emotion`,e.key),e.nonce!==void 0&&t.setAttribute(`nonce`,e.nonce),t.appendChild(document.createTextNode(``)),t.setAttribute(`data-s`,``),t}var w=function(){function e(e){var t=this;this._insertTag=function(e){var n=t.tags.length===0?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling;t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=e.speedy===void 0||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(C(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=S(t);try{n.insertRule(e,n.cssRules.length)}catch{}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){return e.parentNode?.removeChild(e)}),this.tags=[],this.ctr=0},e}(),T=`-ms-`,E=`-moz-`,D=`-webkit-`,ee=`comm`,O=`rule`,k=`decl`,te=`@import`,ne=`@keyframes`,re=`@layer`,ie=Math.abs,A=String.fromCharCode,ae=Object.assign;function oe(e,t){return ue(e,0)^45?(((t<<2^ue(e,0))<<2^ue(e,1))<<2^ue(e,2))<<2^ue(e,3):0}function se(e){return e.trim()}function ce(e,t){return(e=t.exec(e))?e[0]:e}function j(e,t,n){return e.replace(t,n)}function le(e,t){return e.indexOf(t)}function ue(e,t){return e.charCodeAt(t)|0}function de(e,t,n){return e.slice(t,n)}function fe(e){return e.length}function pe(e){return e.length}function me(e,t){return t.push(e),e}function he(e,t){return e.map(t).join(``)}var ge=1,_e=1,ve=0,M=0,N=0,ye=``;function be(e,t,n,r,i,a,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:ge,column:_e,length:o,return:``}}function xe(e,t){return ae(be(``,null,null,``,null,null,0),e,{length:-e.length},t)}function Se(){return N}function Ce(){return N=M>0?ue(ye,--M):0,_e--,N===10&&(_e=1,ge--),N}function we(){return N=M<ve?ue(ye,M++):0,_e++,N===10&&(_e=1,ge++),N}function Te(){return ue(ye,M)}function Ee(){return M}function De(e,t){return de(ye,e,t)}function Oe(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function ke(e){return ge=_e=1,ve=fe(ye=e),M=0,[]}function Ae(e){return ye=``,e}function je(e){return se(De(M-1,Pe(e===91?e+2:e===40?e+1:e)))}function Me(e){for(;(N=Te())&&N<33;)we();return Oe(e)>2||Oe(N)>3?``:` `}function Ne(e,t){for(;--t&&we()&&!(N<48||N>102||N>57&&N<65||N>70&&N<97););return De(e,Ee()+(t<6&&Te()==32&&we()==32))}function Pe(e){for(;we();)switch(N){case e:return M;case 34:case 39:e!==34&&e!==39&&Pe(N);break;case 40:e===41&&Pe(e);break;case 92:we()}return M}function Fe(e,t){for(;we()&&e+N!==57&&(e+N!==84||Te()!==47););return`/*`+De(t,M-1)+`*`+A(e===47?e:we())}function Ie(e){for(;!Oe(Te());)we();return De(e,M)}function Le(e){return Ae(Re(``,null,null,null,[``],e=ke(e),0,[0],e))}function Re(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=``,b=i,x=a,S=r,C=y;g;)switch(m=v,v=we()){case 40:if(m!=108&&ue(C,d-1)==58){le(C+=j(je(v),`&`,`&\f`),`&\f`)!=-1&&(_=-1);break}case 34:case 39:case 91:C+=je(v);break;case 9:case 10:case 13:case 32:C+=Me(m);break;case 92:C+=Ne(Ee()-1,7);continue;case 47:switch(Te()){case 42:case 47:me(Be(Fe(we(),Ee()),t,n),c);break;default:C+=`/`}break;case 123*h:s[l++]=fe(C)*_;case 125*h:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:_==-1&&(C=j(C,/\f/g,``)),p>0&&fe(C)-d&&me(p>32?Ve(C+`;`,r,n,d-1):Ve(j(C,` `,``)+`;`,r,n,d-2),c);break;case 59:C+=`;`;default:if(me(S=ze(C,t,n,l,u,i,s,y,b=[],x=[],d),a),v===123){if(u===0)Re(C,t,S,S,b,a,d,s,x);else switch(f===99&&ue(C,3)===110?100:f){case 100:case 108:case 109:case 115:Re(e,S,S,r&&me(ze(e,S,S,0,0,i,s,y,i,b=[],d),x),i,x,d,s,r?b:x);break;default:Re(C,S,S,S,[``],x,0,s,x)}}}l=u=p=0,h=_=1,y=C=``,d=o;break;case 58:d=1+fe(C),p=m;default:if(h<1){if(v==123)--h;else if(v==125&&h++==0&&Ce()==125)continue}switch(C+=A(v),v*h){case 38:_=u>0?1:(C+=`\f`,-1);break;case 44:s[l++]=(fe(C)-1)*_,_=1;break;case 64:Te()===45&&(C+=je(we())),f=Te(),u=d=fe(y=C+=Ie(Ee())),v++;break;case 45:m===45&&fe(C)==2&&(h=0)}}return a}function ze(e,t,n,r,i,a,o,s,c,l,u){for(var d=i-1,f=i===0?a:[``],p=pe(f),m=0,h=0,g=0;m<r;++m)for(var _=0,v=de(e,d+1,d=ie(h=o[m])),y=e;_<p;++_)(y=se(h>0?f[_]+` `+v:j(v,/&\f/g,f[_])))&&(c[g++]=y);return be(e,t,n,i===0?O:s,c,l,u)}function Be(e,t,n){return be(e,t,n,ee,A(Se()),de(e,2,-2),0)}function Ve(e,t,n,r){return be(e,t,n,k,de(e,0,r),de(e,r+1,-1),r)}function He(e,t){for(var n=``,r=pe(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||``;return n}function Ue(e,t,n,r){switch(e.type){case re:if(e.children.length)break;case te:case k:return e.return=e.return||e.value;case ee:return``;case ne:return e.return=e.value+`{`+He(e.children,r)+`}`;case O:e.value=e.props.join(`,`)}return fe(n=He(e.children,r))?e.return=e.value+`{`+n+`}`:``}function We(e){var t=pe(e);return function(n,r,i,a){for(var o=``,s=0;s<t;s++)o+=e[s](n,r,i,a)||``;return o}}function Ge(e){return function(t){t.root||(t=t.return)&&e(t)}}var Ke=function(e,t,n){for(var r=0,i=0;r=i,i=Te(),r===38&&i===12&&(t[n]=1),!Oe(i);)we();return De(e,M)},qe=function(e,t){var n=-1,r=44;do switch(Oe(r)){case 0:r===38&&Te()===12&&(t[n]=1),e[n]+=Ke(M-1,t,n);break;case 2:e[n]+=je(r);break;case 4:if(r===44){e[++n]=Te()===58?`&\f`:``,t[n]=e[n].length;break}default:e[n]+=A(r)}while(r=we());return e},Je=function(e,t){return Ae(qe(ke(e),t))},Ye=new WeakMap,Xe=function(e){if(!(e.type!==`rule`||!e.parent||e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;n.type!==`rule`;)if(n=n.parent,!n)return;if((e.props.length!==1||t.charCodeAt(0)===58||Ye.get(n))&&!r){Ye.set(e,!0);for(var i=[],a=Je(t,i),o=n.props,s=0,c=0;s<a.length;s++)for(var l=0;l<o.length;l++,c++)e.props[c]=i[s]?a[s].replace(/&\f/g,o[l]):o[l]+` `+a[s]}}},Ze=function(e){if(e.type===`decl`){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return=``,e.value=``)}};function Qe(e,t){switch(oe(e,t)){case 5103:return D+`print-`+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return D+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return D+e+E+e+T+e+e;case 6828:case 4268:return D+e+T+e+e;case 6165:return D+e+T+`flex-`+e+e;case 5187:return D+e+j(e,/(\w+).+(:[^]+)/,D+`box-$1$2`+T+`flex-$1$2`)+e;case 5443:return D+e+T+`flex-item-`+j(e,/flex-|-self/,``)+e;case 4675:return D+e+T+`flex-line-pack`+j(e,/align-content|flex-|-self/,``)+e;case 5548:return D+e+T+j(e,`shrink`,`negative`)+e;case 5292:return D+e+T+j(e,`basis`,`preferred-size`)+e;case 6060:return D+`box-`+j(e,`-grow`,``)+D+e+T+j(e,`grow`,`positive`)+e;case 4554:return D+j(e,/([^-])(transform)/g,`$1`+D+`$2`)+e;case 6187:return j(j(j(e,/(zoom-|grab)/,D+`$1`),/(image-set)/,D+`$1`),e,``)+e;case 5495:case 3959:return j(e,/(image-set\([^]*)/,D+"$1$`$1");case 4968:return j(j(e,/(.+:)(flex-)?(.*)/,D+`box-pack:$3`+T+`flex-pack:$3`),/s.+-b[^;]+/,`justify`)+D+e+e;case 4095:case 3583:case 4068:case 2532:return j(e,/(.+)-inline(.+)/,D+`$1$2`)+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(fe(e)-1-t>6)switch(ue(e,t+1)){case 109:if(ue(e,t+4)!==45)break;case 102:return j(e,/(.+:)(.+)-([^]+)/,`$1`+D+`$2-$3$1`+E+(ue(e,t+3)==108?`$3`:`$2-$3`))+e;case 115:return~le(e,`stretch`)?Qe(j(e,`stretch`,`fill-available`),t)+e:e}break;case 4949:if(ue(e,t+1)!==115)break;case 6444:switch(ue(e,fe(e)-3-(~le(e,`!important`)&&10))){case 107:return j(e,`:`,`:`+D)+e;case 101:return j(e,/(.+:)([^;!]+)(;|!.+)?/,`$1`+D+(ue(e,14)===45?`inline-`:``)+`box$3$1`+D+`$2$3$1`+T+`$2box$3`)+e}break;case 5936:switch(ue(e,t+11)){case 114:return D+e+T+j(e,/[svh]\w+-[tblr]{2}/,`tb`)+e;case 108:return D+e+T+j(e,/[svh]\w+-[tblr]{2}/,`tb-rl`)+e;case 45:return D+e+T+j(e,/[svh]\w+-[tblr]{2}/,`lr`)+e}return D+e+T+e+e}return e}var $e=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case k:e.return=Qe(e.value,e.length);break;case ne:return He([xe(e,{value:j(e.value,`@`,`@`+D)})],r);case O:if(e.length)return he(e.props,function(t){switch(ce(t,/(::plac\w+|:read-\w+)/)){case`:read-only`:case`:read-write`:return He([xe(e,{props:[j(t,/:(read-\w+)/,`:`+E+`$1`)]})],r);case`::placeholder`:return He([xe(e,{props:[j(t,/:(plac\w+)/,`:`+D+`input-$1`)]}),xe(e,{props:[j(t,/:(plac\w+)/,`:`+E+`$1`)]}),xe(e,{props:[j(t,/:(plac\w+)/,T+`input-$1`)]})],r)}return``})}}],et=function(e){var t=e.key;if(t===`css`){var n=document.querySelectorAll(`style[data-emotion]:not([data-s])`);Array.prototype.forEach.call(n,function(e){e.getAttribute(`data-emotion`).indexOf(` `)!==-1&&(document.head.appendChild(e),e.setAttribute(`data-s`,``))})}var r=e.stylisPlugins||$e,i={},a,o=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll(`style[data-emotion^="`+t+` "]`),function(e){for(var t=e.getAttribute(`data-emotion`).split(` `),n=1;n<t.length;n++)i[t[n]]=!0;o.push(e)});var s,c=[Xe,Ze],l,u=[Ue,Ge(function(e){l.insert(e)})],d=We(c.concat(r,u)),f=function(e){return He(Le(e),d)};s=function(e,t,n,r){l=n,f(e?e+`{`+t.styles+`}`:t.styles),r&&(p.inserted[t.name]=!0)};var p={key:t,sheet:new w({key:t,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:s};return p.sheet.hydrate(o),p},P=c(u()),tt=m(),nt=c(g()),F=v();function rt(){return rt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rt.apply(null,arguments)}var it=o((e=>{var t=typeof Symbol==`function`&&Symbol.for,n=t?Symbol.for(`react.element`):60103,r=t?Symbol.for(`react.portal`):60106,i=t?Symbol.for(`react.fragment`):60107,a=t?Symbol.for(`react.strict_mode`):60108,o=t?Symbol.for(`react.profiler`):60114,s=t?Symbol.for(`react.provider`):60109,c=t?Symbol.for(`react.context`):60110,l=t?Symbol.for(`react.async_mode`):60111,u=t?Symbol.for(`react.concurrent_mode`):60111,d=t?Symbol.for(`react.forward_ref`):60112,f=t?Symbol.for(`react.suspense`):60113,p=t?Symbol.for(`react.suspense_list`):60120,m=t?Symbol.for(`react.memo`):60115,h=t?Symbol.for(`react.lazy`):60116,g=t?Symbol.for(`react.block`):60121,_=t?Symbol.for(`react.fundamental`):60117,v=t?Symbol.for(`react.responder`):60118,y=t?Symbol.for(`react.scope`):60119;function b(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:switch(e=e.type,e){case l:case u:case i:case o:case a:case f:return e;default:switch(e&&=e.$$typeof,e){case c:case d:case h:case m:case s:return e;default:return t}}case r:return t}}}function x(e){return b(e)===u}e.AsyncMode=l,e.ConcurrentMode=u,e.ContextConsumer=c,e.ContextProvider=s,e.Element=n,e.ForwardRef=d,e.Fragment=i,e.Lazy=h,e.Memo=m,e.Portal=r,e.Profiler=o,e.StrictMode=a,e.Suspense=f,e.isAsyncMode=function(e){return x(e)||b(e)===l},e.isConcurrentMode=x,e.isContextConsumer=function(e){return b(e)===c},e.isContextProvider=function(e){return b(e)===s},e.isElement=function(e){return typeof e==`object`&&!!e&&e.$$typeof===n},e.isForwardRef=function(e){return b(e)===d},e.isFragment=function(e){return b(e)===i},e.isLazy=function(e){return b(e)===h},e.isMemo=function(e){return b(e)===m},e.isPortal=function(e){return b(e)===r},e.isProfiler=function(e){return b(e)===o},e.isStrictMode=function(e){return b(e)===a},e.isSuspense=function(e){return b(e)===f},e.isValidElementType=function(e){return typeof e==`string`||typeof e==`function`||e===i||e===u||e===o||e===a||e===f||e===p||typeof e==`object`&&!!e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===_||e.$$typeof===v||e.$$typeof===y||e.$$typeof===g)},e.typeOf=b})),at=o(((e,t)=>{t.exports=it()})),ot=o(((e,t)=>{var n=at(),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[n.ForwardRef]=a,s[n.Memo]=o;function c(e){return n.isMemo(e)?o:s[e.$$typeof]||r}var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;function h(e,t,n){if(typeof t!=`string`){if(m){var r=p(t);r&&r!==m&&h(e,r,n)}var a=u(t);d&&(a=a.concat(d(t)));for(var o=c(e),s=c(t),g=0;g<a.length;++g){var _=a[g];if(!i[_]&&!(n&&n[_])&&!(s&&s[_])&&!(o&&o[_])){var v=f(t,_);try{l(e,_,v)}catch{}}}}return e}t.exports=h}));function st(e,t,n){var r=``;return n.split(` `).forEach(function(n){e[n]===void 0?n&&(r+=n+` `):t.push(e[n]+`;`)}),r}var ct=function(e,t,n){var r=e.key+`-`+t.name;n===!1&&e.registered[r]===void 0&&(e.registered[r]=t.styles)},lt=function(e,t,n){ct(e,t,n);var r=e.key+`-`+t.name;if(e.inserted[t.name]===void 0){var i=t;do e.insert(t===i?`.`+r:``,i,e.sheet,!0),i=i.next;while(i!==void 0)}};function ut(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var dt={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ft=/[A-Z]|^ms/g,pt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,mt=function(e){return e.charCodeAt(1)===45},ht=function(e){return e!=null&&typeof e!=`boolean`},gt=y(function(e){return mt(e)?e:e.replace(ft,`-$&`).toLowerCase()}),_t=function(e,t){switch(e){case`animation`:case`animationName`:if(typeof t==`string`)return t.replace(pt,function(e,t,n){return xt={name:t,styles:n,next:xt},t})}return dt[e]!==1&&!mt(e)&&typeof t==`number`&&t!==0?t+`px`:t};function vt(e,t,n){if(n==null)return``;var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case`boolean`:return``;case`object`:var i=n;if(i.anim===1)return xt={name:i.name,styles:i.styles,next:xt},i.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)xt={name:o.name,styles:o.styles,next:xt},o=o.next;return a.styles+`;`}return yt(e,t,n);case`function`:if(e!==void 0){var s=xt,c=n(e);return xt=s,vt(e,t,c)}}var l=n;if(t==null)return l;var u=t[l];return u===void 0?l:u}function yt(e,t,n){var r=``;if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=vt(e,t,n[i])+`;`;else for(var a in n){var o=n[a];if(typeof o!=`object`){var s=o;t!=null&&t[s]!==void 0?r+=a+`{`+t[s]+`}`:ht(s)&&(r+=gt(a)+`:`+_t(a,s)+`;`)}else if(Array.isArray(o)&&typeof o[0]==`string`&&(t==null||t[o[0]]===void 0))for(var c=0;c<o.length;c++)ht(o[c])&&(r+=gt(a)+`:`+_t(a,o[c])+`;`);else{var l=vt(e,t,o);switch(a){case`animation`:case`animationName`:r+=gt(a)+`:`+l+`;`;break;default:r+=a+`{`+l+`}`}}}return r}var bt=/label:\s*([^\s;{]+)\s*(;|$)/g,xt;function St(e,t,n){if(e.length===1&&typeof e[0]==`object`&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i=``;xt=void 0;var a=e[0];a==null||a.raw===void 0?(r=!1,i+=vt(n,t,a)):i+=a[0];for(var o=1;o<e.length;o++)i+=vt(n,t,e[o]),r&&(i+=a[o]);bt.lastIndex=0;for(var s=``,c;(c=bt.exec(i))!==null;)s+=`-`+c[1];return{name:ut(i)+s,styles:i,next:xt}}var Ct=function(e){return e()},wt=P.useInsertionEffect?P.useInsertionEffect:!1,Tt=wt||Ct,Et=wt||P.useLayoutEffect,Dt=P.createContext(typeof HTMLElement<`u`?et({key:`css`}):null);Dt.Provider;var Ot=function(e){return(0,P.forwardRef)(function(t,n){return e(t,(0,P.useContext)(Dt),n)})},kt=P.createContext({}),At={}.hasOwnProperty,jt=`__EMOTION_TYPE_PLEASE_DO_NOT_USE__`,Mt=function(e,t){var n={};for(var r in t)At.call(t,r)&&(n[r]=t[r]);return n[jt]=e,n},Nt=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return ct(t,n,r),Tt(function(){return lt(t,n,r)}),null},Pt=Ot(function(e,t,n){var r=e.css;typeof r==`string`&&t.registered[r]!==void 0&&(r=t.registered[r]);var i=e[jt],a=[r],o=``;typeof e.className==`string`?o=st(t.registered,a,e.className):e.className!=null&&(o=e.className+` `);var s=St(a,void 0,P.useContext(kt));o+=t.key+`-`+s.name;var c={};for(var l in e)At.call(e,l)&&l!==`css`&&l!==jt&&(c[l]=e[l]);return c.className=o,n&&(c.ref=n),P.createElement(P.Fragment,null,P.createElement(Nt,{cache:t,serialized:s,isStringTag:typeof i==`string`}),P.createElement(i,c))});ot();var Ft=function(e,t){var n=arguments;if(t==null||!At.call(t,`css`))return P.createElement.apply(void 0,n);var r=n.length,i=Array(r);i[0]=Pt,i[1]=Mt(e,t);for(var a=2;a<r;a++)i[a]=n[a];return P.createElement.apply(null,i)};(function(e){var t;t||=e.JSX||={}})(Ft||={});var It=Ot(function(e,t){var n=e.styles,r=St([n],void 0,P.useContext(kt)),i=P.useRef();return Et(function(){var e=t.key+`-global`,n=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),a=!1,o=document.querySelector(`style[data-emotion="`+e+` `+r.name+`"]`);return t.sheet.tags.length&&(n.before=t.sheet.tags[0]),o!==null&&(a=!0,o.setAttribute(`data-emotion`,e),n.hydrate([o])),i.current=[n,a],function(){n.flush()}},[t]),Et(function(){var e=i.current,n=e[0];if(e[1]){e[1]=!1;return}r.next!==void 0&&lt(t,r.next,!0),n.tags.length&&(n.before=n.tags[n.tags.length-1].nextElementSibling,n.flush()),t.insert(``,r,n,!1)},[t,r.name]),null});function Lt(...e){return function(...t){e.forEach(e=>e?.(...t))}}var Rt=(...e)=>e.map(e=>e?.trim?.()).filter(Boolean).join(` `),zt=/^on[A-Z]/;function Bt(...e){let t={};for(let n of e){for(let e in t){if(zt.test(e)&&typeof t[e]==`function`&&typeof n[e]==`function`){t[e]=Lt(t[e],n[e]);continue}if(e===`className`||e===`class`){t[e]=Rt(t[e],n[e]);continue}if(e===`style`){t[e]=Object.assign({},t[e]??{},n[e]??{});continue}t[e]=n[e]===void 0?t[e]:n[e]}for(let e in n)t[e]===void 0&&(t[e]=n[e])}return t}var Vt=parseInt(`19.3.0`.split(`.`)[0],10)>=19;function Ht(e,t){if(e!=null){if(typeof e==`function`)return e(t);try{e.current=t}catch{throw Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Ut(...e){let t=e.filter(e=>e!=null);if(Vt){let e=new Map;return n=>(t.forEach(t=>{let r=Ht(t,n);r&&e.set(t,r)}),()=>{t.forEach(t=>{let n=e.get(t);n&&typeof n==`function`?n():Ht(t,null)}),e.clear()})}return e=>{t.forEach(t=>{Ht(t,e)})}}function Wt(e){let t=Object.assign({},e);for(let e in t)t[e]===void 0&&delete t[e];return t}var Gt=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Kt=e=>typeof e==`string`,qt=e=>typeof e==`function`,Jt=(...e)=>{let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(!Kt(r))continue;let i=r.trim();i&&t.push(i)}return t.join(` `)};function Yt(e){return e.default||e}function Xt(e){let t=`19.3.0`;return!Kt(t)||t.startsWith(`18.`)?e?.ref:e?.props?.ref}var Zt=(...e)=>{let t=e.reduce((e,t)=>(t?.forEach(t=>e.add(t)),e),new Set([]));return Array.from(t)};function Qt(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function $t(e={}){let{name:t,strict:n=!0,hookName:r=`useContext`,providerName:i=`Provider`,errorMessage:a,defaultValue:o}=e,s=(0,P.createContext)(o);s.displayName=t;function c(){let e=(0,P.useContext)(s);if(!e&&n){let e=Error(a??Qt(r,i));throw e.name=`ContextError`,Error.captureStackTrace?.(e,c),e}return e}return[s.Provider,c,s]}var[en,tn]=$t({name:`ChakraContext`,strict:!0,providerName:`<ChakraProvider />`});function nn(e){let{value:t,children:n}=e;return(0,F.jsxs)(en,{value:t,children:[!t._config.disableLayers&&(0,F.jsx)(It,{styles:t.layers.atRule}),(0,F.jsx)(It,{styles:t._global}),n]})}var rn=(e,t)=>{let n={},r={},i=Object.keys(e);for(let a of i)t(a)?r[a]=e[a]:n[a]=e[a];return[r,n]},an=(e,t)=>rn(e,qt(t)?t:e=>t.includes(e)),on=new Set([`htmlWidth`,`htmlHeight`,`htmlSize`,`htmlTranslate`]);function sn(e){return typeof e==`string`&&on.has(e)}function cn(e,t,n){let{css:r,isValidProperty:i}=tn(),{children:a,...o}=e,s=(0,P.useMemo)(()=>{let[e,r]=an(o,e=>n(e,t.variantKeys)),[a,s]=an(r,t.variantKeys),[c,l]=an(s,i);return{forwardedProps:e,variantProps:a,styleProps:c,elementProps:l}},[t.variantKeys,n,o,i]),{css:c,...l}=s.styleProps,u=(0,P.useMemo)(()=>{let e={...s.variantProps},n=t.variantKeys.includes(`colorPalette`),r=t.variantKeys.includes(`orientation`);return n||(e.colorPalette=o.colorPalette),r||(e.orientation=o.orientation),t(e)},[t,s.variantProps,o.colorPalette,o.orientation]);return{styles:(0,P.useMemo)(()=>r(u,...ln(c),l),[r,u,c,l]),props:{...s.forwardedProps,...s.elementProps,children:a}}}var ln=e=>(Array.isArray(e)?e:[e]).filter(Boolean).flat(),un=Yt(x),dn=e=>e!==`theme`,fn=(e,t,n)=>{let r;if(t){let n=t.shouldForwardProp;r=e.__emotion_forwardProp&&n?t=>e.__emotion_forwardProp(t)&&n(t):n}return typeof r!=`function`&&n&&(r=e.__emotion_forwardProp),r},pn=typeof document<`u`,mn=({cache:e,serialized:t,isStringTag:n})=>{ct(e,t,n);let r=Tt(()=>lt(e,t,n));if(!pn&&r!==void 0){let n=t.name,i=t.next;for(;i!==void 0;)n=Jt(n,i.name),i=i.next;return(0,F.jsx)(`style`,{"data-emotion":Jt(e.key,n),dangerouslySetInnerHTML:{__html:r},nonce:e.sheet.nonce})}return null},hn={path:[`d`],text:[`x`,`y`],circle:[`cx`,`cy`,`r`],rect:[`width`,`height`,`x`,`y`,`rx`,`ry`],ellipse:[`cx`,`cy`,`rx`,`ry`],g:[`transform`],stop:[`offset`,`stopOpacity`]},gn=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),_n=((e,t={},n={})=>{if(gn(hn,e)){n.forwardProps||=[];let t=hn[e];n.forwardProps=Zt([...n.forwardProps,...t])}let r=e.__emotion_real===e,i=r&&e.__emotion_base||e,a,o;n!==void 0&&(a=n.label,o=n.target);let s=[],c=Ot((a,c,l)=>{let{cva:u,isValidProperty:d}=tn(),f=t.__cva__?t:u(t),p=bn(e.__emotion_cva&&!e.__emotion_cva.__cva__?u(e.__emotion_cva):e.__emotion_cva,f);!n.shouldForwardProp&&n.forwardProps&&(n.shouldForwardProp=(e=>(t,n)=>e.includes(t)?!0:!n?.includes(t)&&!d(t))(n.forwardProps));let m=fn(e,n,r)||((t,n)=>{let r=typeof e==`string`&&e.charCodeAt(0)>96?un:dn,i=!n?.includes(t)&&!d(t);return r(t)&&i}),{props:h,styles:g}=cn(P.useMemo(()=>Object.assign({},n.defaultProps,Wt(a)),[a]),p,m),_=``,v=[g],y=h;if(h.theme==null){y={};for(let e in h)y[e]=h[e];y.theme=P.useContext(kt)}typeof h.className==`string`?_=st(c.registered,v,h.className):h.className!=null&&(_=Jt(_,h.className));let b=St(s.concat(v),c.registered,y);b.styles&&(_=Jt(_,`${c.key}-${b.name}`)),o!==void 0&&(_=Jt(_,o));let x=!m(`as`),S=x&&h.as||i,C={};for(let e in h)if(!(x&&e===`as`)){if(sn(e)){let t=e.replace(`html`,``).toLowerCase();C[t]=h[e];continue}m(e)&&(C[e]=h[e])}let w=_.trim();w?C.className=w:Reflect.deleteProperty(C,`className`),C.ref=l;let T=n.forwardAsChild||n.forwardProps?.includes(`asChild`);if(h.asChild&&!T){let e=P.isValidElement(h.children)?P.Children.only(h.children):P.Children.toArray(h.children).find(P.isValidElement);if(!e)throw Error(`[chakra-ui > factory] No valid child found`);S=e.type,C.children=null,Reflect.deleteProperty(C,`asChild`),C=Bt(C,e.props),C.ref=Ut(l,Xt(e))}return C.as&&T?(C.as=void 0,(0,F.jsxs)(P.Fragment,{children:[(0,F.jsx)(mn,{cache:c,serialized:b,isStringTag:typeof S==`string`}),(0,F.jsx)(S,{asChild:!0,...C,children:(0,F.jsx)(h.as,{children:C.children})})]})):(0,F.jsxs)(P.Fragment,{children:[(0,F.jsx)(mn,{cache:c,serialized:b,isStringTag:typeof S==`string`}),(0,F.jsx)(S,{...C})]})});return c.displayName=a===void 0?`chakra(${typeof i==`string`?i:i.displayName||i.name||`Component`})`:a,c.__emotion_real=c,c.__emotion_base=i,c.__emotion_forwardProp=n.shouldForwardProp,c.__emotion_cva=t,Object.defineProperty(c,"toString",{value(){return`.${o}`}}),c}).bind(),vn=new Map,yn=new Proxy(_n,{apply(e,t,n){return _n(...n)},get(e,t){return vn.has(t)||vn.set(t,_n(t)),vn.get(t)}}),bn=(e,t)=>e&&!t?e:!e&&t?t:e.merge(t),I=yn(`div`);I.displayName=`Box`;function xn(e){if(typeof e!=`string`)return e.displayName||e.name}function Sn(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Cn(e,t){return e+Sn(t)}function wn(e,t){if(t)return e+Sn(t)}var Tn=Object.freeze({}),En=Object.freeze({});function Dn(e){let{key:t,recipe:n}=e,r=tn();return(0,P.useMemo)(()=>n?r.cva(n):t==null?r.cva({}):r.getRecipeFn(t),[t,n,r])}function On(e){let{key:t,recipe:n}=e,r=Sn(t||n.className||`Component`),[i,a]=$t({strict:!1,name:`${r}PropsContext`,providerName:`${r}PropsContext`});function o(e){let{unstyled:r,...i}=e,a=Dn({key:t,recipe:i.recipe||n}),[o,s]=(0,P.useMemo)(()=>a.splitVariantProps(i),[a,i]);return{styles:r?Tn:a(o),className:a.className,props:s}}let s=(e,t)=>{let{displayName:n,...i}=t??{},s=yn(e,{},i),c=(0,P.forwardRef)((e,t)=>{let n=a(),r=(0,P.useMemo)(()=>Bt(n,e),[e,n]),{styles:i,className:c,props:l}=o(r);return(0,F.jsx)(s,{...l,ref:t,css:[i,r.css],className:Jt(c,r.className)})});return c.displayName=n??r??xn(e),c};function c(){return i}return{withContext:s,PropsProvider:i,withPropsProvider:c,usePropsContext:a,useRecipeResult:o}}var kn=Object.defineProperty,An=e=>{throw TypeError(e)},jn=(e,t,n)=>t in e?kn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mn=(e,t,n)=>jn(e,typeof t==`symbol`?t:t+``,n),Nn=(e,t,n)=>t.has(e)||An(`Cannot `+n),Pn=(e,t,n)=>(Nn(e,t,`read from private field`),n?n.call(e):t.get(e)),Fn=(e,t,n)=>t.has(e)?An(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n);function In(e){return e==null?[]:Array.isArray(e)?e:[e]}var Ln=e=>e[0],Rn=e=>e[e.length-1],zn=(e,t)=>e.indexOf(t)!==-1,Bn=(e,...t)=>e.concat(t),Vn=(e,...t)=>e.filter(e=>!t.includes(e)),Hn=(e,t)=>zn(e,t)?Vn(e,t):Bn(e,t);function Un(e,t,n={}){let{step:r=1,loop:i=!0}=n,a=t+r,o=e.length,s=o-1;return t===-1?r>0?0:s:a<0?i?s:0:a>=o?i?0:t>o?o:t:a}function Wn(e,t,n={}){return e[Un(e,t,n)]}function Gn(e,t,n={}){let{step:r=1,loop:i=!0}=n;return Un(e,t,{step:-r,loop:i})}function Kn(e,t,n={}){return e[Gn(e,t,n)]}var qn=e=>e?.constructor.name===`Array`,Jn=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Yn(e[n],t[n]))return!1;return!0},Yn=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual==`function`&&typeof t?.isEqual==`function`)return e.isEqual(t);if(typeof e==`function`&&typeof t==`function`)return e.toString()===t.toString();if(qn(e)&&qn(t))return Jn(Array.from(e),Array.from(t));if(typeof e!=`object`||typeof t!=`object`)return!1;let n=Object.keys(t??Object.create(null)),r=n.length;for(let t=0;t<r;t++)if(!Reflect.has(e,n[t]))return!1;for(let i=0;i<r;i++){let r=n[i];if(!Yn(e[r],t[r]))return!1}return!0},Xn=e=>Array.isArray(e),Zn=e=>typeof e==`object`&&!!e,Qn=e=>Zn(e)&&!Xn(e),$n=e=>typeof e==`string`,er=e=>typeof e==`function`,tr=e=>e==null,nr=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),rr=e=>Object.prototype.toString.call(e),ir=Function.prototype.toString,ar=ir.call(Object),or=e=>{if(!Zn(e)||rr(e)!=`[object Object]`||lr(e))return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let n=nr(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&ir.call(n)==ar},sr=e=>typeof e==`object`&&!!e&&`$$typeof`in e&&`props`in e,cr=e=>typeof e==`object`&&!!e&&`__v_isVNode`in e,lr=e=>sr(e)||cr(e),ur=e=>e(),dr=()=>{},fr=(...e)=>(...t)=>{e.forEach(function(e){e?.(...t)})},{floor:pr,abs:mr,round:hr,min:gr,max:_r,pow:vr,sign:yr}=Math,br=e=>typeof e==`number`?`${e}px`:e;function xr(e){if(!or(e)||e===void 0)return e;let t=Reflect.ownKeys(e).filter(e=>typeof e==`string`),n={};for(let r of t){let t=e[r];t!==void 0&&(n[r]=xr(t))}return n}function Sr(e,t){if(!t)return e;let n={...e},r=t;for(let e in r){let t=r[e];t!==void 0&&(n[e]=t)}return n}var Cr=()=>performance.now(),wr,Tr=class{constructor(e){Mn(this,`onTick`,e),Mn(this,`frameId`,null),Mn(this,`pausedAtMs`,null),Mn(this,`context`),Mn(this,`cancelFrame`,()=>{this.frameId!==null&&(cancelAnimationFrame(this.frameId),this.frameId=null)}),Mn(this,`setStartMs`,e=>{this.context.startMs=e}),Mn(this,`start`,()=>{if(this.frameId!==null)return;let e=Cr();this.pausedAtMs===null?this.context.startMs=e:(this.context.startMs+=e-this.pausedAtMs,this.pausedAtMs=null),this.frameId=requestAnimationFrame(Pn(this,wr))}),Mn(this,`pause`,()=>{this.frameId!==null&&(this.cancelFrame(),this.pausedAtMs=Cr())}),Mn(this,`stop`,()=>{this.frameId!==null&&(this.cancelFrame(),this.pausedAtMs=null)}),Fn(this,wr,e=>{if(this.context.now=e,this.context.deltaMs=e-this.context.startMs,this.onTick(this.context)===!1){this.stop();return}this.frameId=requestAnimationFrame(Pn(this,wr))}),this.context={now:0,startMs:Cr(),deltaMs:0}}get elapsedMs(){return this.pausedAtMs===null?Cr()-this.context.startMs:this.pausedAtMs-this.context.startMs}};wr=new WeakMap;function Er(e,t){let n=new Tr(({deltaMs:n})=>{if(n>=t)return e(),!1});return n.start(),()=>n.stop()}function Dr(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function Or(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function kr(e,t){if(e==null)throw Error(t())}function Ar(e,t,n){let r=[];for(let n of t)e[n]??r.push(n);if(r.length>0)throw Error(`[zag-js${n?` > ${n}`:``}] missing required props: ${r.join(`, `)}`)}function jr(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Mr(e={}){let{name:t,strict:n=!0,hookName:r=`useContext`,providerName:i=`Provider`,errorMessage:a,defaultValue:o}=e,s=(0,P.createContext)(o);s.displayName=t;function c(){let e=(0,P.useContext)(s);if(!e&&n){let e=Error(a??jr(r,i));throw e.name=`ContextError`,nr(Error,`captureStackTrace`)&&er(Error.captureStackTrace)&&Error.captureStackTrace(e,c),e}return e}return[s.Provider,c,s]}var[Nr,Pr]=Mr({name:`EnvironmentContext`,hookName:`useEnvironmentContext`,providerName:`<EnvironmentProvider />`,strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}});function Fr(...e){return t=>{let n=[],r=!1;for(let i of e)if(typeof i==`function`){let e=i(t);typeof e==`function`?(r=!0,n.push(e)):n.push(()=>i(null))}else i&&(i.current=t,n.push(()=>{i.current=null}));if(r)return()=>{for(let e of n)e()}}}function Ir(...e){return(0,P.useCallback)(Fr(...e),e)}var Lr=(...e)=>e.map(e=>e?.trim?.()).filter(Boolean).join(` `),Rr=(...e)=>Array.from(new Set(Lr(...e).split(/\s+/).filter(Boolean))).join(` `),zr=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Br=e=>{let t={},n;for(;n=zr.exec(e);)t[n[1]]=n[2];return t},Vr=(e,t)=>{if($n(e)){if($n(t))return`${e};${t}`;e=Br(e)}else $n(t)&&(t=Br(t));return Object.assign({},e??{},t??{})};function L(...e){let t={};for(let n of e){if(!n)continue;for(let e in t){if(e.startsWith(`on`)&&typeof t[e]==`function`&&typeof n[e]==`function`){t[e]=fr(n[e],t[e]);continue}if(e===`className`||e===`class`){t[e]=Lr(t[e],n[e]);continue}if(e===`style`){t[e]=Vr(t[e],n[e]);continue}if(e===`data-ownedby`){t[e]=Rr(t[e],n[e]);continue}t[e]=n[e]===void 0?t[e]:n[e]}for(let e in n)t[e]===void 0&&(t[e]=n[e]);let e=Object.getOwnPropertySymbols(n);for(let r of e)t[r]=n[r]}return t}var Hr=`.`,Ur=`#`,Wr=new WeakMap,Gr=new WeakMap;function Kr(e){return e.join(Hr)}function qr(e){return e.includes(Hr)}function Jr(e){return e.startsWith(Ur)}function Yr(e){return e.startsWith(Hr)}function Xr(e){return Jr(e)?e.slice(Ur.length):e}function Zr(e,t){return e?`${e}${Hr}${t}`:t}function Qr(e){let t=new Map,n=new Map,r=(e,i)=>{t.set(e,i);let a=i.id;a&&(n.has(a)&&Or(`[zag-js] Duplicate state id: "${a}"`),n.set(a,e));let o=i.states;if(o){kr(i.initial,()=>`[zag-js] Compound state "${e}" has child states but no "initial" property`),i.initial in o||Or(`[zag-js] Compound state "${e}" has initial "${String(i.initial)}" which is not a child state`);for(let[t,n]of Object.entries(o)){if(!n)continue;let i=Zr(e,t);r(i,n)}}};for(let[t,n]of Object.entries(e.states))n&&r(t,n);return{index:t,idIndex:n}}function $r(e){let t=Wr.get(e);if(t)return t;let{index:n,idIndex:r}=Qr(e);return Wr.set(e,n),Gr.set(e,r),n}function ei(e,t){return $r(e),Gr.get(e)?.get(t)}function ti(e){return e?String(e).split(Hr).filter(Boolean):[]}function ni(e,t){if(!t)return[];let n=$r(e),r=ti(t),i=[],a=[];for(let e of r){a.push(e);let t=Kr(a),r=n.get(t);if(!r)break;i.push({path:t,state:r})}return i}function ri(e,t){let n=$r(e),r=ti(t);if(!r.length)return t;let i=[];for(let e of r){i.push(e);let r=Kr(i);if(!n.has(r))return t}let a=Kr(i),o=n.get(a);for(;o?.initial;){let e=`${a}${Hr}${o.initial}`,t=n.get(e);if(!t)break;a=e,o=t}return a}function ii(e,t){return $r(e).has(t)}function ai(e,t,n){let r=String(t);if(Jr(r)){let t=Xr(r),n=ei(e,t);return kr(n,()=>`[zag-js] Unknown state id: "${t}"`),ri(e,n)}if(Yr(r)&&n)return ri(e,Zr(n,r.slice(1)));if(!qr(r)&&n){let t=ti(n);for(let n=t.length-1;n>=1;n--){let i=Zr(t.slice(0,n).join(Hr),r);if(ii(e,i))return ri(e,i)}if(ii(e,r))return ri(e,r)}return ri(e,r)}function oi(e,t,n){let r=ni(e,t);for(let e=r.length-1;e>=0;e--){let t=r[e]?.state.on?.[n];if(t)return{transitions:t,source:r[e]?.path}}return{transitions:e.on?.[n],source:void 0}}function si(e,t,n,r){let i=t?ni(e,t):[],a=ni(e,n),o=0;for(;o<i.length&&o<a.length&&i[o]?.path===a[o]?.path;)o+=1;let s=i.slice(o).reverse(),c=a.slice(o),l=i[i.length-1]?.path===a[a.length-1]?.path;return r&&l&&(s=i.slice().reverse(),c=a),{exiting:s,entering:c}}function ci(e,t){return e?e===t||e.startsWith(`${t}${Hr}`):!1}function li(e,t,n){return ni(e,t).some(e=>e.state.tags?.includes(n))}function ui(){return{and:(...e)=>function(t){return e.every(e=>t.guard(e))},or:(...e)=>function(t){return e.some(e=>t.guard(e))},not:e=>function(t){return!t.guard(e)}}}function di(e){return $r(e),e}function fi(){return{guards:ui(),createMachine:e=>di(e),choose:e=>function({choose:t}){return t(e)?.actions}}}var pi=(e=>(e.NotStarted=`Not Started`,e.Started=`Started`,e.Stopped=`Stopped`,e))(pi||{}),mi=`__init__`,hi=Object.defineProperty,gi=(e,t,n)=>t in e?hi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_i=(e,t,n)=>gi(e,typeof t==`symbol`?t:t+``,n),vi=(e,t)=>e.map((n,r)=>e[(Math.max(t,0)+r)%e.length]),yi=(...e)=>t=>e.reduce((e,t)=>t(e),t),bi=()=>void 0,xi=e=>typeof e==`object`&&!!e,R=e=>e?``:void 0,Si=e=>e?`true`:void 0,Ci=/\\/g,wi=/"/g,Ti=e=>globalThis.CSS?.escape?.(e)??e.replace(Ci,`\\\\`).replace(wi,`\\"`),Ei=e=>`[data-ownedby~="${Ti(String(e))}"]`,Di=1,Oi=9,ki=11,Ai=e=>xi(e)&&e.nodeType===Di&&typeof e.nodeName==`string`,ji=e=>xi(e)&&e.nodeType===Di&&typeof e.nodeName==`string`,Mi=e=>xi(e)&&e.nodeType===Oi,Ni=e=>xi(e)&&e===e.window,Pi=e=>ji(e)?e.localName||``:`#document`;function Fi(e){return[`html`,`body`,`#document`].includes(Pi(e))}var Ii=e=>xi(e)&&e.nodeType!==void 0,Li=e=>Ii(e)&&e.nodeType===ki&&`host`in e,Ri=e=>ji(e)&&e.localName===`input`,zi=e=>!!e?.matches(`a[href]`),Bi=e=>ji(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function Vi(e){return e?Xi(e.getRootNode())===e:!1}var Hi=/(textarea|select)/;function Ui(e){if(e==null||!ji(e))return!1;try{return Ri(e)&&e.selectionStart!=null||Hi.test(e.localName)||e.isContentEditable||e.getAttribute(`contenteditable`)===`true`||e.getAttribute(`contenteditable`)===``}catch{return!1}}function Wi(e){let t=e.parentNode;return Li(t)?t.host:t}function Gi(e){let t=[];for(;e;)t.push(e),e=Wi(e);return t}function Ki(e,t){if(!e||!t||!ji(e)||!Ii(t))return!1;if(ji(t)&&e===t||e.contains(t))return!0;let n=t.getRootNode?.();if(n&&Li(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function qi(e){return Mi(e)?e:Ni(e)?e.document:e?.ownerDocument??document}function Ji(e){return qi(e).documentElement}function Yi(e){return Li(e)?Yi(e.host):Mi(e)?e.defaultView??window:ji(e)?e.ownerDocument?.defaultView??window:window}function Xi(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(!e||e===t)break;t=e}return t}function Zi(e){if(Pi(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Li(e)&&e.host||Ji(e);return Li(t)?t.host:t}function Qi(e){let t;try{if(t=e.getRootNode({composed:!0}),Mi(t)||Li(t))return t}catch{}return e.ownerDocument??document}var $i=new WeakMap;function ea(e){return $i.has(e)||$i.set(e,Yi(e).getComputedStyle(e)),$i.get(e)}var ta=new Set([`menu`,`listbox`,`dialog`,`grid`,`tree`,`region`,`application`]),na=e=>ta.has(e),ra=e=>e.getAttribute(`aria-controls`)?.split(` `)||[];function ia(e,t){let n=new Set,r=Qi(e),i=e=>{let a=e.querySelectorAll(`[aria-controls]`);for(let e of a){if(e.getAttribute(`aria-expanded`)!==`true`)continue;let a=ra(e);for(let e of a){if(!e||n.has(e))continue;n.add(e);let a=r.getElementById(e);if(a){let e=a.getAttribute(`role`),n=a.getAttribute(`aria-modal`)===`true`;if(e&&na(e)&&!n&&(a===t||a.contains(t)||i(a)))return!0}}}return!1};return i(e)}function aa(e,t){let n=Qi(e),r=new Set,i=e=>{let a=e.querySelectorAll(`[aria-controls]`);for(let e of a){if(e.getAttribute(`aria-expanded`)!==`true`)continue;let a=ra(e);for(let e of a){if(!e||r.has(e))continue;r.add(e);let a=n.getElementById(e);if(a){let e=a.getAttribute(`role`),n=a.getAttribute(`aria-modal`)===`true`;e&&ta.has(e)&&!n&&(t(a),i(a))}}}};i(e)}function oa(e){let t=new Set;return aa(e,n=>{e.contains(n)||t.add(n)}),Array.from(t)}function sa(e){let t=e.getAttribute(`role`);return!!(t&&ta.has(t))}function ca(e){return e.hasAttribute(`aria-controls`)&&e.getAttribute(`aria-expanded`)===`true`}function la(e){return ca(e)?!0:!!e.querySelector?.(`[aria-controls][aria-expanded="true"]`)}function ua(e){if(!e.id)return!1;let t=Qi(e),n=CSS.escape(e.id),r=`[aria-controls~="${n}"][aria-expanded="true"], [aria-controls="${n}"][aria-expanded="true"]`;return!!(t.querySelector(r)&&sa(e))}var da=()=>typeof document<`u`;function fa(){return navigator.userAgentData?.platform??navigator.platform}function pa(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}var ma=e=>da()&&e.test(fa()),ha=e=>da()&&e.test(pa()),ga=e=>da()&&e.test(navigator.vendor),_a=/^iPhone/i,va=/^iPad/i,ya=/^Mac/i,ba=/apple/i,xa=/Firefox/i,Sa=/Android/i,Ca=()=>da()&&!!navigator.maxTouchPoints,wa=()=>ma(_a),Ta=()=>ma(va)||Oa()&&navigator.maxTouchPoints>1,Ea=()=>wa()||Ta(),Da=()=>Oa()||Ea(),Oa=()=>ma(ya),ka=()=>Da()&&ga(ba),Aa=()=>ha(xa),ja=()=>ha(Sa);function Ma(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function Na(e){return Ma(e)?.[0]??e.target}function Pa(e){let t=e.currentTarget;if(!t||!t.matches(`a[href], button[type='submit'], input[type='submit']`))return!1;let n=e.button===1,r=Ia(e);return n||r}function Fa(e){return Wa(e).isComposing||e.keyCode===229}function Ia(e){return Oa()?e.metaKey:e.ctrlKey}function La(e){return e.pointerType===``&&e.isTrusted?!0:ja()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}var Ra=e=>e.button===0,za=e=>e.button===2||Oa()&&e.ctrlKey&&e.button===0,Ba=e=>`touches`in e&&e.touches.length>0,Va={Up:`ArrowUp`,Down:`ArrowDown`,Esc:`Escape`," ":`Space`,",":`Comma`,Left:`ArrowLeft`,Right:`ArrowRight`},Ha={ArrowLeft:`ArrowRight`,ArrowRight:`ArrowLeft`};function Ua(e,t={}){let{dir:n=`ltr`,orientation:r=`horizontal`}=t,i=e.key;return i=Va[i]??i,n===`rtl`&&r===`horizontal`&&i in Ha&&(i=Ha[i]),i}function Wa(e){return e.nativeEvent??e}function Ga(e,t=`client`){let n=Ba(e)?e.touches[0]||e.changedTouches[0]:e;return{x:n[`${t}X`],y:n[`${t}Y`]}}var Ka=(e,t,n,r)=>{let i=typeof e==`function`?e():e;return i?.addEventListener(t,n,r),()=>{i?.removeEventListener(t,n,r)}};function qa(e,t){let{type:n=`HTMLInputElement`,property:r=`value`}=t,i=Yi(e)[n].prototype;return Object.getOwnPropertyDescriptor(i,r)??{}}function Ja(e,t){e&&(qa(e,{type:`HTMLInputElement`,property:`checked`}).set?.call(e,t),t?e.setAttribute(`checked`,``):e.removeAttribute(`checked`))}function Ya(e,t){let{checked:n,bubbles:r=!0}=t;if(!e)return;let i=Yi(e);if(!(e instanceof i.HTMLInputElement))return;Ja(e,n);let a=new i.Event(`click`,{bubbles:r});e.dispatchEvent(no(a))}function Xa(e){return e.matches(`textarea, input, select, button`)}function Za(e,t){if(!e)return;let n=Xa(e)?e.form:e.closest(`form`),r=e=>{e.defaultPrevented||t()};return n?.addEventListener(`reset`,r,{passive:!0}),()=>n?.removeEventListener(`reset`,r)}function Qa(e,t){let n=e?.closest(`fieldset`);if(!n)return;t(n.disabled);let r=new(Yi(n)).MutationObserver(()=>t(n.disabled));return r.observe(n,{attributes:!0,attributeFilter:[`disabled`]}),()=>r.disconnect()}function $a(e,t){if(!e)return;let{onFieldsetDisabledChange:n,onFormReset:r}=t,i=[Za(e,r),Qa(e,n)];return()=>i.forEach(e=>e?.())}var eo=Symbol.for(`zag.changeEvent`);function to(e){return Object.prototype.hasOwnProperty.call(e,eo)}function no(e){return to(e)||Object.defineProperty(e,eo,{value:!0}),e}var ro=e=>ji(e)&&e.tagName===`IFRAME`,io=/^(audio|video|details)$/;function ao(e){let t=e.getAttribute(`tabindex`);return t?parseInt(t,10):NaN}var oo=e=>!Number.isNaN(ao(e)),so=e=>ao(e)<0;function co(e){return Ri(e)&&e.type===`radio`}function lo(e){if(!co(e)||!e.name||e.checked)return!0;let t=`input[type="radio"][name="${CSS.escape(e.name)}"]`,n=e.form??e.ownerDocument,r=Array.from(n.querySelectorAll(t)).filter(t=>t.form===e.form&&ho(t)),i=r.find(e=>e.checked);return i?i===e:r[0]===e}function uo(e,t){if(!t)return null;if(t===!0)return e.shadowRoot||null;let n=t(e);return(n===!0?e.shadowRoot:n)||null}function fo(e,t,n){let r=[...e],i=[...e],a=new Set,o=new Map;e.forEach((e,t)=>o.set(e,t));let s=0;for(;s<i.length;){let e=i[s++];if(!e||a.has(e))continue;a.add(e);let c=uo(e,t);if(c){let t=Array.from(c.querySelectorAll(po)).filter(n),a=o.get(e);if(a!==void 0){let e=a+1;r.splice(e,0,...t),t.forEach((t,n)=>{o.set(t,e+n)});for(let n=e+t.length;n<r.length;n++)o.set(r[n],n)}else{let e=r.length;r.push(...t),t.forEach((t,n)=>{o.set(t,e+n)})}i.push(...t)}}return r}var po=`input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type`,mo=(e,t={})=>{if(!e)return[];let{includeContainer:n=!1,getShadowRoot:r}=t,i=Array.from(e.querySelectorAll(po));(n==1||n==`if-empty`&&i.length===0)&&ji(e)&&ho(e)&&i.unshift(e);let a=[];for(let e of i)if(ho(e)){if(ro(e)&&e.contentDocument){let t=e.contentDocument.body;a.push(...mo(t,{getShadowRoot:r}));continue}a.push(e)}return r?fo(a,r,ho):a};function ho(e){return!ji(e)||e.closest(`[inert]`)?!1:e.matches(po)&&Bi(e)}function go(e,t={}){if(!e)return[];let{includeContainer:n,getShadowRoot:r}=t,i=Array.from(e.querySelectorAll(po));n&&_o(e)&&i.unshift(e);let a=[];for(let e of i)if(_o(e)){if(ro(e)&&e.contentDocument){let t=e.contentDocument.body;a.push(...go(t,{getShadowRoot:r}));continue}a.push(e)}if(r){let e=fo(a,r,_o);return!e.length&&n?i:e}return!a.length&&n?i:a}function _o(e){return ji(e)&&e.tabIndex>0?!0:!ho(e)||so(e)?!1:lo(e)}function vo(e,t={}){let n=go(e,t);return[n[0]||null,n[n.length-1]||null]}function yo(e){return e.tabIndex<0&&(io.test(e.localName)||Ui(e))&&!oo(e)?0:e.tabIndex}function bo(e){let{root:t,getInitialEl:n,filter:r,enabled:i=!0}=e;if(!i)return;let a=typeof n==`function`?n():n;return a||=t?.querySelector(`[data-autofocus],[autofocus]`),a||=go(t).filter(e=>!r||r(e)).find(e=>!e.hasAttribute(`data-no-autofocus`)),a||t||void 0}function xo(e){let t=e.currentTarget;if(!t)return!1;let[n,r]=vo(t);return!(Vi(n)&&e.shiftKey||Vi(r)&&!e.shiftKey||!n&&!r)}var So=class e{constructor(){_i(this,`id`,null),_i(this,`fn_cleanup`),_i(this,`cleanup`,()=>{this.cancel()})}static create(){return new e}request(e){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=e?.()})}cancel(){this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),this.fn_cleanup?.(),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function Co(e){let t=So.create();return t.request(e),t.cleanup}function wo(e){let t=new Set;function n(e){let n=globalThis.requestAnimationFrame(e);t.add(()=>globalThis.cancelAnimationFrame(n))}return n(()=>n(e)),function(){t.forEach(e=>e())}}function To(e,t,n){let r=Co(()=>{e.removeEventListener(t,i,!0),n()}),i=()=>{r(),n()};return e.addEventListener(t,i,{once:!0,capture:!0}),r}function Eo(e,t){if(!e)return;let{attributes:n,callback:r}=t,i=new(e.ownerDocument.defaultView||window).MutationObserver(e=>{for(let t of e)t.type===`attributes`&&t.attributeName&&n.includes(t.attributeName)&&r(t)});return i.observe(e,{attributes:!0,attributeFilter:n}),()=>i.disconnect()}function Do(e,t){let{defer:n}=t,r=n?Co:e=>e(),i=[];return i.push(r(()=>{let n=typeof e==`function`?e():e;i.push(Eo(n,t))})),()=>{i.forEach(e=>e?.())}}function Oo(e,t){let{callback:n}=t;if(!e)return;let r=new(e.ownerDocument.defaultView||window).MutationObserver(n);return r.observe(e,{childList:!0,subtree:!0}),()=>r.disconnect()}function ko(e,t){let{defer:n}=t,r=n?Co:e=>e(),i=[];return i.push(r(()=>{let n=typeof e==`function`?e():e;i.push(Oo(n,t))})),()=>{i.forEach(e=>e?.())}}function Ao(e){let t=()=>{let t=Yi(e);e.dispatchEvent(new t.MouseEvent(`click`))};Aa()?To(e,`keyup`,t):queueMicrotask(t)}function jo(e){let t=Zi(e);return Fi(t)?qi(t).body:ji(t)&&Po(t)?t:jo(t)}var Mo=/auto|scroll|overlay|hidden|clip/,No=new Set([`inline`,`contents`]);function Po(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Yi(e).getComputedStyle(e);return Mo.test(t+r+n)&&!No.has(i)}var Fo=`default`,Io=``,Lo=new WeakMap;function Ro(e={}){let{target:t,doc:n}=e,r=n??document,i=r.documentElement;return Ea()?(Fo==="default"&&(Io=i.style.webkitUserSelect,i.style.webkitUserSelect=`none`),Fo=`disabled`):t&&(Lo.set(t,t.style.userSelect),t.style.userSelect=`none`),()=>zo({target:t,doc:r})}function zo(e={}){let{target:t,doc:n}=e,r=(n??document).documentElement;if(Ea()){if(Fo!==`disabled`)return;Fo=`restoring`,setTimeout(()=>{wo(()=>{Fo===`restoring`&&(r.style.webkitUserSelect===`none`&&(r.style.webkitUserSelect=Io||``),Io=``,Fo=`default`)})},300)}else if(t&&Lo.has(t)){let e=Lo.get(t);t.style.userSelect===`none`&&(t.style.userSelect=e??``),t.getAttribute(`style`)===``&&t.removeAttribute(`style`),Lo.delete(t)}}function Bo(e={}){let{defer:t,target:n,...r}=e,i=t?Co:e=>e(),a=[];return a.push(i(()=>{let e=typeof n==`function`?n():n;a.push(Ro({...r,target:e}))})),()=>{a.forEach(e=>e?.())}}function Vo(e,t){let{onPointerMove:n,onPointerUp:r}=t,i=e=>{let t=Ga(e);if(!(Math.sqrt(t.x**2+t.y**2)<(e.pointerType===`touch`?10:5))){if(e.pointerType===`mouse`&&e.buttons===0){a(e);return}n({point:t,event:e})}},a=e=>{let t=Ga(e);r({point:t,event:e})},o=[Ka(e,`pointermove`,i,!1),Ka(e,`pointerup`,a,!1),Ka(e,`pointercancel`,a,!1),Ka(e,`contextmenu`,a,!1),Bo({doc:e})];return()=>{o.forEach(e=>e())}}function Ho(e){let{pointerNode:t,keyboardNode:n=t,onPress:r,onPressStart:i,onPressEnd:a,isValidKey:o=e=>e.key===`Enter`}=e;if(!t)return bi;let s=Yi(t),c=bi,l=bi,u=bi,d=e=>({point:Ga(e),event:e});function f(e){i?.(d(e))}function p(e){a?.(d(e))}c=yi(Ka(t,`pointerdown`,e=>{l(),l=yi(Ka(s,`pointerup`,e=>{let n=Na(e);Ki(t,n)?r?.(d(e)):a?.(d(e))},{passive:!r,once:!0}),Ka(s,`pointercancel`,p,{passive:!a,once:!0})),Vi(n)&&e.pointerType===`mouse`&&e.preventDefault(),f(e)},{passive:!i}),Ka(n,`focus`,m));function m(){u=yi(Ka(n,`keydown`,e=>{o(e)&&(l(),l=Ka(n,`keyup`,e=>{if(!o(e))return;let t=new s.PointerEvent(`pointerup`),n=d(t);r?.(n),a?.(n)}),f(new s.PointerEvent(`pointerdown`)))}),Ka(n,`blur`,()=>{p(new s.PointerEvent(`pointercancel`))}))}return()=>{c(),l(),u()}}function Uo(e,t){return Array.from(e?.querySelectorAll(t)??[])}var Wo=e=>e.id;function Go(e,t,n=Wo){return e.find(e=>n(e)===t)}function Ko(e,t,n=Wo){let r=Go(e,t,n);return r?e.indexOf(r):-1}function qo(e,t,n=!0){let r=Ko(e,t);return r=n?(r+1)%e.length:Math.min(r+1,e.length-1),e[r]}function Jo(e,t,n=!0){let r=Ko(e,t);return r===-1?n?e[e.length-1]:null:(r=n?(r-1+e.length)%e.length:Math.max(0,r-1),e[r])}function Yo(e){let t=new WeakMap,n,r=new WeakMap,i=e=>n||(n=new e.ResizeObserver(e=>{for(let n of e){r.set(n.target,n);let e=t.get(n.target);if(e)for(let t of e)t(n)}}),n);return{observe:(n,r)=>{let a=t.get(n)||new Set;a.add(r),t.set(n,a);let o=Yi(n);return i(o).observe(n,e),()=>{let e=t.get(n);e&&(e.delete(r),e.size===0&&(t.delete(n),i(o).unobserve(n)))}},unobserve:e=>{t.delete(e),n?.unobserve(e)}}}var Xo=Yo({box:`border-box`});function Zo(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function Qo(e,t){let{rootEl:n,...r}=t||{};e&&n&&Po(n)&&Zo(n)&&e.scrollIntoView(r)}var $o=e=>e.split(``).map(e=>{let t=e.charCodeAt(0);return t>0&&t<128?e:t>=128&&t<=255?`/x${t.toString(16)}`.replace(`/`,`\\`):``}).join(``).trim(),es=e=>$o(e.dataset?.valuetext??e.textContent??``),ts=(e,t)=>e.trim().toLowerCase().startsWith(t.toLowerCase());function ns(e,t,n,r=Wo){let i=n?Ko(e,n,r):-1,a=n?vi(e,i):e;return t.length===1&&(a=a.filter(e=>r(e)!==n)),a.find(e=>ts(es(e),t))}function rs(e,t){if(!e)return bi;let n=Object.keys(t).reduce((t,n)=>(t[n]=e.style.getPropertyValue(n),t),{});return as(n,t)?bi:(Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute(`style`)})}function is(e,t,n){if(!e)return bi;let r=e.style.getPropertyValue(t);return r===n?bi:(e.style.setProperty(t,n),()=>{e.style.setProperty(t,r),e.style.length===0&&e.removeAttribute(`style`)})}function as(e,t){return Object.keys(e).every(n=>e[n]===t[n])}function os(e,t){let{state:n,activeId:r,key:i,timeout:a=350,itemToId:o}=t,s=n.keysSoFar+i,c=s.length>1&&Array.from(s).every(e=>e===s[0])?s[0]:s,l=ns(e.slice(),c,r,o);function u(){clearTimeout(n.timer),n.timer=-1}function d(e){n.keysSoFar=e,u(),e!==``&&(n.timer=+setTimeout(()=>{d(``),u()},a))}return d(s),l}var ss=Object.assign(os,{defaultOptions:{keysSoFar:``,timer:-1},isValidEvent:cs});function cs(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var ls={border:`0`,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0`,position:`absolute`,width:`1px`,whiteSpace:`nowrap`,wordWrap:`normal`};function us(e,t,n){let{signal:r}=t;return[new Promise((t,i)=>{let a=setTimeout(()=>{i(Error(`Timeout of ${n}ms exceeded`))},n);r.addEventListener(`abort`,()=>{clearTimeout(a),i(new DOMException(`Promise aborted`,`AbortError`))}),e.then(e=>{r.aborted||(clearTimeout(a),t(e))}).catch(e=>{r.aborted||(clearTimeout(a),i(e))})}),()=>t.abort()]}function ds(e,t){let{timeout:n,rootNode:r}=t,i=Yi(r),a=qi(r),o=new i.AbortController;return us(new Promise(t=>{let n=e();if(n){t(n);return}let r=new i.MutationObserver(()=>{let n=e();n&&n.isConnected&&(r.disconnect(),t(n))});r.observe(a.body,{childList:!0,subtree:!0})}),o,n)}function fs(e,t,n={}){let{defer:r,onMissing:i}=n,a=()=>typeof e==`function`?e():e,o=[],s=e=>{if(!e)return i?.();o.push(t(e))},c=a();if(!r||c)s(c);else{let e=!1;o.push(()=>{e=!0}),queueMicrotask(()=>{if(e)return;let t=a();if(t){s(t);return}o.push(Co(()=>{e||s(a())}))})}return()=>{o.forEach(e=>e?.())}}function ps(e){let t=()=>e.getRootNode?.()??document,n=()=>qi(t()),r=()=>n().defaultView??window,i=()=>Xi(t()),a=e=>t().getElementById(e);return{...e,getRootNode:t,getDoc:n,getWin:r,getActiveElement:i,isActiveElement:Vi,getById:a}}function ms(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var hs=Symbol.for(`react.lazy`);function gs(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===hs}function _s(e){if((0,P.isValidElement)(e))return e;if(gs(e))return P.Children.toArray(e).find(P.isValidElement)}var vs=e=>{let t=(0,P.memo)((0,P.forwardRef)((t,n)=>{let{asChild:r,children:i,...a}=t,o=r?_s(i):void 0,s=o?ms(o):void 0,c=Ir(n,s);return r?o?(0,P.cloneElement)(o,{...L(a,o.props),ref:n?c:s}):null:(0,P.createElement)(e,{...a,ref:n},i)}));return t.displayName=e.displayName||e.name,t},z=(()=>{let e=new Map;return new Proxy(vs,{apply(e,t,n){return vs(n[0])},get(t,n){let r=n;return e.has(r)||e.set(r,vs(r)),e.get(r)}})})(),[ys,bs]=Mr({name:`LocaleContext`,hookName:`useLocaleContext`,providerName:`<LocaleProvider />`,strict:!1,defaultValue:{dir:`ltr`,locale:`en-US`}}),xs=Object.defineProperty,Ss=(e,t)=>{let n={};for(var r in e)xs(n,r,{get:e[r],enumerable:!0});return t||xs(n,Symbol.toStringTag,{value:`Module`}),n},Cs=()=>(e,t)=>t.reduce((e,t)=>{let[n,r]=e,i=t;return r[i]!==void 0&&(n[i]=r[i]),delete r[i],[n,r]},[{},{...e}]),ws=e=>Cs()(e,[`hideMode`,`immediate`,`lazyMount`,`onEnterComplete`,`onExitComplete`,`present`,`skipAnimationOnMount`,`unmountOnExit`]),Ts=(e=>Reflect.get(e,`Activity`))(P),Es=Ts!==void 0;function Ds(e,t={}){let{sync:n=!1}=t,r=Os(e);return(0,P.useCallback)((...e)=>n?queueMicrotask(()=>r.current?.(...e)):r.current?.(...e),[n,r])}function Os(e){let t=(0,P.useRef)(e);return t.current=e,t}var ks=globalThis.document===void 0?P.useEffect:P.useLayoutEffect;function As(e){let t=e().value??e().defaultValue,n=e().isEqual??Object.is,[r]=(0,P.useState)(t),[i,a]=(0,P.useState)(r),o=e().value!==void 0,s=(0,P.useRef)(i);s.current=o?e().value:i;let c=(0,P.useRef)(s.current);ks(()=>{c.current=s.current},[i,e().value]);let l=t=>{let r=c.current,i=er(t)?t(r):t;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:i,prev:r}),o||a(i),n(i,r)||e().onChange?.(i,r)};function u(){return o?e().value:i}return{initial:r,ref:s,get:u,set(t){(e().sync?tt.flushSync:ur)(()=>l(t))},invoke(t,n){e().onChange?.(t,n)},hash(t){return e().hash?.(t)??String(t)}}}As.cleanup=e=>{(0,P.useEffect)(()=>e,[])},As.ref=e=>{let t=(0,P.useRef)(e);return{get:()=>t.current,set:e=>{t.current=e}}};function js(e){let t=(0,P.useRef)(void 0);return t.current===void 0&&(t.current=e()),t.current}function Ms(e){let t=(0,P.useRef)(e);return t.current=e,(0,P.useMemo)(()=>((...e)=>t.current(...e)),[])}function Ns(e){let t=(0,P.useRef)(e);return js(()=>({get(e){return t.current[e]},set(e,n){t.current[e]=n}}))}var Ps=(e,t)=>{let n=(0,P.useRef)(!1),r=(0,P.useRef)(!1);(0,P.useEffect)(()=>{if(n.current&&r.current)return t();r.current=!0},[...(e??[]).map(e=>typeof e==`function`?e():e)]),(0,P.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[])};function Fs(e,t={}){let n=(0,P.useMemo)(()=>{let{id:e,ids:n,getRootNode:r}=t;return ps({id:e,ids:n,getRootNode:r})},[t]),r=(...t)=>{e.debug&&console.log(...t)},i=Ls(e.props?.({props:xr(t),scope:n})??t),a=e.context?.({prop:i,bindable:As,scope:n,flush:Rs,getContext(){return s},getComputed(){return g},getRefs(){return m},getEvent(){return f()}}),o=Is(a),s=js(()=>({get(e){return o.current?.[e].ref.current},set(e,t){o.current?.[e].set(t)},initial(e){return o.current?.[e].initial},hash(e){let t=o.current?.[e].get();return o.current?.[e].hash(t)}})),c=(0,P.useRef)(new Map),l=(0,P.useRef)(null),u=(0,P.useRef)(null),d=(0,P.useRef)({type:``}),f=()=>({...d.current,current(){return d.current},previous(){return u.current}}),p=()=>({...S,matches(...e){return e.some(e=>ci(S.ref.current,e))},hasTag(t){return li(e,S.ref.current,t)}}),m=Ns(e.refs?.({prop:i,context:s})??{}),h=Ms(t=>{queueMicrotask(()=>{if(w.current!==pi.Started)return;u.current=d.current,d.current=t;let n=E(),{transitions:i,source:a}=oi(e,n,t.type),o=x(i);if(!o)return;l.current=o;let s=ai(e,o.target??n,a);r(`transition`,t.type,o.target||n,`(${o.actions})`),s===n?o.reenter?S.invoke(n,n):v(o.actions??[]):(0,tt.flushSync)(()=>S.set(s))})}),g=Ms(t=>{kr(e.computed,()=>`[zag-js] No computed object found on machine`);let r=e.computed[t];return r({context:s,event:f(),prop:i,refs:m,scope:n,computed:g})}),_=()=>({state:p(),context:s,event:f(),prop:i,send:h,action:v,guard:y,track:Ps,refs:m,computed:g,flush:Rs,scope:n,choose:x}),v=t=>{let n=er(t)?t(_()):t;if(!n)return;let r=n.map(t=>{let n=e.implementations?.actions?.[t];return n||Dr(`[zag-js] No implementation found for action "${JSON.stringify(t)}"`),n});for(let e of r)e?.(_())},y=t=>{if(er(t))return t(_());let n=e.implementations?.guards?.[t];return n||Dr(`[zag-js] No implementation found for guard "${JSON.stringify(t)}"`),n?.(_())},b=t=>{let n=er(t)?t(_()):t;if(!n)return;let r=n.map(t=>{let n=e.implementations?.effects?.[t];return n||Dr(`[zag-js] No implementation found for effect "${JSON.stringify(t)}"`),n}),i=[];for(let e of r){let t=e?.(_());t&&i.push(t)}return()=>i.forEach(e=>e?.())},x=e=>In(e).find(e=>{let t=!e.guard;return $n(e.guard)?t=!!y(e.guard):er(e.guard)&&(t=e.guard(_())),t}),S=As(()=>({defaultValue:ai(e,e.initialState({prop:i})),onChange(t,n){let{exiting:r,entering:i}=si(e,n,t,l.current?.reenter);if(r.forEach(e=>{c.current.get(e.path)?.(),c.current.delete(e.path)}),r.forEach(e=>{v(e.state?.exit)}),v(l.current?.actions),i.forEach(e=>{let t=b(e.state?.effects);if(t){let n=c.current.get(e.path);c.current.set(e.path,n?fr(n,t):t)}}),n===`__init__`){v(e.entry);let t=b(e.effects);if(t){let e=c.current.get(mi);c.current.set(mi,e?fr(e,t):t)}}i.forEach(e=>{v(e.state?.entry)})}})),C=(0,P.useRef)(void 0),w=(0,P.useRef)(pi.NotStarted),T=Ms(()=>w.current);ks(()=>{queueMicrotask(()=>{let e=w.current===pi.Started;w.current=pi.Started,r(e?`rehydrating...`:`initializing...`);let t=C.current??S.initial;S.invoke(t,e?S.get():mi)});let t=c.current;return()=>{let n=E();r(`unmounting...`),C.current=n,w.current=pi.Stopped,t.forEach(e=>e?.()),c.current=new Map,l.current=null,queueMicrotask(()=>{v(e.exit),w.current=pi.Stopped})}},[]);let E=()=>`ref`in S?S.ref.current:S.get();return e.watch?.(_()),{state:p(),send:h,context:s,prop:i,scope:n,refs:m,computed:g,event:f(),getStatus:T}}function Is(e){let t=(0,P.useRef)(e);return t.current=e,t}function Ls(e){let t=Is(e);return Ms(function(e){return t.current[e]})}function Rs(e){queueMicrotask(()=>{(0,tt.flushSync)(()=>e())})}function zs(e){return new Proxy({},{get(t,n){return n===`style`?t=>e({style:t}).style:e}})}var Bs=zs(e=>e);function Vs(e,t){let{state:n,send:r,context:i}=e,a=n.matches(`mounted`,`unmountSuspended`);return{skip:!i.get(`initial`),present:a,setNode(e){e&&r({type:`NODE.SET`,node:e})},unmount(){r({type:`UNMOUNT`})}}}var Hs=di({props({props:e}){return{...e,present:!!e.present}},initialState({prop:e}){return e(`present`)?`mounted`:`unmounted`},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:[`cleanupNode`],watch({track:e,prop:t,send:n}){e([()=>t(`present`)],()=>{n({type:`PRESENCE.CHANGED`})})},on:{"NODE.SET":{actions:[`setupNode`]},"PRESENCE.CHANGED":{actions:[`setInitial`,`syncPresence`]}},states:{mounted:{effects:[`trackEnterAnimation`],on:{UNMOUNT:{target:`unmounted`,actions:[`clearPrevAnimationName`,`invokeOnExitComplete`]},"UNMOUNT.SUSPEND":{target:`unmountSuspended`}}},unmountSuspended:{effects:[`trackExitAnimation`],on:{MOUNT:{target:`mounted`,actions:[`setPrevAnimationName`]},UNMOUNT:{target:`unmounted`,actions:[`clearPrevAnimationName`,`invokeOnExitComplete`]}}},unmounted:{on:{MOUNT:{target:`mounted`,actions:[`setPrevAnimationName`]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get(`initial`)||queueMicrotask(()=>{e.set(`initial`,!0)})},invokeOnExitComplete:({prop:e,refs:t})=>{e(`onExitComplete`)?.();let n=t.get(`node`);if(!n)return;let r=new(Yi(n)).CustomEvent(`exitcomplete`,{bubbles:!1});n.dispatchEvent(r)},setupNode:({refs:e,event:t})=>{e.get(`node`)!==t.node&&(e.set(`node`,t.node),e.set(`styles`,ea(t.node)))},cleanupNode:({refs:e})=>{e.set(`node`,null),e.set(`styles`,null)},syncPresence:({context:e,refs:t,send:n,prop:r})=>{let i=r(`present`);if(i)return n({type:`MOUNT`,src:`presence.changed`});let a=t.get(`node`);if(!i&&a?.ownerDocument.visibilityState===`hidden`)return n({type:`UNMOUNT`,src:`visibilitychange`});Co(()=>{if(r(`present`))return;let i=Us(t.get(`styles`));e.set(`unmountAnimationName`,i),i===`none`||i===e.get(`prevAnimationName`)||t.get(`styles`)?.display===`none`||t.get(`styles`)?.animationDuration===`0s`?n({type:`UNMOUNT`,src:`presence.changed`}):n({type:`UNMOUNT.SUSPEND`})})},setPrevAnimationName:({context:e,refs:t})=>{Co(()=>{e.set(`prevAnimationName`,Us(t.get(`styles`)))})},clearPrevAnimationName:({context:e})=>{e.set(`prevAnimationName`,null)}},effects:{trackEnterAnimation:({context:e,refs:t,prop:n})=>{if(!n(`onEnterComplete`)||!e.get(`initial`))return;let r,i=()=>{r=Co(()=>{let e=t.get(`node`);if(!e||!e.isConnected){i();return}let r=ea(e);if(Us(r)===`none`||r.display===`none`||r.animationDuration===`0s`){n(`onEnterComplete`)?.();return}let a=t=>{Na(t)===e&&n(`present`)&&(e.removeEventListener(`animationend`,a),n(`onEnterComplete`)?.())};return e.addEventListener(`animationend`,a),()=>{e.removeEventListener(`animationend`,a)}})};return i(),()=>r?.()},trackExitAnimation:({context:e,refs:t,send:n,prop:r})=>{let i=t.get(`node`);if(!i)return;let a=n=>{(n.composedPath?.()?.[0]??n.target)===i&&e.set(`prevAnimationName`,Us(t.get(`styles`)))},o=a=>{let o=Us(t.get(`styles`));Na(a)===i&&o===e.get(`unmountAnimationName`)&&!r(`present`)&&n({type:`UNMOUNT`,src:`animationend`})},s=e=>{Na(e)===i&&!r(`present`)&&n({type:`UNMOUNT`,src:`animationcancel`})};i.addEventListener(`animationstart`,a),i.addEventListener(`animationcancel`,s),i.addEventListener(`animationend`,o);let c=rs(i,{animationFillMode:`forwards`});return()=>{i.removeEventListener(`animationstart`,a),i.removeEventListener(`animationcancel`,s),i.removeEventListener(`animationend`,o),wo(()=>c())}}}}});function Us(e){return e?.animationName||`none`}var Ws=(e={})=>{let{lazyMount:t,unmountOnExit:n,hideMode:r=`display-none`,present:i,skipAnimationOnMount:a=!1,...o}=e,s=(0,P.useRef)(!1),c=Vs(Fs(Hs,{...o,present:i,onEnterComplete:Ds(e.onEnterComplete),onExitComplete:Ds(e.onExitComplete)}),Bs);c.present&&(s.current=!0);let l=!c.present&&!s.current&&t||n&&!c.present&&s.current,u=r===`activity`&&Es?`activity`:`display-none`;return{ref:c.setNode,getPresenceProps:()=>({"data-state":c.skip&&a?void 0:i?`open`:`closed`,hidden:u!==`activity`&&!c.present}),present:c.present,unmounted:l,hideMode:u}},Gs=e=>{let{presence:t,children:n}=e;return t.unmounted?null:t.hideMode===`activity`&&Ts?(0,F.jsx)(Ts,{mode:t.present?`visible`:`hidden`,children:n}):n},[Ks,qs]=Mr({name:`PresenceContext`,hookName:`usePresenceContext`,providerName:`<PresenceProvider />`}),Js=yn(`span`);Js.displayName=`Span`;var B=(e,t=[])=>({parts:(...n)=>{if(Xs(t))return B(e,n);throw Error(`createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?`)},extendWith:(...n)=>B(e,[...t,...n]),omit:(...n)=>B(e,t.filter(e=>!n.includes(e))),rename:e=>B(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${Ys(e)}"][data-part="${Ys(n)}"]`,`& [data-scope="${Ys(e)}"][data-part="${Ys(n)}"]`].join(`, `),attrs:{"data-scope":Ys(e),"data-part":Ys(n)}}}),{})}),Ys=e=>e.replace(/([A-Z])([A-Z])/g,`$1-$2`).replace(/([a-z])([A-Z])/g,`$1-$2`).replace(/[\s_]+/g,`-`).toLowerCase(),Xs=e=>e.length===0,Zs=B(`tabs`).parts(`root`,`list`,`trigger`,`content`,`indicator`).build(),Qs=e=>e.ids?.root??`tabs:${e.id}`,$s=e=>e.ids?.list??`tabs:${e.id}:list`,ec=(e,t)=>e.ids?.content?.(t)??`tabs:${e.id}:content-${t}`,tc=(e,t)=>e.ids?.trigger?.(t)??`tabs:${e.id}:trigger-${t}`,nc=e=>e.ids?.indicator??`tabs:${e.id}:indicator`,rc=e=>e.getById($s(e)),ic=(e,t)=>e.getById(ec(e,t)),ac=(e,t)=>t==null?null:e.getById(tc(e,t)),oc=e=>e.getById(nc(e)),sc=e=>{let t=`[role=tab]${Ei($s(e))}:not([disabled])`;return Uo(rc(e),t)},cc=e=>Ln(sc(e)),lc=e=>Rn(sc(e)),uc=(e,t)=>qo(sc(e),tc(e,t.value),t.loopFocus),dc=(e,t)=>Jo(sc(e),tc(e,t.value),t.loopFocus),fc=e=>({x:e?.offsetLeft??0,y:e?.offsetTop??0,width:e?.offsetWidth??0,height:e?.offsetHeight??0}),pc=(e,t)=>fc(Go(sc(e),tc(e,t)));function mc(e,t){let{state:n,send:r,context:i,prop:a,scope:o}=e,s=a(`translations`),c=n.matches(`focused`),l=a(`orientation`)===`vertical`,u=a(`orientation`)===`horizontal`,d=a(`composite`);function f(e){return{selected:i.get(`value`)===e.value,focused:i.get(`focusedValue`)===e.value,disabled:!!e.disabled}}return{value:i.get(`value`),focusedValue:i.get(`focusedValue`),setValue(e){r({type:`SET_VALUE`,value:e})},clearValue(){r({type:`CLEAR_VALUE`})},setIndicatorRect(e){let t=tc(o,e);r({type:`SET_INDICATOR_RECT`,id:t})},syncTabIndex(){r({type:`SYNC_TAB_INDEX`})},selectNext(e){r({type:`TAB_FOCUS`,value:e,src:`selectNext`}),r({type:`ARROW_NEXT`,src:`selectNext`})},selectPrev(e){r({type:`TAB_FOCUS`,value:e,src:`selectPrev`}),r({type:`ARROW_PREV`,src:`selectPrev`})},focus(){let e=i.get(`value`);e&&ac(o,e)?.focus()},getRootProps(){return t.element({...Zs.root.attrs,id:Qs(o),"data-orientation":a(`orientation`),"data-focus":R(c),dir:a(`dir`)})},getListProps(){return t.element({...Zs.list.attrs,id:$s(o),role:`tablist`,dir:a(`dir`),"data-focus":R(c),"aria-orientation":a(`orientation`),"data-orientation":a(`orientation`),"aria-label":s?.listLabel,onKeyDown(e){if(e.defaultPrevented||Fa(e)||!Ki(e.currentTarget,Na(e)))return;let t={ArrowDown(){u||r({type:`ARROW_NEXT`,key:`ArrowDown`})},ArrowUp(){u||r({type:`ARROW_PREV`,key:`ArrowUp`})},ArrowLeft(){l||r({type:`ARROW_PREV`,key:`ArrowLeft`})},ArrowRight(){l||r({type:`ARROW_NEXT`,key:`ArrowRight`})},Home(){r({type:`HOME`})},End(){r({type:`END`})}}[Ua(e,{dir:a(`dir`),orientation:a(`orientation`)})];if(t){e.preventDefault(),t(e);return}}})},getTriggerState:f,getTriggerProps(e){let{value:n,disabled:s}=e,c=f(e);return t.button({...Zs.trigger.attrs,role:`tab`,type:`button`,disabled:s,dir:a(`dir`),"data-orientation":a(`orientation`),"data-disabled":R(s),"aria-disabled":s,"data-value":n,"aria-selected":c.selected,"data-selected":R(c.selected),"data-focus":R(c.focused),"aria-controls":c.selected?ec(o,n):void 0,"data-ownedby":$s(o),"data-ssr":R(i.get(`ssr`)),id:tc(o,n),tabIndex:c.selected&&d?0:-1,onFocus(){r({type:`TAB_FOCUS`,value:n})},onBlur(e){e.relatedTarget?.getAttribute(`role`)!==`tab`&&r({type:`TAB_BLUR`})},onClick(e){e.defaultPrevented||Pa(e)||s||(ka()&&e.currentTarget.focus(),r({type:`TAB_CLICK`,value:n}))}})},getContentProps(e){let{value:n}=e,r=i.get(`value`)===n;return t.element({...Zs.content.attrs,dir:a(`dir`),id:ec(o,n),tabIndex:d?0:-1,"aria-labelledby":tc(o,n),role:`tabpanel`,"data-ownedby":$s(o),"data-selected":R(r),"data-orientation":a(`orientation`),hidden:!r})},getIndicatorProps(){let e=i.get(`indicatorRect`),n=i.get(`animateIndicator`);return t.element({id:nc(o),...Zs.indicator.attrs,dir:a(`dir`),"data-orientation":a(`orientation`),hidden:hc(e),onTransitionEnd(e){Na(e)===e.currentTarget&&r({type:`INDICATOR_TRANSITION_END`})},style:{"--transition-property":`left, right, top, bottom, width, height`,"--left":br(e?.x),"--top":br(e?.y),"--width":br(e?.width),"--height":br(e?.height),position:`absolute`,willChange:n?`var(--transition-property)`:`auto`,transitionProperty:n?`var(--transition-property)`:`none`,transitionDuration:n?`var(--transition-duration, 150ms)`:`0ms`,transitionTimingFunction:`var(--transition-timing-function)`,[u?`left`:`top`]:u?`var(--left)`:`var(--top)`}})}}}var hc=e=>e==null||e.width===0&&e.height===0&&e.x===0&&e.y===0,{createMachine:gc}=fi(),_c=gc({props({props:e}){return{dir:`ltr`,orientation:`horizontal`,activationMode:`automatic`,loopFocus:!0,composite:!0,navigate(e){Ao(e.node)},defaultValue:null,...e}},initialState(){return`idle`},context({prop:e,bindable:t}){return{value:t(()=>({defaultValue:e(`defaultValue`),value:e(`value`),onChange(t){e(`onValueChange`)?.({value:t})}})),focusedValue:t(()=>({defaultValue:e(`value`)||e(`defaultValue`),sync:!0,onChange(t){e(`onFocusChange`)?.({focusedValue:t})}})),ssr:t(()=>({defaultValue:!0})),indicatorRect:t(()=>({defaultValue:null})),animateIndicator:t(()=>({defaultValue:!1}))}},refs(){return{indicatorCleanup:null,prevValue:null}},watch({context:e,prop:t,track:n,action:r}){n([()=>e.get(`value`)],()=>{r([`syncIndicatorAnimation`,`syncIndicatorRect`,`syncTabIndex`,`navigateIfNeeded`])}),n([()=>t(`dir`),()=>t(`orientation`)],()=>{r([`syncIndicatorRect`])})},on:{SET_VALUE:{actions:[`setValue`]},CLEAR_VALUE:{actions:[`clearValue`]},SET_INDICATOR_RECT:{actions:[`setIndicatorRect`]},SYNC_TAB_INDEX:{actions:[`syncTabIndex`]},INDICATOR_TRANSITION_END:{actions:[`clearIndicatorAnimation`]}},entry:[`syncPrevValue`,`syncIndicatorRect`,`syncTabIndex`,`syncSsr`],exit:[`cleanupObserver`],states:{idle:{on:{TAB_FOCUS:{target:`focused`,actions:[`setFocusedValue`]},TAB_CLICK:{target:`focused`,actions:[`setFocusedValue`,`setValue`]}}},focused:{on:{TAB_CLICK:{actions:[`setFocusedValue`,`setValue`]},ARROW_PREV:[{guard:`selectOnFocus`,actions:[`focusPrevTab`,`selectFocusedTab`]},{actions:[`focusPrevTab`]}],ARROW_NEXT:[{guard:`selectOnFocus`,actions:[`focusNextTab`,`selectFocusedTab`]},{actions:[`focusNextTab`]}],HOME:[{guard:`selectOnFocus`,actions:[`focusFirstTab`,`selectFocusedTab`]},{actions:[`focusFirstTab`]}],END:[{guard:`selectOnFocus`,actions:[`focusLastTab`,`selectFocusedTab`]},{actions:[`focusLastTab`]}],TAB_FOCUS:{actions:[`setFocusedValue`]},TAB_BLUR:{target:`idle`,actions:[`clearFocusedValue`]}}}},implementations:{guards:{selectOnFocus:({prop:e})=>e(`activationMode`)===`automatic`},actions:{selectFocusedTab({context:e,prop:t}){Co(()=>{let n=e.get(`focusedValue`);if(!n)return;let r=t(`deselectable`)&&e.get(`value`)===n?null:n;e.set(`value`,r)})},setFocusedValue({context:e,event:t,flush:n}){t.value!=null&&n(()=>{e.set(`focusedValue`,t.value)})},clearFocusedValue({context:e}){e.set(`focusedValue`,null)},setValue({context:e,event:t,prop:n}){let r=n(`deselectable`)&&e.get(`value`)===e.get(`focusedValue`);e.set(`value`,r?null:t.value)},clearValue({context:e}){e.set(`value`,null)},focusFirstTab({scope:e}){Co(()=>{cc(e)?.focus()})},focusLastTab({scope:e}){Co(()=>{lc(e)?.focus()})},focusNextTab({context:e,prop:t,scope:n,event:r}){let i=r.value??e.get(`focusedValue`);if(!i)return;let a=uc(n,{value:i,loopFocus:t(`loopFocus`)});Co(()=>{t(`composite`)?a?.focus():a?.dataset.value!=null&&e.set(`focusedValue`,a.dataset.value)})},focusPrevTab({context:e,prop:t,scope:n,event:r}){let i=r.value??e.get(`focusedValue`);if(!i)return;let a=dc(n,{value:i,loopFocus:t(`loopFocus`)});Co(()=>{t(`composite`)?a?.focus():a?.dataset.value!=null&&e.set(`focusedValue`,a.dataset.value)})},syncTabIndex({context:e,scope:t}){Co(()=>{let n=e.get(`value`);if(!n)return;let r=ic(t,n);r&&(mo(r).length>0?r.removeAttribute(`tabindex`):r.setAttribute(`tabindex`,`0`))})},cleanupObserver({refs:e}){let t=e.get(`indicatorCleanup`);t&&t()},setIndicatorRect({context:e,event:t,scope:n}){let r=t.id??e.get(`value`);oc(n)&&r&&ac(n,r)&&e.set(`indicatorRect`,pc(n,r))},syncSsr({context:e}){e.set(`ssr`,!1)},syncPrevValue({context:e,refs:t}){t.set(`prevValue`,e.get(`value`))},syncIndicatorAnimation({context:e,refs:t}){let n=t.get(`prevValue`),r=e.get(`value`),i=n!=null&&r!=null&&n!==r;e.set(`animateIndicator`,i),t.set(`prevValue`,r)},clearIndicatorAnimation({context:e}){e.set(`animateIndicator`,!1)},syncIndicatorRect({context:e,refs:t,scope:n}){let r=t.get(`indicatorCleanup`);if(r&&r(),!oc(n))return;let i=()=>{let t=ac(n,e.get(`value`));if(!t)return;let r=fc(t);e.set(`indicatorRect`,e=>Yn(e,r)?e:r)};i();let a=sc(n),o=rc(n),s=fr(...a.map(e=>Xo.observe(e,i)),...o?[Xo.observe(o,i)]:[]);t.set(`indicatorCleanup`,s)},navigateIfNeeded({context:e,prop:t,scope:n}){let r=e.get(`value`);if(!r)return;let i=ac(n,r);zi(i)&&t(`navigate`)?.({value:r,node:i,href:i.href})}}}}),[vc,yc]=Mr({name:`TabsContext`,hookName:`useTabsContext`,providerName:`<TabsProvider />`}),[bc,xc]=Mr({name:`RenderStrategyContext`,hookName:`useRenderStrategyContext`,providerName:`<RenderStrategyPropsProvider />`}),Sc=e=>Cs()(e,[`lazyMount`,`unmountOnExit`,`hideMode`]),Cc=Cs(),wc=(0,P.forwardRef)((e,t)=>{let[n,r]=Cc(e,[`value`]),i=yc(),a=Ws({...xc(),present:i.value===e.value,immediate:!0}),o=L(i.getContentProps(n),a.getPresenceProps(),r),s=Ir(a.ref,t);return(0,F.jsx)(Ks,{value:a,children:(0,F.jsx)(Gs,{presence:a,children:(0,F.jsx)(z.div,{...o,ref:s})})})});wc.displayName=`TabContent`;var Tc=(0,P.forwardRef)((e,t)=>{let n=L(yc().getIndicatorProps(),e);return(0,F.jsx)(z.div,{...n,ref:t})});Tc.displayName=`TabIndicator`;var Ec=(0,P.forwardRef)((e,t)=>{let n=L(yc().getListProps(),e);return(0,F.jsx)(z.div,{...n,ref:t})});Ec.displayName=`TabList`;var Dc=Cs(),Oc=(0,P.forwardRef)((e,t)=>{let[n,r]=Dc(e,[`disabled`,`value`]),i=L(yc().getTriggerProps(n),r);return(0,F.jsx)(z.button,{...i,ref:t})});Oc.displayName=`TabTrigger`;var kc=e=>e.children(yc()),Ac=e=>{let t=(0,P.useId)(),{getRootNode:n}=Pr(),{dir:r}=bs();return mc(Fs(_c,{id:t,dir:r,getRootNode:n,...e}),Bs)},jc=Cs(),Mc=(0,P.forwardRef)((e,t)=>{let[n,r]=Sc(e),[i,a]=jc(r,[`activationMode`,`composite`,`defaultValue`,`deselectable`,`id`,`ids`,`loopFocus`,`navigate`,`onFocusChange`,`onValueChange`,`orientation`,`translations`,`value`]),o=Ac(i),s=L(o.getRootProps(),a);return(0,F.jsx)(vc,{value:o,children:(0,F.jsx)(bc,{value:n,children:(0,F.jsx)(z.div,{...s,ref:t})})})});Mc.displayName=`TabsRoot`;var Nc=Cs(),Pc=(0,P.forwardRef)((e,t)=>{let[n,r]=Sc(e),[{value:i},a]=Nc(r,[`value`]),o=L(i.getRootProps(),a);return(0,F.jsx)(vc,{value:i,children:(0,F.jsx)(bc,{value:n,children:(0,F.jsx)(z.div,{...o,ref:t})})})});Pc.displayName=`TabsRootProvider`;var Fc=Ss({Content:()=>wc,Context:()=>kc,Indicator:()=>Tc,List:()=>Ec,Root:()=>Mc,RootProvider:()=>Pc,Trigger:()=>Oc});function Ic(e){let{key:t,recipe:n}=e,r=tn();return(0,P.useMemo)(()=>n?r.sva(n):t==null?r.sva({slots:[]}):r.getSlotRecipeFn(t),[t,n,r])}var Lc=e=>{let{key:t,recipe:n}=e,r=Sn(t||n.className||`Component`),[i,a]=$t({name:`${r}StylesContext`,errorMessage:`use${r}Styles returned is 'undefined'. Seems you forgot to wrap the components in "<${r}.Root />" `}),[o,s]=$t({name:`${r}ClassNameContext`,errorMessage:`use${r}ClassNames returned is 'undefined'. Seems you forgot to wrap the components in "<${r}.Root />" `,strict:!1}),[c,l]=$t({strict:!1,name:`${r}PropsContext`,providerName:`${r}PropsContext`,defaultValue:{}});function u(e){let{unstyled:r,...i}=e,a=Ic({key:t,recipe:i.recipe||n}),[o,s]=(0,P.useMemo)(()=>a.splitVariantProps(i),[i,a]);return{styles:(0,P.useMemo)(()=>r?En:a(o),[r,o,a]),classNames:a.classNameMap,props:s}}function d(e,t={}){let{defaultProps:n,displayName:a}=t,s=xn(e),c=wn(r,s),d=t=>{let r=l(),{styles:a,classNames:s,props:c}=u((0,P.useMemo)(()=>Bt(n,r,t),[r,t]));return(0,F.jsx)(i,{value:a,children:(0,F.jsx)(o,{value:s,children:(0,F.jsx)(e,{...c})})})};return d.displayName=a??c??s,d}return{StylesProvider:i,ClassNamesProvider:o,PropsProvider:c,usePropsContext:l,useRecipeResult:u,withProvider:(e,t,n)=>{let{defaultProps:a,displayName:s,wrapElement:c,...d}=n??{},f=Cn(r,String(t)),p=yn(e,{},d),m=(0,P.forwardRef)((e,n)=>{let r=l(),s=(0,P.useMemo)(()=>Bt(a??{},r,e),[r,e]),{styles:d,props:f,classNames:m}=u(s),h=m[t],g=(0,F.jsx)(i,{value:d,children:(0,F.jsx)(o,{value:m,children:(0,F.jsx)(p,{ref:n,...f,css:[d[t],s.css],className:Jt(s.className,h)})})});return c?.(g,s)??g});return m.displayName=s??f??xn(e),m},withContext:(e,t,n)=>{let{displayName:i,...o}=n??{},c=t!=null&&t!==``?Cn(r,String(t)):r,l=yn(e,{},o),u=(0,P.forwardRef)((e,n)=>{let{unstyled:r,...i}=e,o=a(),c=s()?.[t];return(0,F.jsx)(l,{...i,css:[!r&&t?o[t]:void 0,e.css],ref:n,className:Jt(e.className,c)})});return u.displayName=i??c??xn(e),u},withRootProvider:d,useStyles:a,useClassNames:s}},{withProvider:Rc,withContext:zc,useStyles:Bc,PropsProvider:Vc}=Lc({key:`tabs`});Rc(Fc.RootProvider,`root`,{forwardAsChild:!0});var Hc=Rc(Fc.Root,`root`,{forwardAsChild:!0}),Uc=zc(Fc.Trigger,`trigger`,{forwardAsChild:!0}),Wc=zc(Fc.Content,`content`,{forwardAsChild:!0});zc(`div`,`contentGroup`);var Gc=zc(Fc.List,`list`,{forwardAsChild:!0});zc(Fc.Indicator,`indicator`,{forwardAsChild:!0});var{withContext:Kc,PropsProvider:qc}=On({key:`text`}),V=Kc(`p`),Jc=B(`accordion`).parts(`root`,`item`,`itemTrigger`,`itemContent`,`itemIndicator`);Jc.build();var Yc=B(`avatar`).parts(`root`,`image`,`fallback`);Yc.build();var Xc=new WeakMap,Zc=new WeakMap,Qc={},$c=0,el=e=>e&&(e.host||el(e.parentNode)),tl=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=el(t);return n&&e.contains(n)?n:(console.error(`[zag-js > ariaHidden] target`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(e=>!!e),nl=new Set([`script`,`output`,`status`,`next-route-announcer`]),rl=e=>nl.has(e.localName)||e.role===`status`||e.hasAttribute(`aria-live`)?!0:e.matches(`[data-live-announcer]`),il=(e,t)=>{let{parentNode:n,markerName:r,controlAttribute:i,explicitBooleanValue:a,followControlledElements:o=!0}=t,s=tl(n,Array.isArray(e)?e:[e]);Qc[r]||(Qc[r]=new WeakMap);let c=Qc[r],l=[],u=new Set,d=new Set(s),f=e=>{e&&!u.has(e)&&(u.add(e),f(e.parentNode))};s.forEach(e=>{f(e),o&&ji(e)&&aa(e,e=>{f(e)})});let p=e=>{e&&!d.has(e)&&Array.prototype.forEach.call(e.children,e=>{if(u.has(e))p(e);else try{if(rl(e))return;let t=e.getAttribute(i),n=a?t===`true`:t!==null&&t!==`false`,o=(Xc.get(e)||0)+1,s=(c.get(e)||0)+1;Xc.set(e,o),c.set(e,s),l.push(e),o===1&&n&&Zc.set(e,!0),s===1&&e.setAttribute(r,``),n||e.setAttribute(i,a?`true`:``)}catch(t){console.error(`[zag-js > ariaHidden] cannot operate on `,e,t)}})};return p(n),u.clear(),$c++,()=>{l.forEach(e=>{let t=Xc.get(e)-1,n=c.get(e)-1;Xc.set(e,t),c.set(e,n),t||(Zc.has(e)||e.removeAttribute(i),Zc.delete(e)),n||e.removeAttribute(r)}),$c--,$c||(Xc=new WeakMap,Xc=new WeakMap,Zc=new WeakMap,Qc={})}},al=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,ol=(e,t=al(e),n=`data-aria-hidden`,r=!0)=>{if(t)return il(e,{parentNode:t,markerName:n,controlAttribute:`aria-hidden`,explicitBooleanValue:!0,followControlledElements:r})},sl=e=>{let t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function cl(e,t={}){let{defer:n=!0}=t,r=n?sl:e=>e(),i=[];return i.push(r(()=>{let t=(typeof e==`function`?e():e).filter(Boolean);t.length!==0&&i.push(ol(t))})),()=>{i.forEach(e=>e?.())}}function ll(e){let t={each(t){for(let n=0;n<e.frames?.length;n+=1){let r=e.frames[n];r&&t(r)}},addEventListener(e,n,r){return t.each(t=>{try{t.document.addEventListener(e,n,r)}catch{}}),()=>{try{t.removeEventListener(e,n,r)}catch{}}},removeEventListener(e,n,r){t.each(t=>{try{t.document.removeEventListener(e,n,r)}catch{}})}};return t}function ul(e){let t=e.frameElement==null?null:e.parent;return{addEventListener:(e,n,r)=>{try{t?.addEventListener(e,n,r)}catch{}return()=>{try{t?.removeEventListener(e,n,r)}catch{}}},removeEventListener:(e,n,r)=>{try{t?.removeEventListener(e,n,r)}catch{}}}}var dl=`pointerdown.outside`,fl=`focus.outside`;function pl(e){for(let t of e)if(ji(t)&&ho(t))return!0;return!1}var ml=e=>`clientY`in e;function hl(e,t){if(!ml(t)||!e)return!1;let n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function gl(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function _l(e,t){if(!t||!ml(e))return!1;let n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,i=t.scrollWidth>t.clientWidth,a=i&&e.clientY>t.offsetTop+t.clientHeight;return gl({x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(i?16:0)},{x:e.clientX,y:e.clientY})?r||a:!1}function vl(e,t){let{exclude:n,onFocusOutside:r,onPointerDownOutside:i,onInteractOutside:a,defer:o,followControlledElements:s=!0}=t;if(!e)return;let c=qi(e),l=Yi(e),u=ll(l),d=ul(l);function f(t,r){if(!ji(r)||!r.isConnected||Ki(e,r)||hl(e,t)||s&&ia(e,r))return!1;let i=c.querySelector(`[aria-controls="${e.id}"]`);return i&&_l(t,jo(i))||_l(t,jo(e))?!1:!n?.(r)}let p=new Set,m=Li(e?.getRootNode()),h=!1;function g(t){h=!0;let n=()=>{h=!1};c.addEventListener(`pointerup`,n,{once:!0}),l.addEventListener(`pointerup`,n,{once:!0});function r(n){let r=o&&!Ca()?Co:e=>e(),s=n??t,c=s?.composedPath?.()??[s?.target];r(()=>{let n=m?c[0]:Na(t);if(e&&f(t,n)){if(i||a){let t=fr(i,a);e.addEventListener(dl,t,{once:!0})}bl(e,dl,{bubbles:!1,cancelable:!0,detail:{originalEvent:s,contextmenu:za(s),focusable:pl(c),target:n}})}})}t.pointerType===`touch`?(p.forEach(e=>e()),p.add(Ka(c,`click`,r,{once:!0})),p.add(d.addEventListener(`click`,r,{once:!0})),p.add(u.addEventListener(`click`,r,{once:!0}))):r()}let _=new Set,v=setTimeout(()=>{_.add(Ka(c,`pointerdown`,g,!0)),_.add(d.addEventListener(`pointerdown`,g,!0)),_.add(u.addEventListener(`pointerdown`,g,!0))},0);function y(t){h||(o?Co:e=>e())(()=>{let n=t?.composedPath?.()??[t?.target],i=m?n[0]:Na(t);if(e&&f(t,i)){if(r||a){let t=fr(r,a);e.addEventListener(fl,t,{once:!0})}bl(e,fl,{bubbles:!1,cancelable:!0,detail:{originalEvent:t,contextmenu:!1,focusable:ho(i),target:i}})}})}return Ca()||(_.add(Ka(c,`focusin`,y,!0)),_.add(d.addEventListener(`focusin`,y,!0)),_.add(u.addEventListener(`focusin`,y,!0))),()=>{clearTimeout(v),p.forEach(e=>e()),_.forEach(e=>e())}}function yl(e,t){let{defer:n}=t,r=n?Co:e=>e(),i=[];return i.push(r(()=>{let n=typeof e==`function`?e():e;i.push(vl(n,t))})),()=>{i.forEach(e=>e?.())}}function bl(e,t,n){let r=new(e.ownerDocument.defaultView||window).CustomEvent(t,n);return e.dispatchEvent(r)}function xl(e,t){return Ka(qi(e),`keydown`,e=>{e.key===`Escape`&&(e.isComposing||t?.(e))},{capture:!0})}var Sl=`layer:request-dismiss`,Cl={layers:[],branches:[],recentlyRemoved:new Set,count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){return this.indexOf(e)<(this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1)},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},getLayersByType(e){return this.layers.filter(t=>t.type===e)},getNestedLayersByType(e,t){let n=this.indexOf(e);return n===-1?[]:this.layers.slice(n+1).filter(e=>e.type===t)},getParentLayerOfType(e,t){let n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(e=>e.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return!!(this.getNestedLayers(e).some(e=>Ki(e.node,t))||this.recentlyRemoved.size>0)},isInBranch(e){return Array.from(this.branches).some(t=>Ki(t,e))},add(e){let t=this.indexOf(e.node);t!==-1&&this.layers.splice(t,1),this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){let t=this.indexOf(e);t<0||(this.layers[t].styleTargets?.forEach(e=>{let t=e();t&&Tl(t)}),this.recentlyRemoved.add(e),wo(()=>this.recentlyRemoved.delete(e)),t<this.count()-1&&this.getNestedLayers(e).forEach(t=>Cl.dismiss(t.node,e)),this.layers.splice(t,1),this.syncLayers())},removeBranch(e){let t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},syncLayers(){this.layers.forEach((e,t)=>{wl(e,t,e.node),e.styleTargets?.forEach(n=>{let r=n();if(!r||r===e.node)return;wl(e,t,r);let{zIndex:i}=ea(e.node);r.style.setProperty(`--z-index`,i)})})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){let n=this.indexOf(e);if(n===-1)return;let r=this.layers[n];Dl(e,Sl,e=>{r.requestDismiss?.(e),e.defaultPrevented||r?.dismiss()}),El(e,Sl,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function wl(e,t,n){n.style.setProperty(`--layer-index`,`${t}`),n.removeAttribute(`data-nested`),n.removeAttribute(`data-has-nested`),Cl.getParentLayerOfType(e.node,e.type)&&n.setAttribute(`data-nested`,e.type);let r=Cl.countNestedLayersOfType(e.node,e.type);r>0&&n.setAttribute(`data-has-nested`,e.type),n.style.setProperty(`--nested-layer-count`,`${r}`)}function Tl(e){e.style.removeProperty(`--layer-index`),e.style.removeProperty(`--nested-layer-count`),e.style.removeProperty(`--z-index`),e.removeAttribute(`data-nested`),e.removeAttribute(`data-has-nested`)}function El(e,t,n){let r=new(e.ownerDocument.defaultView||window).CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(r)}function Dl(e,t,n){e.addEventListener(t,n,{once:!0})}var Ol=new WeakMap,kl=new WeakMap;function Al(e){return Cl.isBelowPointerBlockingLayer(e)?`none`:`auto`}function jl(e){let t=Al(e);e.style.pointerEvents!==t&&(e.style.pointerEvents=t)}function Ml(e){if(kl.has(e))return;let t=Yi(e);if(t.MutationObserver===void 0)return;let n=new t.MutationObserver(()=>{kl.has(e)&&jl(e)});n.observe(e,{attributes:!0,attributeFilter:[`style`]}),kl.set(e,n)}function Nl(){Cl.layers.forEach(({node:e})=>{jl(e),Ml(e)})}function Pl(e){let t=kl.get(e);t&&(t.disconnect(),kl.delete(e)),e.style.pointerEvents=``}function Fl(e,t){let n=qi(e),r=[];return Cl.hasPointerBlockingLayer()&&!n.body.hasAttribute(`data-inert`)&&(Ol.set(n.body,n.body.style.pointerEvents),queueMicrotask(()=>{let e=n.body;e&&(e.style.pointerEvents=`none`,e.setAttribute(`data-inert`,``))})),t?.forEach(e=>{let[t,n]=ds(()=>{let t=e();return ji(t)?t:null},{timeout:1e3});t.then(e=>r.push(rs(e,{pointerEvents:`auto`}))),r.push(n)}),()=>{Cl.hasPointerBlockingLayer()||(queueMicrotask(()=>{let e=n.body;if(!e)return;let t=Ol.get(e);t!==void 0&&(e.style.pointerEvents=t,Ol.delete(e)),e.removeAttribute(`data-inert`),e.style.length===0&&e.removeAttribute(`style`)}),r.forEach(e=>e()))}}function Il(e,t){let{onDismiss:n,onRequestDismiss:r,pointerBlocking:i,exclude:a,debug:o,type:s=`dialog`,layerStyleTargets:c}=t,l={dismiss:n,node:e,type:s,pointerBlocking:i,requestDismiss:r,styleTargets:c};Cl.add(l),Nl();function u(r){let i=Na(r.detail.originalEvent);Cl.isBelowPointerBlockingLayer(e)||Cl.isInBranch(i)||(t.onPointerDownOutside?.(r),t.onInteractOutside?.(r),!r.defaultPrevented&&(o&&console.log(`onPointerDownOutside:`,r.detail.originalEvent),n?.()))}function d(e){let r=Na(e.detail.originalEvent);Cl.isInBranch(r)||(t.onFocusOutside?.(e),t.onInteractOutside?.(e),!e.defaultPrevented&&(o&&console.log(`onFocusOutside:`,e.detail.originalEvent),n?.()))}function f(r){Cl.isTopMost(e)&&(t.onEscapeKeyDown?.(r),!r.defaultPrevented&&n&&(r.preventDefault(),n()))}function p(n){let r=typeof a==`function`?a():a,i=Array.isArray(r)?r:[r],o=t.persistentElements?.map(e=>e()).filter(ji);return o&&i.push(...o),i.some(e=>Ki(e,n))||Cl.isInNestedLayer(e,n)}let m=[i?Fl(e,t.persistentElements):void 0,xl(e,f),yl(e,{exclude:p,onFocusOutside:d,onPointerDownOutside:u,defer:t.defer})];return()=>{Cl.remove(e),Nl(),Pl(e),m.forEach(e=>e?.())}}function Ll(e,t){let{warnOnMissingNode:n=!0}=t;return fs(e,e=>Il(e,t),{defer:t.defer,onMissing:n?()=>Dr("[@zag-js/dismissable] node is `null` or `undefined`"):void 0})}var Rl=Object.defineProperty,zl=(e,t,n)=>t in e?Rl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bl=(e,t,n)=>zl(e,typeof t==`symbol`?t:t+``,n),Vl={activateTrap(e,t){if(e.length>0){let n=e[e.length-1];n!==t&&n.pause()}let n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},Hl=[],Ul=class{constructor(e,t){Bl(this,`trapStack`),Bl(this,`config`),Bl(this,`doc`),Bl(this,`state`,{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),Bl(this,`lastInteractionType`,`keyboard`),Bl(this,`portalContainers`,new Set),Bl(this,`listenerCleanups`,[]),Bl(this,`handleFocus`,e=>{let t=Na(e),n=this.findContainerIndex(t,e)>=0;if(n||Mi(t))n&&(this.state.mostRecentlyFocusedNode=t);else{e.stopImmediatePropagation();let t,n=!0;if(this.state.mostRecentlyFocusedNode){if(yo(this.state.mostRecentlyFocusedNode)>0){let e=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:r}=this.state.containerGroups[e];if(r.length>0){let e=r.findIndex(e=>e===this.state.mostRecentlyFocusedNode);e>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?e+1<r.length&&(t=r[e+1],n=!1):e-1>=0&&(t=r[e-1],n=!1))}}else this.state.containerGroups.some(e=>e.tabbableNodes.some(e=>yo(e)>0))||(n=!1)}else n=!1;n&&(t=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),t?this.tryFocus(t):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),Bl(this,`handlePointerDown`,e=>{this.lastInteractionType=`pointer`;let t=Na(e);if(!(this.findContainerIndex(t,e)>=0)){if(Jl(this.config.clickOutsideDeactivates,e)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}Jl(this.config.allowOutsideClick,e)||e.preventDefault()}}),Bl(this,`handleClick`,e=>{let t=Na(e);this.findContainerIndex(t,e)>=0||Jl(this.config.clickOutsideDeactivates,e)||Jl(this.config.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())}),Bl(this,`handleTabKey`,e=>{if(this.lastInteractionType=`keyboard`,this.config.isKeyForward(e)||this.config.isKeyBackward(e)){this.state.recentNavEvent=e;let t=this.config.isKeyBackward(e),n=this.findNextNavNode({event:e,isBackward:t});if(!n)return;Gl(e)&&e.preventDefault(),this.tryFocus(n)}}),Bl(this,`handleEscapeKey`,e=>{Yl(e)&&Jl(this.config.escapeDeactivates,e)!==!1&&(e.preventDefault(),this.deactivate())}),Bl(this,`_mutationObserver`),Bl(this,`setupMutationObserver`,()=>{let e=this.doc.defaultView||window;this._mutationObserver=new e.MutationObserver(e=>{e.some(e=>Array.from(e.removedNodes).some(e=>e===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode()),e.some(e=>e.type===`attributes`&&(e.attributeName===`aria-controls`||e.attributeName===`aria-expanded`)||e.type===`childList`&&e.addedNodes.length>0&&Array.from(e.addedNodes).some(e=>{if(e.nodeType!==Node.ELEMENT_NODE)return!1;let t=e;return la(t)?!0:t.id&&!this.state.containers.some(e=>e.contains(t))?ua(t):!1}))&&this.state.active&&!this.state.paused&&(this.updateTabbableNodes(),this.updatePortalContainers())})}),Bl(this,`updateObservedNodes`,()=>{this._mutationObserver?.disconnect(),this.state.active&&!this.state.paused&&(this.state.containers.map(e=>{this._mutationObserver?.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`aria-controls`,`aria-expanded`]})}),this.portalContainers.forEach(e=>{this.observePortalContainer(e)}))}),Bl(this,`getInitialFocusNode`,()=>{let e=this.getNodeForOption(`initialFocus`,{hasFallback:!0});if(e===!1)return!1;if(e===void 0||e&&!ho(e)){let t=Xi(this.doc);if(t&&this.findContainerIndex(t)>=0)e=t;else{let t=this.state.tabbableGroups[0];e=t&&t.firstTabbableNode||this.getNodeForOption(`fallbackFocus`)}}else e===null&&(e=this.getNodeForOption(`fallbackFocus`));if(!e||(e.isConnected||(e=this.getNodeForOption(`fallbackFocus`)),!e||!e.isConnected))throw Error(`Your focus-trap needs to have at least one focusable element`);return e}),Bl(this,`tryFocus`,(e,t)=>{if(e!==!1&&e!==Xi(this.doc)){if(!e||!e.focus){this.tryFocus(this.getInitialFocusNode());return}e.focus({preventScroll:!!this.config.preventScroll,...t}),this.state.mostRecentlyFocusedNode=e,Zl(e)&&e.select()}}),Bl(this,`deactivate`,e=>{if(!this.state.active)return this;let t={onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus,...e};clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),Vl.deactivateTrap(this.trapStack,this),this.portalContainers.clear();let n=this.getOption(t,`onDeactivate`),r=this.getOption(t,`onPostDeactivate`),i=this.getOption(t,`checkCanReturnFocus`),a=this.getOption(t,`returnFocus`,`returnFocusOnDeactivate`);n?.();let o=()=>{Xl(()=>{if(a&&this.isSafeToOverrideFocus()){let e=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation),t=this.lastInteractionType===`keyboard`?{focusVisible:!0}:void 0;this.tryFocus(e,t)}r?.()})};return a&&i?(i(this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation)).then(o,o),this):(o(),this)}),Bl(this,`pause`,e=>{if(this.state.paused||!this.state.active)return this;let t=this.getOption(e,`onPause`),n=this.getOption(e,`onPostPause`);return this.state.paused=!0,t?.(),this.removeListeners(),this.updateObservedNodes(),n?.(),this}),Bl(this,`unpause`,e=>{if(!this.state.paused||!this.state.active)return this;let t=this.getOption(e,`onUnpause`),n=this.getOption(e,`onPostUnpause`);this.state.paused=!1,t?.();try{this.updateTabbableNodes()}catch{}this.attachListeners();try{this.commitInitialFocus()}catch{}return this.updateObservedNodes(),n?.(),this}),Bl(this,`updateContainerElements`,e=>(this.state.containers=Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),Bl(this,`getReturnFocusNode`,e=>{let t=this.getNodeForOption(`setReturnFocus`,{params:[e]});return t||t!==!1&&e}),Bl(this,`getOption`,(e,t,n)=>e&&e[t]!==void 0?e[t]:this.config[n||t]),Bl(this,`getNodeForOption`,(e,{hasFallback:t=!1,params:n=[]}={})=>{let r=this.config[e];if(typeof r==`function`&&(r=r(...n)),r===!0&&(r=void 0),!r){if(r===void 0||r===!1)return r;throw Error(`\`${e}\` was specified but was not a node, or did not return a node`)}let i=r;if(typeof r==`string`){try{i=this.doc.querySelector(r)}catch(t){throw Error(`\`${e}\` appears to be an invalid selector; error="${t.message}"`)}if(!i&&!t)throw Error(`\`${e}\` as selector refers to no known node`)}return i}),Bl(this,`findNextNavNode`,e=>{let{event:t,isBackward:n=!1}=e,r=e.target||Na(t);this.updateTabbableNodes();let i=null;if(this.state.tabbableGroups.length>0){let e=this.findContainerIndex(r,t),a=e>=0?this.state.containerGroups[e]:void 0;if(e<0)i=n?this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:this.state.tabbableGroups[0].firstTabbableNode;else if(n){let n=this.state.tabbableGroups.findIndex(({firstTabbableNode:e})=>r===e);if(n<0&&(a?.container===r||ho(r)&&!_o(r)&&!a?.nextTabbableNode(r,!1))&&(n=e),n>=0){let e=n===0?this.state.tabbableGroups.length-1:n-1,t=this.state.tabbableGroups[e];i=yo(r)>=0?t.lastTabbableNode:t.lastDomTabbableNode}else Gl(t)||(i=a?.nextTabbableNode(r,!1))}else{let n=this.state.tabbableGroups.findIndex(({lastTabbableNode:e})=>r===e);if(n<0&&(a?.container===r||ho(r)&&!_o(r)&&!a?.nextTabbableNode(r))&&(n=e),n>=0){let e=n===this.state.tabbableGroups.length-1?0:n+1,t=this.state.tabbableGroups[e];i=yo(r)>=0?t.firstTabbableNode:t.firstDomTabbableNode}else Gl(t)||(i=a?.nextTabbableNode(r))}}else i=this.getNodeForOption(`fallbackFocus`);return i}),this.trapStack=t.trapStack||Hl;let n={returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,followControlledElements:!0,isKeyForward:Kl,isKeyBackward:ql,...t};this.doc=n.document||qi(Array.isArray(e)?e[0]:e),this.config=n,this.updateContainerElements(e),this.setupMutationObserver()}addPortalContainer(e){let t=e.parentElement;t&&!this.portalContainers.has(t)&&(this.portalContainers.add(t),this.state.active&&!this.state.paused&&this.observePortalContainer(t))}observePortalContainer(e){this._mutationObserver?.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`aria-controls`,`aria-expanded`]})}updatePortalContainers(){this.config.followControlledElements&&this.state.containers.forEach(e=>{oa(e).forEach(e=>{this.addPortalContainer(e)})})}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(e,t){let n=typeof t?.composedPath==`function`?t.composedPath():void 0;return this.state.containerGroups.findIndex(({container:r,tabbableNodes:i})=>r.contains(e)||n?.includes(r)||i.find(t=>t===e)||this.isControlledElement(r,e)||this.isPersistentElement(e,t))}isControlledElement(e,t){return this.config.followControlledElements?ia(e,t):!1}isPersistentElement(e,t){let n=this.config.persistentElements;if(!n||n.length===0)return!1;let r=typeof t?.composedPath==`function`?t.composedPath():void 0;return n.some(t=>{let n=t();return Ki(n,e)||n!=null&&r?.includes(n)})}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(e=>{let t=go(e,{getShadowRoot:this.config.getShadowRoot}),n=mo(e,{getShadowRoot:this.config.getShadowRoot}),r=t[0],i=t[t.length-1],a=r,o=i,s=!1;for(let e=0;e<t.length;e++)if(yo(t[e])>0){s=!0;break}function c(e,r=!0){let i=t.indexOf(e);if(i>=0)return t[i+(r?1:-1)];let a=n.indexOf(e);if(!(a<0)){if(r){for(let e=a+1;e<n.length;e++)if(_o(n[e]))return n[e]}else for(let e=a-1;e>=0;e--)if(_o(n[e]))return n[e]}}return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:s,firstTabbableNode:r,lastTabbableNode:i,firstDomTabbableNode:a,lastDomTabbableNode:o,nextTabbableNode:c}}),this.state.tabbableGroups=this.state.containerGroups.filter(e=>e.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption(`fallbackFocus`))throw Error(`Your focus-trap must have at least one container with at least one tabbable node in it at all times`);if(this.state.containerGroups.find(e=>e.posTabIndexesFound)&&this.state.containerGroups.length>1)throw Error(`At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.`)}attachListeners(){if(this.state.active)return Vl.activateTrap(this.trapStack,this),this.listenerCleanups.push(Ka(this.doc,`focusin`,this.handleFocus,!0),Ka(this.doc,`mousedown`,this.handlePointerDown,{capture:!0,passive:!1}),Ka(this.doc,`touchstart`,this.handlePointerDown,{capture:!0,passive:!1}),Ka(this.doc,`click`,this.handleClick,{capture:!0,passive:!1}),Ka(this.doc,`keydown`,this.handleTabKey,{capture:!0,passive:!1}),Ka(this.doc,`keydown`,this.handleEscapeKey)),this}commitInitialFocus(){return this.state.delayInitialFocusTimer=this.config.delayInitialFocus?Xl(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this}addListeners(){if(this.state.active)return this.attachListeners(),this.commitInitialFocus(),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(e=>e()),this.listenerCleanups=[],this}containsElement(e){return this.state.containers.some(t=>Ki(t,e))}isSafeToOverrideFocus(){let e=Xi(this.doc);return!e||e===this.doc.body||this.containsElement(e)?!0:this.trapStack.some(t=>t!==this&&t.containsElement(e))}activate(e){if(this.state.active)return this;let t=this.getOption(e,`onActivate`),n=this.getOption(e,`onPostActivate`),r=this.getOption(e,`checkCanFocusTrap`);r||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=Xi(this.doc),t?.();let i=()=>{r&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),n?.()};return r?(r(this.state.containers.concat()).then(i,i),this):(i(),this)}},Wl=e=>e?.type===`keydown`,Gl=e=>Wl(e)&&e?.key===`Tab`,Kl=e=>Wl(e)&&e.key===`Tab`&&!e?.shiftKey,ql=e=>Wl(e)&&e.key===`Tab`&&e?.shiftKey,Jl=(e,...t)=>typeof e==`function`?e(...t):e,Yl=e=>!e.isComposing&&e.key===`Escape`,Xl=e=>setTimeout(e,0),Zl=e=>e.localName===`input`&&`select`in e&&typeof e.select==`function`;function Ql(e,t={}){let n,r=Co(()=>{let r=(Array.isArray(e)?e:[e]).map(e=>typeof e==`function`?e():e).filter(e=>e!=null);if(r.length===0)return;let i=r[0];n=new Ul(r,{escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:i,...t,document:qi(i)});try{n.activate()}catch{}});return function(){n?.deactivate(),r()}}var $l=`data-scroll-lock`,eu=new WeakMap;function tu(e){let t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?`paddingLeft`:`paddingRight`}function nu(e){let t=ea(e)?.scrollbarGutter;return t===`stable`||t?.startsWith(`stable `)===!0}function ru(e){let{documentElement:t,body:n}=e;return Po(t)?t:n}function iu(e){let t=e.defaultView??window,{documentElement:n,body:r}=e,i=ru(e),a=nu(n)||nu(r),o=t.innerWidth-n.clientWidth;r.setAttribute($l,``);let s=()=>is(n,`--scrollbar-width`,`${o}px`),c=tu(n),l=[s(),Ea()?(()=>{let{scrollX:e,scrollY:n,visualViewport:i}=t,s=i?.offsetLeft??0,l=i?.offsetTop??0,u={position:`fixed`,overflow:`hidden`,top:`${-(n-Math.floor(l))}px`,left:`${-(e-Math.floor(s))}px`,right:`0`};!a&&o>0&&(u[c]=`${o}px`);let d=rs(r,u);return()=>{d?.(),t.scrollTo({left:e,top:n,behavior:`instant`})}})():(()=>{let e={overflow:`hidden`};return!a&&o>0&&(e[c]=`${o}px`),rs(i,e)})()];return()=>{l.forEach(e=>e?.()),r.removeAttribute($l)}}function au(e){let t=e??document,n=eu.get(t);n||(n={count:0,cleanup:iu(t)},eu.set(t,n)),n.count++;let r=n,i=!1;return()=>{i||(i=!0,r.count--,r.count===0&&(r.cleanup(),eu.delete(t)))}}var ou=B(`carousel`).parts(`root`,`itemGroup`,`item`,`control`,`nextTrigger`,`prevTrigger`,`indicatorGroup`,`indicator`,`autoplayTrigger`,`progressText`);ou.build();var su=ou.extendWith(`progressText`,`autoplayIndicator`),cu=B(`checkbox`).parts(`root`,`label`,`control`,`indicator`),lu=cu.build();function uu(e){return!(e.metaKey||!Oa()&&e.altKey||e.ctrlKey||e.key===`Control`||e.key===`Shift`||e.key===`Meta`)}var du=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]),fu=[`a[href]`,`audio[controls]`,`button`,`details`,`embed`,`iframe`,`img[controls]`,`img[usemap]`,`input`,`select`,`textarea`,`video[controls]`].join(`,`);function pu(e,t,n){let r=n?Na(n):null,i=qi(r),a=Yi(r),o=Xi(i);return e=e||o instanceof a.HTMLInputElement&&!du.has(o?.type)||o instanceof a.HTMLTextAreaElement||o instanceof a.HTMLElement&&o.isContentEditable,!(e&&t===`keyboard`&&n instanceof a.KeyboardEvent&&!Reflect.has(xu,n.key))}var mu=null,hu=new Set,gu=new Map,_u=!1,vu=null,yu=!1,bu=null,xu={Tab:!0,Escape:!0};function Su(e,t){for(let n of hu)n(e,t)}function Cu(e){vu=null,_u=!0,uu(e)&&(mu=`keyboard`,Su(`keyboard`,e))}function wu(e){(e.type!==`pointermove`&&e.type!==`mousemove`||bu?.x!==e.clientX||bu?.y!==e.clientY)&&(bu={x:e.clientX,y:e.clientY},mu=`pointer`,(e.type===`mousedown`||e.type===`pointerdown`)&&(vu=null,_u=!0,Su(`pointer`,e)))}function Tu(e){if(La(e)){vu=null,_u=!0,mu=`virtual`;return}vu=null;let t=Na(e),n=t?.closest(`label`),r=n?.control;if(!n||!r||r.matches(`:disabled`))return;let i=t?.closest(fu);i&&n.contains(i)&&i!==r||r!==Xi(n.ownerDocument)&&(vu=r)}function Eu(e){let t=Na(e),n=t===vu;t!==Yi(t)&&t!==qi(t)&&e.isTrusted&&(!_u&&!n&&!yu&&(mu=`virtual`,Su(`virtual`,e)),_u=!1,vu=null,yu=!1)}function Du(){_u=!1,vu=null,yu=!0}function Ou(e){if(typeof window>`u`||gu.get(Yi(e)))return;let t=Yi(e),n=qi(e),r=t.HTMLElement.prototype.focus;function i(){_u=!0,r.apply(this,arguments)}try{Object.defineProperty(t.HTMLElement.prototype,"focus",{configurable:!0,value:i})}catch{}n.addEventListener(`keydown`,Cu,!0),n.addEventListener(`keyup`,Cu,!0),n.addEventListener(`click`,Tu,!0),t.addEventListener(`focus`,Eu,!0),t.addEventListener(`blur`,Du,!1),t.PointerEvent===void 0?(n.addEventListener(`mousedown`,wu,!0),n.addEventListener(`mousemove`,wu,!0),n.addEventListener(`mouseup`,wu,!0)):(n.addEventListener(`pointerdown`,wu,!0),n.addEventListener(`pointermove`,wu,!0),n.addEventListener(`pointerup`,wu,!0)),t.addEventListener(`beforeunload`,()=>{ku(e)},{once:!0}),gu.set(t,{focus:r})}var ku=(e,t)=>{let n=Yi(e),r=qi(e);t&&r.removeEventListener(`DOMContentLoaded`,t);let i=gu.get(n);if(i){try{Object.defineProperty(n.HTMLElement.prototype,"focus",{configurable:!0,value:i.focus})}catch{}r.removeEventListener(`keydown`,Cu,!0),r.removeEventListener(`keyup`,Cu,!0),r.removeEventListener(`click`,Tu,!0),n.removeEventListener(`focus`,Eu,!0),n.removeEventListener(`blur`,Du,!1),n.PointerEvent===void 0?(r.removeEventListener(`mousedown`,wu,!0),r.removeEventListener(`mousemove`,wu,!0),r.removeEventListener(`mouseup`,wu,!0)):(r.removeEventListener(`pointerdown`,wu,!0),r.removeEventListener(`pointermove`,wu,!0),r.removeEventListener(`pointerup`,wu,!0)),gu.delete(n)}};function Au(){return mu}function ju(e){mu=e,Su(e,null)}function Mu(){return mu===`keyboard`||mu===`virtual`}function Nu(e={}){let{isTextInput:t,autoFocus:n,onChange:r,root:i}=e;Ou(i),r?.({isFocusVisible:n||Mu(),modality:mu});let a=(e,n)=>{pu(!!t,e,n)&&r?.({isFocusVisible:Mu(),modality:e})};return hu.add(a),()=>{hu.delete(a)}}var Pu=e=>e.ids?.root??`checkbox:${e.id}`,Fu=e=>e.ids?.label??`checkbox:${e.id}:label`,Iu=e=>e.ids?.control??`checkbox:${e.id}:control`,Lu=e=>e.ids?.hiddenInput??`checkbox:${e.id}:input`,Ru=e=>e.getById(Pu(e)),zu=e=>e.getById(Lu(e));function Bu(e,t){let{send:n,context:r,prop:i,computed:a,scope:o}=e,s=!!i(`disabled`),c=!!i(`readOnly`),l=!!i(`required`),u=!!i(`invalid`),d=!s&&r.get(`focused`),f=!s&&r.get(`focusVisible`),p=a(`checked`),m=a(`indeterminate`),h=r.get(`checked`),g={"data-active":R(r.get(`active`)),"data-focus":R(d),"data-focus-visible":R(f),"data-readonly":R(c),"data-hover":R(r.get(`hovered`)),"data-disabled":R(s),"data-state":m?`indeterminate`:p?`checked`:`unchecked`,"data-invalid":R(u),"data-required":R(l)};return{checked:p,disabled:s,indeterminate:m,focused:d,checkedState:h,setChecked(e){n({type:`CHECKED.SET`,checked:e,isTrusted:!1})},toggleChecked(){n({type:`CHECKED.TOGGLE`,checked:p,isTrusted:!1})},getRootProps(){return t.label({...lu.root.attrs,...g,dir:i(`dir`),id:Pu(o),htmlFor:Lu(o),onPointerMove(){s||n({type:`CONTEXT.SET`,context:{hovered:!0}})},onPointerLeave(){s||n({type:`CONTEXT.SET`,context:{hovered:!1}})},onClick(e){Na(e)===zu(o)&&e.stopPropagation()}})},getLabelProps(){return t.element({...lu.label.attrs,...g,dir:i(`dir`),id:Fu(o)})},getControlProps(){return t.element({...lu.control.attrs,...g,dir:i(`dir`),id:Iu(o),"aria-hidden":!0})},getIndicatorProps(){return t.element({...lu.indicator.attrs,...g,dir:i(`dir`),hidden:!m&&!p})},getHiddenInputProps(){return t.input({id:Lu(o),type:`checkbox`,required:i(`required`),defaultChecked:p,disabled:s,"aria-labelledby":Fu(o),"aria-invalid":u,name:i(`name`),form:i(`form`),value:i(`value`),style:ls,onFocus(){let e=Mu();n({type:`CONTEXT.SET`,context:{focused:!0,focusVisible:e}})},onBlur(){n({type:`CONTEXT.SET`,context:{focused:!1,focusVisible:!1}})},onClick(e){if(c){e.preventDefault();return}let t=e.currentTarget.checked;n({type:`CHECKED.SET`,checked:t,isTrusted:!0})}})}}}var{not:Vu}=ui(),Hu=di({props({props:e}){return{value:`on`,...e,defaultChecked:e.defaultChecked??!1}},initialState(){return`ready`},context({prop:e,bindable:t}){return{checked:t(()=>({defaultValue:e(`defaultChecked`),value:e(`checked`),onChange(t){e(`onCheckedChange`)?.({checked:t})}})),fieldsetDisabled:t(()=>({defaultValue:!1})),focusVisible:t(()=>({defaultValue:!1})),active:t(()=>({defaultValue:!1})),focused:t(()=>({defaultValue:!1})),hovered:t(()=>({defaultValue:!1}))}},watch({track:e,context:t,prop:n,action:r}){e([()=>n(`disabled`)],()=>{r([`removeFocusIfNeeded`])}),e([()=>t.get(`checked`)],()=>{r([`syncInputElement`])})},effects:[`trackFormControlState`,`trackPressEvent`,`trackFocusVisible`],on:{"CHECKED.TOGGLE":[{guard:Vu(`isTrusted`),actions:[`toggleChecked`,`dispatchChangeEvent`]},{actions:[`toggleChecked`]}],"CHECKED.SET":[{guard:Vu(`isTrusted`),actions:[`setChecked`,`dispatchChangeEvent`]},{actions:[`setChecked`]}],"CONTEXT.SET":{actions:[`setContext`]}},computed:{indeterminate:({context:e})=>Uu(e.get(`checked`)),checked:({context:e})=>Wu(e.get(`checked`)),disabled:({context:e,prop:t})=>!!t(`disabled`)||e.get(`fieldsetDisabled`)},states:{ready:{}},implementations:{guards:{isTrusted:({event:e})=>!!e.isTrusted},effects:{trackPressEvent({context:e,computed:t,scope:n}){if(!t(`disabled`))return Ho({pointerNode:Ru(n),keyboardNode:zu(n),isValidKey:e=>e.key===` `,onPress:()=>e.set(`active`,!1),onPressStart:()=>e.set(`active`,!0),onPressEnd:()=>e.set(`active`,!1)})},trackFocusVisible({computed:e,scope:t}){if(!e(`disabled`))return Nu({root:t.getRootNode?.()})},trackFormControlState({context:e,scope:t}){return $a(zu(t),{onFieldsetDisabledChange(t){e.set(`fieldsetDisabled`,t)},onFormReset(){e.set(`checked`,e.initial(`checked`))}})}},actions:{setContext({context:e,event:t}){for(let n in t.context)e.set(n,t.context[n])},syncInputElement({context:e,computed:t,scope:n}){let r=zu(n);r&&(Ja(r,t(`checked`)),r.indeterminate=Uu(e.get(`checked`)))},removeFocusIfNeeded({context:e,prop:t}){t(`disabled`)&&e.get(`focused`)&&(e.set(`focused`,!1),e.set(`focusVisible`,!1))},setChecked({context:e,event:t}){e.set(`checked`,t.checked)},toggleChecked({context:e,computed:t}){let n=Uu(t(`checked`))?!0:!t(`checked`);e.set(`checked`,n)},dispatchChangeEvent({computed:e,scope:t}){queueMicrotask(()=>{Ya(zu(t),{checked:e(`checked`)})})}}}});function Uu(e){return e===`indeterminate`}function Wu(e){return!Uu(e)&&!!e}var Gu=cu.extendWith(`group`),Ku=B(`clipboard`).parts(`root`,`control`,`trigger`,`indicator`,`input`,`label`);Ku.build();var qu=B(`collapsible`).parts(`root`,`trigger`,`content`,`indicator`);qu.build();var Ju=B(`color-picker`,[`root`,`label`,`control`,`trigger`,`positioner`,`content`,`area`,`areaThumb`,`valueText`,`areaBackground`,`channelSlider`,`channelSliderLabel`,`channelSliderTrack`,`channelSliderThumb`,`channelSliderValueText`,`channelInput`,`transparencyGrid`,`swatchGroup`,`swatchTrigger`,`swatchIndicator`,`swatch`,`eyeDropperTrigger`,`formatTrigger`,`formatSelect`]);Ju.build();var Yu=[`top`,`right`,`bottom`,`left`],Xu=Math.min,Zu=Math.max,Qu=Math.round,$u=Math.floor,ed=e=>({x:e,y:e}),td={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function nd(e,t,n){return Zu(e,Xu(t,n))}function rd(e,t){return typeof e==`function`?e(t):e}function id(e){return e.split(`-`)[0]}function ad(e){return e.split(`-`)[1]}function od(e){return e===`x`?`y`:`x`}function sd(e){return e===`y`?`height`:`width`}function cd(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ld(e){return od(cd(e))}function ud(e,t,n){n===void 0&&(n=!1);let r=ad(e),i=ld(e),a=sd(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=yd(o)),[o,yd(o)]}function dd(e){let t=yd(e);return[fd(e),t,fd(t)]}function fd(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var pd=[`left`,`right`],md=[`right`,`left`],hd=[`top`,`bottom`],gd=[`bottom`,`top`];function _d(e,t,n){switch(e){case`top`:case`bottom`:return n?t?md:pd:t?pd:md;case`left`:case`right`:return t?hd:gd;default:return[]}}function vd(e,t,n,r){let i=ad(e),a=_d(id(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(fd)))),a}function yd(e){let t=id(e);return td[t]+e.slice(t.length)}function bd(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function xd(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:bd(e)}function Sd(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 Cd(e,t,n){let{reference:r,floating:i}=e,a=cd(t),o=ld(t),s=sd(o),c=id(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=ad(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function wd(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}=rd(t,e),p=xd(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Sd(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=Sd(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 Td=50,Ed=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:wd},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Cd(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<Td&&(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}=Cd(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Dd=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}=rd(e,t)||{};if(l==null)return{};let d=xd(u),f={x:n,y:r},p=ld(i),m=sd(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Xu(d[_],T),D=Xu(d[v],T),ee=C-h[m]-D,O=C/2-h[m]/2+w,k=nd(E,O,ee),te=!c.arrow&&ad(i)!=null&&O!==k&&a.reference[m]/2-(O<E?E:D)-h[m]/2<0,ne=te?O<E?O-E:O-ee:0;return{[p]:f[p]+ne,data:{[p]:k,centerOffset:O-k-ne,...te&&{alignmentOffset:ne}},reset:te}}}),Od=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}=rd(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=id(r),_=cd(o),v=id(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[yd(o)]:dd(o)),x=p!==`none`;!d&&x&&b.push(...vd(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=ud(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`||_===cd(t)||T.every(e=>cd(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=cd(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function kd(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ad(e){return Yu.some(t=>e[t]>=0)}var jd=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=rd(e,t);switch(i){case`referenceHidden`:{let e=kd(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ad(e)}}}case`escaped`:{let e=kd(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ad(e)}}}default:return{}}}}},Md=new Set([`left`,`top`]);async function Nd(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=id(n),s=ad(n),c=cd(n)===`y`,l=Md.has(o)?-1:1,u=a&&c?-1:1,d=rd(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 Pd=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 Nd(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}}}}},Fd=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}=rd(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=cd(i),p=od(f),m=u[p],h=u[f],g=(e,t)=>nd(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}}}}}},Id=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}=rd(e,t),u={x:n,y:r},d=cd(i),f=od(d),p=u[f],m=u[d],h=rd(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=Md.has(id(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}}}},Ld=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}=rd(e,t),c=await i.detectOverflow(t,s),l=id(n),u=ad(n),d=cd(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=Xu(p-c[m],g),y=Xu(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*Zu(c.left,c.right):S=p-2*Zu(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 Rd(){return typeof window<`u`}function zd(e){return Hd(e)?(e.nodeName||``).toLowerCase():`#document`}function Bd(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Vd(e){return((Hd(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Hd(e){return Rd()?e instanceof Node||e instanceof Bd(e).Node:!1}function Ud(e){return Rd()?e instanceof Element||e instanceof Bd(e).Element:!1}function Wd(e){return Rd()?e instanceof HTMLElement||e instanceof Bd(e).HTMLElement:!1}function Gd(e){return!Rd()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Bd(e).ShadowRoot}function Kd(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=rf(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function qd(e){return/^(table|td|th)$/.test(zd(e))}function Jd(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Yd=/transform|translate|scale|rotate|perspective|filter/,Xd=/paint|layout|strict|content/,Zd=e=>!!e&&e!==`none`,Qd;function $d(e){let t=Ud(e)?rf(e):e;return Zd(t.transform)||Zd(t.translate)||Zd(t.scale)||Zd(t.rotate)||Zd(t.perspective)||!tf()&&(Zd(t.backdropFilter)||Zd(t.filter))||Yd.test(t.willChange||``)||Xd.test(t.contain||``)}function ef(e){let t=of(e);for(;Wd(t)&&!nf(t);){if($d(t))return t;if(Jd(t))return null;t=of(t)}return null}function tf(){return Qd??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Qd}function nf(e){return/^(html|body|#document)$/.test(zd(e))}function rf(e){return Bd(e).getComputedStyle(e)}function af(e){return Ud(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function of(e){if(zd(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Gd(e)&&e.host||Vd(e);return Gd(t)?t.host:t}function sf(e){let t=of(e);return nf(t)?(e.ownerDocument||e).body:Wd(t)&&Kd(t)?t:sf(t)}function cf(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=sf(e),i=r===e.ownerDocument?.body,a=Bd(r);if(i){let e=lf(a);return t.concat(a,a.visualViewport||[],Kd(r)?r:[],e&&n?cf(e):[])}return t.concat(r,cf(r,[],n))}function lf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function uf(e){let t=rf(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Wd(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Qu(n)!==a||Qu(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function df(e){return Ud(e)?e:e.contextElement}function ff(e){let t=df(e);if(!Wd(t))return ed(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=uf(t),o=(a?Qu(n.width):n.width)/r,s=(a?Qu(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var pf=ed(0);function mf(e){let t=Bd(e);return!tf()||!t.visualViewport?pf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function hf(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Bd(e)}function gf(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=df(e),o=ed(1);t&&(r?Ud(r)&&(o=ff(r)):o=ff(e));let s=hf(a,n,r)?mf(a):ed(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=Bd(a),t=Ud(r)?Bd(r):r,n=e,i=lf(n);for(;i&&t!==n;){let e=ff(i),t=i.getBoundingClientRect(),r=rf(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=Bd(i),i=lf(n)}}return Sd({width:u,height:d,x:c,y:l})}function _f(e,t){let n=af(e).scrollLeft;return t?t.left+n:gf(Vd(e)).left+n}function vf(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-_f(e,n),y:n.top+t.scrollTop}}function yf(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Vd(r),s=t?Jd(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=ed(1),u=ed(0),d=Wd(r);if((d||!a)&&((zd(r)!==`body`||Kd(o))&&(c=af(r)),d)){let e=gf(r);l=ff(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?vf(o,c):ed(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 bf(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function xf(e){let t=af(e),n=e.ownerDocument.body,r=Zu(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Zu(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+_f(e),o=-t.scrollTop;return rf(n).direction===`rtl`&&(a+=Zu(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Sf=25;function Cf(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Bd(e),a=Vd(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!tf()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(_f(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<=Sf&&(s-=o)}return{width:s,height:c,x:l,y:u}}function wf(e,t){let n=gf(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ff(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Tf(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Cf(e,n,t);else if(t===`document`)r=xf(Vd(e));else if(Ud(t))r=wf(t,n);else{let n=mf(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Sd(r)}function Ef(e,t){let n=t.get(e);if(n)return n;let r=cf(e,[],!1).filter(e=>Ud(e)&&zd(e)!==`body`),i=null,a=rf(e).position===`fixed`,o=a?of(e):e;for(;Ud(o)&&!nf(o);){let e=rf(o),t=$d(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=of(o)}return t.set(e,r),r}function Df(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Jd(t)?[]:Ef(t,this._c):[].concat(n),r],o=Tf(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=Tf(t,a[e],i);s=Zu(n.top,s),c=Xu(n.right,c),l=Xu(n.bottom,l),u=Zu(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Of(e){let{width:t,height:n}=uf(e);return{width:t,height:n}}function kf(e,t,n){let r=Wd(t),i=Vd(t),a=n===`fixed`,o=gf(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=ed(0);if((r||!a)&&((zd(t)!==`body`||Kd(i))&&(s=af(t)),r)){let e=gf(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=_f(i));let l=i&&!r&&!a?vf(i,s):ed(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 Af(e){return rf(e).position===`static`}function jf(e,t){if(!Wd(e)||rf(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Vd(e)===n&&(n=n.ownerDocument.body),n}function Mf(e,t){let n=Bd(e);if(Jd(e))return n;if(!Wd(e)){let t=of(e);for(;t&&!nf(t);){if(Ud(t)&&!Af(t))return t;t=of(t)}return n}let r=jf(e,t);for(;r&&qd(r)&&Af(r);)r=jf(r,t);return r&&nf(r)&&Af(r)&&!$d(r)?n:r||ef(e)||n}var Nf=async function(e){let t=this.getOffsetParent||Mf,n=this.getDimensions,r=await n(e.floating);return{reference:kf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Pf(e){return rf(e).direction===`rtl`}var Ff={convertOffsetParentRelativeRectToViewportRelativeRect:yf,getDocumentElement:Vd,getClippingRect:Df,getOffsetParent:Mf,getElementRects:Nf,getClientRects:bf,getDimensions:Of,getScale:ff,isElement:Ud,isRTL:Pf};function If(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Lf(e,t,n){let r=null,i,a=Vd(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=$u(d),h=$u(a.clientWidth-(u+f)),g=$u(a.clientHeight-(d+p)),_=$u(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Zu(0,Xu(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!If(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=Bd(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Rf(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=df(e),u=i||a?[...l?cf(l):[],...t?cf(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Lf(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?gf(e):null;c&&g();function g(){let t=gf(e);h&&!If(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 zf=Pd,Bf=Fd,Vf=Od,Hf=Ld,Uf=jd,Wf=Dd,Gf=Id,Kf=(e,t,n)=>{let r=new Map,i=n??{},a={...Ff,...i.platform,_c:r};return Ed(e,t,{...i,platform:a})};function qf(e=0,t=0,n=0,r=0){if(typeof DOMRect==`function`)return new DOMRect(e,t,n,r);let i={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...i,toJSON:()=>i}}function Jf(e){if(!e)return qf();let{x:t,y:n,width:r,height:i}=e;return qf(t,n,r,i)}function Yf(e,t){return{contextElement:ji(e)?e:e?.contextElement,getBoundingClientRect:()=>{let n=e,r=t?.(n);return r||!n?Jf(r):n.getBoundingClientRect()}}}var Xf=e=>({variable:e,reference:`var(${e})`}),Zf={arrowSize:Xf(`--arrow-size`),arrowSizeHalf:Xf(`--arrow-size-half`),arrowBg:Xf(`--arrow-background`),transformOrigin:Xf(`--transform-origin`),arrowOffset:Xf(`--arrow-offset`)},Qf=e=>e===`top`||e===`bottom`?`y`:`x`;function $f(e,t){return{name:`transformOrigin`,fn(n){let{elements:r,middlewareData:i,placement:a,rects:o,y:s}=n,c=a.split(`-`)[0],l=Qf(c),u=i.arrow?.x||0,d=i.arrow?.y||0,f=t?.clientWidth||0,p=t?.clientHeight||0,m=u+f/2,h=d+p/2,g=Math.abs(i.shift?.y||0),_=o.reference.height/2,v=p/2,y=e.offset?.mainAxis??e.gutter,b=typeof y==`number`?y+v:y??v,x=g>b,S={top:`${m}px calc(100% + ${b}px)`,bottom:`${m}px ${-b}px`,left:`calc(100% + ${b}px) ${h}px`,right:`${-b}px ${h}px`}[c],C=`${m}px ${o.reference.y+_-s}px`,w=!!e.overlap&&l===`y`&&x;return r.floating.style.setProperty(Zf.transformOrigin.variable,w?C:S),{data:{transformOrigin:w?C:S}}}}}var ep={name:`rects`,fn({rects:e}){return{data:e}}},tp=e=>{if(e)return{name:`shiftArrow`,fn({placement:t,middlewareData:n}){if(!n.arrow)return{};let{x:r,y:i}=n.arrow,a=t.split(`-`)[0];return Object.assign(e.style,{left:r==null?``:`${r}px`,top:i==null?``:`${i}px`,[a]:`calc(100% + ${Zf.arrowOffset.reference})`}),{}}}};function np(e){let[t,n]=e.split(`-`);return{side:t,align:n,hasAlign:n!=null}}function rp(e){return e.split(`-`)[0]}var ip={strategy:`absolute`,placement:`bottom`,listeners:!0,restoreStyles:!1,applyStyles:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function ap(e,t){let n=e.devicePixelRatio||1;return Math.round(t*n)/n}function op(e,t){return e!=null&&Math.abs(e-t)<.5}function sp(e){return typeof e==`function`?e():e===`clipping-ancestors`?`clippingAncestors`:e}function cp(e,t,n){return Wf({element:e||t.createElement(`div`),padding:n.arrowPadding})}function lp(e,t){if(!tr(t.offset??t.gutter))return zf(({placement:n})=>{let r=(e?.clientHeight||0)/2,i=t.offset?.mainAxis??t.gutter,a=typeof i==`number`?i+r:i??r,{hasAlign:o}=np(n),s=o?void 0:t.shift;return xr({crossAxis:t.offset?.crossAxis??s,mainAxis:a,alignmentAxis:t.shift})})}function up(e){if(e.flip)return Vf(()=>{let t=sp(e.boundary);return{...t?{boundary:t}:void 0,padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip}})}function dp(e){if(e.slide||e.overlap)return Bf(()=>{let t=sp(e.boundary);return{...t?{boundary:t}:void 0,mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:Gf()}})}function fp(e){if(e.sizeMiddleware===!1&&!e.sameWidth&&!e.fitViewport)return;let t,n,r,i;return Hf(()=>{let a=sp(e.boundary);return{padding:e.overflowPadding,...a?{boundary:a}:void 0,apply({elements:e,rects:a,availableHeight:o,availableWidth:s}){let c=e.floating,l=Math.round(a.reference.width),u=Math.round(a.reference.height);s=Math.floor(s),o=Math.floor(o),op(t,l)||(c.style.setProperty(`--reference-width`,`${l}px`),t=l),op(n,u)||(c.style.setProperty(`--reference-height`,`${u}px`),n=u),op(r,s)||(c.style.setProperty(`--available-width`,`${s}px`),r=s),op(i,o)||(c.style.setProperty(`--available-height`,`${o}px`),i=o)}}})}function pp(e){if(e.hideWhenDetached)return Uf(()=>({strategy:`referenceHidden`,boundary:sp(e.boundary)??`clippingAncestors`}))}function mp(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}var hp=[`transform`,`visibility`,`pointer-events`,`--x`,`--y`,`--z-index`,`--reference-width`,`--reference-height`,`--available-width`,`--available-height`,`--transform-origin`],gp=[`top`,`right`,`bottom`,`left`];function _p(e,t){if(!e)return dr;let n=new Map(t.map(t=>[t,e.style.getPropertyValue(t)]));return()=>{n.forEach((t,n)=>{t?e.style.setProperty(n,t):e.style.removeProperty(n)}),e.style.length===0&&e.removeAttribute(`style`)}}function vp(e){return e==null?null:ji(e)?e:typeof e==`object`&&e&&`contextElement`in e&&e.contextElement?e.contextElement:e}function yp(e,t,n={}){let r=()=>(typeof t==`function`?t():t)??null,i=()=>{let t=typeof e==`function`?e():e;return n.getAnchorElement?.()??t},a=()=>{let e=i();return!e&&!n.getAnchorRect?null:Yf(e,n.getAnchorRect)},o=Object.assign({},ip,n),s=[],c=null,l,u;function d(e){l?.(),u?.(),c=e,l=o.restoreStyles?_p(e,hp):void 0;let t=e.querySelector(`[data-part=arrow]`);u=o.restoreStyles?_p(t,gp):void 0,s=[lp(t,o),up(o),dp(o),cp(t,e.ownerDocument,o),tp(t),$f({gutter:o.gutter,offset:o.offset,overlap:o.overlap},t),fp(o),pp(o),ep]}let{placement:f,strategy:p,onComplete:m,onPositioned:h}=o,g,_,v=!1,y,b,x=dr,S=mp(o.listeners);function C(){if(!o.listeners)return;let e=i(),t=a(),n=r();t&&n&&(vp(e)!==vp(y)||n!==b)&&(x(),y=e,b=n,x=Rf(t,n,T,S))}async function w(){C();let e=r();if(!e)return;e!==c&&(d(e),v=!1);let t=a();if(!t)return;let n=await Kf(t,e,{placement:f,middleware:s,strategy:p}),i=Yi(e),l=ap(i,n.x),u=ap(i,n.y);if(m?.({...n,x:l,y:u}),o.applyStyles!==!1&&(op(g,l)||(e.style.setProperty(`--x`,`${l}px`),g=l),op(_,u)||(e.style.setProperty(`--y`,`${u}px`),_=u),o.hideWhenDetached&&(n.middlewareData.hide?.referenceHidden?(e.style.setProperty(`visibility`,`hidden`),e.style.setProperty(`pointer-events`,`none`)):(e.style.removeProperty(`visibility`),e.style.removeProperty(`pointer-events`))),!v)){let t=e.firstElementChild;t&&(e.style.setProperty(`--z-index`,ea(t).zIndex),v=!0)}}async function T(){n.updatePosition?(await n.updatePosition({updatePosition:w,floatingElement:r()}),h?.({placed:!0})):await w()}return T(),()=>{x(),u?.(),l?.(),h?.({placed:!1})}}function bp(e,t,n={}){let{defer:r,...i}=n,a=r?Co:e=>e(),o=[];return o.push(a(()=>{o.push(yp(e,t,i))})),()=>{o.forEach(e=>e?.())}}var xp={bottom:`rotate(45deg)`,left:`rotate(135deg)`,top:`rotate(225deg)`,right:`rotate(315deg)`};function Sp(e={}){let{placement:t,sameWidth:n,fitViewport:r,strategy:i=`absolute`}=e;return{arrow:{position:`absolute`,width:Zf.arrowSize.reference,height:Zf.arrowSize.reference,[Zf.arrowSizeHalf.variable]:`calc(${Zf.arrowSize.reference} / 2)`,[Zf.arrowOffset.variable]:`calc(${Zf.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?xp[t.split(`-`)[0]]:void 0,background:Zf.arrowBg.reference,top:`0`,left:`0`,width:`100%`,height:`100%`,position:`absolute`,zIndex:`inherit`},floating:{position:i,isolation:`isolate`,minWidth:n?void 0:`max-content`,width:n?`var(--reference-width)`:void 0,maxWidth:r?`var(--available-width)`:void 0,maxHeight:r?`var(--available-height)`:void 0,pointerEvents:t?void 0:`none`,top:`0px`,left:`0px`,transform:t?`translate3d(var(--x), var(--y), 0)`:`translate3d(0, -100vh, 0)`,zIndex:`var(--z-index)`}}}var Cp=Ju.extendWith(`view`),wp=B(`combobox`).parts(`root`,`clearTrigger`,`content`,`control`,`input`,`item`,`itemGroup`,`itemGroupLabel`,`itemIndicator`,`itemText`,`label`,`list`,`positioner`,`trigger`);wp.build();var Tp=Object.defineProperty,Ep=(e,t,n)=>t in e?Tp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,H=(e,t,n)=>Ep(e,typeof t==`symbol`?t:t+``,n),Dp={itemToValue(e){return typeof e==`string`?e:Qn(e)&&nr(e,`value`)?e.value:``},itemToString(e){return typeof e==`string`?e:Qn(e)&&nr(e,`label`)?e.label:Dp.itemToValue(e)},isItemDisabled(e){return Qn(e)&&nr(e,`disabled`)?!!e.disabled:!1}},Op=class e{constructor(t){H(this,`options`,t),H(this,`items`),H(this,`indexMap`,null),H(this,`copy`,t=>new e({...this.options,items:t??[...this.items]})),H(this,`isEqual`,e=>Yn(this.items,e.items)),H(this,`setItems`,e=>this.copy(e)),H(this,`getValues`,(e=this.items)=>{let t=[];for(let n of e){let e=this.getItemValue(n);e!=null&&t.push(e)}return t}),H(this,`find`,e=>{if(e==null)return null;let t=this.indexOf(e);return t===-1?null:this.at(t)}),H(this,`findMany`,e=>{let t=[];for(let n of e){let e=this.find(n);e!=null&&t.push(e)}return t}),H(this,`at`,e=>{if(!this.options.groupBy&&!this.options.groupSort)return this.items[e]??null;let t=0,n=this.group();for(let[,r]of n)for(let n of r){if(t===e)return n;t++}return null}),H(this,`sortFn`,(e,t)=>{let n=this.indexOf(e),r=this.indexOf(t);return(n??0)-(r??0)}),H(this,`sort`,e=>[...e].sort(this.sortFn.bind(this))),H(this,`getItemValue`,e=>e==null?null:this.options.itemToValue?.(e)??Dp.itemToValue(e)),H(this,`getItemDisabled`,e=>e==null?!1:this.options.isItemDisabled?.(e)??Dp.isItemDisabled(e)),H(this,`stringifyItem`,e=>e==null?null:this.options.itemToString?.(e)??Dp.itemToString(e)),H(this,`stringify`,e=>e==null?null:this.stringifyItem(this.find(e))),H(this,`stringifyItems`,(e,t=`, `)=>{let n=[];for(let t of e){let e=this.stringifyItem(t);e!=null&&n.push(e)}return n.join(t)}),H(this,`stringifyMany`,(e,t)=>this.stringifyItems(this.findMany(e),t)),H(this,`has`,e=>this.indexOf(e)!==-1),H(this,`hasItem`,e=>e!=null&&this.has(this.getItemValue(e))),H(this,`group`,()=>{let{groupBy:e,groupSort:t}=this.options;if(!e)return[[``,[...this.items]]];let n=new Map;this.items.forEach((t,r)=>{let i=e(t,r);n.has(i)||n.set(i,[]),n.get(i).push(t)});let r=Array.from(n.entries());return t&&r.sort(([e],[n])=>{if(typeof t==`function`)return t(e,n);if(Array.isArray(t)){let r=t.indexOf(e),i=t.indexOf(n);return r===-1?1:i===-1?-1:r-i}return t===`asc`?e.localeCompare(n):t===`desc`?n.localeCompare(e):0}),r}),H(this,`getNextValue`,(e,t=1,n=!1)=>{let r=this.indexOf(e);if(r===-1)return null;for(r=n?Math.min(r+t,this.size-1):r+t;r<=this.size&&this.getItemDisabled(this.at(r));)r++;return this.getItemValue(this.at(r))}),H(this,`getPreviousValue`,(e,t=1,n=!1)=>{let r=this.indexOf(e);if(r===-1)return null;for(r=n?Math.max(r-t,0):r-t;r>=0&&this.getItemDisabled(this.at(r));)r--;return this.getItemValue(this.at(r))}),H(this,`indexOf`,e=>{if(e==null)return-1;if(!this.options.groupBy&&!this.options.groupSort)return this.items.findIndex(t=>this.getItemValue(t)===e);if(!this.indexMap){this.indexMap=new Map;let e=0,t=this.group();for(let[,n]of t)for(let t of n){let n=this.getItemValue(t);n!=null&&this.indexMap.set(n,e),e++}}return this.indexMap.get(e)??-1}),H(this,`getByText`,(e,t)=>{let n=t==null?-1:this.indexOf(t),r=e.length===1;for(let i=0;i<this.items.length;i++){let a=this.items[(n+i+1)%this.items.length];if(!(r&&this.getItemValue(a)===t)&&!this.getItemDisabled(a)&&kp(this.stringifyItem(a),e))return a}}),H(this,`search`,(e,t)=>{let{state:n,currentValue:r,timeout:i=350}=t,a=n.keysSoFar+e,o=a.length>1&&Array.from(a).every(e=>e===a[0])?a[0]:a,s=this.getByText(o,r),c=this.getItemValue(s);function l(){clearTimeout(n.timer),n.timer=-1}function u(e){n.keysSoFar=e,l(),e!==``&&(n.timer=+setTimeout(()=>{u(``),l()},i))}return u(a),c}),H(this,`update`,(e,t)=>{let n=this.indexOf(e);return n===-1?this:this.copy([...this.items.slice(0,n),t,...this.items.slice(n+1)])}),H(this,`upsert`,(e,t,n=`append`)=>{let r=this.indexOf(e);return r===-1?(n===`append`?this.append:this.prepend)(t):this.copy([...this.items.slice(0,r),t,...this.items.slice(r+1)])}),H(this,`insert`,(e,...t)=>this.copy(Ap(this.items,e,...t))),H(this,`insertBefore`,(e,...t)=>{let n=this.indexOf(e);if(n===-1){if(this.items.length===0)n=0;else return this}return this.copy(Ap(this.items,n,...t))}),H(this,`insertAfter`,(e,...t)=>{let n=this.indexOf(e);if(n===-1){if(this.items.length===0)n=0;else return this}return this.copy(Ap(this.items,n+1,...t))}),H(this,`prepend`,(...e)=>this.copy(Ap(this.items,0,...e))),H(this,`append`,(...e)=>this.copy(Ap(this.items,this.items.length,...e))),H(this,`filter`,e=>{let t=this.items.filter((t,n)=>e(this.stringifyItem(t),n,t));return this.copy(t)}),H(this,`remove`,(...e)=>{let t=e.map(e=>typeof e==`string`?e:this.getItemValue(e));return this.copy(this.items.filter(e=>{let n=this.getItemValue(e);return n!=null&&!t.includes(n)}))}),H(this,`move`,(e,t)=>{let n=this.indexOf(e);return n===-1?this:this.copy(jp(this.items,[n],t))}),H(this,`moveBefore`,(e,...t)=>{let n=this.items.findIndex(t=>this.getItemValue(t)===e);if(n===-1)return this;let r=t.map(e=>this.items.findIndex(t=>this.getItemValue(t)===e)).sort((e,t)=>e-t);return this.copy(jp(this.items,r,n))}),H(this,`moveAfter`,(e,...t)=>{let n=this.items.findIndex(t=>this.getItemValue(t)===e);if(n===-1)return this;let r=t.map(e=>this.items.findIndex(t=>this.getItemValue(t)===e)).sort((e,t)=>e-t);return this.copy(jp(this.items,r,n+1))}),H(this,`reorder`,(e,t)=>this.copy(jp(this.items,[e],t))),H(this,`compareValue`,(e,t)=>{let n=this.indexOf(e),r=this.indexOf(t);return n<r?-1:+(n>r)}),H(this,`range`,(e,t)=>{let n=[],r=e;for(;r!=null;){if(this.find(r)&&n.push(r),r===t)return n;r=this.getNextValue(r)}return[]}),H(this,`getValueRange`,(e,t)=>e&&t?this.compareValue(e,t)<=0?this.range(e,t):this.range(t,e):[]),H(this,`toString`,()=>{let e=``;for(let t of this.items){let n=[this.getItemValue(t),this.stringifyItem(t),this.getItemDisabled(t)].filter(Boolean).join(`:`);e+=n+`,`}return e}),H(this,`toJSON`,()=>({size:this.size,first:this.firstValue,last:this.lastValue})),this.items=[...t.items]}get size(){return this.items.length}get firstValue(){let e=0;for(;this.getItemDisabled(this.at(e));)e++;return this.getItemValue(this.at(e))}get lastValue(){let e=this.size-1;for(;this.getItemDisabled(this.at(e));)e--;return this.getItemValue(this.at(e))}*[Symbol.iterator](){yield*this.items}},kp=(e,t)=>!!e?.toLowerCase().startsWith(t.toLowerCase());function Ap(e,t,...n){return[...e.slice(0,t),...n,...e.slice(t)]}function jp(e,t,n){t=[...t].sort((e,t)=>e-t);let r=t.map(t=>e[t]);for(let n=t.length-1;n>=0;n--)e=[...e.slice(0,t[n]),...e.slice(t[n]+1)];return n=Math.max(0,n-t.filter(e=>e<n).length),[...e.slice(0,n),...r,...e.slice(n)]}function Mp({values:e,collection:t,selectedItemMap:n}){let r=[];for(let i of e){let e=t.find(i)??n.get(i);e!=null&&r.push(e)}return r}function Np({selectedItemMap:e,values:t,selectedItems:n,collection:r}){let i=new Map(e);for(let e of n){let t=r.getItemValue(e);t!=null&&i.set(t,e)}let a=new Set(t);for(let e of i.keys())a.has(e)||i.delete(e);return i}function Pp({values:e,collection:t,selectedItemMap:n}){let r=Mp({values:e,collection:t,selectedItemMap:n});return{selectedItems:r,nextSelectedItemMap:Np({selectedItemMap:n,values:e,selectedItems:r,collection:t})}}function Fp({selectedItems:e,collection:t}){return Np({selectedItemMap:new Map,values:e.map(e=>t.getItemValue(e)).filter(Boolean),selectedItems:e,collection:t})}var Ip=wp.extendWith(`empty`),Lp=B(`date-input`).parts(`root`,`label`,`control`,`segmentGroup`,`segment`,`hiddenInput`);Lp.build();var Rp=B(`date-picker`).parts(`clearTrigger`,`content`,`control`,`input`,`label`,`monthSelect`,`nextTrigger`,`positioner`,`presetTrigger`,`prevTrigger`,`rangeText`,`root`,`table`,`tableBody`,`tableCell`,`tableCellTrigger`,`tableHead`,`tableHeader`,`tableRow`,`trigger`,`view`,`viewControl`,`viewTrigger`,`yearSelect`);Rp.build();var zp=Rp.extendWith(`view`,`valueText`),Bp=B(`dialog`).parts(`trigger`,`backdrop`,`positioner`,`content`,`title`,`description`,`closeTrigger`),Vp=Bp.build(),Hp=e=>e.ids?.positioner??`dialog:${e.id}:positioner`,Up=e=>e.ids?.backdrop??`dialog:${e.id}:backdrop`,Wp=e=>e.ids?.content??`dialog:${e.id}:content`,Gp=(e,t)=>{let n=e.ids?.trigger;return n==null?t?`dialog:${e.id}:trigger:${t}`:`dialog:${e.id}:trigger`:er(n)?n(t):n},Kp=e=>e.ids?.title??`dialog:${e.id}:title`,qp=e=>e.ids?.description??`dialog:${e.id}:description`,Jp=e=>e.ids?.closeTrigger??`dialog:${e.id}:close`,Yp=e=>e.getById(Wp(e)),Xp=e=>e.getById(Hp(e)),Zp=e=>e.getById(Up(e)),Qp=e=>e.getById(Gp(e)),$p=e=>e.getById(Kp(e)),em=e=>e.getById(qp(e)),tm=e=>e.getById(Jp(e)),nm=e=>Uo(e.getRootNode(),`[data-scope="dialog"][data-part="trigger"]${Ei(e.id)}`),rm=(e,t)=>t==null?Qp(e)??nm(e)[0]:e.getById(Gp(e,t));function im(e,t){let{state:n,send:r,context:i,prop:a,scope:o}=e,s=a(`aria-label`),c=n.matches(`open`),l=i.get(`triggerValue`);return{open:c,setOpen(e){n.matches(`open`)!==e&&r({type:e?`OPEN`:`CLOSE`})},triggerValue:l,setTriggerValue(e){r({type:`TRIGGER_VALUE.SET`,value:e})},getTriggerProps(e={}){let{value:n}=e,i=n!=null&&l===n;return t.button({...Vp.trigger.attrs,dir:a(`dir`),id:Gp(o,n),"data-ownedby":o.id,"data-value":n,"aria-haspopup":`dialog`,type:`button`,"aria-expanded":n==null?c:c&&i,"data-state":c?`open`:`closed`,"aria-controls":Wp(o),"data-current":R(i),onClick(e){e.defaultPrevented||r({type:c&&n!=null&&!i?`TRIGGER_VALUE.SET`:`TOGGLE`,value:n})}})},getBackdropProps(){return t.element({...Vp.backdrop.attrs,dir:a(`dir`),hidden:!c,id:Up(o),"data-state":c?`open`:`closed`})},getPositionerProps(){return t.element({...Vp.positioner.attrs,dir:a(`dir`),id:Hp(o),style:xr({pointerEvents:!c||!a(`modal`)?`none`:void 0})})},getContentProps(){let e=i.get(`rendered`);return t.element({...Vp.content.attrs,dir:a(`dir`),role:a(`role`),hidden:!c,id:Wp(o),tabIndex:-1,"data-state":c?`open`:`closed`,"aria-modal":a(`modal`),"aria-label":s||void 0,"aria-labelledby":s||!e.title?void 0:Kp(o),"aria-describedby":e.description?qp(o):void 0,style:xr({pointerEvents:a(`modal`)?void 0:`auto`})})},getTitleProps(){return t.element({...Vp.title.attrs,dir:a(`dir`),id:Kp(o)})},getDescriptionProps(){return t.element({...Vp.description.attrs,dir:a(`dir`),id:qp(o)})},getCloseTriggerProps(){return t.button({...Vp.closeTrigger.attrs,dir:a(`dir`),id:Jp(o),type:`button`,onClick(e){e.defaultPrevented||(e.stopPropagation(),r({type:`CLOSE`}))}})}}}var am=di({props({props:e,scope:t}){let n=e.role===`alertdialog`,r=n?()=>tm(t):void 0,i=typeof e.modal!=`boolean`||e.modal;return{role:`dialog`,modal:i,trapFocus:i,preventScroll:i,closeOnInteractOutside:i&&!n,closeOnEscape:!0,restoreFocus:!0,initialFocusEl:r,...e}},initialState({prop:e}){return e(`open`)||e(`defaultOpen`)?`open`:`closed`},context({bindable:e,prop:t,scope:n}){return{rendered:e(()=>({defaultValue:{title:!0,description:!0}})),triggerValue:e(()=>({defaultValue:t(`defaultTriggerValue`)??null,value:t(`triggerValue`),onChange(e){let r=t(`onTriggerValueChange`);r&&r({value:e,triggerElement:rm(n,e)})}}))}},watch({track:e,action:t,prop:n}){e([()=>n(`open`)],()=>{t([`toggleVisibility`])})},states:{open:{entry:[`checkRenderedElements`,`setInitialFocus`],effects:[`trackDismissableElement`,`trapFocus`,`preventScroll`,`hideContentBelow`],on:{"CONTROLLED.CLOSE":{target:`closed`},CLOSE:[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{target:`closed`,actions:[`invokeOnClose`]}],TOGGLE:[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{target:`closed`,actions:[`invokeOnClose`]}],"TRIGGER_VALUE.SET":{actions:[`setTriggerValue`]}}},closed:{on:{"CONTROLLED.OPEN":{target:`open`},OPEN:[{guard:`isOpenControlled`,actions:[`invokeOnOpen`,`setTriggerValue`]},{target:`open`,actions:[`invokeOnOpen`,`setTriggerValue`]}],TOGGLE:[{guard:`isOpenControlled`,actions:[`invokeOnOpen`,`setTriggerValue`]},{target:`open`,actions:[`invokeOnOpen`,`setTriggerValue`]}],"TRIGGER_VALUE.SET":{actions:[`setTriggerValue`]}}}},implementations:{guards:{isOpenControlled:({prop:e})=>e(`open`)!=null},effects:{trackDismissableElement({scope:e,send:t,prop:n}){return Ll(()=>Yp(e),{type:`dialog`,defer:!0,pointerBlocking:n(`modal`),layerStyleTargets:[()=>Zp(e),()=>Xp(e)],exclude:[Qp(e),...nm(e)].filter(Boolean),onInteractOutside(e){n(`onInteractOutside`)?.(e),n(`closeOnInteractOutside`)||e.preventDefault()},persistentElements:n(`persistentElements`),onFocusOutside:n(`onFocusOutside`),onPointerDownOutside:n(`onPointerDownOutside`),onRequestDismiss:n(`onRequestDismiss`),onEscapeKeyDown(e){n(`onEscapeKeyDown`)?.(e),n(`closeOnEscape`)||e.preventDefault()},onDismiss(){t({type:`CLOSE`,src:`interact-outside`})}})},preventScroll({scope:e,prop:t}){if(t(`preventScroll`))return au(e.getDoc())},trapFocus({scope:e,prop:t,context:n}){return t(`trapFocus`)?Ql(()=>Yp(e),{preventScroll:!0,returnFocusOnDeactivate:!!t(`restoreFocus`),initialFocus:()=>bo({root:Yp(e),getInitialEl:t(`initialFocusEl`)}),setReturnFocus:r=>{let i=t(`finalFocusEl`)?.();if(i)return i;let a=n.get(`triggerValue`);if(a){let t=rm(e,a);if(t)return t}return nm(e)[0]||r},getShadowRoot:!0}):void 0},hideContentBelow({scope:e,prop:t}){return t(`modal`)?cl(()=>[Yp(e)],{defer:!0}):void 0}},actions:{setInitialFocus({prop:e,scope:t}){e(`trapFocus`)||Co(()=>{bo({root:Yp(t),getInitialEl:e(`initialFocusEl`)})?.focus({preventScroll:!0})})},checkRenderedElements({context:e,scope:t}){Co(()=>{e.set(`rendered`,{title:!!$p(t),description:!!em(t)})})},invokeOnClose({prop:e}){e(`onOpenChange`)?.({open:!1})},invokeOnOpen({prop:e}){e(`onOpenChange`)?.({open:!0})},setTriggerValue({context:e,event:t}){t.value!==void 0&&e.set(`triggerValue`,t.value)},toggleVisibility({prop:e,send:t,event:n}){t({type:e(`open`)?`CONTROLLED.OPEN`:`CONTROLLED.CLOSE`,previousEvent:n})}}}}),om=B(`editable`).parts(`root`,`area`,`label`,`preview`,`input`,`editTrigger`,`submitTrigger`,`cancelTrigger`,`control`);om.build();var sm=B(`field`).parts(`root`,`errorText`,`helperText`,`input`,`label`,`select`,`textarea`,`requiredIndicator`),cm=sm.build(),lm=B(`fieldset`).parts(`root`,`errorText`,`helperText`,`legend`);lm.build();var um=B(`file-upload`).parts(`root`,`dropzone`,`item`,`itemDeleteTrigger`,`itemGroup`,`itemName`,`itemPreview`,`itemPreviewImage`,`itemSizeText`,`label`,`trigger`,`clearTrigger`);um.build();var dm=B(`floating-panel`).parts(`trigger`,`positioner`,`content`,`header`,`body`,`title`,`resizeTrigger`,`dragTrigger`,`stageTrigger`,`closeTrigger`,`control`);dm.build();var fm=B(`hoverCard`).parts(`arrow`,`arrowTip`,`trigger`,`positioner`,`content`);fm.build();var pm=B(`listbox`).parts(`label`,`input`,`item`,`itemText`,`itemIndicator`,`itemGroup`,`itemGroupLabel`,`content`,`root`,`valueText`);pm.build();var mm=pm.extendWith(`empty`),hm=B(`marquee`).parts(`root`,`viewport`,`content`,`edge`,`item`);hm.build();var gm=B(`menu`).parts(`arrow`,`arrowTip`,`content`,`contextTrigger`,`indicator`,`item`,`itemGroup`,`itemGroupLabel`,`itemIndicator`,`itemText`,`positioner`,`separator`,`trigger`,`triggerItem`);gm.build();var _m=B(`numberInput`).parts(`root`,`label`,`input`,`control`,`valueText`,`incrementTrigger`,`decrementTrigger`,`scrubber`);_m.build();var vm=B(`pinInput`).parts(`root`,`label`,`input`,`control`);vm.build();var ym=B(`popover`).parts(`arrow`,`arrowTip`,`anchor`,`trigger`,`indicator`,`positioner`,`content`,`title`,`description`,`closeTrigger`);ym.build();var bm=B(`progress`).parts(`root`,`label`,`track`,`range`,`valueText`,`view`,`circle`,`circleTrack`,`circleRange`);bm.build();var xm=B(`qr-code`).parts(`root`,`frame`,`pattern`,`overlay`,`downloadTrigger`);xm.build();var Sm=B(`radio-group`).parts(`root`,`label`,`item`,`itemText`,`itemControl`,`indicator`);Sm.build();var Cm=B(`rating-group`).parts(`root`,`label`,`item`,`control`);Cm.build();var wm=B(`scroll-area`).parts(`root`,`viewport`,`content`,`scrollbar`,`thumb`,`corner`);wm.build();var Tm=Sm.rename(`segment-group`);Tm.build();var Em=B(`select`).parts(`label`,`positioner`,`trigger`,`indicator`,`clearTrigger`,`item`,`itemText`,`itemIndicator`,`itemGroup`,`itemGroupLabel`,`list`,`content`,`root`,`control`,`valueText`),Dm=Em.build(),Om=e=>new Op(e);Om.empty=()=>new Op({items:[]});var km=e=>e.ids?.root??`select:${e.id}`,Am=e=>e.ids?.content??`select:${e.id}:content`,jm=e=>e.ids?.trigger??`select:${e.id}:trigger`,Mm=e=>e.ids?.clearTrigger??`select:${e.id}:clear-trigger`,Nm=e=>e.ids?.label??`select:${e.id}:label`,Pm=e=>e.ids?.control??`select:${e.id}:control`,Fm=(e,t)=>e.ids?.item?.(t)??`select:${e.id}:option:${t}`,Im=e=>e.ids?.hiddenSelect??`select:${e.id}:select`,Lm=e=>e.ids?.positioner??`select:${e.id}:positioner`,Rm=(e,t)=>e.ids?.itemGroup?.(t)??`select:${e.id}:optgroup:${t}`,zm=(e,t)=>e.ids?.itemGroupLabel?.(t)??`select:${e.id}:optgroup-label:${t}`,Bm=e=>e.getById(Im(e)),Vm=e=>e.getById(Am(e)),Hm=e=>e.getById(jm(e)),Um=e=>e.getById(Mm(e)),Wm=e=>e.getById(Lm(e)),Gm=(e,t)=>t==null?null:e.getById(Fm(e,t)),Km={clearTriggerLabel:`Clear value`};function qm(e,t){let{context:n,prop:r,scope:i,state:a,computed:o,send:s}=e,c=Sr(Km,r(`translations`)),l=r(`disabled`)||n.get(`fieldsetDisabled`),u=!!r(`invalid`),d=!!r(`required`),f=!!r(`readOnly`),p=r(`composite`),m=r(`collection`),h=a.hasTag(`open`),g=a.matches(`focused`),_=n.get(`highlightedValue`),v=n.get(`highlightedItem`),y=o(`selectedItems`),b=n.get(`currentPlacement`),x=b?rp(b):void 0,S=o(`isTypingAhead`),C=o(`isInteractive`),w=_?Fm(i,_):void 0;function T(e){let t=m.getItemDisabled(e.item),r=m.getItemValue(e.item);return kr(r,()=>`[zag-js] No value found for item ${JSON.stringify(e.item)}`),{value:r,disabled:!!(l||t),highlighted:_===r,selected:n.get(`value`).includes(r)}}let E=Sp({...r(`positioning`),placement:b});return{open:h,focused:g,empty:n.get(`value`).length===0,highlightedItem:v,highlightedValue:_,selectedItems:y,hasSelectedItems:o(`hasSelectedItems`),value:n.get(`value`),valueAsString:o(`valueAsString`),collection:m,multiple:!!r(`multiple`),disabled:!!l,reposition(e={}){s({type:`POSITIONING.SET`,options:e})},focus(){Hm(i)?.focus({preventScroll:!0})},setOpen(e){a.hasTag(`open`)!==e&&s({type:e?`OPEN`:`CLOSE`})},selectValue(e){s({type:`ITEM.SELECT`,value:e})},setValue(e){s({type:`VALUE.SET`,value:e})},selectAll(){s({type:`VALUE.SET`,value:m.getValues()})},setHighlightValue(e){s({type:`HIGHLIGHTED_VALUE.SET`,value:e})},clearHighlightValue(){s({type:`HIGHLIGHTED_VALUE.CLEAR`})},clearValue(e){s(e?{type:`ITEM.CLEAR`,value:e}:{type:`VALUE.CLEAR`})},getItemState:T,getRootProps(){return t.element({...Dm.root.attrs,dir:r(`dir`),id:km(i),"data-invalid":R(u),"data-readonly":R(f)})},getLabelProps(){return t.label({dir:r(`dir`),id:Nm(i),...Dm.label.attrs,"data-disabled":R(l),"data-invalid":R(u),"data-readonly":R(f),"data-required":R(d),htmlFor:Im(i),onClick(e){e.defaultPrevented||l||Hm(i)?.focus({preventScroll:!0})}})},getControlProps(){return t.element({...Dm.control.attrs,dir:r(`dir`),id:Pm(i),"data-state":h?`open`:`closed`,"data-focus":R(g),"data-disabled":R(l),"data-invalid":R(u)})},getValueTextProps(){return t.element({...Dm.valueText.attrs,dir:r(`dir`),"data-disabled":R(l),"data-invalid":R(u),"data-focus":R(g)})},getTriggerProps(){return t.button({id:jm(i),disabled:l,dir:r(`dir`),type:`button`,role:`combobox`,"aria-controls":Am(i),"aria-expanded":h,"aria-haspopup":`listbox`,"data-state":h?`open`:`closed`,"aria-invalid":u,"aria-required":d,"aria-labelledby":Nm(i),...Dm.trigger.attrs,"data-disabled":R(l),"data-invalid":R(u),"data-readonly":R(f),"data-placement":b,"data-side":x,"data-placeholder-shown":R(!o(`hasSelectedItems`)),onClick(e){C&&(e.defaultPrevented||s({type:`TRIGGER.CLICK`}))},onFocus(){s({type:`TRIGGER.FOCUS`})},onBlur(){s({type:`TRIGGER.BLUR`})},onKeyDown(e){if(e.defaultPrevented||!C)return;let t={ArrowUp(){s({type:`TRIGGER.ARROW_UP`})},ArrowDown(e){s({type:e.altKey?`OPEN`:`TRIGGER.ARROW_DOWN`})},ArrowLeft(){s({type:`TRIGGER.ARROW_LEFT`})},ArrowRight(){s({type:`TRIGGER.ARROW_RIGHT`})},Home(){s({type:`TRIGGER.HOME`})},End(){s({type:`TRIGGER.END`})},Enter(){s({type:`TRIGGER.ENTER`})},Space(e){s(S?{type:`TRIGGER.TYPEAHEAD`,key:e.key}:{type:`TRIGGER.ENTER`})}}[Ua(e,{dir:r(`dir`),orientation:`vertical`})];if(t){t(e),e.preventDefault();return}ss.isValidEvent(e)&&(s({type:`TRIGGER.TYPEAHEAD`,key:e.key}),e.preventDefault())}})},getIndicatorProps(){return t.element({...Dm.indicator.attrs,dir:r(`dir`),"aria-hidden":!0,"data-state":h?`open`:`closed`,"data-disabled":R(l),"data-invalid":R(u),"data-readonly":R(f)})},getItemProps(e){let n=T(e);return t.element({id:Fm(i,n.value),role:`option`,...Dm.item.attrs,dir:r(`dir`),"data-value":n.value,"aria-selected":n.selected,"data-state":n.selected?`checked`:`unchecked`,"data-highlighted":R(n.highlighted),"data-disabled":R(n.disabled),"aria-disabled":Si(n.disabled),onPointerMove(e){n.disabled||e.pointerType!==`mouse`||Au()===`pointer`&&n.value!==_&&s({type:`ITEM.POINTER_MOVE`,value:n.value})},onClick(e){e.defaultPrevented||n.disabled||s({type:`ITEM.CLICK`,src:`pointerup`,value:n.value})},onPointerLeave(t){n.disabled||e.persistFocus||t.pointerType===`mouse`&&Au()===`pointer`&&s({type:`ITEM.POINTER_LEAVE`})}})},getItemTextProps(e){let n=T(e);return t.element({...Dm.itemText.attrs,"data-state":n.selected?`checked`:`unchecked`,"data-disabled":R(n.disabled),"data-highlighted":R(n.highlighted)})},getItemIndicatorProps(e){let n=T(e);return t.element({"aria-hidden":!0,...Dm.itemIndicator.attrs,"data-state":n.selected?`checked`:`unchecked`,hidden:!n.selected})},getItemGroupLabelProps(e){let{htmlFor:n}=e;return t.element({...Dm.itemGroupLabel.attrs,id:zm(i,n),dir:r(`dir`),role:`presentation`})},getItemGroupProps(e){let{id:n}=e;return t.element({...Dm.itemGroup.attrs,"data-disabled":R(l),id:Rm(i,n),"aria-labelledby":zm(i,n),role:`group`,dir:r(`dir`)})},getClearTriggerProps(){return t.button({...Dm.clearTrigger.attrs,id:Mm(i),type:`button`,"aria-label":c.clearTriggerLabel,"data-invalid":R(u),disabled:l,hidden:!o(`hasSelectedItems`),dir:r(`dir`),onClick(e){e.defaultPrevented||s({type:`CLEAR.CLICK`})}})},getHiddenSelectProps(){let e=n.get(`value`),a=r(`multiple`)?e:e?.[0],o=e=>{to(Wa(e))||s({type:`VALUE.SET`,value:Jm(e.currentTarget)})};return t.select({name:r(`name`),form:r(`form`),disabled:l,multiple:r(`multiple`),required:r(`required`),"aria-hidden":!0,id:Im(i),defaultValue:a,style:ls,tabIndex:-1,autoComplete:r(`autoComplete`),onChange:o,onInput:o,onFocus(){Hm(i)?.focus({preventScroll:!0})},"aria-labelledby":Nm(i)})},getPositionerProps(){return t.element({...Dm.positioner.attrs,dir:r(`dir`),id:Lm(i),style:E.floating})},getContentProps(){return t.element({hidden:!h,dir:r(`dir`),id:Am(i),role:p?`listbox`:`dialog`,...Dm.content.attrs,"data-state":h?`open`:`closed`,"data-placement":b,"data-side":x,"data-activedescendant":w,"aria-activedescendant":p?w:void 0,"aria-multiselectable":r(`multiple`)&&p?!0:void 0,"aria-labelledby":Nm(i),tabIndex:0,onKeyDown(e){if(!C||!Ki(e.currentTarget,Na(e)))return;if(e.key===`Tab`&&!xo(e)){e.preventDefault();return}let t={ArrowUp(){s({type:`CONTENT.ARROW_UP`})},ArrowDown(){s({type:`CONTENT.ARROW_DOWN`})},Home(){s({type:`CONTENT.HOME`})},End(){s({type:`CONTENT.END`})},Enter(){s({type:`ITEM.CLICK`,src:`keydown.enter`})},Space(e){S?s({type:`CONTENT.TYPEAHEAD`,key:e.key}):t.Enter?.(e)}},n=t[Ua(e)];if(n){n(e),e.preventDefault();return}Ui(Na(e))||ss.isValidEvent(e)&&(s({type:`CONTENT.TYPEAHEAD`,key:e.key}),e.preventDefault())}})},getListProps(){return t.element({...Dm.list.attrs,tabIndex:0,role:p?void 0:`listbox`,"aria-labelledby":jm(i),"aria-activedescendant":p?void 0:w,"aria-multiselectable":!p&&r(`multiple`)?!0:void 0})}}}var Jm=e=>e.multiple?Array.from(e.selectedOptions,e=>e.value):e.value?[e.value]:[],{and:Ym,not:Xm,or:Zm}=ui(),Qm=di({props({props:e}){return{loopFocus:!1,closeOnSelect:!e.multiple,composite:!0,defaultValue:[],...e,collection:e.collection??Om.empty(),positioning:{placement:`bottom-start`,gutter:8,...e.positioning}}},context({prop:e,bindable:t,getContext:n}){let r=e(`value`)??e(`defaultValue`)??[],i=e(`collection`).findMany(r);return{value:t(()=>({defaultValue:e(`defaultValue`),value:e(`value`),isEqual:Yn,onChange(t){let r=n(),i=e(`collection`),a=Pp({values:t,collection:i,selectedItemMap:r.get(`selectedItemMap`)}),o=e(`value`)??t,s=o===t?a:Pp({values:o,collection:i,selectedItemMap:a.nextSelectedItemMap});return r.set(`selectedItemMap`,s.nextSelectedItemMap),e(`onValueChange`)?.({value:t,items:a.selectedItems})}})),highlightedValue:t(()=>({defaultValue:e(`defaultHighlightedValue`)||null,value:e(`highlightedValue`),onChange(t){e(`onHighlightChange`)?.({highlightedValue:t,highlightedItem:e(`collection`).find(t),highlightedIndex:e(`collection`).indexOf(t)})}})),currentPlacement:t(()=>({defaultValue:void 0})),fieldsetDisabled:t(()=>({defaultValue:!1})),highlightedItem:t(()=>({defaultValue:null})),selectedItemMap:t(()=>({defaultValue:Fp({selectedItems:i,collection:e(`collection`)})}))}},refs(){return{typeahead:{...ss.defaultOptions}}},computed:{hasSelectedItems:({context:e})=>e.get(`value`).length>0,isTypingAhead:({refs:e})=>e.get(`typeahead`).keysSoFar!==``,isDisabled:({prop:e,context:t})=>!!e(`disabled`)||!!t.get(`fieldsetDisabled`),isInteractive:({prop:e})=>!(e(`disabled`)||e(`readOnly`)),selectedItems:({context:e,prop:t})=>Mp({values:e.get(`value`),collection:t(`collection`),selectedItemMap:e.get(`selectedItemMap`)}),valueAsString:({computed:e,prop:t})=>t(`collection`).stringifyItems(e(`selectedItems`))},initialState({prop:e}){return e(`open`)||e(`defaultOpen`)?`open`:`idle`},entry:[`syncSelectElement`],watch({context:e,prop:t,track:n,action:r}){n([()=>e.get(`value`).toString()],()=>{r([`syncSelectedItems`,`syncSelectElement`,`dispatchChangeEvent`])}),n([()=>t(`open`)],()=>{r([`toggleVisibility`])}),n([()=>e.get(`highlightedValue`)],()=>{r([`syncHighlightedItem`])}),n([()=>t(`collection`).toString()],()=>{r([`syncCollection`])})},on:{"HIGHLIGHTED_VALUE.SET":{actions:[`setHighlightedItem`]},"HIGHLIGHTED_VALUE.CLEAR":{actions:[`clearHighlightedItem`]},"ITEM.SELECT":{actions:[`selectItem`]},"ITEM.CLEAR":{actions:[`clearItem`]},"VALUE.SET":{actions:[`setSelectedItems`]},"VALUE.CLEAR":{actions:[`clearSelectedItems`]},"CLEAR.CLICK":{actions:[`clearSelectedItems`,`focusTriggerEl`]}},effects:[`trackFormControlState`],states:{idle:{tags:[`closed`],on:{"CONTROLLED.OPEN":[{guard:`isTriggerClickEvent`,target:`open`,actions:[`setInitialFocus`,`highlightFirstSelectedItem`]},{target:`open`,actions:[`setInitialFocus`]}],"TRIGGER.CLICK":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`invokeOnOpen`,`setInitialFocus`,`highlightFirstSelectedItem`]}],"TRIGGER.FOCUS":{target:`focused`},OPEN:[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`]}]}},focused:{tags:[`closed`],on:{"CONTROLLED.OPEN":[{guard:`isTriggerClickEvent`,target:`open`,actions:[`setInitialFocus`,`highlightFirstSelectedItem`]},{guard:`isTriggerArrowUpEvent`,target:`open`,actions:[`setInitialFocus`,`highlightComputedLastItem`]},{guard:Zm(`isTriggerArrowDownEvent`,`isTriggerEnterEvent`),target:`open`,actions:[`setInitialFocus`,`highlightComputedFirstItem`]},{target:`open`,actions:[`setInitialFocus`]}],OPEN:[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`]}],"TRIGGER.BLUR":{target:`idle`},"TRIGGER.CLICK":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`,`highlightFirstSelectedItem`]}],"TRIGGER.ENTER":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`,`highlightComputedFirstItem`]}],"TRIGGER.ARROW_UP":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`,`highlightComputedLastItem`]}],"TRIGGER.ARROW_DOWN":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`,`highlightComputedFirstItem`]}],"TRIGGER.ARROW_LEFT":[{guard:Ym(Xm(`multiple`),`hasSelectedItems`),actions:[`selectPreviousItem`]},{guard:Xm(`multiple`),actions:[`selectLastItem`]}],"TRIGGER.ARROW_RIGHT":[{guard:Ym(Xm(`multiple`),`hasSelectedItems`),actions:[`selectNextItem`]},{guard:Xm(`multiple`),actions:[`selectFirstItem`]}],"TRIGGER.HOME":{guard:Xm(`multiple`),actions:[`selectFirstItem`]},"TRIGGER.END":{guard:Xm(`multiple`),actions:[`selectLastItem`]},"TRIGGER.TYPEAHEAD":{guard:Xm(`multiple`),actions:[`selectMatchingItem`]}}},open:{tags:[`open`],exit:[`scrollContentToTop`],effects:[`trackDismissableElement`,`trackFocusVisible`,`computePlacement`,`scrollToHighlightedItem`],on:{"CONTROLLED.CLOSE":[{guard:`restoreFocus`,target:`focused`,actions:[`focusTriggerEl`,`clearHighlightedItem`]},{target:`idle`,actions:[`clearHighlightedItem`]}],CLOSE:[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{guard:`restoreFocus`,target:`focused`,actions:[`invokeOnClose`,`focusTriggerEl`,`clearHighlightedItem`]},{target:`idle`,actions:[`invokeOnClose`,`clearHighlightedItem`]}],"TRIGGER.CLICK":[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{target:`focused`,actions:[`invokeOnClose`,`clearHighlightedItem`]}],"ITEM.CLICK":[{guard:Ym(`closeOnSelect`,`isOpenControlled`),actions:[`selectHighlightedItem`,`invokeOnClose`]},{guard:`closeOnSelect`,target:`focused`,actions:[`selectHighlightedItem`,`invokeOnClose`,`focusTriggerEl`,`clearHighlightedItem`]},{actions:[`selectHighlightedItem`]}],"CONTENT.HOME":{actions:[`highlightFirstItem`]},"CONTENT.END":{actions:[`highlightLastItem`]},"CONTENT.ARROW_DOWN":[{guard:Ym(`hasHighlightedItem`,`loop`,`isLastItemHighlighted`),actions:[`highlightFirstItem`]},{guard:`hasHighlightedItem`,actions:[`highlightNextItem`]},{actions:[`highlightFirstItem`]}],"CONTENT.ARROW_UP":[{guard:Ym(`hasHighlightedItem`,`loop`,`isFirstItemHighlighted`),actions:[`highlightLastItem`]},{guard:`hasHighlightedItem`,actions:[`highlightPreviousItem`]},{actions:[`highlightLastItem`]}],"CONTENT.TYPEAHEAD":{actions:[`highlightMatchingItem`]},"ITEM.POINTER_MOVE":{actions:[`highlightItem`]},"ITEM.POINTER_LEAVE":{actions:[`clearHighlightedItem`]},"POSITIONING.SET":{actions:[`reposition`]}}}},implementations:{guards:{loop:({prop:e})=>!!e(`loopFocus`),multiple:({prop:e})=>!!e(`multiple`),hasSelectedItems:({computed:e})=>!!e(`hasSelectedItems`),hasHighlightedItem:({context:e})=>e.get(`highlightedValue`)!=null,isFirstItemHighlighted:({context:e,prop:t})=>e.get(`highlightedValue`)===t(`collection`).firstValue,isLastItemHighlighted:({context:e,prop:t})=>e.get(`highlightedValue`)===t(`collection`).lastValue,closeOnSelect:({prop:e,event:t})=>!!(t.closeOnSelect??e(`closeOnSelect`)),restoreFocus:({event:e})=>$m(e),isOpenControlled:({prop:e})=>e(`open`)!==void 0,isTriggerClickEvent:({event:e})=>e.previousEvent?.type===`TRIGGER.CLICK`,isTriggerEnterEvent:({event:e})=>e.previousEvent?.type===`TRIGGER.ENTER`,isTriggerArrowUpEvent:({event:e})=>e.previousEvent?.type===`TRIGGER.ARROW_UP`,isTriggerArrowDownEvent:({event:e})=>e.previousEvent?.type===`TRIGGER.ARROW_DOWN`},effects:{trackFocusVisible({scope:e}){return Nu({root:e.getRootNode?.()})},trackFormControlState({context:e,scope:t}){return $a(Bm(t),{onFieldsetDisabledChange(t){e.set(`fieldsetDisabled`,t)},onFormReset(){let t=e.initial(`value`);e.set(`value`,t)}})},trackDismissableElement({scope:e,send:t,prop:n}){let r=()=>Vm(e),i=!0;return Ll(r,{type:`listbox`,defer:!0,exclude:[Hm(e),Um(e)],onFocusOutside:n(`onFocusOutside`),onPointerDownOutside:n(`onPointerDownOutside`),onInteractOutside(e){n(`onInteractOutside`)?.(e),i=!(e.detail.focusable||e.detail.contextmenu)},onDismiss(){t({type:`CLOSE`,src:`interact-outside`,restoreFocus:i})}})},computePlacement({context:e,prop:t,scope:n}){let r=t(`positioning`);return e.set(`currentPlacement`,r.placement),bp(()=>Hm(n),()=>Wm(n),{defer:!0,...r,onComplete(t){e.set(`currentPlacement`,t.placement)}})},scrollToHighlightedItem({context:e,prop:t,scope:n}){let r=r=>{let i=e.get(`highlightedValue`);if(i==null||Au()===`pointer`)return;let a=Vm(n),o=t(`scrollToIndexFn`);if(o){let e=t(`collection`).indexOf(i);o?.({index:e,immediate:r,getElement:()=>Gm(n,i)});return}Qo(Gm(n,i),{rootEl:a,block:`nearest`})};return Co(()=>{ju(`virtual`),r(!0)}),Do(()=>Vm(n),{defer:!0,attributes:[`data-activedescendant`],callback(){r(!1)}})}},actions:{reposition({context:e,prop:t,scope:n,event:r}){bp(Hm(n),()=>Wm(n),{...t(`positioning`),...r.options,defer:!0,listeners:!1,onComplete(t){e.set(`currentPlacement`,t.placement)}})},toggleVisibility({send:e,prop:t,event:n}){e({type:t(`open`)?`CONTROLLED.OPEN`:`CONTROLLED.CLOSE`,previousEvent:n})},highlightPreviousItem({context:e,prop:t}){let n=e.get(`highlightedValue`);if(n==null)return;let r=t(`collection`).getPreviousValue(n,1,t(`loopFocus`));r!=null&&e.set(`highlightedValue`,r)},highlightNextItem({context:e,prop:t}){let n=e.get(`highlightedValue`);if(n==null)return;let r=t(`collection`).getNextValue(n,1,t(`loopFocus`));r!=null&&e.set(`highlightedValue`,r)},highlightFirstItem({context:e,prop:t}){let n=t(`collection`).firstValue;e.set(`highlightedValue`,n)},highlightLastItem({context:e,prop:t}){let n=t(`collection`).lastValue;e.set(`highlightedValue`,n)},setInitialFocus({scope:e}){Co(()=>{bo({root:Vm(e)})?.focus({preventScroll:!0})})},focusTriggerEl({event:e,scope:t}){$m(e)&&Co(()=>{Hm(t)?.focus({preventScroll:!0})})},selectHighlightedItem({context:e,prop:t,event:n}){let r=n.value??e.get(`highlightedValue`);r!=null&&t(`collection`).has(r)&&(t(`onSelect`)?.({value:r}),r=t(`deselectable`)&&!t(`multiple`)&&e.get(`value`).includes(r)?null:r,e.set(`value`,e=>r==null?[]:t(`multiple`)?Hn(e,r):[r]))},highlightComputedFirstItem({context:e,prop:t,computed:n}){let r=t(`collection`),i=n(`hasSelectedItems`)?r.sort(e.get(`value`))[0]:r.firstValue;e.set(`highlightedValue`,i)},highlightComputedLastItem({context:e,prop:t,computed:n}){let r=t(`collection`),i=n(`hasSelectedItems`)?r.sort(e.get(`value`))[0]:r.lastValue;e.set(`highlightedValue`,i)},highlightFirstSelectedItem({context:e,prop:t,computed:n}){if(!n(`hasSelectedItems`))return;let r=t(`collection`).sort(e.get(`value`))[0];e.set(`highlightedValue`,r)},highlightItem({context:e,event:t}){e.set(`highlightedValue`,t.value)},highlightMatchingItem({context:e,prop:t,event:n,refs:r}){let i=t(`collection`).search(n.key,{state:r.get(`typeahead`),currentValue:e.get(`highlightedValue`)});i!=null&&e.set(`highlightedValue`,i)},setHighlightedItem({context:e,event:t}){e.set(`highlightedValue`,t.value)},clearHighlightedItem({context:e}){e.set(`highlightedValue`,null)},selectItem({context:e,prop:t,event:n}){t(`onSelect`)?.({value:n.value});let r=t(`deselectable`)&&!t(`multiple`)&&e.get(`value`).includes(n.value)?null:n.value;e.set(`value`,e=>r==null?[]:t(`multiple`)?Hn(e,r):[r])},clearItem({context:e,event:t}){e.set(`value`,e=>e.filter(e=>e!==t.value))},setSelectedItems({context:e,event:t}){e.set(`value`,t.value)},clearSelectedItems({context:e}){e.set(`value`,[])},selectPreviousItem({context:e,prop:t}){let[n]=e.get(`value`),r=t(`collection`).getPreviousValue(n);r&&e.set(`value`,[r])},selectNextItem({context:e,prop:t}){let[n]=e.get(`value`),r=t(`collection`).getNextValue(n);r&&e.set(`value`,[r])},selectFirstItem({context:e,prop:t}){let n=t(`collection`).firstValue;n&&e.set(`value`,[n])},selectLastItem({context:e,prop:t}){let n=t(`collection`).lastValue;n&&e.set(`value`,[n])},selectMatchingItem({context:e,prop:t,event:n,refs:r}){let i=t(`collection`).search(n.key,{state:r.get(`typeahead`),currentValue:e.get(`value`)[0]});i!=null&&e.set(`value`,[i])},scrollContentToTop({prop:e,scope:t}){if(e(`scrollToIndexFn`)){let n=e(`collection`).firstValue;e(`scrollToIndexFn`)?.({index:0,immediate:!0,getElement:()=>Gm(t,n)})}else Vm(t)?.scrollTo(0,0)},invokeOnOpen({prop:e,context:t}){e(`onOpenChange`)?.({open:!0,value:t.get(`value`)})},invokeOnClose({prop:e,context:t}){e(`onOpenChange`)?.({open:!1,value:t.get(`value`)})},syncSelectElement({context:e,prop:t,scope:n}){let r=Bm(n);if(r){if(e.get(`value`).length===0&&!t(`multiple`)){r.selectedIndex=-1;return}for(let t of r.options)t.selected=e.get(`value`).includes(t.value)}},syncCollection({context:e,prop:t}){let n=t(`collection`),r=n.find(e.get(`highlightedValue`));r&&e.set(`highlightedItem`,r);let i=Pp({values:e.get(`value`),collection:n,selectedItemMap:e.get(`selectedItemMap`)});e.set(`selectedItemMap`,i.nextSelectedItemMap)},syncSelectedItems({context:e,prop:t}){let n=Pp({values:e.get(`value`),collection:t(`collection`),selectedItemMap:e.get(`selectedItemMap`)});e.set(`selectedItemMap`,n.nextSelectedItemMap)},syncHighlightedItem({context:e,prop:t}){let n=t(`collection`),r=e.get(`highlightedValue`),i=r?n.find(r):null;e.set(`highlightedItem`,i)},dispatchChangeEvent({scope:e}){queueMicrotask(()=>{let t=Bm(e);if(!t)return;let n=new(e.getWin()).Event(`change`,{bubbles:!0,composed:!0});t.dispatchEvent(no(n))})}}}});function $m(e){let t=e.restoreFocus??e.previousEvent?.restoreFocus;return t==null||!!t}var eh=B(`slider`).parts(`root`,`label`,`thumb`,`valueText`,`track`,`range`,`control`,`markerGroup`,`marker`,`draggingIndicator`);eh.build();var th=Object.defineProperty,nh=(e,t,n)=>t in e?th(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rh=(e,t,n)=>nh(e,typeof t==`symbol`?t:t+``,n),ih=B(`splitter`).parts(`root`,`panel`,`resizeTrigger`,`resizeTriggerIndicator`),ah=ih.build(),oh=e=>e.ids?.root??`splitter:${e.id}`,sh=(e,t)=>e.ids?.resizeTrigger?.(t)??`splitter:${e.id}:splitter:${t}`,ch=(e,t)=>e.ids?.panel?.(t)??`splitter:${e.id}:panel:${t}`,lh=e=>`splitter:${e.id}:global-cursor`,uh=e=>e.getById(oh(e)),dh=(e,t)=>t==null?null:e.getById(sh(e,t)),fh=e=>ji(e)&&e.dataset.part===`panel`?e.dataset.id:void 0,ph=e=>{let t=e?.previousElementSibling??null;for(;t;){let e=fh(t);if(e)return e;t=t.previousElementSibling}},mh=e=>{let t=e?.nextElementSibling??null;for(;t;){let e=fh(t);if(e)return e;t=t.nextElementSibling}},hh=(e,t)=>{let[n,r]=t.split(`:`);if(n&&r)return t;let i=dh(e,t),a=n||ph(i),o=r||mh(i);return a&&o?`${a}:${o}`:null},gh=(e,t)=>{let n=t?`col-resize`:`row-resize`;return e.isAtMin&&(n=t?`e-resize`:`s-resize`),e.isAtMax&&(n=t?`w-resize`:`n-resize`),n},_h=e=>Uo(uh(e),`[role=separator]${Ei(oh(e))}`),vh=e=>e.getDoc().getElementById(lh(e)),yh=(e,t,n,r)=>{let i=vh(e),a=`* { cursor: ${gh(t,n)} !important; }`;if(i)i.textContent=a;else{let t=e.getDoc().createElement(`style`);r&&(t.nonce=r),t.id=lh(e),t.textContent=a,e.getDoc().head.appendChild(t)}},bh=e=>{vh(e)?.remove()};function xh({size:e,panels:t,pivotIndices:n}){let r=0,i=100,a=0,o=0,s=n[0];return kr(s,()=>`No pivot index found`),t.forEach((e,t)=>{let{maxSize:n=100,minSize:c=0}=e;t===s?(r=c,i=n):(a+=c,o+=n)}),{valueMax:Math.min(i,100-a),valueMin:Math.max(r,100-o),valueNow:e[s]}}function Sh(e,t,n){let[r,i]=n.split(`:`),a=t.findIndex(e=>e.id===r),o=t.findIndex(e=>e.id===i);if(a===-1||o===-1)return{beforeId:r||void 0,afterId:i||void 0,valueMax:void 0,valueMin:void 0,valueNow:void 0};let{valueMax:s,valueMin:c,valueNow:l}=xh({size:e,panels:t,pivotIndices:[a,o]});return{beforeId:r,afterId:i,valueMax:Math.round(s),valueMin:Math.round(c),valueNow:l==null?void 0:Math.round(l)}}function Ch(e,t,n=10){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function wh(e,t,n=10){return e==null||t==null?!1:Ch(e,t,n)===0}function Th(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],a=t[r];if(!wh(i,a,n))return!1}return!0}var Eh=/^(-?\d*\.?\d+)(%|px|em|rem|vw|vh)?$/,Dh=/^(-?\d*\.?\d+)%$/;function Oh(e,t){if(!e)return 0;let n=e.getBoundingClientRect();return t===`horizontal`?n.width:n.height}function kh(e,t){return Oh(e,t)}function Ah(e,t,n){let r=n.ownerDocument.defaultView;if(r)switch(t){case`px`:return e;case`em`:return e*Number.parseFloat(r.getComputedStyle(n).fontSize);case`rem`:return e*Number.parseFloat(r.getComputedStyle(n.ownerDocument.documentElement).fontSize);case`vw`:return e/100*r.innerWidth;case`vh`:return e/100*r.innerHeight;default:return}}function jh(e,t,n){if(e==null)return;if(typeof e==`number`)return e;let r=e.trim().match(Eh);if(!r)return;let i=Number.parseFloat(r[1]);if(!Number.isFinite(i))return;let a=r[2];if(a==null||a===`%`)return i;if(!t)return;let o=Oh(t,n);if(o===0)return;let s=Ah(i,a,t);return s==null?void 0:s/o*100}function Mh(e){if(e==null)return;if(typeof e==`number`)return`${e}%`;let t=e.trim();if(Dh.test(t))return t;let n=t.match(Eh);if(!n)return;let r=Number.parseFloat(n[1]);if(!Number.isFinite(r))return;let i=n[2];return i==null?`${r}%`:`${r}${i}`}function Nh({sizes:e,panels:t,rootEl:n,orientation:r}){let i=Array(t.length),a=100,o=0;for(let s=0;s<t.length;s++){let t=jh(e?.[s],n,r);t!=null&&(o++,i[s]=t,a-=t)}for(let e=0;e<t.length;e++){if(i[e]!=null)continue;let n=t.length-o,r=n>0?a/n:0;o++,i[e]=r,a-=r}return i}function Ph(e,t,n){return e.map(e=>({...e,minSize:jh(e.minSize,t,n),maxSize:jh(e.maxSize,t,n),collapsedSize:jh(e.collapsedSize,t,n)}))}function Fh(e,t){let n=e.find(e=>e.id===t);return kr(n,()=>`Panel data not found for id "${t}"`),n}function Ih(e,t){return e.findIndex(e=>e===t||e.id===t.id)}function Lh(e,t){return e.findIndex(e=>e.id===t)}function Rh(e,t,n){let r=Lh(e,t.id),i=r===e.length-1?[r-1,r]:[r,r+1],a=n[r];return{...t,panelSize:a,pivotIndices:i}}function zh(e){return e.sort((e,t)=>{let n=e.order,r=t.order;return n==null&&r==null?0:n==null?-1:r==null?1:n-r})}function Bh(e){return e.map(e=>e.id).sort().join(`:`)}function Vh(e){return e.map(e=>e.id).sort().map(t=>{let n=e.find(e=>e.id===t);return JSON.stringify(n)}).join(`,`)}function Hh({size:e,defaultSize:t,dragState:n,resolvedSizes:r,panels:i,panelIndex:a,horizontal:o,collapsed:s=!1,precision:c=3}){let l=r[a],u=e??t,d=i[a],f,p,m=1,h=o?`Width`:`Height`,g=d?Mh(d.minSize):void 0,_=d?Mh(d.maxSize):void 0,v=s?Mh(d?.collapsedSize??0):g,y=Mh(u);return l==null?y==null?f=`1`:y.endsWith(`%`)?f=Number.parseFloat(y).toPrecision(c):(p=Uh({basis:y,minSize:g,maxSize:_}),f=`0`,m=0):f=i.length===1?`1`:l.toPrecision(c),{flexBasis:p??0,flexGrow:f,flexShrink:m,...v?{[`min${h}`]:v}:{},..._?{[`max${h}`]:_}:{},overflow:`hidden`,pointerEvents:n===null?void 0:`none`}}function Uh({basis:e,minSize:t,maxSize:n}){return`clamp(${t??`0%`}, ${e}, ${n??`100%`})`}function Wh(e,t){let{state:n,send:r,prop:i,computed:a,context:o,scope:s}=e,c=a(`horizontal`),l=n.matches(`dragging`),u=i(`registry`),d=i(`orientation`),f=i(`panels`),p=o.get(`panels`),m=()=>{let e=o.get(`size`);return e.length>0?e:Nh({sizes:i(`size`)??i(`defaultSize`),panels:f,rootEl:null,orientation:d})},h=e=>{let t=f.findIndex(t=>t.id===e),n=i(`size`)?.[t],r=i(`defaultSize`)?.[t],a=o.get(`dragState`),s=o.get(`size`),l=p[t],u=s[t],d=!!l?.collapsible&&u!=null&&wh(u,l.collapsedSize??0);return Hh({size:n,defaultSize:r,dragState:a,resolvedSizes:s,panels:f,panelIndex:t,horizontal:c,collapsed:d})},g=e=>{let[t,n]=e.split(`:`);if(t&&n)return e;if(t){let n=f.findIndex(e=>e.id===t),r=f[n+1];return r?`${t}:${r.id}`:e}if(n){let t=f.findIndex(e=>e.id===n),r=f[t-1];return r?`${r.id}:${n}`:e}return e},_=e=>{let{id:t,disabled:r}=e,i=o.get(`dragState`)?.resizeTriggerId===t;return{dragging:i,focused:i||n.matches(`focused`)&&o.get(`keyboardState`)?.resizeTriggerId===t,disabled:!!r}};return{dragging:l,orientation:d,getPanels(){return f},getPanelById(e){return Fh(f,e)},getItems(){return f.flatMap((e,t,n)=>{let r=n[t+1];return e&&r?[{type:`panel`,id:e.id},{type:`handle`,id:`${e.id}:${r.id}`}]:[{type:`panel`,id:e.id}]})},getSizes(){return m()},setSizes(e){r({type:`SIZE.SET`,size:e})},resetSizes(){r({type:`SIZE.RESET`})},collapsePanel(e){r({type:`PANEL.COLLAPSE`,id:e})},expandPanel(e,t){r({type:`PANEL.EXPAND`,id:e,minSize:t})},resizePanel(e,t){r({type:`PANEL.RESIZE`,id:e,size:t})},getPanelSize(e){let t=o.get(`panels`),n=m(),r=Fh(t,e),{panelSize:i}=Rh(t,r,n);return kr(i!=null,()=>`Panel size not found for panel "${r.id}"`),i},isPanelCollapsed(e){let t=o.get(`panels`),n=m(),r=Fh(t,e),{collapsedSize:i=0,collapsible:a,panelSize:s}=Rh(t,r,n);return kr(s!=null,()=>`Panel size not found for panel "${r.id}"`),a===!0&&wh(s,i)},isPanelExpanded(e){let t=o.get(`panels`),n=m(),r=Fh(t,e),{collapsedSize:i=0,collapsible:a,panelSize:s}=Rh(t,r,n);return kr(s!=null,()=>`Panel size not found for panel "${r.id}"`),!a||Ch(s,i)>0},getLayout(){return Bh(i(`panels`))},getRootProps(){return t.element({...ah.root.attrs,"data-orientation":d,"data-dragging":R(l),id:oh(s),dir:i(`dir`),style:{display:`flex`,flexDirection:c?`row`:`column`,height:`100%`,width:`100%`,overflow:`hidden`}})},getPanelProps(e){let{id:n}=e;return t.element({...ah.panel.attrs,"data-orientation":d,"data-dragging":R(l),dir:i(`dir`),"data-id":n,"data-index":Lh(i(`panels`),n),id:ch(s,n),"data-ownedby":oh(s),style:h(n)})},getResizeTriggerState:_,getResizeTriggerIndicator(e){let n=_(e);return t.element({...ah.resizeTriggerIndicator.attrs,"data-orientation":d,"data-focus":R(n.focused),"data-dragging":R(n.dragging),"data-disabled":R(n.disabled),"data-ownedby":oh(s)})},getResizeTriggerProps(e){let{id:n}=e,a=_(e),o=g(n),l=Sh(m(),p,o);return t.element({...ah.resizeTrigger.attrs,dir:i(`dir`),id:sh(s,n),role:`separator`,"data-id":n,"data-ownedby":oh(s),tabIndex:a.disabled?void 0:0,"aria-valuenow":l.valueNow,"aria-valuemin":l.valueMin,"aria-valuemax":l.valueMax,"data-orientation":d,"aria-orientation":d,"aria-controls":l.beforeId&&l.afterId?`${ch(s,l.beforeId)} ${ch(s,l.afterId)}`:void 0,"data-focus":R(a.focused),"data-dragging":R(a.dragging),"data-disabled":R(a.disabled),style:{touchAction:`none`,userSelect:`none`,WebkitUserSelect:`none`,flex:`0 0 auto`,pointerEvents:a.disabled||a.dragging&&!a.focused?`none`:void 0,cursor:a.disabled||u?void 0:c?`col-resize`:`row-resize`,[c?`minHeight`:`minWidth`]:`0`},onPointerDown(e){if(!Ra(e))return;if(a.disabled){e.preventDefault();return}if(e.currentTarget.focus({preventScroll:!0,focusVisible:!1}),u)return;let t=Ga(e);r({type:`POINTER_DOWN`,id:n,point:t}),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault(),e.stopPropagation()},onPointerUp(e){a.disabled||e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)},onPointerOver(){a.disabled||u||r({type:`POINTER_OVER`,id:n})},onPointerLeave(){a.disabled||u||r({type:`POINTER_LEAVE`,id:n})},onBlur(){a.disabled||r({type:`BLUR`})},onFocus(){a.disabled||r({type:`FOCUS`,id:n})},onKeyDown(e){if(e.defaultPrevented||a.disabled)return;let t=i(`keyboardResizeBy`),o=0;o=e.shiftKey?10:t??1;let s={Enter(){r({type:`ENTER`,id:n})},ArrowUp(){r({type:`KEYBOARD_MOVE`,id:n,delta:c?0:-o})},ArrowDown(){r({type:`KEYBOARD_MOVE`,id:n,delta:c?0:o})},ArrowLeft(){r({type:`KEYBOARD_MOVE`,id:n,delta:c?-o:0})},ArrowRight(){r({type:`KEYBOARD_MOVE`,id:n,delta:c?o:0})},Home(){r({type:`KEYBOARD_MOVE`,id:n,delta:-100})},End(){r({type:`KEYBOARD_MOVE`,id:n,delta:100})},F6(){r({type:`FOCUS.CYCLE`,id:n,shiftKey:e.shiftKey})}}[Ua(e,{dir:i(`dir`),orientation:d})];s&&(s(e),e.preventDefault())}})}}}function Gh({panels:e,prevLayout:t,prevGroupSize:n,nextGroupSize:r}){if(n<=0||r<=0)return t;let i=[...t],a=[],o=0,s=0;if(e.forEach((e,c)=>{if(e.resizeBehavior===`preserve-pixel-size`){let e=t[c]/100*n/r*100;i[c]=e,o+=e}else a.push(c),s+=t[c]}),a.length===0){let e=i.reduce((e,t)=>e+t,0);if(wh(e,100))return i;if(e<=0)return t;let n=100/e;return i.map(e=>e*n)}let c=100-o;if(c<=0){let e=i.reduce((e,t)=>e+t,0);if(wh(e,100))return i;let t=100/Math.max(e,1);return i.map(e=>e*t)}if(wh(s,0)){let e=c/a.length;return a.forEach(t=>{i[t]=e}),i}a.forEach(e=>{i[e]=t[e]/s*c});let l=i.reduce((e,t)=>e+t,0);if(wh(l,100))return i;let u=100/l;return i.map(e=>e*u)}function Kh({panels:e,index:t,size:n}){let r=e[t];kr(r,()=>`Panel data not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,maxSize:o=100,minSize:s=0}=r;if(Ch(n,s)<0){if(a){let e=(i+s)/2;n=Ch(n,e)<0?i:s}else n=s}return n=Math.min(o,n),n=parseFloat(n.toFixed(10)),n}function qh(e){let{delta:t,initialSize:n,panels:r,pivotIndices:i,prevSize:a,trigger:o}=e;if(wh(t,0))return n;let s=[...n],[c,l]=i;kr(c,()=>`Invalid first pivot index`),kr(l,()=>`Invalid second pivot index`);let u=0;if(o===`keyboard`){{let e=t<0?l:c,i=r[e];kr(i,()=>`Panel data not found for index ${e}`);let{collapsedSize:a=0,collapsible:o,minSize:s=0}=i;if(o){let r=n[e];if(kr(r,()=>`Previous size not found for panel index ${e}`),wh(r,a)){let e=s-r;Ch(e,Math.abs(t))>0&&(t=t<0?0-e:e)}}}{let e=t<0?c:l,i=r[e];kr(i,()=>`No panel data found for index ${e}`);let{collapsedSize:a=0,collapsible:o,minSize:s=0}=i;if(o){let r=n[e];if(kr(r,()=>`Previous size not found for panel index ${e}`),wh(r,s)){let e=r-a;Ch(e,Math.abs(t))>0&&(t=t<0?0-e:e)}}}}{let e=t<0?1:-1,i=t<0?l:c,a=0;for(;;){let t=n[i];kr(t,()=>`Previous size not found for panel index ${i}`);let o=Kh({panels:r,index:i,size:100})-t;if(a+=o,i+=e,i<0||i>=r.length)break}let o=Math.min(Math.abs(t),Math.abs(a));t=t<0?0-o:o}{let e=t<0?c:l;for(;e>=0&&e<r.length;){let i=Math.abs(t)-Math.abs(u),a=n[e];kr(a,()=>`Previous size not found for panel index ${e}`);let o=a-i,c=Kh({panels:r,index:e,size:o});if(!wh(a,c)&&(u+=a-c,s[e]=c,u.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?e--:e++}}if(Th(a,s))return a;{let e=t<0?l:c,i=n[e];kr(i,()=>`Previous size not found for panel index ${e}`);let a=i+u,o=Kh({panels:r,index:e,size:a});if(s[e]=o,!wh(o,a)){let e=a-o,n=t<0?l:c;for(;n>=0&&n<r.length;){let i=s[n];kr(i,()=>`Previous size not found for panel index ${n}`);let a=i+e,o=Kh({panels:r,index:n,size:a});if(wh(i,o)||(e-=o-i,s[n]=o),wh(e,0))break;t>0?n--:n++}}}return wh(s.reduce((e,t)=>t+e,0),100)?s:a}function Jh({size:e,panels:t}){let n=[...e],r=n.reduce((e,t)=>e+t,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel size: ${n.map(e=>`${e}%`).join(`, `)}`);if(!wh(r,100)&&n.length>0)for(let e=0;e<t.length;e++){let t=n[e];kr(t,()=>`No size data found for index ${e}`);let i=100/r*t;n[e]=i}let i=0;for(let e=0;e<t.length;e++){let r=n[e];kr(r,()=>`No size data found for index ${e}`);let a=Kh({panels:t,index:e,size:r});r!=a&&(i+=r-a,n[e]=a)}if(!wh(i,0))for(let e=0;e<t.length;e++){let r=n[e];kr(r,()=>`No size data found for index ${e}`);let a=r+i,o=Kh({panels:t,index:e,size:a});if(r!==o&&(i-=o-r,n[e]=o,wh(i,0)))break}return n}var Yh=di({props({props:e}){return Ar(e,[`panels`]),{orientation:`horizontal`,defaultSize:[],dir:`ltr`,...e,panels:zh(e.panels)}},initialState(){return`idle`},context({prop:e,bindable:t,getContext:n,getRefs:r}){return{panels:t(()=>({defaultValue:Ph(e(`panels`),null,e(`orientation`))})),size:t(()=>({defaultValue:[],isEqual(e,t){return t!=null&&Th(e,t)},onChange(t){let i=n(),a=r();if(a.get(`suppressOnResize`))return;let o=a.get(`panelSizeBeforeCollapse`),s=Object.fromEntries(o.entries()),c=i.get(`dragState`)?.resizeTriggerId??null,l=Bh(e(`panels`));e(`onResize`)?.({size:t,layout:l,resizeTriggerId:c,expandToSizes:s})}})),dragState:t(()=>({defaultValue:null})),keyboardState:t(()=>({defaultValue:null}))}},watch({track:e,action:t,prop:n}){e([()=>Vh(n(`panels`)),()=>JSON.stringify(n(`size`)??[]),()=>JSON.stringify(n(`defaultSize`)??[])],()=>{t([`syncSize`])})},refs(){return{panelSizeBeforeCollapse:new Map,prevDelta:0,panelIdToLastNotifiedSizeMap:new Map,initialSize:null,prevInitialLayout:null,prevGroupSize:null,lastRequestedSize:null,suppressOnResize:!1}},computed:{horizontal({prop:e}){return e(`orientation`)===`horizontal`}},on:{"SIZE.SET":{actions:[`setSize`]},"SIZE.RESET":{actions:[`resetSize`]},"PANEL.COLLAPSE":{actions:[`collapsePanel`]},"PANEL.EXPAND":{actions:[`expandPanel`]},"PANEL.RESIZE":{actions:[`resizePanel`]},"ROOT.RESIZE":{actions:[`syncSize`]}},entry:[`syncSize`],exit:[`clearGlobalCursor`],effects:[`trackResizeHandles`,`trackRootResize`],states:{idle:{entry:[`clearDraggingState`,`clearKeyboardState`],on:{POINTER_OVER:{target:`hover:temp`,actions:[`setKeyboardState`]},FOCUS:{target:`focused`,actions:[`setKeyboardState`]},POINTER_DOWN:{target:`dragging`,actions:[`setDraggingState`]}}},"hover:temp":{effects:[`waitForHoverDelay`],on:{HOVER_DELAY:{target:`hover`},FOCUS:{target:`focused`,actions:[`setKeyboardState`]},POINTER_DOWN:{target:`dragging`,actions:[`setDraggingState`]},POINTER_LEAVE:{target:`idle`}}},hover:{tags:[`focus`],on:{FOCUS:{target:`focused`,actions:[`setKeyboardState`]},POINTER_DOWN:{target:`dragging`,actions:[`setDraggingState`]},POINTER_LEAVE:{target:`idle`}}},focused:{tags:[`focus`],on:{BLUR:{target:`idle`},ENTER:{actions:[`collapseOrExpandPanel`]},POINTER_DOWN:{target:`dragging`,actions:[`setDraggingState`]},KEYBOARD_MOVE:{actions:[`invokeOnResizeStart`,`setKeyboardValue`,`invokeOnResizeEnd`]},"FOCUS.CYCLE":{actions:[`focusNextResizeTrigger`]}}},dragging:{tags:[`focus`],effects:[`trackPointerMove`],entry:[`invokeOnResizeStart`],on:{POINTER_MOVE:{actions:[`setPointerValue`,`setGlobalCursor`]},POINTER_UP:[{guard:`isResizeTriggerFocused`,target:`focused`,actions:[`invokeOnResizeEnd`,`setKeyboardState`,`clearDraggingState`,`clearGlobalCursor`]},{target:`idle`,actions:[`invokeOnResizeEnd`,`clearGlobalCursor`]}]}}},implementations:{guards:{isResizeTriggerFocused({context:e,scope:t}){let n=e.get(`dragState`);return t.isActiveElement(dh(t,n?.resizeTriggerId))}},effects:{trackResizeHandles:({prop:e,scope:t,send:n})=>{let r=e(`registry`);if(!r)return;let i=[],a=()=>{i.forEach(e=>e()),i=_h(t).map(i=>{let a=i.dataset.id;if(a)return r.register({id:sh(t,a),element:i,orientation:e(`orientation`),onActivate(e){n({type:`POINTER_DOWN`,id:a,point:e})},onDeactivate(){n({type:`POINTER_UP`})}})}).filter(Boolean)};a();let o=ko(uh(t),{callback:a});return()=>{i.forEach(e=>e()),o?.()}},trackRootResize:({scope:e,send:t})=>{let n=uh(e);if(n)return Xo.observe(n,()=>{t({type:`ROOT.RESIZE`})})},waitForHoverDelay:({send:e})=>Er(()=>{e({type:`HOVER_DELAY`})},250),trackPointerMove:({scope:e,send:t})=>Vo(e.getDoc(),{onPointerMove(e){t({type:`POINTER_MOVE`,point:e.point})},onPointerUp(){t({type:`POINTER_UP`})}})},actions:{setSize(e){let{context:t,event:n,prop:r,scope:i}=e,a=n.size,o=t.get(`size`),s=t.get(`panels`),c=Jh({size:Nh({sizes:a,panels:r(`panels`),rootEl:uh(i),orientation:r(`orientation`)}),panels:s});Yn(o,c)||Xh(e,c)},resetSize(e){let{refs:t,context:n,prop:r,scope:i}=e;Xh(e,t.get(`initialSize`)??Jh({size:Nh({sizes:r(`size`)??r(`defaultSize`),panels:r(`panels`),rootEl:uh(i),orientation:r(`orientation`)}),panels:n.get(`panels`)}))},syncSize(e){let{context:t,scope:n,prop:r,refs:i}=e,a=uh(n);if(!a)return;let o=r(`orientation`),s=kh(a,o);if(s<=0)return;let c=Ph(r(`panels`),a,r(`orientation`));t.set(`panels`,c);let l=r(`size`)??r(`defaultSize`),u=`${Bh(r(`panels`))}:${JSON.stringify(r(`size`)??[])}:${JSON.stringify(r(`defaultSize`)??[])}`,d=i.get(`prevGroupSize`),f=t.get(`size`),p=Nh({sizes:l,panels:r(`panels`),rootEl:a,orientation:o}),m=Jh({size:d!=null&&d!==s&&f.length===c.length?Gh({panels:c,prevLayout:f,prevGroupSize:d,nextGroupSize:s}):p,panels:c});i.get(`prevInitialLayout`)!==u&&(i.set(`initialSize`,m),i.set(`prevInitialLayout`,u));let h=t.get(`size`);Yn(h,m)||(i.set(`suppressOnResize`,r(`size`)!=null||h.length===0),t.set(`size`,m),i.set(`suppressOnResize`,!1)),i.set(`prevGroupSize`,s)},setDraggingState({context:e,event:t,prop:n,scope:r}){let i=n(`orientation`),a=e.get(`size`),o=t.id,s=hh(r,o);if(!s||!uh(r))return;let c=dh(r,o);kr(c,()=>`Drag handle element not found for id "${o}"`);let l=i===`horizontal`?t.point.x:t.point.y;e.set(`dragState`,{resizeTriggerId:t.id,resolvedResizeTriggerId:s,resizeTriggerRect:c.getBoundingClientRect(),initialCursorPosition:l,initialSize:a})},clearDraggingState({context:e}){e.set(`dragState`,null)},setKeyboardState({context:e,event:t,scope:n}){let r=t.id??e.get(`dragState`)?.resizeTriggerId;r!=null&&e.set(`keyboardState`,{resizeTriggerId:r,resolvedResizeTriggerId:hh(n,r)})},clearKeyboardState({context:e}){e.set(`keyboardState`,null)},collapsePanel(e){let{context:t,event:n,refs:r}=e,i=t.get(`size`),a=t.get(`panels`),o=a.find(e=>e.id===n.id);if(kr(o,()=>`Panel data not found for id "${n.id}"`),o.collapsible){let{collapsedSize:t=0,panelSize:n,pivotIndices:s}=Rh(a,o,i);if(kr(n!=null,()=>`Panel size not found for panel "${o.id}"`),!wh(n,t)){r.get(`panelSizeBeforeCollapse`).set(o.id,n);let c=qh({delta:Ih(a,o)===a.length-1?n-t:t-n,initialSize:i,panels:a,pivotIndices:s,prevSize:i,trigger:`imperative-api`});Yn(i,c)||Xh(e,c)}}},expandPanel(e){let{context:t,event:n,refs:r}=e,i=t.get(`panels`),a=t.get(`size`),o=i.find(e=>e.id===n.id);if(kr(o,()=>`Panel data not found for id "${n.id}"`),o.collapsible){let{collapsedSize:t=0,panelSize:s=0,minSize:c=0,pivotIndices:l}=Rh(i,o,a),u=n.minSize??c;if(wh(s,t)){let t=r.get(`panelSizeBeforeCollapse`).get(o.id),n=t!=null&&t>=u?t:u,c=qh({delta:Ih(i,o)===i.length-1?s-n:n-s,initialSize:a,panels:i,pivotIndices:l,prevSize:a,trigger:`imperative-api`});Yn(a,c)||Xh(e,c)}}},resizePanel(e){let{context:t,event:n}=e,r=t.get(`size`),i=t.get(`panels`),a=Fh(i,n.id),o=n.size,{panelSize:s,pivotIndices:c}=Rh(i,a,r);kr(s!=null,()=>`Panel size not found for panel "${a.id}"`);let l=qh({delta:Ih(i,a)===i.length-1?s-o:o-s,initialSize:r,panels:i,pivotIndices:c,prevSize:r,trigger:`imperative-api`});Yn(r,l)||Xh(e,l)},setPointerValue(e){let{context:t,event:n,prop:r,scope:i}=e,a=t.get(`dragState`);if(!a)return;let{resolvedResizeTriggerId:o,initialSize:s,initialCursorPosition:c}=a,l=t.get(`panels`),u=uh(i);kr(u,()=>`Panel group element not found`);let d=o.split(`:`).map(e=>l.findIndex(t=>t.id===e)),f=r(`orientation`)===`horizontal`,p=f?n.point.x:n.point.y,m=u.getBoundingClientRect(),h=f?m.width:m.height,g=(p-c)/h*100,_=t.get(`size`),v=qh({delta:g,initialSize:s??_,panels:l,pivotIndices:d,prevSize:_,trigger:`mouse-or-touch`});Yn(_,v)||Xh(e,v)},setKeyboardValue(e){let{context:t,event:n}=e,r=t.get(`panels`),i=hh(e.scope,n.id);if(!i)return;let a=n.delta,o=i.split(`:`).map(e=>r.findIndex(t=>t.id===e)),s=t.get(`size`),c=qh({delta:a,initialSize:s,panels:r,pivotIndices:o,prevSize:s,trigger:`keyboard`});Yn(s,c)||Xh(e,c)},invokeOnResizeEnd({context:e,prop:t,refs:n}){queueMicrotask(()=>{let r=e.get(`dragState`);t(`onResizeEnd`)?.({size:n.get(`lastRequestedSize`)??e.get(`size`),resizeTriggerId:r?.resizeTriggerId??null})})},invokeOnResizeStart({prop:e}){queueMicrotask(()=>{e(`onResizeStart`)?.()})},collapseOrExpandPanel(e){let{context:t,refs:n}=e,r=t.get(`panels`),i=t.get(`size`),[a,o]=(t.get(`keyboardState`)?.resolvedResizeTriggerId)?.split(`:`)??[],s=r.findIndex(e=>e.id===a);if(s===-1)return;let c=r[s];kr(c,()=>`No panel data found for index ${s}`);let l=i[s],{collapsedSize:u=0,collapsible:d,minSize:f=0}=c;if(l!=null&&d){let t=[a,o].map(e=>r.findIndex(t=>t.id===e)),s=qh({delta:wh(l,u)?f-u:u-l,initialSize:n.get(`initialSize`)??i,panels:r,pivotIndices:t,prevSize:i,trigger:`keyboard`});Yn(i,s)||Xh(e,s)}},setGlobalCursor(e){let{context:t,scope:n,prop:r}=e;if(r(`registry`))return;let i=t.get(`dragState`);if(!i)return;let a=t.get(`panels`),o=r(`orientation`)===`horizontal`,[s]=i.resolvedResizeTriggerId.split(`:`),c=a[a.findIndex(e=>e.id===s)],l=Sh(t.get(`size`),a,i.resolvedResizeTriggerId);yh(n,{isAtMin:wh(l.valueNow,l.valueMin)||wh(l.valueNow,c.collapsedSize),isAtMax:wh(l.valueNow,l.valueMax)},o,r(`nonce`))},clearGlobalCursor({scope:e}){bh(e)},focusNextResizeTrigger({event:e,scope:t}){let n=_h(t),r=n.findIndex(t=>t.dataset.id===e.id);(e.shiftKey?Kn(n,r):Wn(n,r))?.focus()}}}});function Xh(e,t){let{refs:n,prop:r,context:i}=e,a=i.get(`panels`),o=r(`onCollapse`),s=r(`onExpand`),c=r(`onResize`),l=r(`onResizeStart`),u=r(`onResizeEnd`),d=n.get(`panelIdToLastNotifiedSizeMap`),f=i.get(`dragState`),p=i.get(`keyboardState`),m=f===null&&p===null;if(n.set(`lastRequestedSize`,t),m&&l&&queueMicrotask(()=>{l()}),r(`size`)==null)i.set(`size`,t);else if(c){let e=n.get(`panelSizeBeforeCollapse`),i=Object.fromEntries(e.entries()),a=f?.resizeTriggerId??null;c({size:t,layout:Bh(r(`panels`)),resizeTriggerId:a,expandToSizes:i})}t.forEach((e,t)=>{let n=a[t];kr(n,()=>`Panel data not found for index ${t}`);let{collapsedSize:r=0,collapsible:i,id:c}=n,l=d.get(c);(l==null||e!==l)&&(d.set(c,e),i&&l!=null&&(o||s)&&(wh(l,r)&&!wh(e,r)&&s?.({panelId:c,size:e}),!wh(l,r)&&wh(e,r)&&o?.({panelId:c,size:e})))}),m&&u&&queueMicrotask(()=>{u({size:t,resizeTriggerId:null})})}function Zh(e,t,n=!1){return n?e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y:e.x<=t.x+t.width&&e.x+e.width>=t.x&&e.y<=t.y+t.height&&e.y+e.height>=t.y}function Qh(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}function $h(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:Gi(e),b:Gi(t)},r=null;for(;n.a.at(-1)===n.b.at(-1);){let e=n.a.pop();n.b.pop(),r=e}kr(r,()=>`[stacking-order] Stacking order can only be calculated for elements with a common ancestor`);let i={a:ig(rg(n.a)),b:ig(rg(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var eg=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function tg(e){let t=ea(Wi(e)??e).display;return t===`flex`||t===`inline-flex`}function ng(e){let t=ea(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||tg(e))||+t.opacity<1||nr(t,`transform`)&&t.transform!==`none`||nr(t,`webkitTransform`)&&t.webkitTransform!==`none`||nr(t,`mixBlendMode`)&&t.mixBlendMode!==`normal`||nr(t,`filter`)&&t.filter!==`none`||nr(t,`webkitFilter`)&&t.webkitFilter!==`none`||nr(t,`isolation`)&&t.isolation===`isolate`||eg.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function rg(e){let t=e.length;for(;t--;){let n=e[t];if(kr(n,()=>`[stacking-order] missing node in findStackingContext`),ng(n))return n}return null}var ig=e=>e&&Number(ea(e).zIndex)||0,ag=class{constructor(e={}){rh(this,`handles`,new Map),rh(this,`state`,{activeHandleIds:new Set,isPointerDown:!1}),rh(this,`listenerAttached`,!1),rh(this,`options`),rh(this,`handlePointerMove`,e=>{if(this.state.isPointerDown)return;let t=this.getPointerType(e),n=this.findHitHandles(e.clientX,e.clientY,t),r=new Set(n.map(e=>e.id));(r.size!==this.state.activeHandleIds.size||[...r].some(e=>!this.state.activeHandleIds.has(e)))&&(this.state.activeHandleIds=r,this.updateCursor(n))}),rh(this,`handlePointerDown`,e=>{let t=this.getPointerType(e),n=this.findIntersectingHandles(e.clientX,e.clientY,t,e.target);if(n.length>0){this.state.isPointerDown=!0,this.state.activeHandleIds=new Set(n.map(e=>e.id));let t={x:e.clientX,y:e.clientY};n.forEach(e=>{e.onActivate(t)}),this.updateCursor(n)}}),rh(this,`handlePointerUp`,e=>{this.state.isPointerDown&&(this.state.isPointerDown=!1,this.handles.forEach(e=>{this.state.activeHandleIds.has(e.id)&&e.onDeactivate()}),this.state.activeHandleIds.clear(),this.clearGlobalCursor())}),rh(this,`globalCursorId`,`splitter-registry-cursor`),this.options={nonce:e.nonce??``,hitAreaMargins:{coarse:e.hitAreaMargins?.coarse??15,fine:e.hitAreaMargins?.fine??5}}}register(e){return this.handles.set(e.id,e),this.attachGlobalListeners(),()=>{this.handles.delete(e.id),this.state.activeHandleIds.delete(e.id),this.handles.size===0&&this.detachGlobalListeners()}}attachGlobalListeners(){this.listenerAttached||=(this.doc.addEventListener(`pointermove`,this.handlePointerMove,!0),this.doc.addEventListener(`pointerdown`,this.handlePointerDown,!0),this.doc.addEventListener(`pointerup`,this.handlePointerUp,!0),!0)}detachGlobalListeners(){this.listenerAttached&&=(this.doc.removeEventListener(`pointermove`,this.handlePointerMove,!0),this.doc.removeEventListener(`pointerdown`,this.handlePointerDown,!0),this.doc.removeEventListener(`pointerup`,this.handlePointerUp,!0),!1)}getPointerType(e){return e.pointerType===`touch`||e.pointerType===`pen`?`coarse`:`fine`}get doc(){let e=this.handles.values().next().value;return qi(e?.element)}findHitHandles(e,t,n){let r=[],i=this.options.hitAreaMargins[n];return this.handles.forEach(n=>{let a=n.element.getBoundingClientRect();e>=a.left-i&&e<=a.right+i&&t>=a.top-i&&t<=a.bottom+i&&r.push(n)}),r}findIntersectingHandles(e,t,n,r){let i=this.findHitHandles(e,t,n),a=Ai(r)?r:null;return!a||!Ki(this.doc,a)?i:i.filter(e=>{let t=e.element;if(a===t||Ki(t,a)||Ki(a,t))return!0;try{if($h(a,t)>0){let e=t.getBoundingClientRect(),n=a;for(;n&&!n.contains(t);){if(Zh(Qh(n.getBoundingClientRect()),Qh(e),!0))return!1;n=Wi(n)}}}catch{}return!0})}updateCursor(e){if(e.length===0){this.clearGlobalCursor();return}let t=e.some(e=>e.orientation===`horizontal`),n=e.some(e=>e.orientation===`vertical`),r=`default`;t&&n?r=`move`:t?r=`ew-resize`:n&&(r=`ns-resize`),this.setGlobalCursor(r)}setGlobalCursor(e){let t=this.doc,n=t.getElementById(this.globalCursorId),r=`* { cursor: ${e} !important; }`;n?n.textContent=r:(n=t.createElement(`style`),n.id=this.globalCursorId,n.textContent=r,this.options.nonce&&(n.nonce=this.options.nonce),t.head.appendChild(n))}clearGlobalCursor(){this.doc.getElementById(this.globalCursorId)?.remove()}},og=(e={})=>new ag(e),sg=B(`switch`).parts(`root`,`label`,`control`,`thumb`),cg=sg.build(),lg=e=>e.ids?.root??`switch:${e.id}`,ug=e=>e.ids?.label??`switch:${e.id}:label`,dg=e=>e.ids?.thumb??`switch:${e.id}:thumb`,fg=e=>e.ids?.control??`switch:${e.id}:control`,pg=e=>e.ids?.hiddenInput??`switch:${e.id}:input`,mg=e=>e.getById(lg(e)),hg=e=>e.getById(pg(e));function gg(e,t){let{context:n,send:r,prop:i,scope:a}=e,o=!!i(`disabled`),s=!!i(`readOnly`),c=!!i(`required`),l=!!n.get(`checked`),u=!o&&n.get(`focused`),d=!o&&n.get(`focusVisible`),f={"data-active":R(!o&&n.get(`active`)),"data-focus":R(u),"data-focus-visible":R(d),"data-readonly":R(s),"data-hover":R(n.get(`hovered`)),"data-disabled":R(o),"data-state":l?`checked`:`unchecked`,"data-invalid":R(i(`invalid`)),"data-required":R(c)};return{checked:l,disabled:o,focused:u,setChecked(e){r({type:`CHECKED.SET`,checked:e,isTrusted:!1})},toggleChecked(){r({type:`CHECKED.TOGGLE`,checked:l,isTrusted:!1})},getRootProps(){return t.label({...cg.root.attrs,...f,dir:i(`dir`),id:lg(a),htmlFor:pg(a),onPointerMove(){o||r({type:`CONTEXT.SET`,context:{hovered:!0}})},onPointerLeave(){o||r({type:`CONTEXT.SET`,context:{hovered:!1}})},onClick(e){o||(Na(e)===hg(a)&&e.stopPropagation(),ka()&&hg(a)?.focus())}})},getLabelProps(){return t.element({...cg.label.attrs,...f,dir:i(`dir`),id:ug(a)})},getThumbProps(){return t.element({...cg.thumb.attrs,...f,dir:i(`dir`),id:dg(a),"aria-hidden":!0})},getControlProps(){return t.element({...cg.control.attrs,...f,dir:i(`dir`),id:fg(a),"aria-hidden":!0})},getHiddenInputProps(){return t.input({id:pg(a),type:`checkbox`,required:i(`required`),defaultChecked:l,disabled:o,"aria-labelledby":ug(a),"aria-invalid":i(`invalid`),name:i(`name`),form:i(`form`),value:i(`value`),style:ls,onFocus(){let e=Mu();r({type:`CONTEXT.SET`,context:{focused:!0,focusVisible:e}})},onBlur(){r({type:`CONTEXT.SET`,context:{focused:!1,focusVisible:!1}})},onClick(e){if(s){e.preventDefault();return}let t=e.currentTarget.checked;r({type:`CHECKED.SET`,checked:t,isTrusted:!0})}})}}}var{not:_g}=ui(),vg=di({props({props:e}){return{defaultChecked:!1,label:`switch`,value:`on`,...e}},initialState(){return`ready`},context({prop:e,bindable:t}){return{checked:t(()=>({defaultValue:e(`defaultChecked`),value:e(`checked`),onChange(t){e(`onCheckedChange`)?.({checked:t})}})),fieldsetDisabled:t(()=>({defaultValue:!1})),focusVisible:t(()=>({defaultValue:!1})),active:t(()=>({defaultValue:!1})),focused:t(()=>({defaultValue:!1})),hovered:t(()=>({defaultValue:!1}))}},computed:{isDisabled:({context:e,prop:t})=>t(`disabled`)||e.get(`fieldsetDisabled`)},watch({track:e,prop:t,context:n,action:r}){e([()=>t(`disabled`)],()=>{r([`removeFocusIfNeeded`])}),e([()=>n.get(`checked`)],()=>{r([`syncInputElement`])})},effects:[`trackFormControlState`,`trackPressEvent`,`trackFocusVisible`],on:{"CHECKED.TOGGLE":[{guard:_g(`isTrusted`),actions:[`toggleChecked`,`dispatchChangeEvent`]},{actions:[`toggleChecked`]}],"CHECKED.SET":[{guard:_g(`isTrusted`),actions:[`setChecked`,`dispatchChangeEvent`]},{actions:[`setChecked`]}],"CONTEXT.SET":{actions:[`setContext`]}},states:{ready:{}},implementations:{guards:{isTrusted:({event:e})=>!!e.isTrusted},effects:{trackPressEvent({computed:e,scope:t,context:n}){if(!e(`isDisabled`))return Ho({pointerNode:mg(t),keyboardNode:hg(t),isValidKey:e=>e.key===` `,onPress:()=>n.set(`active`,!1),onPressStart:()=>n.set(`active`,!0),onPressEnd:()=>n.set(`active`,!1)})},trackFocusVisible({computed:e,scope:t}){if(!e(`isDisabled`))return Nu({root:t.getRootNode()})},trackFormControlState({context:e,send:t,scope:n}){return $a(hg(n),{onFieldsetDisabledChange(t){e.set(`fieldsetDisabled`,t)},onFormReset(){t({type:`CHECKED.SET`,checked:!!e.initial(`checked`),src:`form-reset`})}})}},actions:{setContext({context:e,event:t}){for(let n in t.context)e.set(n,t.context[n])},syncInputElement({context:e,scope:t}){let n=hg(t);n&&Ja(n,!!e.get(`checked`))},removeFocusIfNeeded({context:e,prop:t}){t(`disabled`)&&e.set(`focused`,!1)},setChecked({context:e,event:t}){e.set(`checked`,t.checked)},toggleChecked({context:e}){e.set(`checked`,!e.get(`checked`))},dispatchChangeEvent({context:e,scope:t}){queueMicrotask(()=>{Ya(hg(t),{checked:e.get(`checked`)})})}}}}),yg=B(`tagsInput`).parts(`root`,`label`,`control`,`input`,`clearTrigger`,`item`,`itemPreview`,`itemInput`,`itemText`,`itemDeleteTrigger`);yg.build();var bg=e=>{if(!e)return;let t=ea(e),n=Yi(e),r=qi(e),i=()=>{requestAnimationFrame(()=>{e.style.height=`auto`;let n;n=t.boxSizing===`content-box`?e.scrollHeight-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):e.scrollHeight+parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),t.maxHeight!==`none`&&n>parseFloat(t.maxHeight)?(t.overflowY===`hidden`&&(e.style.overflowY=`scroll`),n=parseFloat(t.maxHeight)):t.overflowY!==`hidden`&&(e.style.overflowY=`hidden`),e.style.height=`${n}px`})};e.addEventListener(`input`,i),e.form?.addEventListener(`reset`,i);let a=Object.getOwnPropertyDescriptor(e,`value`),o=a?.set?a:Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),`value`);o?.set&&Object.defineProperty(e,"value",{...o,set(e){o.set?.call(this,e),i()}});let s=new n.ResizeObserver(()=>{requestAnimationFrame(()=>i())});s.observe(e);let c=new n.MutationObserver(()=>i());return c.observe(e,{attributes:!0,attributeFilter:[`rows`,`placeholder`]}),r.fonts?.addEventListener(`loadingdone`,i),()=>{e.removeEventListener(`input`,i),e.form?.removeEventListener(`reset`,i),r.fonts?.removeEventListener(`loadingdone`,i),s.disconnect(),c.disconnect()}},xg=B(`tooltip`).parts(`trigger`,`arrow`,`arrowTip`,`positioner`,`content`);xg.build();var Sg=B(`tree-view`).parts(`branch`,`branchContent`,`branchControl`,`branchIndentGuide`,`branchIndicator`,`branchText`,`branchTrigger`,`item`,`itemIndicator`,`itemText`,`label`,`nodeCheckbox`,`nodeRenameInput`,`root`,`tree`);Sg.build();var Cg=typeof window<`u`?P.useLayoutEffect:P.useEffect,[wg,Tg]=Mr({name:`CheckboxContext`,hookName:`useCheckboxContext`,providerName:`<CheckboxProvider />`}),Eg=e=>e.children(Tg()),Dg=(0,P.forwardRef)((e,t)=>{let n=L(Tg().getControlProps(),e);return(0,F.jsx)(z.div,{...n,ref:t})});Dg.displayName=`CheckboxControl`;var[eee,Og]=Mr({name:`FieldsetContext`,hookName:`useFieldsetContext`,providerName:`<FieldsetProvider />`,strict:!1});function kg(e){let{value:t,onChange:n,defaultValue:r}=e,[i,a]=(0,P.useState)(r),o=t!==void 0;return[o?t:i,(0,P.useCallback)(e=>(o||a(e),n?.(e)),[o,n])]}function Ag(e={}){let t=Og(),{defaultValue:n,value:r,onValueChange:i,disabled:a=t?.disabled,readOnly:o,name:s,invalid:c=t?.invalid,maxSelectedValues:l}=e,u=!(a||o),d=Ds(i,{sync:!0}),[f,p]=kg({value:r,defaultValue:n||[],onChange:d}),m=e=>f.some(t=>String(t)===String(e)),h=e=>{m(e)?v(e):_(e)},g=l!=null&&f.length>=l,_=e=>{u&&(m(e)||g||p(f.concat(e)))},v=e=>{u&&p(f.filter(t=>String(t)!==String(e)))};return{isChecked:m,value:f,name:s,disabled:!!a,readOnly:!!o,invalid:!!c,setValue:p,addValue:_,toggleValue:h,getItemProps:e=>{let t=e.value==null?void 0:m(e.value);return{checked:t,onCheckedChange(){e.value!=null&&h(e.value)},name:s,disabled:a||g&&!t,readOnly:o,invalid:c}}}}var[jg,Mg]=Mr({name:`CheckboxGroupContext`,hookName:`useCheckboxGroupContext`,providerName:`<CheckboxGroupProvider />`,strict:!1}),Ng=Cs(),Pg=(0,P.forwardRef)((e,t)=>{let[n,r]=Ng(e,[`defaultValue`,`value`,`onValueChange`,`disabled`,`invalid`,`readOnly`,`name`,`maxSelectedValues`]),i=Ag(n);return(0,F.jsx)(jg,{value:i,children:(0,F.jsx)(z.div,{ref:t,role:`group`,...r,...Gu.build().group.attrs})})});Pg.displayName=`CheckboxGroup`;var Fg=Cs(),Ig=(0,P.forwardRef)((e,t)=>{let[n,r]=Fg(e,[`value`]);return(0,F.jsx)(jg,{value:n.value,children:(0,F.jsx)(z.div,{ref:t,role:`group`,...r,...Gu.build().group.attrs})})});Ig.displayName=`CheckboxGroupProvider`;var[Lg,Rg]=Mr({name:`FieldContext`,hookName:`useFieldContext`,providerName:`<FieldProvider />`,strict:!1}),zg=e=>e.children(Rg()),Bg=(0,P.forwardRef)((e,t)=>{let n=Rg(),r=L(n.getErrorTextProps(),e);return n?.invalid?(0,F.jsx)(z.span,{...r,ref:t}):null});Bg.displayName=`FieldErrorText`;var Vg=(0,P.forwardRef)((e,t)=>{let n=L(Rg()?.getHelperTextProps(),e);return(0,F.jsx)(z.span,{...n,ref:t})});Vg.displayName=`FieldHelperText`;var Hg=(0,P.forwardRef)((e,t)=>{let n=L(Rg()?.getInputProps(),e);return(0,F.jsx)(z.input,{...n,ref:t})});Hg.displayName=`FieldInput`;var Ug=e=>{let{value:t,children:n}=e,r=Rg(),i=(0,P.useMemo)(()=>{if(!r)throw Error(`Field.Item must be used within Field.Root`);let e=`field::${r.ids.control}::item::${t}`,n=`${e}::label`,i=()=>({...r.getInputProps(),id:e});return{...r,ids:{...r.ids,control:e,label:n},getLabelProps:()=>({...r.getLabelProps(),id:n,htmlFor:e}),getInputProps:()=>({...i(),...cm.input.attrs}),getSelectProps:()=>({...i(),...cm.select.attrs}),getTextareaProps:()=>({...i(),...cm.textarea.attrs})}},[r,t]);return(0,F.jsx)(Lg,{value:i,children:n})};Ug.displayName=`FieldItem`;var Wg=(0,P.forwardRef)((e,t)=>{let n=L(Rg()?.getLabelProps(),e);return(0,F.jsx)(z.label,{...n,ref:t})});Wg.displayName=`FieldLabel`;var Gg=(0,P.forwardRef)(({fallback:e,...t},n)=>{let r=Rg();if(!r.required)return e;let i=L(r.getRequiredIndicatorProps(),t);return(0,F.jsx)(z.span,{...i,ref:n,children:t.children??`*`})});Gg.displayName=`FieldRequiredIndicator`;var Kg=(e={})=>{let t=Og(),n=Pr(),{ids:r,target:i,disabled:a=!!t?.disabled,invalid:o=!1,readOnly:s=!1,required:c=!1}=e,[l,u]=(0,P.useState)(!1),[d,f]=(0,P.useState)(!1),p=(0,P.useId)(),m=e.id??p,h=(0,P.useRef)(null),g=r?.control??`field::${m}`,_=r?.errorText??`field::${m}::error-text`,v=r?.helperText??`field::${m}::helper-text`,y=r?.label??`field::${m}::label`;Cg(()=>{let e=h.current;if(!e)return;let t=()=>{let e=n.getRootNode();u(!!e.getElementById(_)),f(!!e.getElementById(v))};t();let r=new(n.getWindow()).MutationObserver(t);return r.observe(e,{childList:!0,subtree:!0}),()=>r.disconnect()},[n,_,v]);let b=(0,P.useMemo)(()=>()=>({...cm.root.attrs,id:g,ref:h,role:`group`,"data-disabled":R(a),"data-invalid":R(o),"data-readonly":R(s)}),[a,o,s,g]),x=i?`field::${m}::item::${i}`:void 0,S=(0,P.useMemo)(()=>()=>({...cm.label.attrs,id:y,"data-disabled":R(a),"data-invalid":R(o),"data-readonly":R(s),"data-required":R(c),htmlFor:x??m}),[a,o,s,c,m,y,x]),C=l&&o?_:void 0,w=(0,P.useMemo)(()=>()=>({"aria-describedby":d?v:void 0,"aria-errormessage":C,"aria-invalid":Si(o),"data-invalid":R(o),"data-required":R(c),"data-readonly":R(s),id:m,required:c,disabled:a,readOnly:s}),[d,v,o,c,s,m,C,a]),T=(0,P.useMemo)(()=>()=>({...w(),...cm.input.attrs}),[w]),E=(0,P.useMemo)(()=>()=>({...w(),...cm.textarea.attrs}),[w]),D=(0,P.useMemo)(()=>()=>({...w(),...cm.select.attrs}),[w]),ee=(0,P.useMemo)(()=>()=>({id:v,...cm.helperText.attrs,"data-disabled":R(a)}),[a,v]),O=(0,P.useMemo)(()=>()=>({id:_,...cm.errorText.attrs,"aria-live":`polite`}),[_]),k=(0,P.useMemo)(()=>()=>({"aria-hidden":!0,...cm.requiredIndicator.attrs}),[]);return{ariaDescribedby:d?v:void 0,ids:{root:g,control:m,label:y,errorText:_,helperText:v},refs:{rootRef:h},disabled:a,invalid:o,readOnly:s,required:c,getLabelProps:S,getRootProps:b,getInputProps:T,getTextareaProps:E,getSelectProps:D,getHelperTextProps:ee,getErrorTextProps:O,getRequiredIndicatorProps:k}},qg=Cs(),Jg=(0,P.forwardRef)((e,t)=>{let[n,r]=qg(e,[`id`,`ids`,`disabled`,`invalid`,`readOnly`,`required`,`target`]),i=Kg(n),a=L(i.getRootProps(),r),o=Ir(t,i.refs.rootRef);return(0,F.jsx)(Lg,{value:i,children:(0,F.jsx)(z.div,{...a,ref:o})})});Jg.displayName=`FieldRoot`;var Yg=Cs(),Xg=(0,P.forwardRef)((e,t)=>{let[{value:n},r]=Yg(e,[`value`]),i=L(n.getRootProps(),r);return(0,F.jsx)(Lg,{value:n,children:(0,F.jsx)(z.div,{...i,ref:t})})});Xg.displayName=`FieldRootProvider`;var Zg=(0,P.forwardRef)((e,t)=>{let n=L(Rg()?.getSelectProps(),e);return(0,F.jsx)(z.select,{...n,ref:t})});Zg.displayName=`FieldSelect`;var Qg=(0,P.forwardRef)((e,t)=>{let{autoresize:n,...r}=e,i=(0,P.useRef)(null),a=L(Rg()?.getTextareaProps(),{style:{resize:n?`none`:void 0}},r),o=Ir(t,i);return(0,P.useEffect)(()=>{if(n)return bg(i.current)},[n]),(0,F.jsx)(z.textarea,{...a,ref:o})});Qg.displayName=`FieldTextarea`;var $g=Ss({Context:()=>zg,ErrorText:()=>Bg,HelperText:()=>Vg,Input:()=>Hg,Item:()=>Ug,Label:()=>Wg,RequiredIndicator:()=>Gg,Root:()=>Jg,RootProvider:()=>Xg,Select:()=>Zg,Textarea:()=>Qg}),e_=(0,P.forwardRef)((e,t)=>{let n=L(Tg().getHiddenInputProps(),e),r=Rg();return(0,F.jsx)(z.input,{"aria-describedby":r?.ariaDescribedby,...n,ref:t})});e_.displayName=`CheckboxHiddenInput`;var t_=(0,P.forwardRef)((e,t)=>{let{indeterminate:n,...r}=e,i=Tg(),a=L(i.getIndicatorProps(),r),o=n?i.indeterminate:i.checked;return(0,F.jsx)(z.div,{...a,hidden:!o,ref:t})});t_.displayName=`CheckboxIndicator`;var n_=(0,P.forwardRef)((e,t)=>{let n=L(Tg().getLabelProps(),e);return(0,F.jsx)(z.span,{...n,ref:t})});n_.displayName=`CheckboxLabel`;var tee=(e={})=>{let t=Mg(),n=Rg(),r=(0,P.useMemo)(()=>L(t?.getItemProps({value:e.value})??{},e),[e,t]),i=(0,P.useId)(),{getRootNode:a}=Pr(),{dir:o}=bs();return Bu(Fs(Hu,{id:i,ids:{label:n?.ids.label,hiddenInput:n?.ids.control},dir:o,disabled:n?.disabled,readOnly:n?.readOnly,invalid:n?.invalid,required:n?.required,getRootNode:a,...r}),Bs)},nee=Cs(),r_=(0,P.forwardRef)((e,t)=>{let[n,r]=nee(e,[`checked`,`defaultChecked`,`disabled`,`form`,`id`,`ids`,`invalid`,`name`,`onCheckedChange`,`readOnly`,`required`,`value`]),i=tee(n),a=L(i.getRootProps(),r);return(0,F.jsx)(wg,{value:i,children:(0,F.jsx)(z.label,{...a,ref:t})})});r_.displayName=`CheckboxRoot`;var ree=Cs(),i_=(0,P.forwardRef)((e,t)=>{let[{value:n},r]=ree(e,[`value`]),i=L(n.getRootProps(),r);return(0,F.jsx)(wg,{value:n,children:(0,F.jsx)(z.label,{...i,ref:t})})});i_.displayName=`CheckboxRootProvider`;var a_=Ss({Context:()=>Eg,Control:()=>Dg,Group:()=>Pg,GroupProvider:()=>Ig,HiddenInput:()=>e_,Indicator:()=>t_,Label:()=>n_,Root:()=>r_,RootProvider:()=>i_}),o_=e=>new Op(e),[s_,c_]=Mr({name:`DialogContext`,hookName:`useDialogContext`,providerName:`<DialogProvider />`}),l_=(0,P.forwardRef)((e,t)=>{let n=c_(),r=Ws({...xc(),present:n.open}),i=L(n.getBackdropProps(),r.getPresenceProps(),e),a=Ir(r.ref,t);return(0,F.jsx)(Gs,{presence:r,children:(0,F.jsx)(z.div,{...i,ref:a})})});l_.displayName=`DialogBackdrop`;var u_=(0,P.forwardRef)((e,t)=>{let n=L(c_().getCloseTriggerProps(),e);return(0,F.jsx)(z.button,{...n,ref:t})});u_.displayName=`DialogCloseTrigger`;var d_=(0,P.forwardRef)((e,t)=>{let n=c_(),r=qs(),i=L(n.getContentProps(),r.getPresenceProps(),e),a=Ir(r.ref,t);return(0,F.jsx)(Gs,{presence:r,children:(0,F.jsx)(z.div,{...i,ref:a})})});d_.displayName=`DialogContent`;var iee=e=>e.children(c_()),f_=(0,P.forwardRef)((e,t)=>{let n=L(c_().getDescriptionProps(),e);return(0,F.jsx)(z.div,{...n,ref:t})});f_.displayName=`DialogDescription`;var p_=(0,P.forwardRef)((e,t)=>{let n=L(c_().getPositionerProps(),e);return qs().unmounted?null:(0,F.jsx)(z.div,{...n,ref:t})});p_.displayName=`DialogPositioner`;var aee=e=>{let t=(0,P.useId)(),{getRootNode:n}=Pr(),{dir:r}=bs();return im(Fs(am,{id:t,getRootNode:n,dir:r,...e}),Bs)},oee=e=>{let[t,{children:n,...r}]=ws(e),[i]=Sc(t),a=aee(r),o=Ws(L({present:a.open},t));return(0,F.jsx)(s_,{value:a,children:(0,F.jsx)(bc,{value:i,children:(0,F.jsx)(Ks,{value:o,children:n})})})},see=e=>{let[t,{value:n,children:r}]=ws(e),[i]=Sc(t),a=Ws(L({present:n.open},t));return(0,F.jsx)(s_,{value:n,children:(0,F.jsx)(bc,{value:i,children:(0,F.jsx)(Ks,{value:a,children:r})})})},m_=(0,P.forwardRef)((e,t)=>{let n=L(c_().getTitleProps(),e);return(0,F.jsx)(z.h2,{...n,ref:t})});m_.displayName=`DialogTitle`;var h_=Cs(),g_=(0,P.forwardRef)((e,t)=>{let[n,r]=h_(e,[`value`]),i=c_(),a=qs(),o=i.getTriggerProps(n),s=L({...o,"aria-controls":a.unmounted?void 0:o[`aria-controls`]},r);return(0,F.jsx)(z.button,{...s,ref:t})});g_.displayName=`DialogTrigger`;var __=Ss({Backdrop:()=>l_,CloseTrigger:()=>u_,Content:()=>d_,Context:()=>iee,Description:()=>f_,Positioner:()=>p_,Root:()=>oee,RootProvider:()=>see,Title:()=>m_,Trigger:()=>g_}),v_=e=>{let{children:t,disabled:n}=e,[r,i]=(0,P.useState)(e.container?.current),a=(0,P.useSyncExternalStore)(b_,()=>!1,()=>!0),{getRootNode:o}=Pr();if((0,P.useEffect)(()=>{i(()=>e.container?.current)},[e.container]),a||n)return(0,F.jsx)(F.Fragment,{children:t});let s=r??y_(o);return(0,F.jsx)(F.Fragment,{children:P.Children.map(t,e=>(0,tt.createPortal)(e,s))})},y_=e=>{let t=e?.(),n=t.getRootNode();return Li(n)?n:qi(t).body},b_=()=>()=>{},[x_,S_]=Mr({name:`SelectContext`,hookName:`useSelectContext`,providerName:`<SelectProvider />`}),C_=(0,P.forwardRef)((e,t)=>{let n=L(S_().getClearTriggerProps(),e);return(0,F.jsx)(z.button,{...n,ref:t})});C_.displayName=`SelectClearTrigger`;var w_=(0,P.forwardRef)((e,t)=>{let n=S_(),r=qs(),i=L(n.getContentProps(),r.getPresenceProps(),e),a=Ir(r.ref,t);return(0,F.jsx)(Gs,{presence:r,children:(0,F.jsx)(z.div,{...i,ref:a})})});w_.displayName=`SelectContent`;var T_=e=>e.children(S_()),E_=(0,P.forwardRef)((e,t)=>{let n=L(S_().getControlProps(),e);return(0,F.jsx)(z.div,{...n,ref:t})});E_.displayName=`SelectControl`;var D_=(0,P.forwardRef)((e,t)=>{let n=S_(),r=L(n.getHiddenSelectProps(),e),i=n.value.length===0,a=Rg();return(0,F.jsxs)(z.select,{"aria-describedby":a?.ariaDescribedby,...r,ref:t,children:[i&&(0,F.jsx)(`option`,{value:``}),n.collection.items.map((e,t)=>(0,F.jsx)(`option`,{value:n.collection.getItemValue(e)??``,disabled:n.collection.getItemDisabled(e),children:n.collection.stringifyItem(e)},t))]})});D_.displayName=`SelectHiddenSelect`;var O_=(0,P.forwardRef)((e,t)=>{let n=L(S_().getIndicatorProps(),e);return(0,F.jsx)(z.div,{...n,ref:t})});O_.displayName=`SelectIndicator`;var[k_,A_]=Mr({name:`SelectItemContext`,hookName:`useSelectItemContext`,providerName:`<SelectItemProvider />`}),[j_,M_]=Mr({name:`SelectItemPropsContext`,hookName:`useSelectItemPropsContext`,providerName:`<SelectItemPropsProvider />`}),N_=Cs(),P_=(0,P.forwardRef)((e,t)=>{let[n,r]=N_(e,[`item`,`persistFocus`]),i=S_(),a=L(i.getItemProps(n),r),o=i.getItemState(n);return(0,F.jsx)(j_,{value:n,children:(0,F.jsx)(k_,{value:o,children:(0,F.jsx)(z.div,{...a,ref:t})})})});P_.displayName=`SelectItem`;var F_=e=>e.children(A_()),[I_,L_]=Mr({name:`SelectItemGroupPropsContext`,hookName:`useSelectItemGroupPropsContext`,providerName:`<SelectItemGroupPropsProvider />`}),R_=Cs(),z_=(0,P.forwardRef)((e,t)=>{let n=(0,P.useId)(),[r,i]=R_(e,[`id`]),a={id:n,...r},o=L(S_().getItemGroupProps(a),i);return(0,F.jsx)(I_,{value:a,children:(0,F.jsx)(z.div,{...o,ref:t})})});z_.displayName=`SelectItemGroup`;var B_=(0,P.forwardRef)((e,t)=>{let n=S_(),r=L_(),i=L(n.getItemGroupLabelProps({htmlFor:r.id}),e);return(0,F.jsx)(z.div,{...i,ref:t})});B_.displayName=`SelectItemGroupLabel`;var V_=(0,P.forwardRef)((e,t)=>{let n=S_(),r=M_(),i=L(n.getItemIndicatorProps(r),e);return(0,F.jsx)(z.div,{...i,ref:t})});V_.displayName=`SelectItemIndicator`;var H_=(0,P.forwardRef)((e,t)=>{let n=S_(),r=M_(),i=L(n.getItemTextProps(r),e);return(0,F.jsx)(z.span,{...i,ref:t})});H_.displayName=`SelectItemText`;var U_=(0,P.forwardRef)((e,t)=>{let n=L(S_().getLabelProps(),e);return(0,F.jsx)(z.label,{...n,ref:t})});U_.displayName=`SelectLabel`;var W_=(0,P.forwardRef)((e,t)=>{let n=L(S_().getListProps(),e);return(0,F.jsx)(z.div,{...n,ref:t})});W_.displayName=`SelectList`;var G_=(0,P.forwardRef)((e,t)=>{let n=L(S_().getPositionerProps(),e);return qs().unmounted?null:(0,F.jsx)(z.div,{...n,ref:t})});G_.displayName=`SelectPositioner`;var cee=e=>{let t=(0,P.useId)(),{dir:n}=bs(),{getRootNode:r}=Pr(),i=Rg();return qm(Fs(Qm,{id:t,ids:{label:i?.ids.label,hiddenSelect:i?.ids.control},disabled:i?.disabled,readOnly:i?.readOnly,invalid:i?.invalid,required:i?.required,dir:n,getRootNode:r,...e}),Bs)},lee=(0,P.forwardRef)((e,t)=>{let[n,r]=ws(e),[i,a]=Cs()(r,`closeOnSelect.collection.composite.defaultHighlightedValue.defaultOpen.defaultValue.deselectable.disabled.form.highlightedValue.id.ids.invalid.loopFocus.multiple.name.onFocusOutside.onHighlightChange.onInteractOutside.onOpenChange.onPointerDownOutside.onSelect.onValueChange.open.positioning.readOnly.required.scrollToIndexFn.translations.autoComplete.value`.split(`.`)),o=cee(i),s=Ws(L({present:o.open},n)),c=L(o.getRootProps(),a);return(0,F.jsx)(x_,{value:o,children:(0,F.jsx)(Ks,{value:s,children:(0,F.jsx)(z.div,{...c,ref:t})})})}),uee=(0,P.forwardRef)((e,t)=>{let[n,r]=ws(e),[{value:i},a]=Cs()(r,[`value`]),o=Ws(L({present:i.open},n)),s=L(i.getRootProps(),a);return(0,F.jsx)(x_,{value:i,children:(0,F.jsx)(Ks,{value:o,children:(0,F.jsx)(z.div,{...s,ref:t})})})}),K_=(0,P.forwardRef)((e,t)=>{let n=L(S_().getTriggerProps(),e);return(0,F.jsx)(z.button,{...n,ref:t})});K_.displayName=`SelectTrigger`;var q_=(0,P.forwardRef)((e,t)=>{let{children:n,placeholder:r,...i}=e,a=S_(),o=L(a.getValueTextProps(),i);return(0,F.jsx)(z.span,{...o,ref:t,children:n||a.valueAsString||r})});q_.displayName=`SelectValueText`;var J_=Ss({ClearTrigger:()=>C_,Content:()=>w_,Context:()=>T_,Control:()=>E_,HiddenSelect:()=>D_,Indicator:()=>O_,Item:()=>P_,ItemContext:()=>F_,ItemGroup:()=>z_,ItemGroupLabel:()=>B_,ItemIndicator:()=>V_,ItemText:()=>H_,Label:()=>U_,List:()=>W_,Positioner:()=>G_,Root:()=>lee,RootProvider:()=>uee,Trigger:()=>K_,ValueText:()=>q_}),dee=e=>og(e),[Y_,X_]=Mr({name:`SplitterContext`,hookName:`useSplitterContext`,providerName:`<SplitterProvider />`}),Z_=e=>e.children(X_()),Q_=Cs(),$_=(0,P.forwardRef)((e,t)=>{let[n,r]=Q_(e,[`id`]),i=L(X_().getPanelProps(n),r);return(0,F.jsx)(z.div,{...i,ref:t})});$_.displayName=`SplitterPanel`;var[ev,tv]=Mr({name:`SplitterResizeTriggerPropsContext`,hookName:`useSplitterResizeTriggerPropsContext`,providerName:`<SplitterResizeTriggerPropsProvider />`}),nv=Cs(),rv=(0,P.forwardRef)((e,t)=>{let[n,r]=nv(e,[`disabled`,`id`]),i=L(X_().getResizeTriggerProps(n),r);return(0,F.jsx)(ev,{value:n,children:(0,F.jsx)(z.button,{ref:t,...i})})});rv.displayName=`SplitterResizeTrigger`;var iv=(0,P.forwardRef)((e,t)=>{let n=X_(),r=tv(),i=L(n.getResizeTriggerIndicator(r),e);return(0,F.jsx)(z.div,{ref:t,...i})});iv.displayName=`SplitterResizeTriggerIndicator`;var av=e=>{let t=(0,P.useId)(),{getRootNode:n}=Pr(),{dir:r}=bs();return Wh(Fs(Yh,{id:t,dir:r,getRootNode:n,...e}),Bs)},ov=Cs(),sv=(0,P.forwardRef)((e,t)=>{let[n,r]=ov(e,[`defaultSize`,`id`,`ids`,`keyboardResizeBy`,`nonce`,`onCollapse`,`onExpand`,`onResize`,`onResizeEnd`,`onResizeStart`,`orientation`,`panels`,`registry`,`size`]),i=av(n),a=L(i.getRootProps(),r);return(0,F.jsx)(Y_,{value:i,children:(0,F.jsx)(z.div,{...a,ref:t})})});sv.displayName=`SplitterRoot`;var cv=Cs(),lv=(0,P.forwardRef)((e,t)=>{let[{value:n},r]=cv(e,[`value`]),i=L(n.getRootProps(),r);return(0,F.jsx)(Y_,{value:n,children:(0,F.jsx)(z.div,{...i,ref:t})})});lv.displayName=`SplitterRootProvider`;var uv=Ss({Context:()=>Z_,Panel:()=>$_,ResizeTrigger:()=>rv,ResizeTriggerIndicator:()=>iv,Root:()=>sv,RootProvider:()=>lv,createRegistry:()=>dee,getLayout:()=>Bh}),[dv,fv]=Mr({name:`SwitchContext`,hookName:`useSwitchContext`,providerName:`<SwitchProvider />`}),pv=e=>e.children(fv()),mv=(0,P.forwardRef)((e,t)=>{let n=L(fv().getControlProps(),e);return(0,F.jsx)(z.span,{...n,ref:t})});mv.displayName=`SwitchControl`;var hv=(0,P.forwardRef)((e,t)=>{let n=L(fv().getHiddenInputProps(),e),r=Rg();return(0,F.jsx)(z.input,{"aria-describedby":r?.ariaDescribedby,...n,ref:t})});hv.displayName=`SwitchHiddenInput`;var gv=(0,P.forwardRef)((e,t)=>{let n=L(fv().getLabelProps(),e);return(0,F.jsx)(z.span,{...n,ref:t})});gv.displayName=`SwitchLabel`;var _v=e=>{let t=(0,P.useId)(),{getRootNode:n}=Pr(),{dir:r}=bs(),i=Rg();return gg(Fs(vg,{id:t,ids:{label:i?.ids.label,hiddenInput:i?.ids.control},dir:r,disabled:i?.disabled,readOnly:i?.readOnly,invalid:i?.invalid,required:i?.required,getRootNode:n,...e}),Bs)},vv=Cs(),yv=(0,P.forwardRef)((e,t)=>{let[n,r]=vv(e,[`checked`,`defaultChecked`,`disabled`,`form`,`id`,`ids`,`invalid`,`label`,`name`,`onCheckedChange`,`readOnly`,`required`,`value`]),i=_v(n),a=L(i.getRootProps(),r);return(0,F.jsx)(dv,{value:i,children:(0,F.jsx)(z.label,{...a,ref:t})})});yv.displayName=`SwitchRoot`;var bv=Cs(),xv=(0,P.forwardRef)((e,t)=>{let[{value:n},r]=bv(e,[`value`]),i=L(n.getRootProps(),r);return(0,F.jsx)(dv,{value:n,children:(0,F.jsx)(z.label,{...i,ref:t})})});xv.displayName=`SwitchRootProvider`;var Sv=(0,P.forwardRef)((e,t)=>{let n=L(fv().getThumbProps(),e);return(0,F.jsx)(z.span,{...n,ref:t})});Sv.displayName=`SwitchThumb`;var Cv=Ss({Context:()=>pv,Control:()=>mv,HiddenInput:()=>hv,Label:()=>gv,Root:()=>yv,RootProvider:()=>xv,Thumb:()=>Sv});function wv(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}var Tv=(e,t)=>{if(!e||typeof e!=`string`)return{invalid:!0,value:e};let[n,r]=e.split(`/`);if(!n||!r||n===`currentBg`)return{invalid:!0,value:n};let i=t(`colors.${n}`),a=t.raw(`opacity.${r}`)?.value;if(!a&&isNaN(Number(r)))return{invalid:!0,value:n};let o=a?Number(a)*100+`%`:`${r}%`,s=i??n;return{invalid:!1,color:s,value:`color-mix(in srgb, ${s} ${o}, transparent)`}},Ev=e=>(t,n)=>{let r=n.utils.colorMix(t);if(r.invalid)return{[e]:t};let i=`--mix-`+e;return{[i]:r.value,[e]:`var(${i}, ${r.color})`}};function Dv(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(e=>Dv(e));let t=Object.create(Object.getPrototypeOf(e));for(let n of Object.keys(e))t[n]=Dv(e[n]);return t}function Ov(e,t){if(t==null)return e;for(let n of Object.keys(t))if(t[n]!==void 0&&n!==`__proto__`){if(!Gt(e[n])&&Gt(t[n]))Object.assign(e,{[n]:t[n]});else if(e[n]&&Gt(t[n]))Ov(e[n],t[n]);else if(Array.isArray(t[n])&&Array.isArray(e[n])){let r=0;for(;r<t[n].length;r++)Gt(e[n][r])&&Gt(t[n][r])?Ov(e[n][r],t[n][r]):e[n][r]=t[n][r]}else Object.assign(e,{[n]:t[n]})}return e}function kv(e,...t){for(let n of t)Ov(e,n);return e}var Av=e=>e!=null;function jv(e,t,n={}){let{stop:r,getKey:i}=n;function a(e,n=[]){if(Gt(e)||Array.isArray(e)){let o={};for(let[s,c]of Object.entries(e)){let l=i?.(s,c)??s,u=[...n,l];if(r?.(e,u))return t(e,n);let d=a(c,u);Av(d)&&(o[l]=d)}return o}return t(e,n)}return a(e)}function Mv(e,t){return Array.isArray(e)?e.map(e=>Av(e)?t(e):e):Gt(e)?jv(e,e=>t(e)):Av(e)?t(e):e}var Nv=[`value`,`type`,`description`],Pv=e=>e&&typeof e==`object`&&!Array.isArray(e),Fv=(...e)=>{let t=kv({},...e.map(Dv));return t.theme?.tokens&&jv(t.theme.tokens,e=>{let t=Object.keys(e).filter(e=>!Nv.includes(e)).length>0,n=Nv.some(t=>e[t]!=null);return t&&n&&(e.DEFAULT||={},Nv.forEach(t=>{var n;e[t]!=null&&((n=e.DEFAULT)[t]||(n[t]=e[t]),delete e[t])})),e},{stop(e){return Pv(e)&&Nv.some(t=>e[t]!=null)}}),t},Iv=e=>e,Lv=e=>e,U=e=>e,Rv=e=>e,zv=e=>e,Bv=e=>e,Vv=e=>e,Hv=e=>e,Uv=e=>e;function Wv(){let e=e=>e;return new Proxy(e,{get(){return e}})}var Gv=Wv(),Kv=Wv(),qv=e=>e,Jv=/[^a-zA-Z0-9_\u0081-\uffff-]/g;function fee(e){return`${e}`.replace(Jv,e=>`\\${e}`)}var pee=/[A-Z]/g;function mee(e){return e.replace(pee,e=>`-${e.toLowerCase()}`)}function Yv(e,t={}){let{fallback:n=``,prefix:r=``}=t,i=mee([`-`,r,fee(e)].filter(Boolean).join(`-`));return{var:i,ref:`var(${i}${n?`, ${n}`:``})`}}var hee=e=>/^var\(--.+\)$/.test(e),Xv=(e,t)=>t==null?t:`${e}(${t})`,Zv=e=>{if(hee(e)||e==null)return e;let t=typeof e==`string`&&!e.endsWith(`deg`);return typeof e==`number`||t?`${e}deg`:e},Qv=e=>({values:[`outside`,`inside`,`mixed`,`none`],transform(t,{token:n}){let r=n(`colors.colorPalette.focusRing`);return{inside:{"--focus-ring-color":r,[e]:{outlineOffset:`0px`,outlineWidth:`var(--focus-ring-width, 1px)`,outlineColor:`var(--focus-ring-color)`,outlineStyle:`var(--focus-ring-style, solid)`,borderColor:`var(--focus-ring-color)`}},outside:{"--focus-ring-color":r,[e]:{outlineWidth:`var(--focus-ring-width, 2px)`,outlineOffset:`var(--focus-ring-offset, 2px)`,outlineStyle:`var(--focus-ring-style, solid)`,outlineColor:`var(--focus-ring-color)`}},mixed:{"--focus-ring-color":r,[e]:{outlineWidth:`var(--focus-ring-width, 3px)`,outlineStyle:`var(--focus-ring-style, solid)`,outlineColor:`color-mix(in srgb, var(--focus-ring-color), transparent 60%)`,borderColor:`var(--focus-ring-color)`}},none:{"--focus-ring-color":r,[e]:{outline:`none`}}}[t]??{}}}),gee=Ev(`borderColor`),$v=e=>({transition:e,transitionTimingFunction:`cubic-bezier(0.4, 0, 0.2, 1)`,transitionDuration:`150ms`}),_ee=Iv({hover:[`@media (hover: hover)`,`&:is(:hover, [data-hover]):not(:disabled, [data-disabled])`],active:`&:is(:active, [data-active]):not(:disabled, [data-disabled], [data-state=open])`,focus:`&:is(:focus, [data-focus])`,focusWithin:`&:is(:focus-within, [data-focus-within])`,focusVisible:`&:is(:focus-visible, [data-focus-visible])`,disabled:`&:is(:disabled, [disabled], [data-disabled], [aria-disabled=true])`,visited:`&:visited`,target:`&:target`,readOnly:`&:is([data-readonly], [aria-readonly=true], [readonly])`,readWrite:`&:read-write`,empty:`&:is(:empty, [data-empty])`,checked:`&:is(:checked, [data-checked], [aria-checked=true], [data-state=checked])`,enabled:`&:enabled`,expanded:`&:is([aria-expanded=true], [data-expanded], [data-state=expanded])`,highlighted:`&[data-highlighted]`,complete:`&[data-complete]`,incomplete:`&[data-incomplete]`,dragging:`&[data-dragging]`,before:`&::before`,after:`&::after`,firstLetter:`&::first-letter`,firstLine:`&::first-line`,marker:`&::marker`,selection:`&::selection`,file:`&::file-selector-button`,backdrop:`&::backdrop`,first:`&:first-of-type`,last:`&:last-of-type`,notFirst:`&:not(:first-of-type)`,notLast:`&:not(:last-of-type)`,only:`&:only-child`,even:`&:nth-of-type(even)`,odd:`&:nth-of-type(odd)`,peerFocus:`.peer:is(:focus, [data-focus]) ~ &`,peerHover:`.peer:is(:hover, [data-hover]):not(:disabled, [data-disabled]) ~ &`,peerActive:`.peer:is(:active, [data-active]):not(:disabled, [data-disabled]) ~ &`,peerFocusWithin:`.peer:focus-within ~ &`,peerFocusVisible:`.peer:is(:focus-visible, [data-focus-visible]) ~ &`,peerDisabled:`.peer:is(:disabled, [disabled], [data-disabled]) ~ &`,peerChecked:`.peer:is(:checked, [data-checked], [aria-checked=true], [data-state=checked]) ~ &`,peerInvalid:`.peer:is(:invalid, [data-invalid], [aria-invalid=true]) ~ &`,peerExpanded:`.peer:is([aria-expanded=true], [data-expanded], [data-state=expanded]) ~ &`,peerPlaceholderShown:`.peer:placeholder-shown ~ &`,groupFocus:`.group:is(:focus, [data-focus]) &`,groupHover:`.group:is(:hover, [data-hover]):not(:disabled, [data-disabled]) &`,groupActive:`.group:is(:active, [data-active]):not(:disabled, [data-disabled]) &`,groupFocusWithin:`.group:focus-within &`,groupFocusVisible:`.group:is(:focus-visible, [data-focus-visible]) &`,groupDisabled:`.group:is(:disabled, [disabled], [data-disabled]) &`,groupChecked:`.group:is(:checked, [data-checked], [aria-checked=true], [data-state=checked]) &`,groupExpanded:`.group:is([aria-expanded=true], [data-expanded], [data-state=expanded]) &`,groupInvalid:`.group:invalid &`,indeterminate:`&:is(:indeterminate, [data-indeterminate], [aria-checked=mixed], [data-state=indeterminate])`,required:`&:is([data-required], [aria-required=true])`,valid:`&:is([data-valid], [data-state=valid])`,invalid:`&:is([data-invalid], [aria-invalid=true], [data-state=invalid])`,autofill:`&:autofill`,inRange:`&:is(:in-range, [data-in-range])`,outOfRange:`&:is(:out-of-range, [data-outside-range])`,placeholder:`&::placeholder, &[data-placeholder]`,placeholderShown:`&:is(:placeholder-shown, [data-placeholder-shown])`,pressed:`&:is([aria-pressed=true], [data-pressed])`,selected:`&:is([aria-selected=true], [data-selected])`,grabbed:`&:is([aria-grabbed=true], [data-grabbed])`,underValue:`&[data-state=under-value]`,overValue:`&[data-state=over-value]`,atValue:`&[data-state=at-value]`,default:`&:default`,optional:`&:optional`,open:`&:is([open], [data-open], [data-state=open])`,closed:`&:is([closed], [data-closed], [data-state=closed])`,fullscreen:`&:is(:fullscreen, [data-fullscreen])`,loading:`&:is([data-loading], [aria-busy=true])`,hidden:`&:is([hidden], [data-hidden])`,current:`&[data-current]`,currentPage:`&[aria-current=page]`,currentStep:`&[aria-current=step]`,today:`&[data-today]`,unavailable:`&[data-unavailable]`,rangeStart:`&[data-range-start]`,rangeEnd:`&[data-range-end]`,now:`&[data-now]`,topmost:`&[data-topmost]`,motionReduce:`@media (prefers-reduced-motion: reduce)`,motionSafe:`@media (prefers-reduced-motion: no-preference)`,print:`@media print`,landscape:`@media (orientation: landscape)`,portrait:`@media (orientation: portrait)`,dark:`.dark &, .dark .chakra-theme:not(.light) &`,light:`:root &, .light &`,osDark:`@media (prefers-color-scheme: dark)`,osLight:`@media (prefers-color-scheme: light)`,highContrast:`@media (forced-colors: active)`,lessContrast:`@media (prefers-contrast: less)`,moreContrast:`@media (prefers-contrast: more)`,ltr:`[dir=ltr] &`,rtl:`[dir=rtl] &`,scrollbar:`&::-webkit-scrollbar`,scrollbarThumb:`&::-webkit-scrollbar-thumb`,scrollbarTrack:`&::-webkit-scrollbar-track`,horizontal:`&[data-orientation=horizontal]`,vertical:`&[data-orientation=vertical]`,icon:`& :where(svg)`,starting:`@starting-style`}),ey=Yv(`bg-currentcolor`),ty=e=>e===ey.ref||e===`currentBg`,ny=e=>({...e(`colors`),currentBg:ey}),vee=qv({conditions:_ee,utilities:{background:{values:ny,shorthand:[`bg`],transform(e,t){if(ty(t.raw))return{background:ey.ref};let n=Ev(`background`)(e,t);return{...n,[ey.var]:n?.background}}},backgroundColor:{values:ny,shorthand:[`bgColor`],transform(e,t){if(ty(t.raw))return{backgroundColor:ey.ref};let n=Ev(`backgroundColor`)(e,t);return{...n,[ey.var]:n?.backgroundColor}}},backgroundSize:{shorthand:[`bgSize`]},backgroundPosition:{shorthand:[`bgPos`]},backgroundRepeat:{shorthand:[`bgRepeat`]},backgroundAttachment:{shorthand:[`bgAttachment`]},backgroundClip:{shorthand:[`bgClip`],values:[`text`],transform(e){return e===`text`?{color:`transparent`,backgroundClip:`text`}:{backgroundClip:e}}},backgroundGradient:{shorthand:[`bgGradient`],values(e){return{...e(`gradients`),"to-t":`linear-gradient(to top, var(--gradient))`,"to-tr":`linear-gradient(to top right, var(--gradient))`,"to-r":`linear-gradient(to right, var(--gradient))`,"to-br":`linear-gradient(to bottom right, var(--gradient))`,"to-b":`linear-gradient(to bottom, var(--gradient))`,"to-bl":`linear-gradient(to bottom left, var(--gradient))`,"to-l":`linear-gradient(to left, var(--gradient))`,"to-tl":`linear-gradient(to top left, var(--gradient))`}},transform(e){return{"--gradient-stops":`var(--gradient-from), var(--gradient-to)`,"--gradient":`var(--gradient-via-stops, var(--gradient-stops))`,backgroundImage:e}}},gradientFrom:{values:ny,transform:Ev(`--gradient-from`)},gradientTo:{values:ny,transform:Ev(`--gradient-to`)},gradientVia:{values:ny,transform(e,t){return{...Ev(`--gradient-via`)(e,t),"--gradient-via-stops":`var(--gradient-from), var(--gradient-via), var(--gradient-to)`}}},backgroundImage:{values(e){return{...e(`gradients`),...e(`assets`)}},shorthand:[`bgImg`,`bgImage`]},border:{values:`borders`},borderTop:{values:`borders`},borderLeft:{values:`borders`},borderBlockStart:{values:`borders`},borderRight:{values:`borders`},borderBottom:{values:`borders`},borderBlockEnd:{values:`borders`},borderInlineStart:{values:`borders`,shorthand:[`borderStart`]},borderInlineEnd:{values:`borders`,shorthand:[`borderEnd`]},borderInline:{values:`borders`,shorthand:[`borderX`]},borderBlock:{values:`borders`,shorthand:[`borderY`]},borderColor:{values:ny,transform:Ev(`borderColor`)},borderTopColor:{values:ny,transform:Ev(`borderTopColor`)},borderBlockStartColor:{values:ny,transform:Ev(`borderBlockStartColor`)},borderBottomColor:{values:ny,transform:Ev(`borderBottomColor`)},borderBlockEndColor:{values:ny,transform:Ev(`borderBlockEndColor`)},borderLeftColor:{values:ny,transform:Ev(`borderLeftColor`)},borderInlineStartColor:{values:ny,shorthand:[`borderStartColor`],transform:Ev(`borderInlineStartColor`)},borderRightColor:{values:ny,transform:Ev(`borderRightColor`)},borderInlineEndColor:{values:ny,shorthand:[`borderEndColor`],transform:Ev(`borderInlineEndColor`)},borderStyle:{values:`borderStyles`},borderTopStyle:{values:`borderStyles`},borderBlockStartStyle:{values:`borderStyles`},borderBottomStyle:{values:`borderStyles`},borderBlockEndStyle:{values:`borderStyles`},borderInlineStartStyle:{values:`borderStyles`,shorthand:[`borderStartStyle`]},borderInlineEndStyle:{values:`borderStyles`,shorthand:[`borderEndStyle`]},borderLeftStyle:{values:`borderStyles`},borderRightStyle:{values:`borderStyles`},borderRadius:{values:`radii`,shorthand:[`rounded`]},borderTopLeftRadius:{values:`radii`,shorthand:[`roundedTopLeft`]},borderStartStartRadius:{values:`radii`,shorthand:[`roundedStartStart`,`borderTopStartRadius`]},borderEndStartRadius:{values:`radii`,shorthand:[`roundedEndStart`,`borderBottomStartRadius`]},borderTopRightRadius:{values:`radii`,shorthand:[`roundedTopRight`]},borderStartEndRadius:{values:`radii`,shorthand:[`roundedStartEnd`,`borderTopEndRadius`]},borderEndEndRadius:{values:`radii`,shorthand:[`roundedEndEnd`,`borderBottomEndRadius`]},borderBottomLeftRadius:{values:`radii`,shorthand:[`roundedBottomLeft`]},borderBottomRightRadius:{values:`radii`,shorthand:[`roundedBottomRight`]},borderInlineStartRadius:{values:`radii`,property:`borderRadius`,shorthand:[`roundedStart`,`borderStartRadius`],transform:e=>({borderStartStartRadius:e,borderEndStartRadius:e})},borderInlineEndRadius:{values:`radii`,property:`borderRadius`,shorthand:[`roundedEnd`,`borderEndRadius`],transform:e=>({borderStartEndRadius:e,borderEndEndRadius:e})},borderTopRadius:{values:`radii`,property:`borderRadius`,shorthand:[`roundedTop`],transform:e=>({borderTopLeftRadius:e,borderTopRightRadius:e})},borderBottomRadius:{values:`radii`,property:`borderRadius`,shorthand:[`roundedBottom`],transform:e=>({borderBottomLeftRadius:e,borderBottomRightRadius:e})},borderLeftRadius:{values:`radii`,property:`borderRadius`,shorthand:[`roundedLeft`],transform:e=>({borderTopLeftRadius:e,borderBottomLeftRadius:e})},borderRightRadius:{values:`radii`,property:`borderRadius`,shorthand:[`roundedRight`],transform:e=>({borderTopRightRadius:e,borderBottomRightRadius:e})},borderWidth:{values:`borderWidths`},borderBlockStartWidth:{values:`borderWidths`},borderTopWidth:{values:`borderWidths`},borderBottomWidth:{values:`borderWidths`},borderBlockEndWidth:{values:`borderWidths`},borderRightWidth:{values:`borderWidths`},borderInlineWidth:{values:`borderWidths`,shorthand:[`borderXWidth`]},borderInlineStartWidth:{values:`borderWidths`,shorthand:[`borderStartWidth`]},borderInlineEndWidth:{values:`borderWidths`,shorthand:[`borderEndWidth`]},borderLeftWidth:{values:`borderWidths`},borderBlockWidth:{values:`borderWidths`,shorthand:[`borderYWidth`]},color:{values:ny,transform:Ev(`color`)},fill:{values:ny,transform:Ev(`fill`)},stroke:{values:ny,transform:Ev(`stroke`)},accentColor:{values:ny,transform:Ev(`accentColor`)},divideX:{values:{type:`string`},transform(e){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":{borderInlineStartWidth:e,borderInlineEndWidth:`0px`}}}},divideY:{values:{type:`string`},transform(e){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":{borderTopWidth:e,borderBottomWidth:`0px`}}}},divideColor:{values:ny,transform(e,t){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":gee(e,t)}}},divideStyle:{property:`borderStyle`,transform(e){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":{borderStyle:e}}}},boxShadow:{values:`shadows`,shorthand:[`shadow`]},boxShadowColor:{values:ny,transform:Ev(`--shadow-color`),shorthand:[`shadowColor`]},mixBlendMode:{shorthand:[`blendMode`]},backgroundBlendMode:{shorthand:[`bgBlendMode`]},opacity:{values:`opacity`},filter:{transform(e){return e===`auto`?{filter:`var(--blur) var(--brightness) var(--contrast) var(--grayscale) var(--hue-rotate) var(--invert) var(--saturate) var(--sepia) var(--drop-shadow)`}:{filter:e}}},blur:{values:`blurs`,transform:e=>({"--blur":Xv(`blur`,e)})},brightness:{transform:e=>({"--brightness":Xv(`brightness`,e)})},contrast:{transform:e=>({"--contrast":Xv(`contrast`,e)})},grayscale:{transform:e=>({"--grayscale":Xv(`grayscale`,e)})},hueRotate:{transform:e=>({"--hue-rotate":Xv(`hue-rotate`,Zv(e))})},invert:{transform:e=>({"--invert":Xv(`invert`,e)})},saturate:{transform:e=>({"--saturate":Xv(`saturate`,e)})},sepia:{transform:e=>({"--sepia":Xv(`sepia`,e)})},dropShadow:{transform:e=>({"--drop-shadow":Xv(`drop-shadow`,e)})},backdropFilter:{transform(e){return e===`auto`?{backdropFilter:`var(--backdrop-blur) var(--backdrop-brightness) var(--backdrop-contrast) var(--backdrop-grayscale) var(--backdrop-hue-rotate) var(--backdrop-invert) var(--backdrop-opacity) var(--backdrop-saturate) var(--backdrop-sepia)`}:{backdropFilter:e}}},backdropBlur:{values:`blurs`,transform:e=>({"--backdrop-blur":Xv(`blur`,e)})},backdropBrightness:{transform:e=>({"--backdrop-brightness":Xv(`brightness`,e)})},backdropContrast:{transform:e=>({"--backdrop-contrast":Xv(`contrast`,e)})},backdropGrayscale:{transform:e=>({"--backdrop-grayscale":Xv(`grayscale`,e)})},backdropHueRotate:{transform:e=>({"--backdrop-hue-rotate":Xv(`hue-rotate`,Zv(e))})},backdropInvert:{transform:e=>({"--backdrop-invert":Xv(`invert`,e)})},backdropOpacity:{transform:e=>({"--backdrop-opacity":Xv(`opacity`,e)})},backdropSaturate:{transform:e=>({"--backdrop-saturate":Xv(`saturate`,e)})},backdropSepia:{transform:e=>({"--backdrop-sepia":Xv(`sepia`,e)})},flexBasis:{values:`sizes`},gap:{values:`spacing`},rowGap:{values:`spacing`,shorthand:[`gapY`]},columnGap:{values:`spacing`,shorthand:[`gapX`]},flexDirection:{shorthand:[`flexDir`]},gridGap:{values:`spacing`},gridColumnGap:{values:`spacing`},gridRowGap:{values:`spacing`},outlineColor:{values:ny,transform:Ev(`outlineColor`)},focusRing:Qv(`&:is(:focus, [data-focus])`),focusVisibleRing:Qv(`&:is(:focus-visible, [data-focus-visible])`),focusRingColor:{values:ny,transform:Ev(`--focus-ring-color`)},focusRingOffset:{values:`spacing`,transform:e=>({"--focus-ring-offset":e})},focusRingWidth:{values:`borderWidths`,property:`outlineWidth`,transform:e=>({"--focus-ring-width":e})},focusRingStyle:{values:`borderStyles`,property:`outlineStyle`,transform:e=>({"--focus-ring-style":e})},aspectRatio:{values:`aspectRatios`},width:{values:`sizes`,shorthand:[`w`]},inlineSize:{values:`sizes`},height:{values:`sizes`,shorthand:[`h`]},blockSize:{values:`sizes`},boxSize:{values:`sizes`,property:`width`,transform:e=>({width:e,height:e})},minWidth:{values:`sizes`,shorthand:[`minW`]},minInlineSize:{values:`sizes`},minHeight:{values:`sizes`,shorthand:[`minH`]},minBlockSize:{values:`sizes`},maxWidth:{values:`sizes`,shorthand:[`maxW`]},maxInlineSize:{values:`sizes`},maxHeight:{values:`sizes`,shorthand:[`maxH`]},maxBlockSize:{values:`sizes`},hideFrom:{values:`breakpoints`,transform:(e,{raw:t,token:n})=>({[n.raw(`breakpoints.${t}`)?`@breakpoint ${t}`:`@media screen and (min-width: ${e})`]:{display:`none`}})},hideBelow:{values:`breakpoints`,transform(e,{raw:t,token:n}){return{[n.raw(`breakpoints.${t}`)?`@breakpoint ${t}Down`:`@media screen and (max-width: ${e})`]:{display:`none`}}}},overscrollBehavior:{shorthand:[`overscroll`]},overscrollBehaviorX:{shorthand:[`overscrollX`]},overscrollBehaviorY:{shorthand:[`overscrollY`]},scrollbar:{values:[`visible`,`hidden`],transform(e){switch(e){case`visible`:return{msOverflowStyle:`auto`,scrollbarWidth:`auto`,"&::-webkit-scrollbar":{display:`block`}};case`hidden`:return{msOverflowStyle:`none`,scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}};default:return{}}}},scrollbarColor:{values:ny,transform:Ev(`scrollbarColor`)},scrollbarGutter:{values:`spacing`},scrollbarWidth:{values:`sizes`},scrollMargin:{values:`spacing`},scrollMarginTop:{values:`spacing`},scrollMarginBottom:{values:`spacing`},scrollMarginLeft:{values:`spacing`},scrollMarginRight:{values:`spacing`},scrollMarginX:{values:`spacing`,transform:e=>({scrollMarginLeft:e,scrollMarginRight:e})},scrollMarginY:{values:`spacing`,transform:e=>({scrollMarginTop:e,scrollMarginBottom:e})},scrollPadding:{values:`spacing`},scrollPaddingTop:{values:`spacing`},scrollPaddingBottom:{values:`spacing`},scrollPaddingLeft:{values:`spacing`},scrollPaddingRight:{values:`spacing`},scrollPaddingInline:{values:`spacing`,shorthand:[`scrollPaddingX`]},scrollPaddingBlock:{values:`spacing`,shorthand:[`scrollPaddingY`]},scrollSnapType:{values:{none:`none`,x:`x var(--scroll-snap-strictness)`,y:`y var(--scroll-snap-strictness)`,both:`both var(--scroll-snap-strictness)`}},scrollSnapStrictness:{values:[`mandatory`,`proximity`],transform:e=>({"--scroll-snap-strictness":e})},scrollSnapMargin:{values:`spacing`},scrollSnapMarginTop:{values:`spacing`},scrollSnapMarginBottom:{values:`spacing`},scrollSnapMarginLeft:{values:`spacing`},scrollSnapMarginRight:{values:`spacing`},listStylePosition:{shorthand:[`listStylePos`]},listStyleImage:{values:`assets`,shorthand:[`listStyleImg`]},position:{shorthand:[`pos`]},zIndex:{values:`zIndex`},inset:{values:`spacing`},insetInline:{values:`spacing`,shorthand:[`insetX`]},insetBlock:{values:`spacing`,shorthand:[`insetY`]},top:{values:`spacing`},insetBlockStart:{values:`spacing`},bottom:{values:`spacing`},insetBlockEnd:{values:`spacing`},left:{values:`spacing`},right:{values:`spacing`},insetInlineStart:{values:`spacing`,shorthand:[`insetStart`]},insetInlineEnd:{values:`spacing`,shorthand:[`insetEnd`]},ring:{transform(e){return{"--ring-offset-shadow":`var(--ring-inset) 0 0 0 var(--ring-offset-width) var(--ring-offset-color)`,"--ring-shadow":`var(--ring-inset) 0 0 0 calc(var(--ring-width) + var(--ring-offset-width)) var(--ring-color)`,"--ring-width":e,boxShadow:`var(--ring-offset-shadow), var(--ring-shadow), var(--shadow, 0 0 #0000)`}}},ringColor:{values:ny,transform:Ev(`--ring-color`)},ringOffset:{transform:e=>({"--ring-offset-width":e})},ringOffsetColor:{values:ny,transform:Ev(`--ring-offset-color`)},ringInset:{transform:e=>({"--ring-inset":e})},margin:{values:`spacing`,shorthand:[`m`]},marginTop:{values:`spacing`,shorthand:[`mt`]},marginBlockStart:{values:`spacing`},marginRight:{values:`spacing`,shorthand:[`mr`]},marginBottom:{values:`spacing`,shorthand:[`mb`]},marginBlockEnd:{values:`spacing`},marginLeft:{values:`spacing`,shorthand:[`ml`]},marginInlineStart:{values:`spacing`,shorthand:[`ms`,`marginStart`]},marginInlineEnd:{values:`spacing`,shorthand:[`me`,`marginEnd`]},marginInline:{values:`spacing`,shorthand:[`mx`,`marginX`]},marginBlock:{values:`spacing`,shorthand:[`my`,`marginY`]},padding:{values:`spacing`,shorthand:[`p`]},paddingTop:{values:`spacing`,shorthand:[`pt`]},paddingRight:{values:`spacing`,shorthand:[`pr`]},paddingBottom:{values:`spacing`,shorthand:[`pb`]},paddingBlockStart:{values:`spacing`},paddingBlockEnd:{values:`spacing`},paddingLeft:{values:`spacing`,shorthand:[`pl`]},paddingInlineStart:{values:`spacing`,shorthand:[`ps`,`paddingStart`]},paddingInlineEnd:{values:`spacing`,shorthand:[`pe`,`paddingEnd`]},paddingInline:{values:`spacing`,shorthand:[`px`,`paddingX`]},paddingBlock:{values:`spacing`,shorthand:[`py`,`paddingY`]},textDecoration:{shorthand:[`textDecor`]},textDecorationColor:{values:ny,transform:Ev(`textDecorationColor`)},textShadow:{values:`shadows`},transform:{transform:e=>{let t=e;return e===`auto`&&(t=`translateX(var(--translate-x, 0)) translateY(var(--translate-y, 0)) rotate(var(--rotate, 0)) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1)) skewX(var(--skew-x, 0)) skewY(var(--skew-y, 0))`),e===`auto-gpu`&&(t=`translate3d(var(--translate-x, 0), var(--translate-y, 0), 0) rotate(var(--rotate, 0)) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1)) skewX(var(--skew-x, 0)) skewY(var(--skew-y, 0))`),{transform:t}}},skewX:{transform:e=>({"--skew-x":Zv(e)})},skewY:{transform:e=>({"--skew-y":Zv(e)})},scaleX:{transform:e=>({"--scale-x":e})},scaleY:{transform:e=>({"--scale-y":e})},scale:{transform(e){return e===`auto`?{scale:`var(--scale-x, 1) var(--scale-y, 1)`}:{scale:e}}},spaceXReverse:{values:{type:`boolean`},transform(e){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":{"--space-x-reverse":e?`1`:void 0}}}},spaceX:{property:`marginInlineStart`,values:`spacing`,transform:e=>({"& > :not(style, [hidden]) ~ :not(style, [hidden])":{"--space-x-reverse":`0`,marginInlineStart:`calc(${e} * calc(1 - var(--space-x-reverse)))`,marginInlineEnd:`calc(${e} * var(--space-x-reverse))`}})},spaceYReverse:{values:{type:`boolean`},transform(e){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":{"--space-y-reverse":e?`1`:void 0}}}},spaceY:{property:`marginTop`,values:`spacing`,transform:e=>({"& > :not(style, [hidden]) ~ :not(style, [hidden])":{"--space-y-reverse":`0`,marginTop:`calc(${e} * calc(1 - var(--space-y-reverse)))`,marginBottom:`calc(${e} * var(--space-y-reverse))`}})},rotate:{transform(e){return e===`auto`?{rotate:`var(--rotate-x, 0) var(--rotate-y, 0) var(--rotate-z, 0)`}:{rotate:Zv(e)}}},rotateX:{transform(e){return{"--rotate-x":Zv(e)}}},rotateY:{transform(e){return{"--rotate-y":Zv(e)}}},translate:{transform(e){return e===`auto`?{translate:`var(--translate-x) var(--translate-y)`}:{translate:e}}},translateX:{values:`spacing`,transform:e=>({"--translate-x":e})},translateY:{values:`spacing`,transform:e=>({"--translate-y":e})},transition:{values:[`all`,`common`,`colors`,`opacity`,`position`,`backgrounds`,`size`,`shadow`,`transform`],transform(e){switch(e){case`all`:return $v(`all`);case`position`:return $v(`left, right, top, bottom, inset-inline, inset-block`);case`colors`:return $v(`color, background-color, border-color, text-decoration-color, fill, stroke`);case`opacity`:return $v(`opacity`);case`shadow`:return $v(`box-shadow`);case`transform`:return $v(`transform`);case`size`:return $v(`width, height`);case`backgrounds`:return $v(`background, background-color, background-image, background-position`);case`common`:return $v(`color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter`);default:return{transition:e}}}},transitionDuration:{values:`durations`},transitionProperty:{values:{common:`background-color, border-color, color, fill, stroke, opacity, box-shadow, translate, transform`,colors:`background-color, border-color, color, fill, stroke`,size:`width, height`,position:`left, right, top, bottom, inset-inline, inset-block`,background:`background, background-color, background-image, background-position`}},transitionTimingFunction:{values:`easings`},animation:{values:`animations`},animationDuration:{values:`durations`},animationDelay:{values:`durations`},animationTimingFunction:{values:`easings`},fontFamily:{values:`fonts`},fontSize:{values:`fontSizes`},fontWeight:{values:`fontWeights`},lineHeight:{values:`lineHeights`},letterSpacing:{values:`letterSpacings`},textIndent:{values:`spacing`},truncate:{values:{type:`boolean`},transform(e){return e===!0?{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`}:{}}},lineClamp:{transform(e){return e===`none`?{WebkitLineClamp:`unset`}:{overflow:`hidden`,display:`-webkit-box`,WebkitLineClamp:e,WebkitBoxOrient:`vertical`,textWrap:`wrap`}}},borderSpacing:{values:e=>({...e(`spacing`),auto:`var(--border-spacing-x, 0) var(--border-spacing-y, 0)`})},borderSpacingX:{values:`spacing`,transform(e){return{"--border-spacing-x":e}}},borderSpacingY:{values:`spacing`,transform(e){return{"--border-spacing-y":e}}},srOnly:{values:{type:`boolean`},transform(e){return yee[e]||{}}},debug:{values:{type:`boolean`},transform(e){return e?{outline:`1px solid blue !important`,"& > *":{outline:`1px solid red !important`}}:{}}},caretColor:{values:ny,transform:Ev(`caretColor`)},cursor:{values:`cursor`}}}),yee={true:{position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},false:{position:`static`,width:`auto`,height:`auto`,padding:`0`,margin:`0`,overflow:`visible`,clip:`auto`,whiteSpace:`normal`}},ry=``.split(`,`),iy=`WebkitAppearance,WebkitBorderBefore,WebkitBorderBeforeColor,WebkitBorderBeforeStyle,WebkitBorderBeforeWidth,WebkitBoxReflect,WebkitLineClamp,WebkitMask,WebkitMaskAttachment,WebkitMaskClip,WebkitMaskComposite,WebkitMaskImage,WebkitMaskOrigin,WebkitMaskPosition,WebkitMaskPositionX,WebkitMaskPositionY,WebkitMaskRepeat,WebkitMaskRepeatX,WebkitMaskRepeatY,WebkitMaskSize,WebkitOverflowScrolling,WebkitTapHighlightColor,WebkitTextFillColor,WebkitTextStroke,WebkitTextStrokeColor,WebkitTextStrokeWidth,WebkitTouchCallout,WebkitUserModify,WebkitUserSelect,accentColor,alignContent,alignItems,alignSelf,alignTracks,all,anchorName,anchorScope,animation,animationComposition,animationDelay,animationDirection,animationDuration,animationFillMode,animationIterationCount,animationName,animationPlayState,animationRange,animationRangeEnd,animationRangeStart,animationTimeline,animationTimingFunction,appearance,aspectRatio,backdropFilter,backfaceVisibility,background,backgroundAttachment,backgroundBlendMode,backgroundClip,backgroundColor,backgroundImage,backgroundOrigin,backgroundPosition,backgroundPositionX,backgroundPositionY,backgroundRepeat,backgroundSize,blockSize,border,borderBlock,borderBlockColor,borderBlockEnd,borderBlockEndColor,borderBlockEndStyle,borderBlockEndWidth,borderBlockStart,borderBlockStartColor,borderBlockStartStyle,borderBlockStartWidth,borderBlockStyle,borderBlockWidth,borderBottom,borderBottomColor,borderBottomLeftRadius,borderBottomRightRadius,borderBottomStyle,borderBottomWidth,borderCollapse,borderColor,borderEndEndRadius,borderEndStartRadius,borderImage,borderImageOutset,borderImageRepeat,borderImageSlice,borderImageSource,borderImageWidth,borderInline,borderInlineColor,borderInlineEnd,borderInlineEndColor,borderInlineEndStyle,borderInlineEndWidth,borderInlineStart,borderInlineStartColor,borderInlineStartStyle,borderInlineStartWidth,borderInlineStyle,borderInlineWidth,borderLeft,borderLeftColor,borderLeftStyle,borderLeftWidth,borderRadius,borderRight,borderRightColor,borderRightStyle,borderRightWidth,borderSpacing,borderStartEndRadius,borderStartStartRadius,borderStyle,borderTop,borderTopColor,borderTopLeftRadius,borderTopRightRadius,borderTopStyle,borderTopWidth,borderWidth,bottom,boxAlign,boxDecorationBreak,boxDirection,boxFlex,boxFlexGroup,boxLines,boxOrdinalGroup,boxOrient,boxPack,boxShadow,boxSizing,breakAfter,breakBefore,breakInside,captionSide,caret,caretColor,caretShape,clear,clip,clipPath,clipRule,color,colorInterpolationFilters,colorScheme,columnCount,columnFill,columnGap,columnRule,columnRuleColor,columnRuleStyle,columnRuleWidth,columnSpan,columnWidth,columns,contain,containIntrinsicBlockSize,containIntrinsicHeight,containIntrinsicInlineSize,containIntrinsicSize,containIntrinsicWidth,container,containerName,containerType,content,contentVisibility,cornerShape,counterIncrement,counterReset,counterSet,cursor,cx,cy,d,direction,display,dominantBaseline,emptyCells,fieldSizing,fill,fillOpacity,fillRule,filter,flex,flexBasis,flexDirection,flexFlow,flexGrow,flexShrink,flexWrap,float,floodColor,floodOpacity,font,fontFamily,fontFeatureSettings,fontKerning,fontLanguageOverride,fontOpticalSizing,fontPalette,fontSize,fontSizeAdjust,fontSmooth,fontStretch,fontStyle,fontSynthesis,fontSynthesisPosition,fontSynthesisSmallCaps,fontSynthesisStyle,fontSynthesisWeight,fontVariant,fontVariantAlternates,fontVariantCaps,fontVariantEastAsian,fontVariantEmoji,fontVariantLigatures,fontVariantNumeric,fontVariantPosition,fontVariationSettings,fontWeight,forcedColorAdjust,gap,grid,gridArea,gridAutoColumns,gridAutoFlow,gridAutoRows,gridColumn,gridColumnEnd,gridColumnGap,gridColumnStart,gridGap,gridRow,gridRowEnd,gridRowGap,gridRowStart,gridTemplate,gridTemplateAreas,gridTemplateColumns,gridTemplateRows,hangingPunctuation,height,hyphenateCharacter,hyphenateLimitChars,hyphens,imageOrientation,imageRendering,imageResolution,imeMode,initialLetter,initialLetterAlign,inlineSize,inset,insetBlock,insetBlockEnd,insetBlockStart,insetInline,insetInlineEnd,insetInlineStart,interpolateSize,isolation,justifyContent,justifyItems,justifySelf,justifyTracks,left,letterSpacing,lightingColor,lineBreak,lineClamp,lineHeight,lineHeightStep,listStyle,listStyleImage,listStylePosition,listStyleType,margin,marginBlock,marginBlockEnd,marginBlockStart,marginBottom,marginInline,marginInlineEnd,marginInlineStart,marginLeft,marginRight,marginTop,marginTrim,marker,markerEnd,markerMid,markerStart,mask,maskBorder,maskBorderMode,maskBorderOutset,maskBorderRepeat,maskBorderSlice,maskBorderSource,maskBorderWidth,maskClip,maskComposite,maskImage,maskMode,maskOrigin,maskPosition,maskRepeat,maskSize,maskType,masonryAutoFlow,mathDepth,mathShift,mathStyle,maxBlockSize,maxHeight,maxInlineSize,maxLines,maxWidth,minBlockSize,minHeight,minInlineSize,minWidth,mixBlendMode,objectFit,objectPosition,offset,offsetAnchor,offsetDistance,offsetPath,offsetPosition,offsetRotate,opacity,order,orphans,outline,outlineColor,outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowBlock,overflowClipBox,overflowClipMargin,overflowInline,overflowWrap,overflowX,overflowY,overlay,overscrollBehavior,overscrollBehaviorBlock,overscrollBehaviorInline,overscrollBehaviorX,overscrollBehaviorY,padding,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingBottom,paddingInline,paddingInlineEnd,paddingInlineStart,paddingLeft,paddingRight,paddingTop,page,pageBreakAfter,pageBreakBefore,pageBreakInside,paintOrder,perspective,perspectiveOrigin,placeContent,placeItems,placeSelf,pointerEvents,position,positionAnchor,positionArea,positionTry,positionTryFallbacks,positionTryOrder,positionVisibility,printColorAdjust,quotes,r,resize,right,rotate,rowGap,rubyAlign,rubyMerge,rubyPosition,rx,ry,scale,scrollBehavior,scrollMargin,scrollMarginBlock,scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginBottom,scrollMarginInline,scrollMarginInlineEnd,scrollMarginInlineStart,scrollMarginLeft,scrollMarginRight,scrollMarginTop,scrollPadding,scrollPaddingBlock,scrollPaddingBlockEnd,scrollPaddingBlockStart,scrollPaddingBottom,scrollPaddingInline,scrollPaddingInlineEnd,scrollPaddingInlineStart,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollSnapAlign,scrollSnapCoordinate,scrollSnapDestination,scrollSnapPointsX,scrollSnapPointsY,scrollSnapStop,scrollSnapType,scrollSnapTypeX,scrollSnapTypeY,scrollTimeline,scrollTimelineAxis,scrollTimelineName,scrollbarColor,scrollbarGutter,scrollbarWidth,shapeImageThreshold,shapeMargin,shapeOutside,shapeRendering,stopColor,stopOpacity,stroke,strokeDasharray,strokeDashoffset,strokeLinecap,strokeLinejoin,strokeMiterlimit,strokeOpacity,strokeWidth,tabSize,tableLayout,textAlign,textAlignLast,textAnchor,textBox,textBoxEdge,textBoxTrim,textCombineUpright,textDecoration,textDecorationColor,textDecorationLine,textDecorationSkip,textDecorationSkipInk,textDecorationStyle,textDecorationThickness,textEmphasis,textEmphasisColor,textEmphasisPosition,textEmphasisStyle,textIndent,textJustify,textOrientation,textOverflow,textRendering,textShadow,textSizeAdjust,textSpacingTrim,textTransform,textUnderlineOffset,textUnderlinePosition,textWrap,textWrapMode,textWrapStyle,timelineScope,top,touchAction,transform,transformBox,transformOrigin,transformStyle,transition,transitionBehavior,transitionDelay,transitionDuration,transitionProperty,transitionTimingFunction,translate,unicodeBidi,userSelect,vectorEffect,verticalAlign,viewTimeline,viewTimelineAxis,viewTimelineInset,viewTimelineName,viewTransitionName,visibility,whiteSpace,whiteSpaceCollapse,widows,width,willChange,wordBreak,wordSpacing,wordWrap,writingMode,x,y,zIndex,zoom,alignmentBaseline,baselineShift,colorInterpolation,colorRendering,glyphOrientationVertical`.split(`,`).concat(ry),ay=new Map(iy.map(e=>[e,!0]));function oy(e){let t=Object.create(null);return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}var sy=/&|@/,cy=oy(e=>ay.has(e)||e.startsWith(`--`)||sy.test(e));function ly(e,t){let n={};for(let r in e){let i=t(r,e[r]);n[i[0]]=i[1]}return n}function uy(e,t){let n={};return jv(e,(e,t)=>{e&&(n[t.join(`.`)]=e.value)},{stop:t}),n}var dy=Object.defineProperty,fy=(e,t,n)=>t in e?dy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,py=(e,t,n)=>fy(e,typeof t==`symbol`?t:t+``,n);function my(e){if(e===null)return`null`;if(e===void 0)return`undefined`;let t=typeof e;return t===`string`?`s:${e}`:t===`number`?`n:${e}`:t===`boolean`?`b:${e}`:t===`function`?`f:${e.name||`anonymous`}`:Array.isArray(e)?`a:[${e.map(my).join(`,`)}]`:t===`object`?`o:{${Object.keys(e).sort().map(t=>`${t}:${my(e[t])}`).join(`,`)}}`:String(e)}var hy=class{constructor(e=500){py(this,`cache`,new Map),py(this,`maxSize`),this.maxSize=e}get(e){let t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e!==void 0&&this.cache.delete(e)}this.cache.set(e,t)}clear(){this.cache.clear()}},gy=e=>{let t=new hy;function n(...n){let r=n.length===1?my(n[0]):n.map(my).join(`|`),i=t.get(r);return i===void 0&&(i=e.apply(this,n),t.set(r,i)),i}return n},_y=16,vy=`px`,yy=`em`,by=`rem`;function xy(e=``){let t=new RegExp(String.raw`-?\d+(?:\.\d+|\d*)`),n=RegExp(`${vy}|${yy}|${by}`);return e.match(RegExp(`${t.source}(${n.source})`))?.[1]}function Sy(e=``){if(typeof e==`number`)return`${e}px`;let t=xy(e);if(!t||t===vy)return e;if(t===yy||t===by)return`${parseFloat(e)*_y}${vy}`}function Cy(e=``){let t=xy(e);if(!t||t===by)return e;if(t===yy)return`${parseFloat(e)}${by}`;if(t===vy)return`${parseFloat(e)/_y}${by}`}var wy=e=>e.charAt(0).toUpperCase()+e.slice(1);function Ty(e){let t=Dy(e),n=Object.fromEntries(t);function r(e){return n[e]}function i(e){return ky(r(e))}function a(){let e=Object.keys(n),t=Oy(e),a=e.flatMap(e=>{let t=r(e),n=[`${e}Down`,ky({max:Ey(t.min)})];return[[e,ky({min:t.min})],[`${e}Only`,i(e)],n]}).filter(([,e])=>e!==``).concat(t.map(([e,t])=>{let n=r(e),i=r(t);return[`${e}To${wy(t)}`,ky({min:n.min,max:Ey(i.min)})]}));return Object.fromEntries(a)}function o(){let e=a();return Object.fromEntries(Object.entries(e))}let s=o(),c=e=>s[e];function l(){return Zt([`base`,...Object.keys(n)])}function u(e){return ky({min:r(e).min})}function d(e){return ky({max:Ey(r(e).min)})}return{values:Object.values(n),only:i,keys:l,conditions:s,getCondition:c,up:u,down:d}}function Ey(e){return Cy(`${parseFloat(Sy(e)??``)-.04}px`)}function Dy(e){return Object.entries(e).sort(([,e],[,t])=>parseInt(e,10)<parseInt(t,10)?-1:1).map(([e,t],n,r)=>{let i=null;return n<=r.length-1&&(i=r[n+1]?.[1]),i!=null&&(i=Ey(i)),[e,{name:e,min:Cy(t),max:i}]})}function Oy(e){let t=[];return e.forEach((n,r)=>{let i=r;i++;let a=e[i];for(;a;)t.push([n,a]),i++,a=e[i]}),t}function ky({min:e,max:t}){return e==null&&t==null?``:[`@media screen`,e&&`(min-width: ${e})`,t&&`(max-width: ${t})`].filter(Boolean).join(` and `)}var Ay=/^@|&|&$/,jy=e=>{let{breakpoints:t,conditions:n={}}=e,r=ly(n,(e,t)=>[`_${e}`,t]),i=Object.assign({},r,t.conditions);function a(){return Object.keys(i)}function o(e){return a().includes(e)||Ay.test(e)||e.startsWith(`_`)}let s=gy(e=>e.filter(e=>e!==`base`).sort((e,t)=>{let n=o(e),r=o(t);return n&&!r?1:!n&&r?-1:0}));function c(e){return e.startsWith(`@breakpoint`)?t.getCondition(e.replace(`@breakpoint `,``)):e}function l(e){return Reflect.get(i,e)||e}return{keys:a,sort:s,has:o,resolve:l,breakpoints:t.keys(),expandAtRule:c}},My=Object.freeze(Object.create(null)),Ny=Object.freeze([]);function Py(){return Object.create(null)}var Fy=e=>({minMax:RegExp(`(!?\\(\\s*min(-device-)?-${e})(.|
10
+ )+\\(\\s*max(-device)?-${e}`,`i`),min:RegExp(`\\(\\s*min(-device)?-${e}`,`i`),maxMin:RegExp(`(!?\\(\\s*max(-device)?-${e})(.|
11
+ )+\\(\\s*min(-device)?-${e}`,`i`),max:RegExp(`\\(\\s*max(-device)?-${e}`,`i`)}),Iy=Fy(`width`),Ly=Fy(`height`),Ry=e=>({isMin:Xy(e.minMax,e.maxMin,e.min),isMax:Xy(e.maxMin,e.minMax,e.max)}),{isMin:zy,isMax:By}=Ry(Iy),{isMin:Vy,isMax:Hy}=Ry(Ly),Uy=/print/i,Wy=/^print$/i,Gy=/(-?\d*\.?\d+)(ch|em|ex|px|rem)/,Ky=/(\d)/,qy=Number.MAX_VALUE,Jy={ch:8.8984375,em:16,rem:16,ex:8.296875,px:1};function Yy(e){let t=Gy.exec(e)||(zy(e)||Vy(e)?Ky.exec(e):null);return t?t[0]===`0`?0:parseFloat(t[1])*(Jy[t[2]]||1):qy}function Xy(e,t,n){return r=>e.test(r)||!t.test(r)&&n.test(r)}function Zy(e,t){let n=Uy.test(e),r=Wy.test(e),i=Uy.test(t),a=Wy.test(t);return n&&i?!r&&a?1:r&&!a?-1:e.localeCompare(t):n?1:i?-1:null}var Qy=gy((e,t)=>{let n=Zy(e,t);if(n!==null)return n;let r=zy(e)||Vy(e),i=By(e)||Hy(e),a=zy(t)||Vy(t),o=By(t)||Hy(t);if(r&&o)return-1;if(i&&a)return 1;let s=Yy(e),c=Yy(t);return s===qy&&c===qy?e.localeCompare(t):s===qy?1:c===qy?-1:s===c?e.localeCompare(t):s>c?i?-1:1:i?1:-1});function $y(e){return e.sort(([e],[t])=>Qy(e,t))}function eb(e){let t=[],n=[],r={};for(let[i,a]of Object.entries(e))i.startsWith(`@media`)?t.push([i,a]):i.startsWith(`@container`)?n.push([i,a]):r[i]=Gt(a)?eb(a):a;let i=$y(t),a=$y(n);return{...r,...Object.fromEntries(i),...Object.fromEntries(a)}}var tb=/\s*!(important)?/i,nb=gy(e=>Kt(e)?tb.test(e):!1),rb=gy(e=>Kt(e)?e.replace(tb,``).trim():e);function ib(e){let{transform:t,conditions:n,normalize:r}=e,i=sb(e);return gy(function(...e){let a=i(...e),o=r(a),s=Py();return jv(o,(e,r)=>{if(e==null)return;let[i,...a]=n.sort(r).map(n.resolve),o=nb(e);o&&(e=rb(e));let c=t(i,e)??My;c=jv(c,e=>Kt(e)&&o?`${e} !important`:e,{getKey:e=>n.expandAtRule(e)}),ab(s,a.flat(),c)}),eb(s)})}function ab(e,t,n){let r=e;for(let e of t)e&&(r[e]||(r[e]=Py()),r=r[e]);kv(r,n)}function ob(...e){return e.filter(e=>{if(!Gt(e))return!1;let t=Wt(e);return Object.keys(t).length>0})}function sb(e){function t(t){let n=ob(...t);return n.length===1?n:n.map(t=>e.normalize(t))}return gy(function(...e){return kv({},...t(e))})}var cb=e=>({base:My,variants:My,defaultVariants:My,compoundVariants:[],...e});function lb(e){let{css:t,conditions:n,normalize:r,layers:i}=e;function a(e={}){let s=cb(e),{base:c,defaultVariants:l,compoundVariants:u}=s,d=ly(s.variants,(e,t)=>[e,ly(t,(e,t)=>[e,r(t)])]),f=ib({conditions:n,normalize:r,transform(e,t){return d[e]?.[t]}}),p=gy(function(e={}){let n=r({...l,...Wt(e)}),a={...r(c)};kv(a,f(n));let s=o(u,n);return i.wrap(`recipes`,t(a,s))}),m=Object.keys(d),h=e=>{let[t,n]=an(wv(e,[`recipe`]),m),r=m.includes(`colorPalette`),i=m.includes(`orientation`);return r||(t.colorPalette=e.colorPalette||l.colorPalette),i&&(n.orientation=e.orientation),[t,n]},g=ly(d,(e,t)=>[e,Object.keys(t)]),_=gy(function(e){return t(p(e))});return Object.assign(_,{className:e.className,__cva__:!0,variantMap:g,variantKeys:m,raw:p,config:e,splitVariantProps:h,merge(e){return a(db(this,e))}})}function o(e,n){let r=My;return e.forEach(e=>{Object.entries(e).every(([e,t])=>e===`css`||(Array.isArray(t)?t:[t]).some(t=>n[e]===t))&&(r=t(r,e.css))}),r}return a}var ub=e=>(e?.__cva__?e.config:e)??My;function db(e,t){let n=cb(ub(e)),r=cb(ub(t)),i=Zt(Object.keys(n.variants),Object.keys(r.variants)),a=kv({},n.base,r.base),o=Object.fromEntries(i.map(e=>[e,kv({},n.variants[e],r.variants[e])])),s=kv({},n.defaultVariants,r.defaultVariants),c=[...n.compoundVariants,...r.compoundVariants];return{className:Jt(n.className,r.className),base:a,variants:o,defaultVariants:s,compoundVariants:c}}var fb={reset:`reset`,base:`base`,tokens:`tokens`,recipes:`recipes`},pb={reset:0,base:1,tokens:2,recipes:3};function mb(e){let t=e.layers??fb,n=Object.values(t).sort((e,t)=>pb[e]-pb[t]);return{names:n,atRule:`@layer ${n.join(`, `)};`,wrap(n,r){return e.disableLayers?r:{[`@layer ${t[n]}`]:r}}}}function hb(e){let{utility:t,normalize:n}=e,{hasShorthand:r,resolveShorthand:i}=t;return function(e){return jv(e,n,{stop:e=>Array.isArray(e),getKey:r?i:void 0})}}function gb(e){let{preflight:t}=e;if(!t)return{};let{scope:n=``,level:r=`parent`}=Gt(t)?t:{},i=``;n&&r===`parent`?i=`${n} `:n&&r===`element`&&(i=`&${n}`);let a={"*":{margin:`0px`,padding:`0px`,font:`inherit`,wordWrap:`break-word`,WebkitTapHighlightColor:`transparent`},"*, *::before, *::after, *::backdrop":{boxSizing:`border-box`,borderWidth:`0px`,borderStyle:`solid`,borderColor:`var(--global-color-border, currentColor)`},hr:{height:`0px`,color:`inherit`,borderTopWidth:`1px`},body:{minHeight:`100dvh`,position:`relative`},img:{borderStyle:`none`},"img, svg, video, canvas, audio, iframe, embed, object":{display:`block`,verticalAlign:`middle`},iframe:{border:`none`},"img, video":{maxWidth:`100%`,height:`auto`},"p, h1, h2, h3, h4, h5, h6":{overflowWrap:`break-word`},"ol, ul":{listStyle:`none`},"code, kbd, pre, samp":{fontSize:`1em`},"button, [type='button'], [type='reset'], [type='submit']":{WebkitAppearance:`button`,backgroundColor:`transparent`,backgroundImage:`none`},"button, input, optgroup, select, textarea":{color:`inherit`},"button, select":{textTransform:`none`},table:{textIndent:`0px`,borderColor:`inherit`,borderCollapse:`collapse`},"*::placeholder":{opacity:`unset`,color:`#9ca3af`,userSelect:`none`},textarea:{resize:`vertical`},summary:{display:`list-item`},small:{fontSize:`80%`},"sub, sup":{fontSize:`75%`,lineHeight:0,position:`relative`,verticalAlign:`baseline`},sub:{bottom:`-0.25em`},sup:{top:`-0.5em`},dialog:{padding:`0px`},a:{color:`inherit`,textDecoration:`inherit`},"abbr:where([title])":{textDecoration:`underline dotted`},"b, strong":{fontWeight:`bolder`},"i, em":{fontStyle:`italic`},"code, kbd, samp, pre":{fontSize:`1em`,"--font-mono-fallback":`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New'`,fontFamily:`var(--global-font-mono, var(--font-mono-fallback))`},'input[type="text"], input[type="email"], input[type="search"], input[type="password"]':{WebkitAppearance:`none`,MozAppearance:`none`},"input[type='search']":{WebkitAppearance:`textfield`,outlineOffset:`-2px`},"::-webkit-search-decoration, ::-webkit-search-cancel-button":{WebkitAppearance:`none`},"::-webkit-file-upload-button":{WebkitAppearance:`button`,font:`inherit`},'input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button':{height:`auto`},"input[type='number']":{MozAppearance:`textfield`},":-moz-ui-invalid":{boxShadow:`none`},":-moz-focusring":{outline:`auto`},"[hidden]:where(:not([hidden='until-found']))":{display:`none !important`}},o={[n||`html`]:{lineHeight:1.5,"--font-fallback":`ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'`,WebkitTextSizeAdjust:`100%`,WebkitFontSmoothing:`antialiased`,MozOsxFontSmoothing:`grayscale`,textRendering:`optimizeLegibility`,touchAction:`manipulation`,MozTabSize:`4`,tabSize:`4`,fontFamily:`var(--global-font-body, var(--font-fallback))`}};if(r===`element`){let e=Object.entries(a).reduce((e,[t,n])=>(e[t]={[i]:n},e),{});Object.assign(o,e)}else i?o[i]=a:Object.assign(o,a);return o}function _b(e){let{conditions:t,isValidProperty:n}=e,r=gy((e,r)=>!n(e)||!r.split(`,`).every(e=>e===`base`||t.has(e)));return function(e){return jv(e,e=>e,{stop:e=>Array.isArray(e),getKey:(e,n)=>!Gt(n)||t.has(e)?e:r(e,Object.keys(n).join(`,`))?yb(e).map(e=>{let t=e.startsWith(`&`)?e.slice(1):e;return vb(t)?`${t} &`:`&${t}`}).join(`, `):e})}}function vb(e){let t=e.toLowerCase();return t.startsWith(`:host-context`)||t.startsWith(`:host`)||t.startsWith(`::slotted`)}function yb(e){let t=[],n=0,r=``,i=!1;for(let a=0;a<e.length;a++){let o=e[a];if(o===`\\`&&!i){i=!0,r+=o;continue}if(i){i=!1,r+=o;continue}o===`(`?n++:o===`)`&&n--,o===`,`&&n===0?(t.push(r.trim()),r=``):r+=o}return r&&t.push(r.trim()),t}var bb=(e=My)=>{let t=t=>({base:e.base?.[t]??My,variants:Py(),defaultVariants:e.defaultVariants??My,compoundVariants:e.compoundVariants?xb(e.compoundVariants,t):Ny}),n=(e.slots??[]).map(e=>[e,t(e)]);for(let[t,r]of Object.entries(e.variants??{}))for(let[e,i]of Object.entries(r))n.forEach(([n,r])=>{var a;(a=r.variants)[t]??(a[t]={}),r.variants[t][e]=i[n]??My});return Object.fromEntries(n)},xb=(e,t)=>e.filter(e=>e.css[t]).map(e=>({...e,css:e.css[t]}));function Sb(e){let{cva:t}=e;return function(e=My){let n=Object.entries(bb(e)).map(([e,n])=>[e,t(n)]),r=gy(function(e){let t=n.map(([t,n])=>[t,n(e)]);return Object.fromEntries(t)}),i=e.variants??My,a=Object.keys(i);function o(t){let[n,r]=an(wv(t,[`recipe`]),a),i=a.includes(`colorPalette`),o=a.includes(`orientation`);return i||(n.colorPalette=t.colorPalette||e.defaultVariants?.colorPalette),o&&(r.orientation=t.orientation),[n,r]}let s=ly(i,(e,t)=>[e,Object.keys(t)]),c={};return e.className&&(c=Object.fromEntries(e.slots.map(t=>[t,`${e.className}__${t}`]))),Object.assign(r,{variantMap:s,variantKeys:a,splitVariantProps:o,classNameMap:c})}}var Cb=()=>e=>Array.from(new Set(e)),wb=/([\0-\x1f\x7f]|^-?\d)|^-$|^-|[^\x80-\uFFFF\w-]/g,Tb=function(e,t){return t?e===`\0`?`�`:e===`-`&&e.length===1?`\\-`:e.slice(0,-1)+`\\`+e.charCodeAt(e.length-1).toString(16):`\\`+e},Eb=e=>(e+``).replace(wb,Tb),Db=(e,t)=>{let n=``,r=0,i=`char`,a=``,o=``,s=[];for(;r<e.length;){let c=e[r];if(c===`{`){let i=e.indexOf(`}`,r);if(i===-1)break;let a=e.slice(r+1,i),o=t(a);n+=o??a,r=i+1;continue}if(i===`token`&&c===`,`){e[r]===``&&r++,i=`fallback`,s.push(i);let c=t(a);c?.endsWith(`)`)&&(n+=c.slice(0,-1)),a=``,o=``;continue}if(i===`fallback`&&o+c===`, var(`){let t=Ob(e.slice(r+1))+r+1,a=e.slice(r+1,t);if(t===-1)break;n+=`, var(`+a+`)`,r=t+1,i=s.pop()??i,o=``;continue}if(i===`token`||i===`fallback`){if(r++,c===`)`){i=s.pop()??i??`char`,o+=c;let e=a&&(t(a)??Eb(a));if(o){if(o=o.slice(1).trim(),!o.startsWith(`token(`)&&o.endsWith(`)`)&&(o=o.slice(0,-1)),o.includes(`token(`)){let e=Db(o,t);e&&(o=e.slice(0,-1))}else if(o){let e=t(o);e&&(o=e)}}let r=n.at(-1);o?r?.trim()?n+=e.slice(0,-1)+(`, `+o+`)`):n+=o:n+=e||`)`,a=``,o=``,i=`char`;continue}i===`token`&&(a+=c),i===`fallback`&&(o+=c);continue}let l=e.indexOf(`token(`,r);if(l!==-1){let t=l+6;n+=e.slice(r,l),r=t,i=`token`,s.push(i);continue}n+=c,r++}return n},Ob=e=>{let t=0,n=[`(`];for(;t<e.length;){let r=e[t];if(r===`(`)n.push(r);else if(r===`)`&&(n.pop(),n.length===0))return t;t++}return t};function kb(e){let t={};return e.forEach((e,n)=>{e instanceof Map?t[n]=Object.fromEntries(e):t[n]=e}),t}var Ab=/({([^}]*)})/g,bee=/[{}]/g,xee=/\w+\.\w+/,jb=e=>{if(!Kt(e))return[];let t=e.match(Ab);return t?t.map(e=>e.replace(bee,``).trim()):[]},See=e=>Ab.test(e);function Mb(e){if(!e.extensions?.references)return e.extensions?.cssVar?.ref??e.value;let t=e.extensions.references??{},n=e.value,r=Object.keys(t);for(let e=0;e<r.length;e++){let i=r[e],a=t[i];if(a.extensions.conditions)continue;let o=Mb(a);n=n.replace(`{${i}}`,o)}return e.value=n,delete e.extensions.references,e.value}function Nb(e,t){if(t==null||!Array.isArray(t))return t;switch(e){case`easings`:return`cubic-bezier(${t.join(`, `)})`;case`animations`:case`fonts`:case`gradients`:case`shadows`:return t.join(`, `);default:return t}}function Cee(e,t){let n={};for(let r in t)n[r]=Nb(e,t[r]);return n}var wee=/calc/g;function Pb(e){return Gt(e)&&e.reference?e.reference:String(e)}var Fb=(e,...t)=>t.map(Pb).join(` ${e} `).replace(wee,``),Ib=(...e)=>`calc(${Fb(`+`,...e)})`,Lb=(...e)=>`calc(${Fb(`-`,...e)})`,Rb=(...e)=>`calc(${Fb(`*`,...e)})`,zb=(...e)=>`calc(${Fb(`/`,...e)})`,Bb=e=>{let t=Pb(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith(`-`)?String(t).slice(1):`-${t}`:Rb(t,-1)},Vb=Object.assign(e=>({add:(...t)=>Vb(Ib(e,...t)),subtract:(...t)=>Vb(Lb(e,...t)),multiply:(...t)=>Vb(Rb(e,...t)),divide:(...t)=>Vb(zb(e,...t)),negate:()=>Vb(Bb(e)),toString:()=>e.toString()}),{add:Ib,subtract:Lb,multiply:Rb,divide:zb,negate:Bb}),Tee={enforce:`pre`,transform(e){let{prefix:t,allTokens:n,formatCssVar:r,formatTokenName:i,registerToken:a}=e;n.filter(({extensions:e})=>e.category===`spacing`).forEach(e=>{let n=e.path.slice(),o=r(n,t);if(Kt(e.value)&&e.value===`0rem`)return;let s=[...e.path],c=s[s.length-1];c!=null&&(s[s.length-1]=`-${c}`);let l={...e,value:Vb.negate(o.ref),name:i(s),path:s,extensions:{...e.extensions,negative:!0,prop:`-${e.extensions.prop}`,originalPath:n}};a(l)})}},Eee=new Set([`spacing`,`sizes`,`borderWidths`,`fontSizes`,`radii`]),Dee=[Tee,{enforce:`post`,transform(e){let{allTokens:t,registerToken:n,formatTokenName:r}=e,i=t.filter(({extensions:e})=>e.category===`colors`),a=new Map,o=new Map;i.forEach(e=>{let{colorPalette:t}=e.extensions;t&&(t.keys.forEach(e=>{a.set(r(e),e)}),t.roots.forEach(n=>{let i=r(n),s=o.get(i)||[];if(s.push(e),o.set(i,s),e.extensions.default&&n.length===1){let e=t.keys[0]?.filter(Boolean);if(!e.length)return;let i=n.concat(e);a.set(r(i),[])}}))}),a.forEach(e=>{let t=[`colors`,`colorPalette`,...e].filter(Boolean),i=r(t),a={name:i,value:i,originalValue:i,path:t,extensions:{condition:`base`,originalPath:t,category:`colors`,prop:r(t.slice(1)),virtual:!0}};n(a,`pre`)})}},{enforce:`post`,transform(e){e.allTokens.filter(e=>Eee.has(e.extensions.category)&&!e.extensions.negative).forEach(e=>{Object.assign(e.extensions,{pixelValue:Sy(e.value)})})}},{enforce:`post`,transform(e){let t=[],n=[];e.allTokens.forEach(e=>{e.value===``?t.push(e):n.push(e)}),e.allTokens.splice(0,e.allTokens.length,...n),t.forEach(t=>{if(e.tokenMap.get(t.name)!==t)return;let n=e.allTokens.find(e=>e.name===t.name);if(!n){e.tokenMap.delete(t.name);return}t.extensions.conditions&&!n.extensions.conditions&&(n.extensions.conditions=t.extensions.conditions),e.tokenMap.set(t.name,n)})}}],Oee=[{type:`extensions`,enforce:`pre`,name:`tokens/css-var`,transform(e,t){let{prefix:n,formatCssVar:r}=t,{negative:i,originalPath:a}=e.extensions;return{cssVar:r((i?a:e.path).filter(Boolean),n)}}},{enforce:`post`,type:`value`,name:`tokens/conditionals`,transform(e,t){let{prefix:n,formatCssVar:r,getByName:i}=t,a=jb(e.value);return a.length&&a.forEach(t=>{if(!i(t))return;let a=r(t.split(`.`),n);e.value=e.value.replaceAll(`{${t}}`,a.ref)}),e.value}},{type:`extensions`,enforce:`pre`,name:`tokens/colors/colorPalette`,match(e){return e.extensions.category===`colors`&&!e.extensions.virtual},transform(e,t){let n=e.path.slice();if(n.pop(),n.shift(),n.length===0){let t=[...e.path];t.shift(),n=t}if(n.length===0)return{};let r=n.reduce((e,t,n,r)=>{let i=r.slice(0,n+1);return e.push(i),e},[]),i=n[0],a=t.formatTokenName(n),o=e.path.slice(e.path.indexOf(i)+1).reduce((e,t,n,r)=>(e.push(r.slice(n)),e),[]);return o.length===0&&o.push([``]),{colorPalette:{value:a,roots:r,keys:o}}}}],Hb=e=>Gt(e)&&Object.prototype.hasOwnProperty.call(e,`value`);function kee(e){return e?{breakpoints:Mv(e,e=>({value:e})),sizes:ly(e,(e,t)=>[`breakpoint-${e}`,{value:t}])}:{breakpoints:{},sizes:{}}}function Aee(e){let{prefix:t=``,tokens:n={},semanticTokens:r={},breakpoints:i={}}=e,a=e=>e.join(`.`),o=(e,t)=>Yv(e.join(`-`),{prefix:t}),s=[],c=new Map,l=new Map,u=new Map,d=new Map,f=new Map,p=new Map,m=new Map,h=new Map,g=[];function _(e,t){s.push(e),(e.extensions.condition===`base`||!c.has(e.name))&&c.set(e.name,e),t&&h.forEach(n=>{n.enforce===t&&ie(n,e)})}let v=kee(i),y=Wt({...n,breakpoints:v.breakpoints,sizes:{...n.sizes,...v.sizes}});function b(){jv(y,(e,t)=>{let n=t.includes(`DEFAULT`);t=Ub(t);let r=t[0],i=a(t),o=Nb(r,(Kt(e)?{value:e}:e).value),s={value:o,originalValue:o,name:i,path:t,extensions:{condition:`base`,originalPath:t,category:r,prop:a(t.slice(1))}};n&&(s.extensions.default=!0),_(s)},{stop:Hb}),jv(r,(e,t)=>{let n=t.includes(`DEFAULT`);t=Wb(Ub(t));let r=t[0],i=a(t),o=Cee(r,(Kt(e.value)||Array.isArray(e.value)?{value:{base:e.value}}:e).value),s={value:o.base??``,originalValue:o.base??``,name:i,path:t,extensions:{originalPath:t,category:r,conditions:o,condition:`base`,prop:a(t.slice(1))}};n&&(s.extensions.default=!0),_(s)},{stop:Hb})}function x(e){return c.get(e)}function S(e){let{condition:t}=e.extensions;t&&(l.has(t)||l.set(t,new Set),l.get(t).add(e))}function C(e){let{category:t,prop:n,condition:r,conditions:i}=e.extensions;if(!t)return;m.has(t)||m.set(t,new Map);let a=m.get(t),o=a.get(n);if(r==null||r===`base`){a.set(n,e);return}i&&!o&&a.set(n,e)}function w(e){let{condition:t,negative:n,virtual:r,cssVar:i}=e.extensions;!n&&!r&&t&&i&&e.value!==``&&(u.has(t)||u.set(t,new Map),u.get(t).set(i.var,e.value))}function T(e){let{category:t,prop:n,cssVar:r,negative:i}=e.extensions;if(!t)return;p.has(t)||p.set(t,new Map);let a=i?e.extensions.conditions?e.originalValue:e.value:r.ref;p.get(t).set(n,a),f.set([t,n].join(`.`),a)}function E(e){let{colorPalette:t,virtual:n,default:r}=e.extensions;t&&!n&&t.roots.forEach(n=>{let i=a(n);d.has(i)||d.set(i,new Map);let o=Mee([...e.path],[...n]),s=x(a(o));if(!s||!s.extensions.cssVar)return;let{var:c}=s.extensions.cssVar;if(d.get(i).set(c,e.extensions.cssVar.ref),r&&n.length===1){let r=x(a([`colors`,`colorPalette`]));if(!r)return;let i=x(a(e.path));if(!i)return;let o=t.keys[0]?.filter(Boolean);if(!o.length)return;let s=a(n.concat(o));d.has(s)||d.set(s,new Map),d.get(s).set(r.extensions.cssVar.var,i.extensions.cssVar.ref)}})}let D={};function ee(){s.forEach(e=>{S(e),C(e),w(e),T(e),E(e)}),D=kb(p)}let O=(e,t)=>{if(!e||typeof e!=`string`)return{invalid:!0,value:e};let[n,r]=e.split(`/`);if(!n||!r)return{invalid:!0,value:n};let i=t(n),a=x(`opacity.${r}`)?.value;if(!a&&isNaN(Number(r)))return{invalid:!0,value:n};let o=a?Number(a)*100+`%`:`${r}%`,s=i??n;return{invalid:!1,color:s,value:`color-mix(in srgb, ${s} ${o}, transparent)`}},k=gy((e,t)=>f.get(e)??t),te={prefix:t,allTokens:s,tokenMap:c,registerToken:_,getByName:x,formatTokenName:a,formatCssVar:o,flatMap:f,cssVarMap:u,categoryMap:m,colorPaletteMap:d,getVar:k,getCategoryValues:gy(e=>D[e]||null),expandReferenceInValue:gy(e=>Db(e,e=>{if(e){if(e.includes(`/`)){let t=O(e,e=>k(e));if(t.invalid)throw Error(`Invalid color mix at `+e+`: `+t.value);return t.value}return k(e)||(xee.test(e)?Eb(e):e)}}))};function ne(...e){e.forEach(e=>{h.set(e.name,e)})}function re(...e){g.push(...e)}function ie(e,t){if(t.extensions.references||qt(e.match)&&!e.match(t))return;let n=(t=>e.transform(t,te))(t);switch(!0){case e.type===`extensions`:Object.assign(t.extensions,n);break;case e.type===`value`:t.value=n;break;default:t[e.type]=n}}function A(e){g.forEach(t=>{t.enforce===e&&t.transform(te)})}function ae(e){h.forEach(t=>{t.enforce===e&&s.forEach(e=>{ie(t,e)})})}function oe(){s.slice().forEach(e=>{let t=jee(e);t&&t.length!==0&&t.forEach(e=>{_(e)})})}function se(e){let t=jb(e),n=[];for(let e=0;e<t.length;e++){let r=x(t[e]);r&&n.push(r)}return n}function ce(){s.forEach(e=>{if(!See(e.value))return;let t=se(e.value);e.extensions.references=t.reduce((e,t)=>(e[t.name]=t,e),{})})}function j(){s.forEach(e=>{Mb(e)})}function le(){A(`pre`),ae(`pre`),oe(),ce(),j(),A(`post`),ae(`post`),ee()}return b(),ne(...Oee),re(...Dee),le(),te}function Ub(e){return e[0]===`DEFAULT`?e:e.filter(e=>e!==`DEFAULT`)}function Wb(e){return e.filter(e=>e!==`base`)}function jee(e){if(!e.extensions.conditions)return;let{conditions:t}=e.extensions,n=[];return jv(t,(t,r)=>{let i=Wb(r);if(!i.length)return;let a={...e,value:t,extensions:{...e.extensions,condition:i.join(`:`)}};n.push(a)}),n}function Mee(e,t){let n=e.findIndex((n,r)=>t.every((t,n)=>e[r+n]===t));return n===-1?e:(e.splice(n,t.length),e.splice(n,0,`colorPalette`),e)}Cb()([`aspectRatios`,`zIndex`,`opacity`,`colors`,`fonts`,`fontSizes`,`fontWeights`,`lineHeights`,`letterSpacings`,`sizes`,`shadows`,`spacing`,`radii`,`cursor`,`borders`,`borderWidths`,`borderStyles`,`durations`,`easings`,`animations`,`blurs`,`gradients`,`breakpoints`,`assets`]);function Gb(e){return e}function Nee(e){return ly(e,(e,t)=>[e,Gb(t)])}function Pee(e){let t=Nee(e.config),n=e.tokens,r=new Map,i=new Map;function a(e,n){t[e]=Gb(n),o(e,n)}let o=(e,t)=>{let n=h(t);n&&(i.set(e,n),d(e,t))},s=()=>{for(let[e,n]of Object.entries(t))n&&o(e,n)},c=()=>{for(let[e,n]of Object.entries(t)){let{shorthand:t}=n??{};t&&(Array.isArray(t)?t:[t]).forEach(t=>r.set(t,e))}},l=()=>{let e=kb(n.colorPaletteMap);a(`colorPalette`,{values:Object.keys(e),transform:gy(t=>e[t])})},u=new Map,d=(e,t)=>{if(!t)return;let n=h(t,e=>`type:Tokens["${e}"]`);if(typeof n==`object`&&n.type){u.set(e,new Set([`type:${n.type}`]));return}if(n){let t=new Set(Object.keys(n));u.set(e,t)}let r=u.get(e)??new Set;t.property&&u.set(e,r.add(`CssProperties["${t.property}"]`))},f=()=>{for(let[e,n]of Object.entries(t))n&&d(e,n)},p=(e,t)=>{let n=u.get(e)??new Set;u.set(e,new Set([...n,...t]))},m=()=>{let e=new Map;for(let[t,n]of u.entries()){if(n.size===0){e.set(t,[`string`]);continue}let r=Array.from(n).map(e=>e.startsWith(`CssProperties`)?e:e.startsWith(`type:`)?e.replace(`type:`,``):JSON.stringify(e));e.set(t,r)}return e},h=(e,t)=>{let{values:r}=e,i=e=>{let n=t?.(e);return n?{[n]:n}:void 0};if(Kt(r))return i?.(r)??n.getCategoryValues(r)??My;if(Array.isArray(r)){let e={};for(let t=0;t<r.length;t++)e[r[t]]=r[t];return e}return qt(r)?r(t?i:n.getCategoryValues):r},g=gy((e,t)=>({[e]:e.startsWith(`--`)?n.getVar(t,t):t})),_=Object.assign(n.getVar,{raw:e=>n.getByName(e)}),v=gy((e,r)=>{let a=x(e);Kt(r)&&!r.includes(`_EMO_`)&&(r=n.expandReferenceInValue(r));let o=t[a];if(!o)return g(a,r);let s=i.get(a)?.[r];return o.transform?o.transform(s??r,{raw:r,token:_,utils:{colorMix:e=>Tv(e,_)}}):g(e,s??r)});function y(){c(),l(),s(),f()}y();let b=r.size>0,x=gy(e=>r.get(e)??e);return{keys:()=>[...Array.from(r.keys()),...Object.keys(t)],hasShorthand:b,transform:v,shorthands:r,resolveShorthand:x,register:a,getTypes:m,addPropertyType:p}}function Kb(...e){let t=Fv(...e),{theme:n={},utilities:r={},globalCss:i={},cssVarsRoot:a=`:where(:root, :host)`,cssVarsPrefix:o=`chakra`,preflight:s}=t,c=mb(t),l=Aee({breakpoints:n.breakpoints,tokens:n.tokens,semanticTokens:n.semanticTokens,prefix:o}),u=Ty(n.breakpoints??My),d=jy({conditions:t.conditions??My,breakpoints:u}),f=Pee({config:r,tokens:l});function p(){let{textStyles:e,layerStyles:t,animationStyles:r}=n,i=Wt({textStyle:e,layerStyle:t,animationStyle:r});for(let[e,t]of Object.entries(i)){let n=uy(t??My,qb);f.register(e,{values:Object.keys(n),transform(e){return y(n[e])}})}}p(),f.addPropertyType(`animationName`,Object.keys(n.keyframes??My));let m=new Set([`css`,...f.keys(),...d.keys()]),h=gy(e=>m.has(e)||cy(e)),g=e=>{if(Array.isArray(e)){let t=Py();for(let n=0;n<e.length;n++){let r=e[n];if(r!=null){let e=d.breakpoints[n];t[e]=r}}return t}return e},_=hb({utility:f,normalize:g}),v=_b({conditions:d,isValidProperty:h}),y=ib({transform:f.transform,conditions:d,normalize:_}),b=lb({css:y,conditions:d,normalize:_,layers:c}),x=Sb({cva:b});function S(){let e={};for(let[t,n]of l.cssVarMap.entries()){let r=Object.fromEntries(n);if(Object.keys(r).length===0)continue;let i=t===`base`?a:d.resolve(t),o=i.startsWith(`@`);kv(e,y(v({[i]:o?{[a]:r}:r})))}return c.wrap(`tokens`,e)}function C(){let e=ly(n.keyframes??My,(e,t)=>[`@keyframes ${e}`,t]),t=Object.assign({},e,y(v(i)));return c.wrap(`base`,t)}function w(e){return an(e,h)}function T(){let e=gb({preflight:s});return c.wrap(`reset`,e)}let E=Fee(l),D=(e,t)=>E.get(e)?.value||t;D.var=(e,t)=>E.get(e)?.variable||t;function ee(e,t){return n.recipes?.[e]??t}function O(e,t){return n.slotRecipes?.[e]??t}let k=new Map,te=new Map;function ne(e,t){let n=k.get(e);return n||(n=b(ee(e,t??My)),k.set(e,n)),n}function re(e,t){let n=te.get(e);return n||(n=x(O(e,t??My)),te.set(e,n)),n}function ie(e){return Object.hasOwnProperty.call(n.recipes??My,e)}function A(e){return Object.hasOwnProperty.call(n.slotRecipes??My,e)}function ae(e){return ie(e)||A(e)}return{$$chakra:!0,_config:t,_global:[T(),C(),S()],breakpoints:u,tokens:l,conditions:d,utility:f,token:D,properties:m,layers:c,isValidProperty:h,splitCssProps:w,normalizeValue:g,getTokenCss:S,getGlobalCss:C,getPreflightCss:T,css:y,cva:b,sva:x,getRecipe:ee,getSlotRecipe:O,getRecipeFn:ne,getSlotRecipeFn:re,hasRecipe:ae,isRecipe:ie,isSlotRecipe:A,query:{layerStyles:Jb(n.layerStyles??My),textStyles:Jb(n.textStyles??My),animationStyles:Jb(n.animationStyles??My),tokens:Yb(l,Object.keys(n.tokens??My),(e,t)=>!e.extensions.conditions&&!t.includes(`colorPalette`)),semanticTokens:Yb(l,Object.keys(n.semanticTokens??My),e=>!!e.extensions.conditions),keyframes:Xb(n.keyframes??My),breakpoints:Xb(n.breakpoints??My)}}}function Fee(e){let t=new Map,n=new Set(e.allTokens.map(e=>e.name));for(let r of n){let n=e.getByName(r);if(!n?.extensions.cssVar)continue;let{cssVar:i,virtual:a,conditions:o}=n.extensions,s=o||a?i.ref:n.value;t.set(r,{value:s,variable:i.ref})}return t}var qb=e=>Gt(e)&&`value`in e,Jb=e=>({list(){return Object.keys(uy(e,qb))},search(e){return this.list().filter(t=>t.includes(e))}}),Yb=(e,t,n)=>({categoryKeys:t,list(t){let r=e.categoryMap.get(t),i=r?[...r.entries()]:[],a=[];for(let e=0;e<i.length;e++){let[t,r]=i[e];n(r,t)&&a.push(t)}return a},search(e,t){return this.list(e).filter(e=>e.includes(t))}}),Xb=e=>({list(){return Object.keys(e)},search(e){return this.list().filter(t=>t.includes(e))}}),Zb={sm:`480px`,md:`768px`,lg:`1024px`,xl:`1280px`,"2xl":`1536px`},Qb=`var(--chakra-empty, )`,$b=zv({"*":{fontFeatureSettings:`"cv11"`,"--ring-inset":Qb,"--ring-offset-width":`0px`,"--ring-offset-color":`#fff`,"--ring-color":`rgba(66, 153, 225, 0.6)`,"--ring-offset-shadow":`0 0 #0000`,"--ring-shadow":`0 0 #0000`,...Object.fromEntries([`brightness`,`contrast`,`grayscale`,`hue-rotate`,`invert`,`saturate`,`sepia`,`drop-shadow`].map(e=>[`--${e}`,Qb])),...Object.fromEntries([`blur`,`brightness`,`contrast`,`grayscale`,`hue-rotate`,`invert`,`opacity`,`saturate`,`sepia`].map(e=>[`--backdrop-${e}`,Qb])),"--global-font-mono":`fonts.mono`,"--global-font-body":`fonts.body`,"--global-color-border":`colors.border`},html:{color:`fg`,bg:`bg`,lineHeight:`1.5`,colorPalette:`gray`},"*::placeholder, *[data-placeholder]":{color:`fg.muted/80`},"*::selection":{bg:`colorPalette.emphasized/80`}}),ex=Uv({"fill.muted":{value:{background:`colorPalette.muted`,color:`colorPalette.fg`}},"fill.subtle":{value:{background:`colorPalette.subtle`,color:`colorPalette.fg`}},"fill.surface":{value:{background:`colorPalette.subtle`,color:`colorPalette.fg`,boxShadow:`0 0 0px 1px var(--shadow-color)`,boxShadowColor:`colorPalette.muted`}},"fill.solid":{value:{background:`colorPalette.solid`,color:`colorPalette.contrast`}},"outline.subtle":{value:{color:`colorPalette.fg`,boxShadow:`inset 0 0 0px 1px var(--shadow-color)`,boxShadowColor:`colorPalette.subtle`}},"outline.solid":{value:{borderWidth:`1px`,borderColor:`colorPalette.solid`,color:`colorPalette.fg`}},"indicator.bottom":{value:{position:`relative`,"--indicator-color-fallback":`colors.colorPalette.solid`,_before:{content:`""`,position:`absolute`,bottom:`var(--indicator-offset-y, 0)`,insetInline:`var(--indicator-offset-x, 0)`,height:`var(--indicator-thickness, 2px)`,background:`var(--indicator-color, var(--indicator-color-fallback))`}}},"indicator.top":{value:{position:`relative`,"--indicator-color-fallback":`colors.colorPalette.solid`,_before:{content:`""`,position:`absolute`,top:`var(--indicator-offset-y, 0)`,insetInline:`var(--indicator-offset-x, 0)`,height:`var(--indicator-thickness, 2px)`,background:`var(--indicator-color, var(--indicator-color-fallback))`}}},"indicator.start":{value:{position:`relative`,"--indicator-color-fallback":`colors.colorPalette.solid`,_before:{content:`""`,position:`absolute`,insetInlineStart:`var(--indicator-offset-x, 0)`,insetBlock:`var(--indicator-offset-y, 0)`,width:`var(--indicator-thickness, 2px)`,background:`var(--indicator-color, var(--indicator-color-fallback))`}}},"indicator.end":{value:{position:`relative`,"--indicator-color-fallback":`colors.colorPalette.solid`,_before:{content:`""`,position:`absolute`,insetInlineEnd:`var(--indicator-offset-x, 0)`,insetBlock:`var(--indicator-offset-y, 0)`,width:`var(--indicator-thickness, 2px)`,background:`var(--indicator-color, var(--indicator-color-fallback))`}}},disabled:{value:{opacity:`0.5`,cursor:`not-allowed`}},none:{value:{}}}),tx=Hv({"slide-fade-in":{value:{transformOrigin:`var(--transform-origin)`,"&[data-placement^=top]":{animationName:`slide-from-bottom, fade-in`},"&[data-placement^=bottom]":{animationName:`slide-from-top, fade-in`},"&[data-placement^=left]":{animationName:`slide-from-right, fade-in`},"&[data-placement^=right]":{animationName:`slide-from-left, fade-in`}}},"slide-fade-out":{value:{transformOrigin:`var(--transform-origin)`,"&[data-placement^=top]":{animationName:`slide-to-bottom, fade-out`},"&[data-placement^=bottom]":{animationName:`slide-to-top, fade-out`},"&[data-placement^=left]":{animationName:`slide-to-right, fade-out`},"&[data-placement^=right]":{animationName:`slide-to-left, fade-out`}}},"scale-fade-in":{value:{transformOrigin:`var(--transform-origin)`,animationName:`scale-in, fade-in`}},"scale-fade-out":{value:{transformOrigin:`var(--transform-origin)`,animationName:`scale-out, fade-out`}}}),nx=Lv({className:`chakra-badge`,base:{display:`inline-flex`,alignItems:`center`,borderRadius:`l2`,gap:`1`,fontWeight:`medium`,fontVariantNumeric:`tabular-nums`,whiteSpace:`nowrap`,userSelect:`none`},variants:{variant:{solid:{bg:`colorPalette.solid`,color:`colorPalette.contrast`},subtle:{bg:`colorPalette.subtle`,color:`colorPalette.fg`},outline:{color:`colorPalette.fg`,"--outline-shadow-legacy":`colors.colorPalette.muted`,"--outline-shadow":`colors.colorPalette.border`,shadow:`inset 0 0 0px 1px var(--shadow-color)`,shadowColor:`var(--outline-shadow, var(--outline-shadow-legacy))`},surface:{bg:`colorPalette.subtle`,color:`colorPalette.fg`,shadow:`inset 0 0 0px 1px var(--shadow-color)`,shadowColor:`colorPalette.muted`},plain:{color:`colorPalette.fg`}},size:{xs:{textStyle:`2xs`,px:`1`,minH:`4`},sm:{textStyle:`xs`,px:`1.5`,minH:`5`},md:{textStyle:`sm`,px:`2`,minH:`6`},lg:{textStyle:`sm`,px:`2.5`,minH:`7`}}},defaultVariants:{variant:`subtle`,size:`sm`}}),rx=Lv({className:`chakra-button`,base:{display:`inline-flex`,appearance:`none`,alignItems:`center`,justifyContent:`center`,userSelect:`none`,position:`relative`,borderRadius:`l2`,whiteSpace:`nowrap`,verticalAlign:`middle`,borderWidth:`1px`,borderColor:`transparent`,cursor:`button`,flexShrink:`0`,outline:`0`,lineHeight:`1.2`,isolation:`isolate`,fontWeight:`medium`,transitionProperty:`common`,transitionDuration:`moderate`,focusVisibleRing:`outside`,_disabled:{layerStyle:`disabled`},_icon:{flexShrink:`0`}},variants:{size:{"2xs":{h:`6`,minW:`6`,textStyle:`xs`,px:`2`,gap:`1`,_icon:{width:`3.5`,height:`3.5`}},xs:{h:`8`,minW:`8`,textStyle:`xs`,px:`2.5`,gap:`1`,_icon:{width:`4`,height:`4`}},sm:{h:`9`,minW:`9`,px:`3.5`,textStyle:`sm`,gap:`2`,_icon:{width:`4`,height:`4`}},md:{h:`10`,minW:`10`,textStyle:`sm`,px:`4`,gap:`2`,_icon:{width:`5`,height:`5`}},lg:{h:`11`,minW:`11`,textStyle:`md`,px:`5`,gap:`3`,_icon:{width:`5`,height:`5`}},xl:{h:`12`,minW:`12`,textStyle:`md`,px:`5`,gap:`2.5`,_icon:{width:`5`,height:`5`}},"2xl":{h:`16`,minW:`16`,textStyle:`lg`,px:`7`,gap:`3`,_icon:{width:`6`,height:`6`}}},variant:{solid:{bg:`colorPalette.solid`,color:`colorPalette.contrast`,borderColor:`transparent`,_hover:{bg:`colorPalette.solid/90`},_expanded:{bg:`colorPalette.solid/90`}},subtle:{bg:`colorPalette.subtle`,color:`colorPalette.fg`,borderColor:`transparent`,_hover:{bg:`colorPalette.muted`},_expanded:{bg:`colorPalette.muted`}},surface:{bg:`colorPalette.subtle`,color:`colorPalette.fg`,shadow:`0 0 0px 1px var(--shadow-color)`,shadowColor:`colorPalette.muted`,_hover:{bg:`colorPalette.muted`},_expanded:{bg:`colorPalette.muted`}},outline:{borderWidth:`1px`,"--outline-color-legacy":`colors.colorPalette.muted`,"--outline-color":`colors.colorPalette.border`,borderColor:`var(--outline-color, var(--outline-color-legacy))`,color:`colorPalette.fg`,_hover:{bg:`colorPalette.subtle`},_expanded:{bg:`colorPalette.subtle`}},ghost:{bg:`transparent`,color:`colorPalette.fg`,_hover:{bg:`colorPalette.subtle`},_expanded:{bg:`colorPalette.subtle`}},plain:{color:`colorPalette.fg`}}},defaultVariants:{size:`md`,variant:`solid`}}),ix=Lv({className:`chakra-checkmark`,base:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,flexShrink:`0`,color:`white`,borderWidth:`1px`,borderColor:`transparent`,borderRadius:`l1`,cursor:`checkbox`,focusVisibleRing:`outside`,_icon:{boxSize:`full`},_invalid:{colorPalette:`red`,borderColor:`border.error`},_disabled:{opacity:`0.5`,cursor:`disabled`}},variants:{size:{xs:{boxSize:`3`},sm:{boxSize:`4`},md:{boxSize:`5`,p:`0.5`},lg:{boxSize:`6`,p:`0.5`}},variant:{solid:{borderColor:`border.emphasized`,"&:is([data-state=checked], [data-state=indeterminate])":{bg:`colorPalette.solid`,color:`colorPalette.contrast`,borderColor:`colorPalette.solid`}},outline:{borderColor:`border`,"&:is([data-state=checked], [data-state=indeterminate])":{color:`colorPalette.fg`,borderColor:`colorPalette.solid`}},subtle:{bg:`colorPalette.muted`,borderColor:`colorPalette.muted`,"&:is([data-state=checked], [data-state=indeterminate])":{color:`colorPalette.fg`}},plain:{"&:is([data-state=checked], [data-state=indeterminate])":{color:`colorPalette.fg`}},inverted:{borderColor:`border`,color:`colorPalette.fg`,"&:is([data-state=checked], [data-state=indeterminate])":{borderColor:`colorPalette.solid`}}},filled:{true:{bg:`bg`}}},defaultVariants:{variant:`solid`,size:`md`}}),{variants:ax,defaultVariants:ox}=nx,sx=Lv({className:`chakra-code`,base:{fontFamily:`mono`,alignItems:`center`,display:`inline-flex`,borderRadius:`l2`},variants:ax,defaultVariants:ox}),cx=Lv({className:`color-swatch`,base:{boxSize:`var(--swatch-size)`,shadow:`inset 0 0 0 1px rgba(0, 0, 0, 0.1)`,"--checker-size":`8px`,"--checker-bg":`colors.bg`,"--checker-fg":`colors.bg.emphasized`,background:`linear-gradient(var(--color), var(--color)), repeating-conic-gradient(var(--checker-fg) 0%, var(--checker-fg) 25%, var(--checker-bg) 0%, var(--checker-bg) 50%) 0% 50% / var(--checker-size) var(--checker-size) !important`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,flexShrink:`0`},variants:{size:{"2xs":{"--swatch-size":`sizes.3.5`},xs:{"--swatch-size":`sizes.4`},sm:{"--swatch-size":`sizes.4.5`},md:{"--swatch-size":`sizes.5`},lg:{"--swatch-size":`sizes.6`},xl:{"--swatch-size":`sizes.7`},"2xl":{"--swatch-size":`sizes.8`},inherit:{"--swatch-size":`inherit`},full:{"--swatch-size":`100%`}},shape:{square:{borderRadius:`none`},circle:{borderRadius:`full`},rounded:{borderRadius:`l1`}}},defaultVariants:{size:`md`,shape:`rounded`}}),lx=Lv({className:`chakra-container`,base:{position:`relative`,maxWidth:`8xl`,w:`100%`,mx:`auto`,px:{base:`4`,md:`6`,lg:`8`}},variants:{centerContent:{true:{display:`flex`,flexDirection:`column`,alignItems:`center`}},fluid:{true:{maxWidth:`full`}}}}),ux=Lv({className:`chakra-heading`,base:{fontFamily:`heading`,fontWeight:`semibold`},variants:{size:{xs:{textStyle:`xs`},sm:{textStyle:`sm`},md:{textStyle:`md`},lg:{textStyle:`lg`},xl:{textStyle:`xl`},"2xl":{textStyle:`2xl`},"3xl":{textStyle:`3xl`},"4xl":{textStyle:`4xl`},"5xl":{textStyle:`5xl`},"6xl":{textStyle:`6xl`},"7xl":{textStyle:`7xl`}}},defaultVariants:{size:`xl`}}),dx=Lv({className:`chakra-icon`,base:{display:`inline-block`,lineHeight:`1em`,flexShrink:`0`,color:`currentcolor`,verticalAlign:`middle`},variants:{size:{inherit:{},xs:{boxSize:`3`},sm:{boxSize:`4`},md:{boxSize:`5`},lg:{boxSize:`6`},xl:{boxSize:`7`},"2xl":{boxSize:`8`}}},defaultVariants:{size:`inherit`}}),fx=Lv({className:`chakra-input`,base:{width:`100%`,minWidth:`0`,outline:`0`,position:`relative`,appearance:`none`,textAlign:`start`,borderRadius:`l2`,_disabled:{layerStyle:`disabled`},height:`var(--input-height)`,minW:`var(--input-height)`,"--focus-color":`colors.colorPalette.focusRing`,"--error-color":`colors.border.error`,_invalid:{focusRingColor:`var(--error-color)`,borderColor:`var(--error-color)`}},variants:{size:{"2xs":{textStyle:`xs`,px:`2`,"--input-height":`sizes.7`},xs:{textStyle:`xs`,px:`2`,"--input-height":`sizes.8`},sm:{textStyle:`sm`,px:`2.5`,"--input-height":`sizes.9`},md:{textStyle:`sm`,px:`3`,"--input-height":`sizes.10`},lg:{textStyle:`md`,px:`4`,"--input-height":`sizes.11`},xl:{textStyle:`md`,px:`4.5`,"--input-height":`sizes.12`},"2xl":{textStyle:`lg`,px:`5`,"--input-height":`sizes.16`}},variant:{outline:{bg:`transparent`,borderWidth:`1px`,borderColor:`border`,focusVisibleRing:`inside`,focusRingColor:`var(--focus-color)`},subtle:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.muted`,focusVisibleRing:`inside`,focusRingColor:`var(--focus-color)`},flushed:{bg:`transparent`,borderBottomWidth:`1px`,borderBottomColor:`border`,borderRadius:`0`,px:`0`,_focusVisible:{borderColor:`var(--focus-color)`,boxShadow:`0px 1px 0px 0px var(--focus-color)`,_invalid:{borderColor:`var(--error-color)`,boxShadow:`0px 1px 0px 0px var(--error-color)`}}}}},defaultVariants:{size:`md`,variant:`outline`}}),px=Lv({className:`chakra-input-addon`,base:{flex:`0 0 auto`,width:`auto`,display:`flex`,alignItems:`center`,whiteSpace:`nowrap`,alignSelf:`stretch`,borderRadius:`l2`},variants:{size:fx.variants.size,variant:{outline:{borderWidth:`1px`,borderColor:`border`,bg:`bg.muted`},subtle:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.emphasized`},flushed:{borderBottom:`1px solid`,borderColor:`inherit`,borderRadius:`0`,px:`0`,bg:`transparent`}}},defaultVariants:{size:`md`,variant:`outline`}}),mx=Lv({className:`chakra-kbd`,base:{display:`inline-flex`,alignItems:`center`,fontWeight:`medium`,fontFamily:`mono`,flexShrink:`0`,whiteSpace:`nowrap`,wordSpacing:`-0.5em`,userSelect:`none`,px:`1`,borderRadius:`l2`},variants:{variant:{raised:{bg:`colorPalette.subtle`,color:`colorPalette.fg`,borderWidth:`1px`,borderBottomWidth:`2px`,borderColor:`colorPalette.muted`},outline:{borderWidth:`1px`,color:`colorPalette.fg`},subtle:{bg:`colorPalette.muted`,color:`colorPalette.fg`},plain:{color:`colorPalette.fg`}},size:{sm:{textStyle:`xs`,height:`4.5`},md:{textStyle:`sm`,height:`5`},lg:{textStyle:`md`,height:`6`}}},defaultVariants:{size:`md`,variant:`raised`}}),hx=Lv({className:`chakra-link`,base:{display:`inline-flex`,alignItems:`center`,outline:`none`,gap:`1.5`,cursor:`pointer`,borderRadius:`l1`,focusVisibleRing:`outside`},variants:{variant:{underline:{color:`colorPalette.fg`,textDecoration:`underline`,textUnderlineOffset:`3px`,textDecorationColor:`currentColor/20`},plain:{color:`colorPalette.fg`,_hover:{textDecoration:`underline`,textUnderlineOffset:`3px`,textDecorationColor:`currentColor/20`}}}},defaultVariants:{variant:`plain`}}),gx=Lv({className:`chakra-mark`,base:{bg:`transparent`,color:`inherit`,whiteSpace:`nowrap`},variants:{variant:{subtle:{bg:`colorPalette.subtle`,color:`inherit`},solid:{bg:`colorPalette.solid`,color:`colorPalette.contrast`},text:{fontWeight:`medium`},plain:{}}}}),_x=Lv({className:`chakra-radiomark`,base:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,verticalAlign:`top`,color:`white`,borderWidth:`1px`,borderColor:`transparent`,borderRadius:`full`,cursor:`radio`,_focusVisible:{outline:`2px solid`,outlineColor:`colorPalette.focusRing`,outlineOffset:`2px`},_invalid:{colorPalette:`red`,borderColor:`red.500`},_disabled:{opacity:`0.5`,cursor:`disabled`},"& .dot":{height:`100%`,width:`100%`,borderRadius:`full`,bg:`currentColor`,scale:`0.4`}},variants:{variant:{solid:{borderWidth:`1px`,borderColor:`border.emphasized`,_checked:{bg:`colorPalette.solid`,color:`colorPalette.contrast`,borderColor:`colorPalette.solid`}},subtle:{borderWidth:`1px`,bg:`colorPalette.muted`,borderColor:`colorPalette.muted`,color:`transparent`,_checked:{color:`colorPalette.fg`}},outline:{borderWidth:`1px`,borderColor:`inherit`,_checked:{color:`colorPalette.fg`,borderColor:`colorPalette.solid`},"& .dot":{scale:`0.6`}},inverted:{bg:`bg`,borderWidth:`1px`,borderColor:`inherit`,_checked:{color:`colorPalette.solid`,borderColor:`currentcolor`}}},size:{xs:{boxSize:`3`},sm:{boxSize:`4`},md:{boxSize:`5`},lg:{boxSize:`6`}},filled:{true:{bg:`bg`}}},defaultVariants:{variant:`solid`,size:`md`}}),vx={badge:nx,button:rx,code:sx,container:lx,heading:ux,input:fx,inputAddon:px,kbd:mx,link:hx,mark:gx,separator:Lv({className:`chakra-separator`,base:{display:`block`,borderColor:`border`},variants:{variant:{solid:{borderStyle:`solid`},dashed:{borderStyle:`dashed`},dotted:{borderStyle:`dotted`}},orientation:{vertical:{borderInlineStartWidth:`var(--separator-thickness)`},horizontal:{borderTopWidth:`var(--separator-thickness)`}},size:{xs:{"--separator-thickness":`0.5px`},sm:{"--separator-thickness":`1px`},md:{"--separator-thickness":`2px`},lg:{"--separator-thickness":`3px`}}},defaultVariants:{size:`sm`,variant:`solid`,orientation:`horizontal`}}),skeleton:Lv({className:`chakra-skeleton`,base:{},variants:{loading:{true:{borderRadius:`l2`,boxShadow:`none`,backgroundClip:`padding-box`,cursor:`default`,color:`transparent`,pointerEvents:`none`,userSelect:`none`,flexShrink:`0`,"&::before, &::after, *":{visibility:`hidden`}},false:{background:`unset`,animation:`fade-in var(--fade-duration, 0.1s) ease-out !important`}},variant:{pulse:{background:`bg.emphasized`,animation:`pulse`,animationDuration:`var(--duration, 1.2s)`},shine:{"--animate-from":`200%`,"--animate-to":`-200%`,"--start-color":`colors.bg.muted`,"--end-color":`colors.bg.emphasized`,backgroundImage:`linear-gradient(270deg,var(--start-color),var(--end-color),var(--end-color),var(--start-color))`,backgroundSize:`400% 100%`,animation:`bg-position var(--duration, 5s) ease-in-out infinite`},none:{animation:`none`}}},defaultVariants:{variant:`pulse`,loading:!0}}),skipNavLink:Lv({className:`chakra-skip-nav`,base:{display:`inline-flex`,bg:`bg.panel`,padding:`2.5`,borderRadius:`l2`,fontWeight:`semibold`,focusVisibleRing:`outside`,textStyle:`sm`,userSelect:`none`,border:`0`,height:`1px`,width:`1px`,margin:`-1px`,outline:`0`,overflow:`hidden`,position:`absolute`,clip:`rect(0 0 0 0)`,_focusVisible:{clip:`auto`,width:`auto`,height:`auto`,position:`fixed`,top:`6`,insetStart:`6`}}}),spinner:Lv({className:`chakra-spinner`,base:{display:`inline-block`,borderColor:`currentColor`,borderStyle:`solid`,borderWidth:`2px`,borderRadius:`full`,width:`var(--spinner-size)`,height:`var(--spinner-size)`,animation:`spin`,animationDuration:`slowest`,"--spinner-track-color":`transparent`,borderBottomColor:`var(--spinner-track-color)`,borderInlineStartColor:`var(--spinner-track-color)`},variants:{size:{inherit:{"--spinner-size":`1em`},xs:{"--spinner-size":`sizes.3`},sm:{"--spinner-size":`sizes.4`},md:{"--spinner-size":`sizes.5`},lg:{"--spinner-size":`sizes.8`},xl:{"--spinner-size":`sizes.10`}}},defaultVariants:{size:`md`}}),textarea:Lv({className:`chakra-textarea`,base:{width:`100%`,minWidth:`0`,outline:`0`,position:`relative`,appearance:`none`,textAlign:`start`,borderRadius:`l2`,_disabled:{layerStyle:`disabled`},"--focus-color":`colors.colorPalette.focusRing`,"--error-color":`colors.border.error`,_invalid:{focusRingColor:`var(--error-color)`,borderColor:`var(--error-color)`}},variants:{size:{xs:{textStyle:`xs`,px:`2`,py:`1.5`,scrollPaddingBottom:`1.5`},sm:{textStyle:`sm`,px:`2.5`,py:`2`,scrollPaddingBottom:`2`},md:{textStyle:`sm`,px:`3`,py:`2`,scrollPaddingBottom:`2`},lg:{textStyle:`md`,px:`4`,py:`3`,scrollPaddingBottom:`3`},xl:{textStyle:`md`,px:`4.5`,py:`3.5`,scrollPaddingBottom:`3.5`}},variant:{outline:{bg:`transparent`,borderWidth:`1px`,borderColor:`border`,focusVisibleRing:`inside`},subtle:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.muted`,focusVisibleRing:`inside`},flushed:{bg:`transparent`,borderBottomWidth:`1px`,borderBottomColor:`border`,borderRadius:`0`,px:`0`,_focusVisible:{borderColor:`var(--focus-color)`,boxShadow:`0px 1px 0px 0px var(--focus-color)`}}}},defaultVariants:{size:`md`,variant:`outline`}}),icon:dx,checkmark:ix,radiomark:_x,colorSwatch:cx},yx=Kv.colors({bg:{DEFAULT:{value:{_light:`{colors.white}`,_dark:`{colors.black}`}},subtle:{value:{_light:`{colors.gray.50}`,_dark:`{colors.gray.950}`}},muted:{value:{_light:`{colors.gray.100}`,_dark:`{colors.gray.900}`}},emphasized:{value:{_light:`{colors.gray.200}`,_dark:`{colors.gray.800}`}},inverted:{value:{_light:`{colors.black}`,_dark:`{colors.white}`}},panel:{value:{_light:`{colors.white}`,_dark:`{colors.gray.950}`}},error:{value:{_light:`{colors.red.50}`,_dark:`{colors.red.950}`}},warning:{value:{_light:`{colors.orange.50}`,_dark:`{colors.orange.950}`}},success:{value:{_light:`{colors.green.50}`,_dark:`{colors.green.950}`}},info:{value:{_light:`{colors.blue.50}`,_dark:`{colors.blue.950}`}}},fg:{DEFAULT:{value:{_light:`{colors.black}`,_dark:`{colors.gray.50}`}},muted:{value:{_light:`{colors.gray.600}`,_dark:`{colors.gray.400}`}},subtle:{value:{_light:`{colors.gray.400}`,_dark:`{colors.gray.500}`}},inverted:{value:{_light:`{colors.gray.50}`,_dark:`{colors.black}`}},error:{value:{_light:`{colors.red.500}`,_dark:`{colors.red.400}`}},warning:{value:{_light:`{colors.orange.600}`,_dark:`{colors.orange.300}`}},success:{value:{_light:`{colors.green.600}`,_dark:`{colors.green.300}`}},info:{value:{_light:`{colors.blue.600}`,_dark:`{colors.blue.300}`}}},border:{DEFAULT:{value:{_light:`{colors.gray.200}`,_dark:`{colors.gray.800}`}},muted:{value:{_light:`{colors.gray.100}`,_dark:`{colors.gray.900}`}},subtle:{value:{_light:`{colors.gray.50}`,_dark:`{colors.gray.950}`}},emphasized:{value:{_light:`{colors.gray.300}`,_dark:`{colors.gray.700}`}},inverted:{value:{_light:`{colors.gray.800}`,_dark:`{colors.gray.200}`}},error:{value:{_light:`{colors.red.500}`,_dark:`{colors.red.400}`}},warning:{value:{_light:`{colors.orange.500}`,_dark:`{colors.orange.400}`}},success:{value:{_light:`{colors.green.500}`,_dark:`{colors.green.400}`}},info:{value:{_light:`{colors.blue.500}`,_dark:`{colors.blue.400}`}}},gray:{contrast:{value:{_light:`{colors.white}`,_dark:`{colors.black}`}},fg:{value:{_light:`{colors.gray.800}`,_dark:`{colors.gray.200}`}},subtle:{value:{_light:`{colors.gray.100}`,_dark:`{colors.gray.900}`}},muted:{value:{_light:`{colors.gray.200}`,_dark:`{colors.gray.800}`}},emphasized:{value:{_light:`{colors.gray.300}`,_dark:`{colors.gray.700}`}},solid:{value:{_light:`{colors.gray.900}`,_dark:`{colors.white}`}},focusRing:{value:{_light:`{colors.gray.400}`,_dark:`{colors.gray.400}`}},border:{value:{_light:`{colors.gray.200}`,_dark:`{colors.gray.800}`}}},red:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.red.700}`,_dark:`{colors.red.300}`}},subtle:{value:{_light:`{colors.red.100}`,_dark:`{colors.red.900}`}},muted:{value:{_light:`{colors.red.200}`,_dark:`{colors.red.800}`}},emphasized:{value:{_light:`{colors.red.300}`,_dark:`{colors.red.700}`}},solid:{value:{_light:`{colors.red.600}`,_dark:`{colors.red.600}`}},focusRing:{value:{_light:`{colors.red.500}`,_dark:`{colors.red.500}`}},border:{value:{_light:`{colors.red.500}`,_dark:`{colors.red.400}`}}},orange:{contrast:{value:{_light:`white`,_dark:`black`}},fg:{value:{_light:`{colors.orange.700}`,_dark:`{colors.orange.300}`}},subtle:{value:{_light:`{colors.orange.100}`,_dark:`{colors.orange.900}`}},muted:{value:{_light:`{colors.orange.200}`,_dark:`{colors.orange.800}`}},emphasized:{value:{_light:`{colors.orange.300}`,_dark:`{colors.orange.700}`}},solid:{value:{_light:`{colors.orange.600}`,_dark:`{colors.orange.500}`}},focusRing:{value:{_light:`{colors.orange.500}`,_dark:`{colors.orange.500}`}},border:{value:{_light:`{colors.orange.500}`,_dark:`{colors.orange.400}`}}},green:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.green.700}`,_dark:`{colors.green.300}`}},subtle:{value:{_light:`{colors.green.100}`,_dark:`{colors.green.900}`}},muted:{value:{_light:`{colors.green.200}`,_dark:`{colors.green.800}`}},emphasized:{value:{_light:`{colors.green.300}`,_dark:`{colors.green.700}`}},solid:{value:{_light:`{colors.green.600}`,_dark:`{colors.green.600}`}},focusRing:{value:{_light:`{colors.green.500}`,_dark:`{colors.green.500}`}},border:{value:{_light:`{colors.green.500}`,_dark:`{colors.green.400}`}}},blue:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.blue.700}`,_dark:`{colors.blue.300}`}},subtle:{value:{_light:`{colors.blue.100}`,_dark:`{colors.blue.900}`}},muted:{value:{_light:`{colors.blue.200}`,_dark:`{colors.blue.800}`}},emphasized:{value:{_light:`{colors.blue.300}`,_dark:`{colors.blue.700}`}},solid:{value:{_light:`{colors.blue.600}`,_dark:`{colors.blue.600}`}},focusRing:{value:{_light:`{colors.blue.500}`,_dark:`{colors.blue.500}`}},border:{value:{_light:`{colors.blue.500}`,_dark:`{colors.blue.400}`}}},yellow:{contrast:{value:{_light:`black`,_dark:`black`}},fg:{value:{_light:`{colors.yellow.800}`,_dark:`{colors.yellow.300}`}},subtle:{value:{_light:`{colors.yellow.100}`,_dark:`{colors.yellow.900}`}},muted:{value:{_light:`{colors.yellow.200}`,_dark:`{colors.yellow.800}`}},emphasized:{value:{_light:`{colors.yellow.300}`,_dark:`{colors.yellow.700}`}},solid:{value:{_light:`{colors.yellow.300}`,_dark:`{colors.yellow.300}`}},focusRing:{value:{_light:`{colors.yellow.500}`,_dark:`{colors.yellow.500}`}},border:{value:{_light:`{colors.yellow.500}`,_dark:`{colors.yellow.500}`}}},teal:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.teal.700}`,_dark:`{colors.teal.300}`}},subtle:{value:{_light:`{colors.teal.100}`,_dark:`{colors.teal.900}`}},muted:{value:{_light:`{colors.teal.200}`,_dark:`{colors.teal.800}`}},emphasized:{value:{_light:`{colors.teal.300}`,_dark:`{colors.teal.700}`}},solid:{value:{_light:`{colors.teal.600}`,_dark:`{colors.teal.600}`}},focusRing:{value:{_light:`{colors.teal.500}`,_dark:`{colors.teal.500}`}},border:{value:{_light:`{colors.teal.500}`,_dark:`{colors.teal.400}`}}},purple:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.purple.700}`,_dark:`{colors.purple.300}`}},subtle:{value:{_light:`{colors.purple.100}`,_dark:`{colors.purple.900}`}},muted:{value:{_light:`{colors.purple.200}`,_dark:`{colors.purple.800}`}},emphasized:{value:{_light:`{colors.purple.300}`,_dark:`{colors.purple.700}`}},solid:{value:{_light:`{colors.purple.600}`,_dark:`{colors.purple.600}`}},focusRing:{value:{_light:`{colors.purple.500}`,_dark:`{colors.purple.500}`}},border:{value:{_light:`{colors.purple.500}`,_dark:`{colors.purple.400}`}}},pink:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.pink.700}`,_dark:`{colors.pink.300}`}},subtle:{value:{_light:`{colors.pink.100}`,_dark:`{colors.pink.900}`}},muted:{value:{_light:`{colors.pink.200}`,_dark:`{colors.pink.800}`}},emphasized:{value:{_light:`{colors.pink.300}`,_dark:`{colors.pink.700}`}},solid:{value:{_light:`{colors.pink.600}`,_dark:`{colors.pink.600}`}},focusRing:{value:{_light:`{colors.pink.500}`,_dark:`{colors.pink.500}`}},border:{value:{_light:`{colors.pink.500}`,_dark:`{colors.pink.400}`}}},cyan:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.cyan.700}`,_dark:`{colors.cyan.300}`}},subtle:{value:{_light:`{colors.cyan.100}`,_dark:`{colors.cyan.900}`}},muted:{value:{_light:`{colors.cyan.200}`,_dark:`{colors.cyan.800}`}},emphasized:{value:{_light:`{colors.cyan.300}`,_dark:`{colors.cyan.700}`}},solid:{value:{_light:`{colors.cyan.600}`,_dark:`{colors.cyan.600}`}},focusRing:{value:{_light:`{colors.cyan.500}`,_dark:`{colors.cyan.500}`}},border:{value:{_light:`{colors.cyan.500}`,_dark:`{colors.cyan.400}`}}}}),bx=Kv.radii({l1:{value:`{radii.xs}`},l2:{value:`{radii.sm}`},l3:{value:`{radii.md}`}}),xx=Kv.shadows({xs:{value:{_light:`0px 1px 2px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/20}`,_dark:`0px 1px 1px {black/64}, 0px 0px 1px inset {colors.gray.300/20}`}},sm:{value:{_light:`0px 2px 4px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/30}`,_dark:`0px 2px 4px {black/64}, 0px 0px 1px inset {colors.gray.300/30}`}},md:{value:{_light:`0px 4px 8px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/30}`,_dark:`0px 4px 8px {black/64}, 0px 0px 1px inset {colors.gray.300/30}`}},lg:{value:{_light:`0px 8px 16px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/30}`,_dark:`0px 8px 16px {black/64}, 0px 0px 1px inset {colors.gray.300/30}`}},xl:{value:{_light:`0px 16px 24px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/30}`,_dark:`0px 16px 24px {black/64}, 0px 0px 1px inset {colors.gray.300/30}`}},"2xl":{value:{_light:`0px 24px 40px {colors.gray.900/16}, 0px 0px 1px {colors.gray.900/30}`,_dark:`0px 24px 40px {black/64}, 0px 0px 1px inset {colors.gray.300/30}`}},inner:{value:{_light:`inset 0 2px 4px 0 {black/5}`,_dark:`inset 0 2px 4px 0 black`}},inset:{value:{_light:`inset 0 0 0 1px {black/5}`,_dark:`inset 0 0 0 1px {colors.gray.300/5}`}}}),Sx=Jc.extendWith(`itemBody`),Cx=B(`action-bar`).parts(`positioner`,`content`,`separator`,`selectionTrigger`,`closeTrigger`),wx=B(`alert`).parts(`title`,`description`,`root`,`indicator`,`content`),Tx=B(`breadcrumb`).parts(`link`,`currentLink`,`item`,`list`,`root`,`ellipsis`,`separator`),Ex=B(`blockquote`).parts(`root`,`icon`,`content`,`caption`),Dx=B(`card`).parts(`root`,`header`,`body`,`footer`,`title`,`description`),Ox=B(`checkbox-card`,[`root`,`control`,`label`,`description`,`addon`,`indicator`,`content`]),kx=B(`data-list`).parts(`root`,`item`,`itemLabel`,`itemValue`),Ax=zp.extendWith(`indicatorGroup`),jx=Bp.extendWith(`header`,`body`,`footer`,`backdrop`),Mx=Bp.extendWith(`header`,`body`,`footer`,`backdrop`),Nx=om.extendWith(`textarea`),Px=B(`empty-state`,[`root`,`content`,`indicator`,`title`,`description`]),Fx=sm.extendWith(`requiredIndicator`),Ix=lm.extendWith(`content`),Lx=um.extendWith(`itemContent`,`dropzoneContent`,`fileText`),Rx=B(`list`).parts(`root`,`item`,`indicator`),zx=gm.extendWith(`itemCommand`),Bx=B(`select`).parts(`root`,`field`,`indicator`),Vx=ym.extendWith(`header`,`body`,`footer`),Hx=Sm.extendWith(`itemAddon`,`itemIndicator`),Ux=Hx.extendWith(`itemContent`,`itemDescription`),Wx=Cm.extendWith(`itemIndicator`),Gx=Em.extendWith(`indicatorGroup`),Kx=Ip.extendWith(`indicatorGroup`,`empty`),qx=eh.extendWith(`markerIndicator`,`markerLabel`),Jx=B(`stat`).parts(`root`,`label`,`helpText`,`valueText`,`valueUnit`,`indicator`),Yx=B(`status`).parts(`root`,`indicator`),Xx=B(`steps`,[`root`,`list`,`item`,`trigger`,`indicator`,`separator`,`content`,`title`,`description`,`nextTrigger`,`prevTrigger`,`progress`]),Zx=sg.extendWith(`indicator`),Qx=B(`table`).parts(`root`,`header`,`body`,`row`,`columnHeader`,`cell`,`footer`,`caption`),$x=B(`toast`).parts(`root`,`title`,`description`,`indicator`,`closeTrigger`,`actionTrigger`),eS=B(`tabs`).parts(`root`,`trigger`,`list`,`content`,`contentGroup`,`indicator`),tS=B(`tag`).parts(`root`,`label`,`closeTrigger`,`startElement`,`endElement`),nS=B(`timeline`).parts(`root`,`item`,`content`,`separator`,`indicator`,`connector`,`title`,`description`),rS=Cp.extendWith(`channelText`),iS=B(`code-block`,[`root`,`content`,`title`,`header`,`footer`,`control`,`overlay`,`code`,`codeText`,`copyTrigger`,`copyIndicator`,`collapseTrigger`,`collapseIndicator`,`collapseText`]),aS=ih.extendWith(`resizeTriggerSeparator`,`resizeTriggerIndicator`);Ku.extendWith(`valueText`);var oS=mm,sS=U({className:`chakra-accordion`,slots:Sx.keys(),base:{root:{width:`full`,"--accordion-radius":`radii.l2`},item:{overflowAnchor:`none`},itemTrigger:{display:`flex`,alignItems:`center`,textAlign:`start`,width:`full`,outline:`0`,gap:`3`,fontWeight:`medium`,borderRadius:`var(--accordion-radius)`,_focusVisible:{outline:`2px solid`,outlineColor:`colorPalette.focusRing`},_disabled:{layerStyle:`disabled`}},itemBody:{pt:`var(--accordion-padding-y)`,pb:`calc(var(--accordion-padding-y) * 2)`},itemContent:{overflow:`hidden`,borderRadius:`var(--accordion-radius)`,_open:{animationName:`expand-height, fade-in`,animationDuration:`moderate`},_closed:{animationName:`collapse-height, fade-out`,animationDuration:`moderate`}},itemIndicator:{transition:`rotate 0.2s`,transformOrigin:`center`,color:`fg.subtle`,_open:{rotate:`180deg`},_icon:{width:`1.2em`,height:`1.2em`}}},variants:{variant:{outline:{item:{borderBottomWidth:`1px`}},subtle:{itemTrigger:{px:`var(--accordion-padding-x)`},itemContent:{px:`var(--accordion-padding-x)`},item:{borderRadius:`var(--accordion-radius)`,_open:{bg:`colorPalette.subtle`}}},enclosed:{root:{borderWidth:`1px`,borderRadius:`var(--accordion-radius)`,divideY:`1px`,overflow:`hidden`},itemTrigger:{px:`var(--accordion-padding-x)`},itemContent:{px:`var(--accordion-padding-x)`},item:{_open:{bg:`bg.subtle`}}},plain:{}},size:{sm:{root:{"--accordion-padding-x":`spacing.3`,"--accordion-padding-y":`spacing.2`},itemTrigger:{textStyle:`sm`,py:`var(--accordion-padding-y)`}},md:{root:{"--accordion-padding-x":`spacing.4`,"--accordion-padding-y":`spacing.2`},itemTrigger:{textStyle:`md`,py:`var(--accordion-padding-y)`}},lg:{root:{"--accordion-padding-x":`spacing.4.5`,"--accordion-padding-y":`spacing.2.5`},itemTrigger:{textStyle:`lg`,py:`var(--accordion-padding-y)`}}}},defaultVariants:{size:`md`,variant:`outline`}}),cS=U({className:`chakra-action-bar`,slots:Cx.keys(),base:{positioner:{position:`fixed`,display:`flex`,pointerEvents:`none`,insetInline:`0`,"--action-bar-offset":`spacing.4`},content:{bg:`bg.panel`,shadow:`md`,display:`flex`,alignItems:`center`,gap:`3`,borderRadius:`l3`,py:`2.5`,px:`3`,pointerEvents:`auto`,translate:`calc(-1 * var(--scrollbar-width) / 2) 0px`,_open:{animationName:`slide-from-bottom, fade-in`,animationDuration:`moderate`},_closed:{animationName:`slide-to-bottom, fade-out`,animationDuration:`faster`}},separator:{width:`1px`,height:`5`,bg:`border`},selectionTrigger:{display:`inline-flex`,alignItems:`center`,gap:`2`,alignSelf:`stretch`,textStyle:`sm`,px:`4`,py:`1`,borderRadius:`l2`,borderWidth:`1px`,borderStyle:`dashed`}},variants:{placement:{bottom:{positioner:{bottom:`calc(env(safe-area-inset-bottom) + var(--action-bar-offset))`,justifyContent:`center`}},"bottom-start":{positioner:{bottom:`calc(env(safe-area-inset-bottom) + var(--action-bar-offset))`,justifyContent:`flex-start`,ps:`var(--action-bar-offset)`}},"bottom-end":{positioner:{bottom:`calc(env(safe-area-inset-bottom) + var(--action-bar-offset))`,justifyContent:`flex-end`,pe:`var(--action-bar-offset)`}}}},defaultVariants:{placement:`bottom`}}),lS=U({slots:wx.keys(),className:`chakra-alert`,base:{root:{width:`full`,display:`flex`,alignItems:`flex-start`,position:`relative`,borderRadius:`l3`},title:{fontWeight:`medium`},description:{display:`inline`},indicator:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,flexShrink:`0`,width:`1em`,height:`1em`,_icon:{boxSize:`full`}},content:{display:`flex`,flex:`1`,gap:`1`}},variants:{status:{info:{root:{colorPalette:`blue`}},warning:{root:{colorPalette:`orange`}},success:{root:{colorPalette:`green`}},error:{root:{colorPalette:`red`}},neutral:{root:{colorPalette:`gray`}}},inline:{true:{content:{display:`inline-flex`,flexDirection:`row`,alignItems:`center`}},false:{content:{display:`flex`,flexDirection:`column`}}},variant:{subtle:{root:{bg:`colorPalette.subtle`,color:`colorPalette.fg`}},surface:{root:{bg:`colorPalette.subtle`,color:`colorPalette.fg`,shadow:`inset 0 0 0px 1px var(--shadow-color)`,shadowColor:`colorPalette.muted`},indicator:{color:`colorPalette.fg`}},outline:{root:{color:`colorPalette.fg`,shadow:`inset 0 0 0px 1px var(--shadow-color)`,"--outline-shadow-legacy":`colors.colorPalette.muted`,"--outline-shadow":`colors.colorPalette.border`,shadowColor:`var(--outline-shadow, var(--outline-shadow-legacy))`},indicator:{color:`colorPalette.fg`}},solid:{root:{bg:`colorPalette.solid`,color:`colorPalette.contrast`},indicator:{color:`colorPalette.contrast`}}},size:{sm:{root:{gap:`2`,px:`3`,py:`3`,textStyle:`xs`},indicator:{textStyle:`lg`}},md:{root:{gap:`3`,px:`4`,py:`4`,textStyle:`sm`},indicator:{textStyle:`xl`}},lg:{root:{gap:`3`,px:`4`,py:`4`,textStyle:`md`},indicator:{textStyle:`2xl`}}}},defaultVariants:{status:`info`,variant:`subtle`,size:`md`,inline:!1}}),uS=U({slots:Yc.keys(),className:`chakra-avatar`,base:{root:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,fontWeight:`medium`,position:`relative`,verticalAlign:`top`,flexShrink:`0`,userSelect:`none`,width:`var(--avatar-size)`,height:`var(--avatar-size)`,fontSize:`var(--avatar-font-size)`,borderRadius:`var(--avatar-radius)`,"&[data-group-item]":{borderWidth:`2px`,borderColor:`bg`}},image:{width:`100%`,height:`100%`,objectFit:`cover`,borderRadius:`var(--avatar-radius)`},fallback:{lineHeight:`1`,textTransform:`uppercase`,fontWeight:`medium`,fontSize:`var(--avatar-font-size)`,borderRadius:`var(--avatar-radius)`}},variants:{size:{full:{root:{"--avatar-size":`100%`,"--avatar-font-size":`100%`}},"2xs":{root:{"--avatar-font-size":`fontSizes.2xs`,"--avatar-size":`sizes.6`}},xs:{root:{"--avatar-font-size":`fontSizes.xs`,"--avatar-size":`sizes.8`}},sm:{root:{"--avatar-font-size":`fontSizes.sm`,"--avatar-size":`sizes.9`}},md:{root:{"--avatar-font-size":`fontSizes.md`,"--avatar-size":`sizes.10`}},lg:{root:{"--avatar-font-size":`fontSizes.md`,"--avatar-size":`sizes.11`}},xl:{root:{"--avatar-font-size":`fontSizes.lg`,"--avatar-size":`sizes.12`}},"2xl":{root:{"--avatar-font-size":`fontSizes.xl`,"--avatar-size":`sizes.16`}}},variant:{solid:{root:{bg:`colorPalette.solid`,color:`colorPalette.contrast`}},subtle:{root:{bg:`colorPalette.muted`,color:`colorPalette.fg`}},outline:{root:{color:`colorPalette.fg`,borderWidth:`1px`,"--outline-shadow-legacy":`colors.colorPalette.muted`,"--outline-shadow":`colors.colorPalette.border`,borderColor:`var(--outline-shadow, var(--outline-shadow-legacy))`}}},shape:{square:{},rounded:{root:{"--avatar-radius":`radii.l3`}},full:{root:{"--avatar-radius":`radii.full`}}},borderless:{true:{root:{"&[data-group-item]":{borderWidth:`0px`}}}}},defaultVariants:{size:`md`,shape:`full`,variant:`subtle`}}),dS=U({className:`chakra-blockquote`,slots:Ex.keys(),base:{root:{position:`relative`,display:`flex`,flexDirection:`column`,gap:`2`},caption:{textStyle:`sm`,color:`fg.muted`},icon:{boxSize:`5`}},variants:{justify:{start:{root:{alignItems:`flex-start`,textAlign:`start`}},center:{root:{alignItems:`center`,textAlign:`center`}},end:{root:{alignItems:`flex-end`,textAlign:`end`}}},variant:{subtle:{root:{paddingX:`5`,borderStartWidth:`4px`,borderStartColor:`colorPalette.muted`},icon:{color:`colorPalette.fg`}},solid:{root:{paddingX:`5`,borderStartWidth:`4px`,borderStartColor:`colorPalette.solid`},icon:{color:`colorPalette.solid`}},plain:{root:{paddingX:`5`},icon:{color:`colorPalette.solid`}}}},defaultVariants:{variant:`subtle`,justify:`start`}}),fS=U({className:`chakra-breadcrumb`,slots:Tx.keys(),base:{list:{display:`flex`,alignItems:`center`,wordBreak:`break-word`,color:`fg.muted`,listStyle:`none`},link:{outline:`0`,textDecoration:`none`,borderRadius:`l1`,focusRing:`outside`,display:`inline-flex`,alignItems:`center`,gap:`2`},item:{display:`inline-flex`,alignItems:`center`},separator:{color:`fg.muted`,opacity:`0.8`,_icon:{boxSize:`1em`},_rtl:{rotate:`180deg`}},ellipsis:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,_icon:{boxSize:`1em`}}},variants:{variant:{underline:{link:{color:`colorPalette.fg`,textDecoration:`underline`,textUnderlineOffset:`0.2em`,textDecorationColor:`colorPalette.muted`},currentLink:{color:`colorPalette.fg`}},plain:{link:{color:`fg.muted`,_hover:{color:`fg`}},currentLink:{color:`fg`}}},size:{sm:{list:{gap:`1`,textStyle:`xs`}},md:{list:{gap:`1.5`,textStyle:`sm`}},lg:{list:{gap:`2`,textStyle:`md`}}}},defaultVariants:{variant:`plain`,size:`md`}}),pS=U({className:`chakra-card`,slots:Dx.keys(),base:{root:{display:`flex`,flexDirection:`column`,position:`relative`,minWidth:`0`,wordWrap:`break-word`,borderRadius:`l3`,color:`fg`,textAlign:`start`},title:{fontWeight:`semibold`},description:{color:`fg.muted`,fontSize:`sm`},header:{paddingInline:`var(--card-padding)`,paddingTop:`var(--card-padding)`,display:`flex`,flexDirection:`column`,gap:`1.5`},body:{padding:`var(--card-padding)`,flex:`1`,display:`flex`,flexDirection:`column`},footer:{display:`flex`,alignItems:`center`,gap:`2`,paddingInline:`var(--card-padding)`,paddingBottom:`var(--card-padding)`}},variants:{size:{sm:{root:{"--card-padding":`spacing.4`},title:{textStyle:`md`}},md:{root:{"--card-padding":`spacing.6`},title:{textStyle:`lg`}},lg:{root:{"--card-padding":`spacing.7`},title:{textStyle:`xl`}}},variant:{elevated:{root:{bg:`bg.panel`,boxShadow:`md`}},outline:{root:{bg:`bg.panel`,borderWidth:`1px`,borderColor:`border`}},subtle:{root:{bg:`bg.muted`}}}},defaultVariants:{variant:`outline`,size:`md`}}),mS=U({className:`carousel`,slots:su.keys(),base:{root:{position:`relative`,display:`flex`,gap:`2`,_horizontal:{flexDirection:`column`},_vertical:{flexDirection:`row`}},item:{_horizontal:{width:`100%`},_vertical:{height:`100%`}},control:{display:`flex`,alignItems:`center`,_horizontal:{flexDirection:`row`,width:`100%`},_vertical:{flexDirection:`column`,height:`100%`}},indicatorGroup:{display:`flex`,justifyContent:`center`,gap:`3`,_horizontal:{flexDirection:`row`},_vertical:{flexDirection:`column`}},indicator:{width:`2.5`,height:`2.5`,borderRadius:`full`,bg:`colorPalette.subtle`,cursor:`button`,_current:{bg:`colorPalette.solid`}}},defaultVariants:{}}),hS=U({slots:Gu.keys(),className:`chakra-checkbox`,base:{root:{display:`inline-flex`,gap:`2`,alignItems:`center`,verticalAlign:`top`,position:`relative`},control:ix.base,label:{fontWeight:`medium`,userSelect:`none`,_disabled:{opacity:`0.5`}}},variants:{size:{xs:{root:{gap:`1.5`},label:{textStyle:`xs`},control:ix.variants?.size?.xs},sm:{root:{gap:`2`},label:{textStyle:`sm`},control:ix.variants?.size?.sm},md:{root:{gap:`2.5`},label:{textStyle:`sm`},control:ix.variants?.size?.md},lg:{root:{gap:`3`},label:{textStyle:`md`},control:ix.variants?.size?.lg}},variant:{outline:{control:ix.variants?.variant?.outline},solid:{control:ix.variants?.variant?.solid},subtle:{control:ix.variants?.variant?.subtle}}},defaultVariants:{variant:`solid`,size:`md`}}),gS=U({slots:Ox.keys(),className:`chakra-checkbox-card`,base:{root:{display:`flex`,flexDirection:`column`,userSelect:`none`,position:`relative`,borderRadius:`l2`,flex:`1`,focusVisibleRing:`outside`,_disabled:{opacity:`0.8`},_invalid:{outline:`2px solid`,outlineColor:`border.error`}},control:{display:`inline-flex`,flex:`1`,position:`relative`,borderRadius:`inherit`,justifyContent:`var(--checkbox-card-justify)`,alignItems:`var(--checkbox-card-align)`},label:{fontWeight:`medium`,display:`flex`,alignItems:`center`,gap:`2`,flex:`1`,_disabled:{opacity:`0.5`}},description:{opacity:`0.64`,textStyle:`sm`,_disabled:{opacity:`0.5`}},addon:{_disabled:{opacity:`0.5`}},indicator:ix.base,content:{display:`flex`,flexDirection:`column`,flex:`1`,gap:`1`,justifyContent:`var(--checkbox-card-justify)`,alignItems:`var(--checkbox-card-align)`}},variants:{size:{sm:{root:{textStyle:`sm`},control:{padding:`3`,gap:`1.5`},addon:{px:`3`,py:`1.5`,borderTopWidth:`1px`},indicator:ix.variants?.size.sm},md:{root:{textStyle:`sm`},control:{padding:`4`,gap:`2.5`},addon:{px:`4`,py:`2`,borderTopWidth:`1px`},indicator:ix.variants?.size.md},lg:{root:{textStyle:`md`},control:{padding:`4`,gap:`3.5`},addon:{px:`4`,py:`2`,borderTopWidth:`1px`},indicator:ix.variants?.size.lg}},variant:{surface:{root:{borderWidth:`1px`,borderColor:`border`,_checked:{bg:`colorPalette.subtle`,color:`colorPalette.fg`,borderColor:`colorPalette.muted`},_disabled:{bg:`bg.muted`}},indicator:ix.variants?.variant.solid},subtle:{root:{bg:`bg.muted`},control:{_checked:{bg:`colorPalette.muted`,color:`colorPalette.fg`}},indicator:ix.variants?.variant.plain},outline:{root:{borderWidth:`1px`,borderColor:`border`,_checked:{boxShadow:`inset 0 0 0 1px var(--shadow-color)`,boxShadowColor:`colorPalette.solid`,borderColor:`colorPalette.solid`}},indicator:ix.variants?.variant.solid},solid:{root:{borderWidth:`1px`,_checked:{bg:`colorPalette.solid`,color:`colorPalette.contrast`,borderColor:`colorPalette.solid`}},indicator:ix.variants?.variant.inverted}},justify:{start:{root:{"--checkbox-card-justify":`flex-start`}},end:{root:{"--checkbox-card-justify":`flex-end`}},center:{root:{"--checkbox-card-justify":`center`}}},align:{start:{root:{"--checkbox-card-align":`flex-start`},content:{textAlign:`start`}},end:{root:{"--checkbox-card-align":`flex-end`},content:{textAlign:`end`}},center:{root:{"--checkbox-card-align":`center`},content:{textAlign:`center`}}},orientation:{vertical:{control:{flexDirection:`column`}},horizontal:{control:{flexDirection:`row`}}}},defaultVariants:{size:`md`,variant:`outline`,align:`start`,orientation:`horizontal`}}),_S=U({slots:iS.keys(),className:`code-block`,base:{root:{colorPalette:`gray`,rounded:`var(--code-block-radius)`,overflow:`hidden`,bg:`bg`,color:`fg`,borderWidth:`1px`,"--code-block-max-height":`320px`,"--code-block-bg":`colors.bg`,"--code-block-fg":`colors.fg`,"--code-block-obscured-opacity":`0.5`,"--code-block-obscured-blur":`1px`,"--code-block-line-number-width":`sizes.3`,"--code-block-line-number-margin":`spacing.4`,"--code-block-highlight-bg":`{colors.teal.focusRing/20}`,"--code-block-highlight-border":`colors.teal.focusRing`,"--code-block-highlight-added-bg":`{colors.green.focusRing/20}`,"--code-block-highlight-added-border":`colors.green.focusRing`,"--code-block-highlight-removed-bg":`{colors.red.focusRing/20}`,"--code-block-highlight-removed-border":`colors.red.focusRing`},header:{display:`flex`,alignItems:`center`,gap:`2`,position:`relative`,px:`var(--code-block-padding)`,minH:`var(--code-block-header-height)`,mb:`calc(var(--code-block-padding) / 2 * -1)`},title:{display:`inline-flex`,alignItems:`center`,gap:`1.5`,flex:`1`,color:`fg.muted`},control:{gap:`1.5`,display:`inline-flex`,alignItems:`center`},footer:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:`2`,px:`var(--code-block-padding)`,minH:`var(--code-block-header-height)`},content:{position:`relative`,colorScheme:`dark`,borderBottomRadius:`var(--code-block-radius)`,maxHeight:`var(--code-block-max-height)`,"& ::selection":{bg:`blue.500/40`},_expanded:{maxHeight:`unset`}},overlay:{"--bg":`{colors.black/50}`,display:`flex`,alignItems:`flex-end`,justifyContent:`center`,padding:`4`,bgImage:`linear-gradient(0deg,var(--bg) 25%,transparent 100%)`,color:`white`,minH:`5rem`,pos:`absolute`,bottom:`0`,insetInline:`0`,zIndex:`1`,fontWeight:`medium`,_expanded:{display:`none`}},code:{fontFamily:`mono`,lineHeight:`tall`,whiteSpace:`pre`,counterReset:`line 0`,overflowX:`auto`,overflowY:`hidden`},codeText:{px:`var(--code-block-padding)`,py:`var(--code-block-padding)`,position:`relative`,display:`block`,width:`100%`,"&[data-has-focused]":{"& [data-line]:not([data-focused])":{transitionProperty:`opacity, filter`,transitionDuration:`moderate`,transitionTimingFunction:`ease-in-out`,opacity:`var(--code-block-obscured-opacity)`,filter:`blur(var(--code-block-obscured-blur))`},"&:hover":{"--code-block-obscured-opacity":`1`,"--code-block-obscured-blur":`0px`}},"&[data-has-line-numbers][data-plaintext]":{paddingInlineStart:`calc(var(--code-block-line-number-width) + var(--code-block-line-number-margin) + var(--code-block-padding))`},"& [data-line]":{position:`relative`,paddingInlineEnd:`var(--code-block-padding)`,"--highlight-bg":`var(--code-block-highlight-bg)`,"--highlight-border":`var(--code-block-highlight-border)`,"&[data-highlight], &[data-diff]":{display:`inline-block`,width:`full`,"&:after":{content:`''`,display:`block`,position:`absolute`,top:`0`,insetStart:`calc(var(--code-block-padding) * -1)`,insetEnd:`0px`,width:`calc(100% + var(--code-block-padding) * 2)`,height:`100%`,bg:`var(--highlight-bg)`,borderStartWidth:`2px`,borderStartColor:`var(--highlight-border)`}},"&[data-diff='added']":{"--highlight-bg":`var(--code-block-highlight-added-bg)`,"--highlight-border":`var(--code-block-highlight-added-border)`},"&[data-diff='removed']":{"--highlight-bg":`var(--code-block-highlight-removed-bg)`,"--highlight-border":`var(--code-block-highlight-removed-border)`}},"&[data-word-wrap]":{"&[data-plaintext], & [data-line]":{whiteSpace:`pre-wrap`,wordBreak:`break-all`}},"&[data-has-line-numbers]":{"--content":`counter(line)`,"& [data-line]:before":{content:`var(--content)`,counterIncrement:`line`,width:`var(--code-block-line-number-width)`,marginRight:`var(--code-block-line-number-margin)`,display:`inline-block`,textAlign:`end`,userSelect:`none`,whiteSpace:`nowrap`,opacity:.4},"& [data-diff='added']:before":{content:`'+'`},"& [data-diff='removed']:before":{content:`'-'`}}}},variants:{size:{sm:{root:{"--code-block-padding":`spacing.4`,"--code-block-radius":`radii.md`,"--code-block-header-height":`sizes.8`},title:{textStyle:`xs`},code:{fontSize:`xs`}},md:{root:{"--code-block-padding":`spacing.4`,"--code-block-radius":`radii.lg`,"--code-block-header-height":`sizes.10`},title:{textStyle:`xs`},code:{fontSize:`sm`}},lg:{root:{"--code-block-padding":`spacing.5`,"--code-block-radius":`radii.xl`,"--code-block-header-height":`sizes.12`},title:{textStyle:`sm`},code:{fontSize:`sm`}}}},defaultVariants:{size:`md`}}),vS=U({slots:qu.keys(),className:`chakra-collapsible`,base:{content:{overflow:`hidden`,_open:{animationName:`expand-height, fade-in`,animationDuration:`moderate`,"&[data-has-collapsed-size]":{animationName:`expand-height`}},_closed:{animationName:`collapse-height, fade-out`,animationDuration:`moderate`,"&[data-has-collapsed-size]":{animationName:`collapse-height`}}}}}),yS=U({className:`colorPicker`,slots:rS.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`},label:{color:`fg`,fontWeight:`medium`,textStyle:`sm`,_disabled:{opacity:`0.5`}},valueText:{textAlign:`start`},control:{display:`flex`,alignItems:`center`,flexDirection:`row`,gap:`2`,position:`relative`},swatchTrigger:{display:`flex`,alignItems:`center`,justifyContent:`center`},trigger:{display:`flex`,alignItems:`center`,justifyContent:`center`,flexDirection:`row`,flexShrink:`0`,gap:`2`,textStyle:`sm`,minH:`var(--input-height)`,minW:`var(--input-height)`,px:`1`,rounded:`l2`,_disabled:{opacity:`0.5`},"--focus-color":`colors.colorPalette.focusRing`,"&:focus-visible":{borderColor:`var(--focus-color)`,outline:`1px solid var(--focus-color)`},"&[data-fit-content]":{"--input-height":`unset`,px:`0`,border:`0`}},content:{display:`flex`,flexDirection:`column`,bg:`bg.panel`,borderRadius:`l3`,boxShadow:`lg`,width:`64`,p:`4`,gap:`3`,"--color-picker-z-index":`zIndex.popover`,zIndex:`calc(var(--color-picker-z-index) + var(--layer-index, 0))`,_open:{animationStyle:`slide-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`slide-fade-out`,animationDuration:`faster`}},area:{height:`180px`,borderRadius:`l2`,overflow:`hidden`},areaThumb:{borderRadius:`full`,height:`var(--thumb-size)`,width:`var(--thumb-size)`,borderWidth:`2px`,borderColor:`white`,shadow:`sm`,focusVisibleRing:`mixed`,focusRingColor:`white`},areaBackground:{height:`full`},channelSlider:{borderRadius:`l2`,flex:`1`},channelSliderTrack:{height:`var(--slider-height)`,borderRadius:`inherit`,boxShadow:`inset 0 0 0 1px rgba(0,0,0,0.1)`},channelText:{textStyle:`xs`,color:`fg.muted`,fontWeight:`medium`,textTransform:`capitalize`},swatchGroup:{display:`flex`,flexDirection:`row`,flexWrap:`wrap`,gap:`2`},swatch:{...cx.base,borderRadius:`l1`},swatchIndicator:{color:`white`,rounded:`full`},channelSliderThumb:{borderRadius:`full`,height:`var(--thumb-size)`,width:`var(--thumb-size)`,borderWidth:`2px`,borderColor:`white`,shadow:`sm`,transform:`translate(-50%, -50%)`,focusVisibleRing:`outside`,focusRingOffset:`1px`},channelInput:{...fx.base,"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:`none`,margin:0}},formatSelect:{textStyle:`xs`,textTransform:`uppercase`,borderWidth:`1px`,minH:`6`,focusRing:`inside`,rounded:`l2`},transparencyGrid:{borderRadius:`l2`},view:{display:`flex`,flexDirection:`column`,gap:`2`}},variants:{size:{"2xs":{channelInput:fx.variants?.size?.[`2xs`],swatch:{"--swatch-size":`sizes.4.5`},trigger:{"--input-height":`sizes.7`},area:{"--thumb-size":`sizes.3`},channelSlider:{"--slider-height":`sizes.3`,"--thumb-size":`sizes.3`}},xs:{channelInput:fx.variants?.size?.xs,swatch:{"--swatch-size":`sizes.5`},trigger:{"--input-height":`sizes.8`},area:{"--thumb-size":`sizes.3.5`},channelSlider:{"--slider-height":`sizes.3.5`,"--thumb-size":`sizes.3.5`}},sm:{channelInput:fx.variants?.size?.sm,swatch:{"--swatch-size":`sizes.6`},trigger:{"--input-height":`sizes.9`},area:{"--thumb-size":`sizes.3.5`},channelSlider:{"--slider-height":`sizes.3.5`,"--thumb-size":`sizes.3.5`}},md:{channelInput:fx.variants?.size?.md,swatch:{"--swatch-size":`sizes.7`},trigger:{"--input-height":`sizes.10`},area:{"--thumb-size":`sizes.3.5`},channelSlider:{"--slider-height":`sizes.3.5`,"--thumb-size":`sizes.3.5`}},lg:{channelInput:fx.variants?.size?.lg,swatch:{"--swatch-size":`sizes.7`},trigger:{"--input-height":`sizes.11`},area:{"--thumb-size":`sizes.3.5`},channelSlider:{"--slider-height":`sizes.3.5`,"--thumb-size":`sizes.3.5`}},xl:{channelInput:fx.variants?.size?.xl,swatch:{"--swatch-size":`sizes.8`},trigger:{"--input-height":`sizes.12`},area:{"--thumb-size":`sizes.3.5`},channelSlider:{"--slider-height":`sizes.3.5`,"--thumb-size":`sizes.3.5`}},"2xl":{channelInput:fx.variants?.size?.[`2xl`],swatch:{"--swatch-size":`sizes.10`},trigger:{"--input-height":`sizes.16`},area:{"--thumb-size":`sizes.3.5`},channelSlider:{"--slider-height":`sizes.3.5`,"--thumb-size":`sizes.3.5`}}},variant:{outline:{channelInput:fx.variants?.variant?.outline,trigger:{borderWidth:`1px`}},subtle:{channelInput:fx.variants?.variant?.subtle,trigger:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.muted`}}}},defaultVariants:{size:`md`,variant:`outline`}}),bS=U({className:`chakra-combobox`,slots:Kx.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`,width:`full`},label:{fontWeight:`medium`,userSelect:`none`,textStyle:`sm`,_disabled:{layerStyle:`disabled`}},control:{pos:`relative`,"--padding-factor":`1`,"--combobox-input-padding-end":`var(--combobox-input-padding-x)`,"&:has([data-part=trigger]), &:has([data-part=clear-trigger])":{"--combobox-input-padding-end":`calc(var(--combobox-input-height) * var(--padding-factor))`},"&:has([data-part=trigger]):has([data-part=clear-trigger]:not([hidden]))":{"--padding-factor":`1.5`}},input:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,background:`bg.panel`,width:`full`,minH:`var(--combobox-input-height)`,ps:`var(--combobox-input-padding-x)`,pe:`var(--combobox-input-padding-end)`,"--input-height":`var(--combobox-input-height)`,borderRadius:`l2`,outline:0,userSelect:`none`,textAlign:`start`,_placeholderShown:{color:`fg.muted`},_disabled:{layerStyle:`disabled`},"--focus-color":`colors.colorPalette.focusRing`,"--error-color":`colors.border.error`,_invalid:{focusRingColor:`var(--error-color)`,borderColor:`var(--error-color)`}},trigger:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,"--input-height":`var(--combobox-input-height)`},clearTrigger:{color:`fg.muted`,pointerEvents:`auto`,focusVisibleRing:`inside`,focusRingWidth:`2px`,rounded:`l1`},indicatorGroup:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:`1`,pos:`absolute`,insetEnd:`0`,top:`0`,bottom:`0`,px:`var(--combobox-input-padding-x)`,_icon:{boxSize:`var(--combobox-indicator-size)`},"[data-disabled] &":{opacity:.5}},content:{background:`bg.panel`,display:`flex`,flexDirection:`column`,"--combobox-z-index":`zIndex.popover`,zIndex:`calc(var(--combobox-z-index) + var(--layer-index, 0))`,borderRadius:`l2`,outline:0,maxH:`96`,overflowY:`auto`,boxShadow:`md`,_open:{animationStyle:`slide-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`slide-fade-out`,animationDuration:`0s`},"&[data-empty]:not(:has([data-scope=combobox][data-part=empty]))":{opacity:0}},item:{position:`relative`,userSelect:`none`,display:`flex`,alignItems:`center`,gap:`2`,py:`var(--combobox-item-padding-y)`,px:`var(--combobox-item-padding-x)`,cursor:`option`,justifyContent:`space-between`,flex:`1`,textAlign:`start`,borderRadius:`l1`,_highlighted:{bg:`bg.emphasized/60`},_disabled:{pointerEvents:`none`,opacity:`0.5`},_icon:{boxSize:`var(--combobox-indicator-size)`}},empty:{py:`var(--combobox-item-padding-y)`,px:`var(--combobox-item-padding-x)`},itemText:{flex:`1`},itemGroup:{pb:`var(--combobox-item-padding-y)`,_last:{pb:`0`}},itemGroupLabel:{fontWeight:`medium`,py:`var(--combobox-item-padding-y)`,px:`var(--combobox-item-padding-x)`}},variants:{variant:{outline:{input:{bg:`transparent`,borderWidth:`1px`,borderColor:`border`,focusVisibleRing:`inside`}},subtle:{input:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.muted`,focusVisibleRing:`inside`}},flushed:{input:{bg:`transparent`,borderBottomWidth:`1px`,borderBottomColor:`border`,borderRadius:`0`,px:`0`,_focusVisible:{borderColor:`var(--focus-color)`,boxShadow:`0px 1px 0px 0px var(--focus-color)`}},indicatorGroup:{px:`0`}}},size:{xs:{root:{"--combobox-input-height":`sizes.8`,"--combobox-input-padding-x":`spacing.2`,"--combobox-indicator-size":`sizes.3.5`},input:{textStyle:`xs`},content:{"--combobox-item-padding-x":`spacing.1.5`,"--combobox-item-padding-y":`spacing.1`,"--combobox-indicator-size":`sizes.3.5`,p:`1`,textStyle:`xs`},trigger:{textStyle:`xs`,gap:`1`}},sm:{root:{"--combobox-input-height":`sizes.9`,"--combobox-input-padding-x":`spacing.2.5`,"--combobox-indicator-size":`sizes.4`},input:{textStyle:`sm`},content:{"--combobox-item-padding-x":`spacing.2`,"--combobox-item-padding-y":`spacing.1.5`,"--combobox-indicator-size":`sizes.4`,p:`1`,textStyle:`sm`},trigger:{textStyle:`sm`,gap:`1`}},md:{root:{"--combobox-input-height":`sizes.10`,"--combobox-input-padding-x":`spacing.3`,"--combobox-indicator-size":`sizes.4`},input:{textStyle:`sm`},content:{"--combobox-item-padding-x":`spacing.2`,"--combobox-item-padding-y":`spacing.1.5`,"--combobox-indicator-size":`sizes.4`,p:`1`,textStyle:`sm`},itemIndicator:{display:`flex`,alignItems:`center`,justifyContent:`center`},trigger:{textStyle:`sm`,gap:`2`}},lg:{root:{"--combobox-input-height":`sizes.12`,"--combobox-input-padding-x":`spacing.4`,"--combobox-indicator-size":`sizes.5`},input:{textStyle:`md`},content:{"--combobox-item-padding-y":`spacing.2`,"--combobox-item-padding-x":`spacing.3`,"--combobox-indicator-size":`sizes.5`,p:`1.5`,textStyle:`md`},trigger:{textStyle:`md`,py:`3`,gap:`2`}}}},defaultVariants:{size:`md`,variant:`outline`}}),xS=U({slots:kx.keys(),className:`chakra-data-list`,base:{itemLabel:{display:`flex`,alignItems:`center`,gap:`1`},itemValue:{display:`flex`,minWidth:`0`,flex:`1`}},variants:{orientation:{horizontal:{root:{display:`flex`,flexDirection:`column`},item:{display:`inline-flex`,alignItems:`center`,gap:`4`},itemLabel:{minWidth:`120px`}},vertical:{root:{display:`flex`,flexDirection:`column`},item:{display:`flex`,flexDirection:`column`,gap:`1`}}},size:{sm:{root:{gap:`3`},item:{textStyle:`xs`}},md:{root:{gap:`4`},item:{textStyle:`sm`}},lg:{root:{gap:`5`},item:{textStyle:`md`}}},variant:{subtle:{itemLabel:{color:`fg.muted`}},bold:{itemLabel:{fontWeight:`medium`},itemValue:{color:`fg.muted`}}}},defaultVariants:{size:`md`,orientation:`vertical`,variant:`subtle`}}),SS=U({className:`chakra-date-input`,slots:Lp.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`,width:`full`,_disabled:{opacity:`0.5`}},label:{textStyle:`label`},control:{display:`flex`,alignItems:`center`,width:`full`},segmentGroup:{flex:`1`,outline:`0`,position:`relative`,appearance:`none`,textAlign:`start`,borderRadius:`l2`,height:`var(--input-height)`,minW:`var(--input-height)`,"--focus-color":`colors.colorPalette.focusRing`,"--error-color":`colors.border.error`,_invalid:{focusRingColor:`var(--error-color)`,borderColor:`var(--error-color)`},display:`flex`,alignItems:`center`,gap:`1`,cursor:`text`},segment:{borderRadius:`l1`,px:`0.5`,outline:`none`,_placeholderShown:{color:`fg.subtle`},"&[data-type=literal]":{px:`0`,color:`fg.subtle`}}},variants:{size:{"2xs":{segmentGroup:{textStyle:`xs`,px:`1.5`,"--input-height":`sizes.7`}},xs:{segmentGroup:{textStyle:`xs`,px:`1.5`,"--input-height":`sizes.8`}},sm:{segmentGroup:{textStyle:`sm`,px:`2`,"--input-height":`sizes.9`}},md:{segmentGroup:{textStyle:`sm`,px:`2.5`,"--input-height":`sizes.10`}},lg:{segmentGroup:{textStyle:`md`,px:`3.5`,"--input-height":`sizes.11`}},xl:{segmentGroup:{textStyle:`md`,px:`4`,"--input-height":`sizes.12`}},"2xl":{segmentGroup:{textStyle:`lg`,px:`4.5`,"--input-height":`sizes.16`}}},variant:{outline:{segmentGroup:{bg:`transparent`,borderWidth:`1px`,borderColor:`border`,focusRing:`inside`,focusRingColor:`var(--focus-color)`},segment:{_focus:{bg:`colorPalette.emphasized`,color:`fg`}}},subtle:{segmentGroup:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.muted`,focusRing:`inside`,focusRingColor:`var(--focus-color)`},segment:{_focus:{bg:`colorPalette.subtle`,color:`colorPalette.fg`}}},flushed:{segmentGroup:{bg:`transparent`,borderBottomWidth:`1px`,borderBottomColor:`border`,borderRadius:`0`,px:`0`,_focus:{borderColor:`var(--focus-color)`,boxShadow:`0px 1px 0px 0px var(--focus-color)`,_invalid:{borderColor:`var(--error-color)`,boxShadow:`0px 1px 0px 0px var(--error-color)`}}},segment:{_focus:{bg:`colorPalette.subtle`,color:`colorPalette.fg`}}}}},defaultVariants:{size:`md`,variant:`outline`}}),CS=Bv({display:`inline-flex`,alignItems:`center`,justifyContent:`center`,boxSize:`var(--datepicker-nav-trigger-size)`,borderRadius:`l2`,color:`fg`,focusVisibleRing:`inside`,focusRingWidth:`2px`,_hover:{bg:`colorPalette.subtle`},_focusVisible:{boxShadow:`0 0 0 2px var(--colors-color-palette-focus-ring)`},_disabled:{opacity:.5},_icon:{boxSize:`4`}}),wS=Bv({height:`var(--datepicker-select-height)`,ps:`2`,pe:`8`,textStyle:`sm`,borderWidth:`1px`,borderRadius:`l2`,outline:`none`,focusVisibleRing:`inside`,appearance:`none`,fieldSizing:`content`,backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")`,backgroundRepeat:`no-repeat`,backgroundPosition:`right 0.375rem center`,backgroundSize:`1.25em`}),TS=U({className:`date-picker`,slots:Ax.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`,width:`full`,"--datepicker-indicators-offset":`sizes.3`,_disabled:{opacity:.5}},label:{textStyle:`sm`,fontWeight:`medium`},indicatorGroup:{position:`absolute`,insetEnd:`var(--datepicker-indicators-offset)`,top:`50%`,transform:`translateY(-50%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:`1`},control:{display:`flex`,alignItems:`center`,gap:`2`,width:`full`,position:`relative`},input:{flex:`1`,minWidth:`0`,height:`var(--datepicker-input-height)`,"--input-height":`var(--datepicker-input-height)`,px:`var(--datepicker-input-px)`,textStyle:`sm`,bg:`transparent`,borderRadius:`l2`,outline:`0`,appearance:`none`,color:`fg`,"--focus-color":`colors.colorPalette.focusRing`,"--error-color":`colors.border.error`,_invalid:{focusRingColor:`var(--error-color)`,borderColor:`var(--error-color)`}},trigger:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:`6`,height:`6`,borderRadius:`l1`,color:`fg.muted`,outline:`none`,_hover:{color:`fg`},focusVisibleRing:`inside`,focusRingWidth:`2px`,_icon:{boxSize:`4`}},content:{display:`flex`,flexDirection:`column`,gap:`3`,p:`3`,minW:`18rem`,bg:`bg.panel`,borderRadius:`l2`,boxShadow:`lg`,color:`fg`,"--date-picker-z-index":`zIndex.popover`,zIndex:`calc(var(--date-picker-z-index) + var(--layer-index, 0))`,outline:`none`,_open:{animationStyle:`scale-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`scale-fade-out`,animationDuration:`faster`}},view:{display:`flex`,flexDirection:`column`,gap:`3`},viewControl:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:`2`,height:`var(--datepicker-nav-trigger-size)`},viewTrigger:{display:`inline-flex`,flex:`1`,alignItems:`center`,justifyContent:`center`,gap:`1`,py:`1.5`,px:`2`,textStyle:`sm`,fontWeight:`semibold`,borderRadius:`l2`,focusVisibleRing:`inside`,focusRingWidth:`2px`,_hover:{bg:`colorPalette.subtle`}},prevTrigger:CS,nextTrigger:CS,rangeText:{textStyle:`sm`,fontWeight:`semibold`},table:{borderCollapse:`separate`,borderSpacing:`0`},tableHeader:{width:`var(--table-cell-size)`,py:`2`,textStyle:`xs`,fontWeight:`medium`,color:`fg.muted`,textAlign:`center`,textTransform:`uppercase`,"&[data-type='week-number']":{color:`fg.subtle`}},tableCell:{py:`0.5`,"&[data-type='week-number']":{color:`fg.subtle`}},tableCellTrigger:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:`var(--table-cell-size)`,minHeight:`var(--table-cell-size)`,textStyle:`sm`,borderRadius:`l2`,focusVisibleRing:`inside`,focusRingWidth:`2px`,focusRingOffset:`0px`,cursor:`default`,position:`relative`,_hover:{bg:`colorPalette.subtle`},"[data-view=month] &, [data-view=year] &":{width:`calc(var(--table-cell-size) * 1.75)`},_today:{color:`colorPalette.fg`,fontWeight:`semibold`,textDecoration:`underline`,textUnderlineOffset:`3px`,textDecorationThickness:`2px`},"&[data-selected]":{bg:`colorPalette.solid`,color:`colorPalette.contrast`,_hover:{bg:`colorPalette.solid`}},"&[data-in-range]":{bg:`colorPalette.subtle`,color:`colorPalette.fg`,borderRadius:`0`,_hover:{bg:`colorPalette.subtle`}},"&[data-in-range][data-selected]":{bg:`colorPalette.solid`,color:`colorPalette.contrast`,borderRadius:`0`,_hover:{bg:`colorPalette.solid`},"&[data-range-start][data-range-end]":{borderRadius:`l2`},"&[data-range-start]:not([data-range-end])":{borderStartRadius:`l2`,borderEndRadius:`0`},"&[data-range-end]:not([data-range-start])":{borderEndRadius:`l2`,borderStartRadius:`0`}},_disabled:{opacity:.4}},monthSelect:wS,yearSelect:wS,clearTrigger:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:`6`,height:`6`,flexShrink:0,textStyle:`xs`,borderRadius:`l2`,color:`fg.muted`,_hover:{color:`fg`},focusVisibleRing:`inside`,_icon:{width:`4`,height:`4`}}},variants:{size:{xs:{root:{"--datepicker-input-height":`sizes.8`,"--datepicker-input-px":`sizes.2`,"--datepicker-indicators-offset":`sizes.2`},view:{"--table-cell-size":`sizes.8`,"--datepicker-nav-trigger-size":`sizes.7`,"--datepicker-select-height":`sizes.8`}},sm:{root:{"--datepicker-input-height":`sizes.9`,"--datepicker-input-px":`sizes.2.5`,"--datepicker-indicators-offset":`sizes.2.5`},view:{"--table-cell-size":`sizes.9`,"--datepicker-nav-trigger-size":`sizes.8`,"--datepicker-select-height":`sizes.9`}},md:{root:{"--datepicker-input-height":`sizes.10`,"--datepicker-input-px":`sizes.3`},view:{"--table-cell-size":`sizes.10`,"--datepicker-nav-trigger-size":`sizes.8`,"--datepicker-select-height":`sizes.10`}},lg:{root:{"--datepicker-input-height":`sizes.11`,"--datepicker-input-px":`sizes.4`},view:{"--table-cell-size":`sizes.10`,"--datepicker-nav-trigger-size":`sizes.9`,"--datepicker-select-height":`sizes.10`}},xl:{root:{"--datepicker-input-height":`sizes.12`,"--datepicker-input-px":`sizes.4.5`},view:{"--table-cell-size":`sizes.10`,"--datepicker-nav-trigger-size":`sizes.9`,"--datepicker-select-height":`sizes.10`}}},hideOutsideDays:{true:{tableCellTrigger:{"&[data-outside-range]":{visibility:`hidden`}}}},variant:{outline:{input:{bg:`transparent`,borderWidth:`1px`,borderColor:`border`,focusVisibleRing:`inside`,focusRingColor:`var(--focus-color)`}},subtle:{input:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.muted`,focusVisibleRing:`inside`,focusRingColor:`var(--focus-color)`}},flushed:{input:{bg:`transparent`,borderBottomWidth:`1px`,borderBottomColor:`border`,borderRadius:`0`,px:`0`,_focusVisible:{borderColor:`var(--focus-color)`,boxShadow:`0px 1px 0px 0px var(--focus-color)`,_invalid:{borderColor:`var(--error-color)`,boxShadow:`0px 1px 0px 0px var(--error-color)`}}},indicatorGroup:{insetEnd:`0`}}}},defaultVariants:{size:`md`,variant:`outline`}}),ES=U({slots:jx.keys(),className:`chakra-dialog`,base:{backdrop:{bg:`blackAlpha.500`,pos:`fixed`,left:0,top:0,w:`100dvw`,h:`100dvh`,"--dialog-z-index":`zIndex.popover`,zIndex:`calc(var(--dialog-z-index) + var(--layer-index, 0) - 1)`,_open:{animationName:`fade-in`,animationDuration:`slow`},_closed:{animationName:`fade-out`,animationDuration:`moderate`}},positioner:{display:`flex`,width:`100dvw`,height:`100dvh`,position:`fixed`,left:0,top:0,"--dialog-z-index":`zIndex.popover`,zIndex:`calc(var(--dialog-z-index) + var(--layer-index, 0))`,justifyContent:`center`,overscrollBehaviorY:`none`},content:{display:`flex`,flexDirection:`column`,position:`relative`,width:`100%`,outline:0,borderRadius:`l3`,textStyle:`sm`,my:`var(--dialog-margin, var(--dialog-base-margin))`,"--dialog-z-index":`zIndex.popover`,zIndex:`calc(var(--dialog-z-index) + var(--layer-index, 0))`,bg:`bg.panel`,boxShadow:`lg`,_open:{animationDuration:`moderate`},_closed:{animationDuration:`faster`}},header:{display:`flex`,gap:`2`,flex:0,px:`6`,pt:`6`,pb:`4`},body:{flex:`1`,px:`6`,pt:`2`,pb:`6`},footer:{display:`flex`,alignItems:`center`,justifyContent:`flex-end`,gap:`3`,px:`6`,pt:`2`,pb:`4`},title:{textStyle:`lg`,fontWeight:`semibold`},description:{color:`fg.muted`},closeTrigger:{pos:`absolute`,top:`2`,insetEnd:`2`}},variants:{placement:{center:{positioner:{alignItems:`center`},content:{"--dialog-base-margin":`auto`,mx:`auto`}},top:{positioner:{alignItems:`flex-start`},content:{"--dialog-base-margin":`spacing.16`,mx:`auto`}},bottom:{positioner:{alignItems:`flex-end`},content:{"--dialog-base-margin":`spacing.16`,mx:`auto`}}},scrollBehavior:{inside:{positioner:{overflow:`hidden`},content:{maxH:`calc(100% - 7.5rem)`},body:{overflow:`auto`}},outside:{positioner:{overflow:`auto`,pointerEvents:`auto`}}},size:{xs:{content:{maxW:`sm`}},sm:{content:{maxW:`md`}},md:{content:{maxW:`lg`}},lg:{content:{maxW:`2xl`}},xl:{content:{maxW:`4xl`}},cover:{positioner:{padding:`10`},content:{width:`100%`,height:`100%`,"--dialog-margin":`0`}},full:{content:{maxW:`100dvw`,minH:`100dvh`,"--dialog-margin":`0`,borderRadius:`0`}}},motionPreset:{scale:{content:{_open:{animationName:`scale-in, fade-in`},_closed:{animationName:`scale-out, fade-out`}}},"slide-in-bottom":{content:{_open:{animationName:`slide-from-bottom, fade-in`},_closed:{animationName:`slide-to-bottom, fade-out`}}},"slide-in-top":{content:{_open:{animationName:`slide-from-top, fade-in`},_closed:{animationName:`slide-to-top, fade-out`}}},"slide-in-left":{content:{_open:{animationName:`slide-from-left, fade-in`},_closed:{animationName:`slide-to-left, fade-out`}}},"slide-in-right":{content:{_open:{animationName:`slide-from-right, fade-in`},_closed:{animationName:`slide-to-right, fade-out`}}},none:{}}},defaultVariants:{size:`md`,scrollBehavior:`outside`,placement:`top`,motionPreset:`scale`}}),DS=U({slots:Mx.keys(),className:`chakra-drawer`,base:{backdrop:{bg:`blackAlpha.500`,pos:`fixed`,insetInlineStart:0,top:0,w:`100vw`,h:`100dvh`,"--drawer-z-index":`zIndex.popover`,zIndex:`calc(var(--drawer-z-index) + var(--layer-index, 0) - 1)`,_open:{animationName:`fade-in`,animationDuration:`slow`},_closed:{animationName:`fade-out`,animationDuration:`moderate`}},positioner:{display:`flex`,width:`100vw`,height:`100dvh`,position:`fixed`,insetInlineStart:0,top:0,"--drawer-z-index":`zIndex.popover`,zIndex:`calc(var(--drawer-z-index) + var(--layer-index, 0))`,overscrollBehaviorY:`none`},content:{display:`flex`,flexDirection:`column`,position:`relative`,width:`100%`,outline:0,"--drawer-z-index":`zIndex.popover`,zIndex:`calc(var(--drawer-z-index) + var(--layer-index, 0))`,textStyle:`sm`,maxH:`100dvh`,color:`inherit`,bg:`bg.panel`,boxShadow:`lg`,_open:{animationDuration:`slowest`,animationTimingFunction:`ease-in-smooth`},_closed:{animationDuration:`slower`,animationTimingFunction:`ease-in-smooth`}},header:{display:`flex`,alignItems:`center`,gap:`2`,flex:0,px:`6`,pt:`6`,pb:`4`},body:{px:`6`,py:`2`,flex:`1`,overflow:`auto`},footer:{display:`flex`,alignItems:`center`,justifyContent:`flex-end`,gap:`3`,px:`6`,pt:`2`,pb:`4`},title:{flex:`1`,textStyle:`lg`,fontWeight:`semibold`},description:{color:`fg.muted`},closeTrigger:{pos:`absolute`,top:`3`,insetEnd:`2`}},variants:{size:{xs:{content:{maxW:`xs`}},sm:{content:{maxW:`md`}},md:{content:{maxW:`lg`}},lg:{content:{maxW:`2xl`}},xl:{content:{maxW:`4xl`}},full:{content:{maxW:`100vw`,h:`100dvh`}}},placement:{start:{positioner:{justifyContent:`flex-start`,alignItems:`stretch`},content:{_open:{animationName:{base:`slide-from-left-full, fade-in`,_rtl:`slide-from-right-full, fade-in`}},_closed:{animationName:{base:`slide-to-left-full, fade-out`,_rtl:`slide-to-right-full, fade-out`}}}},end:{positioner:{justifyContent:`flex-end`,alignItems:`stretch`},content:{_open:{animationName:{base:`slide-from-right-full, fade-in`,_rtl:`slide-from-left-full, fade-in`}},_closed:{animationName:{base:`slide-to-right-full, fade-out`,_rtl:`slide-to-left-full, fade-out`}}}},top:{positioner:{justifyContent:`stretch`,alignItems:`flex-start`},content:{maxW:`100%`,_open:{animationName:`slide-from-top-full, fade-in`},_closed:{animationName:`slide-to-top-full, fade-out`}}},bottom:{positioner:{justifyContent:`stretch`,alignItems:`flex-end`},content:{maxW:`100%`,_open:{animationName:`slide-from-bottom-full, fade-in`},_closed:{animationName:`slide-to-bottom-full, fade-out`}}}},contained:{true:{positioner:{padding:`4`},content:{borderRadius:`l3`}}}},defaultVariants:{size:`xs`,placement:`end`}}),OS=Bv({fontSize:`inherit`,fontWeight:`inherit`,textAlign:`inherit`,bg:`transparent`,borderRadius:`l2`}),kS=U({slots:Nx.keys(),className:`chakra-editable`,base:{root:{display:`inline-flex`,alignItems:`center`,position:`relative`,gap:`1.5`,width:`full`},preview:{...OS,py:`1`,px:`1`,display:`inline-flex`,alignItems:`center`,transitionProperty:`common`,transitionDuration:`moderate`,cursor:`text`,_hover:{bg:`bg.muted`},_disabled:{userSelect:`none`}},input:{...OS,outline:`0`,py:`1`,px:`1`,transitionProperty:`common`,transitionDuration:`normal`,width:`full`,focusVisibleRing:`inside`,focusRingWidth:`2px`,_placeholder:{opacity:.6}},control:{display:`inline-flex`,alignItems:`center`,gap:`1.5`}},variants:{size:{sm:{root:{textStyle:`sm`},preview:{minH:`8`},input:{minH:`8`}},md:{root:{textStyle:`sm`},preview:{minH:`9`},input:{minH:`9`}},lg:{root:{textStyle:`md`},preview:{minH:`10`},input:{minH:`10`}}}},defaultVariants:{size:`md`}}),AS=U({slots:Px.keys(),className:`chakra-empty-state`,base:{root:{width:`full`},content:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`},indicator:{display:`flex`,alignItems:`center`,justifyContent:`center`,color:`fg.subtle`,_icon:{boxSize:`1em`}},title:{fontWeight:`semibold`},description:{textStyle:`sm`,color:`fg.muted`}},variants:{size:{sm:{root:{px:`4`,py:`6`},title:{textStyle:`md`},content:{gap:`4`},indicator:{textStyle:`2xl`}},md:{root:{px:`8`,py:`12`},title:{textStyle:`lg`},content:{gap:`6`},indicator:{textStyle:`4xl`}},lg:{root:{px:`12`,py:`16`},title:{textStyle:`xl`},content:{gap:`8`},indicator:{textStyle:`6xl`}}}},defaultVariants:{size:`md`}}),jS=U({className:`chakra-field`,slots:Fx.keys(),base:{requiredIndicator:{color:`fg.error`,lineHeight:`1`},root:{display:`flex`,width:`100%`,position:`relative`,gap:`1.5`},label:{display:`flex`,alignItems:`center`,textAlign:`start`,textStyle:`sm`,fontWeight:`medium`,gap:`1`,userSelect:`none`,_disabled:{opacity:`0.5`}},errorText:{display:`inline-flex`,alignItems:`center`,fontWeight:`medium`,gap:`1`,color:`fg.error`,textStyle:`xs`},helperText:{color:`fg.muted`,textStyle:`xs`}},variants:{orientation:{vertical:{root:{flexDirection:`column`,alignItems:`flex-start`}},horizontal:{root:{flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`},label:{flex:`0 0 var(--field-label-width, 80px)`}}}},defaultVariants:{orientation:`vertical`}}),MS=U({className:`fieldset`,slots:Ix.keys(),base:{root:{display:`flex`,flexDirection:`column`,width:`full`},content:{display:`flex`,flexDirection:`column`,width:`full`},legend:{color:`fg`,fontWeight:`medium`,_disabled:{opacity:`0.5`}},helperText:{color:`fg.muted`,textStyle:`sm`},errorText:{display:`inline-flex`,alignItems:`center`,color:`fg.error`,gap:`2`,fontWeight:`medium`,textStyle:`sm`}},variants:{size:{sm:{root:{spaceY:`2`},content:{gap:`1.5`},legend:{textStyle:`sm`}},md:{root:{spaceY:`4`},content:{gap:`4`},legend:{textStyle:`sm`}},lg:{root:{spaceY:`6`},content:{gap:`4`},legend:{textStyle:`md`}}}},defaultVariants:{size:`md`}}),NS=U({className:`chakra-file-upload`,slots:Lx.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`4`,width:`100%`,alignItems:`flex-start`},label:{fontWeight:`medium`,textStyle:`sm`},dropzone:{background:`bg`,borderRadius:`l3`,borderWidth:`2px`,borderStyle:`dashed`,display:`flex`,alignItems:`center`,flexDirection:`column`,gap:`4`,justifyContent:`center`,minHeight:`2xs`,px:`3`,py:`2`,transition:`backgrounds`,focusVisibleRing:`outside`,_hover:{bg:`bg.subtle`},_dragging:{bg:`colorPalette.subtle`,borderStyle:`solid`,borderColor:`colorPalette.solid`}},dropzoneContent:{display:`flex`,flexDirection:`column`,alignItems:`center`,textAlign:`center`,gap:`1`,textStyle:`sm`},item:{pos:`relative`,textStyle:`sm`,animationName:`fade-in`,animationDuration:`moderate`,background:`bg`,borderRadius:`l2`,borderWidth:`1px`,width:`100%`,display:`flex`,alignItems:`center`,gap:`3`,p:`4`},itemGroup:{width:`100%`,display:`flex`,flexDirection:`column`,gap:`3`,_empty:{display:`none`}},itemName:{color:`fg`,fontWeight:`medium`,lineClamp:`1`},itemContent:{display:`flex`,flexDirection:`column`,gap:`0.5`,flex:`1`},itemSizeText:{color:`fg.muted`,textStyle:`xs`},itemDeleteTrigger:{display:`flex`,alignItems:`center`,justifyContent:`center`,alignSelf:`flex-start`,boxSize:`5`,p:`2px`,color:`fg.muted`,cursor:`button`},itemPreview:{color:`fg.muted`,_icon:{boxSize:`4.5`}}},defaultVariants:{}}),PS=U({slots:dm.keys(),className:`chakra-floating-panel`,base:{positioner:{"--floating-panel-z-index":`zIndex.popover`,zIndex:`calc(var(--floating-panel-z-index) + var(--layer-index, 0))`,"&:has([data-topmost])":{"--layer-index":`100`},"&:has([data-behind])":{"--layer-index":`-100`}},content:{display:`flex`,flexDirection:`column`,bg:`bg.panel`,borderRadius:`l2`,boxShadow:`lg`,overflow:`hidden`,outline:0,position:`relative`,_open:{animationName:`scale-in, fade-in`,animationDuration:`moderate`}},dragTrigger:{flex:`1`,display:`flex`,alignItems:`center`,gap:`2`,minW:`0`},header:{display:`flex`,alignItems:`center`,gap:`2`,px:`3`,py:`2`,borderBottomWidth:`1px`,bg:`bg.subtle`,flex:`none`},title:{fontWeight:`semibold`,textStyle:`sm`,flex:`1`,truncate:!0},body:{flex:`1`,overflow:`auto`,p:`3`,textStyle:`sm`},resizeTrigger:{zIndex:`1`,"--size":`sizes.2.5`,'&[data-axis="n"], &[data-axis="s"]':{h:`var(--size)`},'&[data-axis="e"], &[data-axis="w"]':{w:`var(--size)`},'&[data-axis]:is([data-axis="ne"], [data-axis="nw"], [data-axis="se"], [data-axis="sw"])':{w:`var(--size)`,h:`var(--size)`}}}}),FS=U({className:`chakra-hover-card`,slots:fm.keys(),base:{content:{position:`relative`,display:`flex`,flexDirection:`column`,textStyle:`sm`,"--hovercard-bg":`colors.bg.panel`,bg:`var(--hovercard-bg)`,boxShadow:`lg`,maxWidth:`80`,borderRadius:`l3`,"--hover-card-z-index":`zIndex.popover`,zIndex:`calc(var(--hover-card-z-index) + var(--layer-index, 0))`,transformOrigin:`var(--transform-origin)`,outline:`0`,_open:{animationStyle:`slide-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`slide-fade-out`,animationDuration:`faster`}},arrow:{"--arrow-size":`sizes.3`,"--arrow-background":`var(--hovercard-bg)`},arrowTip:{borderTopWidth:`0.5px`,borderLeftWidth:`0.5px`}},variants:{size:{xs:{content:{padding:`3`}},sm:{content:{padding:`4`}},md:{content:{padding:`5`}},lg:{content:{padding:`6`}}}},defaultVariants:{size:`md`}}),IS=U({className:`chakra-list`,slots:Rx.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`var(--list-gap)`,"& :where(ul, ol)":{marginTop:`var(--list-gap)`}},item:{whiteSpace:`normal`,display:`list-item`},indicator:{marginEnd:`2`,minHeight:`1lh`,flexShrink:0,display:`inline-block`,verticalAlign:`middle`}},variants:{variant:{marker:{root:{listStyle:`revert`},item:{_marker:{color:`fg.subtle`}}},plain:{item:{alignItems:`flex-start`,display:`inline-flex`}}},align:{center:{item:{alignItems:`center`}},start:{item:{alignItems:`flex-start`}},end:{item:{alignItems:`flex-end`}}}},defaultVariants:{variant:`marker`}}),LS=U({className:`chakra-listbox`,slots:oS.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`,width:`full`},content:{display:`flex`,maxH:`96`,p:`1`,gap:`1`,textStyle:`sm`,outline:`none`,scrollPadding:`1`,_horizontal:{flexDirection:`row`,overflowX:`auto`},_vertical:{flexDirection:`column`,overflowY:`auto`},"--listbox-item-padding-x":`spacing.2`,"--listbox-item-padding-y":`spacing.1.5`},item:{position:`relative`,userSelect:`none`,display:`flex`,alignItems:`center`,gap:`2`,cursor:`pointer`,justifyContent:`space-between`,flex:`1`,textAlign:`start`,borderRadius:`l1`,py:`var(--listbox-item-padding-y)`,px:`var(--listbox-item-padding-x)`,_highlighted:{outline:`2px solid`,outlineColor:`border.emphasized`},_disabled:{pointerEvents:`none`,opacity:`0.5`}},empty:{py:`var(--listbox-item-padding-y)`,px:`var(--listbox-item-padding-x)`},itemText:{flex:`1`},itemGroup:{mt:`1.5`,_first:{mt:`0`}},itemGroupLabel:{py:`1.5`,px:`2`,fontWeight:`medium`},label:{fontWeight:`medium`,userSelect:`none`,textStyle:`sm`,_disabled:{layerStyle:`disabled`}},valueText:{lineClamp:`1`,maxW:`80%`},itemIndicator:{display:`flex`,alignItems:`center`,justifyContent:`center`,_icon:{boxSize:`4`}}},variants:{variant:{subtle:{content:{bg:`bg.panel`,borderWidth:`1px`,borderRadius:`l2`},item:{_hover:{bg:`bg.emphasized/60`},_selected:{bg:`bg.muted`}}},solid:{content:{bg:`bg.panel`,borderWidth:`1px`,borderRadius:`l2`},item:{_selected:{bg:`colorPalette.solid`,color:`colorPalette.contrast`}}},plain:{}}},defaultVariants:{variant:`subtle`}}),RS=U({className:`chakra-marquee`,slots:hm.keys(),base:{root:{position:`relative`,width:`100%`,"--marquee-edge-color":`colors.bg`,"--marquee-edge-size":`20%`,"&[data-paused]":{animationPlayState:`paused !important`,"& *":{animationPlayState:`paused !important`}}},viewport:{overflow:`hidden`,display:`flex`,width:`100%`,height:`100%`},content:{display:`flex`,minWidth:`max-content`,animationTimingFunction:`linear`,animationFillMode:`forwards`,animationDuration:`var(--marquee-duration)`,animationDelay:`var(--marquee-delay)`,animationIterationCount:`var(--marquee-loop-count)`,_motionReduce:{animation:`none !important`},"&[data-side='start'], &[data-side='end']":{animationName:`marqueeX`},"&[data-side='top'], &[data-side='bottom']":{animationName:`marqueeY`},"&[data-reverse]":{animationDirection:`reverse`},"&[data-orientation='horizontal']":{flexDirection:`row`},"&[data-orientation='vertical']":{flexDirection:`column`}},edge:{position:`absolute`,zIndex:`1`,pointerEvents:`none`,"&[data-side='start']":{width:`var(--marquee-edge-size)`,insetY:`0`,insetInlineStart:`0`,background:`linear-gradient(to right, var(--marquee-edge-color, white), transparent)`,_rtl:{background:`linear-gradient(to left, var(--marquee-edge-color, white), transparent)`}},"&[data-side='end']":{width:`var(--marquee-edge-size)`,insetY:`0`,insetInlineEnd:`0`,background:`linear-gradient(to left, var(--marquee-edge-color, white), transparent)`,_rtl:{background:`linear-gradient(to right, var(--marquee-edge-color, white), transparent)`}},"&[data-side='top']":{height:`var(--marquee-edge-size)`,insetX:`0`,top:`0`,background:`linear-gradient(to bottom, var(--marquee-edge-color, white), transparent)`},"&[data-side='bottom']":{height:`var(--marquee-edge-size)`,insetX:`0`,bottom:`0`,background:`linear-gradient(to top, var(--marquee-edge-color, white), transparent)`}}}}),zS=U({className:`chakra-menu`,slots:zx.keys(),base:{content:{outline:0,"--menu-bg":`colors.bg.panel`,bg:`var(--menu-bg)`,boxShadow:`lg`,color:`fg`,maxHeight:`var(--available-height)`,"--menu-z-index":`zIndex.popover`,zIndex:`calc(var(--menu-z-index) + var(--layer-index, 0))`,borderRadius:`l2`,overflow:`hidden`,overflowY:`auto`,_open:{animationStyle:`slide-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`slide-fade-out`,animationDuration:`faster`}},item:{textDecoration:`none`,color:`fg`,userSelect:`none`,borderRadius:`l1`,width:`100%`,display:`flex`,cursor:`menuitem`,alignItems:`center`,textAlign:`start`,position:`relative`,flex:`0 0 auto`,outline:0,_disabled:{layerStyle:`disabled`},"&[data-type]":{ps:`8`}},itemText:{flex:`1`},itemIndicator:{position:`absolute`,insetStart:`2`,transform:`translateY(-50%)`,top:`50%`},itemGroupLabel:{px:`2`,py:`1.5`,fontWeight:`semibold`,textStyle:`sm`},indicator:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,flexShrink:`0`},itemCommand:{opacity:`0.6`,textStyle:`xs`,ms:`auto`,ps:`4`,letterSpacing:`widest`,fontFamily:`inherit`},separator:{height:`1px`,bg:`bg.muted`,my:`1`,mx:`-1`},arrow:{"--arrow-size":`sizes.3`,"--arrow-background":`var(--menu-bg)`},arrowTip:{borderTopWidth:`1px`,borderLeftWidth:`1px`}},variants:{variant:{subtle:{item:{_highlighted:{bg:`bg.emphasized/60`}}},solid:{item:{_highlighted:{bg:`colorPalette.solid`,color:`colorPalette.contrast`}}}},size:{sm:{content:{minW:`8rem`,padding:`1`,scrollPadding:`1`},item:{gap:`1`,textStyle:`xs`,py:`1`,px:`1.5`}},md:{content:{minW:`8rem`,padding:`1.5`,scrollPadding:`1.5`},item:{gap:`2`,textStyle:`sm`,py:`1.5`,px:`2`}}}},defaultVariants:{size:`md`,variant:`subtle`}}),BS=U({className:`chakra-select`,slots:Gx.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`,width:`full`},trigger:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,width:`full`,minH:`var(--select-trigger-height)`,"--input-height":`var(--select-trigger-height)`,px:`var(--select-trigger-padding-x)`,borderRadius:`l2`,userSelect:`none`,textAlign:`start`,focusVisibleRing:`inside`,_placeholderShown:{color:`fg.muted/80`},_disabled:{layerStyle:`disabled`},_invalid:{borderColor:`border.error`}},indicatorGroup:{display:`flex`,alignItems:`center`,gap:`1`,pos:`absolute`,insetEnd:`0`,top:`0`,bottom:`0`,px:`var(--select-trigger-padding-x)`,pointerEvents:`none`},indicator:{display:`flex`,alignItems:`center`,justifyContent:`center`,color:{base:`fg.muted`,_disabled:`fg.subtle`,_invalid:`fg.error`}},content:{background:`bg.panel`,display:`flex`,flexDirection:`column`,"--select-z-index":`zIndex.popover`,zIndex:`calc(var(--select-z-index) + var(--layer-index, 0))`,borderRadius:`l2`,outline:0,maxH:`96`,overflowY:`auto`,boxShadow:`md`,_open:{animationStyle:`slide-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`slide-fade-out`,animationDuration:`fastest`}},item:{position:`relative`,userSelect:`none`,display:`flex`,alignItems:`center`,gap:`2`,cursor:`option`,justifyContent:`space-between`,flex:`1`,textAlign:`start`,borderRadius:`l1`,_highlighted:{bg:`bg.emphasized/60`},_disabled:{pointerEvents:`none`,opacity:`0.5`},_icon:{width:`4`,height:`4`}},control:{pos:`relative`},itemText:{flex:`1`},itemGroup:{_first:{mt:`0`}},itemGroupLabel:{py:`1`,fontWeight:`medium`},label:{fontWeight:`medium`,userSelect:`none`,textStyle:`sm`,_disabled:{layerStyle:`disabled`}},valueText:{lineClamp:`1`,maxW:`80%`},clearTrigger:{color:`fg.muted`,pointerEvents:`auto`,focusVisibleRing:`inside`,focusRingWidth:`2px`,rounded:`l1`}},variants:{variant:{outline:{trigger:{bg:`transparent`,borderWidth:`1px`,borderColor:`border`,_expanded:{borderColor:`border.emphasized`}}},subtle:{trigger:{borderWidth:`1px`,borderColor:`transparent`,bg:`bg.muted`}},ghost:{trigger:{bg:`transparent`,_expanded:{bg:`bg.muted`}}}},size:{xs:{root:{"--select-trigger-height":`sizes.8`,"--select-trigger-padding-x":`spacing.2`},content:{p:`1`,gap:`1`,textStyle:`xs`},trigger:{textStyle:`xs`,gap:`1`},item:{py:`1`,px:`2`},itemGroupLabel:{py:`1`,px:`2`},indicator:{_icon:{width:`3.5`,height:`3.5`}}},sm:{root:{"--select-trigger-height":`sizes.9`,"--select-trigger-padding-x":`spacing.2.5`},content:{p:`1`,textStyle:`sm`},trigger:{textStyle:`sm`,gap:`1`},indicator:{_icon:{width:`4`,height:`4`}},item:{py:`1`,px:`1.5`},itemGroup:{mt:`1`},itemGroupLabel:{py:`1`,px:`1.5`}},md:{root:{"--select-trigger-height":`sizes.10`,"--select-trigger-padding-x":`spacing.3`},content:{p:`1`,textStyle:`sm`},itemGroup:{mt:`1.5`},item:{py:`1.5`,px:`2`},itemIndicator:{display:`flex`,alignItems:`center`,justifyContent:`center`},itemGroupLabel:{py:`1.5`,px:`2`},trigger:{textStyle:`sm`,gap:`2`},indicator:{_icon:{width:`4`,height:`4`}}},lg:{root:{"--select-trigger-height":`sizes.12`,"--select-trigger-padding-x":`spacing.4`},content:{p:`1.5`,textStyle:`md`},itemGroup:{mt:`2`},item:{py:`2`,px:`3`},itemGroupLabel:{py:`2`,px:`3`},trigger:{textStyle:`md`,py:`3`,gap:`2`},indicator:{_icon:{width:`5`,height:`5`}}}}},defaultVariants:{size:`md`,variant:`outline`}}),VS=U({className:`chakra-native-select`,slots:Bx.keys(),base:{root:{height:`fit-content`,display:`flex`,width:`100%`,position:`relative`},field:{width:`100%`,minWidth:`0`,outline:`0`,appearance:`none`,borderRadius:`l2`,"--error-color":`colors.border.error`,"--input-height":`var(--select-field-height)`,height:`var(--select-field-height)`,_disabled:{layerStyle:`disabled`},_invalid:{focusRingColor:`var(--error-color)`,borderColor:`var(--error-color)`},focusVisibleRing:`inside`,lineHeight:`normal`,"& > option, & > optgroup":{bg:`bg`}},indicator:{position:`absolute`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,pointerEvents:`none`,top:`50%`,transform:`translateY(-50%)`,height:`100%`,color:`fg.muted`,_disabled:{opacity:`0.5`},_invalid:{color:`fg.error`},_icon:{width:`1em`,height:`1em`}}},variants:{variant:{outline:{field:BS.variants?.variant.outline.trigger},subtle:{field:BS.variants?.variant.subtle.trigger},plain:{field:{bg:`transparent`,color:`fg`,focusRingWidth:`2px`}},ghost:{field:BS.variants?.variant.ghost.trigger}},size:{xs:{root:{"--select-field-height":`sizes.8`},field:{textStyle:`xs`,ps:`2`,pe:`6`},indicator:{textStyle:`sm`,insetEnd:`1.5`}},sm:{root:{"--select-field-height":`sizes.9`},field:{textStyle:`sm`,ps:`2.5`,pe:`8`},indicator:{textStyle:`md`,insetEnd:`2`}},md:{root:{"--select-field-height":`sizes.10`},field:{textStyle:`sm`,ps:`3`,pe:`8`},indicator:{textStyle:`lg`,insetEnd:`2`}},lg:{root:{"--select-field-height":`sizes.11`},field:{textStyle:`md`,ps:`4`,pe:`8`},indicator:{textStyle:`xl`,insetEnd:`3`}},xl:{root:{"--select-field-height":`sizes.12`},field:{textStyle:`md`,ps:`4.5`,pe:`10`},indicator:{textStyle:`xl`,insetEnd:`3`}}}},defaultVariants:BS.defaultVariants}),HS=Bv({display:`flex`,justifyContent:`center`,alignItems:`center`,flex:`1`,userSelect:`none`,cursor:`button`,lineHeight:`1`,color:`fg.muted`,"--stepper-base-radius":`radii.l1`,"--stepper-radius":`calc(var(--stepper-base-radius) + 1px)`,_icon:{boxSize:`1em`},_disabled:{opacity:`0.5`},_hover:{bg:`bg.muted`},_active:{bg:`bg.emphasized`}}),US=U({className:`chakra-number-input`,slots:_m.keys(),base:{root:{position:`relative`,zIndex:`0`,isolation:`isolate`},input:{...fx.base,verticalAlign:`top`,pe:`calc(var(--stepper-width) + 0.5rem)`},control:{display:`flex`,flexDirection:`column`,position:`absolute`,top:`0`,insetEnd:`0px`,margin:`1px`,width:`var(--stepper-width)`,height:`calc(100% - 2px)`,zIndex:`1`,borderStartWidth:`1px`,divideY:`1px`},incrementTrigger:{...HS,borderTopEndRadius:`var(--stepper-radius)`},decrementTrigger:{...HS,borderBottomEndRadius:`var(--stepper-radius)`},valueText:{fontWeight:`medium`,fontFeatureSettings:`pnum`,fontVariantNumeric:`proportional-nums`}},variants:{size:{xs:{input:fx.variants.size.xs,control:{fontSize:`2xs`,"--stepper-width":`sizes.4`}},sm:{input:fx.variants.size.sm,control:{fontSize:`xs`,"--stepper-width":`sizes.5`}},md:{input:fx.variants.size.md,control:{fontSize:`sm`,"--stepper-width":`sizes.6`}},lg:{input:fx.variants.size.lg,control:{fontSize:`sm`,"--stepper-width":`sizes.6`}}},variant:ly(fx.variants.variant,(e,t)=>[e,{input:t}])},defaultVariants:{size:`md`,variant:`outline`}}),{variants:WS,defaultVariants:GS}=fx,KS=U({className:`chakra-pin-input`,slots:vm.keys(),base:{input:{...fx.base,textAlign:`center`,width:`var(--input-height)`},control:{display:`inline-flex`,gap:`2`,isolation:`isolate`}},variants:{size:ly(WS.size,(e,t)=>[e,{input:{...t,px:`1`}}]),variant:ly(WS.variant,(e,t)=>[e,{input:t}]),attached:{true:{control:{gap:`0`,spaceX:`-1px`},input:{_notFirst:{borderStartRadius:`0`},_notLast:{borderEndRadius:`0`},_focusVisible:{zIndex:`1`}}}}},defaultVariants:GS}),qS=U({className:`chakra-popover`,slots:Vx.keys(),base:{content:{position:`relative`,display:`flex`,flexDirection:`column`,textStyle:`sm`,"--popover-bg":`colors.bg.panel`,bg:`var(--popover-bg)`,boxShadow:`lg`,"--popover-size":`sizes.xs`,"--popover-mobile-size":`calc(100dvw - 1rem)`,width:{base:`min(var(--popover-mobile-size), var(--popover-size))`,sm:`var(--popover-size)`},borderRadius:`l3`,"--popover-z-index":`zIndex.popover`,zIndex:`calc(var(--popover-z-index) + var(--layer-index, 0))`,outline:`0`,transformOrigin:`var(--transform-origin)`,maxHeight:`var(--available-height)`,_open:{animationStyle:`scale-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`scale-fade-out`,animationDuration:`faster`}},header:{paddingInline:`var(--popover-padding)`,paddingTop:`var(--popover-padding)`},body:{padding:`var(--popover-padding)`,flex:`1`},footer:{display:`flex`,alignItems:`center`,paddingInline:`var(--popover-padding)`,paddingBottom:`var(--popover-padding)`},arrow:{"--arrow-size":`sizes.3`,"--arrow-background":`var(--popover-bg)`},arrowTip:{borderTopWidth:`1px`,borderLeftWidth:`1px`}},variants:{size:{xs:{content:{"--popover-padding":`spacing.3`}},sm:{content:{"--popover-padding":`spacing.4`}},md:{content:{"--popover-padding":`spacing.5`}},lg:{content:{"--popover-padding":`spacing.6`}}}},defaultVariants:{size:`md`}}),JS=U({slots:bm.keys(),className:`chakra-progress`,base:{root:{textStyle:`sm`,position:`relative`},track:{overflow:`hidden`,position:`relative`},range:{display:`flex`,alignItems:`center`,justifyContent:`center`,transitionProperty:`width, height`,transitionDuration:`slow`,height:`100%`,bgColor:`var(--track-color)`,_indeterminate:{"--animate-from-x":`-40%`,"--animate-to-x":`100%`,position:`absolute`,willChange:`left`,minWidth:`50%`,animation:`position 1s ease infinite normal none running`,backgroundImage:`linear-gradient(to right, transparent 0%, var(--track-color) 50%, transparent 100%)`}},label:{display:`inline-flex`,fontWeight:`medium`,alignItems:`center`,gap:`1`},valueText:{textStyle:`xs`,lineHeight:`1`,fontWeight:`medium`}},variants:{variant:{outline:{track:{shadow:`inset`,bgColor:`bg.muted`},range:{bgColor:`colorPalette.solid`}},subtle:{track:{bgColor:`colorPalette.muted`},range:{bgColor:`colorPalette.solid/72`}}},shape:{square:{},rounded:{track:{borderRadius:`l1`}},full:{track:{borderRadius:`full`}}},striped:{true:{range:{backgroundImage:`linear-gradient(45deg, var(--stripe-color) 25%, transparent 25%, transparent 50%, var(--stripe-color) 50%, var(--stripe-color) 75%, transparent 75%, transparent)`,backgroundSize:`var(--stripe-size) var(--stripe-size)`,"--stripe-size":`1rem`,"--stripe-color":{_light:`rgba(255, 255, 255, 0.3)`,_dark:`rgba(0, 0, 0, 0.3)`}}}},animated:{true:{range:{"--animate-from":`var(--stripe-size)`,animation:`bg-position 1s linear infinite`}}},size:{xs:{track:{h:`1.5`}},sm:{track:{h:`2`}},md:{track:{h:`2.5`}},lg:{track:{h:`3`}},xl:{track:{h:`4`}}}},defaultVariants:{variant:`outline`,size:`md`,shape:`rounded`}}),YS=U({className:`chakra-progress-circle`,slots:bm.keys(),base:{root:{display:`inline-flex`,textStyle:`sm`,position:`relative`},circle:{_indeterminate:{animation:`spin 2s linear infinite`}},circleTrack:{"--track-color":`colors.colorPalette.muted`,stroke:`var(--track-color)`},circleRange:{stroke:`colorPalette.solid`,transitionProperty:`stroke-dashoffset, stroke-dasharray`,transitionDuration:`0.6s`,_indeterminate:{animation:`circular-progress 1.5s linear infinite`}},label:{display:`inline-flex`},valueText:{lineHeight:`1`,fontWeight:`medium`,letterSpacing:`tight`,fontVariantNumeric:`tabular-nums`}},variants:{size:{xs:{circle:{"--size":`24px`,"--thickness":`4px`},valueText:{textStyle:`2xs`}},sm:{circle:{"--size":`32px`,"--thickness":`5px`},valueText:{textStyle:`2xs`}},md:{circle:{"--size":`40px`,"--thickness":`6px`},valueText:{textStyle:`xs`}},lg:{circle:{"--size":`48px`,"--thickness":`7px`},valueText:{textStyle:`sm`}},xl:{circle:{"--size":`64px`,"--thickness":`8px`},valueText:{textStyle:`sm`}}}},defaultVariants:{size:`md`}}),XS=U({slots:xm.keys(),className:`chakra-qr-code`,base:{root:{position:`relative`,width:`fit-content`,"--qr-code-overlay-size":`calc(var(--qr-code-size) / 3)`},frame:{width:`var(--qr-code-size)`,height:`var(--qr-code-size)`,fill:`currentColor`},overlay:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:`var(--qr-code-overlay-size)`,height:`var(--qr-code-overlay-size)`,padding:`1`,bg:`bg`,rounded:`l1`}},variants:{size:{"2xs":{root:{"--qr-code-size":`40px`}},xs:{root:{"--qr-code-size":`64px`}},sm:{root:{"--qr-code-size":`80px`}},md:{root:{"--qr-code-size":`120px`}},lg:{root:{"--qr-code-size":`160px`}},xl:{root:{"--qr-code-size":`200px`}},"2xl":{root:{"--qr-code-size":`240px`}},full:{root:{"--qr-code-size":`100%`}}}},defaultVariants:{size:`md`}}),ZS=U({className:`chakra-radio-card`,slots:Ux.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`,isolation:`isolate`},item:{flex:`1`,display:`flex`,flexDirection:`column`,userSelect:`none`,position:`relative`,borderRadius:`l2`,_focus:{bg:`colorPalette.muted/20`},_disabled:{opacity:`0.5`},_checked:{zIndex:`1`}},label:{display:`inline-flex`,fontWeight:`medium`,textStyle:`sm`,_disabled:{opacity:`0.5`}},itemText:{fontWeight:`medium`,flex:`1`},itemDescription:{opacity:`0.64`,textStyle:`sm`},itemControl:{display:`inline-flex`,flex:`1`,pos:`relative`,rounded:`inherit`,justifyContent:`var(--radio-card-justify)`,alignItems:`var(--radio-card-align)`,_disabled:{bg:`bg.muted`}},itemIndicator:_x.base,itemAddon:{roundedBottom:`inherit`,_disabled:{color:`fg.muted`}},itemContent:{display:`flex`,flexDirection:`column`,flex:`1`,gap:`1`,justifyContent:`var(--radio-card-justify)`,alignItems:`var(--radio-card-align)`}},variants:{size:{sm:{item:{textStyle:`sm`},itemControl:{padding:`3`,gap:`1.5`},itemAddon:{px:`3`,py:`1.5`,borderTopWidth:`1px`},itemIndicator:_x.variants?.size.sm},md:{item:{textStyle:`sm`},itemControl:{padding:`4`,gap:`2.5`},itemAddon:{px:`4`,py:`2`,borderTopWidth:`1px`},itemIndicator:_x.variants?.size.md},lg:{item:{textStyle:`md`},itemControl:{padding:`4`,gap:`3.5`},itemAddon:{px:`4`,py:`2`,borderTopWidth:`1px`},itemIndicator:_x.variants?.size.lg}},variant:{surface:{item:{borderWidth:`1px`,_checked:{bg:`colorPalette.subtle`,color:`colorPalette.fg`,borderColor:`colorPalette.muted`}},itemIndicator:_x.variants?.variant.solid},subtle:{item:{bg:`bg.muted`},itemControl:{_checked:{bg:`colorPalette.muted`,color:`colorPalette.fg`}},itemIndicator:_x.variants?.variant.outline},outline:{item:{borderWidth:`1px`,_checked:{boxShadow:`inset 0 0 0 1px var(--shadow-color)`,boxShadowColor:`colorPalette.solid`,borderColor:`colorPalette.solid`}},itemControl:{_disabled:{bg:`unset`}},itemIndicator:_x.variants?.variant.solid},solid:{item:{borderWidth:`1px`,_checked:{bg:`colorPalette.solid`,color:`colorPalette.contrast`,borderColor:`colorPalette.solid`}},itemControl:{_disabled:{bg:`unset`}},itemIndicator:_x.variants?.variant.inverted}},justify:{start:{item:{"--radio-card-justify":`flex-start`}},end:{item:{"--radio-card-justify":`flex-end`}},center:{item:{"--radio-card-justify":`center`}}},align:{start:{item:{"--radio-card-align":`flex-start`},itemControl:{textAlign:`start`}},end:{item:{"--radio-card-align":`flex-end`},itemControl:{textAlign:`end`}},center:{item:{"--radio-card-align":`center`},itemControl:{textAlign:`center`}}},orientation:{vertical:{itemControl:{flexDirection:`column`}},horizontal:{itemControl:{flexDirection:`row`}}}},defaultVariants:{size:`md`,variant:`outline`,align:`start`,orientation:`horizontal`}}),QS=U({className:`chakra-radio-group`,slots:Hx.keys(),base:{item:{display:`inline-flex`,alignItems:`center`,position:`relative`,fontWeight:`medium`,_disabled:{cursor:`disabled`}},itemControl:_x.base,label:{userSelect:`none`,textStyle:`sm`,_disabled:{opacity:`0.5`}}},variants:{variant:{outline:{itemControl:_x.variants?.variant?.outline},subtle:{itemControl:_x.variants?.variant?.subtle},solid:{itemControl:_x.variants?.variant?.solid}},size:{xs:{item:{textStyle:`xs`,gap:`1.5`},itemControl:_x.variants?.size?.xs},sm:{item:{textStyle:`sm`,gap:`2`},itemControl:_x.variants?.size?.sm},md:{item:{textStyle:`sm`,gap:`2.5`},itemControl:_x.variants?.size?.md},lg:{item:{textStyle:`md`,gap:`3`},itemControl:_x.variants?.size?.lg}}},defaultVariants:{size:`md`,variant:`solid`}}),$S=U({className:`chakra-rating-group`,slots:Wx.keys(),base:{root:{display:`inline-flex`},control:{display:`inline-flex`,alignItems:`center`},item:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,userSelect:`none`},itemIndicator:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:`1em`,height:`1em`,position:`relative`,"--clip-path":{base:`inset(0 50% 0 0)`,_rtl:`inset(0 0 0 50%)`},_icon:{stroke:`currentColor`,width:`100%`,height:`100%`,display:`inline-block`,flexShrink:0,position:`absolute`,left:0,top:0},"& [data-bg]":{color:`bg.emphasized`},"& [data-fg]":{color:`transparent`},"&[data-highlighted]:not([data-half])":{"& [data-fg]":{color:`colorPalette.solid`}},"&[data-half]":{"& [data-fg]":{color:`colorPalette.solid`,clipPath:`var(--clip-path)`}}}},variants:{size:{xs:{item:{textStyle:`sm`}},sm:{item:{textStyle:`md`}},md:{item:{textStyle:`xl`}},lg:{item:{textStyle:`2xl`}}}},defaultVariants:{size:`md`}}),eC=U({className:`chakra-scroll-area`,slots:wm.keys(),base:{root:{display:`flex`,flexDirection:`column`,width:`100%`,height:`100%`,position:`relative`,overflow:`hidden`,"--scrollbar-margin":`2px`,"--scrollbar-click-area":`calc(var(--scrollbar-size) + calc(var(--scrollbar-margin) * 2))`},viewport:{display:`flex`,flexDirection:`column`,height:`100%`,width:`100%`,borderRadius:`inherit`,WebkitOverflowScrolling:`touch`,scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}},content:{minWidth:`100%`},scrollbar:{display:`flex`,userSelect:`none`,touchAction:`none`,borderRadius:`full`,colorPalette:`gray`,transition:`opacity 150ms 300ms`,position:`relative`,margin:`var(--scrollbar-margin)`,"&:not([data-overflow-x], [data-overflow-y])":{display:`none`},bg:`{colors.colorPalette.solid/10}`,"--thumb-bg":`{colors.colorPalette.solid/25}`,"&:is(:hover, :active)":{"--thumb-bg":`{colors.colorPalette.solid/50}`},_before:{content:`""`,position:`absolute`},_vertical:{width:`var(--scrollbar-size)`,flexDirection:`column`,"&::before":{width:`var(--scrollbar-click-area)`,height:`100%`,insetInlineStart:`calc(var(--scrollbar-margin) * -1)`}},_horizontal:{height:`var(--scrollbar-size)`,flexDirection:`row`,"&::before":{height:`var(--scrollbar-click-area)`,width:`100%`,top:`calc(var(--scrollbar-margin) * -1)`}}},thumb:{borderRadius:`inherit`,bg:`var(--thumb-bg)`,transition:`backgrounds`,_vertical:{width:`full`},_horizontal:{height:`full`}},corner:{bg:`bg.muted`,margin:`var(--scrollbar-margin)`,opacity:0,transition:`opacity 150ms 300ms`,"&[data-hover]":{transitionDelay:`0ms`,opacity:1}}},variants:{variant:{hover:{scrollbar:{opacity:`0`,"&[data-hover], &[data-scrolling]":{opacity:`1`,transitionDuration:`faster`,transitionDelay:`0ms`}}},always:{scrollbar:{opacity:`1`}}},size:{xs:{root:{"--scrollbar-size":`sizes.1`}},sm:{root:{"--scrollbar-size":`sizes.1.5`}},md:{root:{"--scrollbar-size":`sizes.2`}},lg:{root:{"--scrollbar-size":`sizes.3`}}}},defaultVariants:{size:`md`,variant:`hover`}}),tC=U({className:`chakra-segment-group`,slots:Tm.keys(),base:{root:{"--segment-radius":`radii.l2`,"--segment-indicator-bg":{_light:`colors.bg`,_dark:`colors.bg.emphasized`},"--segment-indicator-shadow":`shadows.sm`,borderRadius:`var(--segment-radius)`,display:`inline-flex`,boxShadow:`inset`,minW:`max-content`,textAlign:`center`,position:`relative`,isolation:`isolate`,bg:`bg.muted`,_vertical:{flexDirection:`column`}},item:{display:`flex`,alignItems:`center`,justifyContent:`center`,userSelect:`none`,fontSize:`sm`,position:`relative`,color:`fg`,borderRadius:`var(--segment-radius)`,_disabled:{opacity:`0.5`},"&:has(input:focus-visible)":{focusRing:`outside`},_before:{content:`""`,position:`absolute`,bg:`border`,transition:`opacity 0.2s`},_horizontal:{_before:{insetInlineStart:0,insetBlock:`1.5`,width:`1px`}},_vertical:{_before:{insetBlockStart:0,insetInline:`1.5`,height:`1px`}},"& + &[data-state=checked], &[data-state=checked] + &, &:first-of-type":{_before:{opacity:`0`}},"&[data-state=checked][data-ssr]":{shadow:`sm`,bg:`bg`,borderRadius:`var(--segment-radius)`}},indicator:{shadow:`var(--segment-indicator-shadow)`,pos:`absolute`,bg:`var(--segment-indicator-bg)`,width:`var(--width)`,height:`var(--height)`,top:`var(--top)`,left:`var(--left)`,zIndex:-1,borderRadius:`var(--segment-radius)`}},variants:{size:{xs:{item:{textStyle:`xs`,px:`3`,gap:`1`,height:`6`}},sm:{item:{textStyle:`sm`,px:`4`,gap:`2`,height:`8`}},md:{item:{textStyle:`sm`,px:`4`,gap:`2`,height:`10`}},lg:{item:{textStyle:`md`,px:`4.5`,gap:`3`,height:`11`}}}},defaultVariants:{size:`md`}}),nC=U({className:`chakra-slider`,slots:qx.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1`,textStyle:`sm`,position:`relative`,isolation:`isolate`,touchAction:`none`},label:{fontWeight:`medium`,textStyle:`sm`},control:{display:`inline-flex`,alignItems:`center`,position:`relative`},track:{overflow:`hidden`,borderRadius:`full`,flex:`1`},range:{width:`inherit`,height:`inherit`,_disabled:{bg:`border.emphasized!`}},markerGroup:{position:`absolute!`,zIndex:`1`},marker:{"--marker-bg":{base:`white`,_underValue:`colors.bg`},display:`flex`,alignItems:`center`,gap:`calc(var(--slider-thumb-size) / 2)`,color:`fg.muted`,textStyle:`xs`},markerIndicator:{width:`var(--slider-marker-size)`,height:`var(--slider-marker-size)`,borderRadius:`full`,bg:`var(--marker-bg)`},thumb:{width:`var(--slider-thumb-size)`,height:`var(--slider-thumb-size)`,display:`flex`,alignItems:`center`,justifyContent:`center`,outline:0,zIndex:`2`,borderRadius:`full`,transition:`shadow`,_focusVisible:{ring:`3px`,ringColor:`colorPalette.focusRing/50`}}},variants:{size:{sm:{root:{"--slider-thumb-size":`sizes.4`,"--slider-track-size":`sizes.1.5`,"--slider-marker-center":`6px`,"--slider-marker-size":`sizes.1`,"--slider-marker-inset":`3px`}},md:{root:{"--slider-thumb-size":`sizes.5`,"--slider-track-size":`sizes.2`,"--slider-marker-center":`8px`,"--slider-marker-size":`sizes.1`,"--slider-marker-inset":`4px`}},lg:{root:{"--slider-thumb-size":`sizes.6`,"--slider-track-size":`sizes.2.5`,"--slider-marker-center":`9px`,"--slider-marker-size":`sizes.1.5`,"--slider-marker-inset":`5px`}}},variant:{outline:{track:{shadow:`inset`,bg:`bg.emphasized/72`},range:{bg:`colorPalette.solid`},thumb:{borderWidth:`2px`,borderColor:`colorPalette.solid`,bg:`bg`,_disabled:{bg:`border.emphasized`,borderColor:`border.emphasized`}}},solid:{track:{bg:`colorPalette.subtle`,_disabled:{bg:`bg.muted`}},range:{bg:`colorPalette.solid`},thumb:{bg:`colorPalette.solid`,_disabled:{bg:`border.emphasized`}}}},orientation:{vertical:{root:{display:`inline-flex`},control:{flexDirection:`column`,height:`100%`,minWidth:`var(--slider-thumb-size)`,"&:has(.chakra-slider__markerLabel)":{marginEnd:`4`}},track:{width:`var(--slider-track-size)`},thumb:{left:`50%`,translate:`-50% 0`},markerGroup:{insetStart:`var(--slider-marker-center)`,insetBlock:`var(--slider-marker-inset)`},marker:{flexDirection:`row`}},horizontal:{control:{flexDirection:`row`,width:`100%`,minHeight:`var(--slider-thumb-size)`,"&:has(.chakra-slider__markerLabel)":{marginBottom:`4`}},track:{height:`var(--slider-track-size)`},thumb:{top:`50%`,translate:`0 -50%`},markerGroup:{top:`var(--slider-marker-center)`,insetInline:`var(--slider-marker-inset)`},marker:{flexDirection:`column`}}}},defaultVariants:{size:`md`,variant:`outline`,orientation:`horizontal`}}),rC=U({slots:aS.keys(),className:`splitter`,base:{resizeTrigger:{"--splitter-border-color":`colors.border`,"--splitter-thumb-color":`colors.bg`,"--splitter-thumb-size":`sizes.2`,"--splitter-thumb-inset":`calc(var(--splitter-thumb-size) * -0.5)`,"--splitter-border-size":`1px`,"--splitter-handle-size":`sizes.6`,outline:`0`,display:`grid`,placeItems:`center`,position:`relative`,_focus:{"--splitter-border-color":`colors.border.emphasized`,"--splitter-thumb-color":`colors.colorPalette.subtle`},_dragging:{"--splitter-thumb-color":`colors.colorPalette.focusRing`},_horizontal:{minWidth:`var(--splitter-thumb-size)`,marginInline:`var(--splitter-thumb-inset)`},_vertical:{minHeight:`var(--splitter-thumb-size)`,marginBlock:`var(--splitter-thumb-inset)`}},resizeTriggerSeparator:{position:`absolute`,bg:`var(--splitter-border-color)`,"[data-part='resize-trigger'][data-orientation=horizontal] &":{insetInlineEnd:`calc(var(--splitter-thumb-size) * 0.5)`,insetBlock:`0`,insetInlineStart:`auto`,w:`var(--splitter-border-size)`},"[data-part='resize-trigger'][data-orientation=vertical] &":{insetBlockEnd:`calc(var(--splitter-thumb-size) * 0.5)`,insetInline:`0`,insetBlockStart:`auto`,h:`var(--splitter-border-size)`}},resizeTriggerIndicator:{position:`relative`,rounded:`full`,bg:`var(--splitter-thumb-color)`,shadow:`xs`,borderWidth:`1px`,zIndex:`1`,"[data-part='resize-trigger'][data-orientation=horizontal] &":{w:`full`,h:`var(--splitter-handle-size)`},"[data-part='resize-trigger'][data-orientation=vertical] &":{w:`var(--splitter-handle-size)`,h:`full`},"[data-part='resize-trigger'][data-focus]:focus-visible &":{outlineWidth:`2px`,outlineColor:`colorPalette.focusRing`,outlineStyle:`solid`},"[data-part='resize-trigger'][data-disabled] &":{visibility:`hidden`}}}}),iC=U({className:`chakra-stat`,slots:Jx.keys(),base:{root:{display:`flex`,flexDirection:`column`,gap:`1`,position:`relative`,flex:`1`},label:{display:`inline-flex`,gap:`1.5`,alignItems:`center`,color:`fg.muted`,textStyle:`sm`},helpText:{color:`fg.muted`,textStyle:`xs`},valueUnit:{color:`fg.muted`,textStyle:`xs`,fontWeight:`initial`,letterSpacing:`initial`},valueText:{verticalAlign:`baseline`,fontWeight:`semibold`,letterSpacing:`tight`,fontFeatureSettings:`pnum`,fontVariantNumeric:`proportional-nums`,display:`inline-flex`,gap:`1`},indicator:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,marginEnd:1,"& :where(svg)":{w:`1em`,h:`1em`},"&[data-type=up]":{color:`fg.success`},"&[data-type=down]":{color:`fg.error`}}},variants:{size:{sm:{valueText:{textStyle:`xl`}},md:{valueText:{textStyle:`2xl`}},lg:{valueText:{textStyle:`3xl`}}}},defaultVariants:{size:`md`}}),aC=U({className:`chakra-status`,slots:Yx.keys(),base:{root:{display:`inline-flex`,alignItems:`center`,gap:`2`},indicator:{width:`0.64em`,height:`0.64em`,flexShrink:0,borderRadius:`full`,forcedColorAdjust:`none`,bg:`colorPalette.solid`}},variants:{size:{sm:{root:{textStyle:`xs`}},md:{root:{textStyle:`sm`}},lg:{root:{textStyle:`md`}}}},defaultVariants:{size:`md`}}),oC=U({className:`chakra-steps`,slots:Xx.keys(),base:{root:{display:`flex`,width:`full`},list:{display:`flex`,justifyContent:`space-between`,"--steps-gutter":`spacing.3`,"--steps-thickness":`2px`},title:{fontWeight:`medium`,color:`fg`},description:{color:`fg.muted`},separator:{bg:`border`,flex:`1`},indicator:{display:`flex`,justifyContent:`center`,alignItems:`center`,flexShrink:`0`,borderRadius:`full`,fontWeight:`medium`,width:`var(--steps-size)`,height:`var(--steps-size)`,_icon:{flexShrink:`0`,width:`var(--steps-icon-size)`,height:`var(--steps-icon-size)`}},item:{position:`relative`,display:`flex`,gap:`3`,flex:`1 0 0`,"&:last-of-type":{flex:`initial`,"& [data-part=separator]":{display:`none`}}},trigger:{display:`flex`,alignItems:`center`,gap:`3`,textAlign:`start`,focusVisibleRing:`outside`,borderRadius:`l2`},content:{focusVisibleRing:`outside`}},variants:{orientation:{vertical:{root:{flexDirection:`row`,height:`100%`},list:{flexDirection:`column`,alignItems:`flex-start`},separator:{position:`absolute`,width:`var(--steps-thickness)`,height:`100%`,maxHeight:`calc(100% - var(--steps-size) - var(--steps-gutter) * 2)`,top:`calc(var(--steps-size) + var(--steps-gutter))`,insetStart:`calc(var(--steps-size) / 2 - 1px)`},item:{alignItems:`flex-start`}},horizontal:{root:{flexDirection:`column`,width:`100%`},list:{flexDirection:`row`,alignItems:`center`},separator:{width:`100%`,height:`var(--steps-thickness)`,marginX:`var(--steps-gutter)`},item:{alignItems:`center`}}},variant:{solid:{indicator:{_incomplete:{borderWidth:`var(--steps-thickness)`},_current:{bg:`colorPalette.muted`,borderWidth:`var(--steps-thickness)`,borderColor:`colorPalette.solid`,color:`colorPalette.fg`},_complete:{bg:`colorPalette.solid`,borderColor:`colorPalette.solid`,color:`colorPalette.contrast`}},separator:{_complete:{bg:`colorPalette.solid`}}},subtle:{indicator:{_incomplete:{bg:`bg.muted`},_current:{bg:`colorPalette.muted`,color:`colorPalette.fg`},_complete:{bg:`colorPalette.emphasized`,color:`colorPalette.fg`}},separator:{_complete:{bg:`colorPalette.emphasized`}}}},size:{xs:{root:{gap:`2.5`},list:{"--steps-size":`sizes.6`,"--steps-icon-size":`sizes.3.5`,textStyle:`xs`},title:{textStyle:`sm`}},sm:{root:{gap:`3`},list:{"--steps-size":`sizes.8`,"--steps-icon-size":`sizes.4`,textStyle:`xs`},title:{textStyle:`sm`}},md:{root:{gap:`4`},list:{"--steps-size":`sizes.10`,"--steps-icon-size":`sizes.4`,textStyle:`sm`},title:{textStyle:`sm`}},lg:{root:{gap:`6`},list:{"--steps-size":`sizes.11`,"--steps-icon-size":`sizes.5`,textStyle:`md`},title:{textStyle:`md`}}}},defaultVariants:{size:`md`,variant:`solid`,orientation:`horizontal`}}),sC=U({slots:Zx.keys(),className:`chakra-switch`,base:{root:{display:`inline-flex`,gap:`2.5`,alignItems:`center`,position:`relative`,verticalAlign:`middle`,"--switch-diff":`calc(var(--switch-width) - var(--switch-height))`,"--switch-x":{base:`var(--switch-diff)`,_rtl:`calc(var(--switch-diff) * -1)`}},label:{lineHeight:`1`,userSelect:`none`,fontSize:`sm`,fontWeight:`medium`,_disabled:{opacity:`0.5`}},indicator:{position:`absolute`,height:`var(--switch-height)`,width:`var(--switch-height)`,fontSize:`var(--switch-indicator-font-size)`,fontWeight:`medium`,flexShrink:0,userSelect:`none`,display:`grid`,placeContent:`center`,transition:`inset-inline-start 0.12s ease`,insetInlineStart:`calc(var(--switch-x) - 2px)`,_checked:{insetInlineStart:`2px`}},control:{display:`inline-flex`,gap:`0.5rem`,flexShrink:0,justifyContent:`flex-start`,cursor:`switch`,borderRadius:`full`,position:`relative`,width:`var(--switch-width)`,height:`var(--switch-height)`,transition:`backgrounds`,_disabled:{opacity:`0.5`,cursor:`not-allowed`},_invalid:{outline:`2px solid`,outlineColor:`border.error`,outlineOffset:`2px`}},thumb:{display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,transitionProperty:`translate`,transitionDuration:`fast`,borderRadius:`inherit`,_checked:{translate:`var(--switch-x) 0`}}},variants:{variant:{solid:{control:{borderRadius:`full`,bg:`bg.emphasized`,focusVisibleRing:`outside`,_checked:{bg:`colorPalette.solid`}},thumb:{bg:`white`,width:`var(--switch-height)`,height:`var(--switch-height)`,scale:`0.8`,boxShadow:`sm`,_checked:{bg:`colorPalette.contrast`}}},raised:{control:{borderRadius:`full`,height:`calc(var(--switch-height) / 2)`,bg:`bg.muted`,boxShadow:`inset`,_checked:{bg:`colorPalette.solid/60`}},thumb:{width:`var(--switch-height)`,height:`var(--switch-height)`,position:`relative`,top:`calc(var(--switch-height) * -0.25)`,bg:`white`,boxShadow:`xs`,focusVisibleRing:`outside`,_checked:{bg:`colorPalette.solid`}}}},size:{xs:{root:{"--switch-width":`sizes.6`,"--switch-height":`sizes.3`,"--switch-indicator-font-size":`fontSizes.xs`}},sm:{root:{"--switch-width":`sizes.8`,"--switch-height":`sizes.4`,"--switch-indicator-font-size":`fontSizes.xs`}},md:{root:{"--switch-width":`sizes.10`,"--switch-height":`sizes.5`,"--switch-indicator-font-size":`fontSizes.sm`}},lg:{root:{"--switch-width":`sizes.12`,"--switch-height":`sizes.6`,"--switch-indicator-font-size":`fontSizes.md`}}}},defaultVariants:{variant:`solid`,size:`md`}}),cC=U({className:`chakra-table`,slots:Qx.keys(),base:{root:{fontVariantNumeric:`lining-nums tabular-nums`,borderCollapse:`collapse`,width:`full`,textAlign:`start`,verticalAlign:`top`},row:{_selected:{bg:`colorPalette.subtle`}},cell:{textAlign:`start`,alignItems:`center`},columnHeader:{fontWeight:`medium`,textAlign:`start`,color:`fg`},caption:{fontWeight:`medium`,textStyle:`xs`},footer:{fontWeight:`medium`}},variants:{interactive:{true:{body:{"& tr":{_hover:{bg:`colorPalette.subtle`}}}}},stickyHeader:{true:{header:{"& :where(tr)":{top:`var(--table-sticky-offset, 0)`,position:`sticky`,zIndex:1}}}},striped:{true:{row:{"&:nth-of-type(odd) td":{bg:`bg.muted`}}}},showColumnBorder:{true:{columnHeader:{"&:not(:last-of-type)":{borderInlineEndWidth:`1px`}},cell:{"&:not(:last-of-type)":{borderInlineEndWidth:`1px`}}}},variant:{line:{columnHeader:{borderBottomWidth:`1px`},cell:{borderBottomWidth:`1px`},row:{bg:`bg`}},outline:{root:{boxShadow:`0 0 0 1px {colors.border}`},columnHeader:{borderBottomWidth:`1px`},header:{bg:`bg.muted`},row:{"&:not(:last-of-type)":{borderBottomWidth:`1px`}},footer:{borderTopWidth:`1px`}}},size:{sm:{root:{textStyle:`sm`},columnHeader:{px:`2`,py:`2`},cell:{px:`2`,py:`2`}},md:{root:{textStyle:`sm`},columnHeader:{px:`3`,py:`3`},cell:{px:`3`,py:`3`}},lg:{root:{textStyle:`md`},columnHeader:{px:`4`,py:`3`},cell:{px:`4`,py:`3`}}}},defaultVariants:{variant:`line`,size:`md`}}),lC=U({slots:eS.keys(),className:`chakra-tabs`,base:{root:{"--tabs-trigger-radius":`radii.l2`,"--tabs-indicator-shadow":`shadows.xs`,"--tabs-indicator-bg":`colors.bg`,position:`relative`,_horizontal:{display:`block`},_vertical:{display:`flex`}},list:{display:`inline-flex`,position:`relative`,isolation:`isolate`,minH:`var(--tabs-height)`,_horizontal:{flexDirection:`row`},_vertical:{flexDirection:`column`}},trigger:{outline:`0`,minW:`var(--tabs-height)`,height:`var(--tabs-height)`,display:`flex`,alignItems:`center`,fontWeight:`medium`,position:`relative`,cursor:`button`,gap:`2`,_focusVisible:{zIndex:1,outline:`2px solid`,outlineColor:`colorPalette.focusRing`},_disabled:{cursor:`not-allowed`,opacity:.5}},content:{focusVisibleRing:`inside`,_horizontal:{width:`100%`,pt:`var(--tabs-content-padding)`},_vertical:{height:`100%`,ps:`var(--tabs-content-padding)`}},indicator:{width:`var(--width)`,height:`var(--height)`,borderRadius:`var(--tabs-trigger-radius)`,bg:`var(--tabs-indicator-bg)`,shadow:`var(--tabs-indicator-shadow)`,zIndex:-1}},variants:{fitted:{true:{list:{display:`flex`},trigger:{flex:1,textAlign:`center`,justifyContent:`center`}}},justify:{start:{list:{justifyContent:`flex-start`}},center:{list:{justifyContent:`center`}},end:{list:{justifyContent:`flex-end`}}},size:{sm:{root:{"--tabs-height":`sizes.9`,"--tabs-content-padding":`spacing.3`},trigger:{py:`1`,px:`3`,textStyle:`sm`}},md:{root:{"--tabs-height":`sizes.10`,"--tabs-content-padding":`spacing.4`},trigger:{py:`2`,px:`4`,textStyle:`sm`}},lg:{root:{"--tabs-height":`sizes.11`,"--tabs-content-padding":`spacing.4.5`},trigger:{py:`2`,px:`4.5`,textStyle:`md`}}},variant:{line:{list:{display:`flex`,borderColor:`border`,_horizontal:{borderBottomWidth:`1px`},_vertical:{borderEndWidth:`1px`}},trigger:{color:`fg.muted`,_disabled:{_active:{bg:`initial`}},_selected:{color:`fg`,_horizontal:{layerStyle:`indicator.bottom`,"--indicator-offset-y":`-1px`,"--indicator-color":`colors.colorPalette.solid`},_vertical:{layerStyle:`indicator.end`,"--indicator-offset-x":`-1px`}}}},subtle:{trigger:{borderRadius:`var(--tabs-trigger-radius)`,color:`fg.muted`,_selected:{bg:`colorPalette.subtle`,color:`colorPalette.fg`}}},enclosed:{list:{bg:`bg.muted`,padding:`1`,borderRadius:`l3`,minH:`calc(var(--tabs-height) - 4px)`},trigger:{justifyContent:`center`,color:`fg.muted`,borderRadius:`var(--tabs-trigger-radius)`,_selected:{bg:`bg`,color:`colorPalette.fg`,shadow:`xs`}}},outline:{list:{"--line-thickness":`1px`,"--line-offset":`calc(var(--line-thickness) * -1)`,borderColor:`border`,display:`flex`,_horizontal:{_before:{content:`""`,position:`absolute`,bottom:`0px`,width:`100%`,borderBottomWidth:`var(--line-thickness)`,borderBottomColor:`border`}},_vertical:{_before:{content:`""`,position:`absolute`,insetInline:`var(--line-offset)`,height:`calc(100% - calc(var(--line-thickness) * 2))`,borderEndWidth:`var(--line-thickness)`,borderEndColor:`border`}}},trigger:{color:`fg.muted`,borderWidth:`1px`,borderColor:`transparent`,_selected:{bg:`currentBg`,color:`colorPalette.fg`},_horizontal:{borderTopRadius:`var(--tabs-trigger-radius)`,marginBottom:`var(--line-offset)`,marginEnd:{_notLast:`var(--line-offset)`},_selected:{borderColor:`border`,borderBottomColor:`transparent`}},_vertical:{borderStartRadius:`var(--tabs-trigger-radius)`,marginEnd:`var(--line-offset)`,marginBottom:{_notLast:`var(--line-offset)`},_selected:{borderColor:`border`,borderEndColor:`transparent`}}}},plain:{trigger:{color:`fg.muted`,_selected:{color:`colorPalette.fg`},borderRadius:`var(--tabs-trigger-radius)`,"&[data-selected][data-ssr]":{bg:`var(--tabs-indicator-bg)`,shadow:`var(--tabs-indicator-shadow)`,borderRadius:`var(--tabs-trigger-radius)`}}}}},defaultVariants:{size:`md`,variant:`line`}}),uC=nx.variants?.variant,dC=U({slots:tS.keys(),className:`chakra-tag`,base:{root:{display:`inline-flex`,alignItems:`center`,verticalAlign:`top`,maxWidth:`100%`,userSelect:`none`,borderRadius:`l2`,focusVisibleRing:`outside`},label:{lineClamp:`1`},closeTrigger:{display:`flex`,alignItems:`center`,justifyContent:`center`,outline:`0`,borderRadius:`l1`,color:`currentColor`,focusVisibleRing:`inside`,focusRingWidth:`2px`},startElement:{flexShrink:0,boxSize:`var(--tag-element-size)`,ms:`var(--tag-element-offset)`,"&:has([data-scope=avatar])":{boxSize:`var(--tag-avatar-size)`,ms:`calc(var(--tag-element-offset) * 1.5)`},_icon:{boxSize:`100%`}},endElement:{flexShrink:0,boxSize:`var(--tag-element-size)`,me:`var(--tag-element-offset)`,_icon:{boxSize:`100%`},"&:has(button)":{ms:`calc(var(--tag-element-offset) * -1)`}}},variants:{size:{sm:{root:{px:`1.5`,minH:`4.5`,gap:`1`,"--tag-avatar-size":`spacing.3`,"--tag-element-size":`spacing.3`,"--tag-element-offset":`-2px`},label:{textStyle:`xs`}},md:{root:{px:`1.5`,minH:`5`,gap:`1`,"--tag-avatar-size":`spacing.3.5`,"--tag-element-size":`spacing.3.5`,"--tag-element-offset":`-2px`},label:{textStyle:`xs`}},lg:{root:{px:`2`,minH:`6`,gap:`1.5`,"--tag-avatar-size":`spacing.4.5`,"--tag-element-size":`spacing.4`,"--tag-element-offset":`-3px`},label:{textStyle:`sm`}},xl:{root:{px:`2.5`,minH:`8`,gap:`1.5`,"--tag-avatar-size":`spacing.6`,"--tag-element-size":`spacing.4.5`,"--tag-element-offset":`-4px`},label:{textStyle:`sm`}}},variant:{subtle:{root:uC?.subtle},solid:{root:uC?.solid},outline:{root:uC?.outline},surface:{root:uC?.surface}}},defaultVariants:{size:`md`,variant:`surface`}}),fC=U({slots:yg.keys(),className:`tags-input`,base:{root:{display:`flex`,flexDirection:`column`,gap:`1.5`,width:`full`},label:{fontWeight:`medium`,textStyle:`sm`,_disabled:{opacity:`0.5`}},control:{"--focus-color":`colors.colorPalette.focusRing`,"--error-color":`colors.border.error`,minH:`var(--tags-input-height)`,"--input-height":`var(--tags-input-height)`,px:`var(--tags-input-px)`,py:`var(--tags-input-py)`,gap:`var(--tags-input-gap)`,display:`flex`,flexWrap:`wrap`,alignItems:`center`,borderRadius:`l2`,pos:`relative`,transitionProperty:`border-color, box-shadow`,transitionDuration:`normal`,_disabled:{opacity:`0.5`},_invalid:{borderColor:`var(--error-color)`}},input:{flex:`1`,minWidth:`20`,outline:`none`,bg:`transparent`,color:`fg`,px:`calc(var(--tags-input-item-px) / 1.25)`,height:`var(--tags-input-item-height)`,_readOnly:{display:`none`}},item:{maxWidth:`100%`,minWidth:`0`},itemText:{lineClamp:`1`,minWidth:`0`},itemInput:{outline:`none`,bg:`transparent`,minWidth:`2ch`,color:`inherit`,px:`var(--tags-input-item-px)`,height:`var(--tags-input-item-height)`},itemPreview:{height:`var(--tags-input-item-height)`,userSelect:`none`,display:`inline-flex`,alignItems:`center`,gap:`1`,rounded:`l1`,px:`var(--tags-input-item-px)`,maxWidth:`100%`},itemDeleteTrigger:{display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:`0`,boxSize:`calc(var(--tags-input-item-height) / 1.5)`,cursor:{base:`button`,_disabled:`initial`},me:`-1`,opacity:`0.4`,_hover:{opacity:`1`},"[data-highlighted] &":{opacity:`1`},_icon:{boxSize:`80%`}},clearTrigger:{display:`flex`,alignItems:`center`,justifyContent:`center`,boxSize:`calc(var(--tags-input-item-height) / 1.5)`,cursor:{base:`button`,_disabled:`initial`},color:`fg.muted`,focusVisibleRing:`inside`,focusRingWidth:`2px`,rounded:`l1`,_icon:{boxSize:`5`}}},variants:{size:{xs:{root:{"--tags-input-height":`sizes.8`,"--tags-input-px":`spacing.1.5`,"--tags-input-py":`spacing.1`,"--tags-input-gap":`spacing.1`,"--tags-input-item-height":`sizes.6`,"--tags-input-item-px":`spacing.2`,textStyle:`xs`}},sm:{root:{"--tags-input-height":`sizes.9`,"--tags-input-px":`spacing.1.5`,"--tags-input-py":`spacing.1`,"--tags-input-gap":`spacing.1`,"--tags-input-item-height":`sizes.6`,"--tags-input-item-px":`spacing.2`,textStyle:`sm`}},md:{root:{"--tags-input-height":`sizes.10`,"--tags-input-px":`spacing.1.5`,"--tags-input-py":`spacing.1`,"--tags-input-gap":`spacing.1`,"--tags-input-item-height":`sizes.7`,"--tags-input-item-px":`spacing.2`,textStyle:`sm`}},lg:{root:{"--tags-input-height":`sizes.11`,"--tags-input-px":`spacing.1.5`,"--tags-input-py":`spacing.1`,"--tags-input-gap":`spacing.1`,"--tags-input-item-height":`sizes.8`,"--tags-input-item-px":`spacing.2`,textStyle:`md`}}},variant:{outline:{control:{borderWidth:`1px`,bg:`bg`,_focus:{outlineWidth:`1px`,outlineStyle:`solid`,outlineColor:`var(--focus-color)`,borderColor:`var(--focus-color)`,_invalid:{outlineColor:`var(--error-color)`,borderColor:`var(--error-color)`}}},itemPreview:{bg:`colorPalette.subtle`,_highlighted:{bg:`colorPalette.muted`}}},subtle:{control:{bg:`bg.muted`,borderWidth:`1px`,borderColor:`transparent`,_focus:{outlineWidth:`1px`,outlineStyle:`solid`,outlineColor:`var(--focus-color)`,borderColor:`var(--focus-color)`,_invalid:{outlineColor:`var(--error-color)`,borderColor:`var(--error-color)`}}},itemPreview:{bg:`bg`,borderWidth:`1px`,_highlighted:{bg:`colorPalette.subtle`,borderColor:`colorPalette.emphasized`}}},flushed:{control:{borderRadius:`0`,px:`0`,bg:`transparent`,borderBottomWidth:`1px`,borderBottomColor:`border`,_focus:{borderColor:`var(--focus-color)`,boxShadow:`0px 1px 0px 0px var(--focus-color)`}},itemPreview:{bg:`colorPalette.subtle`,_highlighted:{bg:`colorPalette.muted`}}}}},defaultVariants:{size:`md`,variant:`outline`}}),pC=U({slots:nS.keys(),className:`chakra-timeline`,base:{root:{display:`flex`,flexDirection:`column`,width:`full`,"--timeline-thickness":`1px`,"--timeline-gutter":`4px`},item:{"--timeline-content-gap":`spacing.6`,display:`flex`,position:`relative`,alignItems:`flex-start`,flexShrink:0,gap:`4`,_last:{"--timeline-content-gap":`0`}},separator:{display:`var(--timeline-separator-display)`,position:`absolute`,borderStartWidth:`var(--timeline-thickness)`,ms:`calc(-1 * var(--timeline-thickness) / 2)`,insetInlineStart:`calc(var(--timeline-indicator-size) / 2)`,insetBlock:`0`,borderColor:`border`},indicator:{outline:`2px solid {colors.bg}`,position:`relative`,flexShrink:`0`,boxSize:`var(--timeline-indicator-size)`,fontSize:`var(--timeline-font-size)`,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:`full`,fontWeight:`medium`},connector:{alignSelf:`stretch`,position:`relative`},content:{pb:`var(--timeline-content-gap)`,display:`flex`,flexDirection:`column`,width:`full`,gap:`2`},title:{display:`flex`,fontWeight:`medium`,flexWrap:`wrap`,gap:`1.5`,alignItems:`center`,mt:`var(--timeline-margin)`},description:{color:`fg.muted`,textStyle:`xs`}},variants:{variant:{subtle:{indicator:{bg:`colorPalette.muted`}},solid:{indicator:{bg:`colorPalette.solid`,color:`colorPalette.contrast`}},outline:{indicator:{bg:`currentBg`,borderWidth:`1px`,borderColor:`colorPalette.muted`}},plain:{}},showLastSeparator:{true:{item:{_last:{"--timeline-separator-display":`initial`}}},false:{item:{_last:{"--timeline-separator-display":`none`}}}},size:{sm:{root:{"--timeline-indicator-size":`sizes.4`,"--timeline-font-size":`fontSizes.2xs`},title:{textStyle:`xs`}},md:{root:{"--timeline-indicator-size":`sizes.5`,"--timeline-font-size":`fontSizes.xs`},title:{textStyle:`sm`}},lg:{root:{"--timeline-indicator-size":`sizes.6`,"--timeline-font-size":`fontSizes.xs`},title:{mt:`0.5`,textStyle:`sm`}},xl:{root:{"--timeline-indicator-size":`sizes.8`,"--timeline-font-size":`fontSizes.sm`},title:{mt:`1.5`,textStyle:`sm`}}}},defaultVariants:{size:`md`,variant:`solid`,showLastSeparator:!1}}),mC=U({slots:$x.keys(),className:`chakra-toast`,base:{root:{width:`full`,display:`flex`,alignItems:`flex-start`,position:`relative`,gap:`3`,py:`4`,ps:`4`,pe:`6`,borderRadius:`l2`,translate:`var(--x) var(--y)`,scale:`var(--scale)`,zIndex:`var(--z-index)`,height:`var(--height)`,opacity:`var(--opacity)`,willChange:`translate, opacity, scale`,transition:`translate 400ms, scale 400ms, opacity 400ms, height 400ms, box-shadow 200ms`,transitionTimingFunction:`cubic-bezier(0.21, 1.02, 0.73, 1)`,_closed:{transition:`translate 400ms, scale 400ms, opacity 200ms`,transitionTimingFunction:`cubic-bezier(0.06, 0.71, 0.55, 1)`},bg:`bg.panel`,color:`fg`,boxShadow:`xl`,"--toast-trigger-bg":`colors.bg.muted`,"&[data-type=warning]":{bg:`orange.solid`,color:`orange.contrast`,"--toast-trigger-bg":`{white/10}`,"--toast-border-color":`{white/40}`},"&[data-type=success]":{bg:`green.solid`,color:`green.contrast`,"--toast-trigger-bg":`{white/10}`,"--toast-border-color":`{white/40}`},"&[data-type=error]":{bg:`red.solid`,color:`red.contrast`,"--toast-trigger-bg":`{white/10}`,"--toast-border-color":`{white/40}`}},title:{fontWeight:`medium`,textStyle:`sm`,marginEnd:`2`},description:{display:`inline`,textStyle:`sm`,opacity:`0.8`},indicator:{flexShrink:`0`,boxSize:`5`},actionTrigger:{textStyle:`sm`,fontWeight:`medium`,height:`8`,px:`3`,borderRadius:`l2`,alignSelf:`center`,borderWidth:`1px`,borderColor:`var(--toast-border-color, inherit)`,transition:`background 200ms`,_hover:{bg:`var(--toast-trigger-bg)`}},closeTrigger:{position:`absolute`,top:`1`,insetEnd:`1`,padding:`1`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,color:`{currentColor/60}`,borderRadius:`l2`,textStyle:`md`,transition:`background 200ms`,_icon:{boxSize:`1em`}}}}),hC=U({slots:xg.keys(),className:`chakra-tooltip`,base:{content:{"--tooltip-bg":`colors.bg.inverted`,bg:`var(--tooltip-bg)`,color:`fg.inverted`,px:`2.5`,py:`1`,borderRadius:`l2`,fontWeight:`medium`,textStyle:`xs`,boxShadow:`md`,maxW:`xs`,zIndex:`tooltip`,transformOrigin:`var(--transform-origin)`,_open:{animationStyle:`scale-fade-in`,animationDuration:`fast`},_closed:{animationStyle:`scale-fade-out`,animationDuration:`fast`}},arrow:{"--arrow-size":`sizes.2`,"--arrow-background":`var(--tooltip-bg)`},arrowTip:{borderTopWidth:`1px`,borderLeftWidth:`1px`,borderColor:`var(--tooltip-bg)`}}}),gC=Bv({display:`flex`,alignItems:`center`,gap:`var(--tree-item-gap)`,rounded:`l2`,userSelect:`none`,position:`relative`,"--tree-depth":`calc(var(--depth) - 1)`,"--tree-indentation-offset":`calc(var(--tree-indentation) * var(--tree-depth))`,"--tree-offset":`calc(var(--tree-padding-inline) + var(--tree-indentation-offset))`,ps:`var(--tree-offset)`,pe:`var(--tree-padding-inline)`,py:`var(--tree-padding-block)`,focusVisibleRing:`inside`,focusRingColor:`border.emphasized`,focusRingWidth:`2px`,"&:hover, &:focus-visible":{bg:`bg.muted`},_disabled:{layerStyle:`disabled`}}),_C=Bv({flex:`1`}),vC=Bv({_selected:{bg:`colorPalette.subtle`,color:`colorPalette.fg`}}),yC=Bv({_selected:{layerStyle:`fill.solid`}}),bC={accordion:sS,actionBar:cS,alert:lS,avatar:uS,blockquote:dS,breadcrumb:fS,card:pS,carousel:mS,checkbox:hS,checkboxCard:gS,codeBlock:_S,collapsible:vS,dataList:xS,dateInput:SS,datePicker:TS,dialog:ES,drawer:DS,editable:kS,emptyState:AS,field:jS,fieldset:MS,fileUpload:NS,hoverCard:FS,list:IS,listbox:LS,menu:zS,nativeSelect:VS,numberInput:US,pinInput:KS,popover:qS,progress:JS,progressCircle:YS,radioCard:ZS,radioGroup:QS,ratingGroup:$S,scrollArea:eC,segmentGroup:tC,select:BS,combobox:bS,slider:nC,splitter:rC,stat:iC,steps:oC,switch:sC,table:cC,tabs:lC,tag:dC,tagsInput:fC,toast:mC,tooltip:hC,status:aC,timeline:pC,colorPicker:yS,qrCode:XS,treeView:U({slots:Sg.keys(),className:`chakra-tree-view`,base:{root:{width:`full`,display:`flex`,flexDirection:`column`,gap:`2`},tree:{display:`flex`,flexDirection:`column`,"--tree-item-gap":`spacing.2`,"--tree-indentation":`calc(var(--tree-indent-size) + var(--tree-icon-size) * 0.5)`,_icon:{boxSize:`var(--tree-icon-size)`}},label:{fontWeight:`medium`,textStyle:`sm`},branch:{position:`relative`},branchContent:{position:`relative`},branchIndentGuide:{height:`100%`,width:`1px`,bg:`border`,position:`absolute`,"--tree-depth":`calc(var(--depth) - 1)`,"--tree-indentation-offset":`calc(var(--tree-indentation) * var(--tree-depth))`,"--tree-offset":`calc(var(--tree-padding-inline) + var(--tree-indentation-offset))`,insetInlineStart:`calc(var(--tree-offset) + var(--tree-icon-size) * 0.5)`,zIndex:`1`},branchIndicator:{color:`fg.muted`,transformOrigin:`center`,transitionDuration:`normal`,transitionProperty:`transform`,transitionTimingFunction:`default`,_open:{transform:`rotate(90deg)`}},branchTrigger:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`},branchControl:gC,item:gC,itemText:_C,branchText:_C,nodeCheckbox:{display:`inline-flex`}},variants:{size:{md:{tree:{textStyle:`sm`,"--tree-indent-size":`spacing.4`,"--tree-icon-size":`spacing.4`,"--tree-padding-inline":`spacing.3`,"--tree-padding-block":`spacing.1.5`}},sm:{tree:{textStyle:`sm`,"--tree-indent-size":`spacing.4`,"--tree-icon-size":`spacing.3`,"--tree-padding-inline":`spacing.3`,"--tree-padding-block":`spacing.1`}},xs:{tree:{textStyle:`xs`,"--tree-indent-size":`spacing.4`,"--tree-icon-size":`spacing.3`,"--tree-padding-inline":`spacing.2`,"--tree-padding-block":`spacing.1`}}},variant:{subtle:{branchControl:vC,item:vC},solid:{branchControl:yC,item:yC}},animateContent:{true:{branchContent:{_open:{animationName:`expand-height, fade-in`,animationDuration:`moderate`},_closed:{animationName:`collapse-height, fade-out`,animationDuration:`moderate`}}}}},defaultVariants:{size:`md`,variant:`subtle`}}),marquee:RS,floatingPanel:PS},xC=Vv({"2xs":{value:{fontSize:`2xs`,lineHeight:`0.75rem`}},xs:{value:{fontSize:`xs`,lineHeight:`1rem`}},sm:{value:{fontSize:`sm`,lineHeight:`1.25rem`}},md:{value:{fontSize:`md`,lineHeight:`1.5rem`}},lg:{value:{fontSize:`lg`,lineHeight:`1.75rem`}},xl:{value:{fontSize:`xl`,lineHeight:`1.875rem`}},"2xl":{value:{fontSize:`2xl`,lineHeight:`2rem`}},"3xl":{value:{fontSize:`3xl`,lineHeight:`2.375rem`}},"4xl":{value:{fontSize:`4xl`,lineHeight:`2.75rem`,letterSpacing:`-0.025em`}},"5xl":{value:{fontSize:`5xl`,lineHeight:`3.75rem`,letterSpacing:`-0.025em`}},"6xl":{value:{fontSize:`6xl`,lineHeight:`4.5rem`,letterSpacing:`-0.025em`}},"7xl":{value:{fontSize:`7xl`,lineHeight:`5.75rem`,letterSpacing:`-0.025em`}},none:{value:{}},label:{value:{fontSize:`sm`,lineHeight:`1.25rem`,fontWeight:`medium`}}}),SC=Gv.animations({spin:{value:`spin 1s linear infinite`},ping:{value:`ping 1s cubic-bezier(0, 0, 0.2, 1) infinite`},pulse:{value:`pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite`},bounce:{value:`bounce 1s infinite`}}),CC=Gv.aspectRatios({square:{value:`1 / 1`},landscape:{value:`4 / 3`},portrait:{value:`3 / 4`},wide:{value:`16 / 9`},ultrawide:{value:`18 / 5`},golden:{value:`1.618 / 1`}}),wC=Gv.blurs({none:{value:` `},sm:{value:`4px`},md:{value:`8px`},lg:{value:`12px`},xl:{value:`16px`},"2xl":{value:`24px`},"3xl":{value:`40px`},"4xl":{value:`64px`}}),TC=Gv.borders({xs:{value:`0.5px solid`},sm:{value:`1px solid`},md:{value:`2px solid`},lg:{value:`4px solid`},xl:{value:`8px solid`}}),EC=Gv.colors({transparent:{value:`transparent`},current:{value:`currentColor`},black:{value:`#09090B`},white:{value:`#FFFFFF`},whiteAlpha:{50:{value:`rgba(255, 255, 255, 0.04)`},100:{value:`rgba(255, 255, 255, 0.06)`},200:{value:`rgba(255, 255, 255, 0.08)`},300:{value:`rgba(255, 255, 255, 0.16)`},400:{value:`rgba(255, 255, 255, 0.24)`},500:{value:`rgba(255, 255, 255, 0.36)`},600:{value:`rgba(255, 255, 255, 0.48)`},700:{value:`rgba(255, 255, 255, 0.64)`},800:{value:`rgba(255, 255, 255, 0.80)`},900:{value:`rgba(255, 255, 255, 0.92)`},950:{value:`rgba(255, 255, 255, 0.95)`}},blackAlpha:{50:{value:`rgba(0, 0, 0, 0.04)`},100:{value:`rgba(0, 0, 0, 0.06)`},200:{value:`rgba(0, 0, 0, 0.08)`},300:{value:`rgba(0, 0, 0, 0.16)`},400:{value:`rgba(0, 0, 0, 0.24)`},500:{value:`rgba(0, 0, 0, 0.36)`},600:{value:`rgba(0, 0, 0, 0.48)`},700:{value:`rgba(0, 0, 0, 0.64)`},800:{value:`rgba(0, 0, 0, 0.80)`},900:{value:`rgba(0, 0, 0, 0.92)`},950:{value:`rgba(0, 0, 0, 0.95)`}},gray:{50:{value:`#fafafa`},100:{value:`#f4f4f5`},200:{value:`#e4e4e7`},300:{value:`#d4d4d8`},400:{value:`#a1a1aa`},500:{value:`#71717a`},600:{value:`#52525b`},700:{value:`#3f3f46`},800:{value:`#27272a`},900:{value:`#18181b`},950:{value:`#111111`}},red:{50:{value:`#fef2f2`},100:{value:`#fee2e2`},200:{value:`#fecaca`},300:{value:`#fca5a5`},400:{value:`#f87171`},500:{value:`#ef4444`},600:{value:`#dc2626`},700:{value:`#991919`},800:{value:`#511111`},900:{value:`#300c0c`},950:{value:`#1f0808`}},orange:{50:{value:`#fff7ed`},100:{value:`#ffedd5`},200:{value:`#fed7aa`},300:{value:`#fdba74`},400:{value:`#fb923c`},500:{value:`#f97316`},600:{value:`#ea580c`},700:{value:`#92310a`},800:{value:`#6c2710`},900:{value:`#3b1106`},950:{value:`#220a04`}},yellow:{50:{value:`#fefce8`},100:{value:`#fef9c3`},200:{value:`#fef08a`},300:{value:`#fde047`},400:{value:`#facc15`},500:{value:`#eab308`},600:{value:`#ca8a04`},700:{value:`#845209`},800:{value:`#713f12`},900:{value:`#422006`},950:{value:`#281304`}},green:{50:{value:`#f0fdf4`},100:{value:`#dcfce7`},200:{value:`#bbf7d0`},300:{value:`#86efac`},400:{value:`#4ade80`},500:{value:`#22c55e`},600:{value:`#16a34a`},700:{value:`#116932`},800:{value:`#124a28`},900:{value:`#042713`},950:{value:`#03190c`}},teal:{50:{value:`#f0fdfa`},100:{value:`#ccfbf1`},200:{value:`#99f6e4`},300:{value:`#5eead4`},400:{value:`#2dd4bf`},500:{value:`#14b8a6`},600:{value:`#0d9488`},700:{value:`#0c5d56`},800:{value:`#114240`},900:{value:`#032726`},950:{value:`#021716`}},blue:{50:{value:`#eff6ff`},100:{value:`#dbeafe`},200:{value:`#bfdbfe`},300:{value:`#a3cfff`},400:{value:`#60a5fa`},500:{value:`#3b82f6`},600:{value:`#2563eb`},700:{value:`#173da6`},800:{value:`#1a3478`},900:{value:`#14204a`},950:{value:`#0c142e`}},cyan:{50:{value:`#ecfeff`},100:{value:`#cffafe`},200:{value:`#a5f3fc`},300:{value:`#67e8f9`},400:{value:`#22d3ee`},500:{value:`#06b6d4`},600:{value:`#0891b2`},700:{value:`#0c5c72`},800:{value:`#134152`},900:{value:`#072a38`},950:{value:`#051b24`}},purple:{50:{value:`#faf5ff`},100:{value:`#f3e8ff`},200:{value:`#e9d5ff`},300:{value:`#d8b4fe`},400:{value:`#c084fc`},500:{value:`#a855f7`},600:{value:`#9333ea`},700:{value:`#641ba3`},800:{value:`#4a1772`},900:{value:`#2f0553`},950:{value:`#1a032e`}},pink:{50:{value:`#fdf2f8`},100:{value:`#fce7f3`},200:{value:`#fbcfe8`},300:{value:`#f9a8d4`},400:{value:`#f472b6`},500:{value:`#ec4899`},600:{value:`#db2777`},700:{value:`#a41752`},800:{value:`#6d0e34`},900:{value:`#45061f`},950:{value:`#2c0514`}}}),DC=Gv.cursor({button:{value:`pointer`},checkbox:{value:`default`},disabled:{value:`not-allowed`},menuitem:{value:`default`},option:{value:`default`},radio:{value:`default`},slider:{value:`default`},switch:{value:`pointer`}}),OC=Gv.durations({fastest:{value:`50ms`},faster:{value:`100ms`},fast:{value:`150ms`},moderate:{value:`200ms`},slow:{value:`300ms`},slower:{value:`400ms`},slowest:{value:`500ms`}}),kC=Gv.easings({"ease-in":{value:`cubic-bezier(0.42, 0, 1, 1)`},"ease-out":{value:`cubic-bezier(0, 0, 0.58, 1)`},"ease-in-out":{value:`cubic-bezier(0.42, 0, 0.58, 1)`},"ease-in-smooth":{value:`cubic-bezier(0.32, 0.72, 0, 1)`}}),AC=Gv.fontSizes({"2xs":{value:`0.625rem`},xs:{value:`0.75rem`},sm:{value:`0.875rem`},md:{value:`1rem`},lg:{value:`1.125rem`},xl:{value:`1.25rem`},"2xl":{value:`1.5rem`},"3xl":{value:`1.875rem`},"4xl":{value:`2.25rem`},"5xl":{value:`3rem`},"6xl":{value:`3.75rem`},"7xl":{value:`4.5rem`},"8xl":{value:`6rem`},"9xl":{value:`8rem`}}),jC=Gv.fontWeights({thin:{value:`100`},extralight:{value:`200`},light:{value:`300`},normal:{value:`400`},medium:{value:`500`},semibold:{value:`600`},bold:{value:`700`},extrabold:{value:`800`},black:{value:`900`}}),MC=`-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"`,NC=Gv.fonts({heading:{value:`Inter, ${MC}`},body:{value:`Inter, ${MC}`},mono:{value:`SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace`}}),PC=Rv({spin:{"0%":{transform:`rotate(0deg)`},"100%":{transform:`rotate(360deg)`}},pulse:{"50%":{opacity:`0.5`}},ping:{"75%, 100%":{transform:`scale(2)`,opacity:`0`}},bounce:{"0%, 100%":{transform:`translateY(-25%)`,animationTimingFunction:`cubic-bezier(0.8,0,1,1)`},"50%":{transform:`none`,animationTimingFunction:`cubic-bezier(0,0,0.2,1)`}},"bg-position":{from:{backgroundPosition:`var(--animate-from, 1rem) 0`},to:{backgroundPosition:`var(--animate-to, 0) 0`}},position:{from:{insetInlineStart:`var(--animate-from-x)`,insetBlockStart:`var(--animate-from-y)`},to:{insetInlineStart:`var(--animate-to-x)`,insetBlockStart:`var(--animate-to-y)`}},"circular-progress":{"0%":{strokeDasharray:`1, 400`,strokeDashoffset:`0`},"50%":{strokeDasharray:`400, 400`,strokeDashoffset:`-100%`},"100%":{strokeDasharray:`400, 400`,strokeDashoffset:`-260%`}},"expand-height":{from:{height:`var(--collapsed-height, 0)`},to:{height:`var(--height)`}},"collapse-height":{from:{height:`var(--height)`},to:{height:`var(--collapsed-height, 0)`}},"expand-width":{from:{width:`var(--collapsed-width, 0)`},to:{width:`var(--width)`}},"collapse-width":{from:{width:`var(--width)`},to:{width:`var(--collapsed-width, 0)`}},"fade-in":{from:{opacity:0},to:{opacity:1}},"fade-out":{from:{opacity:1},to:{opacity:0}},"slide-from-left-full":{from:{translate:`-100% 0`},to:{translate:`0 0`}},"slide-from-right-full":{from:{translate:`100% 0`},to:{translate:`0 0`}},"slide-from-top-full":{from:{translate:`0 -100%`},to:{translate:`0 0`}},"slide-from-bottom-full":{from:{translate:`0 100%`},to:{translate:`0 0`}},"slide-to-left-full":{from:{translate:`0 0`},to:{translate:`-100% 0`}},"slide-to-right-full":{from:{translate:`0 0`},to:{translate:`100% 0`}},"slide-to-top-full":{from:{translate:`0 0`},to:{translate:`0 -100%`}},"slide-to-bottom-full":{from:{translate:`0 0`},to:{translate:`0 100%`}},"slide-from-top":{"0%":{translate:`0 calc(var(--slide-from-top-distance, 0.5rem) * -1)`},to:{translate:`0`}},"slide-from-bottom":{"0%":{translate:`0 var(--slide-from-bottom-distance, 0.5rem)`},to:{translate:`0`}},"slide-from-left":{"0%":{translate:`calc(var(--slide-from-left-distance, 0.5rem) * -1) 0`},to:{translate:`0`}},"slide-from-right":{"0%":{translate:`var(--slide-from-right-distance, 0.5rem) 0`},to:{translate:`0`}},"slide-to-top":{"0%":{translate:`0`},to:{translate:`0 calc(var(--slide-to-top-distance, 0.5rem) * -1)`}},"slide-to-bottom":{"0%":{translate:`0`},to:{translate:`0 var(--slide-to-bottom-distance, 0.5rem)`}},"slide-to-left":{"0%":{translate:`0`},to:{translate:`calc(var(--slide-to-left-distance, 0.5rem) * -1) 0`}},"slide-to-right":{"0%":{translate:`0`},to:{translate:`var(--slide-to-right-distance, 0.5rem) 0`}},"scale-in":{from:{scale:`0.95`},to:{scale:`1`}},"scale-out":{from:{scale:`1`},to:{scale:`0.95`}},marqueeX:{from:{transform:`translateX(0%)`},to:{transform:`translateX(var(--marquee-translate))`}},marqueeY:{from:{transform:`translateY(0%)`},to:{transform:`translateY(var(--marquee-translate))`}}}),FC=Gv.letterSpacings({tighter:{value:`-0.05em`},tight:{value:`-0.025em`},wide:{value:`0.025em`},wider:{value:`0.05em`},widest:{value:`0.1em`}}),IC=Gv.lineHeights({shorter:{value:1.25},short:{value:1.375},moderate:{value:1.5},tall:{value:1.625},taller:{value:2}}),LC=Gv.radii({none:{value:`0`},"2xs":{value:`0.0625rem`},xs:{value:`0.125rem`},sm:{value:`0.25rem`},md:{value:`0.375rem`},lg:{value:`0.5rem`},xl:{value:`0.75rem`},"2xl":{value:`1rem`},"3xl":{value:`1.5rem`},"4xl":{value:`2rem`},full:{value:`9999px`}}),RC=Gv.spacing({.5:{value:`0.125rem`},1:{value:`0.25rem`},1.5:{value:`0.375rem`},2:{value:`0.5rem`},2.5:{value:`0.625rem`},3:{value:`0.75rem`},3.5:{value:`0.875rem`},4:{value:`1rem`},4.5:{value:`1.125rem`},5:{value:`1.25rem`},6:{value:`1.5rem`},7:{value:`1.75rem`},8:{value:`2rem`},9:{value:`2.25rem`},10:{value:`2.5rem`},11:{value:`2.75rem`},12:{value:`3rem`},14:{value:`3.5rem`},16:{value:`4rem`},20:{value:`5rem`},24:{value:`6rem`},28:{value:`7rem`},32:{value:`8rem`},36:{value:`9rem`},40:{value:`10rem`},44:{value:`11rem`},48:{value:`12rem`},52:{value:`13rem`},56:{value:`14rem`},60:{value:`15rem`},64:{value:`16rem`},72:{value:`18rem`},80:{value:`20rem`},96:{value:`24rem`}}),zC=Gv.sizes({"3xs":{value:`14rem`},"2xs":{value:`16rem`},xs:{value:`20rem`},sm:{value:`24rem`},md:{value:`28rem`},lg:{value:`32rem`},xl:{value:`36rem`},"2xl":{value:`42rem`},"3xl":{value:`48rem`},"4xl":{value:`56rem`},"5xl":{value:`64rem`},"6xl":{value:`72rem`},"7xl":{value:`80rem`},"8xl":{value:`90rem`}}),BC=Gv.sizes({max:{value:`max-content`},min:{value:`min-content`},fit:{value:`fit-content`},prose:{value:`60ch`},full:{value:`100%`},dvh:{value:`100dvh`},svh:{value:`100svh`},lvh:{value:`100lvh`},dvw:{value:`100dvw`},svw:{value:`100svw`},lvw:{value:`100lvw`},vw:{value:`100vw`},vh:{value:`100vh`}}),VC=Gv.sizes({"1/2":{value:`50%`},"1/3":{value:`33.333333%`},"2/3":{value:`66.666667%`},"1/4":{value:`25%`},"3/4":{value:`75%`},"1/5":{value:`20%`},"2/5":{value:`40%`},"3/5":{value:`60%`},"4/5":{value:`80%`},"1/6":{value:`16.666667%`},"2/6":{value:`33.333333%`},"3/6":{value:`50%`},"4/6":{value:`66.666667%`},"5/6":{value:`83.333333%`},"1/12":{value:`8.333333%`},"2/12":{value:`16.666667%`},"3/12":{value:`25%`},"4/12":{value:`33.333333%`},"5/12":{value:`41.666667%`},"6/12":{value:`50%`},"7/12":{value:`58.333333%`},"8/12":{value:`66.666667%`},"9/12":{value:`75%`},"10/12":{value:`83.333333%`},"11/12":{value:`91.666667%`}}),HC=Fv(vee,qv({preflight:!0,cssVarsPrefix:`chakra`,cssVarsRoot:`:where(html, .chakra-theme)`,globalCss:$b,theme:{breakpoints:Zb,keyframes:PC,tokens:{aspectRatios:CC,animations:SC,blurs:wC,borders:TC,colors:EC,durations:OC,easings:kC,fonts:NC,fontSizes:AC,fontWeights:jC,letterSpacings:FC,lineHeights:IC,radii:LC,spacing:RC,sizes:Gv.sizes({...zC,...RC,...VC,...BC}),zIndex:Gv.zIndex({hide:{value:-1},base:{value:0},docked:{value:10},dropdown:{value:1e3},sticky:{value:1100},banner:{value:1200},overlay:{value:1300},modal:{value:1400},popover:{value:1500},skipNav:{value:1600},toast:{value:1700},tooltip:{value:1800},max:{value:2147483647}}),cursor:DC},semanticTokens:{colors:yx,shadows:xx,radii:bx},recipes:vx,slotRecipes:bC,textStyles:xC,layerStyles:ex,animationStyles:tx}}));Kb(HC);var UC=yn(`div`,{base:{position:`absolute`,display:`flex`,alignItems:`center`,justifyContent:`center`},variants:{axis:{horizontal:{insetStart:`50%`,translate:`-50%`,_rtl:{translate:`50%`}},vertical:{top:`50%`,translate:`0 -50%`},both:{insetStart:`50%`,top:`50%`,translate:`-50% -50%`,_rtl:{translate:`50% -50%`}}}},defaultVariants:{axis:`both`}});UC.displayName=`AbsoluteCenter`;var WC=e=>(0,F.jsx)(yn.svg,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:(0,F.jsx)(`path`,{d:`M20 6 9 17l-5-5`})}),GC=e=>(0,F.jsx)(yn.svg,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:(0,F.jsx)(`path`,{d:`m6 9 6 6 6-6`})}),KC=e=>(0,F.jsx)(yn.svg,{viewBox:`0 0 24 24`,fill:`currentColor`,...e,children:(0,F.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M18.7071 6.70711C19.0976 6.31658 19.0976 5.68342 18.7071 5.29289C18.3166 4.90237 17.6834 4.90237 17.2929 5.29289L12 10.5858L6.70711 5.29289C6.31658 4.90237 5.68342 4.90237 5.29289 5.29289C4.90237 5.68342 4.90237 6.31658 5.29289 6.70711L10.5858 12L5.29289 17.2929C4.90237 17.6834 4.90237 18.3166 5.29289 18.7071C5.68342 19.0976 6.31658 19.0976 6.70711 18.7071L12 13.4142L17.2929 18.7071C17.6834 19.0976 18.3166 19.0976 18.7071 18.7071C19.0976 18.3166 19.0976 17.6834 18.7071 17.2929L13.4142 12L18.7071 6.70711Z`})}),{PropsProvider:Iee,withContext:qC}=On({key:`badge`}),JC=qC(`span`),{withContext:YC,PropsProvider:Lee}=On({key:`spinner`}),XC=YC(`span`),ZC=P.forwardRef(function(e,t){let{spinner:n=(0,F.jsx)(XC,{size:`inherit`,borderWidth:`0.125em`,color:`inherit`}),spinnerPlacement:r=`start`,children:i,text:a,visible:o=!0,...s}=e;return o?a?(0,F.jsxs)(Js,{ref:t,display:`contents`,...s,children:[r===`start`&&n,a,r===`end`&&n]}):n?(0,F.jsxs)(Js,{ref:t,display:`contents`,...s,children:[(0,F.jsx)(UC,{display:`inline-flex`,children:n}),(0,F.jsx)(Js,{visibility:`hidden`,display:`contents`,children:i})]}):(0,F.jsx)(Js,{ref:t,display:`contents`,...s,children:i}):i});ZC.displayName=`Loader`;var{useRecipeResult:QC,PropsProvider:Ree,usePropsContext:$C}=On({key:`button`}),ew=(0,P.forwardRef)(function(e,t){let n=$C(),r=(0,P.useMemo)(()=>Bt(n,e),[n,e]),i=QC(r),{loading:a,loadingText:o,children:s,spinner:c,spinnerPlacement:l,...u}=i.props;return(0,F.jsx)(yn.button,{type:`button`,ref:t,...u,"data-loading":R(a),disabled:a||u.disabled,className:Jt(i.className,r.className),css:[i.styles,r.css],children:!r.asChild&&a?(0,F.jsx)(ZC,{spinner:c,text:o,spinnerPlacement:l,children:s}):s})});ew.displayName=`Button`;var tw=(0,P.forwardRef)(function(e,t){let n=Dn({key:`checkmark`,recipe:e.recipe}),[r,i]=n.splitVariantProps(e),{checked:a,indeterminate:o,disabled:s,unstyled:c,children:l,css:u,...d}=i,f=c?Tn:n(r);return(0,F.jsx)(yn.svg,{ref:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3px`,strokeLinecap:`round`,strokeLinejoin:`round`,"data-state":o?`indeterminate`:a?`checked`:`unchecked`,"data-disabled":R(s),css:[f,u],...d,children:o?(0,F.jsx)(`path`,{d:`M5 12h14`}):a?(0,F.jsx)(`polyline`,{points:`20 6 9 17 4 12`}):null})});tw.displayName=`Checkmark`;var{withProvider:nw,withContext:rw,useStyles:iw,PropsProvider:zee}=Lc({key:`checkbox`});nw(a_.RootProvider,`root`,{forwardAsChild:!0});var aw=nw(a_.Root,`root`,{forwardAsChild:!0}),ow=rw(a_.Label,`label`,{forwardAsChild:!0}),sw=(0,P.forwardRef)(function(e,t){let{checked:n,indeterminate:r,...i}=e,a=Tg(),o=iw();return n&&a.checked?(0,F.jsx)(yn.svg,{ref:t,asChild:!0,...i,css:[o.indicator,e.css],children:n}):r&&a.indeterminate?(0,F.jsx)(yn.svg,{ref:t,asChild:!0,...i,css:[o.indicator,e.css],children:r}):(0,F.jsx)(tw,{ref:t,checked:a.checked,indeterminate:a.indeterminate,disabled:a.disabled,unstyled:!0,...i,css:[o.indicator,e.css]})}),cw=rw(a_.Control,`control`,{forwardAsChild:!0,defaultProps:{children:(0,F.jsx)(sw,{})}});yn(a_.Group,{base:{display:`flex`,flexDirection:`column`,gap:`1.5`}},{forwardAsChild:!0}),a_.Context;var lw=a_.HiddenInput,uw=(0,P.forwardRef)(function(e,t){return(0,F.jsx)(ew,{px:`0`,py:`0`,_icon:{fontSize:`1.2em`},ref:t,...e})});uw.displayName=`IconButton`;var dw=P.forwardRef(function(e,t){return(0,F.jsx)(uw,{variant:`ghost`,"aria-label":`Close`,ref:t,...e,children:e.children??(0,F.jsx)(KC,{})})});dw.displayName=`CloseButton`;function fw(e){let{gap:t,direction:n}=e,r={column:{marginY:t,marginX:0,borderInlineStartWidth:0,borderTopWidth:`1px`},"column-reverse":{marginY:t,marginX:0,borderInlineStartWidth:0,borderTopWidth:`1px`},row:{marginX:t,marginY:0,borderInlineStartWidth:`1px`,borderTopWidth:0},"row-reverse":{marginX:t,marginY:0,borderInlineStartWidth:`1px`,borderTopWidth:0}};return{"&":Mv(n,e=>r[e])}}function pw(e){return P.Children.toArray(e).filter(e=>(0,P.isValidElement)(e))}var mw=(0,P.forwardRef)(function(e,t){let{direction:n=`column`,align:r,justify:i,gap:a=`0.5rem`,wrap:o,children:s,separator:c,className:l,...u}=e,d=(0,P.useMemo)(()=>fw({gap:a,direction:n}),[a,n]),f=(0,P.useMemo)(()=>(0,P.isValidElement)(c)?pw(s).map((e,t,n)=>{let r=e.key===void 0?t:e.key,i=c,a=(0,P.cloneElement)(i,{css:[d,i.props.css]});return(0,F.jsxs)(P.Fragment,{children:[e,t===n.length-1?null:a]},r)}):s,[s,c,d]);return(0,F.jsx)(yn.div,{ref:t,display:`flex`,alignItems:r,justifyContent:i,flexDirection:n,flexWrap:o,gap:c?void 0:a,className:Jt(`chakra-stack`,l),...u,children:f})});mw.displayName=`Stack`;var{withRootProvider:hw,withContext:gw,useStyles:Bee,PropsProvider:Vee}=Lc({key:`dialog`});hw(__.RootProvider,{defaultProps:{unmountOnExit:!0,lazyMount:!0}});var _w=hw(__.Root,{defaultProps:{unmountOnExit:!0,lazyMount:!0}});gw(__.Trigger,`trigger`,{forwardAsChild:!0});var vw=gw(__.Positioner,`positioner`,{forwardAsChild:!0}),yw=gw(__.Content,`content`,{forwardAsChild:!0});gw(__.Description,`description`,{forwardAsChild:!0});var bw=gw(__.Title,`title`,{forwardAsChild:!0}),xw=gw(__.CloseTrigger,`closeTrigger`,{forwardAsChild:!0});(0,P.forwardRef)(function(e,t){let n=c_();return(0,F.jsx)(yn.button,{type:`button`,...e,ref:t,onClick:t=>{e.onClick?.(t),n.setOpen(!1)}})});var Sw=gw(__.Backdrop,`backdrop`,{forwardAsChild:!0}),Cw=gw(`div`,`body`);gw(`div`,`footer`);var ww=gw(`div`,`header`);__.Context;var{useRecipeResult:Tw,PropsProvider:Hee}=On({key:`icon`}),Ew=P.forwardRef(function(e,t){let{styles:n,className:r,props:i}=Tw({asChild:!e.as,...e});return(0,F.jsx)(yn.svg,{ref:t,focusable:!1,"aria-hidden":`true`,...i,css:[n,e.css],className:Jt(r,e.className)})});function Dw(e){let{viewBox:t=`0 0 24 24`,d:n,displayName:r,defaultProps:i={}}=e,a=P.Children.toArray(e.path),o=(0,P.forwardRef)((e,r)=>(0,F.jsx)(Ew,{ref:r,asChild:!1,viewBox:t,...i,...e,children:a.length?a:(0,F.jsx)(`path`,{fill:`currentColor`,d:n})}));return o.displayName=r,o}var{withProvider:Ow,withContext:kw,useStyles:Aw,useClassNames:jw,PropsProvider:Uee}=Lc({key:`field`}),Mw=Ow($g.Root,`root`,{forwardAsChild:!0}),Nw=kw($g.Label,`label`,{forwardAsChild:!0}),Pw=kw($g.HelperText,`helperText`,{forwardAsChild:!0}),Fw=kw($g.ErrorText,`errorText`,{forwardAsChild:!0});Dw({d:`M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z`,defaultProps:{boxSize:`1em`}}),(0,P.forwardRef)(function(e,t){let{fallback:n,children:r=`*`,...i}=e,a=Rg(),o=jw(),s=Aw();return a?.required?(0,F.jsx)(yn.span,{ref:t,"aria-hidden":`true`,...i,className:Jt(o.requiredIndicator,e.className),css:[s.requiredIndicator,e.css],children:r}):n});var W=(0,P.forwardRef)(function(e,t){return(0,F.jsx)(mw,{align:`center`,...e,direction:`row`,ref:t})});W.displayName=`HStack`;var Iw=(0,P.forwardRef)(function(e,t){let{align:n,fit:r=`cover`,...i}=e;return(0,F.jsx)(yn.img,{ref:t,objectFit:r,objectPosition:n,...i,className:Jt(`chakra-image`,e.className)})});Iw.displayName=`Image`;var{withContext:Lw,PropsProvider:Wee}=On({key:`input`}),Rw=Lw($g.Input),{withProvider:zw,withContext:Bw,useStyles:Gee,PropsProvider:Kee}=Lc({key:`list`}),Vw=zw(`ul`,`root`,{defaultProps:{role:`list`}}),Hw=Bw(`li`,`item`);Bw(`span`,`indicator`);var[Uw,Ww]=$t({name:`NativeSelectBasePropsContext`,hookName:`useNativeSelectBaseProps`,providerName:`<NativeSelectRoot />`,strict:!1}),{withProvider:Gw,useClassNames:Kw,useStyles:qw,PropsProvider:qee}=Lc({key:`nativeSelect`}),Jw=Gw(`div`,`root`,{wrapElement(e,t){let n=Rg(),r=!!(n?.disabled??t.disabled),i=!!(n?.invalid??t.invalid);return(0,F.jsx)(Uw,{value:{disabled:r,invalid:i},children:e})}}),Yw=yn($g.Select,{},{forwardAsChild:!0}),Xw=(0,P.forwardRef)(function(e,t){let{children:n,placeholder:r,unstyled:i,...a}=e,{disabled:o,invalid:s}=Ww(),c=qw(),l=Kw();return(0,F.jsxs)(Yw,{disabled:o,"data-invalid":R(s),...a,ref:t,className:Jt(l.field,e.className),css:[i?void 0:c.field,e.css],children:[r&&(0,F.jsx)(`option`,{value:``,children:r}),n]})}),{withProvider:Zw,withContext:Qw,useStyles:Jee,PropsProvider:Yee}=Lc({key:`select`});Zw(J_.RootProvider,`root`,{forwardAsChild:!0});var $w=Zw(J_.Root,`root`,{forwardAsChild:!0,defaultProps:{positioning:{sameWidth:!0}}}),eT=Qw(J_.Trigger,`trigger`,{forwardAsChild:!0}),tT=Qw(J_.Positioner,`positioner`,{forwardAsChild:!0}),nT=Qw(J_.Content,`content`,{forwardAsChild:!0});Qw(J_.List,`list`,{forwardAsChild:!0});var rT=Qw(J_.ValueText,`valueText`,{forwardAsChild:!0});Qw(J_.ClearTrigger,`clearTrigger`,{forwardAsChild:!0,defaultProps:{children:(0,F.jsx)(KC,{boxSize:`1em`})}}),Qw(J_.ItemGroup,`itemGroup`,{forwardAsChild:!0}),Qw(J_.ItemGroupLabel,`itemGroupLabel`,{forwardAsChild:!0});var iT=Qw(J_.Item,`item`,{forwardAsChild:!0});Qw(J_.ItemText,`itemText`,{forwardAsChild:!0}),Qw(J_.ItemIndicator,`itemIndicator`,{forwardAsChild:!0,defaultProps:{children:(0,F.jsx)(WC,{})}}),Qw(`div`,`indicatorGroup`),Qw(J_.Indicator,`indicator`,{forwardAsChild:!0,defaultProps:{children:(0,F.jsx)(GC,{})}});var aT=Qw(J_.Control,`control`,{forwardAsChild:!0});Qw(J_.Label,`label`,{forwardAsChild:!0}),J_.Context;var oT=J_.HiddenSelect;J_.ItemContext;var{withProvider:sT,withContext:cT,useStyles:Xee,PropsProvider:Zee}=Lc({key:`splitter`});sT(uv.RootProvider,`root`,{forwardAsChild:!0});var lT=sT(uv.Root,`root`,{forwardAsChild:!0}),uT=cT(uv.Panel,`panel`,{forwardAsChild:!0}),dT=cT(`div`,`resizeTriggerSeparator`),fT=cT(uv.ResizeTriggerIndicator,`resizeTriggerIndicator`),pT=cT(uv.ResizeTrigger,`resizeTrigger`,{forwardAsChild:!0,defaultProps:{"aria-label":`Resize`,children:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(dT,{}),(0,F.jsx)(fT,{})]})}});uv.Context;var{withProvider:mT,withContext:hT,useStyles:gT,PropsProvider:Qee}=Lc({key:`switch`});mT(Cv.RootProvider,`root`,{forwardAsChild:!0});var _T=mT(Cv.Root,`root`,{forwardAsChild:!0}),vT=hT(Cv.Label,`label`,{forwardAsChild:!0}),yT=hT(Cv.Thumb,`thumb`,{forwardAsChild:!0}),bT=hT(Cv.Control,`control`,{forwardAsChild:!0,defaultProps:{children:(0,F.jsx)(yT,{})}});(0,P.forwardRef)(function(e,t){let n=fv(),r=gT(),{fallback:i,children:a,unstyled:o,...s}=e;return(0,F.jsx)(yn.span,{ref:t,"data-checked":R(n.checked),...s,css:[o?void 0:r.indicator,e.css],children:n.checked?a:i})}),(0,P.forwardRef)(function(e,t){let n=fv(),{fallback:r,children:i,...a}=e;return(0,F.jsx)(yn.span,{ref:t,"data-checked":R(n.checked),...a,children:n.checked?i:r})}),Cv.Context;var xT=Cv.HiddenInput,{StylesProvider:ST,ClassNamesProvider:CT,useRecipeResult:wT,withContext:TT,useStyles:$ee,PropsProvider:ete}=Lc({key:`table`}),ET=(0,P.forwardRef)(function({native:e,...t},n){let{styles:r,props:i,classNames:a}=wT(t),o=(0,P.useMemo)(()=>e?{...r.root,"& thead":r.header,"& tbody":r.body,"& tfoot":r.footer,"& thead th":r.columnHeader,"& tr":r.row,"& td":r.cell,"& caption":r.caption}:r.root,[r,e]);return(0,F.jsx)(CT,{value:a,children:(0,F.jsx)(ST,{value:r,children:(0,F.jsx)(yn.table,{ref:n,...i,css:[o,t.css],className:Jt(a?.root,t.className)})})})}),DT=TT(`tr`,`row`),OT=yn(`div`,{base:{display:`block`,whiteSpace:`nowrap`,WebkitOverflowScrolling:`touch`,overflow:`auto`,maxWidth:`100%`}}),kT=TT(`thead`,`header`);TT(`tfoot`,`footer`);var AT=TT(`th`,`columnHeader`),jT=TT(`td`,`cell`);TT(`caption`,`caption`,{defaultProps:{captionSide:`bottom`}});var MT=TT(`tbody`,`body`);TT(`colgroup`),TT(`col`);var{withContext:NT,PropsProvider:tte}=On({key:`textarea`}),PT=NT($g.Textarea),FT=(0,P.forwardRef)(function(e,t){return(0,F.jsx)(mw,{align:`center`,...e,direction:`column`,ref:t})});FT.displayName=`VStack`;var IT=P.createContext(void 0),LT=e=>{let t=P.useContext(IT);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},RT=({client:e,children:t})=>(P.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,F.jsx)(IT.Provider,{value:e,children:t})),zT={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},BT=new class{#e=zT;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function VT(e){setTimeout(e,0)}var HT=typeof window>`u`||`Deno`in globalThis;function UT(){}function WT(e,t){return typeof e==`function`?e(t):e}function GT(e){return typeof e==`number`&&e>=0&&e!==1/0}function KT(e,t){return Math.max(e+(t||0)-Date.now(),0)}function qT(e,t){return typeof e==`function`?e(t):e}function JT(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==XT(o,t.options))return!1}else if(!QT(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function YT(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ZT(t.options.mutationKey)!==ZT(a))return!1}else if(!QT(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function XT(e,t){return(t?.queryKeyHashFn||ZT)(e)}function ZT(e){return JSON.stringify(e,(e,t)=>rE(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function QT(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!QT(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!QT(e[r],t[r]))return!1;return!0}return!1}var $T=Object.prototype.hasOwnProperty;function eE(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=nE(e)&&nE(t);if(!r&&!(rE(e)&&rE(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:$T.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=eE(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function tE(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function nE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function rE(e){if(!iE(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!iE(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function iE(e){return Object.prototype.toString.call(e)===`[object Object]`}function aE(e){return new Promise(t=>{BT.setTimeout(t,e)})}function oE(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:eE(e,t)}function sE(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function cE(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var lE=Symbol();function uE(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===lE?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function dE(e,t){return typeof e==`function`?e(...t):!!e}function fE(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var pE=()=>HT,mE=()=>pE(),hE=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},gE=new class extends hE{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},_E=VT;function vE(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=_E,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var yE=vE(),bE=new class extends hE{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function xE(e){return Math.min(1e3*2**e,3e4)}function SE(e){return(e??`online`)!==`online`||bE.isOnline()}var CE=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function wE(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(UT);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new CE(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>gE.isFocused()&&(e.networkMode===`always`||bE.isOnline())&&e.canRun(),p=()=>SE(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(mE()?0:3),a=e.retryDelay??xE,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),aE(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var TE=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),GT(this.gcTime)&&(this.#e=BT.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(mE()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(BT.clearTimeout(this.#e),this.#e=void 0)}};function EE(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{fE(e,()=>t.signal,()=>n=!0)},u=uE(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?cE:sE;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?OE:DE,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:DE(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function DE(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function OE(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var kE=class extends TE{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ME(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=ME(this.options);e.data!==void 0&&(this.setState(jE(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=oE(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(UT).catch(UT):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>qT(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===lE||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>qT(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!KT(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=uE(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?EE(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=wE({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof CE&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof CE){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...AE(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...jE(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),yE.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function AE(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:SE(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function jE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ME(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var NE=class extends hE{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),FE(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return IE(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return IE(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof qT(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!tE(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&LE(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||qT(this.options.enabled,this.#t)!==qT(t.enabled,this.#t)||qT(this.options.staleTime,this.#t)!==qT(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||qT(this.options.enabled,this.#t)!==qT(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return tE(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(UT)),t}#h(e){return!mE()&&qT(this.options.enabled,this.#t)!==!1&&GT(e)}#g(){this.#b();let e=qT(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=KT(this.#r.dataUpdatedAt,e)+1;this.#u=BT.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return qT(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=BT.setInterval(()=>{(this.options.refetchIntervalInBackground||gE.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(BT.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(BT.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&FE(e,t),o=i&&LE(e,n,t,r);(a||o)&&(l={...l,...AE(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=oE(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=oE(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:RE(e,t),refetch:this.refetch,isEnabled:qT(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),tE(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();yE.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function PE(e,t){return qT(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||qT(t.retryOnMount,e)!==!1)}function FE(e,t){return PE(e,t)||e.state.data!==void 0&&IE(e,t,t.refetchOnMount)}function IE(e,t,n){if(qT(t.enabled,e)!==!1&&qT(t.staleTime,e)!==`static`){let r=qT(n,e);return r===`always`||r!==!1&&RE(e,t)}return!1}function LE(e,t,n,r){return(e!==t||qT(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&RE(e,n)}function RE(e,t){return qT(t.enabled,e)!==!1&&e.isStaleByTime(qT(t.staleTime,e))}var zE=class extends TE{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||BE(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=wE({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),yE.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function BE(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var VE=class extends hE{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new zE({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=HE(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=HE(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=HE(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=HE(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){yE.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>YT(t,e))}findAll(e={}){return this.getAll().filter(t=>YT(e,t))}notify(e){yE.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return yE.batch(()=>Promise.all(e.map(e=>e.continue().catch(UT))))}};function HE(e){return e.options.scope?.id}var UE=class extends hE{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),tE(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&ZT(t.mutationKey)!==ZT(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??BE();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){yE.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},WE=class extends hE{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??XT(r,t),a=this.get(i);return a||(a=new kE({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){yE.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>JT(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>JT(e,t)):t}notify(e){yE.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){yE.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){yE.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},GE=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new WE,this.#t=e.mutationCache||new VE,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=gE.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=bE.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(qT(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=WT(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return yE.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;yE.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return yE.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=yE.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(UT).catch(UT)}invalidateQueries(e,t={}){return yE.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=yE.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(UT)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(UT)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(qT(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(qT(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(UT).catch(UT)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(UT).catch(UT)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return bE.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(ZT(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{QT(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(ZT(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{QT(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=XT(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===lE&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},KE=P.createContext(!1),qE=()=>P.useContext(KE);KE.Provider;function JE(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var YE=P.createContext(JE()),XE=()=>P.useContext(YE),ZE=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?dE(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},QE=e=>{P.useEffect(()=>{e.clearReset()},[e])},$E=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||dE(n,[e.error,r])),eD=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},tD=(e,t)=>e?.suspense&&t.isPending,nte=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function rte(e,t,n){let r=qE(),i=XE(),a=LT(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,eD(o),ZE(o,i,s),QE(i);let[l]=P.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(P.useSyncExternalStore(P.useCallback(e=>{let t=d?l.subscribe(yE.batchCalls(e)):UT;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),P.useEffect(()=>{l.setOptions(o)},[o,l]),tD(o,u))throw nte(o,l,i);if($E({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function nD(e,t){return rte(e,NE,t)}function ite(e,t){let n=LT(t);return ate({filters:{...e,status:`pending`}},n).length}function rD(e,t){return e.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}function ate(e={},t){let n=LT(t).getMutationCache(),r=P.useRef(e),i=P.useRef(null);return i.current===null&&(i.current=rD(n,e)),P.useEffect(()=>{r.current=e}),P.useSyncExternalStore(P.useCallback(e=>n.subscribe(()=>{let t=eE(i.current,rD(n,r.current));i.current!==t&&(i.current=t,yE.schedule(e))}),[n]),()=>i.current,()=>i.current)}function iD(e,t){let n=LT(t),[r]=P.useState(()=>new UE(n,e));P.useEffect(()=>{r.setOptions(e)},[r,e]);let i=P.useSyncExternalStore(P.useCallback(e=>r.subscribe(yE.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=P.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(UT)},[r]);if(i.error&&dE(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var ote=Kb(HC,qv({theme:{tokens:{colors:{brand:{50:{value:`#f5f0ff`},100:{value:`#ebe0ff`},200:{value:`#d9c4ff`},300:{value:`#c0a0fb`},400:{value:`#a574f3`},500:{value:`#8a4ee8`},600:{value:`#6f2fda`},700:{value:`#5c24b8`},800:{value:`#4a1d93`},900:{value:`#39166f`},950:{value:`#240d4a`}},accent:{500:{value:`#ff2e14`},600:{value:`#e02610`}}}},semanticTokens:{colors:{brand:{contrast:{value:{_light:`white`,_dark:`white`}},fg:{value:{_light:`{colors.brand.700}`,_dark:`{colors.brand.300}`}},subtle:{value:{_light:`{colors.brand.50}`,_dark:`{colors.brand.950}`}},muted:{value:{_light:`{colors.brand.100}`,_dark:`{colors.brand.900}`}},emphasized:{value:{_light:`{colors.brand.200}`,_dark:`{colors.brand.800}`}},solid:{value:{_light:`{colors.brand.600}`,_dark:`{colors.brand.500}`}},focusRing:{value:{_light:`{colors.brand.500}`,_dark:`{colors.brand.400}`}},border:{value:{_light:`{colors.brand.500}`,_dark:`{colors.brand.400}`}}},bg:{DEFAULT:{value:{_light:`white`,_dark:`#1f1b26`}},subtle:{value:{_light:`#f7f5fa`,_dark:`#26212e`}},muted:{value:{_light:`#efecf4`,_dark:`#2e2838`}},emphasized:{value:{_light:`#e1dde7`,_dark:`#3a3347`}},panel:{value:{_light:`white`,_dark:`#26212e`}}},border:{DEFAULT:{value:{_light:`#e1dde7`,_dark:`#3a3347`}},muted:{value:{_light:`#ece9f1`,_dark:`#2e2838`}},emphasized:{value:{_light:`#cfc9d8`,_dark:`#4b4259`}}}}}}}));function ste(){return(0,F.jsxs)(W,{gap:2,flexShrink:0,children:[(0,F.jsx)(Iw,{src:`/opencraw-logo.svg`,alt:`OpenCraw`,h:`28px`,w:`auto`}),(0,F.jsx)(V,{fontWeight:`semibold`,letterSpacing:`tight`,children:`OpenCraw Studio`})]})}var aD=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},cte=(e=>e?aD(e):aD),lte=e=>e;function ute(e,t=lte){let n=P.useSyncExternalStore(e.subscribe,P.useCallback(()=>t(e.getState()),[e,t]),P.useCallback(()=>t(e.getInitialState()),[e,t]));return P.useDebugValue(n),n}var oD=e=>{let t=cte(e),n=e=>ute(t,e);return Object.assign(n,t),n},sD=(e=>e?oD(e):oD),cD=`opencraw-studio:color-mode`;function dte(){try{let e=localStorage.getItem(cD);return e===`light`||e===`dark`?e:`system`}catch{return`system`}}function fte(){return typeof matchMedia==`function`&&matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}function lD(e){return e.preference===`system`?e.system:e.preference}var uD=sD(e=>({preference:dte(),system:fte(),setPreference:t=>{try{t===`system`?localStorage.removeItem(cD):localStorage.setItem(cD,t)}catch{}e({preference:t})},setSystem:t=>{e({system:t})}}));function pte(){let e=uD(lD),t=uD(e=>e.setSystem);(0,P.useEffect)(()=>{if(typeof matchMedia!=`function`)return;let e=matchMedia(`(prefers-color-scheme: dark)`),n=e=>{t(e.matches?`dark`:`light`)};return e.addEventListener(`change`,n),()=>{e.removeEventListener(`change`,n)}},[t]),(0,P.useEffect)(()=>{let t=document.documentElement;t.classList.remove(`light`,`dark`),t.classList.add(e),t.style.colorScheme=e},[e])}function mte(){return{preference:uD(e=>e.preference),mode:uD(lD),setPreference:uD(e=>e.setPreference)}}var dD={system:`light`,light:`dark`,dark:`system`},fD={system:{glyph:`◐`,label:`System`},light:{glyph:`☀`,label:`Light`},dark:{glyph:`☾`,label:`Dark`}};function hte(){let{preference:e,setPreference:t}=mte(),{glyph:n,label:r}=fD[e],i=fD[dD[e]].label;return(0,F.jsxs)(ew,{size:`xs`,variant:`ghost`,flexShrink:0,"aria-label":`Theme: ${r}. Switch to ${i}`,title:`Theme: ${r}. Click for ${i}`,onClick:()=>{t(dD[e])},children:[(0,F.jsx)(`span`,{"aria-hidden":!0,children:n}),r]})}var gte=`opencraw-studio:density`;function _te(){try{return localStorage.getItem(`opencraw-studio:density`)===`compact`?`compact`:`comfortable`}catch{return`comfortable`}}var pD=sD(e=>({density:_te(),setDensity:t=>{try{localStorage.setItem(gte,t)}catch{}e({density:t})}})),vte=[{value:`comfortable`,label:`Comfort`},{value:`compact`,label:`Compact`}];function yte(){let e=pD(e=>e.density),t=pD(e=>e.setDensity);return(0,F.jsx)(W,{gap:0,role:`group`,"aria-label":`Editor density`,flexShrink:0,children:vte.map(n=>(0,F.jsx)(ew,{size:`2xs`,colorPalette:`brand`,variant:e===n.value?`solid`:`outline`,"aria-pressed":e===n.value,onClick:()=>{t(n.value)},children:n.label},n.value))})}var bte={comfortable:{compact:!1,listGap:1,cardPad:2,nestIndent:8,text:`sm`},compact:{compact:!0,listGap:.5,cardPad:1,nestIndent:4,text:`xs`}};function mD(){return bte[pD(e=>e.density)]}function hD(e,t){let n=new Set;for(let t of e)gD(t,n);let r=new Map;return t.map(e=>{let t=new Set;gD(e,t);let i=new Map;for(let e of t){if(!n.has(e))continue;let r=2;for(;n.has(`${e}_${r}`)||t.has(`${e}_${r}`);)r++;i.set(e,`${e}_${r}`)}for(let[e,t]of i)r.set(e,t);let a=i.size===0&&r.size===0?e:_D(e,i,r);return gD(a,n),a})}function gD(e,t){for(let n of[`id`,`as`]){let r=e.step[n];typeof r==`string`&&t.add(r)}if(e.kind===`bracket`){for(let n of e.children)gD(n,t);let n=e.elseChildren??[];for(let e of n)gD(e,t)}}function _D(e,t,n){let r={...e.step};for(let e of[`id`,`as`]){let n=r[e];typeof n==`string`&&t.has(n)&&(r[e]=t.get(n))}for(let e of[`over`,`from`]){let t=r[e];typeof t==`string`&&n.has(t)&&(r[e]=n.get(t))}return e.kind===`card`?{...e,step:r}:{...e,step:r,children:e.children.map(e=>_D(e,t,n)),...e.elseChildren!==void 0&&{elseChildren:e.elseChildren.map(e=>_D(e,t,n))}}}var vD=`value`,yD=`items`,bD=`item`;function xD(e,t,n=vD){return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:n,selector:e.selector,kind:`css`,...e.take!==`text`&&{take:e.take}}}}function xte(e,t,n={}){let r=n.id??vD,i=e.jsonpath===void 0?`xpath`:`jsonpath`,a=e.jsonpath??e.xpath;if(a===void 0)throw Error(`documentReadCardNode: the node has neither a jsonpath nor an xpath`);if(n.generalize===!0&&e.listPath===void 0)throw Error(`documentReadCardNode: this node has no list to generalise to (it is not part of an array or a repeated sibling group)`);let o=n.generalize===!0?e.listPath:a,s=i===`xpath`&&n.namespaces!==void 0&&Object.keys(n.namespaces).length>0?n.namespaces:void 0;return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:r,selector:o,kind:i,...n.generalize===!0&&{many:!0},...s!==void 0&&{namespaces:s}}}}function Ste(e,t){if(e.jsonpath===void 0)throw Error(`paginateFromNextNode: pagination reads a JSON/YAML "next" value (node.jsonpath)`);return{kind:`bracket`,path:t,stepType:`paginate`,sentence:[],children:[],step:{type:`paginate`,next:{jsonpath:e.jsonpath},steps:[]}}}function Cte(e,t,n={}){let r=n.itemsId??yD,i=n.itemAlias??bD,a=n.fieldId??ED(e.field),o=AD(t);return[{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:r,selector:e.item.selector,kind:`css`,take:`html`,many:!0}},{kind:`bracket`,path:o,stepType:`forEach`,sentence:[],children:[{kind:`card`,path:`${o}.steps.0`,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:a,from:i,selector:e.field.selector,kind:`css`,...e.field.take!==`text`&&{take:e.field.take}}}],step:{type:`forEach`,over:r,as:i,emit:!0,steps:[]}}]}function SD(e){if(e.jsonpath===void 0||e.listPath===void 0)return;let t=e.listPath.lastIndexOf(`[*]`);if(t===-1)return;let n=e.listPath.slice(t+3);return{items:e.listPath.slice(0,t+3),field:n===``?`$`:`$${n}`}}function CD(e){return(e.match(/[A-Z_]\w*/gi)??[]).pop()??vD}function wD(e,t,n,r){return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:r,from:n,selector:e,kind:`jsonpath`,take:`json`}}}function wte(e,t){let n=SD(e);if(n===void 0)return;let r=AD(t);return[{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:yD,selector:n.items,kind:`jsonpath`,take:`json`,many:!0}},{kind:`bracket`,path:r,stepType:`forEach`,sentence:[],children:[wD(n.field,`${r}.steps.0`,bD,CD(n.field))],step:{type:`forEach`,over:yD,as:bD,emit:!0,steps:[]}}]}function Tte(e,t){let n=SD(t);if(n===void 0)return;let r=e.find(e=>e.kind===`card`&&e.step.type===`extract`&&e.step.kind===`jsonpath`&&e.step.selector===n.items&&e.step.many===!0),i=e.findIndex(e=>e.kind===`bracket`&&e.stepType===`forEach`&&e.step.over===r?.step.id),a=e[i];if(r===void 0||a?.kind!==`bracket`)return;let[o]=hD(e,[wD(n.field,`${a.path}.steps.${a.children.length}`,String(a.step.as),CD(n.field))]);return e.map((e,t)=>t===i?{...a,children:[...a.children,o]}:e).map((e,t)=>kD(e,`steps.${t}`))}function TD(e){for(let t of e){if(t.kind!==`bracket`||t.stepType!==`forEach`)continue;let n=e.find(e=>e.kind===`card`&&e.step.type===`extract`&&e.step.id===t.step.over&&e.step.kind===`css`&&e.step.many===!0);if(n!==void 0&&typeof n.step.selector==`string`)return n.step.selector}}function Ete(e,t){let n=TD(e),r=e.findIndex(t=>t.kind===`bracket`&&t.stepType===`forEach`&&e.some(e=>e.kind===`card`&&e.step.id===t.step.over&&e.step.selector===n)),i=e[r];if(n===void 0||i?.kind!==`bracket`)return;let a=xD(t,`${i.path}.steps.${i.children.length}`,ED(t)),[o]=hD(e,[{...a,step:{...a.step,from:String(i.step.as)}}]);return e.map((e,t)=>t===r?{...i,children:[...i.children,o]}:e).map((e,t)=>kD(e,`steps.${t}`))}function ED(e){if(e.take===`attr:src`)return`image`;if(e.take===`attr:href`)return`link`;let t=((e.selector.split(/[\s>+~]+/).pop()??``).match(/\.[A-Z][\w-]*/gi)??[]).pop(),[n,...r]=t===void 0?[]:t.slice(1).split(/[_-]+/).filter(e=>e!==``);return n===void 0?vD:n.toLowerCase()+r.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(``)}function DD(e){let t=e[e.length-1];return t?.kind===`card`&&t.stepType===`emit`?e.length-1:e.length}function OD(e,t,n){let r=hD(t===void 0?e:e.filter((e,n)=>n!==t),n),i=DD(e),a=t===void 0?[...e.slice(0,i),...r,...e.slice(i)]:[...e.slice(0,t),...r,...e.slice(t+1)];return(r.some(e=>e.kind===`bracket`&&e.stepType===`forEach`&&e.step.emit===!0)&&Dte(a[a.length-1])?a.slice(0,-1):a).map((e,t)=>kD(e,`steps.${t}`))}function Dte(e){return e?.kind===`card`&&e.stepType===`emit`}function kD(e,t){return e.kind===`card`?{...e,path:t}:{...e,path:t,children:e.children.map((e,n)=>kD(e,`${t}.steps.${n}`))}}function AD(e){let t=e.split(`.`),n=Number(t[t.length-1]);return[...t.slice(0,-1),String(n+1)].join(`.`)}function jD(e){let t=0;for(let n of e)t=Math.trunc(t*31+(n.codePointAt(0)??0));return`hsl(${Math.abs(t)%360}, 65%, 42%)`}function MD(e){return e.kind===`bracket`}function ND(e,t){if(t===``)return e.steps;let[n,r]=t.split(`::`,2),i=LD(e.steps,n);return i===void 0?[]:r===`else`?i.elseChildren??[]:i.children}function PD(e,t,n){if(t===``)return{...e,steps:n};let[r,i]=t.split(`::`,2);return{...e,steps:FD(e.steps,r,i,n)}}function Ote(e,t,n){return{...e,steps:ID(e.steps,t,n)}}function FD(e,t,n,r){return e.map(e=>MD(e)?e.path===t?n===`else`?{...e,elseChildren:r}:{...e,children:r}:{...e,children:FD(e.children,t,n,r),elseChildren:e.elseChildren===void 0?void 0:FD(e.elseChildren,t,n,r)}:e)}function ID(e,t,n){return e.map(e=>e.path===t?n(e):MD(e)?{...e,children:ID(e.children,t,n),elseChildren:e.elseChildren===void 0?void 0:ID(e.elseChildren,t,n)}:e)}function LD(e,t){for(let n of e){if(!MD(n))continue;if(n.path===t)return n;let e=LD(n.children,t);if(e!==void 0)return e;if(n.elseChildren!==void 0){let e=LD(n.elseChildren,t);if(e!==void 0)return e}}}function RD(e){if(e===``)return`steps`;let[t,n]=e.split(`::`,2);return`${t}.${n===`else`?`else`:`steps`}`}function zD(e,t){if(e!==void 0&&t!==void 0)return BD(e.steps,t)}function BD(e,t){for(let n of e){if(n.step.id===t)return n;if(!MD(n))continue;let e=BD(n.children,t);if(e!==void 0)return e;if(n.elseChildren!==void 0){let e=BD(n.elseChildren,t);if(e!==void 0)return e}}}function VD(e){return e===void 0?[]:HD(e.steps)}function HD(e){return e.flatMap(e=>MD(e)?[e,...HD(e.children),...HD(e.elseChildren??[])]:[e])}function kte(e,t){return e.filter(e=>{if(e.path===t)return!0;if(!e.path.startsWith(`${t}.`))return!1;let n=e.path.slice(t.length+1);return!n.startsWith(`steps.`)&&!n.startsWith(`else.`)})}var UD=/\s*Call log:[\s\S]*$/,WD=/\u{1B}\[[\d;]*m|\[\d{1,2}m/gu,GD=[[/Download is starting/i,`This address is a file to download, not a web page. Load it again from Load ▾ → Web page: files are opened as documents.`],[/ERR_NAME_NOT_RESOLVED|ENOTFOUND|getaddrinfo/i,`The address could not be found. Check that it is spelled correctly.`],[/ERR_CONNECTION_REFUSED|ECONNREFUSED|ERR_CONNECTION_RESET|ERR_CONNECTION_CLOSED|ECONNRESET/i,`The site refused the connection. It may be down, or may not allow this kind of visit.`],[/ERR_CERT|certificate|SSL/i,`The site's security certificate is not valid, so the browser would not open it.`],[/Timeout \d+ms exceeded|ERR_TIMED_OUT|timed out|ETIMEDOUT/i,`The site took too long to answer. Try again in a moment, and check your connection.`],[/\bstatus\D{1,15}40[13]\b|\bHTTP\W*40[13]\b|\b40[13] (?:Forbidden|Unauthorized)/i,`The site refused to show this page (access denied).`],[/\bstatus\D{1,15}404\b|\bHTTP\W*404\b|\b404 Not Found/i,`The page was not found (404). Check the address.`],[/\bstatus\D{1,15}429\b|\bHTTP\W*429\b|Too Many Requests/i,`The site says it was asked too often. Wait a while and try again.`],[/\bstatus\D{1,15}5\d\d\b|\bHTTP\W*5\d\d\b/i,`The site had a problem answering (a server error). Try again later.`]];function KD(e){let t=e.replace(WD,``).replace(UD,``).replace(/\s+/g,` `).trim(),n=GD.find(([t])=>t.test(e));return n===void 0?t:n[1]}function qD(e){return new URLSearchParams(globalThis.location.search).get(e)??void 0}async function JD(e,t){let n=await fetch(`/api/command?token=${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),r=await n.json();if(!n.ok)throw Error(YD(r,n.status));return r}function YD(e,t){return typeof e==`object`&&e&&`error`in e?String(e.error):`request failed: ${t}`}function Ate(){let e=qD(`token`)??``;return{token:e,initialFolder:qD(`folder`),initialOpen:qD(`open`),openPath:(t,n)=>JD(e,{type:`open-path`,path:t,...n!==void 0&&{workspace:n}}),openWorkspace:t=>JD(e,{type:`open-workspace`,folder:t}),chooseFolder:async()=>(await JD(e,{type:`choose-folder`})).folder,importDocument:(t,n,r)=>JD(e,{type:`import-document`,folder:t,name:n,bytes:r}),detectUrl:t=>JD(e,{type:`detect-url`,url:t}),runSample:async(t,n,r)=>{await JD(e,{type:`run-sample`,recipeId:t,budget:n,...r!==void 0&&{stubs:r}})},stopRun:async()=>{await JD(e,{type:`stop-run`})},saveRecipe:async(t,n)=>{await JD(e,{type:`save-recipe`,path:t,recipe:n})},saveOutline:async(t,n)=>{await JD(e,{type:`save-outline`,path:t,outline:n})},fetchStartPage:async t=>(await JD(e,{type:`fetch-start-page`,recipeId:t})).html,takeSnapshot:(t,n)=>JD(e,{type:`take-snapshot`,recipeId:t,path:n}),verifySelector:(t,n,r)=>JD(e,{type:`verify-selector`,recipeId:t,path:n,selector:r}),inferSelector:(t,n,r,i)=>JD(e,{type:`infer-selector`,recipeId:t,path:n,nodeIds:r,...i!==void 0&&{within:i}}),explainWhy:t=>JD(e,{type:`explain-why`,target:t}),inspectPage:(t,n)=>JD(e,{type:`inspect-page`,recipeId:t,path:n}),responsesSeen:(t,n)=>JD(e,{type:`responses-seen`,recipeId:t,path:n}),documentTree:(t,n)=>JD(e,{type:`document-tree`,recipeId:t,path:n}),pdfView:(t,n)=>JD(e,{type:`pdf-view`,recipeId:t,path:n}),tablePreview:(t,n,r)=>JD(e,{type:`table-preview`,recipeId:t,path:n,options:r}),regionPreview:(t,n,r)=>JD(e,{type:`region-preview`,recipeId:t,path:n,selector:r}),pdfBytesUrl:(t,n,r)=>`/api/pdf-bytes?token=${encodeURIComponent(e)}&recipeId=${encodeURIComponent(t)}&path=${encodeURIComponent(n)}${r===void 0?``:`&v=${encodeURIComponent(r)}`}`,gridView:(t,n,r)=>JD(e,{type:`grid-view`,recipeId:t,path:n,delimiter:r?.delimiter,encoding:r?.encoding}),gridPreview:(t,n,r)=>JD(e,{type:`grid-preview`,recipeId:t,path:n,options:r}),deckView:(t,n)=>JD(e,{type:`deck-view`,recipeId:t,path:n}),deckPreview:(t,n,r)=>JD(e,{type:`deck-preview`,recipeId:t,path:n,options:r}),startRecording:t=>JD(e,{type:`start-recording`,recipeId:t}),stopRecording:()=>JD(e,{type:`stop-recording`}),subscribe:t=>{let n=globalThis.location.protocol===`https:`?`wss`:`ws`,r=new WebSocket(`${n}://${globalThis.location.host}/ws?token=${encodeURIComponent(e)}`);return r.addEventListener(`message`,e=>{t(JSON.parse(String(e.data)))}),()=>{r.close()}}}}function XD(){return(0,P.useMemo)(()=>Ate(),[])}function ZD(){return new GE({defaultOptions:{queries:{retry:!1},mutations:{retry:!1}}})}function QD(e){return[`workspace`,e]}function $D(e){let t=XD();return nD({queryKey:QD(e),queryFn:()=>t.openWorkspace(e),enabled:e!==void 0})}var eO={folder:``,editorTab:`steps`,showHidden:!1},G=sD((e,t)=>({...eO,setFolder:t=>{e({folder:t})},commitFolder:t=>{e({folder:t,openFolder:t})},selectRecipe:t=>{e({selectedRecipeId:t})},setEditorTab:t=>{e({editorTab:t})},startPicking:(t,n)=>{e({pickTarget:{recipeId:t,stepPath:n}})},stopPicking:()=>{e({pickTarget:void 0})},registerPick:n=>{let r=t().pickTarget;if(r?.firstNodeId===void 0)return e({pickTarget:{...r??{recipeId:``,stepPath:``},firstNodeId:n}}),{kind:`first`};let i=r.firstNodeId;return e({pickTarget:void 0}),{kind:`second`,firstNodeId:i}},setShowHidden:t=>{e({showHidden:t})},setHoveredNodeId:t=>{e({hoveredNodeId:t})},setHoveredStepId:t=>{e({hoveredStepId:t})}}));G.getState();var tO={active:!1,cards:[],notes:[]},nO=sD(e=>({...tO,startRecording:(t,n)=>{e({active:!0,recipeId:t,startUrl:n,cards:[],notes:[],stoppedSteps:void 0,error:void 0})},addCard:t=>{e(e=>({cards:[...e.cards,t]}))},addNote:t=>{e(e=>({notes:[...e.notes,t]}))},recordingStopped:t=>{e({active:!1,stoppedSteps:t})},dismissStopped:()=>{e({stoppedSteps:void 0,cards:[],notes:[]})},failStart:t=>{e({active:!1,error:t})},setError:t=>{e({error:t})}})),rO=nO.getState();function iO(){nO.setState(rO,!0)}var aO={running:!1,records:[],rejected:[],traceLines:[]},oO=sD(e=>({...aO,startRun:()=>{e({running:!0,records:[],rejected:[],traceLines:[],error:void 0})},appendTraceLine:t=>{e(e=>({traceLines:[...e.traceLines,t]}))},appendRecord:t=>{e(e=>({records:[...e.records,t]}))},appendRejected:t=>{e(e=>({rejected:[...e.rejected,t]}))},appendBatch:t=>{e(e=>({traceLines:[...e.traceLines,...t.traceLines],records:[...e.records,...t.records],rejected:[...e.rejected,...t.rejected]}))},finishRun:t=>{e(t===void 0?{running:!1}:{running:!1,error:t})},setError:t=>{e({error:t})}}));oO.getState();function sO(){oO.setState({...aO,error:void 0}),iO(),G.setState({pickTarget:void 0,hoveredNodeId:void 0,hoveredStepId:void 0})}function cO(){let e=G(e=>e.openFolder),t=G(e=>e.selectedRecipeId);return $D(e).data?.recipes.find(e=>e.id===t)}function lO(){return $D(G(e=>e.openFolder)).data?.recipes.filter(e=>e.kind===`input`)??[]}function uO(e,t){if(e===void 0)return!0;try{let n=JSON.parse(e).start;return JSON.stringify(n)!==JSON.stringify(t.start)}catch{return!0}}function dO(){let e=XD(),t=LT();return iD({mutationFn:({path:t,recipe:n})=>e.saveRecipe(t,n),onMutate:({path:e})=>({previousText:fO(t,e)}),onSuccess:async(e,{recipe:n},r)=>{t.invalidateQueries({queryKey:[`workspace`]}),uO(r.previousText,n)&&(await t.invalidateQueries({queryKey:[`snapshot`]}),t.invalidateQueries({predicate:e=>e.queryKey[0]!==`workspace`&&e.queryKey[0]!==`snapshot`}))}})}function fO(e,t){let n=e.getQueriesData({queryKey:[`workspace`]});for(let[,e]of n){let n=e?.recipes?.find(e=>e.file===t);if(n!==void 0)return n.text}}function pO(){let e=XD();return iD({mutationFn:({folder:t,name:n,bytes:r})=>e.importDocument(t,n,r)})}function jte(){let e=XD(),t=LT();return iD({mutationFn:({path:t,outline:n})=>e.saveOutline(t,n),onSuccess:()=>{t.invalidateQueries({queryKey:[`workspace`]})}})}function Mte(){let e=XD(),t=oO(e=>e.startRun),n=oO(e=>e.finishRun),r=oO(e=>e.setError);return iD({mutationFn:({recipeId:t,budget:n,stubs:r})=>e.runSample(t,n,r),onMutate:()=>{t()},onError:e=>{n(),r(e instanceof Error?e.message:String(e))}})}function Nte(){let e=XD();return iD({mutationFn:()=>e.stopRun()})}var mO=120;function Pte(){let e=XD(),t=LT(),n=oO(e=>e.appendBatch),r=oO(e=>e.finishRun),i=nO(e=>e.addCard),a=nO(e=>e.addNote),o=nO(e=>e.recordingStopped);(0,P.useEffect)(()=>{let s={traceLines:[],records:[],rejected:[]},c,l=0,u=()=>{if(c!==void 0&&clearTimeout(c),c=void 0,s.traceLines.length===0&&s.records.length===0&&s.rejected.length===0)return;l=Date.now();let e={traceLines:[...s.traceLines],records:[...s.records],rejected:[...s.rejected]};s.traceLines.length=0,s.records.length=0,s.rejected.length=0,n(e)},d=()=>{let e=Date.now()-l;e>=mO?u():c??=setTimeout(u,mO-e)},f=e.subscribe(e=>{switch(e.type){case`trace-line`:s.traceLines.push(e.line),d();break;case`record`:s.records.push({key:e.key,data:e.data,scope:e.scope,mapping:e.mapping}),d();break;case`record-rejected`:s.rejected.push({field:e.field,reason:e.reason,scope:e.scope}),d();break;case`run-finished`:u(),r(e.error);break;case`recording-card`:i({node:e.node,secret:e.secret});break;case`recording-note`:a({kind:e.kind,message:e.message,selector:e.kind===`next-link`?Fte():void 0});break;case`recording-stopped`:o(e.steps),t.invalidateQueries({queryKey:[`snapshot`]});break;case`workspace-changed`:t.invalidateQueries({queryKey:[`workspace`]}),t.invalidateQueries({queryKey:[`snapshot`]})}});return()=>{u(),f()}},[e,t,n,r,i,a,o])}function Fte(){let e=nO.getState().cards,t=e[e.length-1];if(t===void 0||t.node.kind!==`card`||t.node.stepType!==`click`)return;let n=t.node.step.selector;return typeof n==`string`?n:void 0}function Ite(e,t){let n=XD();return nD({queryKey:[`snapshot`,e,t],queryFn:()=>n.takeSnapshot(e,t),enabled:e!==void 0&&t!==void 0})}function hO(){let e=XD();return iD({mutationFn:({recipeId:t,path:n,nodeIds:r,within:i})=>e.inferSelector(t,n,r,i)})}function Lte(){let e=XD();return iD({mutationFn:t=>e.explainWhy(t)})}function Rte(e,t,n=!0){let r=XD();return nD({queryKey:[`inspect-page`,e,t],queryFn:()=>r.inspectPage(e,t),enabled:n&&e!==void 0&&t!==void 0})}function zte(){let e=XD();return iD({mutationFn:({recipeId:t,path:n})=>e.responsesSeen(t,n)})}function Bte(e,t,n=!0){let r=XD();return nD({queryKey:[`document-tree`,e,t],queryFn:()=>r.documentTree(e,t),enabled:n&&e!==void 0&&t!==void 0})}function Vte(e,t,n=!0){let r=XD();return nD({queryKey:[`pdf-view`,e,t],queryFn:()=>r.pdfView(e,t),enabled:n&&e!==void 0&&t!==void 0})}function Hte(e,t,n){let r=XD();return nD({queryKey:[`table-preview`,e,t,n],queryFn:()=>r.tablePreview(e,t,n),enabled:e!==void 0&&t!==void 0&&n!==void 0})}function gO(e,t,n){let r=XD();return nD({queryKey:[`region-preview`,e,t,n],queryFn:()=>r.regionPreview(e,t,n),enabled:e!==void 0&&t!==void 0&&n!==void 0,placeholderData:e=>e})}function _O(e,t,n=!0,r){let i=XD();return nD({queryKey:[`grid-view`,e,t,r],queryFn:()=>i.gridView(e,t,r),enabled:n&&e!==void 0&&t!==void 0})}function vO(e,t,n){let r=XD();return nD({queryKey:[`grid-preview`,e,t,n],queryFn:()=>r.gridPreview(e,t,n),enabled:e!==void 0&&t!==void 0&&n!==void 0})}function yO(e,t,n=!0){let r=XD();return nD({queryKey:[`deck-view`,e,t],queryFn:()=>r.deckView(e,t),enabled:n&&e!==void 0&&t!==void 0})}function bO(e,t,n){let r=XD();return nD({queryKey:[`deck-preview`,e,t,n],queryFn:()=>r.deckPreview(e,t,n),enabled:e!==void 0&&t!==void 0&&n!==void 0})}function xO(){let e=XD(),t=nO(e=>e.startRecording),n=nO(e=>e.failStart);return iD({mutationFn:async({recipeId:t})=>{await e.startRecording(t)},onMutate:({recipeId:e,startUrl:n})=>{t(e,n)},onError:e=>{n(e instanceof Error?e.message:String(e))}})}function SO(){let e=XD();return iD({mutationFn:async()=>{await e.stopRecording()}})}function CO(e){return typeof e==`object`?e.key:e}function wO(e,t){let n=e.length;return new Proxy(e,{get(e,r,i){if(typeof r==`string`){let i=r.charCodeAt(0);if(i>=48&&i<=57){let i=+r;if(Number.isInteger(i)&&i>=0&&i<n){let n=e[i];if(typeof n!=`object`){let r=t[i*2];n=e[i]={index:i,key:n,start:r,size:t[i*2+1],end:r+t[i*2+1],lane:0}}return n}}if(r===`length`)return n}return Reflect.get(e,r,i)}})}function TO(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function EO(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var DO=(e,t)=>Math.abs(e-t)<1.01,OO=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})},kO,AO=()=>{if(kO!==void 0)return kO;if(typeof navigator>`u`)return kO=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return kO=!0;let e=navigator.maxTouchPoints;return kO=navigator.platform===`MacIntel`&&e!==void 0&&e>0},jO=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},MO=e=>e,NO=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},PO=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(jO(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(jO(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},FO={passive:!0},IO=typeof window>`u`||`onscrollend`in window,LO=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&IO,o=0,s=a?null:OO(i,()=>t(n(r),!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,FO),a&&r.addEventListener(`scrollend`,u,FO),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},RO=(e,t)=>LO(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),zO=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},BO=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})};function VO(e,t,n,r){if(t===0)return!1;let i=r(0),a=new Set,o=0;for(;o<e;){let e=n(o);if(e===i)break;a.add(e),o++}let s=e-o;if(s===0||s>=t)return!1;for(let e=0;e<s;e++)if(r(e)!==n(o+e))return!1;for(let e=s;e<t;e++)if(a.has(r(e)))return!1;return!0}var HO=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.isIndexInRange(n)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:MO,rangeExtractor:NO,onChange:()=>{},measureElement:zO,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=this._singleLaneMeasurements?.items??s,l=e=>CO(c[e]),u=e>0?l(0):null,d=e>0?l(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==u||t.getItemKey(o-1)!==d)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>0&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==d)&&(o>e||VO(e,o,l,t.getItemKey))&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:a,getItemKey:c}=this.options,l=0;for(;l<a&&c(l)!==e;)l++;if(l<a){let e=n[l];if(e){let n=Math.max(0,e.start+t);!i&&n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=TO(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,AO()&&this.targetWindow!=null&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,FO),e.addEventListener(`touchend`,n,FO),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(AO()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this.scrollState?.behavior===`smooth`&&!DO(this.getScrollOffset()-i,this.scrollState.lastTargetOffset)||this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;let{target:e,maxAtWrite:t}=this._clampedAdjustment,n=this.getMaxScrollOffset();n>t+.5&&(this._clampedAdjustment=e>n+.5?{target:e,maxAtWrite:n}:null,this._scrollToOffset(e,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;if(this._iosDeferredAdjustment<0&&e>=t-1){this._iosDeferredAdjustment=0;return}let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=TO(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=TO(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._singleLaneMeasurements?.flat;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e}let o=u===0?Array(e):this._singleLaneMeasurements.items.slice(),c;if(u===0)c=t+n;else{let e=u-1;c=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t);o[t]=e;let n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=c,a[t*2+1]=i,c+=i+s}this._singleLaneMeasurements={flat:a,items:o};let d=wO(o,a);return this.measurementsCache=d,d}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=TO(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=GO(e,t,n,r,r===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=TO(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(!this.isIndexInRange(e))return;let n,r,i,a=this._singleLaneMeasurements?.flat;if(this.options.lanes===1&&a!=null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=this.itemSizeCache.get(i)??n,s=t-o;if(s!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,c=a?this.getTotalSize():0,l=this.getScrollOffset()+this.scrollAdjustments,u=this.itemSizeCache.has(i)?r+o<=l&&this.scrollDirection!==`backward`:r<l,d=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?u:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},s,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++;let f=!1;a?f=this.applyScrollAdjustment(this.getTotalSize()-c):d&&(f=this.applyScrollAdjustment(s)),this.notify(f),this._retryClampedAdjustment()}},this.getVirtualItems=TO(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._singleLaneMeasurements?.flat,r=this.options.lanes===1&&n!=null;return EO(t[UO(0,t.length-1,r?e=>n[e*2]:e=>EO(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0;let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0,e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._singleLaneMeasurements?.flat;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){if(e===0)return!1;if(AO()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=e,!1;{let n=this.getScrollOffset()+this.scrollAdjustments+e,r=this.scrollElement,i=r!==null&&(`scrollHeight`in r||`document`in r)?this.getMaxScrollOffset():null;return this._clampedAdjustment=i!==null&&n>i+.5?{target:n,maxAtWrite:i}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&DO(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},UO=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function WO(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function GO(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=WO(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=UO(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var KO=typeof document<`u`?P.useLayoutEffect:P.useEffect;function qO({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=P.useReducer(e=>e+1,0)[1],a=P.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=P.useRef(!1),s=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}},c=e=>{let t=a.current;if(!t.enabled||!t.container)return;s(e);let n=!!e.options.horizontal,r=t.mode===`transform`,i=n?`left`:`top`,o=e.options.scrollMargin,c=e.getVirtualItems();for(let a of c){let s=a.start-o,c=e.elementsCache.get(a.key);c&&t.lastPositions.get(c)!==s&&(t.lastPositions.set(c,s),r?c.style.transform=n?`translate3d(${s}px, 0, 0)`:`translate3d(0, ${s}px, 0)`:c.style[i]=`${s}px`)}},l={...r,onChange:(t,n)=>{var s;let l=a.current,u=!0;if(l.enabled){c(t);let e=t.range,n=l.prevRange;u=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,u&&(l.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}u&&(e&&n&&!o.current?(0,tt.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[u]=P.useState(()=>{let e=new HO(l),t=e.measureElement;return e.measureElement=e=>{o.current=!0;try{t(e)}finally{o.current=!1}},Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return u.setOptions(l),KO(()=>u._didMount(),[]),KO(()=>(s(u),u._willUpdate())),KO(()=>{c(u)}),u}function JO(e){return qO({observeElementRect:PO,observeElementOffset:RO,scrollToFn:BO,...e})}function YO(e,t,n=``,r=!1){let i=n.trim().toLowerCase();return i===``?XO(e,t,0,r):ZO(e,i,0,r).rows}function XO(e,t,n,r){if(!r&&e.hidden)return[];let i=t.has(e.nodeId),a={key:e.nodeId,node:e,depth:n,hasChildren:e.children.length>0,expanded:i};return i?[a,...e.children.flatMap(e=>XO(e,t,n+1,r))]:[a]}function ZO(e,t,n,r){if(!r&&e.hidden)return{rows:[],matched:!1};let i=e.children.map(e=>ZO(e,t,n+1,r));return!i.some(e=>e.matched)&&!QO(e,t)?{rows:[],matched:!1}:{rows:[{key:e.nodeId,node:e,depth:n,hasChildren:e.children.length>0,expanded:!0},...i.flatMap(e=>e.rows)],matched:!0}}function QO(e,t){return e.tag.toLowerCase().includes(t)||e.id?.toLowerCase().includes(t)===!0||e.classes?.some(e=>e.toLowerCase().includes(t))===!0||e.text?.toLowerCase().includes(t)===!0?!0:Object.values(e.attributes).some(e=>e.toLowerCase().includes(t))}var $O=3;function ek({row:e,highlightColor:t,hovered:n,onToggle:r,onHover:i,onClick:a,onContextMenu:o}){let{node:s,depth:c,hasChildren:l,expanded:u}=e,d=Object.entries(s.attributes).slice(0,$O),f=Object.keys(s.attributes).length-d.length;return(0,F.jsxs)(W,{gap:1,pl:`${c*14+4}px`,pr:2,h:`22px`,fontSize:`xs`,fontFamily:`mono`,opacity:s.hidden?.5:1,bg:n?`bg.emphasized`:void 0,style:t===void 0?void 0:{boxShadow:`inset 3px 0 0 ${t}`},cursor:`pointer`,whiteSpace:`nowrap`,overflow:`hidden`,onMouseEnter:()=>{i(!0)},onMouseLeave:()=>{i(!1)},onClick:a,onContextMenu:o,children:[l?(0,F.jsx)(V,{as:`button`,w:`12px`,flexShrink:0,color:`fg.muted`,onClick:e=>{e.stopPropagation(),r()},children:u?`▾`:`▸`}):(0,F.jsx)(I,{w:`12px`,flexShrink:0}),(0,F.jsx)(V,{as:`span`,color:`purple.fg`,children:`<${s.tag}`}),s.id!==void 0&&(0,F.jsx)(V,{as:`span`,color:`brand.fg`,children:`#${s.id}`}),s.classes?.map(e=>(0,F.jsx)(V,{as:`span`,color:`teal.fg`,children:`.${e}`},e)),d.map(([e,t])=>(0,F.jsx)(V,{as:`span`,color:`fg.muted`,children:`${e}="${t}"`},e)),f>0&&(0,F.jsx)(V,{as:`span`,color:`fg.muted`,children:`…+${f}`}),(0,F.jsx)(V,{as:`span`,color:`purple.fg`,children:`>`}),s.text!==void 0&&s.text!==``&&(0,F.jsx)(V,{as:`span`,color:`fg.muted`,truncate:!0,children:s.text}),s.repeatCount!==void 0&&(0,F.jsx)(JC,{size:`xs`,colorPalette:`gray`,children:`×${s.repeatCount}`})]})}var tk=22,nk=20;function rk({tree:e,showHidden:t,query:n,expanded:r,onToggle:i,nodeColors:a,hoveredNodeId:o,onHoverNode:s,onPickNode:c,onContextMenuNode:l}){let u=(0,P.useRef)(null),d=YO(e,r,n,t),f=JO({count:d.length,getScrollElement:()=>u.current,estimateSize:()=>tk,overscan:nk});return(0,F.jsx)(I,{ref:u,h:`full`,overflow:`auto`,children:(0,F.jsx)(I,{h:`${f.getTotalSize()}px`,position:`relative`,children:f.getVirtualItems().map(e=>{let t=d[e.index];return t===void 0?null:(0,F.jsx)(I,{position:`absolute`,top:0,left:0,w:`full`,style:{transform:`translateY(${e.start}px)`},children:(0,F.jsx)(ek,{row:t,highlightColor:a.get(t.node.nodeId),hovered:o===t.node.nodeId,onToggle:()=>{i(t.node.nodeId)},onHover:e=>{s(e?t.node.nodeId:void 0)},onClick:()=>{c(t.node.nodeId)},onContextMenu:e=>{e.preventDefault(),l(t.node,e.clientX,e.clientY)}})},t.key)})})})}function ik({node:e,x:t,y:n,onClose:r,onChoose:i}){let a=(0,P.useRef)(null);(0,P.useEffect)(()=>{let e=e=>{a.current!==null&&!a.current.contains(e.target)&&r()},t=e=>{e.key===`Escape`&&r()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]);let o=Object.keys(e.attributes);return(0,F.jsxs)(I,{ref:a,position:`fixed`,top:`${n}px`,left:`${t}px`,zIndex:1e3,bg:`bg.panel`,borderWidth:`1px`,borderRadius:`md`,boxShadow:`lg`,py:1,minW:`190px`,fontSize:`sm`,children:[(0,F.jsx)(ak,{label:`Read as text`,onClick:()=>{i({kind:`take`,take:`text`})}}),(0,F.jsx)(ak,{label:`Read as html`,onClick:()=>{i({kind:`take`,take:`html`})}}),(0,F.jsx)(ak,{label:`Read as json`,onClick:()=>{i({kind:`take`,take:`json`})}}),o.length>0&&(0,F.jsxs)(I,{borderTopWidth:`1px`,mt:1,pt:1,children:[(0,F.jsx)(V,{px:3,py:`2px`,fontSize:`xs`,color:`fg.muted`,children:`As an attribute`}),o.map(e=>(0,F.jsx)(ak,{label:e,onClick:()=>{i({kind:`take`,take:`attr:${e}`})}},e))]}),(0,F.jsx)(I,{borderTopWidth:`1px`,mt:1,pt:1,children:(0,F.jsx)(ak,{label:`Regex on its text…`,onClick:()=>{i({kind:`regex`})}})})]})}function ak({label:e,onClick:t}){return(0,F.jsx)(V,{as:`button`,display:`block`,w:`full`,textAlign:`left`,px:3,py:`4px`,_hover:{bg:`bg.emphasized`},onClick:t,children:e})}var ok=`data-oc-node`;function sk(e,t){if(t.trim()===``)return new Set;try{let n=new DOMParser().parseFromString(e,`text/html`).querySelectorAll(t);return new Set(Array.from(n,e=>e.getAttribute(ok)).filter(e=>e!==null))}catch{return new Set}}function ck({findings:e,onPick:t}){return e.length===0?(0,F.jsx)(I,{p:3,color:`fg.muted`,fontSize:`sm`,children:`No JSON-LD, inline state, meta or link data found in this page.`}):(0,F.jsx)(FT,{align:`stretch`,gap:0,fontSize:`sm`,overflow:`auto`,h:`full`,children:e.map(e=>(0,F.jsxs)(I,{borderBottomWidth:`1px`,px:3,py:2,children:[(0,F.jsxs)(W,{justify:`space-between`,gap:2,children:[(0,F.jsx)(V,{fontWeight:`medium`,truncate:!0,children:e.label}),(0,F.jsx)(V,{as:`button`,flexShrink:0,fontSize:`xs`,color:`brand.fg`,onClick:()=>{t(e,void 0)},children:e.keys===void 0?`Read`:`Read whole value`})]}),e.keys!==void 0&&e.keys.length>0&&(0,F.jsx)(W,{wrap:`wrap`,gap:1,mt:1,children:e.keys.map(n=>(0,F.jsx)(V,{as:`button`,fontSize:`xs`,px:2,py:`1px`,borderRadius:`full`,borderWidth:`1px`,onClick:()=>{t(e,n)},children:n},n))})]},`${e.kind}-${e.selector}`))})}var lk=`data`;function uk(e,t,n,r=lk){if(e.kind===`meta`||e.kind===`link`)return[{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:r,selector:e.selector,kind:`css`,take:`attr:${e.attribute??`content`}`}}];let i={kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:r,selector:e.selector,kind:`css`}};return n===void 0?[i]:[i,{kind:`card`,path:dk(t),stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:`${r}_${n}`,from:r,selector:`$.${n}`,kind:`jsonpath`}}]}function dk(e){let t=e.split(`.`),n=Number(t[t.length-1]);return[...t.slice(0,-1),String(n+1)].join(`.`)}function fk({responses:e,loading:t,error:n,onCheck:r,onPick:i}){return(0,F.jsxs)(FT,{align:`stretch`,gap:2,p:3,fontSize:`sm`,overflow:`auto`,h:`full`,children:[(0,F.jsx)(V,{as:`button`,alignSelf:`flex-start`,colorPalette:`brand`,color:`colorPalette.fg`,fontWeight:`medium`,opacity:t?.6:1,pointerEvents:t?`none`:void 0,onClick:r,children:t?`Checking…`:`Check for JSON responses`}),n!==void 0&&(0,F.jsx)(V,{color:`red.fg`,children:n}),e!==void 0&&e.length===0&&(0,F.jsx)(V,{color:`fg.muted`,children:`No JSON responses seen while the page rendered.`}),e?.map(e=>(0,F.jsxs)(I,{borderWidth:`1px`,borderRadius:`md`,p:2,children:[(0,F.jsx)(V,{fontWeight:`medium`,truncate:!0,title:e.url,children:e.url}),(0,F.jsx)(V,{color:`fg.muted`,fontSize:`xs`,children:`${e.status} · ${e.size} bytes · ${e.shape}`}),(0,F.jsx)(V,{as:`button`,fontSize:`xs`,color:`brand.fg`,mt:1,onClick:()=>{i(e)},children:`Switch to api mode on this endpoint`})]},e.url))]})}var pk=`response`;function mk(e,t){return{mode:`api`,start:[{url:hk(e.url,t)}],steps:[{type:`request`,id:pk,url:`{{start.url}}`,as:`json`}]}}function hk(e,t){let n=new URL(e),r=new Map(Object.entries(t??{}).map(([e,t])=>[String(t),e])),i=[...n.searchParams].map(([e,t])=>{let n=r.get(t);return`${e}=${n===void 0?encodeURIComponent(t):`{{vars.${n}}}`}`});return`${n.origin}${n.pathname}${i.length===0?``:`?${i.join(`&`)}`}`}var gk=`start`,_k=`#dd6b20`;function vk({recipeId:e,recipe:t,snapshot:n,onSaveOutline:r,onSaveRecipe:i}){let[a,o]=(0,P.useState)(`tree`),[s,c]=(0,P.useState)(``),[l,u]=(0,P.useState)(!1),[d,f]=(0,P.useState)(()=>new Set),[p,m]=(0,P.useState)(void 0),[h,g]=(0,P.useState)(void 0),_=G(e=>e.hoveredStepId),v=G(e=>e.hoveredNodeId),y=G(e=>e.setHoveredNodeId),b=(0,P.useMemo)(()=>{let e=zD(t?.outline,_)?.step.selector;return typeof e==`string`?e:void 0},[t?.outline,_]),x=Rte(e,gk,n!==void 0),S=hO(),C=zte(),w=(0,P.useMemo)(()=>{let e=new Map;if(n===void 0)return e;let r=t?.outline?.steps??[];for(let t of r){if(t.kind!==`card`)continue;let r=t.step;if(r.type===`extract`&&r.kind===`css`&&typeof r.id==`string`&&typeof r.selector==`string`)for(let t of sk(n.html,r.selector))e.set(t,jD(r.id))}if(b!==void 0&&b!==``)for(let t of sk(n.html,b))e.set(t,_k);return e},[n,t,b]);(0,P.useEffect)(()=>{f(new Set)},[e]),(0,P.useEffect)(()=>{x.data!==void 0&&f(e=>{if(e.size>0)return e;let t=x.data.tree,n=new Set([t.nodeId]),[r]=t.children;return r!==void 0&&t.children.length===1&&n.add(r.nodeId),n})},[x.data]);function T(e){f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function E(e){if(r===void 0||t?.outline===void 0)return;let n=OD(t.outline.steps,void 0,e);await r(t.file,{...t.outline,steps:n})}async function D(t,n){if(e===void 0)return;let r=await S.mutateAsync({recipeId:e,path:gk,nodeIds:[t]});if(r.kind!==`field`){g(r.kind===`unsupported`?r.reason:void 0);return}let i=n===void 0?r.field:{...r.field,take:n};await E([xD(i,`steps.0`)]),g(`Read card: ${i.selector}`)}async function ee(t){if(e===void 0)return;let n=await S.mutateAsync({recipeId:e,path:gk,nodeIds:[t]});if(n.kind!==`field`)return;let r=`text`;await E([xD({...n.field,take:`text`},`steps.0`,r),{kind:`card`,path:`steps.1`,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:`${r}_match`,from:r,selector:``,kind:`regex`}}]),g(`Read card: ${n.field.selector} → regex (fill the pattern in its form)`)}async function O(e,t){await E(uk(e,`steps.0`,t)),g(`Read card: ${e.selector}${t===void 0?``:` → $.${t}`}`)}async function k(e){if(i===void 0||t===void 0)return;let n;try{n=JSON.parse(t.text)}catch{g(`The recipe's JSON does not parse; fix it in the JSON tab first`);return}let r=mk(e,yk(n.vars)?n.vars:void 0);await i(t.file,{...n,...r}),g(`Switched to api mode: ${r.start[0].url}`)}function te(e){if(p===void 0)return;let t=p.node.nodeId;m(void 0),e.kind===`regex`?ee(t):D(t,e.take)}return(0,F.jsxs)(I,{h:`full`,display:`flex`,flexDirection:`column`,children:[(0,F.jsxs)(W,{px:2,py:1,borderBottomWidth:`1px`,gap:2,flexShrink:0,children:[(0,F.jsx)(bk,{label:`Tree`,active:a===`tree`,onClick:()=>{o(`tree`)}}),(0,F.jsx)(bk,{label:`Data in page`,active:a===`data`,count:x.data?.pageData.length,onClick:()=>{o(`data`)}}),(0,F.jsx)(bk,{label:`Responses`,active:a===`responses`,count:C.data?.responses.length,onClick:()=>{o(`responses`)}})]}),a===`tree`&&(0,F.jsxs)(W,{px:2,py:1,borderBottomWidth:`1px`,gap:2,flexShrink:0,children:[(0,F.jsx)(Rw,{size:`xs`,placeholder:`Search by tag, class or text…`,value:s,onChange:e=>{c(e.target.value)}}),(0,F.jsx)(V,{as:`button`,fontSize:`xs`,color:l?`colorPalette.fg`:`fg.muted`,colorPalette:`orange`,whiteSpace:`nowrap`,onClick:()=>{u(e=>!e)},children:l?`Hide hidden`:`Show hidden`})]}),h!==void 0&&(0,F.jsx)(I,{px:2,py:`2px`,fontSize:`xs`,color:`fg.muted`,borderBottomWidth:`1px`,flexShrink:0,children:h}),(0,F.jsxs)(I,{flex:`1`,minH:`0`,position:`relative`,children:[a===`tree`&&x.data!==void 0&&(0,F.jsx)(rk,{tree:x.data.tree,showHidden:l,query:s,expanded:d,onToggle:T,nodeColors:w,hoveredNodeId:v,onHoverNode:y,onPickNode:e=>{D(e)},onContextMenuNode:(e,t,n)=>{m({node:e,x:t,y:n})}}),a===`tree`&&x.isFetching&&(0,F.jsx)(I,{p:3,color:`fg.muted`,fontSize:`sm`,children:`Inspecting…`}),a===`data`&&(0,F.jsx)(ck,{findings:x.data?.pageData??[],onPick:(e,t)=>{O(e,t)}}),a===`responses`&&(0,F.jsx)(fk,{responses:C.data?.responses,loading:C.isPending,error:C.error?.message,onCheck:()=>{e!==void 0&&C.mutate({recipeId:e,path:gk})},onPick:e=>{k(e)}}),p!==void 0&&(0,F.jsx)(ik,{node:p.node,x:p.x,y:p.y,onClose:()=>{m(void 0)},onChoose:te})]})]})}function yk(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function bk({label:e,active:t,count:n,onClick:r}){return(0,F.jsxs)(W,{as:`button`,gap:1,px:2,py:`2px`,borderRadius:`sm`,fontSize:`xs`,fontWeight:t?`semibold`:`normal`,color:t?`fg`:`fg.muted`,bg:t?`bg.emphasized`:void 0,onClick:r,children:[(0,F.jsx)(V,{as:`span`,children:e}),n!==void 0&&(0,F.jsx)(JC,{size:`xs`,children:n})]})}function xk(){return(0,F.jsxs)(I,{"data-testid":`next-step-hint`,role:`note`,mb:3,p:3,borderWidth:`1px`,borderColor:`brand.border`,borderRadius:`md`,bg:`brand.subtle`,children:[(0,F.jsx)(V,{fontSize:`sm`,fontWeight:`semibold`,mb:1,children:`Nothing is collected yet`}),(0,F.jsx)(V,{fontSize:`sm`,mb:1,children:`The steps below only open what you loaded. To collect data:`}),(0,F.jsxs)(Vw,{as:`ol`,ps:5,fontSize:`sm`,gap:.5,children:[(0,F.jsxs)(Hw,{children:[`Pick what you want from the left. Click the text you want on the page (on a web page you can also press `,(0,F.jsx)(`b`,{children:`Read`}),` first). In a table or a list of data, click the value.`]}),(0,F.jsx)(Hw,{children:`Pick two similar things (two product names, say) to collect the whole list.`}),(0,F.jsxs)(Hw,{children:[`Press `,(0,F.jsx)(`b`,{children:`Run sample`}),` to see what comes out.`]})]})]})}var Sk=`application/x-opencraw-card`;function Ck(e){return JSON.stringify(e)}function wk(e){let t=e.getData(Sk);if(t!==``)try{let e=JSON.parse(t);return e.kind===`card`||e.kind===`bracket`?e:void 0}catch{return}}function Tk(e){return[...e.types].includes(Sk)}var Ek=(0,P.createContext)(void 0),Dk=`myHook`;function Ok(){return(0,P.useContext)(Ek)}function kk({value:e,onChange:t,onCommit:n,size:r=`sm`,ariaLabel:i}){let a=Ok(),o=()=>{n?.()};if(a===void 0||a.length===0)return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Rw,{size:r,"aria-label":i,value:e,onChange:e=>{t(e.target.value)},onBlur:o}),(0,F.jsx)(V,{fontSize:`xs`,color:`fg.muted`,children:a===void 0?"Studio has no hooks loaded: restart it with `opencraw studio --hooks <file>` to pick from a list.":`The hooks file exports no hooks.`})]});let s=e!==``&&!a.includes(e);return(0,F.jsx)(Jw,{size:r,children:(0,F.jsxs)(Xw,{"aria-label":i,value:e,onChange:e=>{t(e.target.value),o()},children:[(0,F.jsx)(`option`,{value:``,disabled:!0,children:`(choose a hook)`}),s&&(0,F.jsx)(`option`,{value:e,children:`${e} (not in the loaded hooks)`}),a.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))]})})}var Ak=[{label:`Go to`,stepType:`goto`,bracket:!1},{label:`Request`,stepType:`request`,bracket:!1},{label:`Read`,stepType:`extract`,bracket:!1},{label:`Loop`,stepType:`forEach`,bracket:!0},{label:`Next page`,stepType:`paginate`,bracket:!0},{label:`If`,stepType:`if`,bracket:!0},{label:`Fill form`,stepType:`fill`,bracket:!1},{label:`Click`,stepType:`click`,bracket:!1},{label:`Set`,stepType:`set`,bracket:!1},{label:`Collect`,stepType:`collect`,bracket:!1},{label:`Hook`,stepType:`hook`,bracket:!1},{label:`Emit`,stepType:`emit`,bracket:!1}];function jk(e,t=Dk){switch(e){case`goto`:return{type:`goto`,url:``};case`request`:return{type:`request`,id:`response`,url:``,as:`json`};case`extract`:return{type:`extract`,id:`value`,selector:``,kind:`css`};case`forEach`:return{type:`forEach`,as:`item`,over:``,steps:[]};case`paginate`:return{type:`paginate`,next:{selector:``},steps:[]};case`if`:return{type:`if`,test:``,steps:[]};case`fill`:return{type:`fill`,selector:``,value:``};case`click`:return{type:`click`,selector:``};case`set`:return{type:`set`,id:`value`,value:``};case`collect`:return{type:`collect`,into:``,value:``};case`hook`:return{type:`hook`,name:t};case`emit`:return{type:`emit`};default:return{type:e}}}var Mk=[`forEach`,`paginate`,`if`];function Nk(e,t,n=Dk){let r=jk(e,n),i=[{kind:`word`,text:Ak.find(t=>t.stepType===e)?.label??e}],a=Mk.find(t=>t===e);return a===void 0?{kind:`card`,path:t,stepType:e,sentence:i,step:r,custom:!1}:{kind:`bracket`,path:t,stepType:a,sentence:i,step:r,children:[]}}var Pk=(0,P.createContext)({});function Fk(e){let t=(0,P.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Ik=typeof window<`u`?P.useLayoutEffect:P.useEffect,Lk=(0,P.createContext)(null);function Rk(e,t){e.indexOf(t)===-1&&e.push(t)}function zk(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function Bk([...e],t,n){let r=t<0?e.length+t:t;if(r>=0&&r<e.length){let r=n<0?e.length+n:n,[i]=e.splice(t,1);e.splice(r,0,i)}return e}var Vk=(e,t,n)=>n>t?t:n<e?e:n,Hk={},Uk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Wk=e=>typeof e==`object`&&!!e,Gk=e=>/^0[^.\s]+$/u.test(e);function Kk(e){let t;return()=>(t===void 0&&(t=e()),t)}var qk=e=>e,Jk=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Yk=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},Xk=class{constructor(){this.subscriptions=[]}add(e){return Rk(this.subscriptions,e),()=>this.remove(e)}remove(e){zk(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},Zk=e=>e*1e3,Qk=e=>e/1e3,$k=(e,t)=>t?1e3/t*e:0,eA=(e,t,n)=>e*(3*(1-e)*((1-e)*t+e*n)+e*e);function tA(e,t,n,r){return e===t&&n===r?qk:i=>{let a=0,o=1,s=i;for(let t=0;;t++){s>=a&&s<=o||(s=(a+o)/2);let r=eA(s,e,n)-i;if(r*r<1e-28||t===40)break;r>0?o=s:a=s,s-=r*1e-7/(eA(s+1e-7,e,n)-i-r)}return eA(s,t,r)}}var nA=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,rA=e=>t=>1-e(1-t),iA=tA(.33,1.53,.69,.99),aA=rA(iA),oA=nA(aA),sA=e=>e>=1?1:(e*=2)<1?.5*aA(e):.5*(2-2**(-10*(e-1))),cA=e=>1-Math.sin(Math.acos(e)),lA=rA(cA),uA=nA(cA),dA=tA(.42,0,1,1),fA=tA(0,0,.58,1),pA=tA(.42,0,.58,1),mA=e=>Array.isArray(e)&&typeof e[0]!=`number`,hA=e=>Array.isArray(e)&&typeof e[0]==`number`,gA={linear:qk,easeIn:dA,easeInOut:pA,easeOut:fA,circIn:cA,circInOut:uA,circOut:lA,backIn:aA,backInOut:oA,backOut:iA,anticipate:sA},_A=e=>typeof e==`string`,vA=e=>{if(hA(e)){e.length;let[t,n,r,i]=e;return tA(t,n,r,i)}return _A(e)?(gA[e],`${e}`,gA[e]):e},yA={delta:0,timestamp:0,isProcessing:!1},bA;function xA(){bA=void 0}var SA={now:()=>(bA===void 0&&SA.set(yA.isProcessing||Hk.useManualTiming?yA.timestamp:performance.now()),bA),set:e=>{bA=e,queueMicrotask(xA)}},CA=e=>Math.round(e*1e5)/1e5,wA=e=>t=>typeof t==`string`&&t.startsWith(e),TA=wA(`--`),EA=wA(`var(--`),DA=e=>EA(e)?OA.test(e.split(`/*`)[0].trim()):!1,OA=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function kA(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var AA={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},jA={...AA,transform:e=>Vk(0,1,e)},MA={...AA,default:1},NA=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function PA(e){return e==null}var FA=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,IA=(e,t)=>n=>!!(typeof n==`string`&&FA.test(n)&&n.startsWith(e)||t&&!PA(n)&&Object.prototype.hasOwnProperty.call(n,t)),LA=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(NA);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},RA=e=>Vk(0,255,e),zA={...AA,transform:e=>Math.round(RA(e))},BA={test:IA(`rgb`,`red`),parse:LA(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+zA.transform(e)+`, `+zA.transform(t)+`, `+zA.transform(n)+`, `+CA(jA.transform(r))+`)`};function VA(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var HA={test:IA(`#`),parse:VA,transform:BA.transform},UA=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),WA=UA(`deg`),GA=UA(`%`),K=UA(`px`),KA=UA(`vh`),qA=UA(`vw`),JA={...GA,parse:e=>GA.parse(e)/100,transform:e=>GA.transform(e*100)},YA={test:IA(`hsl`,`hue`),parse:LA(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+GA.transform(CA(t))+`, `+GA.transform(CA(n))+`, `+CA(jA.transform(r))+`)`},XA={test:e=>BA.test(e)||HA.test(e)||YA.test(e),parse:e=>BA.test(e)?BA.parse(e):YA.test(e)?YA.parse(e):HA.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?BA.transform(e):YA.transform(e),getAnimatableNone:e=>{let t=XA.parse(e);return t.alpha=0,XA.transform(t)}},ZA=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,QA=new RegExp(NA.source),$A=new RegExp(ZA.source,`i`);function ej(e){return isNaN(e)&&typeof e==`string`&&(QA.test(e)||$A.test(e))}var tj=`number`,nj=`color`,rj=`var`,ij=`var(`,aj="${}",oj=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)(?![a-z]*\()/giu;function sj(e){let t=e.toString();return QA.test(t)||$A.test(t)}function cj(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(oj,e=>(XA.test(e)?(r.color.push(a),i.push(nj),n.push(XA.parse(e))):e.startsWith(ij)?(r.var.push(a),i.push(rj),n.push(e)):(r.number.push(a),i.push(tj),n.push(parseFloat(e))),++a,aj)).split(aj),indexes:r,types:i}}function lj(e){return cj(e).values}function uj({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===tj?CA(r[a]):e===nj?XA.transform(r[a]):r[a]}return i}}function dj(e){return uj(cj(e))}var fj=e=>typeof e==`number`?0:XA.test(e)?XA.getAnimatableNone(e):e,pj=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:fj(e);function mj(e){let t=cj(e);return uj(t)(t.values.map((e,n)=>pj(e,t.split[n])))}var hj={test:ej,parse:lj,createTransformer:dj,getAnimatableNone:mj};function gj(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function _j({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=gj(s,r,e+1/3),a=gj(s,r,e),o=gj(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function vj(e,t){return n=>n>0?t:e}var yj=(e,t,n)=>e+(t-e)*n,bj=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},xj=[HA,BA,YA],Sj=e=>xj.find(t=>t.test(e));function Cj(e){let t=Sj(e);if(!t)return`${e}`,!1;let n=t.parse(e);return t===YA&&(n=_j(n)),n}var wj=(e,t)=>{let n=Cj(e),r=Cj(t);if(!n||!r)return vj(e,t);let i={...n};return e=>(i.red=bj(n.red,r.red,e),i.green=bj(n.green,r.green,e),i.blue=bj(n.blue,r.blue,e),i.alpha=yj(n.alpha,r.alpha,e),BA.transform(i))},Tj=new Set([`none`,`hidden`]);function Ej(e,t){return Tj.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Dj(e,t){return n=>yj(e,t,n)}function Oj(e){return typeof e==`number`?Dj:typeof e==`string`?DA(e)?vj:XA.test(e)?wj:Mj:Array.isArray(e)?kj:typeof e==`object`?XA.test(e)?wj:Aj:vj}function kj(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Oj(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Aj(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Oj(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function jj(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var Mj=(e,t)=>{let n=hj.createTransformer(t),r=cj(e),i=cj(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Tj.has(e)&&!i.values.length||Tj.has(t)&&!r.values.length?Ej(e,t):Jk(kj(jj(r,i),i.values),n):(`${e}${t}`,vj(e,t))},Nj=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function Pj(e,t){let n=Nj.exec(e);if(!n)return;let r=Nj.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>CA(yj(a,o,e))+i}function Fj(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return yj(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=Pj(e,t);if(n)return n}return Oj(e)(e,t)}var Ij=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function Lj(e){let t=new Set,n=new Set,r=!1,i=!1,a=new Set,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(n.add(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var Rj=40;function zj(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=Ij.reduce((e,t)=>(e[t]=Lj(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=Hk.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,Rj),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:Ij.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Ij.length;t++)o[Ij[t]].cancel(e)},state:n,steps:o}}var{schedule:Bj,cancel:Vj,steps:Hj}=zj(typeof requestAnimationFrame<`u`?requestAnimationFrame:qk,!0,yA),Uj=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>Bj.update(t,e),stop:()=>Vj(t),now:()=>yA.isProcessing?yA.timestamp:SA.now()}},Wj=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},Gj=2e4;function Kj(e,t=50,n=Gj,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function qj(e,t=100,n){let{keyframes:r,velocity:i}=e,a=r&&r[r.length-1]-r[0],o=n({...e,velocity:i&&a?i*t/a:i,keyframes:[0,t]}),s=Math.min(Kj(o),Gj);return{type:`keyframes`,ease:e=>o.next(s*e).value/t,duration:Qk(s)}}var Jj={stiffness:100,damping:10,mass:1,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05},Yj=e=>e<0?1/Math.max(1+e,Jj.minDamping):Math.max(1-e,Jj.minDamping);function Xj(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return $j(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function Zj(e,t){return e*Math.sqrt(1-t*t)}var Qj=12;function $j(e,t,n){let r=n;for(let n=1;n<Qj;n++)r-=e(r)/t(r);return r}var eM=.001;function tM({duration:e=Jj.duration,bounce:t=Jj.bounce}){let n,r;Jj.maxDuration;let i=Yj(t);e=Vk(Jj.minDuration,Jj.maxDuration,Qk(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=Zj(t,i),o=Math.exp(-r);return eM-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=Zj(t*t,i);return(-n(t)+eM>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=$j(n,r,a),s=o*Xj(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:Zk(e)}}var nM=(e,t)=>(t?e>=0:e>0)&&e<1/0;function rM(e,t){if(nM(e,t))return e}function iM(e){let t=rM(e.stiffness),n=rM(e.damping,!0),r=rM(e.mass),i={...e,stiffness:t??Jj.stiffness,damping:n??Jj.damping,mass:r??Jj.mass,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=Yj(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*Xj(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,tM(i)),i.isResolvedFromDuration=!0;(!nM(i.stiffness)||!nM(i.damping,!0))&&(i.stiffness=Jj.stiffness,i.damping=Jj.damping)}return i}function aM(e=Jj.visualDuration,t=Jj.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=iM({...n}),f=e=>d?0:-Qk(e),p=s/(2*Math.sqrt(o*c)),m=Qk(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?Jj.restSpeed.granular:Jj.restSpeed.default),g.restDelta=n.restDelta||(e?Jj.restDelta.granular:Jj.restDelta.default)};_();let v,y,b;if(p<1){let e=Zj(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=d?1/0:300/e,i=(e,t)=>Math.exp(t>r?-e*r-h*(t-r):-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>Zk(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=Zk(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(Kj(S),Gj),t=Wj(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}aM.applyToOptions=e=>{let t=qj(e,100,aM);return e.ease=t.ease,e.duration=Zk(t.duration),e.type=`keyframes`,e};function oM({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:_+t},b,x,S=e=>{p(f.value)&&(b=e,x=aM({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function sM(e,t,n){let r=[],i=n||Hk.mix||Fj,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=Jk(Array.isArray(t)?t[n]||qk:t,a)),r.push(a)}return r}function cM(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=sM(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=Yk(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Vk(e[0],e[a-1],t)):l}function lM(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Yk(0,t,r);e.push(yj(n,1,i))}}function uM(e){let t=[0];return lM(t,e.length-1),t}function dM(e,t){return e.map(e=>e*t)}function fM(e,t){return e.map(()=>t||pA).splice(0,e.length-1)}function pM({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=mA(r)?r.map(vA):vA(r)||pA,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(Hk.mix||Fj)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?Vk(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=cM(dM(n&&n.length===t.length?n:uM(t),e),t,{ease:Array.isArray(i)?i:fM(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var mM=5;function hM(e,t,n){let r=Math.max(t-mM,0);return $k(n-e(r),t-r)}function gM(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):hM(t=>e.next(t).value,t,e.next(t).value)}var _M=e=>e!==null;function vM(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(_M),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var yM={decay:oM,inertia:oM,tween:pM,keyframes:pM,spring:aM};function bM(e){typeof e.type==`string`&&(e.type=yM[e.type])}var xM=40,SM=(e,t)=>t-e>xM&&!Hk.useManualTiming?t:e;function CM(e,t){return{kind:e,animation:t,timestamp:SA.now(),frameTimestamp:yA.timestamp,frameIsProcessing:yA.isProcessing}}function wM(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...CM(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function TM(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...CM(`layout-animation-start`,e),node:t})}catch{}}var EM=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},DM=e=>e/100,OM=e=>Math.round(e*1e4)/1e4,kM=class extends EM{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==SA.now()&&this.tick(SA.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),wM(this,this.options)}initAnimation(){let{options:e}=this;bM(e);let{type:t=pM,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||pM;s!==pM&&typeof o[0]!=`number`&&(this.mixKeyframes=Jk(DM,Fj(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Kj(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,calculatedDuration:i}=this;if(this.startTime===null)return n.next(0);let{delay:a=0,keyframes:o,type:s,onUpdate:c,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=SM(this.startTime,e)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let u=this.currentTime-a*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?u<0:u>r;this.currentTime=Math.max(u,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let f=this.generate(this.currentTime,d),{done:p}=f;!d&&i!==null&&(p=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let m=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&p);return m&&s!==oM&&(f.value=vM(o,this.options,l,this.speed)),c&&c(f.value),m&&this.finish(),f}at(e){return this.holdTime??OM((e-this.startTime)*this.playbackSpeed)}sampleAt(e,t){let{options:n,totalDuration:r}=this,i=this.at(e)-(n.delay||0);return i>=r&&n.type!==oM?vM(n.keyframes,n,t?void 0:n.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(e,t){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o}=this,{keyframes:s,repeat:c,repeatType:l,repeatDelay:u}=this.options,d=e,f=n;if(c){let t=Math.min(e,r)/o,n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),i===1&&n--,n=Math.min(n,c+1),n%2&&(l===`reverse`?(i=1-i,u&&(i-=u/o)):l===`mirror`&&(f=a)),d=Vk(0,1,i)*o}let p;return t?(this.delayState.value=s[0],p=this.delayState):p=f.next(d),i&&!t&&(p.value=i(p.value)),p}then(e,t){return this.finished.then(e,t)}get duration(){return Qk(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Qk(e)}get time(){return Qk(this.currentTime)}set time(e){e=Zk(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return gM(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(SA.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Qk(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Uj,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??(this.pendingStartTime=n):this.startTime=n-this.holdTime/(this.playbackSpeed||1),this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(SA.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},AM=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function jM(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(NA)||[];if(!r)return e;let i=n.replace(r,``),a=+!!AM.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var MM=/\b([a-z-]*)\(.*?\)/gu,NM={...hj,getAnimatableNone:e=>{let t=e.match(MM);return t?t.map(jM).join(` `):e}},PM={...hj,getAnimatableNone:e=>{let t=hj.parse(e);return hj.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},FM={...AA,transform:Math.round},IM={borderWidth:K,borderTopWidth:K,borderRightWidth:K,borderBottomWidth:K,borderLeftWidth:K,borderRadius:K,borderTopLeftRadius:K,borderTopRightRadius:K,borderBottomRightRadius:K,borderBottomLeftRadius:K,width:K,maxWidth:K,height:K,maxHeight:K,top:K,right:K,bottom:K,left:K,inset:K,insetBlock:K,insetBlockStart:K,insetBlockEnd:K,insetInline:K,insetInlineStart:K,insetInlineEnd:K,padding:K,paddingTop:K,paddingRight:K,paddingBottom:K,paddingLeft:K,paddingBlock:K,paddingBlockStart:K,paddingBlockEnd:K,paddingInline:K,paddingInlineStart:K,paddingInlineEnd:K,margin:K,marginTop:K,marginRight:K,marginBottom:K,marginLeft:K,marginBlock:K,marginBlockStart:K,marginBlockEnd:K,marginInline:K,marginInlineStart:K,marginInlineEnd:K,fontSize:K,backgroundPositionX:K,backgroundPositionY:K,rotate:WA,pathRotation:WA,rotateX:WA,rotateY:WA,rotateZ:WA,scale:MA,scaleX:MA,scaleY:MA,scaleZ:MA,skew:WA,skewX:WA,skewY:WA,distance:K,translateX:K,translateY:K,translateZ:K,x:K,y:K,z:K,perspective:K,transformPerspective:K,opacity:jA,originX:JA,originY:JA,originZ:K,zIndex:FM,fillOpacity:jA,strokeOpacity:jA,numOctaves:FM},Ute={...IM,color:XA,backgroundColor:XA,outlineColor:XA,fill:XA,stroke:XA,borderColor:XA,borderTopColor:XA,borderRightColor:XA,borderBottomColor:XA,borderLeftColor:XA,filter:NM,WebkitFilter:NM,mask:PM,WebkitMask:PM},LM=e=>Ute[e],Wte=new Set([NM,PM]);function RM(e,t){let n=LM(e);return Wte.has(n)||(n=hj),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function Gte(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var zM=e=>e*180/Math.PI,BM=e=>VM(zM(Math.atan2(e[1],e[0]))),Kte={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:BM,rotateZ:BM,skewX:e=>zM(Math.atan(e[1])),skewY:e=>zM(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},VM=e=>(e%=360,e<0&&(e+=360),e),HM=BM,UM=e=>Math.hypot(e[0],e[1]),WM=e=>Math.hypot(e[4],e[5]),qte={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:UM,scaleY:WM,scaleZ:e=>Math.hypot(e[8],e[9],e[10]),scale:e=>(UM(e)+WM(e))/2,rotateX:e=>VM(zM(Math.atan2(e[6],e[5]))),rotateY:e=>VM(zM(Math.atan2(-e[2],e[0]))),rotateZ:HM,rotate:HM,skewX:e=>zM(Math.atan(e[4])),skewY:e=>zM(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function GM(e){return+!!e.includes(`scale`)}function KM(e,t){if(!e||e===`none`)return GM(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=qte,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Kte,i=t}if(!i)return GM(t);let a=r[t],o=i[1].split(`,`).map(Yte);return typeof a==`function`?a(o):o[a]}var Jte=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return KM(n,t)};function Yte(e){return parseFloat(e.trim())}var qM=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],JM=new Set([...qM,`pathRotation`]),YM=e=>e===AA||e===K,Xte=new Set([`x`,`y`,`z`]),Zte=qM.filter(e=>!Xte.has(e));function Qte(e){let t=[];return Zte.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var $te=new Set([`bottom`,`right`]);function XM(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var ZM={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>XM(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>XM(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:({transform:e})=>KM(e,`x`),y:({transform:e})=>KM(e,`y`)};ZM.translateX=ZM.x,ZM.translateY=ZM.y;var QM=new Set,$M=!1,eN=!1,tN=!1;function nN(){if(eN){let e=[],t=new Set,n=new Set;QM.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),$te.has(r.name)&&n.add(r.element))});let r=new Map;n.forEach(e=>{let t=Qte(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}eN=!1,$M=!1,QM.forEach(e=>e.complete(tN)),QM.clear()}function rN(){QM.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(eN=!0)})}function ene(){tN=!0,rN(),nN(),tN=!1}function tne(e,t,n){if(typeof e==`string`){if(Uk(e)||Gk(e))return parseFloat(e);if(!hj.test(e)&&hj.test(n))return RM(t,n)}return e??void 0}var iN=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(QM.add(this),$M||($M=!0,Bj.read(rN),Bj.resolveKeyframes(nN))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=tne(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Gte(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),QM.delete(this)}cancel(){this.state===`scheduled`&&(QM.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},nne=e=>e.startsWith(`--`);function aN(e,t,n){nne(t)?e.style.setProperty(t,n):e.style[t]=n}var rne={};function oN(e,t){let n=Kk(e);return()=>rne[t]??n()}var ine=oN(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),sN=oN(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),cN=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,lN={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:cN([0,.65,.55,1]),circOut:cN([.55,0,1,.45]),backIn:cN([.31,.01,.66,-.59]),backOut:cN([.33,1.53,.69,.99])};function uN(e,t){if(e)return typeof e==`function`?sN()?Wj(e,t):`ease-out`:hA(e)?cN(e):Array.isArray(e)?e.map(e=>uN(e,t)||lN.easeOut):lN[e]}function dN(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=uN(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function fN(e){return typeof e==`function`&&`applyToOptions`in e}function pN({type:e,...t}){return fN(e)&&sN()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var mN=class extends EM{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=pN(e);this.animation=dN(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=vM(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),aN(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},wM(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return Qk(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Qk(e)}get time(){return Qk(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Zk(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&ine()?(this.animation.timeline=e,t?.(this.animation),qk):n(this)}},hN={anticipate:sA,backInOut:oA,circInOut:uA};function gN(e){return e in hN}function _N(e){typeof e.ease==`string`&&gN(e.ease)&&(e.ease=hN[e.ease])}var vN=class extends mN{constructor(e){_N(e),bM(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}elapsed(){return this.state===`running`?(SA.now()-this.startTime)*this.speed:this.time*1e3}sample(e){if(!this.sampler){let{motionValue:e,onUpdate:t,onComplete:n,onPlay:r,onStop:i,element:a,...o}=this.options;this.sampler=new kM({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){let{state:e}=this;if(e===`running`||e===`paused`)return this.sample(this.elapsed())}updateMotionValue(e){let{motionValue:t,element:n,name:r}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let{speed:i}=this,a=this.elapsed(),o=this.state===`running`&&i?Vk(0,10,a):0,s=this.sample(a);n&&r&&aN(n,r,s),t.setWithVelocity(this.sample(a-o*Math.sign(i)),s,o/Math.abs(i||1))}},yN=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(hj.test(e)||e===`0`)&&!e.startsWith(`url(`));function bN(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function xN(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=yN(i,t),s=yN(a,t);return!o||!s?(o!==s&&`${t}${i}${a}${o?a:i}`,!1):bN(e)||(n===`spring`||fN(n))&&r}function SN(e){e.duration=0,e.type=`keyframes`}var CN=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),wN=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function TN(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&wN.test(e[t]))return!0;return!1}var EN=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),DN=Kk(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function ON(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(CN.has(n)||EN.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return DN()&&(CN.has(n)||EN.has(n)&&TN(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var kN=(e,t)=>t&&typeof e==`number`?t.transform(e):e,AN={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},jN=qM.length;function MN(e,t,n){let r=``,i=!0;for(let a=0;a<jN;a++){let o=qM[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=kN(s,IM[o]);if(!c){i=!1;let t=AN[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${kN(a,IM.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}var NN=new WeakMap,PN=200,FN=.001,IN=.1,LN=.001,RN=100,zN=e=>/^(linear|ease(In|Out|InOut))$/.test(e),BN=(e,t)=>e-t,VN=(e,t,n)=>{let r=[];for(let i=0;i<=n;i++)r.push(yj(e,t,i/n));return r},HN=e=>e.motionValue.owner,UN=e=>NN.get(e),WN=(e,t)=>e.latestValues?e.latestValues[t]:e.getValue(t)?.get(),GN=({name:e,motionValue:t})=>e&&qM.includes(e)&&t?.owner?.current instanceof HTMLElement&&DN()&&sN();function KN(e){let t=HN(e),{onUpdate:n,transformTemplate:r}=t.getProps();return!e.isHandoff&&!n&&!e.hasOnUpdate&&!r&&e.type!==`inertia`&&(WN(t,`transform`)||`none`)===`none`&&!WN(t,`pathRotation`)&&!t.projection?.isProjecting()}var qN=class extends kM{constructor(e){let t=HN(e).current,{driver:n=Uj}=e,r=KN(e);e.driver=e=>{let r=n(e);return{js:r,now:r.now,start:(e=!0)=>{let n=UN(t);!n||n.isJS?r.start(e):n.schedule(!1,!e)},stop:()=>{r.stop();let e=UN(t);e?.schedule(!e.isFinishing)}}},super(e),this.canAccelerate=r;let{stop:i}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),i()}}get group(){return UN(HN(this.options).current)}get js(){return this.driver?.js}get name(){return this.options.name}timing(){let{startTime:e,speed:t,totalDuration:n}=this,{delay:r=0,repeatType:i}=this.options;return this.holdTime===null?n===1/0?[e+r/t,this.resolvedDuration*(i===`loop`?1:2)/t||1]:[e+(r+n)/t,0]:[1/0,0]}isAccelerated(){let{group:e,state:t}=this;return e?.tracks.has(this)&&!e.isJS&&this.canAccelerate&&(t===`running`||t===`paused`)}liveValue(){return this.isAccelerated()?this.sampleAt(SA.now()):void 0}tween(){let{keyframes:e,type:t,ease:n,times:r,repeat:i,delay:a=0}=this.options,o=hA(n)?cN(n):zN(n)&&lN[n];if(o&&!i&&!r&&e.length===2&&t===pM&&this.holdTime===null){let e=this.startTime+a/this.speed;return[e,e+this.resolvedDuration/this.speed,o]}}boundaries(e,t){let{startTime:n,speed:r,resolvedDuration:i,options:a}=this,{delay:o=0,repeat:s=0,repeatDelay:c=0,repeatType:l,times:u,keyframes:d,type:f}=a,p=(f||pM)===pM?u||uM(d):[0,1],m=n+o/r,h=[];if(this.holdTime!==null||!(i>0))return h;for(let n=Math.max(0,Math.floor((e-m)*r/i));n<=s;n++){let a=m+n*i/r;if(a>t)break;for(let o of p){let s=a+(n%2&&l&&l!==`loop`?1-o:o)*(i-c)/r;s>e&&s<t&&h.push(s)}}return h}numberAt(e){return parseFloat(this.sampleAt(e,!0))}sync(){let e=SA.now();this.options.motionValue.setWithVelocity(this.sampleAt(e-10,!0),this.sampleAt(e,!0),10)}play(){this.isStopped||((this.group||JN(HN(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&(this.sync(),this.group.schedule(!1))}complete(){super.complete();let{group:e}=this;e&&!e.isJS&&this.canAccelerate&&this.tick(SA.now())}get time(){return this.isAccelerated()?Qk(Vk(0,this.totalDuration,this.at(SA.now())-(this.options.delay||0))):super.time}set time(e){super.time=e}attachTimeline(e){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(e)}};function JN(e){let t=e.current,n=new Set,r=new Map,i={},a=[],o=new Map,s=[],c=!1,l=!1,u=!1,d=-1/0,f=e=>{for(let t of n)if(t.name===e)return!0},p=(t,n)=>{let o={};for(let s of t===void 0?qM:a){let a=r.get(s),c=t===void 0?WN(e,s):a?a.sampleAt(n>t&&!a.timing()[1]?n:t):i[s];c!==void 0&&(o[s]=c)}return o},m=(e,t)=>{let n=``,r=p(e,t);for(let e in r)n+=(AN[e]||e)+`(`+kN(r[e],IM[e])+`) `;return n||`none`},h=(e=p())=>{t.style.transform=MN(e,{})},g=(e=!0)=>{e&&h(),s.forEach(({animation:e})=>e.cancel()),s=[]},_=(e,t,n=1/0)=>{let r={animation:e,offset:t,end:n};e.startTime=SA.now()+t,n<1/0&&(e.onfinish=()=>{r.isDone=!0,s.some(e=>e.end===1/0)&&(e.cancel(),s=s.filter(e=>e!==r)),E.schedule(!1)}),e.oncancel=()=>s.includes(r)&&E.demote(),s.push(r)},v=(e,t,n)=>{let r=(t,n)=>Math.abs(e(n)-e(t)),i=r(t,n);for(;n-t>.01;){let e=(t+n)/2;r(t,e)>r(e,n)?n=e:t=e}return r(t,n)>i/2?[t,n]:[]},y=(e,t,n,r)=>{let i=Math.min(PN,Math.max(2,Math.ceil((n-t)/10)));if(r.length*4>i)return;let a=VN(t,n,i).concat(r).sort(BN),o=e=>Yk(t,n,e),s,c;for(let t of e){let e=a.map(e=>t.numberAt(e)),[n]=e,r=e[e.length-1]-n,i=e.map(e=>r?(e-n)/r:e-n);if(!r){if(i.some(e=>!(Math.abs(e)<=FN)))return}else if(!s)s=i,c=e=>(t.numberAt(e)-n)/r;else if(i.some((e,t)=>!(Math.abs(e-s[t])<=FN)))return}if(!s||s.every((e,t)=>Math.abs(e-o(a[t]))<=FN))return`linear`;let l=[],u=(e,t=c(e))=>l.push(OM(t)+` `+OM(o(e)*100)+`%`);return s.forEach((e,t)=>{t&&Math.abs(e-s[t-1])>.2&&v(c,a[t-1],a[t]).forEach(e=>u(e)),u(a[t],e)}),`linear(`+l+`)`},b=(e,t,n,r)=>{let i=[t],a=(t,n)=>e.every(e=>!(Math.abs(e.numberAt((t+n)/2)-(e.numberAt(t)+e.numberAt(n))/2)>(e.name.startsWith(`scale`)?LN:IN))),o=(t,n,r)=>{if(n-t<1||a(t,n))i.push(n);else if(r<4)o(t,(t+n)/2,r+1),o((t+n)/2,n,r+1);else{for(let r of e)i.push(...v(e=>r.numberAt(e),t,n));i.push(n)}},s=VN(t,n,Math.ceil((n-t)/100));for(let e of r)s.push(e,Math.min(e+.01,n));let c=t;for(let e of s.sort(BN))e>c&&o(c,e,0),c=e;return i.sort(BN)},x=e=>{let t;for(let n of e){let e=n.tween();if(!e||t?.some((t,n)=>n<2?Math.abs(e[n]-t)>1:e[n]!==t))return;t=e}return t},S=(e,n,r,i={fill:`both`},a,o)=>{let s=e.flatMap(e=>e.boundaries(n,r)),c=o||y(e,n,r,s),l=c?[n,r]:b(e,n,r,s),u=l.map(e=>m(e,a)),d={transform:u};return c||(d.offset=l.map(e=>Yk(n,r,e))),u.every(e=>e===u[0])&&(h(p(n,a)),d=null),t.animate(d,{...i,duration:r-n,easing:c||`linear`})},C=c=>{let l=c,u=0,d=0,f=[],p=[],m=new Set;r.clear(),o=new Map;for(let e of n){r.set(e.name,e);let[t,n]=e.timing(),i=t===1/0;if(o.set(e,[e.at(c),e.speed,i]),i){e.sync();continue}if(e.speed<0)return;if(n){if(u){let e=(t-d)/n;if(Math.abs(n-u)>1||Math.abs(e-Math.round(e))*u>1)return}else u=n,d=t;p.push(e)}else m.add(t);f.push(e),l=Math.max(l,t)}i={},a=qM.filter(t=>{if(r.has(t))return!0;let n=i[t]=WN(e,t);return n!==void 0&&parseFloat(n)!==+!!t.startsWith(`scale`)}),g(!1);let h=!u&&x(f);try{if(h&&h[1]>c){let[e,t,n]=h;_(S(f,e,t,void 0,void 0,n),e-c,t-e)}else l>c&&(_(S(f,c,l),0,l-c),m.forEach(e=>e<l-1&&_(t.animate(null,{duration:e-c}),0,e-c)));if(u){let e=d+Math.floor((l-d)/u)*u;_(S(p,e,e+u,{iterations:1/0,iterationStart:(l-e)/u,fill:`forwards`},l),l-c)}}catch{return}return s.length||g(),!0},w=e=>{let t,r=0;for(let i of n){let n=o.get(i);if(!n)return!1;let[a,s,c]=n,l=i.at(e),u=i.timing()[0]===1/0;if(c){if(u&&l===a)continue;return!1}let d=(l-a)/s,f=u?0:i.speed/s;if(t===void 0)t=d,r=f;else if(Math.abs(d-t)>1||f!==r)return!1}if(t===void 0)return!0;if(!s.length)return!1;for(let{offset:e,end:n,isDone:r}of s){let i=t-e;if(n<1/0&&(r?i<n-1:i<0||i>=n))return!1}for(let{animation:n,offset:i,isDone:a}of s){if(a)continue;let o=t-i;r?(n.playbackRate=r,n.startTime=e-o/r):(n.pause(),n.currentTime=o)}return!0},T=()=>{let r=SA.now();if(E.isJS||(E.isFinishing=!0,n.forEach(t=>{let[n,a]=t.timing();t.state===`running`&&t.speed>0&&!a&&n<=r+1&&(t.complete(),i[t.name]=WN(e,t.name),o.has(t)||(c=!0))}),E.isFinishing=!1),l=!1,n.forEach(({state:e},t)=>{(e===`idle`||e===`finished`)&&n.delete(t)}),!n.size){NN.delete(t),E.isJS||g();return}for(let e of n)if(!e.canAccelerate)return E.demote(!0);E.isJS&&(E.isJS=!1,c=!0,n.forEach(e=>e.js?.stop()));let a=c,s=u;if(c=u=!1,a||!w(r)){if(s){if(r-d<RN)return E.demote();d=r}if(!C(r))return E.demote()}},E={tracks:n,isJS:!1,isFinishing:!1,schedule(e,t){c||=e,u||=!!t,l||(l=!0,yA.isProcessing?Bj.render(T,!1,!0):queueMicrotask(T))},check(){if(!E.isJS){for(let t in i)if(WN(e,t)!==i[t]&&!f(t))return E.schedule(!0,!0)}},demote(e){E.isJS||(n.forEach(t=>{t.isAccelerated()&&t.sync(),e||(t.canAccelerate=!1)}),E.isJS=!0,o=new Map,g(),n.forEach(e=>e.state===`running`&&e.js?.start()))}};return NN.set(t,E),E}var YN=class extends EM{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=SA.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||iN;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=SA.now();let u=!0;xN(e,i,a,o)||(u=!1,(Hk.instantAnimations||!s)&&l?.(vM(e,n,t)),e[0]=e[e.length-1],SN(n),n.repeat=0);let{onComplete:d}=n;n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{d?.(),this.notifyFinished()};let f=u&&!c&&ON(n),p=!f&&GN(n);r&&(f||p||this.resolvedAt!==this.createdAt)&&(n.startTime??=SM(this.createdAt,this.resolvedAt));let m;if(f){n.element=n.motionValue?.owner?.current;try{m=new vN(n)}catch{m=new kM(n)}}else m=p?new qN(n):new kM(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),ene()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function XN(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var ZN=30,QN=e=>!isNaN(parseFloat(e)),$N={current:void 0},eP=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=SA.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=SA.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=QN(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new Xk)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new Xk,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){Bj.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){$N.current&&$N.current.push(this);let e=this.animation?.liveValue?.();return e===void 0?this.current:e}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=SA.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ZN)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,ZN);return $k(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&this.clearAnimation(),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function tP(e,t){return new eP(e,t)}function nP(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function rP(e,t){let n=e?.[t]??e?.default??e;return n===e?n:nP(n,e)}var iP={type:`spring`,stiffness:500,damping:25,restSpeed:10},aP=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),oP={type:`keyframes`,duration:.8},sP={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},cP=(e,{keyframes:t})=>t.length>2?oP:JM.has(e)?e.startsWith(`scale`)?aP(t[1]):iP:sP,lP=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function uP(e){for(let t in e)if(!lP.has(t))return!0;return!1}var dP=(e,t,n,r={},i,a)=>o=>{let s=rP(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=Zk(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i,hasOnUpdate:!!s.onUpdate};uP(s)||Object.assign(u,cP(e,u)),u.duration&&=Zk(u.duration),u.repeatDelay&&=Zk(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(SN(u),u.delay===0&&(d=!0)),(Hk.instantAnimations||Hk.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,SN(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=vM(u.keyframes,s);if(e!==void 0){Bj.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new kM(u):new YN(u)},fP=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function pP(e){let t=fP.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function mP(e,t,n=1){`${e}`;let[r,i]=pP(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Uk(e)?parseFloat(e):e}return DA(i)?mP(i,t,n+1):i}function hP(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function gP(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...hP(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function _P(e,t,n){return gP(e.getProps(),t,n,e)}var vP=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,yP=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...qM]),bP=e=>Array.isArray(e);function xP(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,tP(n))}function SP(e){return bP(e)?e[e.length-1]||0:e}function CP(e,t){let{transitionEnd:n={},transition:r={},...i}=_P(e,t)||{};i={...i,...n};for(let t in i)xP(e,t,SP(i[t]))}var wP=e=>!!(e&&e.getVelocity);function TP(e){return!!(wP(e)&&e.add)}function EP(e,t){let n=e.getValue(`willChange`);if(TP(n))return n.add(t);if(!n&&Hk.WillChange){let n=new Hk.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function DP(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var OP=`data-`+DP(`framerAppearId`);function kP(e){return e.props[OP]}var AP=typeof window<`u`;function jP({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function MP(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?nP(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&jP(f,t))continue;let o={delay:n,...rP(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){Bj.update(()=>r.set(i));continue}let p=!1;if(AP&&window.MotionHandoffAnimation){let n=kP(e);if(n){let e=window.MotionHandoffAnimation(n,t,Bj);e!==null&&(o.startTime=e,p=!0)}}EP(e,t);let m=l??e.shouldReduceMotion;r.start(dP(t,r,i,m&&yP.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>Bj.update(()=>{o&&CP(e,o)});d.length?Promise.all(d).then(t):t()}return d}function NP(e,t,n={}){let r=_P(e,t,vP(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?MP(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(NP(e,t,{...n,delay:r+(typeof o==`function`?0:o)+XN(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function PP(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>NP(e,t,n))):typeof t==`string`?NP(e,t,n):Promise.all(MP(e,_P(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var FP={test:e=>e===`auto`,parse:e=>e},IP=e=>t=>t.test(e),LP=[AA,K,GA,WA,qA,KA,FP],RP=e=>LP.find(IP(e));function zP(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Gk(e)}var BP=new Set([`auto`,`none`,`0`]);function VP(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!BP.has(t)&&sj(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=RM(n,i))}var HP=class extends iN{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){let{unresolvedKeyframes:e,element:t,motionValue:n}=this,r=e[0]??n?.get();if(!t?.current||r===void 0)return!1;for(let t=0;t<e.length;t++)if(kA(t?e[t]:r))return!1;return!0}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),DA(r))){let i=mP(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!yP.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=RP(r),o=RP(i);if(kA(r)!==kA(i)&&ZM[n]){this.needsMeasurement=!0;return}if(a!==o){if(YM(a)&&YM(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else ZM[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||zP(e[t]))&&n.push(t);n.length&&VP(e,n,t)}measure(){let{element:e,name:t}=this;return ZM[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e||!e.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},UP=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function WP(e){return Wk(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function GP(e){return Wk(e)&&`ownerSVGElement`in e}function KP(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}function qP(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(JM.has(e)){o=!0;continue}if(TA(e)){i[e]=n;continue}{let t=kN(n,IM[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=MN(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var JP={offset:`stroke-dashoffset`,array:`stroke-dasharray`},YP={offset:`strokeDashoffset`,array:`strokeDasharray`};function XP(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?JP:YP;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var ZP=[`transform`,`opacity`,`clipPath`,`filter`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function QP(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(qP(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of ZP)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&XP(d,i,a,o,!1)}function $P({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function eF({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function tF(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function nF(e){return e===void 0||e===1}function rF({scale:e,scaleX:t,scaleY:n}){return!nF(e)||!nF(t)||!nF(n)}function iF(e){return rF(e)||aF(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function aF(e){return oF(e.x)||oF(e.y)}function oF(e){return e&&e!==`0%`}function sF(e,t,n){return n+t*(e-n)}function cF(e,t,n,r,i){return i!==void 0&&(e=sF(e,i,r)),sF(e,n,r)+t}function lF(e,t=0,n=1,r,i){e.min=cF(e.min,t,n,r,i),e.max=cF(e.max,t,n,r,i)}function uF(e,{x:t,y:n}){lF(e.x,t.translate,t.scale,t.originPoint),lF(e.y,n.translate,n.scale,n.originPoint)}var dF=.999999999999,fF=1.0000000000001;function pF(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(mF(e.x,-a.scroll.offset.x),mF(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,uF(e,o)),r&&iF(a.latestValues)&&_F(e,a.latestValues,a.layout?.layoutBox))}t.x<fF&&t.x>dF&&(t.x=1),t.y<fF&&t.y>dF&&(t.y=1)}function mF(e,t){e.min+=t,e.max+=t}function hF(e,t,n,r,i=.5){lF(e,t,n,yj(e.min,e.max,i),r)}function gF(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function _F(e,t,n){let r=n??e;hF(e.x,gF(t.x,r.x),t.scaleX,t.scale,t.originX),hF(e.y,gF(t.y,r.y),t.scaleY,t.scale,t.originY)}function vF(e,t){return $P(tF(e.getBoundingClientRect(),t))}function yF(e,t,n){let r=vF(e,n),{scroll:i}=t;return i&&(mF(r.x,i.offset.x),mF(r.y,i.offset.y)),r}var{schedule:bF,cancel:ane}=zj(queueMicrotask,!1),xF={x:!1,y:!1};function SF(){return xF.x||xF.y}function CF(e){return e===`x`||e===`y`?xF[e]?null:(xF[e]=!0,()=>{xF[e]=!1}):xF.x||xF.y?null:(xF.x=xF.y=!0,()=>{xF.x=xF.y=!1})}function wF(e,t){let n=KP(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function TF(e){return!(e.pointerType===`touch`||SF())}function EF(e,t,n={}){let[r,i,a]=wF(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!TF(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var DF=(e,t)=>t?e===t||DF(e,t.parentElement):!1,OF=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,kF=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function AF(e){return kF.has(e.tagName)||e.isContentEditable===!0}var jF=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function MF(e){return jF.has(e.tagName)||e.isContentEditable===!0}var NF=new WeakSet;function PF(e){return t=>{t.key===`Enter`&&e(t)}}function FF(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var IF=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=PF(()=>{if(NF.has(n))return;FF(n,`down`);let e=PF(()=>{FF(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>FF(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function LF(e){return OF(e)&&!SF()}var RF=new WeakSet;function zF(e,t,n={}){let[r,i,a]=wF(e,n),o=e=>{let r=e.currentTarget;if(!LF(e)||RF.has(e))return;NF.add(r),n.stopPropagation&&RF.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),NF.has(r)&&NF.delete(r),LF(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||DF(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),WP(e)&&(e.addEventListener(`focus`,e=>IF(e,i)),!AF(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var BF=new WeakMap,VF,HF=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:GP(r)&&`getBBox`in r?r.getBBox()[t]:r[n],UF=HF(`inline`,`width`,`offsetWidth`),WF=HF(`block`,`height`,`offsetHeight`);function GF({target:e,borderBoxSize:t}){BF.get(e)?.forEach(n=>{n(e,{get width(){return UF(e,t)},get height(){return WF(e,t)}})})}function KF(e){e.forEach(GF)}function qF(){typeof ResizeObserver<`u`&&(VF=new ResizeObserver(KF))}function JF(e,t){VF||qF();let n=KP(e);return n.forEach(e=>{let n=BF.get(e);n||(n=new Set,BF.set(e,n)),n.add(t),VF?.observe(e)}),()=>{n.forEach(e=>{let n=BF.get(e);n?.delete(t),n?.size||VF?.unobserve(e)})}}var YF=new Set,XF;function ZF(){XF=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};YF.forEach(t=>t(e))},window.addEventListener(`resize`,XF)}function QF(e){return YF.add(e),XF||ZF(),()=>{YF.delete(e),!YF.size&&typeof XF==`function`&&(window.removeEventListener(`resize`,XF),XF=void 0)}}function $F(e,t){return typeof e==`function`?QF(e):JF(e,t)}var eI={value:null,addProjectionMetrics:null};function tI(e){return GP(e)&&e.tagName===`svg`}function nI(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=cM(i,a,o);return t?s(r):s}var rI=e=>typeof e==`number`?e:parseFloat(e),iI=()=>({translate:0,scale:1,origin:0,originPoint:0}),aI=()=>({x:iI(),y:iI()}),oI=()=>({min:0,max:0}),sI=()=>({x:oI(),y:oI()}),cI=new WeakMap;function lI(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function uI(e){return typeof e==`string`||Array.isArray(e)}var dI=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],fI=[`initial`,...dI];function pI(e){if(lI(e.animate))return!0;for(let t=0;t<fI.length;t++)if(uI(e[fI[t]]))return!0;return!1}function mI(e){return!!(pI(e)||e.variants)}function hI(e,t,n){for(let r in t){let i=t[r],a=n[r];if(wP(i))e.addValue(r,i);else if(wP(a))e.addValue(r,tP(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,tP(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var gI={current:null},_I={current:!1},vI=typeof window<`u`;function yI(){if(_I.current=!0,vI){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>gI.current=e.matches;e.addEventListener(`change`,t),t()}else gI.current=!1}}var bI=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],xI={};function SI(e){xI=e}function CI(){return xI}var wI=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=iN,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=SA.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Bj.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=pI(t),this.isVariantNode=mI(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&wP(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,cI.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(_I.current||yI(),this.shouldReduceMotion=gI.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Vj(this.notifyUpdate),Vj(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&CN.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new mN({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:Zk(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=JM.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&Bj.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),NN.get(this.current)?.check()),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in xI){let t=xI[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):sI()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){let{transformTemplate:n,onUpdate:r}=this.props;(e.transformTemplate||n)&&this.scheduleRender(),(e.transformTemplate&&!n||e.onUpdate&&!r)&&NN.get(this.current)?.demote(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<bI.length;t++){let n=bI[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=hI(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=tP(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Uk(n)||Gk(n))?n=parseFloat(n):typeof n!=`number`&&!hj.test(n)&&hj.test(t)&&(n=RM(e,t)),this.setBaseTarget(e,wP(n)?n.get():n)),wP(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return this.events[e]||(this.events[e]=new Xk),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){bF.render(this.render)}},TI=class extends wI{constructor(){super(...arguments),this.KeyframeResolver=HP}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;wP(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},EI=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function DI(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}var OI={};function kI(e,{layout:t,layoutId:n}){return JM.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!OI[e]||e===`opacity`)}function AI(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(wP(r[t])||i&&wP(i[t])||kI(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function jI(e){return window.getComputedStyle(e)}var MI=class extends TI{constructor(){super(...arguments),this.type=`html`,this.renderInstance=DI}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(JM.has(t))return this.projection?.isProjecting?GM(t):Jte(e,t);{let n=jI(e),r=(TA(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return vF(e,t)}build(e,t,n){qP(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return AI(e,t,n)}},NI=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),PI=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function FI(e,t,n,r){DI(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(NI.has(n)?n:DP(n),t.attrs[n])}function II(e,t,n){let r=AI(e,t,n);for(let n in e)if(n!==`children`&&(wP(e[n])||wP(t[n]))){let t=qM.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var LI=class extends TI{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=sI}getBaseTargetFromProps(e,t){return JM.has(t)?super.getBaseTargetFromProps(e,t)??GM(t):e[t]}getDefaultValue(e){return JM.has(e)?this.latestValues[e]??GM(e):void 0}readValueFromInstance(e,t){if(JM.has(t)){let e=LM(t);return e&&e.default||0}if(ZP.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=NI.has(t)?t:DP(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return II(e,t,n)}build(e,t,n){QP(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){FI(e,t,n,r)}mount(e){this.isSVGTag=PI(e.tagName),super.mount(e)}};function RI(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var zI=[...dI].reverse();function BI(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>PP(e,t,n))),n=HI(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,l=r||i,u=[],d=new Set,f={},p=1/0,m=e;do m=m.props.inherit!==!1&&m.parent;while(m&&!m.isControllingVariants);if(zI.forEach((t,r)=>{let i=n[t],h=o[t],g=m&&m.props[t],_=h===void 0?uI(g)||g===!1?g:void 0:h,v=uI(_),y=t===a?i.isActive:null;y===!1&&(p=r);let b=v&&h===void 0&&!(l&&c);if(i.protectedKeys={...f},!i.isActive&&y===null||!_&&!i.prevProp||lI(_)||typeof _==`boolean`)return;if(t===`exit`&&i.isActive&&y!==!0){f={...f,...i.prevResolvedValues};return}let x=VI(i.prevProp,_),S=x||v&&(y&&!b||r>p),C=!1,w=Array.isArray(_)?_:[_],T={};if(y!==!1)for(let n of w){let{transition:r,transitionEnd:i,...a}=_P(e,n,vP(e,t))||{};T={...T,...a,...i}}let{prevResolvedValues:E}=i;for(let t in{...E,...T}){if(t in f)continue;let n=T[t],r=E[t],a=Array.isArray(n)&&Array.isArray(r)?!RI(n,r)||x:n!==r;if(a&&n==null)d.add(t);else if(a||n!==void 0&&d.has(t)){S=!0,d.delete(t)&&(C=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0}if(i.prevProp=_,i.prevResolvedValues=T,i.isActive&&(f={...f,...T}),S&&(!(b&&x)||C))for(let n of w){let r={type:t};if(typeof n==`string`&&l&&c&&s?.enteringChildren){let t=_P(s,n)?.transition?.delayChildren;r.delay=XN(s.enteringChildren,e,t)}u.push({animation:n,options:r})}}),d.size){let{initial:t}=o,n={},r=typeof t!=`boolean`&&_P(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom);r&&r.transition&&(n.transition=r.transition),d.forEach(i=>{let a=e.getValue(i);a&&(a.liveStyle=!0);let s=r&&!Array.isArray(t)?r[i]:void 0,c=e.getBaseTargetFromProps(o,i);n[i]=(s===void 0?c!==void 0&&!wP(c)?c:e.initialValues[i]===void 0?e.baseTarget[i]:void 0:s)??null}),u.push({animation:n})}let h=l&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!h&&u.length?t(u):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=HI(),i=!0}}}function VI(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!RI(t,e):!1}function HI(){let e={};for(let t of dI)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}};return e}function UI(e,t){e.min=t.min,e.max=t.max}function WI(e,t){UI(e.x,t.x),UI(e.y,t.y)}function GI(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var KI=.9999,qI=1.0001,JI=-.01,YI=.01;function XI(e){return e.max-e.min}function ZI(e,t,n){return Math.abs(e-t)<=n}function QI(e,t,n,r=.5){e.origin=r,e.originPoint=yj(t.min,t.max,e.origin),e.scale=XI(n)/XI(t),e.translate=yj(n.min,n.max,e.origin)-e.originPoint,(e.scale>=KI&&e.scale<=qI||isNaN(e.scale))&&(e.scale=1),(e.translate>=JI&&e.translate<=YI||isNaN(e.translate))&&(e.translate=0)}function $I(e,t,n,r){QI(e.x,t.x,n.x,r?r.originX:void 0),QI(e.y,t.y,n.y,r?r.originY:void 0)}function eL(e,t,n,r=0){e.min=(r?yj(n.min,n.max,r):n.min)+t.min,e.max=e.min+XI(t)}function tL(e,t,n,r){eL(e.x,t.x,n.x,r?.x),eL(e.y,t.y,n.y,r?.y)}function nL(e,t,n,r=0){let i=r?yj(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+XI(t)}function rL(e,t,n,r){nL(e.x,t.x,n.x,r?.x),nL(e.y,t.y,n.y,r?.y)}function iL(e,t,n,r,i){return e-=t,e=sF(e,1/n,r),i!==void 0&&(e=sF(e,1/i,r)),e}function aL(e,t=0,n=1,r=.5,i,a=e,o=e){if(GA.test(t)&&(t=parseFloat(t),t=yj(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=yj(a.min,a.max,r);e===a&&(s-=t),e.min=iL(e.min,t,n,s,i),e.max=iL(e.max,t,n,s,i)}function oL(e,t,[n,r,i],a,o){aL(e,t[n],t[r],t[i],t.scale,a,o)}var sL=[`x`,`scaleX`,`originX`],cL=[`y`,`scaleY`,`originY`];function lL(e,t,n,r){oL(e.x,t,sL,n?n.x:void 0,r?r.x:void 0),oL(e.y,t,cL,n?n.y:void 0,r?r.y:void 0)}function uL(e){return e.translate===0&&e.scale===1}function dL(e){return uL(e.x)&&uL(e.y)}function fL(e,t){return e.min===t.min&&e.max===t.max}function pL(e,t){return fL(e.x,t.x)&&fL(e.y,t.y)}function mL(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function hL(e,t){return mL(e.x,t.x)&&mL(e.y,t.y)}function gL(e){return XI(e.x)/XI(e.y)}function _L(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function vL(e){return[e(`x`),e(`y`)]}function yL(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var bL={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(K.test(e))e=parseFloat(e);else return e}return`${yL(e,t.target.x)}% ${yL(e,t.target.y)}%`}},xL={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=hj.parse(e);if(i.length>5)return r;let a=hj.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=yj(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}};function SL(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var CL=UP.length,wL=e=>typeof e==`number`||K.test(e);function TL(e,t,n,r,i,a){i?(e.opacity=yj(0,n.opacity??1,DL(r)),e.opacityExit=yj(t.opacity??1,0,OL(r))):a&&(e.opacity=yj(t.opacity??1,n.opacity??1,r));for(let i=0;i<CL;i++){let a=UP[i],o=EL(t,a),s=EL(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||wL(o)===wL(s)?(e[a]=Math.max(yj(rI(o),rI(s),r),0),(GA.test(s)||GA.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=yj(t.rotate||0,n.rotate||0,r))}function EL(e,t){return e[t]===void 0?e.borderRadius:e[t]}var DL=kL(0,.5,lA),OL=kL(.5,.95,qk);function kL(e,t,n){return r=>r<e?0:r>t?1:n(Yk(e,t,r))}function AL(e,t,n){let r=wP(e)?e:tP(e);return r.start(dP(``,r,t,n)),r.animation}function jL(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var ML=(e,t)=>e.depth-t.depth,NL=class{constructor(){this.children=[],this.isDirty=!1}add(e){Rk(this.children,e),this.isDirty=!0}remove(e){zk(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ML),this.isDirty=!1,this.children.forEach(e)}};function PL(e,t){let n=SA.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Vj(r),e(a-t))};return Bj.setup(r,!0),()=>Vj(r)}function FL(e){return wP(e)?e.get():e}var IL=class{constructor(){this.members=[]}add(e){Rk(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(zk(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(zk(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},LL={borderRadius:{...bL,applyTo:[...UP]},borderTopLeftRadius:bL,borderTopRightRadius:bL,borderBottomLeftRadius:bL,borderBottomRightRadius:bL,boxShadow:xL},RL={hasAnimatedSinceResize:!0,hasEverUpdated:!1};Object.assign(OI,{...LL,...OI});var zL={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},BL=[``,`X`,`Y`,`Z`],VL=1e3,HL=0;function UL(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var WL=({instance:e})=>e&&NN.get(e)?.demote();function GL(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=kP(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,Bj,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&GL(r)}function KL({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=HL++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,eI.value&&(zL.nodes=zL.calculatedTargetDeltas=zL.calculatedProjections=0),this.nodes.forEach(YL),this.nodes.forEach(oR),this.nodes.forEach(sR),this.nodes.forEach(XL),eI.addProjectionMetrics&&eI.addProjectionMetrics(zL)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new NL)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Xk),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=GP(t)&&!tI(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;Bj.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=PL(i,250),RL.hasAnimatedSinceResize&&(RL.hasAnimatedSinceResize=!1,this.nodes.forEach(aR)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||mR,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!hL(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...rP(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||aR(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Vj(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(cR),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&GL(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;WL(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,WL(t),(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1),t.isAnimationBlocked&&(t.dragSnapshot||=t.measure(),this.dragAncestor=t)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach($L),this.nodes.forEach(QL);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(eR);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(nR),this.nodes.forEach(rR),this.nodes.forEach(iR),this.nodes.forEach(qL),this.nodes.forEach(JL)):this.nodes.forEach(eR),this.clearAllSnapshots();let e=SA.now();yA.delta=Vk(0,1e3/60,e-yA.timestamp),yA.timestamp=e,yA.isProcessing=!0,Hj.update.process(yA),Hj.preRender.process(yA),Hj.render.process(yA),yA.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,bF.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ZL),this.sharedNodes.forEach(lR)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Bj.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Bj.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!XI(this.snapshot.measuredBox.x)&&!XI(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=sI(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;e&&WL(this);let t=this.projectionDelta&&!dL(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||iF(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),vR(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return sI();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(bR))){let{scroll:e}=this.root;e&&(mF(t.x,e.offset.x),mF(t.y,e.offset.y))}return t}removeElementScroll(e){let t=sI();if(WI(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&WI(t,e),mF(t.x,i.offset.x),mF(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||sI();WI(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(mF(r.x,-n.scroll.offset.x),mF(r.y,-n.scroll.offset.y)),iF(n.latestValues)&&_F(r,n.latestValues,n.layout?.layoutBox)}return iF(this.latestValues)&&_F(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=sI();WI(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!iF(n.latestValues))continue;let r;n.instance&&(rF(n.latestValues)&&n.updateSnapshot(),r=sI(),WI(r,n.measurePageBox())),lL(t,n.latestValues,n.snapshot?.layoutBox,r)}return iF(this.latestValues)&&lL(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==yA.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=yA.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=sI(),this.targetWithTransforms=sI()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),tL(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):WI(this.target,this.layout.layoutBox),uF(this.target,this.targetDelta)):WI(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),eI.value&&zL.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||rF(this.parent.latestValues)||aF(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=sI(),this.relativeTargetOrigin=sI(),rL(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),WI(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===yA.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;WI(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;pF(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=sI());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(GI(this.prevProjectionDelta.x,this.projectionDelta.x),GI(this.prevProjectionDelta.y,this.projectionDelta.y)),$I(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!_L(this.projectionDelta.x,this.prevProjectionDelta.x)||!_L(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),eI.value&&zL.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=aI(),this.projectionDelta=aI(),this.projectionDeltaWithTransform=aI()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=aI();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=sI(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(pR));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=yj(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=yj(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(uR(o.x,e.x,n),uR(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(rL(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),fR(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&pL(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=sI(),WI(f,this.relativeTarget)),c&&(this.animationValues=a,TL(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Vj(this.pendingAnimation),void 0),this.pendingAnimation=Bj.update(()=>{RL.hasAnimatedSinceResize=!0,this.motionValue||=tP(0),this.motionValue.jump(0,!1),this.currentAnimation=AL(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),TM(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(VL),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&yR(this.options.animationType,this.layout.layoutBox,n.layoutBox)){i=this.target||sI();let t=XI(this.layout.layoutBox.x);i.x.min=e.target.x.min,i.x.max=i.x.min+t;let n=XI(this.layout.layoutBox.y);i.y.min=e.target.y.min,i.y.max=i.y.min+n}WI(t,i),_F(t,r),$I(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new IL),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&UL(`z`,e,r,this.animationValues);for(let t=0;t<BL.length;t++)UL(`rotate${BL[t]}`,e,r,this.animationValues),UL(`skew${BL[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=FL(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=FL(t?.pointerEvents)||``),this.hasProjected&&!iF(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=SL(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in OI){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=OI[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?FL(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(QL),this.root.sharedNodes.clear()}}}function qL(e){e.updateLayout(),tR(e)}function JL(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)vL(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=XI(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;UI(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else yR(i,t.layoutBox,n)&&vL(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=XI(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=aI();$I(o,n,t.layoutBox);let s=aI();a?$I(s,e.applyTransform(r,!0),t.measuredBox):$I(s,n,t.layoutBox);let c=!dL(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=sI();rL(s,t.layoutBox,i.layoutBox,o);let c=sI();rL(c,n,a.layoutBox,o),hL(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function YL(e){eI.value&&zL.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function XL(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ZL(e){e.clearSnapshot()}function QL(e){e.clearMeasurements()}function $L(e){e.isLayoutDirty=!0,e.updateLayout()}function eR(e){e.isLayoutDirty=!1}function tR(e){let{snapshot:t,dragAncestor:n}=e,r=n?.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;vL(e=>mF(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function nR(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function rR(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function iR(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function aR(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function oR(e){e.resolveTargetDelta()}function sR(e){e.calcProjection()}function cR(e){e.resetSkewAndRotation()}function lR(e){e.removeLeadSnapshot()}function uR(e,t,n){e.translate=yj(t.translate,0,n),e.scale=yj(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function dR(e,t,n,r){e.min=yj(t.min,n.min,r),e.max=yj(t.max,n.max,r)}function fR(e,t,n,r){dR(e.x,t.x,n.x,r),dR(e.y,t.y,n.y,r)}function pR(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var mR={duration:.45,ease:[.4,0,.1,1]},hR=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),gR=hR(`applewebkit/`)&&!hR(`chrome/`)?Math.round:qk;function _R(e){e.min=gR(e.min),e.max=gR(e.max)}function vR(e){_R(e.x),_R(e.y)}function yR(e,t,n){return e===`position`||e===`preserve-aspect`&&!ZI(gL(t),gL(n),.2)}function bR(e){return e!==e.root&&e.scroll?.wasRoot}var xR=KL({attachResizeListener:(e,t)=>jL(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),SR={current:void 0},CR=KL({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!SR.current){let e=new xR({});e.mount(window),e.setOptions({layoutScroll:!0}),SR.current=e}return SR.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),wR=(0,P.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function TR(e=!0){let t=(0,P.useContext)(Lk);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,P.useId)();(0,P.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,P.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var ER=(0,P.createContext)({strict:!1}),DR={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},OR=!1;function kR(){if(OR)return;let e={};for(let t in DR)e[t]={isEnabled:e=>DR[t].some(t=>!!e[t])};SI(e),OR=!0}function AR(){return kR(),CI()}function jR(e){let t=AR();for(let n in e)t[n]={...t[n],...e[n]};SI(t)}var MR=(0,P.createContext)({});function NR(e,t){if(pI(e)){let{initial:t,animate:n}=e;return{initial:t===!1||uI(t)?t:void 0,animate:uI(n)?n:void 0}}return e.inherit===!1?{}:t}function PR(e){let{initial:t,animate:n}=NR(e,(0,P.useContext)(MR));return(0,P.useMemo)(()=>({initial:t,animate:n}),[FR(t),FR(n)])}function FR(e){return Array.isArray(e)?e.join(` `):e}var IR=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function LR(e,t,n){for(let r in t)!wP(t[r])&&!kI(r,n)&&(e[r]=t[r])}function RR({transformTemplate:e},t){return(0,P.useMemo)(()=>{let n=IR();return qP(n,t,e),Object.assign({},n.vars,n.style)},[t])}function zR(e,t){let n=e.style||{},r={};return LR(r,n,e),Object.assign(r,RR(e,t)),r}function BR(e,t){let n={},r=zR(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var VR=()=>({...IR(),attrs:{}});function HR(e,t,n,r){let i=(0,P.useMemo)(()=>{let n=VR();return QP(n,t,PI(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};LR(t,e.style,e),i.style={...t,...i.style}}return i}var UR=new Set(`animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function WR(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||UR.has(e)}function GR(e,t){return e.startsWith(`on`)?!WR(e):t?.(e)??!WR(e)}function KR(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(wP(e[a])||(GR(a,r)||n===!0&&WR(a)||!t&&!WR(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var qR=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function JR(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(qR.indexOf(e)>-1||/[A-Z]/u.test(e))}function YR(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??JR(e)?HR:BR)(t,r,i,e),l=KR(t,typeof e==`string`,a,s),u=e===P.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,P.useMemo)(()=>wP(d)?d.get():d,[d]);return(0,P.createElement)(e,{...u,children:f})}function XR({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:ZR(n,r,i,e),renderState:t()}}function ZR(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=FL(a[e]);let{initial:o,animate:s}=e,c=pI(e),l=mI(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!lI(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=gP(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var QR=e=>(t,n)=>{let r=(0,P.useContext)(MR),i=(0,P.useContext)(Lk),a=()=>XR(e,t,r,i);return n?a():Fk(a)},$R=QR({scrapeMotionValuesFromProps:AI,createRenderState:IR}),ez=QR({scrapeMotionValuesFromProps:II,createRenderState:VR}),tz=Symbol.for(`motionComponentSymbol`);function nz(e,t,n){let r=(0,P.useRef)(n);(0,P.useInsertionEffect)(()=>{r.current=n});let i=(0,P.useRef)(null);return(0,P.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var rz=(0,P.createContext)({});function iz(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function az(e,t,n,r,i,a){let{visualElement:o}=(0,P.useContext)(MR),s=(0,P.useContext)(ER),c=(0,P.useContext)(Lk),l=(0,P.useContext)(wR),u=l.reducedMotion,d=l.skipAnimations,f=(0,P.useRef)(null),p=(0,P.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,P.useContext)(rz);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&oz(f.current,n,i,h);let g=(0,P.useRef)(!1);(0,P.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[OP],v=(0,P.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return Ik(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),Ik(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,P.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function oz(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:sz(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&iz(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function sz(e){if(e)return e.options.allowProjection===!1?sz(e.parent):e.projection}function cz(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&jR(r);let a=n?n===`svg`:JR(e),o=a?ez:$R;function s(n,s){let c,l={...(0,P.useContext)(wR),...n,layoutId:lz(n)},{isStatic:u,isValidProp:d}=l,f=PR(n),p=o(n,u);if(!u&&typeof window<`u`){uz(l,r);let t=dz(l);c=t.MeasureLayout,f.visualElement=az(e,p,l,i,t.ProjectionNode,a)}return(0,F.jsxs)(MR.Provider,{value:f,children:[c&&f.visualElement?(0,F.jsx)(c,{visualElement:f.visualElement,...l}):null,YR(e,n,nz(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,P.forwardRef)(s);return c[tz]=e,c}function lz({layoutId:e}){let t=(0,P.useContext)(Pk).id;return t&&e!==void 0?t+`-`+e:e}function uz(e,t){(0,P.useContext)(ER).strict}function dz(e){let{drag:t,layout:n}=AR();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function fz(e,t){if(typeof Proxy>`u`)return cz;let n=new Map,r=(n,r)=>cz(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,cz(a,void 0,e,t)),n.get(a))})}var pz=(e,t)=>t.isSVG??JR(e)?new LI(t):new MI(t,{allowProjection:e!==P.Fragment}),mz=class extends EI{constructor(e){super(e),e.animationState||=BI(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();lI(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},hz=0,gz={animation:{Feature:mz},exit:{Feature:class extends EI{constructor(){super(...arguments),this.id=hz++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=_P(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function _z(e){return{point:{x:e.pageX,y:e.pageY}}}var vz=e=>t=>OF(t)&&e(t,_z(t));function yz(e,t,n,r){return jL(e,t,vz(n),r)}var bz=({current:e})=>e?e.ownerDocument.defaultView:null,xz=(e,t)=>Math.abs(e-t);function Sz(e,t){let n=xz(e.x,t.x),r=xz(e.y,t.y);return Math.sqrt(n**2+r**2)}var Cz=new Set([`auto`,`scroll`]),wz=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Tz(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Dz(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Sz(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:SA.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Tz(t,this.transformPagePoint),this.hasPendingMove=!0,Bj.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Dz(e.type===`pointercancel`?this.lastMoveEventInfo:Tz(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!OF(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=Tz(_z(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=yA;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Dz(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=Jk(yz(this.contextWindow,`pointermove`,this.handlePointerMove,d),yz(this.contextWindow,`pointerup`,this.handlePointerUp,d),yz(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Cz.has(e.overflowX)||Cz.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),Bj.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Vj(this.updatePoint)}};function Tz(e,t){return t?{point:t(e.point)}:e}function Ez(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Dz({point:e},t){return{point:e,delta:Ez(e,kz(t)),offset:Ez(e,Oz(t)),velocity:Az(t,.1)}}function Oz(e){return e[0]}function kz(e){return e[e.length-1]}function Az(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=kz(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Zk(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Zk(t)*2&&(r=e[1]);let a=Qk(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function jz(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?yj(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?yj(n,e,r.max):Math.min(e,n)),e}function Mz(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Nz(e,{top:t,left:n,bottom:r,right:i}){return{x:Mz(e.x,n,i),y:Mz(e.y,t,r)}}function Pz(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Fz(e,t){return{x:Pz(e.x,t.x),y:Pz(e.y,t.y)}}function Iz(e,t){let n=.5,r=XI(e),i=XI(t);return i>r?n=Yk(t.min,t.max-r,e.min):r>i&&(n=Yk(e.min,e.max-i,t.min)),Vk(0,1,n)}function Lz(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Rz=.35;function zz(e=Rz){return e===!1?e=0:e===!0&&(e=Rz),{x:Bz(e,`left`,`right`),y:Bz(e,`top`,`bottom`)}}function Bz(e,t,n){return{min:Vz(e,t),max:Vz(e,n)}}function Vz(e,t){return typeof e==`number`?e:e[t]||0}var Hz=new WeakMap,Uz=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=sI(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=CF(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),vL(e=>{let t=this.getAxisMotionValue(e).get()||0;if(GA.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=XI(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&Bj.update(()=>i(e,t),!1,!0),EP(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=qz(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&Bj.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new wz(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:bz(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&Bj.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Kz(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=jz(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&iz(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?Nz(n.layoutBox,e):!1,this.elastic=zz(t),r!==this.constraints&&!iz(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&vL(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Lz(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!iz(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=yF(n,r.root,this.visualElement.getTransformPagePoint()),a=Fz(r.layout.layoutBox,i);if(t){let e=t(eF(a));this.hasMutatedConstraints=!!e,e&&(a=$P(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=vL(o=>{if(!Kz(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return EP(this.visualElement,e),n.start(dP(e,n,0,t,this.visualElement,!1))}stopAnimation(){vL(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();vL(e=>{if(!Kz(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-yj(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!iz(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};vL(e=>{let t=this.getAxisMotionValue(e).get();i[e]=Iz({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),vL(t=>{let n=this.getAxisMotionValue(t);if(!Kz(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(yj(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Hz.set(this.visualElement,this);let e=this.visualElement.current,t=yz(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&MF(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();iz(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Gz(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Bj.read(r);let o=jL(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(vL(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Rz,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Wz(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Gz(e,t,n){let r=$F(e,Wz(n)),i=$F(t,Wz(n));return()=>{r(),i()}}function Kz(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function qz(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Jz=class extends EI{constructor(e){super(e),this.removeGroupControls=qk,this.removeListeners=qk,this.controls=new Uz(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||qk}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},Yz=e=>(t,n)=>{e&&Bj.update(()=>e(t,n),!1,!0)},Xz=class extends EI{constructor(){super(...arguments),this.removePointerDownListener=qk}onPointerDown(e){this.session=new wz(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:bz(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Yz(e),onStart:Yz(t),onMove:Yz(n),onEnd:(e,t)=>{delete this.session,r&&Bj.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=yz(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Zz=!1,Qz=class extends P.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Zz&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),RL.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Zz=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Bj.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),bF.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Zz=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function $z(e){let[t,n]=TR(),r=(0,P.useContext)(Pk);return(0,F.jsx)(Qz,{...e,layoutGroup:r,switchLayoutGroup:(0,P.useContext)(rz),isPresent:t,safeToRemove:n})}var eB={pan:{Feature:Xz},drag:{Feature:Jz,ProjectionNode:CR,MeasureLayout:$z}};function tB(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&Bj.postRender(()=>i(t,_z(t)))}var one=class extends EI{mount(){let{current:e}=this.node;e&&(this.unmount=EF(e,(e,t)=>(tB(this.node,t,`Start`),e=>tB(this.node,e,`End`))))}unmount(){}},sne=class extends EI{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=Jk(jL(this.node.current,`focus`,()=>this.onFocus()),jL(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function nB(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&Bj.postRender(()=>i(t,_z(t)))}var cne=class extends EI{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=zF(e,(e,t)=>(nB(this.node,t,`Start`),(e,{success:t})=>nB(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},rB=new WeakMap,iB=new WeakMap,lne=e=>{let t=rB.get(e.target);t&&t(e)},une=e=>{e.forEach(lne)};function dne({root:e,...t}){let n=e||document;iB.has(n)||iB.set(n,{});let r=iB.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(une,{root:e,...t})),r[i]}function fne(e,t,n){let r=dne(t);return rB.set(e,n),r.observe(e),()=>{rB.delete(e),r.unobserve(e)}}var pne={some:0,all:1},mne=class extends EI{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:pne[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=fne(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(hne(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function hne({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var gne={inView:{Feature:mne},tap:{Feature:cne},focus:{Feature:sne},hover:{Feature:one}},_ne={layout:{ProjectionNode:CR,MeasureLayout:$z}},aB=fz({...gz,...gne,...eB,..._ne},pz);function oB(e){let t=Fk(()=>tP(e)),{isStatic:n}=(0,P.useContext)(wR);if(n){let[,n]=(0,P.useState)(e);(0,P.useEffect)(()=>t.on(`change`,n),[])}return t}function sB(e,t){let n=oB(t()),r=()=>n.set(t());return r(),Ik(()=>{let t=()=>Bj.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return r(),()=>{n.forEach(e=>e()),Vj(r)}}),n}function vne(e){$N.current=[],e();let t=sB($N.current,e);return $N.current=void 0,t}function cB(e,t,n,r){if(typeof e==`function`)return vne(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return yne(e,t,n,r);let i=typeof t==`function`?t:nI(t,n,r),a=Array.isArray(e)?lB(e,i):lB([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;if(o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1){let e=r?.ease;a.accelerate={...o,times:[0,...t,1],keyframes:[n[0],...n,n[n.length-1]],isTransformed:!0,...e?{ease:Array.isArray(e)?[e[0],...e]:e}:{}}}return a}function lB(e,t){let n=Fk(()=>[]);return sB(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function yne(e,t,n,r){let i=Fk(()=>Object.keys(n)),a=Fk(()=>({}));for(let o of i)a[o]=cB(e,t,n[o],r);return a}var bne=class{constructor(){this.componentControls=new Set}subscribe(e){return this.componentControls.add(e),()=>this.componentControls.delete(e)}start(e,t){this.componentControls.forEach(n=>{n.start(e.nativeEvent||e,t)})}cancel(){this.componentControls.forEach(e=>{e.cancel()})}stop(){this.componentControls.forEach(e=>{e.stop()})}},xne=()=>new bne;function Sne(){return Fk(xne)}var uB=(0,P.createContext)(null);function Cne(e,t,n,r,i,a=`ltr`){let o=e.findIndex(e=>e.value===t);if(o===-1)return e;if(i===`xy`){let{layout:t}=e[o],r={x:yj(t.x.min,t.x.max,.5)+n.x,y:yj(t.y.min,t.y.max,.5)+n.y},i=wne(e),s=i.find(t=>t.items.includes(e[o])),c=i.reduce((e,t)=>dB(r.y,t)<dB(r.y,e)?t:e);if(c!==s)return Tne(e,o,r.x,c,a);let l=fB(r,t),u=-1,d=l;return e.forEach((e,t)=>{if(t===o)return;let n=fB(r,e.layout);n<d&&(u=t,d=n)}),u===-1?e:Bk(e,o,o+Math.sign(u-o))}if(!r[i])return e;let s=r[i]>0?1:-1,c=e[o+s];if(!c)return e;let l=e[o].layout[i],u=c.layout[i],d=yj(u.min,u.max,.5);return s===1&&l.max+n[i]>d||s===-1&&l.min+n[i]<d?Bk(e,o,o+s):e}function wne(e){let t=[];return e.forEach(e=>{let{min:n,max:r}=e.layout.y,i=t[t.length-1];!i||n>=i.max||r<=i.min?t.push({items:[e],min:n,max:r}):(i.items.push(e),i.min=Math.min(i.min,n),i.max=Math.max(i.max,r))}),t}function dB(e,t){return e<t.min?t.min-e:e>t.max?e-t.max:0}function Tne(e,t,n,r,i){let a=e.filter((e,n)=>n!==t),o=r.items.find(e=>{let t=yj(e.layout.x.min,e.layout.x.max,.5);return i===`ltr`?n<t:n>t}),s=o?a.indexOf(o):a.indexOf(r.items[r.items.length-1])+1,c=[...a];return c.splice(s,0,e[t]),c.every((t,n)=>t===e[n])?e:c}function fB(e,t){let n=Math.max(t.x.min-e.x,0,e.x-t.x.max),r=Math.max(t.y.min-e.y,0,e.y-t.y.max);return n*n+r*r}var pB=(e,t)=>e.max<=t.min||t.max<=e.min;function Ene(e){let t=!1,n=!1;for(let r=0;r<e.length;r++)for(let i=r+1;i<e.length;i++)if(t||=pB(e[r].x,e[i].x),n||=pB(e[r].y,e[i].y),t&&n)return`xy`;return t?`x`:`y`}function Dne({children:e,as:t=`ul`,axis:n,onReorder:r,values:i,onPointerDownCapture:a,onClickCapture:o,...s},c){let l=Fk(()=>aB[t]),u=(0,P.useRef)(new Map),[d,f]=(0,P.useState)(`y`),p=(0,P.useRef)(!1),m=(0,P.useRef)(!1),h=(0,P.useRef)(null),g=n||d,_=new Set(i);u.current.forEach((e,t)=>{_.has(t)||u.current.delete(t)});let v={axis:g,groupRef:h,hasReordered:m,registerItem:(e,t)=>{if(u.current.set(e,t),!n){let e=Ene(i.flatMap(e=>{let t=u.current.get(e);return t?[t]:[]}));e!==d&&f(e)}},updateOrder:(e,t,n)=>{if(p.current)return;let a=i.flatMap(e=>{let t=u.current.get(e);return t?[{value:e,layout:t}]:[]}),o=h.current?.ownerDocument.defaultView?.getComputedStyle(h.current).direction===`rtl`?`rtl`:`ltr`,s=Cne(a,e,t,n,g,o);if(a!==s){p.current=!0,m.current=!0;let e=[...i],t=a.map(({value:e})=>i.indexOf(e));s.forEach(({value:n},r)=>{e[t[r]]=n}),r(e)}}};(0,P.useEffect)(()=>{p.current=!1},[i]);let y=e=>{h.current=e,typeof c==`function`?c(e):c&&(c.current=e)},b={overflowAnchor:`none`,...s.style};return(0,F.jsx)(l,{...s,style:b,ref:y,onPointerDownCapture:e=>{m.current=!1,a?.(e)},onClickCapture:e=>{m.current&&e.detail&&(m.current=!1,e.stopPropagation(),e.preventDefault()),o?.(e)},ignoreStrict:!0,children:(0,F.jsx)(uB.Provider,{value:v,children:e})})}var One=(0,P.forwardRef)(Dne),mB=50,kne=25,Ane=new Set([`auto`,`scroll`]),hB=new WeakMap,gB=new WeakMap,_B=null;function jne(){if(_B){let e=vB(_B,`y`);e&&(gB.delete(e),hB.delete(e));let t=vB(_B,`x`);t&&t!==e&&(gB.delete(t),hB.delete(t)),_B=null}}function Mne(e,t){let n=getComputedStyle(e),r=t===`x`?n.overflowX:n.overflowY,i=e===document.body||e===document.documentElement;return Ane.has(r)||i}function vB(e,t){let n=e?.parentElement;for(;n;){if(Mne(n,t))return n;n=n.parentElement}return null}function Nne(e,t,n){let r=t.getBoundingClientRect(),i=n===`x`?Math.max(0,r.left):Math.max(0,r.top),a=n===`x`?Math.min(window.innerWidth,r.right):Math.min(window.innerHeight,r.bottom),o=e-i,s=a-e;if(o<mB){let e=1-o/mB;return{amount:-25*e*e,edge:`start`}}if(s<mB){let e=1-s/mB;return{amount:kne*e*e,edge:`end`}}return{amount:0,edge:null}}function Pne(e,t,n,r){if(!e)return;_B=e;let i=vB(e,n);if(!i)return;let{amount:a,edge:o}=Nne(t-(n===`x`?window.scrollX:window.scrollY),i,n);if(o===null){gB.delete(i),hB.delete(i);return}let s=gB.get(i),c=i===document.body||i===document.documentElement;if(s!==o){if(!(o===`start`&&r<0||o===`end`&&r>0))return;gB.set(i,o);let e=n===`x`?i.scrollWidth-(c?window.innerWidth:i.clientWidth):i.scrollHeight-(c?window.innerHeight:i.clientHeight);hB.set(i,e)}if(a>0){let e=hB.get(i);if((n===`x`?c?window.scrollX:i.scrollLeft:c?window.scrollY:i.scrollTop)>=e)return}n===`x`?c?window.scrollBy({left:a}):i.scrollLeft+=a:c?window.scrollBy({top:a}):i.scrollTop+=a}function yB(e,t=0){return wP(e)?e:oB(t)}function Fne({children:e,style:t={},value:n,as:r=`li`,onDrag:i,onDragEnd:a,layout:o=!0,...s},c){let l=Fk(()=>aB[r]),u=(0,P.useContext)(uB),d={x:yB(t.x),y:yB(t.y)},f=cB([d.x,d.y],([e,t])=>e||t?1:`unset`),{axis:p,registerItem:m,updateOrder:h,groupRef:g,hasReordered:_}=u;return(0,F.jsx)(l,{drag:p===`xy`||p,...s,dragSnapToOrigin:!0,style:{...t,x:d.x,y:d.y,zIndex:f},layout:o,onDrag:(e,t)=>{let{velocity:r,point:a}=t,o={x:d.x.get(),y:d.y.get()};h(n,o,r);let s=p===`xy`?Math.abs(r.x)>Math.abs(r.y)?`x`:`y`:p;Pne(g.current,a[s],s,r[s]),i&&i(e,t)},onDragEnd:(e,t)=>{_.current=!1,jne(),a&&a(e,t)},onLayoutMeasure:e=>{m(n,e)},ref:c,ignoreStrict:!0,children:e})}var Ine=(0,P.forwardRef)(Fne);function bB({onAdd:e,ariaLabel:t}){let{compact:n}=mD();return(0,F.jsx)(Jw,{size:`xs`,width:n?`7em`:`9em`,variant:`outline`,opacity:n?.55:1,_hover:{opacity:1},_focusWithin:{opacity:1},children:(0,F.jsxs)(Xw,{"aria-label":t,value:``,onChange:t=>{let n=t.target.value;n!==``&&e(n),t.target.value=``},children:[(0,F.jsx)(`option`,{value:``,disabled:!0,children:`+ Add step`}),Ak.map(e=>(0,F.jsx)(`option`,{value:e.stepType,children:e.label},e.stepType))]})})}var xB=`application/x-opencraw-pill`;function SB({name:e,draggable:t=!0}){let n=t?t=>{t.dataTransfer.setData(xB,e),t.dataTransfer.setData(`text/plain`,e),t.dataTransfer.effectAllowed=`copy`}:void 0;return(0,F.jsx)(V,{as:`span`,display:`inline-block`,px:2,py:`1px`,borderRadius:`full`,fontSize:`xs`,fontWeight:`medium`,color:`white`,bg:jD(e),draggable:t,cursor:t?`grab`:void 0,onDragStart:n,children:e})}var Lne=/^\{\{env\.[A-Za-z_]\w*\}\}$/;function Rne({parts:e}){let{text:t}=mD();return(0,F.jsx)(W,{gap:1,wrap:`wrap`,fontSize:t,children:e.map((e,t)=>{let n=`${t}:${e.kind}:${e.text}`;return e.kind===`pill`?(0,F.jsx)(SB,{name:e.text},n):e.kind===`code`&&Lne.test(e.text)?(0,F.jsx)(zne,{placeholder:e.text},n):e.kind===`code`?(0,F.jsx)(V,{as:`code`,fontFamily:`mono`,fontSize:`xs`,bg:`bg.muted`,px:1,borderRadius:`sm`,children:e.text},n):(0,F.jsx)(V,{color:`fg.muted`,children:e.text},n)})})}function zne({placeholder:e}){let t=e.slice(6,-2);return(0,F.jsx)(V,{as:`span`,display:`inline-block`,px:2,py:`1px`,borderRadius:`full`,fontSize:`xs`,fontFamily:`mono`,fontWeight:`medium`,color:`red.fg`,bg:`red.subtle`,borderWidth:`1px`,borderColor:`red.muted`,title:`Never the real value — set the ${t} environment variable before running this recipe.`,children:e})}function Bne({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function CB(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var wB=[],TB=0,{link:EB,unlink:Vne,propagate:Hne,checkDirty:DB,shallowPropagate:OB}=Bne({update(e){return e._update()},notify(e){wB[AB++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,PB(e))}}),kB=0,AB=0,jB,MB=0;function NB(e){try{++MB,e()}finally{--MB||FB()}}function PB(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Vne(n,e)}function FB(){if(!(MB>0)){for(;kB<AB;){let e=wB[kB];wB[kB++]=void 0,e.notify()}kB=0,AB=0}}function IB(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return jB!==void 0&&EB(i,jB,TB),i._snapshot},subscribe(e){let t=CB(e),n={current:!1},r=Une(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=jB,o=t?.compare??Object.is;if(n)jB=i,++TB,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{jB=a,n&&(i.flags&=-5),PB(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&DB(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&OB(e)}}else e&32&&(i.flags=e&-33);return jB!==void 0&&EB(i,jB,TB),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Hne(e),OB(e),FB())}},i}function Une(e){let t=()=>{let t=jB;jB=n,++TB,n.depsTail=void 0,n.flags=6;try{return e()}finally{jB=t,n.flags&=-5,PB(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&DB(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,PB(this)}};return t(),n}var LB=class{constructor(e,t){this.atom=IB(e),this.get=this.get.bind(this),this.setState=this.setState.bind(this),this.subscribe=this.subscribe.bind(this),t&&(this.actions=t(this))}setState(e){this.atom.set(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(CB(e))}},Wne=class{constructor(e){this.atom=IB(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(CB(e))}};function RB(e,t){return typeof e==`function`?new Wne(e):t?new LB(e,t):new LB(e)}var Gne=class{constructor(e,t){this.fn=e,this.options=t,this.lastExecutionTime=0,this.isPending=!1,this.maybeExecute=(...e)=>{let t=Date.now()-this.lastExecutionTime;if(this.options.leading&&t>=this.options.wait)this.execute(...e);else if(this.lastArgs=e,!this.timeoutId&&this.options.trailing){let e=this.options.wait-t;this.isPending=!0,this.timeoutId=setTimeout(()=>{this.lastArgs!==void 0&&this.execute(...this.lastArgs)},e)}},this.execute=(...e)=>{this.fn(...e),this.options.onExecute?.(e,this),this.lastExecutionTime=Date.now(),this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.flush=()=>{this.isPending&&this.lastArgs&&this.execute(...this.lastArgs)},this.cancel=()=>{this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.clearTimeout=()=>{this.timeoutId&&=(clearTimeout(this.timeoutId),void 0)},this.options.leading===void 0&&this.options.trailing===void 0&&(this.options.leading=!0,this.options.trailing=!0)}};function Kne(e,t){return new Gne(e,t).maybeExecute}var qne=class{#e=!0;#t;#n;#r;#i;#a;#o;#s;#c=0;#l=5;#u=!1;#d=!1;#f=null;#p=()=>{this.debugLog(`Connected to event bus`),this.#a=!0,this.#u=!1,this.debugLog(`Emitting queued events`,this.#i),this.#i.forEach(e=>this.emitEventToBus(e)),this.#i=[],this.stopConnectLoop(),this.#n().removeEventListener(`tanstack-connect-success`,this.#p)};#m=()=>{if(this.#c<this.#l){this.#c++,this.dispatchCustomEvent(`tanstack-connect`,{});return}this.#n().removeEventListener(`tanstack-connect`,this.#m),this.#d=!0,this.debugLog(`Max retries reached, giving up on connection`),this.stopConnectLoop()};#h=()=>{this.#u||(this.#u=!0,this.#n().addEventListener(`tanstack-connect-success`,this.#p),this.#m())};constructor({pluginId:e,debug:t=!1,enabled:n=!0,reconnectEveryMs:r=300}){this.#t=e,this.#e=n,this.#n=this.getGlobalTarget,this.#r=t,this.debugLog(` Initializing event subscription for plugin`,this.#t),this.#i=[],this.#a=!1,this.#d=!1,this.#o=null,this.#s=r}startConnectLoop(){this.#o!==null||this.#a||(this.debugLog(`Starting connect loop (every ${this.#s}ms)`),this.#o=setInterval(this.#m,this.#s))}stopConnectLoop(){this.#u=!1,this.#o!==null&&(clearInterval(this.#o),this.#o=null,this.#i=[],this.debugLog(`Stopped connect loop`))}debugLog(...e){this.#r&&console.log(`🌴 [tanstack-devtools:${this.#t}-plugin]`,...e)}getGlobalTarget(){if(typeof globalThis<`u`&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog(`Using global event target`),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<`u`&&window.addEventListener!==void 0)return this.debugLog(`Using window as event target`),window;let e=typeof EventTarget<`u`?new EventTarget:void 0;return e===void 0||e.addEventListener===void 0?(this.debugLog(`No event mechanism available, running in non-web environment`),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog(`Using new EventTarget as fallback`),e)}getPluginId(){return this.#t}dispatchCustomEventShim(e,t){try{let n=new Event(e,{detail:t});this.#n().dispatchEvent(n)}catch{this.debugLog(`Failed to dispatch shim event`)}}dispatchCustomEvent(e,t){try{this.#n().dispatchEvent(new CustomEvent(e,{detail:t}))}catch{this.dispatchCustomEventShim(e,t)}}emitEventToBus(e){this.debugLog(`Emitting event to client bus`,e),this.dispatchCustomEvent(`tanstack-dispatch-event`,e)}createEventPayload(e,t){return{type:`${this.#t}:${e}`,payload:t,pluginId:this.#t}}emit(e,t){if(!this.#e){this.debugLog(`Event bus client is disabled, not emitting event`,e,t);return}if(this.#f&&(this.debugLog(`Emitting event to internal event target`,e,t),this.#f.dispatchEvent(new CustomEvent(`${this.#t}:${e}`,{detail:this.createEventPayload(e,t)}))),this.#d){this.debugLog(`Previously failed to connect, not emitting to bus`);return}if(!this.#a){this.debugLog(`Bus not available, will be pushed as soon as connected`),this.#i.push(this.createEventPayload(e,t)),typeof CustomEvent<`u`&&!this.#u&&(this.#h(),this.startConnectLoop());return}return this.emitEventToBus(this.createEventPayload(e,t))}on(e,t,n){let r=n?.withEventTarget??!1,i=`${this.#t}:${e}`;if(r&&(this.#f||=new EventTarget,this.#f.addEventListener(i,e=>{t(e.detail)})),!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`,i),()=>{};let a=e=>{this.debugLog(`Received event from bus`,e.detail),t(e.detail)};return this.#n().addEventListener(i,a),this.debugLog(`Registered event to bus`,i),()=>{r&&this.#f?.removeEventListener(i,a),this.#n().removeEventListener(i,a)}}onAll(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}onAllPluginEvents(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;this.#t&&n.pluginId!==this.#t||e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}},zB=new class extends qne{constructor(){super({pluginId:`form-devtools`,reconnectEveryMs:1e3})}};function BB(e,t){return typeof e==`function`?e(t):e}function VB(e,t){return qB(t).reduce((e,t)=>{if(e===null)return null;if(e!==void 0)return e[t]},e)}function HB(e,t,n){let r=qB(t);function i(e){if(!r.length)return BB(n,e);let t=r.shift();if(typeof t==`string`||typeof t==`number`&&!Array.isArray(e))return typeof e==`object`?(e===null&&(e={}),{...e,[t]:i(e[t])}):{[t]:i()};if(Array.isArray(e)&&typeof t==`number`){let n=e.slice(0,t);return[...n.length?n:Array(t),i(e[t]),...e.slice(t+1)]}return[...Array(t),i()]}return i(e)}function Jne(e,t){let n=qB(t);function r(e){if(!e)return;if(n.length===1){let t=n[0];if(Array.isArray(e)&&typeof t==`number`)return e.filter((e,n)=>n!==t);let{[t]:r,...i}=e;return i}let t=n.shift();if((typeof t==`string`||typeof t==`number`&&!Array.isArray(e))&&typeof e==`object`)return{...e,[t]:r(e[t])};if(typeof t==`number`&&Array.isArray(e)){if(t>=e.length)return e;let n=e.slice(0,t);return[...n.length?n:Array(t),r(e[t]),...e.slice(t+1)]}throw Error(`It seems we have created an infinite loop in deleteBy. `)}return r(e)}var UB=46,WB=91,GB=93,KB=48,Yne=57;function qB(e){if(Array.isArray(e))return[...e];if(typeof e!=`string`)throw Error(`Path must be a string.`);let t=e.length,n=[],r=+(t>0&&e.charCodeAt(0)===WB),i=!0,a=-1;for(let o=r;o<=t;o++){let s=o<t?e.charCodeAt(o):-1;if(o===t||s===UB||s===WB||s===GB){let t=o-r;if(t>0){let a=i&&(t===1||e.charCodeAt(r)!==KB),s=e.slice(r,o);if(a){let e=parseInt(s,10);t<=15||String(e)===s?n.push(e):n.push(s)}else n.push(s)}else a!==GB&&(a!==-1||s!==GB)&&(a!==s||s!==UB&&s!==WB)&&n.push(``);r=o+1,i=!0}else(s<KB||s>Yne)&&(i=!1);a=s}return n.length||n.push(``),n}function Xne(e){return!(Array.isArray(e)&&e.length===0)}function JB(e,t){return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!1},runValidation:e=>e.validators.filter(Boolean).map(e=>({cause:e.cause,validate:e.fn}))})}function YB(e,t){let{asyncDebounceMs:n}=t,{onBlurAsyncDebounceMs:r,onChangeAsyncDebounceMs:i,onDynamicAsyncDebounceMs:a}=t.validators||{},o=n??0;return t.validationLogic({form:t.form,group:t.group,validators:t.validators,event:{type:e,fieldName:t.fieldName,async:!0},runValidation:t=>t.validators.filter(Boolean).map(t=>{let n=t?.cause||e,s=o;switch(n){case`change`:s=i??o;break;case`blur`:s=r??o;break;case`dynamic`:s=a??o;break;case`submit`:s=0}return e===`submit`&&(s=0),{cause:n,validate:t.fn,debounceMs:s}})})}var XB=e=>!!e&&typeof e==`object`&&`fields`in e;function ZB(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length||n.length===0&&!Array.isArray(e)&&!Array.isArray(t)&&(Object.getPrototypeOf(e)!==Object.prototype||Object.getPrototypeOf(t)!==Object.prototype))return!1;for(let i of n)if(!r.includes(i)||!ZB(e[i],t[i]))return!1;return!0}var QB=({newFormValidatorError:e,isPreviousErrorFromFormValidator:t,previousErrorValue:n})=>e?{newErrorValue:e,newSource:`form`}:t?{newErrorValue:void 0,newSource:void 0}:n?{newErrorValue:n,newSource:`field`}:{newErrorValue:void 0,newSource:void 0},$B=({formLevelError:e,fieldLevelError:t})=>t?{newErrorValue:t,newSource:`field`}:e?{newErrorValue:e,newSource:`form`}:{newErrorValue:void 0,newSource:void 0};function eV(e,t){return e==null?t:{...e,...t}}for(var tV=256,nV=[],rV;tV--;)nV[tV]=(tV+256).toString(16).substring(1);function iV(){let e=0,t,n=``;if(!rV||tV+16>256){for(rV=Array(256),e=256;e--;)rV[e]=256*Math.random()|0;e=0,tV=0}for(;e<16;e++)t=rV[tV+e],n+=e===6?nV[t&15|64]:e===8?nV[t&63|128]:nV[t],e&1&&e>1&&e<11&&(n+=`-`);return tV++,n}var Zne=Kne(e=>zB.emit(`form-state`,{id:e.formId,state:e.store.state}),{wait:300});function aV(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++)t[n]=aV(e[n]);return t}if(e instanceof Map){let t=new Map;return e.forEach((e,n)=>{t.set(n,aV(e))}),t}if(e instanceof Set){let t=new Set;return e.forEach(e=>{t.add(aV(e))}),t}let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=aV(e[n]));return t}function oV(e,t){return t===e||t.startsWith(`${e}.`)||t.startsWith(`${e}[`)}var sV=e=>{if(!e.validators)return e.runValidation({validators:[],form:e.form});let t=e.event.async,n=t?void 0:{fn:e.validators.onMount,cause:`mount`},r={fn:t?e.validators.onChangeAsync:e.validators.onChange,cause:`change`},i={fn:t?e.validators.onBlurAsync:e.validators.onBlur,cause:`blur`},a={fn:t?e.validators.onSubmitAsync:e.validators.onSubmit,cause:`submit`},o=t?void 0:{fn:()=>void 0,cause:`server`};switch(e.event.type){case`mount`:return e.runValidation({validators:[n],form:e.form});case`submit`:return e.runValidation({validators:[r,i,a,o],form:e.form});case`server`:return e.runValidation({validators:[],form:e.form});case`blur`:return e.runValidation({validators:[i,o],form:e.form});case`change`:return e.runValidation({validators:[r,o],form:e.form});default:throw Error(`Unknown validation event type: ${e.event.type}`)}};function cV(e,t){let n=new Map;for(let r of e){let e=r.path??[],i=t,a=``;for(let t=0;t<e.length;t++){let n=e[t];if(n===void 0)continue;let r=typeof n==`object`?n.key:n,o=Number(r);a+=Array.isArray(i)&&!Number.isNaN(o)?`[${o}]`:(t>0?`.`:``)+String(r),i=typeof i==`object`&&i?i[r]:void 0}n.set(a,(n.get(a)??[]).concat(r))}return Object.fromEntries(n)}var lV=(e,t)=>{let n=cV(e,t);return{form:n,fields:n}},uV={validate({value:e,validationSource:t},n){let r=n[`~standard`].validate(e);if(r instanceof Promise)throw Error(`async function passed to sync validator`);if(r.issues)return t===`field`?r.issues:lV(r.issues,e)},async validateAsync({value:e,validationSource:t},n){let r=await n[`~standard`].validate(e);if(r.issues)return t===`field`?r.issues:lV(r.issues,e)}},dV=e=>!!e&&`~standard`in e,fV={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{},_arrayVersion:0,_pendingValidationsCount:0};function pV(e){function t(t){let n=e.getFieldMeta(t)??fV;e.setFieldMeta(t,{...n,_arrayVersion:(n._arrayVersion||0)+1})}function n(n,r,i){t(n);let a=s(n,r,`move`,i),c=Math.min(r,i),u=Math.max(r,i);for(let e=c;e<=u;e++)a.push(o(n,e));let d=Object.keys(e.fieldInfo).reduce((t,i)=>(i.startsWith(o(n,r))&&t.set(i,e.getFieldMeta(i)),t),new Map);l(a,r<i?`up`:`down`),Object.keys(e.fieldInfo).filter(e=>e.startsWith(o(n,i))).forEach(t=>{let a=t.replace(o(n,i),o(n,r)),s=d.get(a);s&&e.setFieldMeta(t,s)})}function r(e,n){t(e),l(s(e,n,`remove`),`up`)}function i(n,r,i){t(n),s(n,r,`swap`,i).forEach(t=>{if(!t.toString().startsWith(o(n,r)))return;let a=t.toString().replace(o(n,r),o(n,i)),[s,c]=[e.getFieldMeta(t),e.getFieldMeta(a)];s&&e.setFieldMeta(a,s),c&&e.setFieldMeta(t,c)})}function a(n,r){t(n);let i=s(n,r,`insert`);l(i,`down`),i.forEach(t=>{t.toString().startsWith(o(n,r))&&e.setFieldMeta(t,u())})}function o(e,t){return`${e}[${t}]`}function s(t,n,r,i){let a=[o(t,n)];switch(r){case`swap`:a.push(o(t,i));break;case`move`:{let[e,r]=[Math.min(n,i),Math.max(n,i)];for(let n=e;n<=r;n++)a.push(o(t,n));break}default:{let r=e.getFieldValue(t),i=Array.isArray(r)?r.length:0;for(let e=n+1;e<i;e++)a.push(o(t,e));break}}return Object.keys(e.fieldInfo).filter(e=>a.some(t=>e.startsWith(t)))}function c(e,t){return e.replace(/\[(\d+)\]/,(e,n)=>{let r=parseInt(n,10);return`[${t===`up`?r+1:Math.max(0,r-1)}]`})}function l(t,n){(n===`up`?t:[...t].reverse()).forEach(t=>{let r=c(t.toString(),n),i=e.getFieldMeta(r);i?e.setFieldMeta(t,i):e.setFieldMeta(t,u())})}let u=()=>fV;return{bumpArrayVersion:t,handleArrayMove:n,handleArrayRemove:r,handleArraySwap:i,handleArrayInsert:a}}function mV(e){return{values:e.values??{},errorMap:e.errorMap??{},fieldMetaBase:e.fieldMetaBase??{},formGroupStateBase:e.formGroupStateBase??{},isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}}}var hV=class{constructor(e){this.options={},this.fieldInfo={},this.formGroupApis=new Set,this.mount=()=>{let e=this.store.subscribe(()=>{Zne(this)}),t=zB.on(`request-form-state`,e=>{e.payload.id===this._formId&&zB.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}),n=zB.on(`request-form-reset`,e=>{e.payload.id===this._formId&&this.reset()}),r=zB.on(`request-form-force-submit`,e=>{e.payload.id===this._formId&&(this._devtoolsSubmissionOverride=!0,this.handleSubmit(),this._devtoolsSubmissionOverride=!1)}),i=()=>{r(),n(),t(),e.unsubscribe(),zB.emit(`form-unmounted`,{id:this._formId})};this.options.listeners?.onMount?.({formApi:this});let{onMount:a}=this.options.validators||{};return zB.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options}),a&&this.validateSync(`mount`),i},this.update=e=>{if(!e)return;let t=this.options;this.options=e;let n=e.defaultValues&&!ZB(e.defaultValues,t.defaultValues)&&!this.state.isTouched,r=!ZB(e.defaultState,t.defaultState)&&!this.state.isTouched;if(n||r){if(NB(()=>{this.baseStore.setState(()=>mV(Object.assign({},this.state,r?e.defaultState:{},n?{values:e.defaultValues}:{})))}),n){let e=pV(this);for(let t of Object.keys(this.fieldInfo))Array.isArray(this.getFieldValue(t))&&e.bumpArrayVersion(t)}zB.emit(`form-api`,{id:this._formId,state:this.store.state,options:this.options})}},this.reset=(e,t)=>{let{fieldMeta:n}=this.state,r=this.resetFieldMeta(n);e&&!t?.keepDefaultValues&&(this.options={...this.options,defaultValues:e}),this.baseStore.setState(()=>{let t=e??this.options.defaultValues??this.options.defaultState?.values;return e||Object.values(this.fieldInfo).forEach(e=>{e.instance&&e.instance.options.defaultValue!==void 0&&(t=HB(t,e.instance.name,e.instance.options.defaultValue))}),mV({...this.options.defaultState,values:t,fieldMetaBase:r})})},this.validateAllFields=async e=>{let t=[];return NB(()=>{Object.values(this.fieldInfo).forEach(n=>{if(!n.instance)return;let r=n.instance;t.push(Promise.resolve().then(()=>r.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.instance.store.state.meta.isTouched||n.instance.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null,a=[`${e}[${t}]`];for(let n=t+1;n<=(i??0);n++)a.push(`${e}[${n}]`);let o=Object.keys(this.fieldInfo).filter(e=>a.some(t=>e.startsWith(t))),s=[];return NB(()=>{o.forEach(e=>{s.push(Promise.resolve().then(()=>this.validateField(e,n)))})}),(await Promise.all(s)).flat()},this.validateField=(e,t)=>{let n=this.fieldInfo[e]?.instance;if(!n){let{hasErrored:n}=this.validateSync(t);return n&&!this.options.asyncAlways?this.getFieldMeta(e)?.errors??[]:this.validateAsync(t).then(()=>this.getFieldMeta(e)?.errors??[])}return n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0})),n.validate(t)},this.validateSync=(e,t)=>{let n=JB(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||sV}),r=!1,i={};return NB(()=>{for(let e of n){if(!e.validate)continue;let{formError:n,fieldErrors:a}=gV(this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`},type:`validate`})),o=_V(e.cause),s=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(a||{})]);t?.filterFieldNames&&(s=new Set([...s].filter(t.filterFieldNames)));for(let e of s){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!a?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??fV,r=a?.[e],{newErrorValue:s,newSource:c}=QB({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[o]===`form`,previousErrorValue:t?.[o]});c===`form`&&(i[e]={...i[e],[o]:r}),t?.[o]!==s&&this.setFieldMeta(e,(e=fV)=>({...e,errorMap:{...e.errorMap,[o]:s},errorSourceMap:{...e.errorSourceMap,[o]:c}}))}t?.dontUpdateFormErrorMap||this.state.errorMap?.[o]!==n&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:n}})),(n||a)&&(r=!0)}if(t?.dontUpdateFormErrorMap)return;let a=_V(`submit`);this.state.errorMap?.[a]&&e!==`submit`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[a]:void 0}}));let o=_V(`server`);this.state.errorMap?.[o]&&e!==`server`&&!r&&this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[o]:void 0}}))}),{hasErrored:r,fieldsErrorMap:i}},this.validateAsync=async(e,t)=>{let n=YB(e,{...this.options,form:this,group:t?.group,validationLogic:this.options.validationLogic||sV});this.state.isFormValidating||this.baseStore.setState(e=>({...e,isFormValidating:!0}));let r=[],i;for(let e of n){if(!e.validate)continue;let n=_V(e.cause);this.state.validationMetaMap[n]?.lastAbortController.abort();let a=new AbortController;this.state.validationMetaMap[n]={lastAbortController:a},r.push(new Promise(async n=>{let r;try{r=await new Promise((t,n)=>{setTimeout(async()=>{if(a.signal.aborted)return t(void 0);try{t(await this.runValidator({validate:e.validate,value:{value:this.state.values,formApi:this,validationSource:`form`,signal:a.signal},type:`validateAsync`}))}catch(e){n(e)}},e.debounceMs)})}catch(e){r=e}let{formError:o,fieldErrors:s}=gV(r);s&&(i=i?{...i,...s}:s);let c=_V(e.cause),l=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(i||{})]),u=Array.from(l);t?.filterFieldNames&&(u=u.filter(t.filterFieldNames));for(let e of u){if(this.baseStore.state.fieldMetaBase[e]===void 0&&!i?.[e])continue;let{errorMap:t,errorSourceMap:n}=this.getFieldMeta(e)??fV,r=i?.[e],{newErrorValue:a,newSource:o}=QB({newFormValidatorError:r,isPreviousErrorFromFormValidator:n?.[c]===`form`,previousErrorValue:t?.[c]});t?.[c]!==a&&this.setFieldMeta(e,(e=fV)=>({...e,errorMap:{...e.errorMap,[c]:a},errorSourceMap:{...e.errorSourceMap,[c]:o}}))}t?.dontUpdateFormErrorMap||this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[c]:o}})),n(i?{fieldErrors:i,errorMapKey:c}:void 0)}))}let a=[],o={};if(r.length){a=await Promise.all(r);for(let e of a)if(e?.fieldErrors){let{errorMapKey:t}=e;for(let[n,r]of Object.entries(e.fieldErrors))o[n]={...o[n]||{},[t]:r}}}return this.baseStore.setState(e=>({...e,isFormValidating:!1})),o},this.validate=(e,t)=>{let{hasErrored:n,fieldsErrorMap:r}=this.validateSync(e,t);return n&&!this.options.asyncAlways?r:this.validateAsync(e,t)},this._handleSubmit=async e=>{this.baseStore.setState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),NB(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance&&(e.instance.store.state.meta.isTouched||e.instance.setMeta(e=>({...e,isTouched:!0})))})});let t=e??this.options.onSubmitMeta;if(!this.state.canSubmit&&!this._devtoolsSubmissionOverride&&this.baseStore.state.submissionAttempts<=1){this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t});return}this.baseStore.setState(e=>({...e,isSubmitting:!0}));let n=()=>{this.baseStore.setState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.state.isFieldsValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),zB.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validateAllFields`,errors:Object.values(this.state.fieldMeta).map(e=>e.errors).flat()});return}if(await this.validate(`submit`),!this.state.isValid){n(),this.options.onSubmitInvalid?.({value:this.state.values,formApi:this,meta:t}),zB.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`validate`,errors:this.state.errors});return}NB(()=>{Object.values(this.fieldInfo).forEach(e=>{e.instance?.triggerOnSubmitListener()})}),this.options.listeners?.onSubmit?.({formApi:this,meta:t});try{await this.options.onSubmit?.({value:this.state.values,formApi:this,meta:t}),NB(()=>{this.baseStore.setState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),zB.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!0}),n()})}catch(e){throw this.baseStore.setState(e=>({...e,isSubmitSuccessful:!1})),zB.emit(`form-submission`,{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:`inflight`,onError:e}),n(),e}},this.getFieldValue=e=>VB(this.state.values,e),this.getFieldMeta=e=>this.state.fieldMeta[e],this.getFormGroupMeta=e=>this.formGroupMetaDerived.state[e],this.getFieldInfo=e=>this.fieldInfo[e]||={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.setFieldMeta=(e,t)=>{this.baseStore.setState(n=>({...n,fieldMetaBase:{...n.fieldMetaBase,[e]:BB(t,n.fieldMetaBase[e])}}))},this.resetFieldMeta=e=>Object.keys(e).reduce((e,t)=>{let n=t;return e[n]=fV,e},{}),this.setFieldValue=(e,t,n)=>{let r=n?.dontUpdateMeta??!1,i=n?.dontRunListeners??!1,a=n?.dontValidate??!1;NB(()=>{r||this.setFieldMeta(e,e=>({...e,isTouched:!0,isDirty:!0,errorMap:{...e?.errorMap,onMount:void 0}})),this.baseStore.setState(n=>({...n,values:HB(n.values,e,t)}))}),i||this.getFieldInfo(e).instance?.triggerOnChangeListener(),a||this.validateField(e,`change`)},this.deleteField=e=>{let t=[...Object.keys(this.fieldInfo).filter(t=>{let n=e.toString();return t.startsWith(`${n}.`)||t.startsWith(`${n}[`)}),e];this.baseStore.setState(e=>{let n={...e};return t.forEach(e=>{n.values=Jne(n.values,e),delete this.fieldInfo[e],delete n.fieldMetaBase[e]}),n})},this.pushFieldValue=(e,t,n)=>{this.setFieldValue(e,e=>[...Array.isArray(e)?e:[],t],n),pV(this).bumpArrayVersion(e)},this.insertFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>[...e.slice(0,t),n,...e.slice(t)],eV(r,{dontValidate:!0}));let i=r?.dontValidate??!1;i||await this.validateField(e,`change`),pV(this).handleArrayInsert(e,t),i||await this.validateArrayFieldsStartingFrom(e,t,`change`)},this.replaceFieldValue=async(e,t,n,r)=>{this.setFieldValue(e,e=>e.map((e,r)=>r===t?n:e),eV(r,{dontValidate:!0})),pV(this).bumpArrayVersion(e),(r?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.removeFieldValue=async(e,t,n)=>{let r=this.getFieldValue(e),i=Array.isArray(r)?Math.max(r.length-1,0):null;if(this.setFieldValue(e,e=>e.filter((e,n)=>n!==t),eV(n,{dontValidate:!0})),pV(this).handleArrayRemove(e,t),i!==null){let t=`${e}[${i}]`;this.deleteField(t)}(n?.dontValidate??!1)||(await this.validateField(e,`change`),await this.validateArrayFieldsStartingFrom(e,t,`change`))},this.swapFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=e[t],i=e[n];return HB(HB(e,`${t}`,i),`${n}`,r)},eV(r,{dontValidate:!0})),pV(this).handleArraySwap(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.moveFieldValues=(e,t,n,r)=>{this.setFieldValue(e,e=>{let r=[...e];return r.splice(n,0,r.splice(t,1)[0]),r},eV(r,{dontValidate:!0})),pV(this).handleArrayMove(e,t,n),(r?.dontValidate??!1)||(this.validateField(e,`change`),this.validateField(`${e}[${t}]`,`change`),this.validateField(`${e}[${n}]`,`change`))},this.clearFieldValues=(e,t)=>{let n=this.getFieldValue(e),r=Array.isArray(n)?Math.max(n.length-1,0):null;if(this.setFieldValue(e,[],eV(t,{dontValidate:!0})),pV(this).bumpArrayVersion(e),r!==null)for(let t=0;t<=r;t++){let n=`${e}[${t}]`;this.deleteField(n)}(t?.dontValidate??!1)||this.validateField(e,`change`)},this.resetField=e=>{this.baseStore.setState(t=>{let n=this.getFieldInfo(e).instance?.options.defaultValue,r=VB(this.options.defaultValues,e),i=n??r;return{...t,fieldMetaBase:{...t.fieldMetaBase,[e]:fV},values:i===void 0?t.values:HB(t.values,e,i)}})},this.setErrorMap=e=>{NB(()=>{Object.entries(e).forEach(([e,t])=>{let n=e;if(XB(t)){let{formError:e,fieldErrors:r}=gV(t);for(let e of Object.keys(this.fieldInfo))this.getFieldMeta(e)&&this.setFieldMeta(e,t=>({...t,errorMap:{...t.errorMap,[n]:r?.[e]},errorSourceMap:{...t.errorSourceMap,[n]:`form`}}));this.baseStore.setState(t=>({...t,errorMap:{...t.errorMap,[n]:e}}))}else this.baseStore.setState(e=>({...e,errorMap:{...e.errorMap,[n]:t}}))})})},this.getAllErrors=()=>({form:{errors:this.state.errors,errorMap:this.state.errorMap},fields:Object.entries(this.state.fieldMeta).reduce((e,[t,n])=>(Object.keys(n).length&&n.errors.length&&(e[t]={errors:n.errors,errorMap:n.errorMap}),e),{})}),this.parseValuesWithSchema=e=>uV.validate({value:this.state.values,validationSource:`form`},e),this.parseValuesWithSchemaAsync=e=>uV.validateAsync({value:this.state.values,validationSource:`form`},e),this.timeoutIds={validations:{},listeners:{},formListeners:{}},this._formId=e?.formId??iV(),this._devtoolsSubmissionOverride=!1;let t=mV({...e?.defaultState,values:e?.defaultValues??e?.defaultState?.values});if(e?.transform){t=e.transform({state:t}).state;for(let e of Object.keys(t.errorMap)){let n=t.errorMap[e];if(n!==void 0&&XB(n))for(let r of Object.keys(n.fields)){let i=n.fields[r];if(i===void 0)continue;let a=t.fieldMetaBase[r];t.fieldMetaBase[r]={isTouched:!1,isValidating:!1,isBlurred:!1,isDirty:!1,_arrayVersion:0,_pendingValidationsCount:0,...a??{},errorSourceMap:{...a?.errorSourceMap??{},onChange:`form`},errorMap:{...a?.errorMap??{},[e]:i}}}}}this.baseStore=RB(t);let n;this.fieldMetaDerived=RB(e=>{let t=this.baseStore.get(),r=0,i={};for(let a of Object.keys(t.fieldMetaBase)){let o=t.fieldMetaBase[a],s=n?.fieldMetaBase[a],c=e?.[a],l=VB(t.values,a),u=c?.errors;if(!s||o.errorMap!==s.errorMap){u=Object.values(o.errorMap??{}).filter(e=>e!==void 0);let e=this.getFieldInfo(a)?.instance;(!e||!e.options.disableErrorFlat)&&(u=u.flat(1))}let d=!Xne(u),f=!o.isDirty,p=ZB(l,this.getFieldInfo(a)?.instance?.options.defaultValue??VB(this.options.defaultValues,a));if(c&&c.isPristine===f&&c.isValid===d&&c.isDefaultValue===p&&c.errors===u&&o===s){i[a]=c,r++;continue}i[a]={...o,errors:u??[],isPristine:f,isValid:d,isDefaultValue:p}}return Object.keys(t.fieldMetaBase).length?e&&r===Object.keys(t.fieldMetaBase).length?e:(n=this.baseStore.get(),i):i}),this.formGroupMetaDerived=RB(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),r={};for(let i of this.formGroupApis){let a=i.name,o=t.formGroupStateBase[a]??{isSubmitted:!1,isSubmitting:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1},s=n[a],c=!1,l=!0,u=!1,d=!1,f=!0,p=!1;for(let e in n){if(e===a||!oV(a,e))continue;let t=n[e];t&&(t.isValidating&&(c=!0),t.isValid||(l=!1),t.isTouched&&(u=!0),t.isBlurred&&(d=!0),t.isDefaultValue||(f=!1),t.isDirty&&(p=!0))}let m=!p,h=!!c||o.isValidating,g=s?.errorMap??{},_=s?.errorSourceMap??{},v=!!(g.onMount||Object.entries(n).some(([e,t])=>t&&e!==a&&oV(a,e)&&t.errorMap.onMount)),y=e?.[a],b=y?.errors??[];(!y||y.__srcErrorMap!==g)&&(b=Object.values(g).reduce((e,t)=>{if(t===void 0)return e;if(t&&typeof t==`object`&&`fields`in t){let n=t.group;return n!==void 0&&e.push(n),e}return e.push(t),e},[]));let x=b.length===0,S=l&&x,C=i.options.canSubmitWhenInvalid??!1,w=o.submissionAttempts===0&&!u&&!v||!h&&!o.isSubmitting&&S||C;if(y&&y.errorMap===g&&y.errorSourceMap===_&&y.errors===b&&y.isFieldsValidating===c&&y.isFieldsValid===l&&y.isGroupValid===x&&y.isValid===S&&y.canSubmit===w&&y.isTouched===u&&y.isBlurred===d&&y.isPristine===m&&y.isDefaultValue===f&&y.isDirty===p&&y.isValidating===h&&y.isSubmitting===o.isSubmitting&&y.isSubmitted===o.isSubmitted&&y.submissionAttempts===o.submissionAttempts&&y.isSubmitSuccessful===o.isSubmitSuccessful){r[a]=y;continue}let T={...o,errorMap:g,errorSourceMap:_,_arrayVersion:s?._arrayVersion??0,isTouched:u,isBlurred:d,isDirty:p,isPristine:m,isDefaultValue:f,isValid:S,errors:b,isValidating:h,isFieldsValidating:c,isFieldsValid:l,isGroupValid:x,canSubmit:w};Object.defineProperty(T,"__srcErrorMap",{value:g,enumerable:!1,configurable:!0}),r[a]=T}return r});let r;this.store=RB(e=>{let t=this.baseStore.get(),n=this.fieldMetaDerived.get(),i=Object.values(n).filter(Boolean),a=i.some(e=>e.isValidating),o=i.every(e=>e.isValid),s=i.some(e=>e.isTouched),c=i.some(e=>e.isBlurred),l=i.every(e=>e.isDefaultValue),u=s&&t.errorMap?.onMount,d=i.some(e=>e.isDirty),f=!d,p=!!(t.errorMap?.onMount||i.some(e=>e?.errorMap?.onMount)),m=!!a,h=e?.errors??[];(!r||t.errorMap!==r.errorMap)&&(h=Object.values(t.errorMap).reduce((e,t)=>t===void 0?e:t&&XB(t)?(e.push(t.form),e):(e.push(t),e),[]));let g=h.length===0,_=o&&g,v=this.options.canSubmitWhenInvalid??!1,y=t.submissionAttempts===0&&!s&&!p||!m&&!t.isSubmitting&&_||v,b=t.errorMap;if(u&&(h=h.filter(e=>e!==t.errorMap.onMount),b=Object.assign(b,{onMount:void 0})),e&&r&&e.errorMap===b&&e.fieldMeta===this.fieldMetaDerived.state&&e.errors===h&&e.isFieldsValidating===a&&e.isFieldsValid===o&&e.isFormValid===g&&e.isValid===_&&e.canSubmit===y&&e.isTouched===s&&e.isBlurred===c&&e.isPristine===f&&e.isDefaultValue===l&&e.isDirty===d&&ZB(r,t))return e;let x={...t,errorMap:b,fieldMeta:this.fieldMetaDerived.state,errors:h,isFieldsValidating:a,isFieldsValid:o,isFormValid:g,isValid:_,canSubmit:y,isTouched:s,isBlurred:c,isPristine:f,isDefaultValue:l,isDirty:d};return r=this.baseStore.get(),x}),this.handleSubmit=this.handleSubmit.bind(this),this.update(e||{})}get state(){return this.store.state}get formId(){return this._formId}runValidator(e){return dV(e.validate)?uV[e.type](e.value,e.validate):e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function gV(e){return e?XB(e)?{formError:gV(e.form).formError,fieldErrors:e.fields}:{formError:e}:{formError:void 0}}function _V(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}var vV=class e{constructor(t){this.options={},this.mount=()=>{this.options.defaultValue!==void 0&&!this.getMeta().isTouched&&this.form.setFieldValue(this.name,this.options.defaultValue,{dontUpdateMeta:!0});let e=this.getInfo();e.instance=this,this.update(this.options);let{onMount:t}=this.options.validators||{};if(t){let e=this.runValidator({validate:t,value:{value:this.state.value,fieldApi:this,validationSource:`field`},type:`validate`});e&&this.setMeta(t=>({...t,errorMap:{...t?.errorMap,onMount:e},errorSourceMap:{...t?.errorSourceMap,onMount:`field`}}))}return this.options.listeners?.onMount?.({value:this.state.value,fieldApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);let e=this.form.fieldInfo[this.name];if(e&&e.instance===this){for(let[t,n]of Object.entries(e.validationMetaMap))n?.lastAbortController.abort(),e.validationMetaMap[t]=void 0;this.form.baseStore.setState(e=>({...e,fieldMetaBase:{...e.fieldMetaBase,[this.name]:{...fV,isTouched:e.fieldMetaBase[this.name]?.isTouched??fV.isTouched,isBlurred:e.fieldMetaBase[this.name]?.isBlurred??fV.isBlurred,isDirty:e.fieldMetaBase[this.name]?.isDirty??fV.isDirty}}})),e.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,fieldApi:this}),this.form.options.listeners?.onFieldUnmount?.({formApi:this.form,fieldApi:this})}}},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(ZB(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,this.state.meta)},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,eV(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(e,t)=>{this.form.pushFieldValue(this.name,e,eV(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.insertValue=(e,t,n)=>{this.form.insertFieldValue(this.name,e,t,eV(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.replaceValue=(e,t,n)=>{this.form.replaceFieldValue(this.name,e,t,eV(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.removeValue=(e,t)=>{this.form.removeFieldValue(this.name,e,eV(t,{dontRunListeners:!0})),t?.dontRunListeners||this.triggerOnChangeListener()},this.swapValues=(e,t,n)=>{this.form.swapFieldValues(this.name,e,t,eV(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.moveValue=(e,t,n)=>{this.form.moveFieldValues(this.name,e,t,eV(n,{dontRunListeners:!0})),n?.dontRunListeners||this.triggerOnChangeListener()},this.clearValues=e=>{this.form.clearFieldValues(this.name,eV(e,{dontRunListeners:!0})),e?.dontRunListeners||this.triggerOnChangeListener()},this.getLinkedFields=t=>{let n=Object.values(this.form.fieldInfo),r=[];for(let i of n){if(!i.instance||!(i.instance instanceof e))continue;let{onChangeListenTo:n,onBlurListenTo:a}=i.instance.options.validators||{};t===`change`&&n?.includes(this.name)&&r.push(i.instance),t===`blur`&&a?.includes(this.name)&&r.push(i.instance)}return r},this.validateSync=(e,t)=>{let n=JB(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||sV}),r=this.getLinkedFields(e).reduce((t,n)=>{let r=JB(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||sV});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),i=!1;NB(()=>{let e=(e,n)=>{let r=bV(n.cause),a=n.validate?yV(e.runValidator({validate:n.validate,value:{value:e.store.state.value,validationSource:`field`,fieldApi:e},type:`validate`})):void 0,o=t[r],{newErrorValue:s,newSource:c}=$B({formLevelError:o,fieldLevelError:a});e.state.meta.errorMap?.[r]!==s&&e.setMeta(e=>({...e,errorMap:{...e.errorMap,[r]:s},errorSourceMap:{...e.errorSourceMap,[r]:c}})),s&&(i=!0)};for(let t of n)e(this,t);for(let t of r)t.validate&&e(t.field,t)});let a=bV(`submit`);return this.state.meta.errorMap?.[a]&&e!==`submit`&&!i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[a]:void 0},errorSourceMap:{...e.errorSourceMap,[a]:void 0}})),{hasErrored:i}},this.validateAsync=async(e,t)=>{let n=YB(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||sV}),r=await t,i=this.getLinkedFields(e).reduce((t,n)=>{let r=YB(e,{...n.options,form:n.form,fieldName:n.name,validationLogic:n.form.options.validationLogic||sV});return r.forEach(e=>{e.field=n}),t.concat(r)},[]),a=[],o=[],s=n.some(e=>e.validate),c=Array.from(new Set(i.filter(e=>e.validate).map(e=>e.field)));NB(()=>{s&&this.startValidation();for(let e of c)e.startValidation()});let l=(e,t,n)=>{let i=bV(t.cause),a=e.getInfo();a.validationMetaMap[i]?.lastAbortController.abort();let o=new AbortController;a.validationMetaMap[i]={lastAbortController:o},n.push(new Promise(async n=>{let a;try{a=await new Promise((n,r)=>{e.timeoutIds.validations[t.cause]&&(clearTimeout(e.timeoutIds.validations[t.cause]),e.endValidation()),e.timeoutIds.validations[t.cause]=setTimeout(async()=>{if(o.signal.aborted)return n(void 0);try{n(await this.runValidator({validate:t.validate,value:{value:e.store.state.value,fieldApi:e,signal:o.signal,validationSource:`field`},type:`validateAsync`}))}catch(e){r(e)}},t.debounceMs)})}catch(e){a=e}if(o.signal.aborted)return n(void 0);let s=yV(a),c=r[e.name]?.[i],{newErrorValue:l,newSource:u}=$B({formLevelError:c,fieldLevelError:s});if(e.getInfo().instance!==e)return n(void 0);e.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:l},errorSourceMap:{...e.errorSourceMap,[i]:u}})),n(l)}))};for(let e of n)e.validate&&l(this,e,a);for(let e of i)e.validate&&l(e.field,e,o);let u=[];return(a.length||o.length)&&(u=await Promise.all(a),await Promise.all(o)),NB(()=>{s&&this.endValidation();for(let e of c)e.endValidation()}),u.filter(Boolean)},this.validate=(e,t)=>{if(!this.state.meta.isTouched)return[];let n=t?.skipGroupValidation?[]:Array.from(this.form.formGroupApis).filter(e=>this.name.startsWith(e.name)),r=(t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e)).fieldsErrorMap[this.name]??{};if(!t?.skipFormValidation)for(let t of n){if(t.state.meta.submissionAttempts===0)continue;let{fieldsErrorMap:n}=this.form.validateSync(e,{group:t,dontUpdateFormErrorMap:!0,filterFieldNames:e=>oV(t.name,e)});r={...r,...n[this.name]??{}}}let{hasErrored:i}=this.validateSync(e,r),a=new WeakMap;for(let t of n){let{hasErrored:n}=t.validateSync(e,{},{skipRelatedFieldValidation:!0});a.set(t,n)}if(i&&!this.options.asyncAlways){this.getInfo().validationMetaMap[bV(e)]?.lastAbortController.abort();let t=[];for(let r of n)r.getInfo().validationMetaMap[bV(e)]?.lastAbortController.abort(),t.push(r.state.meta.errors);return[...this.state.meta.errors,...t.flat()]}let o=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e),s=this.validateAsync(e,o),c=[];for(let t of n)(!a.get(t)||t.options.asyncAlways)&&c.push(t.validateAsync(e,o,{skipRelatedFieldValidation:!0}));return c.length===0?s:Promise.all([s,...c]).then(e=>e.flat())},this.handleChange=e=>{this.setValue(e)},this.handleBlur=()=>{this.state.meta.isTouched||this.setMeta(e=>({...e,isTouched:!0})),this.state.meta.isBlurred||this.setMeta(e=>({...e,isBlurred:!0})),this.validate(`blur`),this.triggerOnBlurListener()},this.setErrorMap=e=>{this.setMeta(t=>({...t,errorMap:{...t.errorMap,...e}}))},this.parseValueWithSchema=e=>uV.validate({value:this.state.value,validationSource:`field`},e),this.parseValueWithSchemaAsync=e=>uV.validateAsync({value:this.state.value,validationSource:`field`},e),this.triggerOnBlurListener=()=>{let e=this.form.options.listeners?.onBlurDebounceMs;e&&e>0?(this.timeoutIds.formListeners.blur&&clearTimeout(this.timeoutIds.formListeners.blur),this.timeoutIds.formListeners.blur=setTimeout(()=>{this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onBlur?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onBlurDebounceMs;t&&t>0?(this.timeoutIds.listeners.blur&&clearTimeout(this.timeoutIds.listeners.blur),this.timeoutIds.listeners.blur=setTimeout(()=>{this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onBlur?.({value:this.state.value,fieldApi:this})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this})},e)):this.form.options.listeners?.onChange?.({formApi:this.form,fieldApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,fieldApi:this});for(let e of this.form.formGroupApis)oV(e.name,this.name)&&e.triggerOnChangeListener()},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,fieldApi:this})},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.store=RB(e=>{this.form.store.get();let n=this.form.getFieldMeta(this.name)??{...fV,...t.defaultMeta},r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!ZB(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}})}get state(){return this.store.state}runValidator(e){return dV(e.validate)?uV[e.type](e.value,e.validate):e.validate(e.value)}startValidation(){this.setMeta(e=>{let t=e._pendingValidationsCount+1;return{...e,_pendingValidationsCount:t,isValidating:t>0&&!e.isValidating||e.isValidating}})}endValidation(){this.setMeta(e=>{let t=Math.max(0,e._pendingValidationsCount-1);return{...e,_pendingValidationsCount:t,isValidating:t===0&&e.isValidating?!1:e.isValidating}})}};function yV(e){if(e)return e}function bV(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function xV(e){return{isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,isSubmitSuccessful:e.isSubmitSuccessful??!1}}function SV(e){return{...fV,...e,errors:[],isPristine:!0,isValid:!0,isDefaultValue:!0,isFieldsValidating:!1,isFieldsValid:!0,isGroupValid:!0,canSubmit:!0,isSubmitting:!1,isSubmitted:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1}}var CV=class e{constructor(t){this.options={},this.setFormGroupState=e=>{this.form.baseStore.setState(t=>{let n=t.formGroupStateBase[this.name]??xV({});return{...t,formGroupStateBase:{...t.formGroupStateBase,[this.name]:e(n)}}})},this._lastDistributedFieldNames={},this.update=e=>{this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0&&(ZB(this.form.getFieldValue(this.name),e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})),this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,{...fV,...this.options.defaultMeta})},this.mount=()=>{this.update(this.options),this.form.formGroupApis.add(this),this.fieldInfo.instance=this,this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:e.formGroupStateBase[this.name]??xV({...this.options.defaultState})}}));let{onMount:e}=this.options.validators||{};if(e){let t=this.runValidator({validate:e,value:{value:this.state.value,groupApi:this,validationSource:`form`},type:`validate`}),n=t,r;TV(t)&&(n=t.group,r=t.fields);let i=wV(n);i&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,onMount:i},errorSourceMap:{...e.errorSourceMap,onMount:`field`}})),this.distributeFieldErrors(`onMount`,r)}return this.options.listeners?.onMount?.({value:this.state.value,groupApi:this}),()=>{for(let[e,t]of Object.entries(this.timeoutIds.validations))t&&(clearTimeout(t),this.timeoutIds.validations[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.listeners))t&&(clearTimeout(t),this.timeoutIds.listeners[e]=null);for(let[e,t]of Object.entries(this.timeoutIds.formListeners))t&&(clearTimeout(t),this.timeoutIds.formListeners[e]=null);if(this.fieldInfo.instance===this){for(let[e,t]of Object.entries(this.fieldInfo.validationMetaMap))t?.lastAbortController.abort(),this.fieldInfo.validationMetaMap[e]=void 0;this.form.formGroupApis.delete(this),this.form.baseStore.setState(e=>({...e,formGroupStateBase:{...e.formGroupStateBase,[this.name]:xV({})}})),this.fieldInfo.instance=null,this.options.listeners?.onUnmount?.({value:this.state.value,groupApi:this})}}},this.setValue=(e,t)=>{this.form.setFieldValue(this.name,e,eV(t,{dontRunListeners:!0,dontValidate:!0})),t?.dontRunListeners||this.triggerOnChangeListener(),t?.dontValidate||this.validate(`change`)},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.fieldInfo,this.getRelatedFields=()=>{let e=Object.values(this.form.fieldInfo),t=[];for(let n of e)n.instance&&n.instance instanceof vV&&n.instance.name.startsWith(this.name)&&t.push(n.instance);return t},this.getRelatedFieldMetasDerived=()=>{let e=Object.entries(this.form.fieldMetaDerived.state),t=[];for(let[n,r]of e)n!==this.name&&oV(this.name,n)&&t.push({...r,name:n});return t},this.buildChildFieldName=e=>e===``?this.name:e.startsWith(`[`)?`${this.name}${e}`:`${this.name}.${e}`,this.distributeFieldErrors=(e,t)=>{let n=this._lastDistributedFieldNames[e]??new Set,r=new Set;if(t)for(let[e,n]of Object.entries(t))n!=null&&n!==!1&&r.add(this.buildChildFieldName(e));let i=new Set([...n,...r]),a=!1;for(let n of i){let r=n.startsWith(this.name+`[`)?n.slice(this.name.length):n.slice(this.name.length+1),i=t?.[r],o=this.form.getFieldMeta(n);if(!o&&!i)continue;let s=o?.errorMap[e],{newErrorValue:c,newSource:l}=QB({newFormValidatorError:i,isPreviousErrorFromFormValidator:o?.errorSourceMap[e]===`form`,previousErrorValue:s});c&&(a=!0),(s!==c||o?.errorSourceMap[e]!==l)&&this.form.setFieldMeta(n,(t=fV)=>({...t,errorMap:{...t.errorMap,[e]:c},errorSourceMap:{...t.errorSourceMap,[e]:l}}))}return this._lastDistributedFieldNames[e]=r,a},this.validateSync=(t,n,r={})=>{let i=JB(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||sV}),a=(r.skipRelatedFieldValidation?[]:this.getRelatedFields()).reduce((e,n)=>{let r=JB(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||sV});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),o=!1;NB(()=>{let t=(t,r)=>{let i=DV(r.cause),a=t===this,s;r.validate&&(s=t.runValidator({validate:r.validate,value:{value:t.store.state.value,validationSource:a?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validate`}));let c=s,l;a&&TV(s)&&(c=s.group,l=s.fields);let u=wV(c),d=n[i],{newErrorValue:f,newSource:p}=$B({formLevelError:d,fieldLevelError:u});t.state.meta.errorMap?.[i]!==f&&t.setMeta(e=>({...e,errorMap:{...e.errorMap,[i]:f},errorSourceMap:{...e.errorSourceMap,[i]:p}})),f&&(o=!0),a&&this.distributeFieldErrors(i,l)&&(o=!0)};for(let e of i)t(this,e);for(let e of a)e.validate&&t(e.field,e)});let s=DV(`submit`);return this.state.meta.errorMap?.[s]&&t!==`submit`&&!o&&this.setMeta(e=>({...e,errorMap:{...e.errorMap,[s]:void 0},errorSourceMap:{...e.errorSourceMap,[s]:void 0}})),{hasErrored:o}},this.validateAsync=async(t,n,r={})=>{let i=YB(t,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||sV}),a=await n,o=r.skipRelatedFieldValidation?[]:this.getRelatedFields(),s=o.reduce((e,n)=>{let r=YB(t,{...n.options,form:n.form,validationLogic:n.form.options.validationLogic||sV});return r.forEach(e=>{e.field=n}),e.concat(r)},[]),c=[],l=[],u=i.some(e=>e.validate)||s.some(e=>e.validate);if(u){this.state.meta.isValidating||this.setMeta(e=>({...e,isValidating:!0}));for(let e of o)e.setMeta(e=>({...e,isValidating:!0}))}let d=(t,n,r)=>{let i=DV(n.cause),o=t.getInfo();o.validationMetaMap[i]?.lastAbortController.abort();let s=new AbortController;o.validationMetaMap[i]={lastAbortController:s};let c=t===this;r.push(new Promise(async r=>{let o;try{o=await new Promise((r,i)=>{t.timeoutIds.validations[n.cause]&&clearTimeout(t.timeoutIds.validations[n.cause]),t.timeoutIds.validations[n.cause]=setTimeout(async()=>{if(s.signal.aborted)return r(void 0);try{r(await this.runValidator({validate:n.validate,value:{value:t.store.state.value,signal:s.signal,validationSource:c?`form`:`field`,...t instanceof e?{groupApi:t}:{fieldApi:t}},type:`validateAsync`}))}catch(e){i(e)}},n.debounceMs)})}catch(e){o=e}if(s.signal.aborted)return r(void 0);let l=o,u;c&&TV(o)&&(l=o.group,u=o.fields);let d=wV(l),f=a[t.name]?.[i],{newErrorValue:p,newSource:m}=$B({formLevelError:f,fieldLevelError:d});if(t.getInfo().instance!==t)return r(void 0);t.setMeta(e=>({...e,errorMap:{...e?.errorMap,[i]:p},errorSourceMap:{...e.errorSourceMap,[i]:m}})),c&&this.distributeFieldErrors(i,u),r(p)}))};for(let e of i)e.validate&&d(this,e,c);for(let e of s)e.validate&&d(e.field,e,l);let f=[];if((c.length||l.length)&&(f=await Promise.all(c),await Promise.all(l)),u){this.setMeta(e=>({...e,isValidating:!1}));for(let e of o)e.setMeta(e=>({...e,isValidating:!1}))}return f.filter(Boolean)},this.validateAllFields=async e=>{let t=[];return NB(()=>{Object.values(this.getRelatedFields()).forEach(n=>{t.push(Promise.resolve().then(()=>n.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),n.store.state.meta.isTouched||n.setMeta(e=>({...e,isTouched:!0}))})}),(await Promise.all(t)).flat()},this.validateArrayFieldsStartingFrom=(e,t,n)=>this.form.validateArrayFieldsStartingFrom(e,t,n),this.validateField=(e,t)=>this.form.validateField(e,t),this.getFieldValue=e=>this.form.getFieldValue(e),this.getFieldMeta=e=>this.form.getFieldMeta(e),this.setFieldMeta=(e,t)=>this.form.setFieldMeta(e,t),this.setFieldValue=(e,t)=>this.form.setFieldValue(e,t),this.deleteField=e=>this.form.deleteField(e),this.pushFieldValue=(e,t)=>this.form.pushFieldValue(e,t),this.insertFieldValue=(e,t,n)=>this.form.insertFieldValue(e,t,n),this.replaceFieldValue=(e,t,n)=>this.form.replaceFieldValue(e,t,n),this.swapFieldValues=(e,t,n)=>this.form.swapFieldValues(e,t,n),this.moveFieldValues=(e,t,n)=>this.form.moveFieldValues(e,t,n),this.clearFieldValues=e=>this.form.clearFieldValues(e),this.resetField=e=>this.form.resetField(e),this.removeFieldValue=(e,t)=>this.form.removeFieldValue(e,t),this.areRelatedFieldsValid=()=>Object.values(this.getRelatedFields()).every(e=>e.state.meta.isValid),this.validate=(e,t)=>{let{fieldsErrorMap:n}=t?.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>oV(this.name,e)}),{hasErrored:r}=this.validateSync(e,n[this.name]??{},{skipRelatedFieldValidation:t?.skipRelatedFieldValidation});if(r&&!this.options.asyncAlways)return this.getInfo().validationMetaMap[DV(e)]?.lastAbortController.abort(),this.state.meta.errors;let i=t?.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:e=>oV(this.name,e)});return this.validateAsync(e,i,{skipRelatedFieldValidation:t?.skipRelatedFieldValidation})},this.triggerOnChangeListener=()=>{let e=this.form.options.listeners?.onChangeGroupDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this})},e)):this.form.options.listeners?.onChangeGroup?.({formApi:this.form,groupApi:this});let t=this.options.listeners?.onChangeDebounceMs;t&&t>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},t)):this.options.listeners?.onChange?.({value:this.state.value,groupApi:this})},this.triggerOnSubmitListener=()=>{this.options.listeners?.onSubmit?.({value:this.state.value,groupApi:this})},this._handleSubmit=async e=>{this.setFormGroupState(e=>({...e,isSubmitted:!1,submissionAttempts:e.submissionAttempts+1,isSubmitSuccessful:!1})),NB(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.state.meta.isTouched||e.setMeta(e=>({...e,isTouched:!0}))})});let t=e??this.options.onSubmitMeta;this.setFormGroupState(e=>({...e,isSubmitting:!0}));let n=()=>{this.setFormGroupState(e=>({...e,isSubmitting:!1}))};if(await this.validateAllFields(`submit`),!this.areRelatedFieldsValid()){n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});return}if(await this.validate(`submit`,{skipRelatedFieldValidation:!0}),!this.areRelatedFieldsValid()||!this.state.meta.isValid){n(),this.options.onGroupSubmitInvalid?.({value:this.state.value,groupApi:this,meta:t});return}NB(()=>{Object.values(this.getRelatedFields()).forEach(e=>{e.options.listeners?.onGroupSubmit?.({value:e.state.value,fieldApi:e})})}),this.options.listeners?.onSubmit?.({groupApi:this,value:this.state.value});try{await this.options.onGroupSubmit?.({value:this.state.value,groupApi:this,meta:t}),NB(()=>{this.setFormGroupState(e=>({...e,isSubmitted:!0,isSubmitSuccessful:!0})),n()})}catch(e){throw this.setFormGroupState(e=>({...e,isSubmitSuccessful:!1})),n(),e}},this.form=t.form,this.name=t.name,this.options=t,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.fieldInfo={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.store=RB(e=>{this.form.formGroupMetaDerived.get(),this.form.baseStore.get();let n=this.form.getFormGroupMeta(this.name)??SV(t.defaultMeta),r=this.form.getFieldValue(this.name);return!n.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!ZB(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===n?e:{value:r,meta:n}}),this.handleSubmit=this.handleSubmit.bind(this)}get state(){return this.store.state}runValidator(e){if(dV(e.validate)){let t=uV[e.type](e.value,e.validate);return e.type===`validate`?EV(t):t.then(EV)}return e.validate(e.value)}handleSubmit(e){return this._handleSubmit(e)}};function wV(e){if(e)return e}function TV(e){return!!e&&typeof e==`object`&&`fields`in e}function EV(e){if(!e||typeof e!=`object`||!(`form`in e)&&!(`fields`in e))return e;let{form:t,fields:n,...r}=e;return{...r,group:t,fields:n}}function DV(e){switch(e){case`submit`:return`onSubmit`;case`blur`:return`onBlur`;case`mount`:return`onMount`;case`server`:return`onServer`;case`dynamic`:return`onDynamic`;default:return`onChange`}}function OV(e,t){if(!t)return;let n=Object.assign({},e,{state:aV(e.state)});t(n),n.fieldInfo!==e.fieldInfo&&(e.fieldInfo=n.fieldInfo),n.options!==e.options&&(e.options=n.options);let r=Object.keys({values:null,validationMetaMap:null,fieldMetaBase:null,formGroupStateBase:null,isSubmitting:null,isSubmitted:null,isValidating:null,submissionAttempts:null,isSubmitSuccessful:null,_force_re_eval:null}).reduce((t,r)=>(e.state[r]!==n.state[r]&&(t[r]=n.state[r]),t),{});return NB(()=>{Object.keys(r).length&&e.baseStore.setState(e=>({...e,...r})),n.state.errorMap!==e.state.errorMap&&e.setErrorMap(n.state.errorMap)}),n}var kV=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),AV=o(((e,t)=>{t.exports=kV()})),jV=o((e=>{var t=u(),n=AV();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}})),MV=o(((e,t)=>{t.exports=jV()}))();function NV(e,t){return e===t}function PV(e,t=e=>e,n){let r=n?.compare??NV,i=(0,P.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,P.useCallback)(()=>e.get(),[e]);return(0,MV.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var FV=typeof window<`u`?P.useLayoutEffect:P.useEffect;function IV(e){let[t,n]=(0,P.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,P.useState)(()=>new vV({...e})),a=r;(t.form!==e.form||t.name!==e.name)&&(a=new vV({...e}),i(a),n({form:e.form,name:e.name}));let o=PV(a.store,e.mode===`array`?e=>e.meta._arrayVersion||0:e=>e.value),s=PV(a.store,e=>e.meta.isTouched),c=PV(a.store,e=>e.meta.isBlurred),l=PV(a.store,e=>e.meta.isDirty),u=PV(a.store,e=>e.meta.errorMap),d=PV(a.store,e=>e.meta.errorSourceMap),f=PV(a.store,e=>e.meta.isValidating),p=(0,P.useMemo)(()=>({...a,get state(){return{value:e.mode===`array`?a.state.value:o,get meta(){return{...a.state.meta,isTouched:s,isBlurred:c,isDirty:l,errorMap:u,errorSourceMap:d,isValidating:f}}}}}),[a,e.mode,o,s,c,l,u,d,f]);return FV(a.mount,[a]),FV(()=>{a.update(e)}),p}var LV=(({children:e,...t})=>{let n=IV(t),r=(0,P.useMemo)(()=>BB(e,n),[e,n]);return(0,F.jsx)(F.Fragment,{children:r})});function RV(){return(0,P.useState)(()=>iV())[0]}var zV=P,BV=`19.3.0`.split(`.`)[0]===`17`?RV:zV.useId;function VV(e){let[t,n]=(0,P.useState)(()=>({form:e.form,name:e.name})),[r,i]=(0,P.useState)(()=>new CV({...e}));(t.form!==e.form||t.name!==e.name)&&(i(new CV({...e})),n({form:e.form,name:e.name}));let a=PV(r.store,e=>e.value),o=PV(r.store,e=>e.meta.isTouched),s=PV(r.store,e=>e.meta.isBlurred),c=PV(r.store,e=>e.meta.isDirty),l=PV(r.store,e=>e.meta.errorMap),u=PV(r.store,e=>e.meta.errorSourceMap),d=PV(r.store,e=>e.meta.isValidating),f=PV(r.store,e=>e.meta.isSubmitting),p=PV(r.store,e=>e.meta.isSubmitted),m=PV(r.store,e=>e.meta.submissionAttempts),h=PV(r.store,e=>e.meta.isSubmitSuccessful),g=PV(r.store,e=>e.meta.canSubmit),_=PV(r.store,e=>e.meta.isValid),v=PV(r.store,e=>e.meta.isFieldsValid),y=PV(r.store,e=>e.meta.isFieldsValidating),b=PV(r.store,e=>e.meta.isGroupValid),x=(0,P.useMemo)(()=>({...r,handleSubmit:((...e)=>r._handleSubmit(...e)),get state(){return{...r.state,value:a,get meta(){return{...r.state.meta,isTouched:o,isBlurred:s,isDirty:c,errorMap:l,errorSourceMap:u,isValidating:d,isSubmitting:f,isSubmitted:p,submissionAttempts:m,isSubmitSuccessful:h,canSubmit:g,isValid:_,isFieldsValid:v,isFieldsValidating:y,isGroupValid:b}}}}}),[r,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b]);return FV(r.mount,[r]),FV(()=>{r.update(e)}),x}var HV=(({children:e,...t})=>{let n=VV(t),r=(0,P.useMemo)(()=>BB(e,n),[e,n]);return(0,F.jsx)(F.Fragment,{children:r})});function UV({form:e,selector:t=e=>e,children:n}){let r=PV(e.store,t);return(0,F.jsx)(F.Fragment,{children:BB(n,r)})}function WV(e){let t=BV(),[n,r]=(0,P.useState)(e?.formId),[i,a]=(0,P.useState)(()=>new hV({...e,formId:e?.formId??t}));if(n!==e?.formId){let n=e?.formId??t;a(new hV({...e,formId:n})),r(n)}let o=(0,P.useMemo)(()=>{let e={...i,handleSubmit:((...e)=>i._handleSubmit(...e)),get formId(){return i._formId},get state(){return i.store.state}};return e.Field=function(e){return(0,F.jsx)(LV,{...e,form:i})},e.FormGroup=function(e){return(0,F.jsx)(HV,{...e,form:i})},e.Subscribe=function(e){return(0,F.jsx)(UV,{form:i,selector:e.selector,children:e.children})},e},[i]);FV(i.mount,[]),FV(()=>{i.update(e)});let s=(0,P.useRef)(!1);return FV(()=>{s.current&&e?.transform&&OV(i,e.transform)},[i,e?.transform]),FV(()=>{s.current=!0}),o}var GV={key:`id`,label:`id`,kind:`string`},KV={key:`when`,label:`when (template)`,kind:`string`},qV={goto:[{key:`url`,label:`url`,kind:`string`},{key:`waitUntil`,label:`wait until`,kind:`enum`,options:[`load`,`domcontentloaded`,`networkidle`,`commit`]},KV],click:[{key:`selector`,label:`selector`,kind:`string`},{key:`optional`,label:`optional`,kind:`boolean`},GV,KV],fill:[{key:`selector`,label:`selector`,kind:`string`},{key:`value`,label:`value (template)`,kind:`string`},GV,KV],press:[{key:`selector`,label:`selector`,kind:`string`},{key:`key`,label:`key`,kind:`string`},GV,KV],select:[{key:`selector`,label:`selector`,kind:`string`},{key:`value`,label:`value`,kind:`string`},GV,KV],scroll:[{key:`to`,label:`to`,kind:`string`},{key:`untilStable`,label:`until stable`,kind:`boolean`},KV],wait:[{key:`selector`,label:`selector`,kind:`string`},{key:`ms`,label:`ms`,kind:`number`},KV],screenshot:[{key:`path`,label:`path`,kind:`string`},GV,KV],request:[{key:`url`,label:`url`,kind:`string`},{key:`method`,label:`method`,kind:`enum`,options:[`GET`,`POST`,`PUT`,`PATCH`,`DELETE`,`HEAD`]},{key:`as`,label:`read as`,kind:`enum`,options:[`text`,`json`,`html`,`xml`,`csv`,`yaml`,`pdf`,`workbook`,`deck`]},GV,KV],extract:[{key:`selector`,label:`selector`,kind:`string`},{key:`kind`,label:`kind`,kind:`enum`,options:[`css`,`xpath`,`jsonpath`,`table`]},{key:`take`,label:`take`,kind:`string`},{key:`many`,label:`many`,kind:`boolean`},{key:`from`,label:`from (id)`,kind:`string`},GV,KV],set:[{key:`value`,label:`value (JSON)`,kind:`json`},GV,KV],collect:[{key:`into`,label:`into (id)`,kind:`string`},{key:`value`,label:`value (JSON)`,kind:`json`},KV],forEach:[{key:`as`,label:`as`,kind:`string`},{key:`over`,label:`over (id)`,kind:`string`},{key:`selector`,label:`selector (live elements)`,kind:`string`},{key:`emit`,label:`emits a record`,kind:`boolean`},GV,KV],paginate:[{key:`until`,label:`until (template)`,kind:`string`},{key:`maxPages`,label:`max pages`,kind:`number`},GV,KV],if:[{key:`test`,label:`test (template)`,kind:`string`},GV],hook:[{key:`name`,label:`hook`,kind:`hook`},{key:`args`,label:`args (JSON)`,kind:`json`},GV,KV],emit:[{key:`output`,label:`output recipe id`,kind:`string`},KV]};function JV({stepType:e,step:t,onChange:n,onCommit:r}){let[i,a]=(0,P.useState)(!1),o=qV[e]??[],s=WV({defaultValues:t});return(0,F.jsxs)(mw,{gap:2,p:2,borderWidth:`1px`,borderRadius:`md`,bg:`bg.subtle`,children:[o.map(e=>(0,F.jsx)(s.Field,{name:e.key,validators:{onMount:({value:t})=>YV(e,t),onChange:({value:t})=>YV(e,t)},children:i=>(0,F.jsxs)(mw,{gap:0,children:[(0,F.jsx)(XV,{field:e,value:i.state.value,onChange:r=>{i.handleChange(r),n({...t,[e.key]:r})},onCommit:()=>{i.handleBlur(),r()}}),i.state.meta.errors.length>0&&(0,F.jsx)(V,{fontSize:`xs`,color:`fg.error`,children:String(i.state.meta.errors[0])})]})},e.key)),o.length===0&&(0,F.jsx)(V,{fontSize:`xs`,color:`fg.muted`,children:`No common fields for this step type; edit its JSON below.`}),(0,F.jsxs)(I,{children:[(0,F.jsxs)(V,{as:`button`,fontSize:`xs`,color:`fg.muted`,cursor:`pointer`,onClick:()=>{a(e=>!e)},children:[i?`▾`:`▸`,` Advanced (JSON)`]}),i&&(0,F.jsx)(QV,{step:t,onChange:n,onCommit:r})]})]})}function YV(e,t){return t!==void 0&&typeof t!=`number`&&e.kind===`number`?`must be a number`:void 0}function XV({field:e,value:t,onChange:n,onCommit:r}){return e.kind===`boolean`?(0,F.jsxs)(aw,{checked:t===!0,onCheckedChange:e=>{n(e.checked===!0),r()},children:[(0,F.jsx)(lw,{}),(0,F.jsx)(cw,{}),(0,F.jsx)(ow,{fontSize:`sm`,children:e.label})]}):e.kind===`enum`?(0,F.jsxs)(Mw,{children:[(0,F.jsx)(Nw,{fontSize:`xs`,children:e.label}),(0,F.jsx)(Jw,{size:`sm`,children:(0,F.jsxs)(Xw,{value:typeof t==`string`?t:``,onChange:e=>{n(e.target.value===``?void 0:e.target.value),r()},children:[(0,F.jsx)(`option`,{value:``,children:`(default)`}),e.options?.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))]})})]}):e.kind===`hook`?(0,F.jsxs)(Mw,{children:[(0,F.jsx)(Nw,{fontSize:`xs`,children:e.label}),(0,F.jsx)(kk,{ariaLabel:e.label,value:typeof t==`string`?t:``,onChange:n,onCommit:r})]}):e.kind===`json`?(0,F.jsx)(ZV,{field:e,value:t,onChange:n,onCommit:r}):(0,F.jsxs)(Mw,{children:[(0,F.jsx)(Nw,{fontSize:`xs`,children:e.label}),(0,F.jsx)(Rw,{size:`sm`,type:e.kind===`number`?`number`:`text`,value:t===void 0?``:String(t),onChange:t=>{n(e.kind===`number`?$V(t.target.value):t.target.value)},onBlur:r})]})}function ZV({field:e,value:t,onChange:n,onCommit:r}){let[i,a]=(0,P.useState)(()=>eH(t));return(0,F.jsxs)(Mw,{children:[(0,F.jsx)(Nw,{fontSize:`xs`,children:e.label}),(0,F.jsx)(Rw,{size:`sm`,fontFamily:`mono`,value:i,onChange:e=>{a(e.target.value)},onBlur:()=>{n(tH(i)),r()}})]})}function QV({step:e,onChange:t,onCommit:n}){let[r,i]=(0,P.useState)(()=>JSON.stringify(e,null,2)),[a,o]=(0,P.useState)();return(0,F.jsxs)(mw,{gap:1,mt:1,children:[(0,F.jsx)(PT,{size:`sm`,fontFamily:`mono`,fontSize:`xs`,rows:6,"aria-label":`Advanced step JSON`,value:r,onChange:e=>{i(e.target.value)},onBlur:()=>{try{let e=JSON.parse(r);if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`a step is a JSON object`);o(void 0),t(e),n()}catch(e){o(e instanceof Error?e.message:String(e))}}}),a!==void 0&&(0,F.jsx)(V,{fontSize:`xs`,color:`fg.error`,children:a})]})}function $V(e){if(e===``)return;let t=Number(e);return Number.isNaN(t)?void 0:t}function eH(e){return typeof e==`string`?e:e===void 0?``:JSON.stringify(e)}function tH(e){try{return JSON.parse(e)}catch{return e}}function nH({listId:e,nodes:t,allIssues:n,actions:r,menuLabel:i}){let{listGap:a}=mD();return(0,F.jsxs)(mw,{gap:a,children:[(0,F.jsx)(bB,{ariaLabel:`${i} at the start`,onAdd:t=>{r.insert(e,0,t)}}),(0,F.jsx)(One,{as:`div`,axis:`y`,values:t,onReorder:t=>{r.reorder(e,t)},style:{display:`flex`,flexDirection:`column`,gap:a*4},children:t.map((a,o)=>(0,F.jsx)(rH,{node:a,listId:e,index:o,lastIndex:t.length-1,allIssues:n,actions:r,menuLabel:i},a.path))})]})}function rH({node:e,listId:t,index:n,lastIndex:r,allIssues:i,actions:a,menuLabel:o}){let s=Sne(),{listGap:c}=mD();return(0,F.jsxs)(Ine,{as:`div`,value:e,dragListener:!1,dragControls:s,onDragEnd:a.commit,whileDrag:{scale:1.02,boxShadow:`0 8px 24px rgba(0, 0, 0, 0.25)`,zIndex:1},style:{display:`flex`,flexDirection:`column`,gap:c*4,position:`relative`},children:[(0,F.jsx)(iH,{node:e,listId:t,index:n,lastIndex:r,allIssues:i,actions:a,dragControls:s}),(0,F.jsx)(bB,{ariaLabel:`${o} after this step`,onAdd:e=>{a.insert(t,n+1,e)}})]})}function iH({node:e,listId:t,index:n,lastIndex:r,allIssues:i,actions:a,readOnly:o=!1,dragControls:s}){let[c,l]=(0,P.useState)(!1),{compact:u,listGap:d,cardPad:f,nestIndent:p}=mD(),m=e.kind===`bracket`,h=e.kind===`card`&&e.custom,g=kte(i,e.path),_=typeof e.step.id==`string`?e.step.id:void 0,v=G(e=>e.hoveredStepId),y=G(e=>e.setHoveredStepId),b=_!==void 0&&_===v;return(0,F.jsxs)(mw,{gap:d,"data-testid":`outline-card-${e.path}`,children:[(0,F.jsxs)(W,{className:`group`,gap:u?1:2,p:f,borderWidth:`1px`,borderRadius:`md`,"data-highlighted":b,borderColor:b?`orange.solid`:void 0,bg:b?`orange.subtle`:h?`bg.muted`:`bg.panel`,cursor:o?`default`:`pointer`,onClick:o?void 0:()=>{l(e=>!e)},onMouseEnter:o||_===void 0?void 0:()=>{y(_)},onMouseLeave:o||_===void 0?void 0:()=>{y(void 0)},children:[!o&&s!==void 0&&(0,F.jsx)(I,{"aria-label":`Drag to reorder`,title:`Drag to reorder`,role:`img`,display:`flex`,alignItems:`center`,flexShrink:0,px:1,color:`fg.muted`,cursor:`grab`,userSelect:`none`,_active:{cursor:`grabbing`},style:{touchAction:`none`},onClick:e=>{e.stopPropagation()},onPointerDown:e=>{e.stopPropagation(),s.start(e)},children:(0,F.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 14 14`,"aria-hidden":!0,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,children:(0,F.jsx)(`path`,{d:`M2 3.5h10M2 7h10M2 10.5h10`})})}),!o&&(0,F.jsxs)(mw,{direction:u?`row`:`column`,order:u?2:0,gap:0,flexShrink:0,opacity:+!u,_groupHover:{opacity:1},_focusWithin:{opacity:1},children:[(0,F.jsx)(uw,{"aria-label":`Move up`,size:`2xs`,variant:`ghost`,disabled:n===0,onClick:e=>{e.stopPropagation(),a.move(t,n,-1)},children:`↑`}),(0,F.jsx)(uw,{"aria-label":`Move down`,size:`2xs`,variant:`ghost`,disabled:n===r,onClick:e=>{e.stopPropagation(),a.move(t,n,1)},children:`↓`})]}),(0,F.jsxs)(I,{flex:`1`,order:1,children:[(0,F.jsx)(Rne,{parts:e.sentence}),g.length>0&&(0,F.jsx)(mw,{gap:0,mt:1,children:g.map(e=>(0,F.jsx)(V,{fontSize:`xs`,color:`fg.error`,children:e.message},e.message))})]}),!o&&(0,F.jsx)(uw,{"aria-label":`Remove step`,size:`2xs`,variant:`ghost`,order:3,onClick:e=>{e.stopPropagation(),a.remove(t,n)},children:`✕`})]}),c&&!h&&!o&&(0,F.jsx)(I,{pl:p,children:(0,F.jsx)(JV,{stepType:e.stepType,step:e.step,onChange:t=>{a.edit(e.path,e=>({...e,step:t}))},onCommit:a.commit})}),c&&h&&!o&&(0,F.jsxs)(I,{pl:p,children:[(0,F.jsx)(V,{fontSize:`xs`,color:`fg.muted`,mb:1,children:`This step doesn't read as a sentence yet: edit its JSON directly.`}),(0,F.jsx)(JV,{stepType:e.stepType,step:e.step,onChange:t=>{a.edit(e.path,e=>({...e,step:t}))},onCommit:a.commit})]}),m&&(0,F.jsxs)(I,{pl:p,borderLeftWidth:`2px`,borderColor:`border.muted`,children:[(0,F.jsx)(nH,{listId:`${e.path}::then`,nodes:e.children,allIssues:i,actions:a,menuLabel:`Add step`}),e.stepType===`if`&&e.elseChildren!==void 0&&(0,F.jsxs)(mw,{gap:1,mt:2,children:[(0,F.jsx)(V,{fontSize:`xs`,fontWeight:`medium`,color:`fg.muted`,children:`Else`}),(0,F.jsx)(nH,{listId:`${e.path}::else`,nodes:e.elseChildren,allIssues:i,actions:a,menuLabel:`Add step`})]}),e.stepType===`if`&&e.elseChildren===void 0&&(0,F.jsx)(ew,{size:`xs`,variant:`outline`,mt:2,onClick:()=>{a.insert(`${e.path}::else`,0,`emit`)},children:`+ Add an else branch`})]})]})}var aH={edit:()=>{},commit:()=>{},move:()=>{},reorder:()=>{},remove:()=>{},insert:()=>{}};function oH({recipe:e,onSaveOutline:t}){let[n,r]=(0,P.useState)(e?.outline);(0,P.useEffect)(()=>{r(e?.outline)},[e?.file,e?.text]);let[i,a]=(0,P.useState)(new Set),[o,s]=(0,P.useState)(!1),c=Ok(),l=nO(e=>e.recipeId),u=nO(e=>e.active),d=nO(e=>e.stoppedSteps!==void 0),f=nO(e=>e.cards),p=nO(e=>e.notes);if(e===void 0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(V,{children:`Select a recipe to see its steps.`})});if(n===void 0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(V,{children:`This recipe has no steps to show (not an input recipe, or its JSON is not an object).`})});let m=n=>{r(n),t(e.file,n)},h={edit:(e,t)=>{r(n=>n===void 0?n:Ote(n,e,t))},commit:()=>{r(n=>(n!==void 0&&t(e.file,n),n))},move:(e,t,r)=>{if(n===void 0)return;let i=ND(n,e),a=t+r;if(a<0||a>=i.length)return;let o=[...i],[s]=o.splice(t,1);o.splice(a,0,s),m(PD(n,e,o))},reorder:(e,t)=>{r(n=>n===void 0?n:PD(n,e,t))},remove:(e,t)=>{if(n===void 0)return;let r=ND(n,e);m(PD(n,e,r.filter((e,n)=>n!==t)))},insert:(e,t,r)=>{if(n===void 0)return;let i=ND(n,e),a=Nk(r,`${RD(e)}.${t}`,c?.[0]);m(PD(n,e,[...i.slice(0,t),a,...i.slice(t)]))}};function g(e,t){if(n===void 0||e.selector===void 0)return;let r={kind:`bracket`,path:`steps.${n.steps.length}`,stepType:`paginate`,sentence:[{kind:`word`,text:`For every page — click`},{kind:`code`,text:e.selector}],step:{type:`paginate`,next:{selector:e.selector},steps:[]},children:[]};m({...n,steps:[...n.steps,r]}),a(e=>new Set(e).add(t))}let _=l===e.id&&(u||d);function v(e){if(!Tk(e.dataTransfer))return;e.preventDefault(),s(!1);let t=wk(e.dataTransfer);t!==void 0&&n!==void 0&&m({...n,steps:[...n.steps,{...t,path:`steps.${String(n.steps.length)}`}]})}function y(e){Tk(e.dataTransfer)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,s(!0))}return(0,F.jsxs)(I,{h:`full`,overflow:`auto`,p:2,"data-testid":`steps-outline`,"data-card-over":o,outline:o?`2px dashed`:void 0,outlineColor:`brand.solid`,outlineOffset:`-4px`,onDragOver:y,onDragLeave:()=>{s(!1)},onDrop:v,children:[VD(n).every(e=>e.stepType!==`extract`)&&(0,F.jsx)(xk,{}),(0,F.jsx)(nH,{listId:``,nodes:n.steps,allIssues:e.issues,actions:h,menuLabel:`Add step`},e.file),_&&(0,F.jsxs)(I,{mt:3,pt:2,borderTopWidth:`1px`,borderColor:`border.muted`,"data-testid":`recording-cards`,children:[(0,F.jsxs)(W,{gap:2,mb:1,children:[(0,F.jsx)(V,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:u?`Recording…`:`Recording stopped`}),(0,F.jsxs)(JC,{size:`sm`,colorPalette:u?`red`:`gray`,children:[f.length,` step`,f.length===1?``:`s`]})]}),(0,F.jsx)(mw,{gap:1,children:f.map((e,t)=>(0,F.jsx)(iH,{node:e.node,listId:`recording`,index:t,lastIndex:f.length-1,allIssues:[],actions:aH,readOnly:!0},`recording:${t}:${e.node.path}`))}),p.length>0&&(0,F.jsx)(mw,{gap:1,mt:2,children:p.map((e,t)=>(0,F.jsxs)(W,{gap:2,p:2,borderWidth:`1px`,borderRadius:`md`,borderColor:e.kind===`unsupported`?`orange.muted`:`border.muted`,bg:`bg.muted`,children:[(0,F.jsx)(V,{fontSize:`xs`,flex:`1`,children:e.message}),e.kind===`next-link`&&e.selector!==void 0&&!i.has(t)&&(0,F.jsx)(ew,{size:`2xs`,colorPalette:`brand`,onClick:()=>{g(e,t)},children:`Turn into pagination`}),e.kind===`next-link`&&i.has(t)&&(0,F.jsx)(JC,{size:`sm`,colorPalette:`green`,children:`Added`})]},`note:${t}:${e.message}`))})]})]})}function sH(){return(0,F.jsx)(I,{px:3,py:2,bg:`orange.subtle`,borderBottomWidth:`1px`,flexShrink:0,role:`status`,children:(0,F.jsx)(V,{fontSize:`sm`,children:`This page shows almost nothing. If it should have content, it builds it with JavaScript and the engine fetched it without a browser. Use Inspect to see the data it loads.`})})}function cH({text:e}){return(0,F.jsx)(I,{px:3,py:2,bg:`orange.subtle`,borderBottomWidth:`1px`,flexShrink:0,role:`status`,children:(0,F.jsx)(V,{fontSize:`sm`,children:e})})}function lH({value:e,onChange:t}){return(0,F.jsxs)(W,{gap:0,role:`group`,"aria-label":`Show the document as`,flexShrink:0,children:[(0,F.jsx)(ew,{size:`2xs`,colorPalette:`brand`,variant:e===`tree`?`solid`:`outline`,"aria-pressed":e===`tree`,title:`Click values to collect them`,onClick:()=>{t(`tree`)},children:`Tree`}),(0,F.jsx)(ew,{size:`2xs`,colorPalette:`brand`,variant:e===`text`?`solid`:`outline`,"aria-pressed":e===`text`,title:`The document as it is written`,onClick:()=>{t(`text`)},children:`Text`})]})}var uH=`table`,dH=`text`,fH=4,pH=1;function mH(e){return`^${DH(e.trim())}`}function hH(e){let t=e.trim().toLowerCase().replace(/[^\d a-z]/gi,` `).trim().split(/\s+/).filter(e=>e!==``);if(t.length===0)return`column`;let[n,...r]=t;return n+r.map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function gH(e,t,n=uH,r=!1){if(e.header===void 0)throw Error(`tableCardNode: pick the header row first`);let i=e.columns,a=i!==void 0&&Object.keys(i).length>0;return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:n,kind:`table`,selector:e.header,...e.until!==void 0&&{until:e.until},...a&&{columns:i},...r&&{ignoreHeadersFooters:!0}}}}function _H(e,t,n){let[r,i]=EH(n.x1,n.x2),[a,o]=EH(n.y1,n.y2);return`${e}=${String(t)} x=${String(Math.round(r))}..${String(Math.round(i))} y=${String(Math.round(a))}..${String(Math.round(o))}`}function vH(e){return{x1:e.x-pH,y1:e.y-pH,x2:e.x+Math.max(e.width,1)+pH,y2:e.y+e.height+pH}}function yH(e){return{x1:e.x1-pH,y1:e.y1-pH,x2:e.x2+pH,y2:e.y2+pH}}function bH(e,t){return{x1:Math.min(e.x1,t.x1),y1:Math.min(e.y1,t.y1),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function xH(e){let[t=``]=e.split(`
12
+ `,1),n=t.trim().toLowerCase().replace(/[^\d a-z]/gi,` `).trim().split(/\s+/).filter(e=>e!==``).slice(0,fH);if(n.length===0)return dH;let[r,...i]=n;return r+i.map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function SH(e,t,n){return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:n,kind:`region`,selector:e}}}function CH(e,t,n){return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:n,kind:`regex`,selector:`${DH(e)}${String.raw`:[\t ]*([^\t\n]+)`}`}}}function wH(e,t,n,r,i,a={}){return{kind:`card`,path:r,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:i,kind:`section`,selector:`^${DH(e)}$`,...t!==void 0&&{until:`^${DH(t)}$`},...n&&{ignoreHeadersFooters:!0},...a.line!==void 0&&{line:a.line},...a.match!==void 0&&{match:a.match}}}}function TH(e,t,n,r=1){return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:n,kind:`regex`,selector:`${DH(e)}${String.raw`\n([^\n]+`}${r>1?String.raw`(?:\n[^\n]+){${String(r-1)}}`:``})`}}}function EH(e,t){return e<=t?[e,t]:[t,e]}function DH(e){return e.replace(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}var OH=`table`;function kH(e){return`${mH(e)}$`}function AH(e){return e.map(e=>String(e.value).trim()).filter(e=>e!==``).join(` `)}function jH(e){let t=e.rows.map(e=>e.map(e=>e.value));for(let n of e.merges){let e=t[n.top]?.[n.left]??``;for(let r=n.top;r<=n.bottom;r+=1){t[r]??=[];for(let i=n.left;i<=n.right;i+=1)t[r][i]=e}}return t}function MH(e,t,n){let r=[];for(let i of t){let t=String(e[i]?.[n]??``).trim();t!==``&&!r.includes(t)&&r.push(t)}return r.join(` `)}function NH(e,t){let n=mH(t);return Object.entries(e.columns??{}).find(([,e])=>e===n)?.[0]??t}function PH(e,t,n=OH){if(e.header===void 0)throw Error(`gridTableCardNode: pick the header row first`);let r=e.columns,i=r!==void 0&&Object.keys(r).length>0,a=e.fillDown!==void 0&&e.fillDown.length>0;return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:n,kind:`table`,selector:e.header,...e.sheet!==void 0&&{sheet:e.sheet},...e.until!==void 0&&{until:e.until},...i&&{columns:r},...e.headerRows!==void 0&&e.headerRows>1&&{headerRows:e.headerRows},...a&&{fillDown:e.fillDown},...e.includeHidden===!0&&{includeHidden:!0}}}}function FH(e,t){let n=t.top===t.bottom?`[${String(t.top)}]`:`[${String(t.top)}:${String(t.bottom+1)}]`,r=t.left===t.right?`[${String(t.left)}]`:`[${String(t.left)}:${String(t.right+1)}]`;return`$.sheets[?(@.name==${BH(e)})].rows${n}${r}`}function IH(e,t){return{top:Math.min(e.top,t.top),left:Math.min(e.left,t.left),bottom:Math.max(e.bottom,t.bottom),right:Math.max(e.right,t.right)}}function LH(e){return e.top===e.bottom&&e.left===e.right}function RH(e,t){let n=[];for(let r=t.top;r<=t.bottom;r+=1){let i=e.rows[r]?.slice(t.left,t.right+1)??[];n.push(i.map(e=>String(e.value)).join(` `))}return n.join(`
13
+ `)}function zH(e,t,n,r){return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:n,kind:`jsonpath`,selector:e,take:`json`,...r&&{many:!0}}}}function BH(e){return e.includes(`'`)?`"${e.replace(/["\\]/g,String.raw`\$&`)}"`:`'${e}'`}var VH=`table`,HH=`value`,UH=1;function WH(e){return`${mH(e)}$`}function GH(e,t,n=VH){if(e.header===void 0)throw Error(`deckTableCardNode: pick the header row first`);let r=e.columns,i=r!==void 0&&Object.keys(r).length>0,a=e.fillDown!==void 0&&e.fillDown.length>0;return{kind:`card`,path:t,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:n,kind:`table`,selector:e.header,...e.slide!==void 0&&{slide:e.slide},...e.shapes===!0&&{shapes:!0},...e.until!==void 0&&{until:e.until},...i&&{columns:r},...e.headerRows!==void 0&&e.headerRows>1&&{headerRows:e.headerRows},...a&&{fillDown:e.fillDown},...e.includeHidden===!0&&{includeHidden:!0}}}}function KH(e,t,n,r=HH){return{kind:`card`,path:n,stepType:`extract`,sentence:[],custom:!1,step:{type:`extract`,id:r,selector:`$.slides[${String(e)}].charts[${String(t)}].series`,kind:`jsonpath`,take:`json`}}}function qH(e){return{x1:e.x-UH,y1:e.y-UH,x2:e.x+Math.max(e.width,1)+UH,y2:e.y+Math.max(e.height,1)+UH}}var JH=`#9b5de5`;function YH({left:e,top:t,text:n,loading:r,note:i,choices:a,choice:o=0,onChoose:s,onAdd:c,onClear:l,onDragStart:u}){let d=n===void 0&&!r,[f=``]=(n??``).split(`
14
+ `,1);return(0,F.jsxs)(I,{"data-testid":`region-chip`,position:`absolute`,style:{left:`${String(e)}px`,top:`${String(t)}px`},zIndex:`docked`,px:2,py:1,bg:`bg.panel`,borderWidth:`1px`,borderColor:JH,borderRadius:`md`,shadow:`md`,maxW:`420px`,draggable:n!==void 0,onDragStart:u,onMouseDown:e=>{e.stopPropagation()},onMouseUp:e=>{e.stopPropagation()},cursor:n===void 0?`default`:`grab`,title:n===void 0?void 0:`Drag onto the Steps tab to add it there`,children:[(0,F.jsxs)(W,{gap:2,children:[(0,F.jsx)(V,{fontSize:`xs`,fontFamily:`mono`,truncate:!0,flex:`1`,color:d?`fg.muted`:`fg`,children:r&&n===void 0?`reading…`:d?`nothing to read here`:f}),(0,F.jsx)(ew,{size:`2xs`,colorPalette:`brand`,onClick:c,disabled:n===void 0,children:`Add to recipe`}),(0,F.jsx)(dw,{size:`2xs`,"aria-label":`Clear selection`,onClick:l})]}),i!==void 0&&(0,F.jsx)(V,{"data-testid":`region-chip-note`,fontSize:`2xs`,color:`fg.muted`,children:i}),a!==void 0&&a.length>1&&s!==void 0&&(0,F.jsx)(Jw,{size:`xs`,mt:1,children:(0,F.jsx)(Xw,{"aria-label":`Select as`,value:o,onChange:e=>{s(Number(e.target.value))},children:a.map((e,t)=>(0,F.jsx)(`option`,{value:t,children:e},e))})})]})}var XH=/^\s*(page|slide)=(\*|\d+)\s+x=(-?\d+(?:\.\d+)?)\.\.(-?\d+(?:\.\d+)?)\s+y=(-?\d+(?:\.\d+)?)\.\.(-?\d+(?:\.\d+)?)\s*$/,ZH=/^\$\.sheets\[\?\(@\.name==(?:'([^']*)'|"((?:[^"\\]|\\.)*)")\)\]\.rows\[(\d+)(?::(\d+))?\]\[(\d+)(?::(\d+))?\]$/,QH=/^\$\.slides\[(\d+)\]\.charts\[(\d+)\]\.series$/;function $H(e){let t=[];for(let n of VD(e)){let{id:e,kind:r,selector:i}=n.step;typeof e==`string`&&typeof r==`string`&&typeof i==`string`&&n.step.type===`extract`&&t.push({id:e,kind:r,selector:i})}return t}function eU(e,t){let n=new Set([e.jsonpath,e.xpath,e.listPath].filter(e=>e!==void 0));return t.filter(e=>n.has(e.selector)&&(e.kind===`jsonpath`||e.kind===`xpath`)).map(e=>e.id)}function tU(e){let t=XH.exec(e);if(t===null)return;let[,n,r,i,a,o,s]=t;return{on:n,at:r===`*`?`*`:Number(r),box:{x1:Number(i),y1:Number(o),x2:Number(a),y2:Number(s)}}}function nU(e,t,n){let r=[];for(let i of e){if(i.kind!==`region`)continue;let e=tU(i.selector);e===void 0||e.on!==t||e.at!==`*`&&e.at!==n||r.push({id:i.id,box:e.box})}return r}function rU(e,t){let[n,r]=lU(e.x1,e.x2),[i,a]=lU(e.y1,e.y2),[o,s]=lU(t.x1,t.x2),[c,l]=lU(t.y1,t.y2),u=(r-n)*(a-i);return u===0?n>=o&&n<=s&&i>=c&&i<=l:Math.max(0,Math.min(r,s)-Math.max(n,o))*Math.max(0,Math.min(a,l)-Math.max(i,c))>=u/2}function iU(e,t){return t.filter(t=>rU(e,t.box)).map(e=>e.id)}function aU(e){let t=ZH.exec(e);if(t===null)return;let[,n,r,i,a,o,s]=t;return{sheet:n??(r??``).replace(/\\(.)/g,`$1`),range:{top:Number(i),left:Number(o),bottom:a===void 0?Number(i):Number(a)-1,right:s===void 0?Number(o):Number(s)-1}}}function oU(e,t){let n=[];for(let r of e){if(r.kind!==`jsonpath`)continue;let e=aU(r.selector);e!==void 0&&e.sheet===t&&n.push({id:r.id,range:e.range})}return n}function sU(e,t,n){return n.filter(({range:n})=>e>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right).map(e=>e.id)}function cU(e,t,n){for(let r of e){if(r.kind!==`jsonpath`)continue;let e=QH.exec(r.selector);if(e!==null&&Number(e[1])===t&&Number(e[2])===n)return r.id}}function lU(e,t){return e<=t?[e,t]:[t,e]}var uU=[],dU=5,fU=24,pU=4,mU=`#1d4ed8`,hU=`#ea580c`;function gU({recipeId:e,stepPath:t,view:n,onTablePick:r,onChartPick:i,onRegionPick:a,steps:o=uU,hoveredStepId:s,onHoverStepId:c}){let[l,u]=(0,P.useState)(0),[d,f]=(0,P.useState)(`table`),[p,m]=(0,P.useState)(0),[h,g]=(0,P.useState)(`text`),[_,v]=(0,P.useState)({}),[y,b]=(0,P.useState)(void 0),[x,S]=(0,P.useState)(void 0),[C,w]=(0,P.useState)(void 0),T=(0,P.useRef)(void 0),E=n.slides[l],D=(0,P.useMemo)(()=>nU(o,`slide`,E?.number??-1),[o,E?.number]),ee=(0,P.useMemo)(()=>(E?.charts??[]).map((e,t)=>cU(o,l,t)),[o,E?.charts,l]),O=d===`table`?E?.tables[p]:void 0,k=_.headerRowIndex===void 0?void 0:Array.from({length:_.headerRows??1},(e,t)=>_.headerRowIndex+t),te=bO(e,t,_.header===void 0?void 0:{slide:_.slide,shapes:_.shapes,header:_.header,until:_.until,columns:_.columns,headerRows:_.headerRows,fillDown:_.fillDown,includeHidden:_.includeHidden}),ne=(0,P.useMemo)(()=>te.data?.matches.find(e=>e.slide===E?.number),[te.data,E?.number]),re=x===void 0?void 0:_H(`slide`,x.slide,x.box),ie=gO(e,t,re),A=ie.data?.matches.find(e=>e.page===x?.slide),ae=A?.text;if((0,P.useEffect)(()=>{_.header!==void 0&&r(GH(_,t))},[_]),(0,P.useEffect)(()=>{m(0),v({}),f(E!==void 0&&E.tables.length===0&&E.shapes.length>0?`shapes`:`table`)},[l]),E===void 0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(V,{children:`This deck has no slides.`})});function oe(e){e!==d&&(f(e),v({}))}function se(e){if(O===void 0)return;let t=AH(O.rows[e]);if(t!==``){if(h===`header`){v(n=>n.headerRowIndex!==void 0&&e===n.headerRowIndex+(n.headerRows??1)?{...n,headerRows:(n.headerRows??1)+1}:{slide:WH(E.title??``),includeHidden:n.includeHidden,header:mH(t),headerRowIndex:e,headerRows:1});return}h===`until`&&_.header!==void 0&&v(e=>({...e,until:mH(t)}))}}function ce(e,t){if(O===void 0||k===void 0)return;let n=jH(O);if(h===`column`){let e=MH(n,k,t);if(e===``)return;v(t=>({...t,columns:{...t.columns,[hH(e)]:mH(e)}}));return}if(h===`fillDown`&&_U(O,e,t)){let e=MH(n,k,t);if(e===``)return;let r=NH(_,e);v(e=>{let t=e.fillDown??[];return t.includes(r)?e:{...e,fillDown:[...t,r]}})}}function j(e){let t=E.shapeRows.findIndex(t=>t.includes(e));if(t===-1)return;let n=E.shapeRows[t];if(h===`header`){let e=E.shapes[n[0]]?.text??``;if(e.trim()===``)return;v({slide:WH(E.title??``),shapes:!0,header:mH(e),headerRowIndex:t,headerRows:1});return}if(h===`until`){if(_.header===void 0)return;let e=E.shapes[n[0]]?.text??``;if(e.trim()===``)return;v(t=>({...t,until:mH(e)}));return}if(h===`column`){if(_.headerRowIndex!==t)return;let n=E.shapes[e]?.text??``;if(n.trim()===``)return;v(e=>({...e,columns:{...e.columns,[hH(n)]:mH(n)}}))}}function le(e){f(`table`),m(e),v({})}function ue(e){i(KH(l,e,t))}function de(e,t){let n=x;S(t&&n!==void 0&&n.slide===E.number?{slide:E.number,box:bH(n.box,e)}:{slide:E.number,box:e})}function fe(e){c!==void 0&&T.current!==e&&(T.current=e,c(e))}function pe(e){let t=vU(e);if(C!==void 0){w({...C,currentX:t.x,currentY:t.y});return}let n=SU(E,t);b(n),fe(n===void 0?void 0:iU(qH(n),D)[0])}function me(e){if(e.button!==0)return;let t=vU(e);w({startX:t.x,startY:t.y,currentX:t.x,currentY:t.y})}function he(e){if(C===void 0)return;let t=vU(e);if(w(void 0),Math.abs(t.x-C.startX)+Math.abs(t.y-C.startY)>pU){de({x1:C.startX,y1:C.startY,x2:t.x,y2:t.y},e.shiftKey);return}let n=SU(E,t);if(n===void 0){e.shiftKey||S(void 0);return}de(qH(n),e.shiftKey)}function ge(){if(re!==void 0&&ae!==void 0)return SH(re,t,xH(ae))}function _e(){let e=ge();e!==void 0&&(a(e),S(void 0))}function ve(e){let t=ge();t!==void 0&&ae!==void 0&&(e.dataTransfer.setData(Sk,Ck(t)),e.dataTransfer.setData(`text/plain`,ae),e.dataTransfer.effectAllowed=`copy`)}let M=h===`text`,N=x!==void 0&&x.slide===E.number?x:void 0;return(0,F.jsxs)(I,{h:`full`,display:`flex`,flexDirection:`column`,children:[(0,F.jsxs)(W,{px:3,py:2,borderBottomWidth:`1px`,gap:3,flexShrink:0,flexWrap:`wrap`,children:[n.slides.length>1&&(0,F.jsx)(wU,{slides:n.slides,value:l,onChange:u}),(0,F.jsx)(CU,{label:`Text`,active:M,onClick:()=>{g(`text`)}}),!M&&(0,F.jsx)(CU,{label:`Native table`,active:d===`table`,onClick:()=>{oe(`table`)}}),!M&&(0,F.jsx)(CU,{label:`Text-box grid`,active:d===`shapes`,onClick:()=>{oe(`shapes`)}}),(0,F.jsx)(CU,{label:`Header row(s)`,tip:`The row that names the columns of a table: click it to say where the table starts.`,active:h===`header`,onClick:()=>{g(`header`)}}),(0,F.jsx)(CU,{label:`Last row (until)`,tip:`The line that comes right after the table: click it to say where the table stops.`,active:h===`until`,onClick:()=>{g(`until`)}}),(0,F.jsx)(CU,{label:`Column`,tip:`Click a column to collect everything under it.`,active:h===`column`,onClick:()=>{g(`column`)}}),!M&&d===`table`&&(0,F.jsx)(CU,{label:`Fill down`,tip:`Click a column whose empty cells should repeat the value above them (a group name written once).`,active:h===`fillDown`,onClick:()=>{g(`fillDown`)}}),M&&(0,F.jsx)(V,{fontSize:`xs`,color:`fg.muted`,visibility:x===void 0?`visible`:`hidden`,children:`Click a text box (shift+click to extend) or drag a box, then add it to the recipe or drag it onto the Steps tab.`}),_.header!==void 0&&(0,F.jsx)(JC,{size:`sm`,colorPalette:`green`,children:`table: ${_.header}${_.until===void 0?``:` until ${_.until}`}`}),te.data?.error!==void 0&&(0,F.jsx)(JC,{size:`sm`,colorPalette:`orange`,children:te.data.error}),ie.data?.error!==void 0&&(0,F.jsx)(JC,{size:`sm`,colorPalette:`orange`,children:ie.data.error})]}),(0,F.jsxs)(I,{flex:`1`,minH:`0`,display:`flex`,overflow:`hidden`,children:[(0,F.jsxs)(I,{flex:`2`,minW:`0`,overflow:`auto`,p:3,children:[M&&(0,F.jsxs)(I,{position:`relative`,width:`${String(n.width)}px`,height:`${String(n.height)}px`,children:[(0,F.jsx)(TU,{slide:E,width:n.width,height:n.height}),(0,F.jsxs)(`svg`,{"data-testid":`deck-overlay`,width:n.width,height:n.height,style:{position:`absolute`,top:0,left:0,cursor:`crosshair`},onMouseMove:pe,onMouseDown:me,onMouseUp:he,onMouseLeave:()=>{b(void 0),fe(void 0)},children:[D.map(e=>(0,F.jsx)(`rect`,{"data-testid":`recipe-region`,"data-step-id":e.id,"data-highlighted":e.id===s,...xU(e.box),fill:e.id===s?`rgba(234, 88, 12, 0.22)`:`rgba(234, 88, 12, 0.05)`,stroke:hU,strokeWidth:e.id===s?2:1,strokeDasharray:e.id===s?void 0:`4 3`,pointerEvents:`none`,children:(0,F.jsx)(`title`,{children:`In the recipe: ${e.id}`})},`recipe:${e.id}`)),y!==void 0&&C===void 0&&(0,F.jsx)(`rect`,{"data-testid":`snap-target`,...bU(y),fill:`rgba(29, 78, 216, 0.08)`,stroke:mU,strokeWidth:1.5,strokeDasharray:`3 2`,pointerEvents:`none`}),N!==void 0&&(0,F.jsx)(`rect`,{"data-testid":`staged-region`,...xU(N.box),fill:`rgba(155, 93, 229, 0.12)`,stroke:`#9b5de5`,strokeWidth:1.5,pointerEvents:`none`}),N!==void 0&&A?.shapes.map(e=>(0,F.jsx)(`rect`,{"data-testid":`staged-shape`,...bU(e),fill:`rgba(155, 93, 229, 0.28)`,pointerEvents:`none`},yU(e))),C!==void 0&&(0,F.jsx)(`rect`,{...xU({x1:C.startX,y1:C.startY,x2:C.currentX,y2:C.currentY}),fill:`rgba(155, 93, 229, 0.2)`,stroke:`#9b5de5`,strokeDasharray:`4 2`,pointerEvents:`none`})]}),N!==void 0&&(0,F.jsx)(YH,{left:Math.min(N.box.x1,N.box.x2),top:Math.max(N.box.y1,N.box.y2)+6,text:ae,loading:ie.isPending,onAdd:_e,onClear:()=>{S(void 0)},onDragStart:ve})]}),!M&&d===`shapes`&&(0,F.jsx)(TU,{slide:E,width:n.width,height:n.height,headerRowIndex:_.headerRowIndex,onPick:j}),!M&&d===`table`&&O!==void 0&&(0,F.jsx)(EU,{table:O,headerRowIndexes:k,mode:h,onRowPick:se,onCellPick:ce}),!M&&d===`table`&&O===void 0&&(0,F.jsx)(V,{color:`fg.muted`,fontSize:`sm`,children:`This slide has no native tables.`}),!M&&ne!==void 0&&(0,F.jsx)(OU,{match:ne})]}),(0,F.jsx)(I,{flex:`1`,minW:`220px`,maxW:`320px`,borderLeftWidth:`1px`,overflow:`auto`,p:3,children:(0,F.jsx)(DU,{slide:E,activeSource:d,activeTableIndex:p,onTablePick:le,onChartPick:ue,chartStepIds:ee,hoveredStepId:s,onHoverStepId:fe})})]})]})}function _U(e,t,n){let r=e.merges.find(e=>e.top===t&&e.left===n);return r!==void 0&&r.bottom>r.top&&r.left===r.right}function vU(e){let t=e.currentTarget.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}function yU(e){return`staged:${String(e.x)}:${String(e.y)}`}function bU(e){return{x:e.x,y:e.y,width:Math.max(e.width,1),height:Math.max(e.height,1)}}function xU(e){let[t,n]=[Math.min(e.x1,e.x2),Math.max(e.x1,e.x2)],[r,i]=[Math.min(e.y1,e.y2),Math.max(e.y1,e.y2)];return{x:t,y:r,width:n-t,height:i-r}}function SU(e,t){let n;for(let r of e.shapes){let e=bU(r),i=Math.max(e.x-t.x,0,t.x-(e.x+e.width)),a=Math.max(e.y-t.y,0,t.y-(e.y+e.height)),o=Math.hypot(i,a);o<=fU&&(n===void 0||o<n.distance)&&(n={shape:r,distance:o})}return n?.shape}function CU({label:e,tip:t,active:n,onClick:r}){return(0,F.jsx)(V,{as:`button`,title:t,fontSize:`sm`,fontWeight:n?`semibold`:`normal`,color:n?`colorPalette.fg`:`fg`,colorPalette:`brand`,cursor:`pointer`,onClick:r,children:e})}function wU({slides:e,value:t,onChange:n}){let r=o_({items:e.map((e,t)=>({label:`Slide ${String(e.number)}${e.title===void 0||e.title===``?``:` — ${e.title}`}${e.hidden?` (hidden)`:``}`,value:String(t)}))});return(0,F.jsxs)($w,{collection:r,size:`sm`,width:`220px`,value:[String(t)],onValueChange:e=>{n(Number(e.value[0]))},children:[(0,F.jsx)(oT,{}),(0,F.jsx)(aT,{children:(0,F.jsx)(eT,{children:(0,F.jsx)(rT,{})})}),(0,F.jsx)(tT,{children:(0,F.jsx)(nT,{children:r.items.map(e=>(0,F.jsx)(iT,{item:e,children:e.label},e.value))})})]})}function TU({slide:e,width:t,height:n,headerRowIndex:r,onPick:i}){let a=r===void 0?void 0:new Set(e.shapeRows[r]);return(0,F.jsx)(I,{position:`relative`,width:`${String(t)}px`,height:`${String(n)}px`,borderWidth:`1px`,bg:`bg.panel`,children:e.shapes.map((e,t)=>(0,F.jsx)(I,{position:`absolute`,style:{left:`${String(e.x)}px`,top:`${String(e.y)}px`,width:`${String(Math.max(e.width,1))}px`,height:`${String(Math.max(e.height,1))}px`},borderWidth:`1px`,borderColor:a?.has(t)===!0?`orange.fg`:`border.muted`,bg:a?.has(t)===!0?`orange.subtle`:`bg`,overflow:`hidden`,px:1,fontSize:`xs`,cursor:i===void 0?`default`:`pointer`,_hover:i===void 0?void 0:{bg:`bg.emphasized`},onClick:i===void 0?void 0:()=>{i(t)},title:e.placeholder,children:e.text},`${String(e.x)}:${String(e.y)}:${String(t)}`))})}function EU({table:e,headerRowIndexes:t,mode:n,onRowPick:r,onCellPick:i}){return(0,F.jsx)(ET,{size:`sm`,variant:`outline`,children:(0,F.jsx)(MT,{children:e.rows.map((e,a)=>(0,F.jsx)(DT,{bg:t?.includes(a)===!0?`yellow.subtle`:void 0,children:e.map((e,t)=>(0,F.jsx)(jT,{fontSize:`xs`,cursor:`pointer`,_hover:{bg:`bg.emphasized`},onClick:()=>{n===`header`||n===`until`?r(a):i(a,t)},children:String(e.value)},t))},a))})})}function DU({slide:e,activeSource:t,activeTableIndex:n,onTablePick:r,onChartPick:i,chartStepIds:a,hoveredStepId:o,onHoverStepId:s}){return(0,F.jsxs)(FT,{align:`stretch`,gap:4,children:[(0,F.jsxs)(I,{children:[(0,F.jsx)(V,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,mb:1,children:`Native tables (${String(e.tables.length)})`}),e.tables.length===0&&(0,F.jsx)(V,{fontSize:`xs`,color:`fg.muted`,children:`None on this slide.`}),(0,F.jsx)(FT,{align:`stretch`,gap:1,children:e.tables.map((e,i)=>(0,F.jsxs)(I,{as:`button`,textAlign:`left`,p:2,borderWidth:`1px`,borderRadius:`sm`,bg:t===`table`&&n===i?`bg.emphasized`:void 0,onClick:()=>{r(i)},children:[(0,F.jsx)(V,{fontSize:`xs`,fontWeight:`medium`,children:e.name}),(0,F.jsx)(V,{fontSize:`2xs`,color:`fg.muted`,children:`${String(e.rows.length)} rows`})]},e.name))})]}),(0,F.jsxs)(I,{children:[(0,F.jsx)(V,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,mb:1,children:`Charts (${String(e.charts.length)})`}),e.charts.length===0&&(0,F.jsx)(V,{fontSize:`xs`,color:`fg.muted`,children:`None on this slide.`}),(0,F.jsx)(FT,{align:`stretch`,gap:1,children:e.charts.map((e,t)=>(0,F.jsxs)(I,{as:`button`,"data-testid":`deck-chart`,"data-step-ids":a[t],"data-highlighted":a[t]!==void 0&&a[t]===o,textAlign:`left`,p:2,borderWidth:`1px`,borderRadius:`sm`,borderColor:a[t]===void 0?void 0:`orange.solid`,borderStyle:a[t]===void 0||a[t]===o?`solid`:`dashed`,bg:a[t]!==void 0&&a[t]===o?`orange.subtle`:void 0,onClick:()=>{i(t)},onMouseEnter:()=>{s(a[t])},onMouseLeave:()=>{s(void 0)},children:[(0,F.jsxs)(W,{gap:1,children:[(0,F.jsx)(V,{fontSize:`xs`,fontWeight:`medium`,children:e.title??e.type}),a[t]!==void 0&&(0,F.jsx)(JC,{size:`xs`,colorPalette:`orange`,title:`Already in the recipe: the step reading this`,children:a[t]})]}),(0,F.jsx)(V,{fontSize:`2xs`,color:`fg.muted`,children:`${e.type} · ${String(e.series.length)} series`})]},t))})]}),(0,F.jsxs)(I,{children:[(0,F.jsx)(V,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,mb:1,children:`Notes`}),(0,F.jsx)(V,{fontSize:`xs`,color:e.notes===``?`fg.muted`:`fg`,whiteSpace:`pre-wrap`,children:e.notes===``?`None.`:e.notes})]})]})}function OU({match:e}){let t=e.rows.slice(0,dU);return(0,F.jsxs)(I,{borderTopWidth:`1px`,mt:3,maxH:`160px`,overflow:`auto`,children:[(0,F.jsx)(W,{px:0,py:1,gap:2,children:(0,F.jsx)(V,{fontSize:`xs`,color:`fg.muted`,children:`Live preview: ${String(e.rows.length)} row${e.rows.length===1?``:`s`} matched${e.title===``?``:` ("${e.title}")`}`})}),(0,F.jsxs)(ET,{size:`sm`,variant:`outline`,children:[(0,F.jsx)(kT,{children:(0,F.jsx)(DT,{children:e.header.map(e=>(0,F.jsx)(AT,{fontSize:`2xs`,children:e},e))})}),(0,F.jsx)(MT,{children:t.map((t,n)=>(0,F.jsx)(DT,{children:e.header.map(e=>(0,F.jsx)(jT,{fontSize:`2xs`,children:String(t[e]??``)},e))},n))})]})]})}var kU=7,AU=4/3,jU=24,MU=64,NU=4;function PU(e,t,n){let r=e.defaultColumnWidth===void 0?MU:IU(e.defaultColumnWidth),i=e.defaultRowHeight===void 0?jU:LU(e.defaultRowHeight),a=[0];for(let n=0;n<t;n+=1){let t=e.columnWidths?.[String(n)];a.push(a[n]+(t===void 0?r:IU(t)))}let o=[0];for(let t=0;t<n;t+=1){let n=e.rowHeights?.[String(t)];o.push(o[t]+(n===void 0?i:LU(n)))}return{columnLefts:a,rowTops:o,width:a[t],height:o[n]}}function FU(e){let t=``;for(let n=e+1;n>0;n=Math.floor((n-1)/26))t=String.fromCodePoint(65+(n-1)%26)+t;return t}function IU(e){return Math.max(NU,Math.round(e*kU))}function LU(e){return Math.max(NU,Math.round(e*AU))}var RU=[],zU=24,BU=44,VU=30,HU=5;function UU({recipeId:e,stepPath:t,view:n,onTablePick:r,onCellPick:i,steps:a=RU,hoveredStepId:o,onHoverStepId:s,csvOverride:c,onCsvOverrideChange:l}){let[u,d]=(0,P.useState)(0),[f,p]=(0,P.useState)(`cell`),[m,h]=(0,P.useState)({}),[g,_]=(0,P.useState)(void 0),[v,y]=(0,P.useState)(void 0),[b,x]=(0,P.useState)(void 0),S=(0,P.useRef)(null),C=(0,P.useRef)(void 0),w=n.sheets[u],T=(0,P.useMemo)(()=>oU(a,w?.name??``),[a,w?.name]),E=(0,P.useMemo)(()=>w===void 0?[]:jH(w),[w]),D=(0,P.useMemo)(()=>w===void 0?[]:JU(w),[w]),ee=m.headerRowIndex===void 0?void 0:Array.from({length:m.headerRows??1},(e,t)=>m.headerRowIndex+t),O=vO(e,t,m.header===void 0?void 0:{sheet:m.sheet,header:m.header,until:m.until,columns:m.columns,headerRows:m.headerRows,fillDown:m.fillDown,includeHidden:m.includeHidden}),k=(0,P.useMemo)(()=>O.data?.matches.find(e=>e.sheet===w?.name),[O.data,w?.name]),te=(0,P.useMemo)(()=>PU(w??{},w?.columnCount??0,w?.rows.length??0),[w]),ne=(0,P.useCallback)(e=>`${String(u)}:${String(e)}`,[u]),re=JO({count:w?.rows.length??0,getScrollElement:()=>S.current,estimateSize:e=>te.rowTops[e+1]-te.rowTops[e],getItemKey:ne,overscan:VU});(0,P.useEffect)(()=>{m.header!==void 0&&r(PH(m,t))},[m]);let ie=f===`cell`,A=b!==void 0&&w!==void 0&&b.sheet===w.name?b:void 0,ae=A===void 0?void 0:FH(A.sheet,A.range),oe=A===void 0||w===void 0?void 0:RH(w,A.range);if(w===void 0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(V,{children:`This workbook has no sheets.`})});function se(e){s!==void 0&&C.current!==e&&(C.current=e,s(e))}function ce(e,t){let n=A;x(t&&n!==void 0?{sheet:w.name,range:IH(n.range,e)}:{sheet:w.name,range:e})}function j(e,t){ie&&t.button===0&&(t.stopPropagation(),y(e))}function le(e,t){if(!ie)return;t.stopPropagation();let n=v??e;y(void 0),ce({top:Math.min(n.row,e.row),left:Math.min(n.column,e.column),bottom:Math.max(n.row,e.row),right:Math.max(n.column,e.column)},t.shiftKey)}function ue(e){ie&&(y(void 0),e.shiftKey||x(void 0))}function de(){if(A!==void 0&&ae!==void 0&&oe!==void 0)return zH(ae,t,xH(oe),!LH(A.range))}function fe(){let e=de();e!==void 0&&(i(e),x(void 0))}function pe(e){let t=de();t!==void 0&&oe!==void 0&&(e.dataTransfer.setData(Sk,Ck(t)),e.dataTransfer.setData(`text/plain`,oe),e.dataTransfer.effectAllowed=`copy`)}function me(e){if(d(e),f!==`sheet`)return;let t=n.sheets[e].name;h(e=>({...e,sheet:kH(t)}))}function he(e){let t=AH(w.rows[e]);t!==``&&h(n=>n.headerRowIndex!==void 0&&e===n.headerRowIndex+(n.headerRows??1)?{...n,headerRows:(n.headerRows??1)+1}:{sheet:n.sheet,includeHidden:n.includeHidden,header:mH(t),headerRowIndex:e,headerRows:1})}function ge(e){if(m.header===void 0)return;let t=AH(w.rows[e]);t!==``&&h(e=>({...e,until:mH(t)}))}function _e(e){if(ee===void 0)return;let t=MH(E,ee,e);if(t===``)return;let n=hH(t);h(e=>({...e,columns:{...e.columns,[n]:mH(t)}}))}function ve(e){if(ee===void 0)return;let t=MH(E,ee,e);if(t===``)return;let n=NH(m,t);h(e=>{let t=e.fillDown??[];return t.includes(n)?e:{...e,fillDown:[...t,n]}})}function M(e,t,n){if(f===`header`){he(e);return}if(f===`until`){ge(e);return}if(f===`column`){_e(t);return}f===`fillDown`&&n&&ve(t)}return(0,F.jsxs)(I,{h:`full`,display:`flex`,flexDirection:`column`,children:[(0,F.jsx)(W,{px:3,py:2,borderBottomWidth:`1px`,gap:1,flexShrink:0,flexWrap:`wrap`,children:n.sheets.map((e,t)=>(0,F.jsx)(QU,{sheet:e,active:t===u,onClick:()=>{me(t)}},e.name))}),(0,F.jsxs)(W,{px:3,py:2,borderBottomWidth:`1px`,gap:3,flexShrink:0,flexWrap:`wrap`,children:[(0,F.jsx)(ZU,{label:`Cell`,active:ie,onClick:()=>{p(`cell`)}}),(0,F.jsx)(ZU,{label:`Sheet`,active:f===`sheet`,onClick:()=>{p(`sheet`)}}),(0,F.jsx)(ZU,{label:`Header row(s)`,tip:`The row that names the columns of a table: click it to say where the table starts.`,active:f===`header`,onClick:()=>{p(`header`)}}),(0,F.jsx)(ZU,{label:`First non-data row (until)`,tip:`The first row below the table that is not part of it (a total, a note, a blank): click it to say where the table stops.`,active:f===`until`,onClick:()=>{p(`until`)}}),(0,F.jsx)(ZU,{label:`Column`,tip:`Click a column to collect everything under it.`,active:f===`column`,onClick:()=>{p(`column`)}}),(0,F.jsx)(ZU,{label:`Fill down`,tip:`Click a column whose empty cells should repeat the value above them (a group name written once).`,active:f===`fillDown`,onClick:()=>{p(`fillDown`)}}),n.csv!==void 0&&(0,F.jsx)(iW,{format:n.csv,override:c,onChange:l}),ie&&(0,F.jsx)(V,{fontSize:`xs`,color:`fg.muted`,visibility:b===void 0?`visible`:`hidden`,children:`Click a cell (shift+click, or press and release, for a range), then add it to the recipe or drag it onto the Steps tab.`}),m.header!==void 0&&(0,F.jsx)(JC,{size:`sm`,colorPalette:`green`,children:`table: ${m.header}${m.until===void 0?``:` until ${m.until}`}`}),O.data?.error!==void 0&&(0,F.jsx)(JC,{size:`sm`,colorPalette:`orange`,children:O.data.error})]}),(0,F.jsxs)(I,{flex:`1`,minH:`0`,display:`flex`,flexDirection:`column`,children:[(0,F.jsx)(I,{ref:S,flex:`1`,minH:`0`,overflow:`auto`,position:`relative`,onMouseUp:ue,onMouseLeave:()=>{_(void 0),se(void 0)},children:(0,F.jsxs)(I,{position:`relative`,style:{height:`${String(zU+te.height)}px`,width:`${String(BU+te.width)}px`},children:[(0,F.jsx)(KU,{geometry:te}),(0,F.jsx)(qU,{geometry:te,rowIndexes:re.getVirtualItems().map(e=>e.index),hiddenRows:w.hiddenRows}),re.getVirtualItems().map(e=>D[e.index]?.map(t=>t===void 0?null:(0,F.jsx)(nW,{cell:t,box:WU(te,e.index,t),isHeader:ee?.includes(e.index)??!1,isHidden:w.hiddenRows.includes(e.index),isSnapped:ie&&g?.row===e.index&&g.column===t.columnIndex,isStaged:A!==void 0&&XU(A.range,e.index,t.columnIndex),stepIds:sU(e.index,t.columnIndex,T),hoveredStepId:o,onClick:ie?void 0:()=>{M(e.index,t.columnIndex,t.isMergeLabel)},onMouseEnter:n=>{ie&&_({row:e.index,column:t.columnIndex}),se(n[0])},onMouseDown:ie?n=>{j({row:e.index,column:t.columnIndex},n)}:void 0,onMouseUp:ie?n=>{le({row:e.index,column:t.columnIndex},n)}:void 0},`${String(e.index)}:${String(t.columnIndex)}`))),A!==void 0&&(0,F.jsx)(YH,{left:BU+te.columnLefts[A.range.left],top:zU+te.rowTops[A.range.bottom+1]+4,text:oe,loading:!1,onAdd:fe,onClear:()=>{x(void 0)},onDragStart:pe})]})}),k!==void 0&&(0,F.jsx)(rW,{match:k})]})]})}function WU(e,t,n){let r=e.columnLefts.length-1,i=e.rowTops.length-1,a=e.columnLefts[n.columnIndex],o=e.rowTops[t];return{top:zU+o,left:BU+a,width:e.columnLefts[Math.min(n.columnIndex+n.colSpan,r)]-a,height:e.rowTops[Math.min(t+n.rowSpan,i)]-o}}var GU={fontSize:`11px`,fontWeight:600};function KU({geometry:e}){let t=e.columnLefts.length-1;return(0,F.jsxs)(I,{position:`sticky`,top:0,zIndex:3,bg:`bg.muted`,borderBottomWidth:`1px`,style:{height:`${String(zU)}px`,width:`${String(BU+e.columnLefts[t])}px`},children:[(0,F.jsx)(I,{position:`sticky`,left:0,zIndex:4,bg:`bg.muted`,borderRightWidth:`1px`,style:{width:`${String(BU)}px`,height:`${String(zU)}px`}}),Array.from({length:t},(t,n)=>(0,F.jsx)(I,{"data-testid":`column-header`,position:`absolute`,top:0,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRightWidth:`1px`,color:`fg.muted`,overflow:`hidden`,style:{...GU,left:`${String(BU+e.columnLefts[n])}px`,width:`${String(e.columnLefts[n+1]-e.columnLefts[n])}px`,height:`${String(zU)}px`},children:FU(n)},FU(n)))]})}function qU({geometry:e,rowIndexes:t,hiddenRows:n}){return(0,F.jsx)(I,{position:`sticky`,left:0,zIndex:2,bg:`bg.muted`,borderRightWidth:`1px`,style:{width:`${String(BU)}px`,height:`${String(e.height)}px`},children:t.map(t=>(0,F.jsx)(I,{"data-testid":`row-header`,position:`absolute`,left:0,display:`flex`,alignItems:`center`,justifyContent:`center`,borderBottomWidth:`1px`,color:`fg.muted`,overflow:`hidden`,opacity:n.includes(t)?.4:1,style:{...GU,top:`${String(e.rowTops[t])}px`,width:`${String(BU)}px`,height:`${String(e.rowTops[t+1]-e.rowTops[t])}px`},children:t+1},t))})}function JU(e){let t=YU(e.merges),n=new Map(e.merges.map(e=>[`${String(e.top)}:${String(e.left)}`,{rowSpan:e.bottom-e.top+1,colSpan:e.right-e.left+1}]));return e.rows.map((e,r)=>e.map((e,i)=>{let a=`${String(r)}:${String(i)}`;if(t.has(a))return;let o=n.get(a);return{columnIndex:i,rowSpan:o?.rowSpan??1,colSpan:o?.colSpan??1,value:e.value,type:e.type,isMergeLabel:o!==void 0&&o.rowSpan>1&&o.colSpan===1}}))}function YU(e){let t=new Set;for(let n of e)for(let e=n.top;e<=n.bottom;e+=1)for(let r=n.left;r<=n.right;r+=1)(e!==n.top||r!==n.left)&&t.add(`${String(e)}:${String(r)}`);return t}function XU(e,t,n){return t>=e.top&&t<=e.bottom&&n>=e.left&&n<=e.right}function ZU({label:e,tip:t,active:n,onClick:r}){return(0,F.jsx)(V,{as:`button`,title:t,fontSize:`sm`,fontWeight:n?`semibold`:`normal`,color:n?`colorPalette.fg`:`fg`,colorPalette:`brand`,cursor:`pointer`,onClick:r,children:e})}function QU({sheet:e,active:t,onClick:n}){return(0,F.jsxs)(W,{as:`button`,gap:1,px:2,py:1,borderRadius:`sm`,bg:t?`bg.emphasized`:void 0,opacity:e.hidden?.55:1,onClick:n,children:[(0,F.jsx)(V,{fontSize:`sm`,fontWeight:t?`semibold`:`normal`,children:e.name}),e.hidden&&(0,F.jsx)(JC,{size:`xs`,colorPalette:`gray`,children:`hidden`})]})}var $U={string:`fg`,number:`orange.fg`,boolean:`blue.fg`,date:`purple.fg`};function eW(e,t,n){return e?`purple.fg`:t?`blue.fg`:n?`orange.solid`:`border.muted`}function tW(e,t,n,r){return n?`purple.muted`:r?`orange.subtle`:t?`yellow.subtle`:e.isMergeLabel?`purple.subtle`:`bg`}function nW({cell:e,box:t,isHeader:n,isHidden:r,isSnapped:i,isStaged:a,stepIds:o,hoveredStepId:s,onClick:c,onMouseEnter:l,onMouseDown:u,onMouseUp:d}){let f=o.length>0,p=s!==void 0&&o.includes(s);return(0,F.jsx)(I,{"data-testid":i?`snap-target`:a?`staged-cell`:`grid-cell`,"data-step-ids":f?o.join(` `):void 0,"data-highlighted":p,position:`absolute`,style:{top:`${String(t.top)}px`,left:`${String(t.left)}px`,width:`${String(t.width)}px`,height:`${String(t.height)}px`},borderWidth:f?`2px`:`1px`,borderStyle:f&&!p?`dashed`:`solid`,borderColor:eW(a,i,f),bg:tW(e,n,a,p),opacity:r?.4:1,overflow:`hidden`,px:1,fontSize:`xs`,color:$U[e.type],cursor:c===void 0?`cell`:`pointer`,_hover:{bg:a?`purple.muted`:`bg.emphasized`},onClick:c,onMouseEnter:l===void 0?void 0:()=>{l(o)},onMouseDown:u,onMouseUp:d,title:f?`In the recipe: ${o.join(`, `)}
15
+ ${String(e.value)}`:r?`Hidden row
16
+ ${String(e.value)}`:String(e.value),truncate:!0,children:String(e.value)})}function rW({match:e}){let t=e.rows.slice(0,HU);return(0,F.jsxs)(I,{borderTopWidth:`1px`,maxH:`160px`,overflow:`auto`,flexShrink:0,children:[(0,F.jsx)(W,{px:2,py:1,gap:2,children:(0,F.jsx)(V,{fontSize:`xs`,color:`fg.muted`,children:`Live preview: ${String(e.rows.length)} row${e.rows.length===1?``:`s`} matched${e.title===``?``:` ("${e.title}")`}`})}),(0,F.jsxs)(ET,{size:`sm`,variant:`outline`,children:[(0,F.jsx)(kT,{children:(0,F.jsx)(DT,{children:e.header.map(e=>(0,F.jsx)(AT,{fontSize:`2xs`,children:e},e))})}),(0,F.jsx)(MT,{children:t.map((t,n)=>(0,F.jsx)(DT,{children:e.header.map(e=>(0,F.jsx)(jT,{fontSize:`2xs`,children:String(t[e]??``)},e))},n))})]})]})}function iW({format:e,override:t,onChange:n}){let r=t?.delimiter??e.delimiter,i=t?.encoding??e.encoding;return(0,F.jsxs)(W,{gap:2,children:[(0,F.jsx)(V,{fontSize:`xs`,color:`fg.muted`,children:`Delimiter`}),(0,F.jsx)(Rw,{size:`xs`,width:`40px`,defaultValue:r,onBlur:e=>{let i=e.target.value;i!==``&&i!==r&&n({delimiter:i,encoding:t?.encoding})}},r),(0,F.jsx)(V,{fontSize:`xs`,color:`fg.muted`,children:`Encoding`}),(0,F.jsx)(Rw,{size:`xs`,width:`110px`,defaultValue:i,onBlur:e=>{let r=e.target.value;r!==``&&r!==i&&n({delimiter:t?.delimiter,encoding:r})}},i)]})}var aW=2,oW=.15,sW=.6,cW=3,lW=40,uW=1.15,dW=.95;function fW(e,t){let n=_W(t),r=e.rows.findIndex(e=>e.cells.includes(t));if(r===-1||e.rows[r]?.cells.length!==1)return n;let i=n,a=t;for(let t=r+1;t<e.rows.length;t+=1){let n=hW(e,t);if(n===void 0||!gW(a,n))break;i=vW(i,_W(n)),a=n}a=t;for(let t=r-1;t>=0;--t){let n=hW(e,t);if(n===void 0||!gW(n,a))break;i=vW(i,_W(n)),a=n}return i}function pW(e){let t=/^([A-Z][\w &()./-]*):\s*(\S.*)$/i.exec(e.trim());if(t===null)return;let[,n=``,r=``]=t,i=n.trim();if(!(i.length>lW||r.startsWith(`//`)))return{label:i,value:r.trim()}}function mW(e){let[t,...n]=e.toLowerCase().split(/[^\da-z]+/).filter(e=>e!==``);if(t===void 0)return`value`;let r=t+n.map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``);return/^\d/.test(r)?`value${r.charAt(0).toUpperCase()}${r.slice(1)}`:r}function hW(e,t){let n=e.rows[t]?.cells;return n?.length===1?n[0]:void 0}function gW(e,t){let n=e.y-(t.y+t.height),r=Math.abs(e.height-t.height)<=Math.max(e.height,t.height)*oW,i=Math.abs(e.x-t.x)<=aW,a=Math.abs(e.x+e.width/2-(t.x+t.width/2))<=cW;return(i||a)&&r&&n<=e.height*sW}function _W(e){return{x1:e.x,y1:e.y,x2:e.x+Math.max(e.width,1),y2:e.y+e.height}}function vW(e,t){return{x1:Math.min(e.x1,t.x1),y1:Math.min(e.y1,t.y1),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function yW(e,t,n){let r=e.flatMap(e=>e.rows.filter(e=>e.running!==!0).map(t=>({page:e.number,row:t}))),i=r.findIndex(e=>e.row.cells.includes(n)),a=r[i]?.row;if(a===void 0||bW(a))return;let o=xW(r,i,n.height);return o===-1?wW(t,r,i):CW(r,o,t.number,e.some(e=>e.rows.some(e=>e.running===!0)),n)}function bW(e){return e.cells.length>1&&e.cells.every(e=>pW(e.text)!==void 0)}function xW(e,t,n){for(let r=t-1;r>=0;--r){let t=e[r]?.row.cells??[],i=t[0];if(i!==void 0&&i.height>n*uW&&t.length===1&&SW(e,r))return r}return-1}function SW(e,t){let n=e[t]?.row.cells[0]?.height??0;return e.some((e,r)=>r!==t&&e.row.cells.length===1&&Math.abs((e.row.cells[0]?.height??0)-n)<=n*.050000000000000044)}function CW(e,t,n,r,i){let a=e[t]?.row,o=a?.cells[0]?.height??0,s=a?.cells[0]?.text;if(s===void 0)return;let c=e.slice(t+1),l=c.findIndex(e=>Math.max(...e.row.cells.map(e=>e.height))>=o*dW),u=l===-1?c:c.slice(0,l),[d,...f]=u.filter(e=>e.page===n).flatMap(e=>e.row.cells).map(e=>_W(e));if(d===void 0)return;let p=l===-1?void 0:c[l]?.row.cells.map(e=>e.text).join(` `),m=u.map(e=>e.row),h=m.every(e=>e.cells.length===1)?m.findIndex(e=>e.cells[0]===i)+1:0;return{kind:`section`,heading:s,...p!==void 0&&{until:p},box:f.reduce((e,t)=>vW(e,t),d),ignoreHeadersFooters:r,...h>0&&{clickedLine:h}}}function wW(e,t,n){let r=t.filter(t=>t.page===e.number).map(e=>e.row),i=r.indexOf(t[n]?.row);if(r[i]?.cells.length!==1)return;let a=i;for(;a>0&&TW(r[a-1],r[a]);)--a;let o=i;for(;o<r.length-1&&TW(r[o],r[o+1]);)o+=1;let s=r[a-1],c=r.slice(a,o+1).map(e=>e.cells[0]).filter(e=>e!==void 0),[l,...u]=c;if(s!==void 0&&l!==void 0&&!(c.length>1&&l.height<=EW(r)*uW))return{kind:`after`,previous:s.cells.map(e=>e.text).join(` `),lines:c.length,box:u.reduce((e,t)=>vW(e,_W(t)),_W(l)),page:e.number}}function TW(e,t){let n=e?.cells.length===1?e.cells[0]:void 0,r=t?.cells.length===1?t.cells[0]:void 0;return n!==void 0&&r!==void 0&&!n.text.trimEnd().endsWith(`:`)&&gW(n,r)}function EW(e){let t=e.map(e=>Math.max(...e.cells.map(e=>e.height))).sort((e,t)=>e-t);return t[Math.floor(t.length/2)]??0}var DW=[{name:`date`,test:/\b\d{1,2}\s+[A-Z]{3,9}\s+\d{4}\b/i,pattern:String.raw`(\d{1,2} [A-Za-z]{3,9} \d{4})`},{name:`date`,test:/\b\d{4}-\d{2}-\d{2}\b/,pattern:String.raw`(\d{4}-\d{2}-\d{2})`},{name:`email address`,test:/[\w.+-]+@[\w-]+(?:\.[\w-]+)+/,pattern:String.raw`([\w.+-]+@[\w-]+(?:\.[\w-]+)+)`},{name:`amount`,test:/[£$€]\s?\d[\d,.]*/,pattern:String.raw`([£$€]\s?\d[\d,.]*)`}];function OW(e){let t=DW.find(t=>t.test.test(e));return t===void 0?void 0:{name:t.name,pattern:t.pattern}}function kW(e,t,n,r){let i=yW(e,t,n),a=[{...i!==void 0&&{anchor:i},box:yH(i?.kind===`section`||i?.kind===`after`&&i.lines>1?i.box:r)}];if(i?.kind===`section`){let e=vH(n),t=OW(n.text);i.clickedLine!==void 0&&a.push({anchor:{...i,line:i.clickedLine,box:e},box:e}),t!==void 0&&a.push({anchor:{...i,match:t.pattern,matchName:t.name,box:e},box:e})}return i!==void 0&&a.push({box:yH(r)}),a}var AW=`modulepreload`,jW=function(e){return`/`+e},MW={},NW=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=jW(t,n),t=s(t),t in MW)return;MW[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:AW,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},PW=[],FW=1.5,IW=20,LW=1.2,RW=24,zW=4,BW=[`#2e86ab`,`#3bb273`],VW=`#e4572e`,HW=`rgba(59, 178, 115, 0.18)`,UW=`#1d4ed8`,WW=`#ea580c`;function GW({recipeId:e,stepPath:t,view:n,bytesUrl:r,zoom:i=1,onTablePick:a,onRegionPick:o,steps:s=PW,hoveredStepId:c,onHoverStepId:l}){let[u,d]=(0,P.useState)(0),[f,p]=(0,P.useState)(`text`),[m,h]=(0,P.useState)({}),[g,_]=(0,P.useState)(void 0),[v,y]=(0,P.useState)(void 0),[b,x]=(0,P.useState)(void 0),S=(0,P.useRef)(null),C=(0,P.useRef)(null),[w,T]=(0,P.useState)(1),E=w*i,[D,ee]=(0,P.useState)(`white`),O=(0,P.useRef)(void 0),k=n.pages[u],te=(0,P.useMemo)(()=>nU(s,`page`,k?.number??-1),[s,k?.number]),ne=k===void 0?0:Math.ceil(k.width*FW),re=k===void 0?0:Math.ceil(k.height*FW),ie=Hte(e,t,m.header===void 0?void 0:{header:m.header,until:m.until,columns:m.columns}),A=(0,P.useMemo)(()=>ie.data?.matches.find(e=>e.page===k?.number),[ie.data,k?.number]),ae=v===void 0?void 0:_H(`page`,v.page,v.box),oe=gO(e,t,ae),se=oe.data?.matches.find(e=>e.page===v?.page),ce=se?.text;if((0,P.useEffect)(()=>{m.header!==void 0&&a(gH(m,t,void 0,n.pages.some(e=>e.rows.some(e=>e.running===!0))))},[m]),(0,P.useEffect)(()=>{let e=C.current;if(e===null||ne===0||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>{let t=e.clientWidth-IW;T(t>0?Math.min(1,t/ne):1)});return t.observe(e),()=>{t.disconnect()}},[ne]),(0,P.useEffect)(()=>{let e=S.current;if(e===null||k===void 0)return;let t=new AbortController;return sG(e,r,k.number,FW,t.signal).then(e=>{e!==void 0&&!t.signal.aborted&&ee(e)}).catch(e=>{t.signal.aborted||console.error(`PDF canvas: could not render the page`,e)}),()=>{t.abort()}},[r,k?.number]),k===void 0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(V,{children:`This PDF has no pages.`})});function j(e){let t=e.cells[0]?.text??``;if(f===`header`){h({header:mH(t)});return}f===`until`&&m.header!==void 0&&h(e=>({...e,until:mH(t)}))}function le(e){m.header!==void 0&&h(t=>({...t,columns:{...t.columns,[hH(e)]:mH(e)}}))}function ue(e,t,n){let r=v;if(t&&r!==void 0&&r.page===k.number){y({page:k.number,box:bH(r.box,e)});return}let i=n?.[0];y({page:k.number,box:e,...i?.anchor!==void 0&&{anchor:i.anchor},...n!==void 0&&{choices:n,choice:0}})}function de(e){let t=v,n=t?.choices?.[e];t!==void 0&&n!==void 0&&y({page:t.page,box:n.box,choices:t.choices,choice:e,...n.anchor!==void 0&&{anchor:n.anchor}})}function fe(e){l!==void 0&&O.current!==e&&(O.current=e,l(e))}function pe(e){if(f!==`text`)return;let t=ZW(e);if(b!==void 0){x({...b,currentX:t.x,currentY:t.y});return}let n=nG(k,t);_(n),fe(n===void 0?void 0:iU(vH(n),te)[0])}function me(e){if(f!==`text`||e.button!==0)return;let t=ZW(e);x({startX:t.x,startY:t.y,currentX:t.x,currentY:t.y})}function he(e){if(f!==`text`||b===void 0)return;let t=ZW(e);if(x(void 0),Math.abs(t.x-b.startX)+Math.abs(t.y-b.startY)>zW){ue(tG(k,b.startX,b.startY,t.x,t.y),e.shiftKey);return}let r=nG(k,t);if(r===void 0){e.shiftKey||y(void 0);return}if(e.shiftKey){ue(yH(fW(k,r)),!0);return}let i=kW(n.pages,k,r,fW(k,r));ue(i[0]?.box??yH(fW(k,r)),!1,i)}function ge(){if(ae===void 0||ce===void 0)return;let e=v?.anchor;if(e?.kind===`section`)return wH(e.heading,e.until,e.ignoreHeadersFooters,t,mW(e.matchName??(e.line===void 0?e.heading:`${e.heading} line ${String(e.line)}`)),{...e.line!==void 0&&{line:e.line},...e.match!==void 0&&{match:e.match}});if(e===void 0&&(v?.choices?.length??0)>1)return SH(ae,t,xH(ce));let n=ce.includes(`
17
+ `)?void 0:pW(ce);return n===void 0?e?.kind===`after`?TH(e.previous,t,mW(e.previous),e.lines):SH(ae,t,xH(ce)):CH(n.label,t,mW(n.label))}function _e(){let e=ge();e!==void 0&&(o(e),y(void 0))}function ve(e){let t=ge();t!==void 0&&ce!==void 0&&(e.dataTransfer.setData(Sk,Ck(t)),e.dataTransfer.setData(`text/plain`,ce),e.dataTransfer.effectAllowed=`copy`)}let M=f===`text`,N=v!==void 0&&v.page===k.number?v:void 0;return(0,F.jsxs)(I,{h:`full`,display:`flex`,flexDirection:`column`,children:[(0,F.jsxs)(W,{px:3,py:2,borderBottomWidth:`1px`,gap:3,flexShrink:0,flexWrap:`wrap`,children:[n.pages.length>1&&(0,F.jsx)(iG,{pages:n.pages.length,value:u,onChange:d}),n.pages.length>1&&(0,F.jsx)(V,{fontSize:`sm`,color:`fg.muted`,children:`of ${String(n.pages.length)}`}),(0,F.jsx)(rG,{label:`Text`,active:M,onClick:()=>{p(`text`)}}),(0,F.jsx)(rG,{label:`Header row`,tip:`The row that names the columns of a table: click it to say where the table starts.`,active:f===`header`,onClick:()=>{p(`header`)}}),(0,F.jsx)(rG,{label:`Last row (until)`,tip:`The line that comes right after the table: click it to say where the table stops.`,active:f===`until`,onClick:()=>{p(`until`)}}),(0,F.jsx)(rG,{label:`Column`,tip:`Click a column to collect everything under it.`,active:f===`column`,onClick:()=>{p(`column`)}}),(0,F.jsx)(V,{fontSize:`xs`,color:`fg.muted`,children:`${String(k.rowCount)} rows, ${String(k.cellCount)} cells${k.hasTextLayer?``:` — no text layer (a scan?)`}`}),M&&(0,F.jsx)(V,{fontSize:`xs`,color:`fg.muted`,visibility:v===void 0?`visible`:`hidden`,children:`Click a line (shift+click to extend) or drag a box, then add it to the recipe or drag it onto the Steps tab.`}),m.header!==void 0&&(0,F.jsx)(JC,{size:`sm`,colorPalette:`green`,children:`table: ${m.header}${m.until===void 0?``:` until ${m.until}`}`}),ie.data?.error!==void 0&&(0,F.jsx)(JC,{size:`sm`,colorPalette:`orange`,children:ie.data.error}),oe.data?.error!==void 0&&(0,F.jsx)(JC,{size:`sm`,colorPalette:`orange`,children:oe.data.error})]}),(0,F.jsx)(I,{ref:C,flex:`1`,minH:`0`,overflow:`auto`,position:`relative`,style:{background:D},onContextMenu:e=>{e.preventDefault()},children:(0,F.jsx)(I,{position:`relative`,width:`${String(Math.ceil(ne*E))}px`,height:`${String(Math.ceil(re*E))}px`,children:(0,F.jsxs)(I,{position:`absolute`,top:0,left:0,width:`${String(ne)}px`,height:`${String(re)}px`,style:{transform:`scale(${String(E)})`,transformOrigin:`top left`},children:[(0,F.jsx)(`canvas`,{ref:S,width:ne,height:re,style:{position:`absolute`,top:0,left:0}}),(0,F.jsxs)(`svg`,{"data-testid":`pdf-overlay`,width:ne,height:re,style:{position:`absolute`,top:0,left:0,cursor:M?`crosshair`:`pointer`},onMouseMove:pe,onMouseDown:me,onMouseUp:he,onMouseLeave:()=>{_(void 0),fe(void 0)},children:[te.map(e=>(0,F.jsx)(`rect`,{"data-testid":`recipe-region`,"data-step-id":e.id,"data-highlighted":e.id===c,...eG(e.box,k.height),fill:e.id===c?`rgba(234, 88, 12, 0.22)`:`rgba(234, 88, 12, 0.05)`,stroke:WW,strokeWidth:e.id===c?2:1,strokeDasharray:e.id===c?void 0:`4 3`,pointerEvents:`none`,children:(0,F.jsx)(`title`,{children:`In the recipe: ${e.id}`})},`recipe:${e.id}`)),k.rows.map((e,t)=>(0,F.jsx)(aG,{row:e,colour:e.cells[0]?.text!==void 0&&A?.headerRowIndex===t?VW:BW[t%2],highlighted:A?.matchedRowIndices.includes(t)??!1,scale:FW,pageHeight:k.height,cursor:M?`crosshair`:`pointer`,onClick:M?void 0:()=>{j(e)}},`${String(e.top)}:${String(e.bottom)}`)),f===`column`&&A!==void 0&&A.bands.map(e=>(0,F.jsx)(oG,{band:e,scale:FW,pageHeight:k.height,onClick:()=>{le(e.name)}},e.column)),M&&g!==void 0&&b===void 0&&(0,F.jsx)(`rect`,{"data-testid":`snap-target`,...$W(g,k.height),fill:`rgba(29, 78, 216, 0.08)`,stroke:UW,strokeWidth:1.5,strokeDasharray:`3 2`,pointerEvents:`none`}),N!==void 0&&(0,F.jsx)(`rect`,{"data-testid":`staged-region`,...eG(N.box,k.height),fill:`rgba(155, 93, 229, 0.12)`,stroke:`#9b5de5`,strokeWidth:1.5,pointerEvents:`none`}),N!==void 0&&se?.cells.map(e=>(0,F.jsx)(`rect`,{"data-testid":`staged-cell`,...$W(e,k.height),fill:`rgba(155, 93, 229, 0.28)`,pointerEvents:`none`},QW(e))),b!==void 0&&(0,F.jsx)(`rect`,{x:Math.min(b.startX,b.currentX),y:Math.min(b.startY,b.currentY),width:Math.abs(b.currentX-b.startX),height:Math.abs(b.currentY-b.startY),fill:`rgba(155, 93, 229, 0.2)`,stroke:`#9b5de5`,strokeDasharray:`4 2`,pointerEvents:`none`})]}),N!==void 0&&(0,F.jsx)(YH,{left:Math.min(N.box.x1,N.box.x2)*FW,top:qW(N.box,k.height),text:JW(N.anchor,ce),note:XW(N.anchor,ce),choices:N.choices?.map(e=>YW(e)),choice:N.choice,onChoose:de,loading:oe.isPending,onAdd:_e,onClear:()=>{y(void 0)},onDragStart:ve})]})})})]})}var KW=56;function qW(e,t){let n=(t-Math.max(e.y1,e.y2))*FW,r=(t-Math.min(e.y1,e.y2))*FW;return n>=KW?n-KW:r+6}function JW(e,t){if(t===void 0||e?.kind!==`section`||e.match===void 0)return t;let n=new RegExp(e.match,`i`).exec(t);return n===null?void 0:n[1]??n[0]}function YW(e){let{anchor:t}=e;return t?.kind===`section`?t.line===void 0?t.matchName===void 0?t.until===void 0?`The whole block below “${t.heading}”`:`The whole block between “${t.heading}” and “${t.until}”`:`Only the ${t.matchName} in the block`:`Only this line (line ${String(t.line)} of the block)`:t?.kind===`after`?t.lines>1?`The ${String(t.lines)} lines after “${t.previous}”`:`The line after “${t.previous}”`:`A fixed position on the page (breaks if the layout moves)`}function XW(e,t){let n=t!==void 0&&!t.includes(`
18
+ `)&&pW(t)!==void 0;return e?.kind===`section`&&e.line!==void 0?`Reads line ${String(e.line)} of what is between “${e.heading}” and ${e.until===void 0?`the end`:`“${e.until}”`}`:e?.kind===`section`&&e.matchName!==void 0?`Reads the ${e.matchName} in what is below “${e.heading}”, wherever it sits`:e?.kind===`section`?e.until===void 0?`Reads everything below “${e.heading}”`:`Reads what is between “${e.heading}” and “${e.until}”`:n?`Reads the value after its label`:e?.kind===`after`?e.lines>1?`Reads the ${String(e.lines)} lines after “${e.previous}”`:`Reads the line after “${e.previous}”`:`Reads a fixed position on the page: it breaks when the layout moves`}function ZW(e){let t=e.currentTarget.getBoundingClientRect(),n=Number(e.currentTarget.getAttribute(`width`)),r=t.width>0&&n>0?t.width/n:1;return{x:(e.clientX-t.left)/r,y:(e.clientY-t.top)/r}}function QW(e){return`staged:${String(e.x)}:${String(e.y)}`}function $W(e,t){return{x:e.x*FW,y:(t-e.y-e.height)*FW,width:Math.max(e.width,1)*FW,height:e.height*FW*LW}}function eG(e,t){let[n,r]=[Math.min(e.x1,e.x2),Math.max(e.x1,e.x2)],[i,a]=[Math.min(e.y1,e.y2),Math.max(e.y1,e.y2)];return{x:n*FW,y:(t-a)*FW,width:(r-n)*FW,height:(a-i)*FW}}function tG(e,t,n,r,i){return{x1:t/FW,y1:e.height-n/FW,x2:r/FW,y2:e.height-i/FW}}function nG(e,t){let n;for(let r of e.rows)for(let i of r.cells){let r=$W(i,e.height),a=Math.max(r.x-t.x,0,t.x-(r.x+r.width)),o=Math.max(r.y-t.y,0,t.y-(r.y+r.height)),s=Math.hypot(a,o);s<=RW&&(n===void 0||s<n.distance)&&(n={cell:i,distance:s})}return n?.cell}function rG({label:e,tip:t,active:n,onClick:r}){return(0,F.jsx)(V,{as:`button`,title:t,fontSize:`sm`,fontWeight:n?`semibold`:`normal`,color:n?`colorPalette.fg`:`fg`,colorPalette:`brand`,cursor:`pointer`,onClick:r,children:e})}function iG({pages:e,value:t,onChange:n}){let r=o_({items:Array.from({length:e},(e,t)=>({label:`Page ${String(t+1)}`,value:String(t)}))});return(0,F.jsxs)($w,{collection:r,size:`sm`,width:`140px`,value:[String(t)],onValueChange:e=>{n(Number(e.value[0]))},children:[(0,F.jsx)(oT,{}),(0,F.jsx)(aT,{children:(0,F.jsx)(eT,{children:(0,F.jsx)(rT,{})})}),(0,F.jsx)(tT,{children:(0,F.jsx)(nT,{children:r.items.map(e=>(0,F.jsx)(iT,{item:e,children:e.label},e.value))})})]})}function aG({row:e,colour:t,highlighted:n,scale:r,pageHeight:i,cursor:a,onClick:o}){return(0,F.jsxs)(`g`,{onClick:o,style:{cursor:a},children:[n&&e.cells.length>0&&(0,F.jsx)(`rect`,{x:Math.min(...e.cells.map(e=>e.x))*r,y:(i-e.top)*r,width:(Math.max(...e.cells.map(e=>e.x+e.width))-Math.min(...e.cells.map(e=>e.x)))*r,height:(e.top-e.bottom)*r,fill:HW}),e.cells.map(e=>(0,F.jsx)(`rect`,{x:e.x*r,y:(i-e.y-e.height)*r,width:Math.max(e.width,1)*r,height:e.height*r*LW,fill:`transparent`,stroke:t,strokeWidth:1.5},`${String(e.x)}:${String(e.y)}`))]})}function oG({band:e,scale:t,pageHeight:n,onClick:r}){return(0,F.jsx)(`rect`,{x:e.start*t,y:0,width:Math.max(e.end-e.start,1)*t,height:n*t,fill:`rgba(46, 134, 171, 0.08)`,stroke:`#2e86ab`,strokeDasharray:`4 2`,onClick:r,style:{cursor:`pointer`},children:(0,F.jsx)(`title`,{children:e.name})})}async function sG(e,t,n,r,i){let a=await NW(()=>import(`./pdf-DJOnIZdZ.js`),[]),o=await NW(()=>import(`./pdf.worker.min-D7i8o3wR.js`),[]);a.GlobalWorkerOptions.workerSrc=o.default;let s=a.getDocument({url:t}),c=await s.promise;try{let t=await c.getPage(n);if(i.aborted)return;let a=t.getViewport({scale:r});e.width=Math.ceil(a.width),e.height=Math.ceil(a.height);let o=e.getContext(`2d`);if(o===null)return;let s=t.render({canvas:e,canvasContext:o,viewport:a});return i.addEventListener(`abort`,()=>{s.cancel()}),await s.promise,cG(o)}finally{await s.destroy()}}function cG(e){try{let[t,n,r]=e.getImageData(1,1,1,1).data;return`rgb(${String(t)}, ${String(n)}, ${String(r)})`}catch{return}}function lG(e,t){return{kind:`card`,path:t,stepType:`goto`,sentence:[{kind:`word`,text:`Go to`},{kind:`code`,text:e}],custom:!1,step:{type:`goto`,url:e}}}function uG(e,t){return[{type:`goto`,url:e},...t]}function dG(e,t,n,r){return{...n,steps:uG(e,t),keep:[`cookies`],saveTo:r}}function fG(e){let t=e.start;if(!Array.isArray(t))return;let n=t[0];if(typeof n!=`object`||!n)return;let r=n.url;return typeof r==`string`?r:void 0}function pG(e,t){let n=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`)),r=n===-1?`.`:e.slice(0,n),i=n===-1||e[n]===void 0?`/`:e[n];return`${r}${i}storage${i}${t}-session.json`}function mG(e,t,n){let r=[`[data-oc-node] { cursor: ${e?`crosshair`:`inherit`}; }`,`[data-oc-node]:hover { outline: 2px solid #3182ce !important; outline-offset: -2px; }`];return n!==void 0&&n!==``&&r.push(`${n} { outline: 2px solid #dd6b20 !important; outline-offset: -2px; background: rgba(221,107,32,0.08) !important; }`),t?r.push(`[data-oc-overlay] { display: revert !important; opacity: 0.5 !important; outline: 1px dashed #ed8936 !important; }`):r.push(`[data-oc-overlay] { display: none !important; }`,`html:has([data-oc-overlay]), body:has([data-oc-overlay]) { overflow: auto !important; position: static !important; }`),t&&r.push(`[data-oc-hidden] { display: revert !important; visibility: visible !important; opacity: 0.5 !important; outline: 1px dashed #ed8936 !important; }`),r.join(`
19
+ `)}var hG=1e3,gG=`data-oc-node`,_G=`opencraw-picker-style`;function vG({html:e,pickMode:t,showHidden:n,hoveredSelector:r,onHoverNode:i,onPickNode:a}){let o=(0,P.useRef)(null),s=(0,P.useRef)(null),[c,l]=(0,P.useState)({width:0,height:0}),u=(0,P.useRef)({onHoverNode:i,onPickNode:a});u.current={onHoverNode:i,onPickNode:a},(0,P.useEffect)(()=>{let e=o.current;if(e===null)return;let t,n=e=>{u.current.onHoverNode(bG(e.target))},r=()=>{u.current.onHoverNode(void 0)},i=e=>{yG(e.target)!==void 0&&e.preventDefault();let t=bG(e.target);t!==void 0&&(e.preventDefault(),e.stopPropagation(),u.current.onPickNode(t))},a=e=>{e.preventDefault()},s=()=>{let o=e.contentDocument;o!==null&&(o.addEventListener(`mouseover`,n),o.addEventListener(`mouseout`,r),o.addEventListener(`click`,i,{capture:!0}),o.addEventListener(`contextmenu`,a),t=()=>{o.removeEventListener(`contextmenu`,a),o.removeEventListener(`mouseover`,n),o.removeEventListener(`mouseout`,r),o.removeEventListener(`click`,i,{capture:!0})})};return e.addEventListener(`load`,s),()=>{e.removeEventListener(`load`,s),t?.()}},[e]),(0,P.useEffect)(()=>{let e=s.current;if(e===null||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>{l({width:e.clientWidth,height:e.clientHeight})});return t.observe(e),()=>{t.disconnect()}},[]),(0,P.useEffect)(()=>{let e=o.current?.contentDocument;if(e==null)return;let i=e.getElementById(_G);i===null&&(i=e.createElement(`style`),i.id=_G,e.head?.append(i)),i.textContent=mG(t,n,r)});let d=c.width>0,f=d?Math.max(c.width,hG):0,p=d?c.width/f:1,m=d&&p<1?{width:`${String(f)}px`,height:`${String(c.height/p)}px`,transform:`scale(${String(p)})`,transformOrigin:`top left`}:{width:`100%`,height:`100%`};return(0,F.jsx)(`div`,{ref:s,style:{width:`100%`,height:`100%`,overflow:`hidden`},children:(0,F.jsx)(`iframe`,{ref:o,title:`Snapshot`,sandbox:`allow-same-origin`,srcDoc:e,style:{...m,border:`none`,background:`white`}})})}function yG(e){return(e?.nodeType===Node.ELEMENT_NODE?e.closest(`a[href], area[href]`):null)??void 0}function bG(e){return(e?.nodeType===Node.ELEMENT_NODE?e.closest(`[${CSS.escape(gG)}]`):null)?.getAttribute(gG)??void 0}var xG=[],SG={object:`purple.fg`,array:`purple.fg`,element:`purple.fg`,string:`green.fg`,number:`orange.fg`,boolean:`blue.fg`,null:`fg.muted`},CG=(0,P.memo)(EG),wG=6;function TG(e){let t=new Set,n=(e,r)=>{if(e.children.length===0)return;let i=/^\[?(\d+)\]?$/.exec(e.label)?.[1];if(i!==void 0&&Number(i)>0||r>=wG){t.add(e.id);return}for(let t of e.children)n(t,r+1)};return n(e,0),t}function EG({tree:e,onPick:t,steps:n=xG,hoveredStepId:r,onHoverStepId:i}){let[a,o]=(0,P.useState)(()=>TG(e.root));function s(e){o(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return(0,F.jsxs)(I,{h:`full`,overflow:`auto`,fontFamily:`mono`,fontSize:`xs`,py:2,children:[e.namespaces!==void 0&&Object.keys(e.namespaces).length>0&&(0,F.jsxs)(W,{px:2,pb:2,gap:2,flexWrap:`wrap`,children:[(0,F.jsx)(V,{color:`fg.muted`,children:`Namespaces:`}),Object.entries(e.namespaces).map(([e,t])=>(0,F.jsx)(JC,{size:`xs`,colorPalette:`gray`,children:`${e}: ${t}`},e))]}),(0,F.jsx)(DG,{node:e.root,depth:0,collapsed:a,onToggle:s,onPick:t,steps:n,hoveredStepId:r,onHoverStepId:i})]})}function DG({node:e,depth:t,collapsed:n,onToggle:r,onPick:i,steps:a,hoveredStepId:o,onHoverStepId:s}){let c=e.children.length>0,l=n.has(e.id),u=e.valueType!==`object`&&e.valueType!==`array`&&e.valueType!==`element`,d=eU(e,a),f=o!==void 0&&d.includes(o);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(W,{"data-testid":`tree-node`,"data-highlighted":f,"data-step-ids":d.length===0?void 0:d.join(` `),gap:1,pl:`${t*14+4}px`,pr:2,minH:`20px`,cursor:`pointer`,bg:f?`orange.subtle`:void 0,_hover:{bg:f?`orange.subtle`:`bg.emphasized`},onClick:()=>{i(e,`value`)},onMouseEnter:s===void 0?void 0:()=>{s(d[0])},onMouseLeave:s===void 0?void 0:()=>{s(void 0)},children:[c?(0,F.jsx)(V,{as:`button`,w:`12px`,flexShrink:0,color:`fg.muted`,onClick:t=>{t.stopPropagation(),r(e.id)},children:l?`▸`:`▾`}):(0,F.jsx)(I,{w:`12px`,flexShrink:0}),(0,F.jsx)(V,{as:`span`,color:SG[e.valueType],fontWeight:`medium`,children:e.label}),u&&e.preview!==void 0&&(0,F.jsx)(V,{as:`span`,color:`fg.muted`,truncate:!0,children:e.preview}),d.map(e=>(0,F.jsx)(JC,{size:`xs`,colorPalette:`orange`,variant:f?`solid`:`subtle`,title:`Already in the recipe: the step reading this`,flexShrink:0,children:e},e)),e.listPath!==void 0&&(0,F.jsx)(JC,{as:`button`,size:`xs`,colorPalette:`brand`,onClick:t=>{t.stopPropagation(),i(e,`list`)},title:`Collect this for every one of the ${String(e.listCount??0)} items of the list`,children:`[*] ×${String(e.listCount??0)}`}),u&&e.jsonpath!==void 0&&(0,F.jsx)(V,{as:`button`,fontSize:`2xs`,color:`fg.muted`,_hover:{color:`fg`,textDecoration:`underline`},onClick:t=>{t.stopPropagation(),i(e,`next`)},title:`Use this value to reach the next page of results (for data that comes in pages)`,children:`next →`})]}),c&&!l&&e.children.map(e=>(0,F.jsx)(DG,{node:e,depth:t+1,collapsed:n,onToggle:r,onPick:i,steps:a,hoveredStepId:o,onHoverStepId:s},e.id))]})}var OG=100,kG=`img, picture, video, canvas, svg, iframe, object, embed, input, select, textarea, table`,AG=`h1, h2, h3, h4, h5, h6, li, a[href]`;function jG(e){let t=new DOMParser().parseFromString(e,`text/html`).body;for(let e of t.querySelectorAll(`script, style, noscript, template`))e.remove();return(t.textContent??``).trim().length>=OG||t.querySelector(`${kG}, ${AG}`)!==null}function MG({zoom:e,zoomIn:t,zoomOut:n,reset:r}){return(0,F.jsxs)(W,{gap:0,role:`group`,"aria-label":`Zoom`,flexShrink:0,children:[(0,F.jsx)(ew,{size:`2xs`,variant:`outline`,"aria-label":`Zoom out`,title:`Zoom out (ctrl + wheel)`,onClick:n,children:`−`}),(0,F.jsx)(ew,{size:`2xs`,variant:`outline`,"aria-label":`Reset zoom`,title:`Back to 100%`,minW:`3.5em`,onClick:r,children:`${String(Math.round(e*100))}%`}),(0,F.jsx)(ew,{size:`2xs`,variant:`outline`,"aria-label":`Zoom in`,title:`Zoom in (ctrl + wheel)`,onClick:t,children:`+`})]})}var NG=[.5,.67,.8,1,1.25,1.5,2,3];function PG(e,t){let n=NG.findIndex(t=>t>=e),r=n===-1?NG.length-1:n;return NG[Math.min(Math.max(r+t,0),NG.length-1)]??1}function FG(e){let[t,n]=(0,P.useState)(1),r=(0,P.useCallback)(()=>{n(e=>PG(e,1))},[]),i=(0,P.useCallback)(()=>{n(e=>PG(e,-1))},[]),a=(0,P.useCallback)(()=>{n(1)},[]);return(0,P.useEffect)(()=>{let t=e.current;if(t===null)return;let n=e=>{e.ctrlKey&&(e.preventDefault(),e.deltaY<0?r():i())};return t.addEventListener(`wheel`,n,{passive:!1}),()=>{t.removeEventListener(`wheel`,n)}},[e,r,i]),{zoom:t,zoomIn:r,zoomOut:i,reset:a}}function IG(e,t){let n=zD(e,t)?.step.selector;return typeof n==`string`?n:void 0}function LG(e,t,n){if(e!==void 0&&t!==void 0)for(let r of VD(e)){let e=r.step.selector,i=r.step.id;if(typeof e==`string`&&typeof i==`string`&&sk(t,e).has(n))return i}}var RG=`start`,zG=new Set([`json`,`yaml`,`jsonl`,`xml`]),BG=new Set([`csv`,`xlsx`]),VG=new Set([`pptx`]);function HG({recipe:e,onSaveOutline:t,onSaveRecipe:n}){let r=e?.id,i=Ite(r,r===void 0?void 0:RG),a=hO(),[o,s]=(0,P.useState)(!1),[c,l]=(0,P.useState)(`tree`),u=XD(),d=i.data?.format,f=d!==void 0&&zG.has(d),p=d===`pdf`,m=d!==void 0&&BG.has(d),h=d!==void 0&&VG.has(d),g=!f&&!p&&!m&&!h,_=i.data?.html,v=(0,P.useMemo)(()=>_===void 0||jG(_),[_]),y=Bte(r,r===void 0?void 0:RG,f),b=Vte(r,r===void 0?void 0:RG,p),[x,S]=(0,P.useState)(void 0),C=_O(r,r===void 0?void 0:RG,m,x),w=yO(r,r===void 0?void 0:RG,h),T=G(e=>e.pickTarget),E=G(e=>e.showHidden),D=G(e=>e.hoveredStepId),ee=G(e=>e.startPicking),O=G(e=>e.stopPicking),k=G(e=>e.registerPick),te=G(e=>e.setShowHidden),ne=G(e=>e.setHoveredNodeId),re=G(e=>e.setHoveredStepId),ie=(0,P.useMemo)(()=>IG(e?.outline,D),[e?.outline,D]),A=(0,P.useMemo)(()=>$H(e?.outline),[e?.outline]),ae=(0,P.useRef)(Te);ae.current=Te;let oe=(0,P.useCallback)((e,t)=>{ae.current(e,t)},[]),se=t=>{ne(t),re(t===void 0?void 0:LG(e?.outline,i.data?.html,t))},ce=nO(e=>e.recipeId),j=nO(e=>e.active),le=nO(e=>e.cards.length),ue=nO(e=>e.stoppedSteps),de=nO(e=>e.error),fe=nO(e=>e.dismissStopped),pe=xO(),me=SO(),he=ce===r&&j,ge=ce===r?ue:void 0,[_e,ve]=(0,P.useState)(void 0),M=e=>{ve(e===void 0?void 0:{text:e,ok:!0})},N=e=>{ve(e===void 0?void 0:{text:e,ok:!1})},ye=(0,P.useRef)(void 0),be=(0,P.useRef)(null),xe=FG(be),Se=(0,P.useRef)(void 0),Ce=T!==void 0&&T.recipeId===r;(0,P.useEffect)(()=>{Se.current=void 0,S(void 0)},[r]);async function we(t){if(r===void 0)return;Ce||(ye.current=void 0,ee(r,RG));let n=k(t);if(n.kind===`first`){let n=e?.outline===void 0?void 0:TD(e.outline.steps),i=await a.mutateAsync({recipeId:r,path:RG,nodeIds:[t],...n!==void 0&&{within:n}});if(i.kind===`item-field`){ee(r,RG),await ke(e=>{let t=Ete(e,i.field);return t===void 0?e:(M(`Added to the list: ${i.field.selector}`),t)});return}if(i.kind!==`field`){N(i.kind===`unsupported`?i.reason:void 0);return}await ke(e=>(ye.current=DD(e),M(`Read card: ${i.field.selector} (${i.field.matches} match${i.field.matches===1?``:`es`})`),OD(e,void 0,[xD(i.field,`steps.${e.length}`)])));return}let i=await a.mutateAsync({recipeId:r,path:RG,nodeIds:[n.firstNodeId,t]});if(i.kind!==`list`){N(i.kind===`unsupported`?i.reason:void 0);return}await ke(e=>{let t=ye.current;ye.current=void 0;let n=t??DD(e);return M(`List: ${i.item.selector} (${i.item.matches} items) → ${i.field.selector}`),OD(e,t,Cte(i,`steps.${n}`))})}async function Te(e,t){if(r!==void 0)try{if(t===`next`){await ke(t=>{let n=Ste(e,`steps.${t.length}`);return M(`Paginate: next from ${e.jsonpath}`),OD(t,void 0,[n])});return}await ke(n=>{if(t===`list`){let t=Tte(n,e);if(t!==void 0)return M(`Added to the list: ${String(e.listPath)}`),t;let r=wte(e,`steps.${DD(n)}`);if(r!==void 0)return M(`List: ${String(e.listPath)} (${String(e.listCount??0)} items)`),OD(n,void 0,r)}let r=xte(e,`steps.${n.length}`,{generalize:t===`list`,namespaces:y.data?.namespaces});return M(`Read card: ${r.step.selector}${t===`list`?` (${String(e.listCount??0)} items)`:``}`),OD(n,void 0,[r])})}catch(e){N(e instanceof Error?e.message:String(e))}}async function Ee(e){await ke(t=>{let n=Se.current,r=n??DD(t);return Se.current=r,M(`table: ${String(e.step.selector)}`),OD(t,n,[{...e,path:`steps.${r}`}])})}async function De(e){await ke(t=>(M(`${String(e.step.kind)}: ${String(e.step.id)} ← ${String(e.step.selector)}`),OD(t,void 0,[{...e,path:`steps.${t.length}`}])))}async function Oe(e){await ke(t=>(M(`jsonpath: ${String(e.step.selector)}`),OD(t,void 0,[{...e,path:`steps.${t.length}`}])))}async function ke(n){if(t===void 0||e?.outline===void 0)return;let r=n(e.outline.steps);await t(e.file,{...e.outline,steps:r})}function Ae(){if(r===void 0||e?.outline===void 0)return;let t=fG(e.outline.recipe);if(t===void 0){N(`this recipe has no start point to record from`);return}pe.mutate({recipeId:r,startUrl:t})}async function je(){if(ge===void 0||e?.outline===void 0)return;let n=nO.getState().startUrl;if(n===void 0)return;let i=e.outline.recipe.session,a=UG(i)?i:{},o=a.bootstrap,s=UG(o)?o:void 0,c=pG(e.file,r??`recipe`),l={...a,bootstrap:dG(n,ge,s,c)};await t?.(e.file,{...e.outline,recipe:{...e.outline.recipe,session:l}}),M(`Made the login: session.bootstrap, ${ge.length} step${ge.length===1?``:`s`}`),fe()}async function Me(){if(ge===void 0||e?.outline===void 0)return;let t=nO.getState().startUrl;if(t===void 0)return;let n=nO.getState().cards;await ke(e=>OD(e,void 0,[lG(t,`steps.${e.length}`),...n.map(e=>e.node)])),M(`Kept as steps: ${ge.length} step${ge.length===1?``:`s`}`),fe()}if(r===void 0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(V,{children:`Pick a recipe to see its snapshot here.`})});function Ne(){if(Ce){O();return}ye.current=void 0,ee(r,RG)}return(0,F.jsxs)(I,{h:`full`,display:`flex`,flexDirection:`column`,children:[(0,F.jsxs)(W,{px:3,py:2,borderBottomWidth:`1px`,gap:3,flexShrink:0,minH:`38px`,children:[!f&&!p&&!m&&!h&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(V,{as:`button`,fontSize:`sm`,fontWeight:Ce?`semibold`:`normal`,whiteSpace:`nowrap`,color:Ce?`colorPalette.fg`:`fg`,colorPalette:`brand`,cursor:`pointer`,title:`Pick data from the page: click here, then click the text you want to collect (click two similar things to collect a whole list)`,onClick:Ne,children:Ce?`Cancel pick`:`Read`}),(0,F.jsxs)(_T,{checked:E,onCheckedChange:e=>{te(e.checked)},size:`sm`,title:`Also show the parts of the page that are normally out of sight (menus, pop-ups, tabs that are not open)`,children:[(0,F.jsx)(xT,{}),(0,F.jsx)(bT,{}),(0,F.jsx)(vT,{fontSize:`sm`,whiteSpace:`nowrap`,children:`Show hidden`})]}),(0,F.jsx)(V,{as:`button`,fontSize:`sm`,fontWeight:o?`semibold`:`normal`,color:o?`colorPalette.fg`:`fg`,colorPalette:`purple`,cursor:`pointer`,title:`See how the page is built, and the data it loads: for things that are hard to click`,onClick:()=>{s(e=>!e)},children:o?`Hide inspector`:`Inspect`}),(0,F.jsx)(V,{as:`button`,fontSize:`sm`,fontWeight:he?`semibold`:`normal`,color:he?`red.fg`:`fg`,colorPalette:`red`,cursor:`pointer`,title:`Open a real browser window and record what you click and type (to log in, open a menu or fill a form), as steps`,onClick:()=>{he?me.mutate():Ae()},children:he?`Stop recording`:`Record`})]}),f&&(d===`json`||d===`yaml`)&&(0,F.jsx)(lH,{value:c,onChange:l}),f&&(0,F.jsx)(V,{fontSize:`sm`,color:`fg.muted`,children:`Click a value to collect it. Click [*] beside a field to collect it for every item of a list.`}),(i.isFetching||f&&y.isFetching||p&&b.isFetching||m&&C.isFetching||h&&w.isFetching)&&(0,F.jsx)(XC,{size:`xs`}),_e!==void 0&&(0,F.jsx)(JC,{size:`sm`,colorPalette:_e.ok?`green`:`orange`,children:_e.text}),(0,F.jsx)(I,{ml:`auto`,children:(0,F.jsx)(MG,{...xe})})]}),he&&(0,F.jsxs)(W,{px:3,py:2,bg:`red.subtle`,color:`red.fg`,fontSize:`sm`,gap:3,flexShrink:0,"data-testid":`recording-banner`,children:[(0,F.jsx)(I,{w:`8px`,h:`8px`,borderRadius:`full`,bg:`red.solid`,flexShrink:0}),(0,F.jsx)(V,{children:`Recording — a browser window opened for you to drive; interact with it, not with the snapshot below.`}),(0,F.jsxs)(JC,{size:`sm`,colorPalette:`red`,children:[le,` step`,le===1?``:`s`]})]}),de!==void 0&&ce===r&&(0,F.jsx)(I,{px:3,py:1,bg:`red.subtle`,color:`red.fg`,fontSize:`sm`,flexShrink:0,children:de}),ge!==void 0&&(0,F.jsxs)(W,{px:3,py:2,borderBottomWidth:`1px`,gap:3,flexShrink:0,"data-testid":`recording-stopped-bar`,children:[(0,F.jsxs)(V,{fontSize:`sm`,children:[`Recording stopped: `,ge.length,` step`,ge.length===1?``:`s`,` recorded.`]}),(0,F.jsx)(ew,{size:`xs`,colorPalette:`brand`,onClick:()=>{je()},disabled:ge.length===0,children:`Make this the login`}),(0,F.jsx)(ew,{size:`xs`,variant:`outline`,onClick:()=>{Me()},disabled:ge.length===0,children:`Keep as steps`}),(0,F.jsx)(ew,{size:`xs`,variant:`ghost`,onClick:fe,children:`Discard`})]}),i.data?.notice!==void 0&&(0,F.jsx)(cH,{text:i.data.notice}),g&&i.data!==void 0&&i.data.notice===void 0&&!v&&(0,F.jsx)(sH,{}),(0,F.jsxs)(I,{ref:be,flex:`1`,minH:`0`,overflow:`auto`,style:p?void 0:{zoom:xe.zoom},onContextMenu:e=>{e.preventDefault()},children:[f&&c===`text`&&i.data!==void 0&&(0,F.jsx)(vG,{html:i.data.html,pickMode:!1,showHidden:!1,onHoverNode:()=>{},onPickNode:()=>{}}),f&&c===`tree`&&y.data!==void 0&&(0,F.jsx)(CG,{tree:y.data,onPick:oe,steps:A,hoveredStepId:D,onHoverStepId:re}),f&&y.isError&&(0,F.jsx)(I,{p:4,color:`fg.error`,children:(0,F.jsx)(V,{children:y.error.message})}),p&&b.data!==void 0&&(0,F.jsx)(GW,{recipeId:r,stepPath:RG,view:b.data,zoom:xe.zoom,bytesUrl:u.pdfBytesUrl(r,RG,i.data?.baseUrl),onTablePick:e=>{Ee(e)},onRegionPick:e=>{De(e)},steps:A,hoveredStepId:D,onHoverStepId:re},u.pdfBytesUrl(r,RG,i.data?.baseUrl)),p&&b.isError&&(0,F.jsx)(I,{p:4,color:`fg.error`,children:(0,F.jsx)(V,{children:b.error.message})}),m&&C.data!==void 0&&(0,F.jsx)(UU,{recipeId:r,stepPath:RG,view:C.data,onTablePick:e=>{Ee(e)},onCellPick:e=>{De(e)},steps:A,hoveredStepId:D,onHoverStepId:re,csvOverride:x,onCsvOverrideChange:S}),m&&C.isError&&(0,F.jsx)(I,{p:4,color:`fg.error`,children:(0,F.jsx)(V,{children:C.error.message})}),h&&w.data!==void 0&&(0,F.jsx)(gU,{recipeId:r,stepPath:RG,view:w.data,onTablePick:e=>{Ee(e)},onChartPick:e=>{Oe(e)},onRegionPick:e=>{De(e)},steps:A,hoveredStepId:D,onHoverStepId:re}),h&&w.isError&&(0,F.jsx)(I,{p:4,color:`fg.error`,children:(0,F.jsx)(V,{children:w.error.message})}),!f&&!p&&!m&&!h&&i.data!==void 0&&!o&&(0,F.jsx)(vG,{html:i.data.html,pickMode:Ce,showHidden:E,hoveredSelector:ie,onHoverNode:se,onPickNode:e=>{we(e)}}),!f&&!p&&!m&&!h&&i.data!==void 0&&o&&(0,F.jsxs)(lT,{panels:[{id:`snapshot`,minSize:15},{id:`inspect`,minSize:20}],h:`full`,children:[(0,F.jsx)(uT,{id:`snapshot`,overflow:`hidden`,children:(0,F.jsx)(vG,{html:i.data.html,pickMode:Ce,showHidden:E,hoveredSelector:ie,onHoverNode:se,onPickNode:e=>{we(e)}})}),(0,F.jsx)(pT,{id:`snapshot:inspect`}),(0,F.jsx)(uT,{id:`inspect`,overflow:`hidden`,children:(0,F.jsx)(vk,{recipeId:r,recipe:e,snapshot:i.data,onSaveOutline:t,onSaveRecipe:n})})]}),i.isError&&(0,F.jsxs)(I,{p:4,color:`fg.error`,role:`alert`,children:[(0,F.jsx)(V,{fontWeight:`semibold`,children:`Could not take a snapshot of this recipe's page.`}),(0,F.jsx)(V,{children:KD(i.error.message)})]}),!i.isFetching&&!i.isError&&i.data===void 0&&(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(V,{children:`Run a sample, or open a recipe, to see its snapshot here.`})})]})]})}function UG(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var WG=1024,GG=0,KG=class{constructor(e,t){this.from=e,this.to=t}},qG=class{constructor(e={}){this.id=GG++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=XG.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};qG.closedBy=new qG({deserialize:e=>e.split(` `)}),qG.openedBy=new qG({deserialize:e=>e.split(` `)}),qG.group=new qG({deserialize:e=>e.split(` `)}),qG.isolate=new qG({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),qG.contextHash=new qG({perNode:!0}),qG.lookAhead=new qG({perNode:!0}),qG.mounted=new qG({perNode:!0});var JG=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[qG.mounted.id]}},YG=Object.create(null),XG=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):YG,r=+!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e==`string`){if(this.name==e)return!0;let t=this.prop(qG.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(qG.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};XG.none=new XG(``,Object.create(null),0,8);var ZG=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new XG(e.name,r,e.id,e.flags):e)}return new e(n)}},QG=new WeakMap,$G=new WeakMap,eK;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(eK||={});var tK=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=JG.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new hK(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new hK(QG.get(this)||this.topNode);return r.moveTo(e,t),QG.set(this,r._tree),r}get topNode(){return new sK(this,0,0,null)}resolve(e,t=0){let n=aK(QG.get(this)||this.topNode,e,t,!1);return QG.set(this,n),n}resolveInner(e,t=0){let n=aK($G.get(this)||this.topNode,e,t,!0);return $G.set(this,n),n}resolveStack(e,t=0){return mK(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&eK.IncludeAnonymous)>0;for(let e=this.cursor(a|eK.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(t={}){return this.children.length<=8?this:bK(XG.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(XG.none,t,n,r)))}static build(e){return _K(e)}};tK.empty=new tK(XG.none,[],[],0);var nK=class e{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new e(this.buffer,this.index)}},rK=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return XG.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(iK(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function iK(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function aK(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof sK&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:eK.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof sK&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var oK=class{cursor(e=0){return new hK(this,e)}getChild(e,t=null,n=null){let r=cK(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return cK(this,e,t,n)}resolve(e,t=0){return aK(this,e,t,!1)}resolveInner(e,t=0){return aK(this,e,t,!0)}matchContext(e){return lK(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},sK=class e extends oK{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from,d;if(a&eK.EnterBracketed&&l instanceof tK&&(d=JG.get(l))&&!d.overlay&&d.bracketed&&r>=u&&r<=u+l.length||iK(i,r,u,u+l.length)){if(l instanceof rK){if(a&eK.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new dK(new uK(o,l,t,u),null,e)}else if(a&eK.IncludeAnonymous||!l.type.isAnonymous||gK(l)){let s;if(!(a&eK.IgnoreMounts)&&(s=JG.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&eK.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i,a)}}}if(a&eK.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let i;if(!(r&eK.IgnoreOverlays)&&(i=JG.get(this._tree))&&i.overlay){let a=t-this.from,o=r&eK.EnterBracketed&&i.bracketed;for(let{from:t,to:r}of i.overlay)if((n>0||o?t<=a:t<a)&&(n<0||o?r>=a:r>a))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function cK(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function lK(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var uK=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},dK=class e extends oK{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&eK.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new tK(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function fK(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof sK&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new pK(i,n)}var pK=class{constructor(e,t){this.heads=e,this.node=t}get next(){return fK(this.heads)}};function mK(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof sK?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=JG.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new sK(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(aK(o,t,n,!1))}}return i?fK(i):r}var hK=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~eK.EnterBracketed,e instanceof sK)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof sK?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&eK.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&eK.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&eK.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&eK.IncludeAnonymous||e instanceof rK||!e.type.isAnonymous||gK(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new dK(this.buffer,t,this.stack[e]);return this.bufferNode=new dK(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return lK(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return lK(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function gK(e){return e.children.some(e=>e instanceof rK||!e.type.isAnonymous||gK(e))}function _K(e){let{buffer:t,nodeSet:n,maxBufferLength:r=WG,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new nK(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,b){let{id:x,start:S,end:C,size:w}=o,T=l,E=c;if(w<0){if(o.next(),w==-1){let t=i[x];_.push(t),v.push(S-e);return}if(w==-3){c=x;return}if(w==-4){l=x;return}throw RangeError(`Unrecognized record size: ${w}`)}let D=s[x],ee,O,k=S-e;if(C-S<=r&&(O=h(o.pos-t,y))){let t=new Uint16Array(O.size-O.skip),r=o.pos-O.size,i=t.length;for(;o.pos>r;)i=g(O.start,t,i);ee=new rK(t,C-O.start,n),k=O.start-e}else{let e=o.pos-w;o.next();let t=[],n=[],i=x>=a?x:-1,s=0,c=C;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,S,s,o.end,c,i,T,E),s=t.length,c=o.end),o.next()):b>2500?d(S,e,t,n):u(S,e,t,n,i,b+1);if(i>=0&&s>0&&s<t.length&&p(t,n,S,s,S,c,i,T,E),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(D,E);ee=bK(D,t,n,0,t.length,0,C-S,e,e)}else ee=m(D,t,n,C-S,T-C,E)}_.push(ee),v.push(k)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new rK(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof tK){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(qG.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[qG.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[qG.lookAhead,i];o=o?[e].concat(o):[e]}return new tK(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};scan:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0){if(n.size==-3||n.size==-4)d+=4;else break scan}else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new tK(s[e.topID],_.reverse(),v.reverse(),y)}var vK=new WeakMap;function yK(e,t){if(!e.isAnonymous||t instanceof rK||t.type!=e)return 1;let n=vK.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof tK)){n=1;break}n+=yK(e,r)}vK.set(t,n)}return n}function bK(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=yK(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=yK(e,t[s]);for(s++;s<i;s++){let n=yK(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(bK(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var xK=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},SK=class{startParse(e,t,n){return typeof e==`string`&&(e=new CK(e)),n=n?n.length?n.map(e=>new KG(e.from,e.to)):[new KG(0,0)]:[new KG(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},CK=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};new qG({perNode:!0});var wK=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new TK(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){n<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from;n<r.minRepeatTerm&&s==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&this.buffer[e-4]==0&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new EK(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216)){if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new TK(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},TK=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},EK=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},DK=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}};function OK(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var kK=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},AK=new kK,jK=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=AK,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.next=this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?-1:this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=AK,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},MK=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;PK(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};MK.prototype.contextual=MK.prototype.fallback=MK.prototype.extend=!1;var NK=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?OK(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(PK(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};NK.prototype.contextual=MK.prototype.fallback=MK.prototype.extend=!1;function PK(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||IK(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function FK(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function IK(e,t,n,r){let i=FK(n,r,t);return i<0||FK(n,r,e)<i}var LK=typeof process<`u`&&/\bparse\b/.test({}.LOG),RK=null;function zK(e,t,n){let r=e.cursor(eK.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}var BK=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?zK(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?zK(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],a=this.start[t]+n.positions[r];if(a>e)return this.nextStart=a,null;if(i instanceof tK){if(a==e){if(a<this.safeFrom)return null;let e=a+i.length;if(e<=this.safeTo){let t=i.prop(qG.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,a+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}},VK=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new kK)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if((!n||c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new kK,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new kK,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535){if(o[s+1]==1)s=KK(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(KK(o,s+2),t,n,r));break}}o[s]==t&&(r=this.putAction(KK(o,s+1),t,n,r))}return r}},HK=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new jK(t,r),this.tokens=new VK(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[wK.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new BK(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&qK(r);if(e)return LK&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw LK&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return LK&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500){if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=LK?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let o=this.fragments.nodeAt(r);o;){let r=this.parser.nodeSet.types[o.type.id]==o.type?i.getGoto(e.state,o.type.id):-1;if(r>-1&&o.length&&(!t||(o.prop(qG.contextHash)||0)==n))return e.useNode(o,r),LK&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(o.type.id)})`),!0;if(!(o instanceof tK)||o.children.length==0||o.positions[0]>0)break;let s=o.children[0];if(s instanceof tK&&o.positions[0]==0)o=s;else break}}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),LK&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),LK&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return UK(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=LK?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),LK&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(LK&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)LK&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))LK&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),LK&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),UK(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),tK.build({buffer:DK.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(RK||=new WeakMap).get(e);return t||RK.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function UK(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var WK=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},GK=class e extends SK{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(` `);this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push(``);let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=qG[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let a=t[n+-r];for(let o=-r;o>0;o--)i(t[n++],e,a);n++}}}this.nodeSet=new ZG(t.map((t,i)=>XG.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:i==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=WG;let a=OK(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(JK),this.states=OK(e.states,Uint32Array),this.data=OK(e.stateData),this.goto=OK(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new MK(a,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new HK(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535){if(n[i+1]==1)a=n[i=KK(n,i+2)];else if(n[i+1]==2)return KK(n,i+2);else break}if(a==t||a==0)return KK(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=KK(this.data,n+2);else break}r=t(KK(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=KK(this.data,n+2);else break}if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=JK(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new WK(e,n,r)}static deserialize(t){return new e(t)}};function KK(e,t){return e[t]|e[t+1]<<16}function qK(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function JK(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}var YK=0,XK=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=YK++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new QK(e);return e=>e.modified.indexOf(t)>-1?e:QK.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},ZK=0,QK=class e{constructor(e){this.name=e,this.instances=[],this.id=ZK++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&$K(n,e.modified));if(r)return r;let i=[],a=new XK(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=eq(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function $K(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function eq(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function tq(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new rq(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return nq.add(t)}var nq=new qG({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth<=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new rq(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}}),rq=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};rq.empty=new rq([],2,null);function iq(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}function aq(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+` `+e:e)}return n}function oq(e,t,n,r=0,i=e.length){let a=new sq(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,``,a.highlighters),a.flush(i)}var sq=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=``}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,i){let{type:a,from:o,to:s}=e;if(o>=n||s<=t)return;a.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(a)));let c=r,l=cq(e)||rq.empty,u=aq(i,l.tags);if(u&&(c&&(c+=` `),c+=u,l.mode==1&&(r+=(r?` `:``)+u)),this.startSpan(Math.max(t,o),c),l.opaque)return;let d=e.tree&&e.tree.prop(qG.mounted);if(d&&d.overlay){let a=e.node.enter(d.overlay[0].from+o,1),l=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),u=e.firstChild();for(let f=0,p=o;;f++){let m=f<d.overlay.length?d.overlay[f]:null,h=m?m.from+o:s,g=Math.max(t,p),_=Math.min(n,h);if(g<_&&u)for(;e.from<_&&(this.highlightRange(e,g,_,r,i),this.startSpan(Math.min(_,e.to),c),!(e.to>=h||!e.nextSibling())););if(!m||h>n)break;p=m.to+o,p>t&&(this.highlightRange(a.cursor(),Math.max(t,m.from+o),Math.min(n,p),``,l),this.startSpan(Math.min(n,p),c))}u&&e.parent()}else if(e.firstChild()){d&&(r=``);do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}};function cq(e){let t=e.type.prop(nq);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}var q=XK.define,lq=q(),uq=q(),dq=q(uq),fq=q(uq),pq=q(),mq=q(pq),hq=q(pq),gq=q(),_q=q(gq),vq=q(),yq=q(),bq=q(),xq=q(bq),Sq=q(),J={comment:lq,lineComment:q(lq),blockComment:q(lq),docComment:q(lq),name:uq,variableName:q(uq),typeName:dq,tagName:q(dq),propertyName:fq,attributeName:q(fq),className:q(uq),labelName:q(uq),namespace:q(uq),macroName:q(uq),literal:pq,string:mq,docString:q(mq),character:q(mq),attributeValue:q(mq),number:hq,integer:q(hq),float:q(hq),bool:q(pq),regexp:q(pq),escape:q(pq),color:q(pq),url:q(pq),keyword:vq,self:q(vq),null:q(vq),atom:q(vq),unit:q(vq),modifier:q(vq),operatorKeyword:q(vq),controlKeyword:q(vq),definitionKeyword:q(vq),moduleKeyword:q(vq),operator:yq,derefOperator:q(yq),arithmeticOperator:q(yq),logicOperator:q(yq),bitwiseOperator:q(yq),compareOperator:q(yq),updateOperator:q(yq),definitionOperator:q(yq),typeOperator:q(yq),controlOperator:q(yq),punctuation:bq,separator:q(bq),bracket:xq,angleBracket:q(xq),squareBracket:q(xq),paren:q(xq),brace:q(xq),content:gq,heading:_q,heading1:q(_q),heading2:q(_q),heading3:q(_q),heading4:q(_q),heading5:q(_q),heading6:q(_q),contentSeparator:q(gq),list:q(gq),quote:q(gq),emphasis:q(gq),strong:q(gq),link:q(gq),monospace:q(gq),strikethrough:q(gq),inserted:q(),deleted:q(),changed:q(),invalid:q(),meta:Sq,documentMeta:q(Sq),annotation:q(Sq),processingInstruction:q(Sq),definition:XK.defineModifier(`definition`),constant:XK.defineModifier(`constant`),function:XK.defineModifier(`function`),standard:XK.defineModifier(`standard`),local:XK.defineModifier(`local`),special:XK.defineModifier(`special`)};for(let e in J){let t=J[e];t instanceof XK&&(t.name=e)}iq([{tag:J.link,class:`tok-link`},{tag:J.heading,class:`tok-heading`},{tag:J.emphasis,class:`tok-emphasis`},{tag:J.strong,class:`tok-strong`},{tag:J.keyword,class:`tok-keyword`},{tag:J.atom,class:`tok-atom`},{tag:J.bool,class:`tok-bool`},{tag:J.url,class:`tok-url`},{tag:J.labelName,class:`tok-labelName`},{tag:J.inserted,class:`tok-inserted`},{tag:J.deleted,class:`tok-deleted`},{tag:J.literal,class:`tok-literal`},{tag:J.string,class:`tok-string`},{tag:J.number,class:`tok-number`},{tag:[J.regexp,J.escape,J.special(J.string)],class:`tok-string2`},{tag:J.variableName,class:`tok-variableName`},{tag:J.local(J.variableName),class:`tok-variableName tok-local`},{tag:J.definition(J.variableName),class:`tok-variableName tok-definition`},{tag:J.special(J.variableName),class:`tok-variableName2`},{tag:J.definition(J.propertyName),class:`tok-propertyName tok-definition`},{tag:J.typeName,class:`tok-typeName`},{tag:J.namespace,class:`tok-namespace`},{tag:J.className,class:`tok-className`},{tag:J.macroName,class:`tok-macroName`},{tag:J.propertyName,class:`tok-propertyName`},{tag:J.operator,class:`tok-operator`},{tag:J.comment,class:`tok-comment`},{tag:J.meta,class:`tok-meta`},{tag:J.invalid,class:`tok-invalid`},{tag:J.punctuation,class:`tok-punctuation`}]);var Cq=tq({String:J.string,Number:J.number,"True False":J.bool,PropertyName:J.propertyName,Null:J.null,", :":J.separator,"[ ]":J.squareBracket,"{ }":J.brace}),wq=GK.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:`#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O`,goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:`⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array`,maxTerm:25,nodeProps:[[`isolate`,-2,6,11,``],[`openedBy`,7,`{`,14,`[`],[`closedBy`,8,`}`,15,`]`]],propSources:[Cq],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),Tq=[],Eq=[];(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?Eq:Tq).push(n+=e[t])})();function Dq(e){if(e<768)return!1;for(let t=0,n=Tq.length;;){let r=t+n>>1;if(e<Tq[r])n=r;else if(e>=Eq[r])t=r+1;else return!0;if(t==n)return!1}}function Oq(e){return e>=127462&&e<=127487}var kq=8205;function Aq(e,t,n=!0,r=!0){return(n?jq:Mq)(e,t,r)}function jq(e,t,n){if(t==e.length)return t;t&&Pq(e.charCodeAt(t))&&Fq(e.charCodeAt(t-1))&&t--;let r=Nq(e,t);for(t+=Iq(r);t<e.length;){let i=Nq(e,t);if(r==kq||i==kq||n&&Dq(i))t+=Iq(i),r=i;else if(Oq(i)){let n=0,r=t-2;for(;r>=0&&Oq(Nq(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function Mq(e,t,n){for(;t>1;){let r=jq(e,t-2,n);if(r<t)return r;t--}return 0}function Nq(e,t){let n=e.charCodeAt(t);if(!Fq(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return Pq(r)?(n-55296<<10)+(r-56320)+65536:n}function Pq(e){return e>=56320&&e<57344}function Fq(e){return e>=55296&&e<56320}function Iq(e){return e<65536?1:2}var Lq=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=qq(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),zq.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=qq(this,e,t);let n=[];return this.decompose(e,t,n,0),zq.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new Uq(this),i=new Uq(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new Uq(this,e)}iterRange(e,t=this.length){return new Wq(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Gq(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new Rq(t):zq.from(Rq.split(t,[]))}},Rq=class e extends Lq{constructor(e,t=Bq(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new Kq(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(Hq(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=Vq(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=qq(this,t,n);let i=Vq(this.text,Vq(r.text,Hq(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):zq.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`
20
+ `){[e,t]=qq(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},zq=class e extends Lq{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=qq(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=`
21
+ `){[e,t]=qq(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new Rq(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof Rq&&c&&(n=u[u.length-1])instanceof Rq&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new Rq(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}};Lq.empty=new Rq([``],0);function Bq(e){let t=-1;for(let n of e)t+=n.length+1;return t}function Vq(e,t,n=0,r=1e9){for(let i=0,a=0,o=!0;a<e.length&&i<=r;a++){let s=e[a],c=i+s.length;c>=n&&(c>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),o?(t[t.length-1]+=s,o=!1):t.push(s)),i=c+1}return t}function Hq(e,t,n){return Vq(e,[``],t,n)}var Uq=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof Rq?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof Rq?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
22
+ `,this;e--}else if(r instanceof Rq){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof Rq?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},Wq=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new Uq(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=``}},Gq=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<`u`&&(Lq.prototype[Symbol.iterator]=function(){return this.iter()},Uq.prototype[Symbol.iterator]=Wq.prototype[Symbol.iterator]=Gq.prototype[Symbol.iterator]=function(){return this});var Kq=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function qq(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function Jq(e,t,n=!0,r=!0){return Aq(e,t,n,r)}function Yq(e){return e>=56320&&e<57344}function Xq(e){return e>=55296&&e<56320}function Zq(e,t){let n=e.charCodeAt(t);if(!Xq(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return Yq(r)?(n-55296<<10)+(r-56320)+65536:n}function Qq(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function $q(e){return e<65536?1:2}var eJ=/\r\n?|\n/,tJ=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(tJ||={}),nJ=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){oJ(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:cJ(this,e)}mapDesc(e,t=!1){return e.empty?this:sJ(this,e,t)}mapPos(e,t=-1,n=tJ.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=tJ.Simple&&c>=e&&(n==tJ.TrackDel&&r<e&&c>e||n==tJ.TrackBefore&&r<e||n==tJ.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},rJ=class e extends nJ{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return oJ(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return sJ(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push(Lq.empty);r.push(a?t.slice(i,i+a):Lq.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:cJ(this,e,!0)}map(e,t=!1){return e.empty?this:sJ(this,e,t,!0)}iterChanges(e,t=!1){oJ(this,e,t)}get desc(){return nJ.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new lJ(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);iJ(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;iJ(n,e,t),t>0&&aJ(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);iJ(n,e,-1),iJ(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:nJ.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(t,n,r){let i=[],a=[],o=0,s=null;function c(t=!1){if(!t&&!i.length)return;o<n&&iJ(i,n-o,-1);let r=new e(i,a);s=s?s.compose(r.map(s)):r,i=[],a=[],o=0}function l(t){if(Array.isArray(t))for(let e of t)l(e);else if(t instanceof e){if(t.length!=n)throw RangeError(`Mismatched change set length (got ${t.length}, expected ${n})`);c(),s=s?s.compose(t.map(s)):t}else{let{from:e,to:s=e,insert:l}=t;if(e>s||e<0||s>n)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${n})`);let u=l?typeof l==`string`?Lq.of(l.split(r||eJ)):l:Lq.empty,d=u.length;if(e==s&&d==0)return;e<o&&c(),e>o&&iJ(i,e-o,-1),iJ(i,s-e,d),aJ(a,i,u),o=s}}return l(t),c(!s),s}static empty(t){return new e(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError(`Invalid JSON representation of ChangeSet`);let n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e];if(typeof i==`number`)n.push(i,-1);else if(!Array.isArray(i)||typeof i[0]!=`number`||i.some((e,t)=>t&&typeof e!=`string`))throw RangeError(`Invalid JSON representation of ChangeSet`);else if(i.length==1)n.push(i[0],0);else{for(;r.length<e;)r.push(Lq.empty);r[e]=Lq.of(i.slice(1)),n.push(i[0],r[e].length)}}return new e(n,r)}static createSet(t,n){return new e(t,n)}};function iJ(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function aJ(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(Lq.empty);e.push(n)}}function oJ(e,t,n){let r=e.inserted;for(let i=0,a=0,o=0;o<e.sections.length;){let s=e.sections[o++],c=e.sections[o++];if(c<0)i+=s,a+=s;else{let l=i,u=a,d=Lq.empty;for(;l+=s,u+=c,c&&r&&(d=d.append(r[o-2>>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)s=e.sections[o++],c=e.sections[o++];t(i,l,a,u,d),i=l,a=u}}}function sJ(e,t,n,r=!1){let i=[],a=r?[]:null,o=new lJ(e),s=new lJ(t);for(let e=-1;;)if(o.done&&s.len||s.done&&o.len)throw Error(`Mismatched change set lengths`);else if(o.ins==-1&&s.ins==-1){let e=Math.min(o.len,s.len);iJ(i,e,-1),o.forward(e),s.forward(e)}else if(s.ins>=0&&(o.ins<0||e==o.i||o.off==0&&(s.len<o.len||s.len==o.len&&!n))){let t=s.len;for(iJ(i,s.ins,-1);t;){let n=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=n&&(iJ(i,0,o.ins),a&&aJ(a,i,o.text),e=o.i),o.forward(n),t-=n}s.next()}else if(o.ins>=0){let t=0,n=o.len;for(;n;)if(s.ins==-1){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(s.ins==0&&s.len<n)n-=s.len,s.next();else break;iJ(i,t,e<o.i?o.ins:0),a&&e<o.i&&aJ(a,i,o.text),e=o.i,o.forward(o.len-n)}else if(o.done&&s.done)return a?rJ.createSet(i,a):nJ.create(i);else throw Error(`Mismatched change set lengths`)}function cJ(e,t,n=!1){let r=[],i=n?[]:null,a=new lJ(e),o=new lJ(t);for(let e=!1;;)if(a.done&&o.done)return i?rJ.createSet(r,i):nJ.create(r);else if(a.ins==0)iJ(r,a.len,0,e),a.next();else if(o.len==0&&!o.done)iJ(r,0,o.ins,e),i&&aJ(i,r,o.text),o.next();else if(a.done||o.done)throw Error(`Mismatched change set lengths`);else{let t=Math.min(a.len2,o.len),n=r.length;if(a.ins==-1){let n=o.ins==-1?-1:o.off?0:o.ins;iJ(r,t,n,e),i&&n&&aJ(i,r,o.text)}else o.ins==-1?(iJ(r,a.off?0:a.len,t,e),i&&aJ(i,r,a.textBit(t))):(iJ(r,a.off?0:a.len,o.off?0:o.ins,e),i&&!o.off&&aJ(i,r,o.text));e=(a.ins>t||o.ins>=0&&o.len>t)&&(e||r.length>n),a.forward2(t),o.forward(t)}}var lJ=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?Lq.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?Lq.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},uJ=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.flags=n,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new e(r,i,this.flags,this.goalColumn)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return Y.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Y.range(this.anchor,r,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!=`number`||typeof e.head!=`number`)throw RangeError(`Invalid JSON representation for SelectionRange`);return Y.range(e.anchor,e.head)}static create(t,n,r,i){return new e(t,n,r,i)}},Y=class e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(t,n=-1){return t.empty?this:e.create(this.ranges.map(e=>e.map(t,n)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new e([this.main],0)}addRange(t,n=!0){return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!=`number`||t.main>=t.ranges.length)throw RangeError(`Invalid JSON representation for EditorSelection`);return new e(t.ranges.map(e=>uJ.fromJSON(e)),t.main)}static single(t,n=t){return new e([e.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw RangeError(`A selection needs at least one range`);for(let r=0,i=0;i<t.length;i++){let a=t[i];if(a.empty?a.from<=r:a.from<r)return e.normalized(t.slice(),n);r=a.to}return new e(t,n)}static cursor(e,t=0,n,r){return uJ.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n)),r)}static range(e,t,n,r,i){let a=r==null?7:Math.min(6,r);return!i&&e!=t&&(i=t<e?1:-1),i&&(a|=i<0?8:16),t<e?uJ.create(t,e,a|32,n):uJ.create(e,t,a,n)}static undirectionalRange(e,t){return uJ.create(e,t,64,void 0)}static normalized(t,n=0){let r=t[n];t.sort((e,t)=>e.from-t.from),n=t.indexOf(r);for(let r=1;r<t.length;r++){let i=t[r],a=t[r-1];if(i.empty?i.from<=a.to:i.from<a.to){let o=a.from,s=Math.max(i.to,a.to);r<=n&&n--,t.splice(--r,2,i.anchor>i.head?e.range(s,o):e.range(o,s))}}return new e(t,n)}};function dJ(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError(`Selection points outside of document`)}var fJ=0,X=class e{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=fJ++,this.default=e([]),this.extensions=typeof i==`function`?i(this):i}get reader(){return this}static define(t={}){return new e(t.combine||(e=>e),t.compareInput||((e,t)=>e===t),t.compare||(t.combine?(e,t)=>e===t:pJ),!!t.static,t.enables)}of(e){return new mJ([],this,0,e)}compute(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new mJ(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new mJ(e,this,2,t)}from(e,t){return t||=e=>e,this.compute([e],n=>t(n.field(e)))}};function pJ(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}var mJ=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=fJ++}dynamicSlot(e){let t=this.value,n=this.facet.compareInput,r=this.id,i=e[r]>>1,a=this.type==2,o=!1,s=!1,c=[];for(let t of this.dependencies)t==`doc`?o=!0:t==`selection`?s=!0:(e[t.id]??1)&1||c.push(e[t.id]);return{create(e){return e.values[i]=t(e),1},update(e,r){if(o&&r.docChanged||s&&(r.docChanged||r.selection)||gJ(e,c)){let r=t(e);if(a?!hJ(r,e.values[i],n):!n(r,e.values[i]))return e.values[i]=r,1}return 0},reconfigure:(e,o)=>{let s,c=o.config.address[r];if(c!=null){let r=kJ(o,c);if(this.dependencies.every(t=>t instanceof X?o.facet(t)===e.facet(t):t instanceof yJ?o.field(t,!1)==e.field(t,!1):!0)||(a?hJ(s=t(e),r,n):n(s=t(e),r)))return e.values[i]=r,0}else s=t(e);return e.values[i]=s,1}}}get extension(){return this}};function hJ(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function gJ(e,t){let n=!1;for(let r of t)OJ(e,r)&1&&(n=!0);return n}function _J(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),a=r.filter(e=>!(e&1)),o=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<r.length;t++){let a=kJ(e,r[t]);if(i[t]==2)for(let e of a)n.push(e);else n.push(a)}return t.combine(n)}return{create(e){for(let t of r)OJ(e,t);return e.values[o]=s(e),1},update(e,n){if(!gJ(e,a))return 0;let r=s(e);return t.compare(r,e.values[o])?0:(e.values[o]=r,1)},reconfigure(e,i){let a=gJ(e,r),c=i.config.facets[t.id],l=i.facet(t);if(c&&!a&&pJ(n,c))return e.values[o]=l,0;let u=s(e);return t.compare(u,l)?(e.values[o]=l,0):(e.values[o]=u,1)}}}var vJ=X.define({static:!0}),yJ=class e{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(t){let n=new e(fJ++,t.create,t.update,t.compare||((e,t)=>e===t),t);return t.provide&&(n.provides=t.provide(n)),n}create(e){return(e.facet(vJ).find(e=>e.field==this)?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(vJ),i=n.facet(vJ),a;return(a=r.find(e=>e.field==this))&&a!=i.find(e=>e.field==this)?(e.values[t]=a.create(e),1):n.config.address[this.id]==null?(e.values[t]=this.create(e),1):(e.values[t]=n.field(this),0)}}}init(e){return[this,vJ.of({field:this,create:e})]}get extension(){return this}},bJ={lowest:4,low:3,default:2,high:1,highest:0};function xJ(e){return t=>new CJ(t,e)}var SJ={highest:xJ(bJ.highest),high:xJ(bJ.high),default:xJ(bJ.default),low:xJ(bJ.low),lowest:xJ(bJ.lowest)},CJ=class{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}},wJ=class e{of(e){return new TJ(this,e)}reconfigure(t){return e.reconfigure.of({compartment:this,extension:t})}get(e){return e.config.compartments.get(this)}},TJ=class{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}},EJ=class e{constructor(e,t,n,r,i,a){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(t,n,r){let i=[],a=Object.create(null),o=new Map;for(let e of DJ(t,n,o))e instanceof yJ?i.push(e):(a[e.facet.id]||(a[e.facet.id]=[])).push(e);let s=Object.create(null),c=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push(t=>e.slot(t));let u=r?.config.facets;for(let e in a){let t=a[e],n=t[0].facet,i=u&&u[e]||[];if(t.every(e=>e.type==0)){if(s[n.id]=c.length<<1|1,pJ(i,t))c.push(r.facet(n));else{let e=n.combine(t.map(e=>e.value));c.push(r&&n.compare(e,r.facet(n))?r.facet(n):e)}}else{for(let e of t)e.type==0?(s[e.id]=c.length<<1|1,c.push(e.value)):(s[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));s[n.id]=l.length<<1,l.push(e=>_J(e,n,t))}}let d=l.map(e=>e(s));return new e(t,o,d,s,c,a)}};function DJ(e,t,n){let r=[[],[],[],[],[]],i=new Map;function a(e,o){let s=i.get(e);if(s!=null){if(s<=o)return;let t=r[s].indexOf(e);t>-1&&r[s].splice(t,1),e instanceof TJ&&n.delete(e.compartment)}if(i.set(e,o),Array.isArray(e))for(let t of e)a(t,o);else if(e instanceof TJ){if(n.has(e.compartment))throw RangeError(`Duplicate use of compartment in extensions`);let r=t.get(e.compartment)||e.inner;n.set(e.compartment,r),a(r,o)}else if(e instanceof CJ)a(e.inner,e.prec);else if(e instanceof yJ)r[o].push(e),e.provides&&a(e.provides,o);else if(e instanceof mJ)r[o].push(e),e.facet.extensions&&a(e.facet.extensions,bJ.default);else{let t=e.extension;if(!t)throw Error(`Unrecognized extension value in extension set (${e}).`);if(t==e)throw Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(t,o)}}return a(e,bJ.default),r.reduce((e,t)=>e.concat(t))}function OJ(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw Error(`Cyclic dependency between fields and/or facets`);if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function kJ(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}var AJ=X.define(),jJ=X.define({combine:e=>e.some(e=>e),static:!0}),MJ=X.define({combine:e=>e.length?e[0]:void 0,static:!0}),NJ=X.define(),PJ=X.define(),FJ=X.define(),IJ=X.define({combine:e=>e.length?e[0]:!1}),LJ=class{constructor(e,t){this.type=e,this.value=t}static define(){return new RJ}},RJ=class{of(e){return new LJ(this,e)}},zJ=class{constructor(e){this.map=e}of(e){return new BJ(this,e)}},BJ=class e{constructor(e,t){this.type=e,this.value=t}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new e(this.type,n)}is(e){return this.type==e}static define(e={}){return new zJ(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}};BJ.reconfigure=BJ.define(),BJ.appendConfig=BJ.define();var VJ=class e{constructor(t,n,r,i,a,o){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,r&&dJ(r,n.newLength),a.some(t=>t.type==e.time)||(this.annotations=a.concat(e.time.of(Date.now())))}static create(t,n,r,i,a,o){return new e(t,n,r,i,a,o)}get newDoc(){return this._doc||=this.changes.apply(this.startState.doc)}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(e.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]==`.`))}};VJ.time=LJ.define(),VJ.userEvent=LJ.define(),VJ.addToHistory=LJ.define(),VJ.remote=LJ.define();function HJ(e,t){let n=[];for(let r=0,i=0;;){let a,o;if(r<e.length&&(i==t.length||t[i]>=e[r]))a=e[r++],o=e[r++];else if(i<t.length)a=t[i++],o=t[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function UJ(e,t,n){let r,i,a;return n?(r=t.changes,i=rJ.empty(t.changes.length),a=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),i=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(r)),{changes:a,selection:t.selection?t.selection.map(i):e.selection?.map(r),effects:BJ.mapEffects(e.effects,r).concat(BJ.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function WJ(e,t,n){let r=t.selection,i=YJ(t.annotations);return t.userEvent&&(i=i.concat(VJ.userEvent.of(t.userEvent))),{changes:t.changes instanceof rJ?t.changes:rJ.of(t.changes||[],n,e.facet(MJ)),selection:r&&(r instanceof Y?r:Y.single(r.anchor,r.head)),effects:YJ(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function GJ(e,t,n){let r=WJ(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let i=1;i<t.length;i++){t[i].filter===!1&&(n=!1);let a=!!t[i].sequential;r=UJ(r,WJ(e,t[i],a?r.changes.newLength:e.doc.length),a)}let i=VJ.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return qJ(n?KJ(i):i)}function KJ(e){let t=e.startState,n=!0;for(let r of t.facet(NJ)){let t=r(e);if(t===!1){n=!1;break}Array.isArray(t)&&(n=n===!0?t:HJ(n,t))}if(n!==!0){let r,i;if(n===!1)i=e.changes.invertedDesc,r=rJ.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,i=t.filtered.mapDesc(t.changes).invertedDesc}e=VJ.create(t,r,e.selection&&e.selection.map(i),BJ.mapEffects(e.effects,i),e.annotations,e.scrollIntoView)}let r=t.facet(PJ);for(let n=r.length-1;n>=0;n--){let i=r[n](e);e=i instanceof VJ?i:Array.isArray(i)&&i.length==1&&i[0]instanceof VJ?i[0]:GJ(t,YJ(i),!1)}return e}function qJ(e){let t=e.startState,n=t.facet(FJ),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=UJ(r,WJ(t,a,e.changes.newLength),!0))}return r==e?e:VJ.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}var JJ=[];function YJ(e){return e==null?JJ:Array.isArray(e)?e:[e]}var XJ=(function(e){return e[e.Word=0]=`Word`,e[e.Space=1]=`Space`,e[e.Other=2]=`Other`,e})(XJ||={}),ZJ=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,QJ;try{QJ=RegExp(`[\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{}function $J(e){if(QJ)return QJ.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>`€`&&(n.toUpperCase()!=n.toLowerCase()||ZJ.test(n)))return!0}return!1}function eY(e){return t=>{if(!/\S/.test(t))return XJ.Space;if($J(t))return XJ.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return XJ.Word;return XJ.Other}}var tY=class e{constructor(e,t,n,r,i,a){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)OJ(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw RangeError(`Field is not present in this state`);return}return OJ(this,n),kJ(this,n)}update(...e){return GJ(this,e,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let e of t.effects)e.is(wJ.reconfigure)?(n&&=(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),null),i.set(e.value.compartment,e.value.extension)):e.is(BJ.reconfigure)?(n=null,r=e.value):e.is(BJ.appendConfig)&&(n=null,r=YJ(r).concat(e.value));let a;n?a=t.startState.values.slice():(n=EJ.resolve(r,i,this),a=new e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let o=t.startState.facet(jJ)?t.newSelection:t.newSelection.asSingle();new e(n,t.newDoc,o,a,(e,n)=>n.update(e,t),t)}replaceSelection(e){return typeof e==`string`&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:Y.cursor(t.from+e.length,-1)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],a=YJ(n.effects);for(let n=1;n<t.ranges.length;n++){let o=e(t.ranges[n]),s=this.changes(o.changes),c=s.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(c);let l=r.mapDesc(s,!0);i.push(o.range.map(l)),r=r.compose(c),a=BJ.mapEffects(a,c).concat(BJ.mapEffects(YJ(o.effects),l))}return{changes:r,selection:Y.create(i,t.mainIndex),effects:a}}changes(t=[]){return t instanceof rJ?t:rJ.of(t,this.doc.length,this.facet(e.lineSeparator))}toText(t){return Lq.of(t.split(this.facet(e.lineSeparator)||eJ))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(OJ(this,t),kJ(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof yJ&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(t,n={},r){if(!t||typeof t.doc!=`string`)throw RangeError(`Invalid JSON representation for EditorState`);let i=[];if(r){for(let e in r)if(Object.prototype.hasOwnProperty.call(t,e)){let n=r[e],a=t[e];i.push(n.init(e=>n.spec.fromJSON(a,e)))}}return e.create({doc:t.doc,selection:Y.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=EJ.resolve(t.extensions||[],new Map),r=t.doc instanceof Lq?t.doc:Lq.of((t.doc||``).split(n.staticFacet(e.lineSeparator)||eJ)),i=t.selection?t.selection instanceof Y?t.selection:Y.single(t.selection.anchor,t.selection.head):Y.single(0);return dJ(i,r.length),n.staticFacet(jJ)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(e.tabSize)}get lineBreak(){return this.facet(e.lineSeparator)||`
23
+ `}get readOnly(){return this.facet(IJ)}phrase(t,...n){for(let n of this.facet(e.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(e,t)=>{if(t==`$`)return`$`;let r=+(t||1);return!r||r>n.length?e:n[r-1]})),t}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(AJ))for(let a of i(this,t,n))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){let t=this.languageDataAt(`wordChars`,e);return eY(t.length?t[0]:``)}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-n,o=e-n;for(;a>0;){let e=Jq(t,a,!1);if(i(t.slice(e,a))!=XJ.Word)break;a=e}for(;o<r;){let e=Jq(t,o);if(i(t.slice(o,e))!=XJ.Word)break;o=e}return a==o?null:Y.range(a+n,o+n)}};tY.allowMultipleSelections=jJ,tY.tabSize=X.define({combine:e=>e.length?e[0]:4}),tY.lineSeparator=MJ,tY.readOnly=IJ,tY.phrases=X.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),tY.languageData=AJ,tY.changeFilter=NJ,tY.transactionFilter=PJ,tY.transactionExtender=FJ,wJ.reconfigure=BJ.define();function nY(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],a=r[e];if(a===void 0)r[e]=i;else if(a!==i&&i!==void 0){if(Object.hasOwnProperty.call(n,e))r[e]=n[e](a,i);else throw Error(`Config merge conflict for field `+e)}}for(let e in t)r[e]===void 0&&(r[e]=t[e]);return r}var rY=class{eq(e){return this==e}range(e,t=e){return aY.create(e,t,this)}};rY.prototype.startSide=rY.prototype.endSide=0,rY.prototype.point=!1,rY.prototype.mapMode=tJ.TrackDel;function iY(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}var aY=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,r){return new e(t,n,r)}};function oY(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var sY=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return lY(this.to)}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let a=r,o=i.length;;){if(a==o)return a;let r=a+o>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==a)return s>=0?a:o;s>=0?o=r:a=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),a=this.findIndex(n,1e9,!1,i);i<a;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(t,n,r,i,a){let o=[],s=[],c=[],l=-1,u=-1;iter:for(let e=0;e<this.value.length;e++){let d=this.value[e],f=this.from[e]+t,p=this.to[e]+t,m,h;if(f==p){let e=n.mapPos(f,d.startSide,d.mapMode);if(e==null||(m=h=e,d.startSide!=d.endSide&&(h=n.mapPos(f,d.endSide),h<m)))continue}else if(m=n.mapPos(f,d.startSide),h=n.mapPos(p,d.endSide),m>h||m==h&&d.startSide>0&&d.endSide<=0)continue;if(!((h-m||d.endSide-d.startSide)<0)){if(l<0&&(l=m),d.point&&(u=Math.max(u,h-m)),(m-r||d.startSide-i)>=0)o.push(d),s.push(m-l),c.push(h-l),r=h,i=d.endSide;else{if(m==h)for(let e=o.length;e>0;e--){if((m-(c[e-1]+l)||d.startSide-o[e-1].endSide)>=0){o.splice(e,0,d),s.splice(e,0,m-l),c.splice(e,0,h-l);continue iter}if((m-(s[e-1]+l)||d.endSide-o[e-1].startSide)>0)break}a(m,h,d)}}}return{mapped:o.length?new e(s,c,o,u):null,pos:l}}},cY=class e{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(t,n,r,i){return new e(t,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(oY)),this.isEmpty)return n.length?e.of(n):this;let s=new pY(this,null,-1).goto(0),c=0,l=[],u=new dY;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let e=n[c++];u.addInner(e.from,e.to,e.value,!1)||l.push(e)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||a<s.from||o(s.from,s.to,s.value))&&(u.addInner(s.from,s.to,s.value,!1)||l.push(aY.create(s.from,s.to,s.value))),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?e.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1,a,o=(e,t,n)=>{a||=new dY,a.addRange(e,t,n,!1)};for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],s=this.chunk[e],c=t.touchesRange(a,a+s.length);if(c===!1)i=Math.max(i,s.maxPoint),n.push(s),r.push(t.mapPos(a));else if(c===!0){let[e,c]=n.length?[lY(r)+lY(n).length,lY(lY(n).value).endSide]:[-1,-1],{mapped:l,pos:u}=s.map(a,t,e,c,o);l&&(i=Math.max(i,l.maxPoint),n.push(l),r.push(u))}}let s=this.nextLayer.map(t);return a&&(s=a.finishInner(s)),n.length==0?s:new e(r,n,s||e.empty,i)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],a=this.chunk[r];if(t>=i&&e<=i+a.length&&a.between(i,e-i,t-i,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return mY.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return mY.from(e).goto(t)}static compare(e,t,n,r,i=-1){let a=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=fY(a,o,n),c=new gY(a,s,i),l=new gY(o,s,i);n.iterGaps((e,t,n)=>_Y(c,e,l,t,n,r)),n.empty&&n.length==0&&_Y(c,0,l,0,0,r)}static eq(e,t,n=0,r){r??=1e9-1;let i=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),a=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=fY(i,a),s=new gY(i,o,0).goto(n),c=new gY(a,o,0).goto(n);for(;;){if(s.to!=c.to||!vY(s.active,c.active)||s.point&&(!c.point||!iY(s.point,c.point)))return!1;if(s.to>r)return!0;s.next(),c.next()}}static spans(e,t,n,r,i=-1){let a=new gY(e,null,i).goto(t),o=t,s=a.openStart;for(;;){let e=Math.min(a.to,n);if(a.point){let n=a.activeForPoint(a.to),i=a.pointFrom<t?n.length+1:a.point.startSide<0?n.length:Math.min(n.length,s);r.point(o,e,a.point,n,i,a.pointRank),s=Math.min(a.openEnd(e),n.length)}else e>o&&(r.span(o,e,a.active,s),s=a.openEnd(e));if(a.to>n)return s+(a.point&&a.to>n?1:0);o=a.to,a.next()}}static of(e,t=!1){let n=new dY;for(let r of e instanceof aY?[e]:t?uY(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(t){if(!t.length)return e.empty;let n=lY(t);for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=e.empty;i=i.nextLayer)n=new e(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}};cY.empty=new cY([],[],null,-1);function lY(e){return e[e.length-1]}function uY(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(oY(t,r)>0)return e.slice().sort(oY);t=r}return e}cY.empty.nextLayer=cY.empty;var dY=class e{finishChunk(e){this.chunks.push(new sY(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addRange(e,t,n,!0)}addRange(t,n,r,i){this.addInner(t,n,r,i)||(this.nextLayer||=new e).addRange(t,n,r,i)}addInner(e,t,n,r){let i=e-this.lastTo||n.startSide-this.last.endSide;if(r&&i<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(cY.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=cY.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function fY(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let a=r.get(e.chunk[t]);a!=null&&(n?n.mapPos(a):a)==e.chunkPos[t]&&!n?.touchesRange(a,a+e.chunk[t].length)&&i.add(e.chunk[t])}return i}var pY=class{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}},mY=class e{constructor(e){this.heap=e}static from(t,n=null,r=-1){let i=[];for(let e=0;e<t.length;e++)for(let a=t[e];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new pY(a,n,r,e));return i.length==1?i[0]:new e(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)hY(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)hY(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),hY(this.heap,0)}}};function hY(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var gY=class{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=mY.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){yY(this.active,e),yY(this.activeTo,e),yY(this.activeRank,e),this.minActive=xY(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;bY(this.active,t,n),bY(this.activeTo,t,r),bY(this.activeRank,t,i),e&&bY(e,t,this.cursor.from),this.minActive=xY(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&yY(n,r)}else if(!this.cursor.value){this.to=this.endSide=1e9;break}else if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(!e.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}};function _Y(e,t,n,r,i,a){e.goto(t),n.goto(r);let o=r+i,s=r,c=r-t,l=!!a.boundChange;for(let t=!1;;){let r=e.to+c-n.to,i=r||e.endSide-n.endSide,u=i<0?e.to+c:n.to,d=Math.min(u,o);if(e.point||n.point?(e.point&&n.point&&iY(e.point,n.point)&&vY(e.activeForPoint(e.to),n.activeForPoint(n.to))||a.comparePoint(s,d,e.point,n.point),t=!1):(t&&=(a.boundChange(s),!1),d>s&&!vY(e.active,n.active)&&a.compareRange(s,d,e.active,n.active),l&&d<o&&(r||e.openEnd(u)!=n.openEnd(u))&&(t=!0)),u>o)break;s=u,i<=0&&e.next(),i>=0&&n.next()}}function vY(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!iY(e[n],t[n]))return!1;return!0}function yY(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function bY(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function xY(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function SY(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=Jq(e,i));return r}function CY(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=e.charCodeAt(r)==9?n-i%n:1,r=Jq(e,r)}return r===!0?-1:e.length}for(var wY=`ͼ`,TY=typeof Symbol>`u`?`__ͼ`:Symbol.for(wY),EY=typeof Symbol>`u`?`__styleSet`+Math.floor(Math.random()*1e8):Symbol(`styleSet`),DY=typeof globalThis<`u`?globalThis:typeof window<`u`?window:{},OY=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,t,a,o){let s=[],c=/^@(\w+)\b/.exec(e[0]),l=c&&c[1]==`keyframes`;if(c&&t==null)return a.push(e[0]+`;`);for(let n in t){let o=t[n];if(/&/.test(n))i(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),o,a);else if(o&&typeof o==`object`){if(!c)throw RangeError(`The value of a property (`+n+`) should be a primitive value.`);i(r(n),o,s,l)}else o!=null&&s.push(n.replace(/_.*/,``).replace(/[A-Z]/g,e=>`-`+e.toLowerCase())+`: `+o+`;`)}(s.length||l)&&a.push((n&&!c&&!o?e.map(n):e).join(`, `)+` {`+s.join(` `)+`}`)}for(let t in e)i(r(t),e[t],this.rules)}getRules(){return this.rules.join(`
24
+ `)}static newName(){let e=DY[TY]||1;return DY[TY]=e+1,wY+e.toString(36)}static mount(e,t,n){let r=e[EY],i=n&&n.nonce;r?i&&r.setNonce(i):r=new AY(e,i),r.mount(Array.isArray(t)?t:[t],e)}},kY=new Map,AY=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=kY.get(n);if(t)return e[EY]=t;this.sheet=new r.CSSStyleSheet,kY.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[EY]=this}mount(e,t){let n=this.sheet,r=0,i=0,a=!1;for(let t=0;t<e.length;t++){let o=e[t],s=this.modules.indexOf(o);if(s<i&&s>-1&&(this.modules.splice(s,1),a=!0,i--,s=-1),s==-1){if(this.modules.splice(i++,0,o),a=!0,n)for(let e=0;e<o.rules.length;e++)n.insertRule(o.rules[e],r++)}else{for(;i<s;)r+=this.modules[i++].rules.length;r+=o.rules.length,i++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{if(a){let e=``;for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+`
25
+ `;this.styleTag.textContent=e}let e=t.head||t;this.styleTag.parentNode!=e&&e.insertBefore(this.styleTag,e.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(`nonce`)!=e&&this.styleTag.setAttribute(`nonce`,e)}},jY={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},MY={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},NY=typeof navigator<`u`&&/Mac/.test(navigator.platform),PY=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),FY=0;FY<10;FY++)jY[48+FY]=jY[96+FY]=String(FY);for(var FY=1;FY<=24;FY++)jY[FY+111]=`F`+FY;for(var FY=65;FY<=90;FY++)jY[FY]=String.fromCharCode(FY+32),MY[FY]=String.fromCharCode(FY);for(var IY in jY)MY.hasOwnProperty(IY)||(MY[IY]=jY[IY]);function LY(e){var t=!(NY&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||PY&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?MY:jY)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}function RY(){var e=arguments[0];typeof e==`string`&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n==`object`&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i==`string`?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)zY(e,arguments[t]);return e}function zY(e,t){if(typeof t==`string`)e.appendChild(document.createTextNode(t));else if(t!=null){if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)zY(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}}var BY=typeof navigator<`u`?navigator:{userAgent:``,vendor:``,platform:``},VY=typeof document<`u`?document:{documentElement:{style:{}}},HY=/Edge\/(\d+)/.exec(BY.userAgent),UY=/MSIE \d/.test(BY.userAgent),WY=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(BY.userAgent),GY=!!(UY||WY||HY),KY=!GY&&/gecko\/(\d+)/i.test(BY.userAgent),qY=!GY&&/Chrome\/(\d+)/.exec(BY.userAgent),JY=`webkitFontSmoothing`in VY.documentElement.style,YY=!GY&&/Apple Computer/.test(BY.vendor),XY=YY&&(/Mobile\/\w+/.test(BY.userAgent)||BY.maxTouchPoints>2),Z={mac:XY||/Mac/.test(BY.platform),windows:/Win/.test(BY.platform),linux:/Linux|X11/.test(BY.platform),ie:GY,ie_version:UY?VY.documentMode||6:WY?+WY[1]:HY?+HY[1]:0,gecko:KY,gecko_version:KY?+(/Firefox\/(\d+)/.exec(BY.userAgent)||[0,0])[1]:0,chrome:!!qY,chrome_version:qY?+qY[1]:0,ios:XY,android:/Android\b/.test(BY.userAgent),webkit:JY,webkit_version:JY?+(/\bAppleWebKit\/(\d+)/.exec(BY.userAgent)||[0,0])[1]:0,safari:YY,safari_version:YY?+(/\bVersion\/(\d+(\.\d+)?)/.exec(BY.userAgent)||[0,0])[1]:0,tabSize:VY.documentElement.style.tabSize==null?`-moz-tab-size`:`tab-size`};function ZY(e,t){for(let n in e)n==`class`&&t.class?t.class+=` `+e.class:n==`style`&&t.style?t.style+=`;`+e.style:t[n]=e[n];return t}var QY=Object.create(null);function $Y(e,t,n){if(e==t)return!0;e||=QY,t||=QY;let r=Object.keys(e),i=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let a of r)if(a!=n&&(i.indexOf(a)==-1||e[a]!==t[a]))return!1;return!0}function eX(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]??e.removeAttribute(r)}for(let n in t){let r=t[n];n==`style`?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}function tX(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i==`style`?e.style.cssText=``:e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i==`style`?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function nX(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}var rX=class{eq(e){return!1}updateDOM(e,t,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},iX=(function(e){return e[e.Text=0]=`Text`,e[e.WidgetBefore=1]=`WidgetBefore`,e[e.WidgetAfter=2]=`WidgetAfter`,e[e.WidgetRange=3]=`WidgetRange`,e})(iX||={}),Q=class extends rY{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new aX(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new sX(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:i,end:a}=cX(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(a?t?2e8:1:-6e8)+1}return new sX(e,n,r,t,e.widget||null,!0)}static line(e){return new oX(e)}static set(e,t=!1){return cY.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};Q.none=cY.empty;var aX=class e extends Q{constructor(e){let{start:t,end:n}=cX(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||`span`,this.attrs=e.class&&e.attributes?ZY(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||QY}eq(t){return this==t||t instanceof e&&this.tagName==t.tagName&&$Y(this.attrs,t.attrs)}range(e,t=e){if(e>=t)throw RangeError(`Mark decorations may not be empty`);return super.range(e,t)}};aX.prototype.point=!1;var oX=class e extends Q{constructor(e){super(-2e8,-2e8,null,e)}eq(t){return t instanceof e&&this.spec.class==t.spec.class&&$Y(this.spec.attributes,t.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError(`Line decoration ranges must be zero-length`);return super.range(e,t)}};oX.prototype.mapMode=tJ.TrackBefore,oX.prototype.point=!0;var sX=class e extends Q{constructor(e,t,n,r,i,a){super(t,n,i,e),this.block=r,this.isReplace=a,this.mapMode=r?t<=0?tJ.TrackBefore:tJ.TrackAfter:tJ.TrackDel}get type(){return this.startSide==this.endSide?this.startSide<=0?iX.WidgetBefore:iX.WidgetAfter:iX.WidgetRange}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof e&&lX(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError(`Invalid range for replacement decoration`);if(!this.isReplace&&t!=e)throw RangeError(`Widget decorations can only have zero-length ranges`);return super.range(e,t)}};sX.prototype.point=!0;function cX(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n??=e.inclusive,r??=e.inclusive,{start:n??t,end:r??t}}function lX(e,t){return e==t||!!(e&&t&&e.compare(t))}function uX(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}var dX=class e extends rY{constructor(e,t,n){super(),this.tagName=e,this.attributes=t,this.rank=n}eq(t){return t==this||t instanceof e&&this.tagName==t.tagName&&$Y(this.attributes,t.attributes)}static create(t){return new e(t.tagName,t.attributes||QY,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(e,t=!1){return cY.of(e,t)}};dX.prototype.startSide=dX.prototype.endSide=-1;function fX(e){let t;return t=e.nodeType==11?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function pX(e,t){return t?e==t||e.contains(t.nodeType==1?t:t.parentNode):!1}function mX(e,t){if(!t.anchorNode)return!1;try{return pX(e,t.anchorNode)}catch{return!1}}function hX(e){return e.nodeType==3?MX(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function gX(e,t,n,r){return n?yX(e,t,n,r,-1)||yX(e,t,n,r,1):!1}function _X(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function vX(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function yX(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:bX(e))){if(e.nodeName==`DIV`)return!1;let n=e.parentNode;if(!n||n.nodeType!=1)return!1;t=_X(e)+(i<0?0:1),e=n}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable==`false`)return!1;t=i<0?bX(e):0}else return!1}}function bX(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function xX(e,t){let{left:n,right:r}=e;if(n==r)return e;let i=t?n:r;return{left:i,right:i,top:e.top,bottom:e.bottom}}function SX(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function CX(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function wX(e,t,n,r,i,a,o,s){let c=e.ownerDocument,l=c.defaultView||window;for(let u=e,d=!1;u&&!d;)if(u.nodeType==1){let e,f=u==c.body,p=1,m=1;if(f)e=SX(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:p,scaleY:m}=CX(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*m}}let h=0,g=0;if(i==`nearest`)t.top<e.top+o?(g=t.top-(e.top+o),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+o)):t.bottom>e.bottom-o&&(g=t.bottom-e.bottom+o,n<0&&t.top-g<e.top&&(g=t.top-(e.top+o)));else{let r=t.bottom-t.top,a=e.bottom-e.top;g=(i==`center`&&r<=a?t.top+r/2-a/2:i==`start`||i==`center`&&n<0?t.top-o:t.bottom-a+o)-e.top}if(r==`nearest`?t.left<e.left+a?(h=t.left-(e.left+a),n>0&&t.right>e.right+h&&(h=t.right-e.right+a)):t.right>e.right-a&&(h=t.right-e.right+a,n<0&&t.left<e.left+h&&(h=t.left-(e.left+a))):h=(r==`center`?t.left+(t.right-t.left)/2-(e.right-e.left)/2:r==`start`==s?t.left-a:t.right-(e.right-e.left)+a)-e.left,h||g){if(f)l.scrollBy(h,g);else{let e=0,n=0;if(g){let e=u.scrollTop;u.scrollTop+=g/m,n=(u.scrollTop-e)*m}if(h){let t=u.scrollLeft;u.scrollLeft+=h/p,e=(u.scrollLeft-t)*p}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-h)<1&&(r=`nearest`),n&&Math.abs(n-g)<1&&(i=`nearest`)}}if(f)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function TX(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let a=e.parentNode;a&&!(a==n.body||(!t||r)&&i);)if(a.nodeType==1)!i&&a.scrollHeight>a.clientHeight&&(i=a),t&&!r&&a.scrollWidth>a.clientWidth&&(r=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:r,y:i}}var EX=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?bX(t):0),n,Math.min(e.focusOffset,n?bX(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}};function DX(e){let t=[];for(let n=e;n;n=n.nodeType==11?n.host:n.parentNode)n.nodeType==1&&t.push({node:n,left:n.scrollLeft,top:n.scrollTop});return t}function OX(e,t=!0){for(let{node:n,left:r,top:i}of e)t&&n.scrollTop!=i&&(n.scrollTop=i),n.scrollLeft!=r&&(n.scrollLeft=r)}var kX=null;Z.safari&&Z.safari_version>=26&&(kX=!1);function AX(e){if(e.setActive)return e.setActive();if(kX)return e.focus(kX);let t=DX(e);e.focus(kX==null?{get preventScroll(){return kX={preventScroll:!0},!0}}:void 0),kX||(kX=!1,OX(t))}var jX;function MX(e,t,n=t){let r=jX||=document.createRange();return r.setEnd(e,n),r.setStart(e,t),r}function NX(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let a=new KeyboardEvent(`keydown`,i);a.synthetic=!0,e.dispatchEvent(a);let o=new KeyboardEvent(`keyup`,i);return o.synthetic=!0,e.dispatchEvent(o),a.defaultPrevented||o.defaultPrevented}function PX(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function FX(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,bX(n));;)if(r){if(n.nodeType!=1)return!1;let e=n.childNodes[r-1];e.contentEditable==`false`?r--:(n=e,r=bX(n))}else if(n==e)return!0;else r=_X(n),n=n.parentNode}function IX(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function LX(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r>0)return{node:n,offset:r};else if(n.nodeType==1&&r>0){if(n.contentEditable==`false`)return null;n=n.childNodes[r-1],r=bX(n)}else if(n.parentNode&&!vX(n))r=_X(n),n=n.parentNode;else return null}function RX(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};else if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable==`false`)return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!vX(n))r=_X(n)+1,n=n.parentNode;else return null}var zX=class e{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(t,n){return new e(t.parentNode,_X(t),n)}static after(t,n){return new e(t.parentNode,_X(t)+1,n)}},BX=(function(e){return e[e.LTR=0]=`LTR`,e[e.RTL=1]=`RTL`,e})(BX||={}),VX=BX.LTR,HX=BX.RTL;function UX(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}var WX=UX(`88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008`),GX=UX(`4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333`),KX=Object.create(null),qX=[];for(let e of[`()`,`[]`,`{}`]){let t=e.charCodeAt(0),n=e.charCodeAt(1);KX[t]=n,KX[n]=-t}function JX(e){return e<=247?WX[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?GX[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}var YX=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,XX=class{get dir(){return this.level%2?HX:VX}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let i=-1;for(let a=0;a<e.length;a++){let o=e[a];if(o.from<=t&&o.to>=t){if(o.level==n)return a;(i<0||(r==0?e[i].level>o.level:r<0?o.from<t:o.to>t))&&(i=a)}}if(i<0)throw RangeError(`Index out of range`);return i}};function ZX(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!ZX(r.inner,i.inner))return!1}return!0}var QX=[];function $X(e,t,n,r,i){for(let a=0;a<=r.length;a++){let o=a?r[a-1].to:t,s=a<r.length?r[a].from:n,c=a?256:i;for(let t=o,n=c,r=c;t<s;t++){let i=JX(e.charCodeAt(t));i==512?i=n:i==8&&r==4&&(i=16),QX[t]=i==4?2:i,i&7&&(r=i),n=i}for(let e=o,t=c,r=c;e<s;e++){let i=QX[e];if(i==128)e<s-1&&t==QX[e+1]&&t&24?i=QX[e]=t:QX[e]=256;else if(i==64){let i=e+1;for(;i<s&&QX[i]==64;)i++;let a=e&&t==8||i<n&&QX[i]==8?r==1?1:8:256;for(let t=e;t<i;t++)QX[t]=a;e=i-1}else i==8&&r==1&&(QX[e]=1);t=i,i&7&&(r=i)}}}function eZ(e,t,n,r,i){let a=i==1?2:1;for(let o=0,s=0,c=0;o<=r.length;o++){let l=o?r[o-1].to:t,u=o<r.length?r[o].from:n;for(let t=l,n,r,o;t<u;t++)if(r=KX[n=e.charCodeAt(t)]){if(r<0){for(let e=s-3;e>=0;e-=3)if(qX[e+1]==-r){let n=qX[e+2],r=n&2?i:n&4?n&1?a:i:0;r&&(QX[t]=QX[qX[e]]=r),s=e;break}}else if(qX.length==189)break;else qX[s++]=t,qX[s++]=n,qX[s++]=c}else if((o=QX[t])==2||o==1){let e=o==i;c=+!e;for(let t=s-3;t>=0;t-=3){let n=qX[t+2];if(n&2)break;if(e)qX[t+2]|=2;else{if(n&4)break;qX[t+2]|=4}}}}}function tZ(e,t,n,r){for(let i=0,a=r;i<=n.length;i++){let o=i?n[i-1].to:e,s=i<n.length?n[i].from:t;for(let c=o;c<s;){let o=QX[c];if(o==256){let o=c+1;for(;;)if(o==s){if(i==n.length)break;o=n[i++].to,s=i<n.length?n[i].from:t}else if(QX[o]==256)o++;else break;let l=a==1,u=l==((o<t?QX[o]:r)==1)?l?1:2:r;for(let t=o,r=i,a=r?n[r-1].to:e;t>c;)t==a&&(t=n[--r].from,a=r?n[r-1].to:e),QX[--t]=u;c=o}else a=o,c++}}}function nZ(e,t,n,r,i,a,o){let s=r%2?2:1;if(r%2==i%2)for(let c=t,l=0;c<n;){let t=!0,u=!1;if(l==a.length||c<a[l].from){let e=QX[c];e!=s&&(t=!1,u=e==16)}let d=!t&&s==1?[]:null,f=t?r:r+1,p=c;run:for(;;)if(l<a.length&&p==a[l].from){if(u)break run;let m=a[l];if(!t)for(let e=m.to,t=l+1;;){if(e==n)break run;if(t<a.length&&a[t].from==e)e=a[t++].to;else if(QX[e]==s)break run;else break}l++,d?d.push(m):(m.from>c&&o.push(new XX(c,m.from,f)),rZ(e,m.direction==VX==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.to),p=m.to}else if(p==n||(t?QX[p]!=s:QX[p]==s))break;else p++;d?nZ(e,c,p,r+1,i,d,o):c<p&&o.push(new XX(c,p,f)),c=p}else for(let c=n,l=a.length;c>t;){let n=!0,u=!1;if(!l||c>a[l-1].to){let e=QX[c-1];e!=s&&(n=!1,u=e==16)}let d=!n&&s==1?[]:null,f=n?r:r+1,p=c;run:for(;;)if(l&&p==a[l-1].to){if(u)break run;let m=a[--l];if(!n)for(let e=m.from,n=l;;){if(e==t)break run;if(n&&a[n-1].to==e)e=a[--n].from;else if(QX[e-1]==s)break run;else break}d?d.push(m):(m.to<c&&o.push(new XX(m.to,c,f)),rZ(e,m.direction==VX==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.from),p=m.from}else if(p==t||(n?QX[p-1]!=s:QX[p-1]==s))break;else p--;d?nZ(e,p,c,r+1,i,d,o):p<c&&o.push(new XX(p,c,f)),c=p}}function rZ(e,t,n,r,i,a,o){let s=t%2?2:1;$X(e,i,a,r,s),eZ(e,i,a,r,s),tZ(i,a,r,s),nZ(e,i,a,t,n,r,o)}function iZ(e,t,n){if(!e)return[new XX(0,0,+(t==HX))];if(t==VX&&!n.length&&!YX.test(e))return aZ(e.length);if(n.length)for(;e.length>QX.length;)QX[QX.length]=256;let r=[],i=t==VX?0:1;return rZ(e,i,i,n,0,e.length,r),r}function aZ(e){return[new XX(0,e,0)]}var oZ=``;function sZ(e,t,n,r,i){if(!e.length)return null;let a=r.head-e.from,o;if(r.head==e.from&&r.assoc<0){if(!i)return null;a=t[o=0].side(!1,n)}else if(r.head==e.to&&r.assoc>0){if(i)return null;a=t[o=t.length-1].side(!0,n)}else o=XX.find(t,a,r.bidiLevel??-1,r.assoc);let s=t[o],c=s.side(i,n);if(a==c){let e=o+=i?1:-1;if(e<0||e>=t.length)return null;s=t[o=e],a=s.side(!i,n),c=s.side(i,n)}let l=Jq(e.text,a,s.forward(i,n));(l<s.from||l>s.to)&&(l=c),oZ=e.text.slice(Math.min(a,l),Math.max(a,l));let u=o==(i?t.length-1:0)?null:t[o+(i?1:-1)];if(l==c){if(!u)return i?Y.cursor(e.to,1):Y.cursor(e.from,-1);if(u.level+ +!i<s.level)return Y.cursor(u.side(!i,n)+e.from,u.forward(i,n)?1:-1,u.level)}return Y.cursor(l+e.from,s.forward(i,n)?-1:1,s.level)}function cZ(e,t,n){for(let r=t;r<n;r++){let t=JX(e.charCodeAt(r));if(t==1)return VX;if(t==2||t==4)return HX}return VX}var lZ=X.define(),uZ=X.define(),dZ=X.define(),fZ=X.define(),pZ=X.define(),mZ=X.define(),hZ=X.define(),gZ=X.define(),_Z=X.define(),vZ=X.define({combine:e=>e.some(e=>e)}),yZ=X.define({combine:e=>e.some(e=>e)}),bZ=X.define(),xZ=class e{constructor(e,t,n,r,i,a=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i,this.isSnapshot=a}map(t){return t.empty?this:new e(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new e(Y.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},SZ=BJ.define({map:(e,t)=>e.map(t)}),CZ=BJ.define();function wZ(e,t,n){let r=e.facet(fZ);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+`:`,t):console.error(t))}var TZ=X.define({combine:e=>!e.length||e[0]}),EZ=0,DZ=X.define({combine(e){return e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})}}),OZ=class e{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(DZ.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(DZ.of({plugin:this,arg:e}))}static define(t,n){let{eventHandlers:r,eventObservers:i,provide:a,decorations:o}=n||{};return new e(EZ++,t,r,i,e=>{let t=[];return o&&t.push(MZ.of(t=>{let n=t.plugin(e);return n?o(n):Q.none})),a&&t.push(a(e)),t})}static fromClass(t,n){return e.define((e,n)=>new t(e,n),n)}},kZ=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(!this.value){if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){wZ(e.state,t,`CodeMirror plugin crashed`),this.deactivate()}}else if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(wZ(e.state,t,`CodeMirror plugin crashed`),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}return this}destroy(e){if(this.value?.destroy)try{this.value.destroy()}catch(t){wZ(e.state,t,`CodeMirror plugin crashed`)}}deactivate(){this.spec=this.value=null}},AZ=X.define(),jZ=X.define(),MZ=X.define(),NZ=X.define(),PZ=X.define(),FZ=X.define(),IZ=X.define();function LZ(e,t){let n=e.state.facet(IZ);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return cY.spans(r,t.from,t.to,{point(){},span(e,n,r,a){let o=e-t.from,s=n-t.from,c=i;for(let e=r.length-1;e>=0;e--,a--){let n=r[e].spec.bidiIsolate,i;if(n??=cZ(t.text,o,s),a>0&&c.length&&(i=c[c.length-1]).to==o&&i.direction==n)i.to=s,c=i.inner;else{let e={from:o,to:s,direction:n,inner:[]};c.push(e),c=e.inner}}}}),i}var RZ=X.define();function zZ(e){let t=0,n=0,r=0,i=0;for(let a of e.state.facet(RZ)){let o=a(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:t,right:n,top:r,bottom:i}}var BZ=X.define(),VZ=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(t){return new e(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,a=0,o=0;;){let s=i<t.length?t[i].fromB:1e9,c=a<n.length?n[a]:1e9,l=Math.min(s,c);if(l==1e9)break;let u=l+o,d=l,f=u;for(;;)if(a<n.length&&n[a]<=d){let e=n[a+1];a+=2,d=Math.max(d,e);for(let e=i;e<t.length&&t[e].fromB<=d;e++)o=t[e].toA-t[e].toB;f=Math.max(f,e+o)}else if(i<t.length&&t[i].fromB<=d){let e=t[i++];d=Math.max(d,e.toB),f=Math.max(f,e.toA),o=e.toA-e.toB}else break;r.push(new e(u,f,l,d))}return r}},HZ=class e{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=rJ.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new VZ(e,t,n,i))),this.changedRanges=r}static create(t,n,r){return new e(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},UZ=[],WZ=class{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return UZ}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let e=this.domAttrs;e&&eX(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:``)+(this.breakAfter?`#`:``)}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError(`Invalid child in posBefore`)}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t,n){return null}domPosFor(e,t){let n=_X(this.dom),r=this.length?e>0:t>0;return new zX(this.parent.dom,n+ +!!r,e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof qZ)return e;return null}static get(e){return e.cmTile}},GZ=class extends WZ{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,n=null,r,i=e?.node==t?e:null,a=0;for(let o of this.children){if(o.sync(e),a+=o.length+o.breakAfter,r=n?n.nextSibling:t.firstChild,i&&r!=o.dom&&(i.written=!0),o.dom.parentNode==t)for(;r&&r!=o.dom;)r=KZ(r);else t.insertBefore(o.dom,r);n=o.dom}for(r=n?n.nextSibling:t.firstChild,i&&r&&(i.written=!0);r;)r=KZ(r);this.length=a}};function KZ(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var qZ=class extends GZ{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=WZ.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,i=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&i++,r=t.pop()}else{let a=n.children[r++];if(a instanceof JZ)t.push(r),n=a,r=0;else{let t=i+a.length,n=e(a,i);if(n!==void 0)return n;i=t+a.breakAfter}}}resolveBlock(e,t){let n,r=-1,i,a=-1;if(this.blockTiles((o,s)=>{let c=s+o.length;if(e>=s&&e<=c){if(o.isWidget()&&t>=-1&&t<=1){if(o.flags&32)return!0;o.flags&16&&(n=void 0)}(s<e||e==c&&(t<-1?o.length:o.covers(1)))&&(!n||!o.isWidget()&&n.isWidget())&&(n=o,r=e-s),(c>e||e==s&&(t>1?o.length:o.covers(-1)))&&(!i||!o.isWidget()&&i.isWidget())&&(i=o,a=e-s)}}),!n&&!i)throw Error(`No tile at position `+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:a}}},JZ=class e extends GZ{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},YZ=class e extends GZ{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(t,n,r){let i=new e(n||document.createElement(`div`),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,i=-1,a=null,o=-1;function s(e,c){for(let l=0,u=0;l<e.children.length&&u<=c;l++){let d=e.children[l],f=u+d.length;f>=c&&(d.isComposite()?s(d,c-u):(!a||a.isHidden&&(t>0&&!(a.flags&32)||n&&ZZ(a,d)))&&(f>c||d.flags&32&&t<=1)?(a=d,o=c-u):(u<c||d.flags&16&&!d.isHidden&&t>=-1)&&(r=d,i=c-u)),u=f}}s(this,e);let c=(t<0?r:a)||r||a;return c?{tile:c,offset:c==r?i:o}:null}coordsIn(e,t,n){let r=this.resolveInline(e,t,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),t,n):XZ(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new zX(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,e.flags&16?1:e.flags&32?-1:t);let i=n.tile.parent,a=!1;for(let e of i.children){if(a)return new zX(e.dom,0);e==n.tile&&(a=!0)}}return new zX(this.dom,0)}};function XZ(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=hX(t);return n[n.length-1]||null}function ZZ(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}var QZ=class e extends GZ{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},$Z=class e extends WZ{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t,n){let r=this.dom.nodeValue.length;e>r&&(e=r);let i=e,a=e,o=0;e==0&&t<0||e==r&&t>=0?Z.chrome||Z.gecko||(e?(i--,o=1):a<r&&(a++,o=-1)):t<0?i--:a<r&&a++;let s=MX(this.dom,i,a).getClientRects();if(!s.length)return null;let c=s[(o?o<0:t>=0)?0:s.length-1];return Z.safari&&!o&&c.width==0&&(c=Array.prototype.find.call(s,e=>e.width)||c),n==null?c:xX(c,(o?o>0:t<0)==n)}static of(t,n){let r=new e(n||document.createTextNode(t),t);return n||(r.flags|=2),r}},eQ=class e extends WZ{constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return xX(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=this.flags&16?!0:this.flags&32?!1:e>0;for(let i=r?t.length-1:0;n=t[i],!(e>0?i==0:i==t.length-1||n.top<n.bottom);i+=r?-1:1);return xX(n,!r)}}get overrideDOMText(){if(!this.length)return Lq.empty;let{root:e}=this;if(!e)return Lq.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(t,n,r,i,a){return a||(a=t.toDOM(n),t.editable||(a.contentEditable=`false`)),new e(a,r,t,i)}},tQ=class extends WZ{constructor(e){let t=document.createElement(`img`);t.className=`cm-widgetBuffer`,t.setAttribute(`aria-hidden`,`true`),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return Lq.empty}coordsIn(e,t,n){let r=this.dom.getBoundingClientRect();return n==null?r:xX(r,t>0==n)}},nQ=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:i,beforeBreak:a,parents:o}=this;for(;e||t>0;)if(!r.isComposite()){let t=r.length;if(i<t&&e){let a=Math.min(e,t-i);n&&n.skip(r,i,i+a),e-=a,i+=a}if(i==t)a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++;else if(!e)break}else if(a){if(!e)break;n&&n.break(),e--,a=!1}else if(i==r.children.length){if(!e&&!o.length)break;n&&n.leave(r),a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++}else{let s=r.children[i],c=s.breakAfter;(t>0?s.length<=e:s.length<e)&&(!n||n.skip(s,0,s.length)!==!1||!s.isComposite)?(a=!!c,i++,e-=s.length):(o.push({tile:r,index:i}),r=s,i=0,n&&s.isComposite()&&n.enter(s))}return this.tile=r,this.index=i,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},rQ=class{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}},iQ=class{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){this.flushBuffer();let i=this.ensureMarks(t,n),a=i.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let t=i.children[i.children.length-1]=new $Z(a.dom,a.text+e);t.parent=i}else i.append(r||$Z.of(e,this.cache.find($Z)?.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?mQ(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],i=r.lastChild;if(i instanceof QZ&&i.mark.eq(n.mark))i.dom!=n.dom&&i.setDOM(mQ(n.dom)),r=i;else{let{dom:e}=n;this.cache.reused.get(n)&&WZ.get(n.dom)&&(e=mQ(n.dom));let t=QZ.of(n.mark,e);r.append(t),r=t}this.cache.reused.set(n,2)}let i=WZ.get(e.text);i&&this.cache.reused.set(i,2);let a=new $Z(e.text,e.text.nodeValue);a.flags|=8,this.pos=e.range.toB,r.append(a)}addInlineWidget(e,t,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let i=this.ensureMarks(t,n);!r&&!(e.flags&16)&&i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){e||=dQ;let n=YZ.start(e,t||this.cache.find(YZ)?.dom,!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){let n=this.curLine;for(let r=e.length-1;r>=0;r--){let i=e[r],a;if(t>0&&(a=n.lastChild)&&a instanceof QZ&&a.mark.eq(i))n=a,t--;else{let e=QZ.of(i,this.cache.find(QZ,e=>e.mark.eq(i))?.dom);n.append(e),n=e,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!lQ(this.curLine,!1)||e.dom.nodeName!=`BR`&&e.isWidget()&&!(Z.ios&&lQ(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(gQ,0,32)||new eQ(gQ.toDOM(),0,gQ,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=e.rank*102+e.value.rank,n=new rQ(e.from,e.to,e.value,t),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){this.updateBlockWrappers();let e=this.root;for(let t of this.wrappers){let n=e.lastChild;if(t.from<this.pos&&n instanceof JZ&&n.wrapper.eq(t.wrapper))e=n;else{let n=JZ.of(t.wrapper,this.cache.find(JZ,e=>e.wrapper.eq(t.wrapper))?.dom);e.append(n),e=n}}return e}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(tQ,void 0,1);return n&&(n.flags=t),n||new tQ(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},aQ=class{constructor(e){this.skipCount=0,this.text=``,this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text=``,this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw Error(`Ran out of text content when drawing inline views`);this.text=t;let i=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,i)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}},oQ=[eQ,YZ,$Z,QZ,tQ,JZ,qZ];for(let e=0;e<oQ.length;e++)oQ[e].bucket=e;var sQ=class{constructor(e){this.view=e,this.buckets=oQ.map(()=>[]),this.index=oQ.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,i=this.buckets[r],a=this.index[r];for(let e=0;e<i.length;e++){let o=(e+a)%i.length,s=i[o];if((!t||t(s))&&!this.reused.has(s))return i.splice(o,1),o<a&&this.index[r]--,this.reused.set(s,n),s}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let i=0,a=0;;i++){if(i==r.length){if(a)return null;a=1,i=0}let o=r[i];if(!this.reused.has(o)&&(a==0?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view,o.widget)))return r.splice(i,1),i<this.index[0]&&this.index[0]--,o.widget==e&&o.length==t&&(o.flags&497)==n?(this.reused.set(o,1),o):(this.reused.set(o,2),new eQ(o.dom,t,e,o.flags&-498|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},cQ=class{constructor(e,t,n,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new sQ(e),this.text=new aQ(e.state.doc),this.builder=new iQ(this.cache,new qZ(e,e.contentDOM),cY.iter(n)),this.cache.reused.set(t,2),this.old=new nQ(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,i=0,a=0;;){let o=a<e.length?e[a++]:null,s=o?o.fromA:this.old.root.length;if(s>r){let e=s-r;this.preserve(e,!a,!o),r=s,i+=e}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(i,t.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,o.toA),this.emit(t.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(i,o.toB)),i=o.toB,r=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=pQ(this.old),i=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget()){if(this.openWidget)this.builder.continueWidget(n-t);else{let a=n>0||t<e.length?eQ.of(e.widget,this.view,n-t,e.flags&496,this.cache.maybeReuse(e)):this.cache.reuse(e);a.flags&256?(a.flags&=-2,this.builder.addBlockWidget(a)):(this.builder.ensureLine(null),this.builder.addInlineWidget(a,r,i),i=r.length)}}else if(e.isText())this.builder.ensureLine(null),!t&&n==e.length&&!this.cache.reused.has(e)?this.builder.addText(e.text,r,i,this.cache.reuse(e)):(this.cache.add(e),this.builder.addText(e.text.slice(t,n),r,i)),i=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof tQ)this.cache.add(e);else if(e instanceof QZ)this.builder.ensureLine(null),this.builder.addMark(e,r,i),this.cache.reused.set(e,1),i=r.length;else return!1;this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof QZ&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&=i=0:e instanceof QZ&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,i=-1,a=cY.spans(this.decorations,e,t,{point:(e,t,a,o,s,c)=>{if(a instanceof sX){if(this.disallowBlockEffectsFor[c]){if(a.block)throw RangeError(`Block decorations may not be specified via plugins`);if(t>this.view.state.doc.lineAt(e).to)throw RangeError(`Decorations that replace line breaks may not be specified via plugins`)}if(i=o.length,s>o.length)r.continueWidget(t-e);else{let i=a.widget||(a.block?hQ.block:hQ.inline),c=uQ(a),l=this.cache.findWidget(i,t-e,c)||eQ.of(i,this.view,t-e,c);a.block?(a.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(l)):(r.ensureLine(n),r.addInlineWidget(l,o,s))}n=null}else n=fQ(n,a);t>e&&this.text.skip(t-e)},span:(e,t,a,o)=>{for(let i=e;i<t;){let s=this.text.next(Math.min(512,t-i));s==null?(r.addLineStartIfNotCovered(n),r.addBreak(),i++):(r.ensureLine(n),r.addText(s,a,i==e?o:a.length),i+=s.length),n=null}i=a.length}});i>-1&&(this.openWidget=a>i),this.openWidget||r.addLineStartIfNotCovered(n),this.openMarks=a}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let e=WZ.get(r);if(r==this.view.contentDOM)break;e instanceof QZ?t.push(e):e?.isLine()?n=e:e instanceof JZ||(r.nodeName==`DIV`&&!n?n=new YZ(r,dQ):n||t.push(QZ.of(new aX({tagName:r.nodeName.toLowerCase(),attributes:nX(r)}),r)))}return n?{line:n,marks:t}:null}};function lQ(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function uQ(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}var dQ={class:`cm-line`};function fQ(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r?e:(e||={class:`cm-line`},n&&ZY(n,e),r&&(e.class+=` `+r),e)}function pQ(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof QZ&&t.push(r.mark)}return t}function mQ(e){let t=WZ.get(e);return t&&t.setDOM(e.cloneNode()),e}var hQ=class extends rX{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};hQ.inline=new hQ(`span`),hQ.block=new hQ(`div`);var gQ=new class extends rX{toDOM(){return document.createElement(`br`)}get isHidden(){return!0}get editable(){return!0}},_Q=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Q.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new qZ(e,e.contentDOM),this.updateInner([new VZ(0,0,0,e.state.doc.length)],null)}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(this.domChanged?.newSel?n=this.domChanged.newSel.head:!OQ(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let r=n>-1?xQ(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){let{from:n,to:r}=this.hasComposition;t=new VZ(n,r,e.changes.mapPos(n,-1),e.changes.mapPos(r,1)).addToSet(t.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(Z.ie||Z.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,a=this.blockWrappers;this.updateDeco();let o=wQ(i,this.decorations,e.changes);o.length&&(t=VZ.extendWithRanges(t,o));let s=EQ(a,this.blockWrappers,e.changes);return s.length&&(t=VZ.extendWithRanges(t,s)),r&&!t.some(e=>e.fromA<=r.range.fromA&&e.toA>=r.range.toA)&&(t=r.range.addToSet(t.slice())),this.tile.flags&2&&t.length==0?!1:(this.updateInner(t,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,r=new cQ(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&WZ.get(t.text)&&r.cache.reused.set(WZ.get(t.text),2),this.tile=r.run(e,t),vQ(n,r.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+`px`,this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+`px`:``;let r=Z.chrome||Z.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=``});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof kQ&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(CZ)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,i=r==n,a=!i&&!(this.view.state.facet(TZ)||n.tabIndex>-1)&&mX(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(i||t||a))return;let o=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,c,l;if(s.empty?l=c=this.inlineDOMNearPos(s.anchor,s.assoc||1):(l=this.inlineDOMNearPos(s.head,s.head==s.from?1:-1),c=this.inlineDOMNearPos(s.anchor,s.anchor==s.from?1:-1)),Z.gecko&&s.empty&&!this.hasComposition&&yQ(c)){let e=document.createTextNode(``);this.view.observer.ignore(()=>c.node.insertBefore(e,c.node.childNodes[c.offset]||null)),c=l=new zX(e,0),o=!0}let u=this.view.observer.selectionRange;(o||!u.focusNode||(!gX(c.node,c.offset,u.anchorNode,u.anchorOffset)||!gX(l.node,l.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,s))&&(this.view.observer.ignore(()=>{Z.android&&Z.chrome&&n.contains(u.focusNode)&&DQ(u.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let e=fX(this.view.root);if(e){if(s.empty){if(Z.gecko){let e=SQ(c.node,c.offset);if(e&&e!=3){let t=(e==1?LX:RX)(c.node,c.offset);t&&(c=new zX(t.node,t.offset))}}e.collapse(c.node,c.offset),s.bidiLevel!=null&&e.caretBidiLevel!==void 0&&(e.caretBidiLevel=s.bidiLevel)}else if(e.extend){e.collapse(c.node,c.offset);try{e.extend(l.node,l.offset)}catch{}}else{let t=document.createRange();s.anchor>s.head&&([c,l]=[l,c]),t.setEnd(l.node,l.offset),t.setStart(c.node,c.offset),e.removeAllRanges(),e.addRange(t)}}a&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,l)),this.impreciseAnchor=c.precise?null:new zX(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new zX(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&gX(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=fX(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let a=this.lineAt(t.head,t.assoc);if(!a)return;let o=a.posAtStart;if(t.head==o||t.head==o+a.length)return;let s=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!s||!c||s.bottom>c.top)return;let l=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(l.node,l.offset),n.modify(`move`,t.assoc<0?`forward`:`backward`,`lineboundary`),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,i)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let i;if(e==n.dom)i=n.dom.childNodes[t];else{let r=bX(e)==0?0:t==0?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;r==0&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}i=r<0?e:e.nextSibling}if(i==n.dom.firstChild)return r;for(;i&&!WZ.get(i);)i=i.nextSibling;if(!i)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==i)return t;t+=r.length+r.breakAfter}}else if(n.isText())return e==n.dom?r+t:r+(t?n.length:0);else return r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(r,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,i=!1,a,o=-1,s=!1;return this.tile.blockTiles((t,c)=>{if(t.isWidget()){if(t.flags&32&&c>=e)return!0;t.flags&16&&(i=!0)}else{let l=c+t.length;if(c<=e&&(n=t,r=e-c,i=l<e),l>=e&&!a&&(a=t,o=e-c,s=c>e),c>e&&a)return!0}}),!n&&!a?this.domAtPos(e,t):(i&&a?n=null:s&&n&&(a=null),n&&t<0||!a?n.domIn(r,t):a.domIn(o,t))}coordsAt(e,t,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,t);return r.isWidget()?r.widget instanceof kQ?null:r.coordsInWidget(i,t,!0):r.coordsIn(i,t,n)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(e,t){if(e.isComposite())for(let n of e.children){if(n.length>=t){let e=r(n,t);if(e)return e}if(t-=n.length,t<0)break}else if(e.isText()&&t<e.length){let n=Jq(e.text,t);if(n==t)return null;let r=MX(e.dom,t,n).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}return r(t,n)}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,i=this.view.contentDOM.clientWidth,a=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,s=this.view.textDirection==BX.LTR,c=0,l=(e,u,d)=>{for(let f=0;f<e.children.length&&!(u>r);f++){let r=e.children[f],p=u+r.length,m=r.dom.getBoundingClientRect(),{height:h}=m;if(d&&!f&&(c+=m.top-d.top),r instanceof JZ)p>n&&l(r,u,m);else if(u>=n&&(c>0&&t.push(-c),t.push(h+c),c=0,a)){let e=r.dom.lastChild,t=e?hX(e):[];if(t.length){let e=t[t.length-1],n=s?e.right-m.left:m.right-e.left;n>o&&(o=n,this.minWidth=i,this.minWidthFrom=u,this.minWidthTo=p)}}d&&f==e.children.length-1&&(c+=d.bottom-m.bottom),u=p+r.breakAfter}};return l(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction==`rtl`?BX.RTL:BX.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=hX(r.dom);if(e.length!=1)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;let t=document.createElement(`div`),n,r,i;return t.className=`cm-line`,t.style.width=`99999px`,t.style.position=`absolute`,t.textContent=`abc def ghi jkl mno pqr stu`,this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let e=hX(t.firstChild)[0];n=t.getBoundingClientRect().height,r=e&&e.width?e.width/27:7,i=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],a=i?i.from-1:this.view.state.doc.length;if(a>n){let r=(t.lineBlockAt(a).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(Q.replace({widget:new kQ(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,a))}if(!i)break;n=i.to+1}return Q.set(e)}updateDeco(){let e=1,t=this.view.state.facet(MZ).map(t=>(this.dynamicDecorationMap[e++]=typeof t==`function`)?t(this.view):t),n=!1,r=this.view.state.facet(PZ).map((e,t)=>{let r=typeof e==`function`;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(cY.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(NZ).map(e=>typeof e==`function`?e(this.view):e)}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(bZ))try{if(t(this.view,e.range,e))return!0}catch(e){wZ(this.view.state,e,`scroll handler`)}let{range:t}=e,n=this.coordsAt(t.head,t.assoc||(t.head>t.anchor?-1:1)),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let i=zZ(this.view),a={left:n.left-i.left,top:n.top-i.top,right:n.right+i.right,bottom:n.bottom+i.bottom},{offsetWidth:o,offsetHeight:s}=this.view.scrollDOM;if(wX(this.view.scrollDOM,a,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,o),-o),Math.max(Math.min(e.yMargin,s),-s),this.view.textDirection==BX.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(n.top>window.visualViewport.offsetTop+window.visualViewport.height||n.bottom<window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(t.head,1);if(e){let t=DX(e.dom);e.dom.scrollIntoView({block:`nearest`}),OX(t,!1)}}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){vQ(this.tile)}};function vQ(e,t){let n=t?.get(e);if(n!=1){n??e.destroy();for(let n of e.children)vQ(n,t)}}function yQ(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable==`false`)&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable==`false`)}function bQ(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=LX(n.focusNode,n.focusOffset),i=RX(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let t=WZ.get(i.node);if(!t||t.isText()&&t.text!=i.node.nodeValue)a=i;else if(e.docView.lastCompositionAfterCursor){let e=WZ.get(r.node);!e||e.isText()&&e.text!=r.node.nodeValue||(a=i)}}if(e.docView.lastCompositionAfterCursor=a!=r,!a)return null;let o=t-a.offset;return{from:o,to:o+a.node.nodeValue.length,node:a.node}}function xQ(e,t,n){let r=bQ(e,n);if(!r)return null;let{node:i,from:a,to:o}=r,s=i.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(r.from,r.to)!=s)return null;let c=t.invertedDesc;return{range:new VZ(c.mapPos(a),c.mapPos(o),a,o),text:i}}function SQ(e,t){return e.nodeType==1?(t&&e.childNodes[t-1].contentEditable==`false`?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable==`false`?2:0):0}var CQ=class{constructor(){this.changes=[]}compareRange(e,t){uX(e,t,this.changes)}comparePoint(e,t){uX(e,t,this.changes)}boundChange(e){uX(e,e,this.changes)}};function wQ(e,t,n){let r=new CQ;return cY.compare(e,t,n,r),r.changes}var TQ=class{constructor(){this.changes=[]}compareRange(e,t){uX(e,t,this.changes)}comparePoint(){}boundChange(e){uX(e,e,this.changes)}};function EQ(e,t,n){let r=new TQ;return cY.compare(e,t,n,r),r.changes}function DQ(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable==`false`)return!0;return!1}function OQ(e,t){let n=!1;return t&&e.iterChangedRanges((e,r)=>{e<t.to&&r>t.from&&(n=!0)}),n}var kQ=class extends rX{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement(`div`);return e.className=`cm-gap`,this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+`px`,!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function AQ(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(i.length==0)return Y.cursor(t);a==0?n=1:a==i.length&&(n=-1);let o=a,s=a;n<0?o=Jq(i.text,a,!1):s=Jq(i.text,a);let c=r(i.text.slice(o,s));for(;o>0;){let e=Jq(i.text,o,!1);if(r(i.text.slice(e,o))!=c)break;o=e}for(;s<i.length;){let e=Jq(i.text,s);if(r(i.text.slice(s,e))!=c)break;s=e}return Y.undirectionalRange(o+i.from,s+i.from)}function jQ(e,t,n,r,i){let a=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>e.defaultLineHeight*1.5){let t=e.viewState.heightOracle.textHeight,r=Math.floor((i-n.top-(e.defaultLineHeight-t)*.5)/t);a+=r*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(n.from,n.to);return n.from+CY(o,a,e.state.tabSize)}function MQ(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let i of r.type){if(i.from>t)break;if(!(i.to<t)){if(i.from<t&&i.to>t)return i;(!e||i.type==iX.Text&&(e.type!=i.type||(n<0?i.from<t:i.to>t)))&&(e=i)}}return e||r}return r}function NQ(e,t,n,r){let i=MQ(e,t.head,t.assoc||-1),a=!r||i.type!=iX.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(a){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(i.from),o=e.posAtCoords({x:n==(r==BX.LTR)?t.right-1:t.left+1,y:(a.top+a.bottom)/2});if(o!=null)return Y.cursor(o,n?-1:1)}return Y.cursor(n?i.to:i.from,n?-1:1)}function PQ(e,t,n,r){let i=e.state.doc.lineAt(t.head),a=e.bidiSpans(i),o=e.textDirectionAt(i.from);for(let s=t,c=null;;){let t=sZ(i,a,o,s,n),l=oZ;if(!t){if(i.number==(n?e.state.doc.lines:1))return s;l=`
26
+ `,i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),t=n?Y.cursor(i.from,-1):Y.cursor(i.to,1)}if(!c){if(!r)return t;c=r(l)}else if(!c(l))return s;s=t}}function FQ(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==XJ.Space&&(i=t),i==t}}function IQ(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return Y.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),u=e.documentTop;if(l)o??=l.left-c.left,s=a<0?l.top:l.bottom;else{let t=e.viewState.lineBlockAt(i);o??=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-t.from)),s=(a<0?t.top:t.bottom)+u}let d=c.left+o,f=e.viewState.heightOracle.textHeight>>1,p=r??f;for(let t=0;;t+=f){let r=s+(p+t)*a,i=VQ(e,{x:d,y:r},!1,a);if(n?r>c.bottom:r<c.top)return Y.cursor(i.pos,i.assoc);let l=e.coordsAtPos(i.pos,i.assoc),u=l?(l.top+l.bottom)/2:0;if(!l||(n?u>s:u<s))return Y.cursor(i.pos,i.assoc,void 0,o)}}function LQ(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,a)=>{if(t>e&&t<i){let a=r||n||(t-e<i-t?-1:1);t=a<0?e:i,r=a}});if(!r)return t}}function RQ(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],a=null;if(i.empty){let t=LQ(e,i.from,0);t!=i.from&&(a=Y.cursor(t,-1))}else{let t=LQ(e,i.from,-1),n=LQ(e,i.to,1);(t!=i.from||n!=i.to)&&(a=i.undirectional?Y.undirectionalRange(i.from,i.to):Y.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}a&&(n||=t.ranges.slice(),n[r]=a)}return n?Y.create(n,t.mainIndex):t}function zQ(e,t,n){let r=LQ(e.state.facet(FZ).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:Y.cursor(r,r<n.from?1:-1)}var BQ=class{constructor(e,t){this.pos=e,this.assoc=t}};function VQ(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),a=i.top+e.viewState.paddingTop,{x:o,y:s}=t,c=s-a,l;for(;;){if(c<0)return new BQ(0,1);if(c>e.viewState.docHeight)return new BQ(e.state.doc.length,-1);if(l=e.elementAtHeight(c),r==null)break;if(l.type==iX.Text){if(r<0?l.to<e.viewport.from:l.from>e.viewport.to)break;let t=e.docView.coordsAt(r<0?l.from:l.to,r>0?-1:1);if(t&&(r<0?t.top<=c+a:t.bottom>=c+a))break}let t=e.viewState.heightOracle.textHeight/2;c=r>0?l.bottom+t:l.top-t}if(e.viewport.from>=l.to||e.viewport.to<=l.from){if(n)return null;if(l.type==iX.Text){let t=jQ(e,i,l,o,s);return new BQ(t,t==l.from?1:-1)}}if(l.type!=iX.Text)return c<(l.top+l.bottom)/2?new BQ(l.from,1):new BQ(l.to,-1);let u=e.docView.lineAt(l.from,2);return(!u||u.length!=l.length)&&(u=e.docView.lineAt(l.from,-2)),new HQ(e,o,s,e.textDirectionAt(l.from)).scanTile(u,l.from)}var HQ=class{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[XX.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[XX.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t,n=!1){let r=0,i=e.length-1,a=new Set,o=this.bidiIn(e[0],e[i]),s,c,l=-1,u=1e9,d;search:for(;r<i;){let n=i-r,f=r+i>>1;adjust:if(a.has(f)){for(let e=1;e<n;e++){let t=f+e;if(t>=i&&(t-=n),!a.has(t)){f=t;break adjust}}break search}a.add(f);let p=t(f),m=0;if(p)for(let e=0;e<p.length;e++){let t=p[e];if(!(t.width==0&&p.length>1)){if(t.bottom<this.y)(!s||s.bottom<t.bottom)&&(s=t),m=1;else if(t.top>this.y)(!c||c.top>t.top)&&(c=t),m=-1;else{let e=t.left>this.x?this.x-t.left:t.right<this.x?this.x-t.right:0,n=Math.abs(e);n<u&&(l=f,u=n,d=t),e&&(m=e<0==(this.baseDir==BX.LTR)?-1:1)}}}m==-1&&(!o||this.baseDirAt(e[f],1))?i=f:m==1&&(!o||this.baseDirAt(e[f+1],-1))&&(r=f+1)}if(!d){if(!c&&!s)return{i:0,after:!1};let n=s&&(!c||this.y-s.bottom<c.top-this.y)?s:c;return this.y=(n.top+n.bottom)/2,this.scan(e,t,!0)}if(u&&!n){let{top:n,bottom:r}=d;if(s&&s.bottom>(n+n+r)/3)return this.y=s.bottom-1,this.scan(e,t,!0);if(c&&c.top<(n+r+r)/3)return this.y=c.top+1,this.scan(e,t,!0)}let f=(o?this.dirAt(e[l],1):this.baseDir)==BX.LTR;return{i:l,after:this.x>(d.left+d.right)/2==f}}scanText(e,t){let n=[];for(let r=0;r<e.length;r=Jq(e.text,r))n.push(t+r);n.push(t+e.length);let r=this.scan(n,r=>{let i=n[r]-t,a=n[r+1]-t;return MX(e.dom,i,a).getClientRects()});return r.after?new BQ(n[r.i+1],-1):new BQ(n[r.i],1)}scanTile(e,t){if(!e.length)return new BQ(t,1);if(e.children.length==1){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let r=0,i=t;r<e.children.length;r++)n.push(i+=e.children[r].length);let r=this.scan(n,t=>{let n=e.children[t];return n.flags&48?null:(n.dom.nodeType==1?n.dom:MX(n.dom,0,n.length)).getClientRects()}),i=e.children[r.i],a=n[r.i];return i.isText()?this.scanText(i,a):i.isComposite()?this.scanTile(i,a):r.after?new BQ(n[r.i+1],-1):new BQ(a,1)}},UQ=`￿`,WQ=class{constructor(e,t){this.points=e,this.view=t,this.text=``,this.lineSeparator=t.state.facet(tY.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=UQ}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let i=WZ.get(r),a=r.nextSibling;if(a==t){i?.breakAfter&&!a&&n!=this.view.contentDOM&&this.lineBreak();break}let o=WZ.get(a);(i&&o?i.breakAfter:(i?i.breakAfter:vX(r))||vX(a)&&(r.nodeName!=`BR`||i?.isWidget())&&this.text.length>e)&&!KQ(a,t)&&this.lineBreak(),r=a}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,a=1,o;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),a=this.lineSeparator.length):(o=r.exec(t))&&(i=o.index,a=o[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=a-1);n=i+a}}readNode(e){let t=WZ.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName==`BR`?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(GQ(e,n.node,n.offset)?t:0))}};function GQ(e,t,n){for(;;){if(!t||n<bX(t))return!1;if(t==e)return!0;n=_X(t)+1,t=t.parentNode}}function KQ(e,t){let n;for(;e!=t&&e;e=e.nextSibling){let t=WZ.get(e);if(!t?.isWidget())return!1;t&&(n||=[]).push(t)}if(n){for(let e of n)if(e.overrideDOMText?.length)return!1}return!0}var qQ=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},JQ=class{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text=``,this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:a}=e.docView,o=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=YQ(e.docView.tile,t,n,0))){let t=i||a?[]:e$(e),n=new WQ(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=t$(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!pX(e.contentDOM,t.focusNode)?o.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=a&&a.node==t.anchorNode&&a.offset==t.anchorOffset||!pX(e.contentDOM,t.anchorNode)?o.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((Z.ios||Z.chrome)&&n!=r&&Math.min(n,r)<=o.main.from&&Math.max(n,r)>=o.main.to&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),a=s.from-t,o=s.to-i;(a==0||a==1||t==0)&&(o==0||o==-1||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}if(e.inputState.composing>-1&&o.ranges.length>1)this.newSel=o.replaceRange(Y.range(r,n));else if(e.lineWrapping&&r==n&&!(o.main.empty&&o.main.head==n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),r=0;t&&(r=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=Y.create([Y.cursor(n,r)])}else this.newSel=Y.single(r,n)}}};function YQ(e,t,n,r){if(e.isComposite()){let i=-1,a=-1,o=-1,s=-1;for(let c=0,l=r,u=r;c<e.children.length;c++){let r=e.children[c],d=l+r.length;if(l<t&&d>n)return YQ(r,t,n,l);if(d>=t&&i==-1&&(i=c,a=l),l>n&&r.dom.parentNode==e.dom){o=c,s=u;break}u=d,l=d+r.breakAfter}return{from:a,to:s<0?r+e.length:s,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o<e.children.length&&o>=0?e.children[o].dom:null}}return e.isText()?{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function XQ(e,t){let n,{newSel:r}=t,{state:i}=e,a=i.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:r}=t.bounds,s=a.from,c=null;(o===8||Z.android&&t.text.length<r-e)&&(s=a.to,c=`end`);let l=i.doc.sliceString(e,r,UQ),u,d;!a.empty&&a.from>=e&&a.to<=r&&(t.typeOver||l!=t.text)&&l.slice(0,a.from-e)==t.text.slice(0,a.from-e)&&l.slice(a.to-e)==t.text.slice(u=t.text.length-(l.length-(a.to-e)))?n={from:a.from,to:a.to,insert:Lq.of(t.text.slice(a.from-e,u).split(UQ))}:(d=$Q(l,t.text,s-e,c))&&(Z.chrome&&o==13&&d.toB==d.from+2&&t.text.slice(d.from,d.toB)==`￿￿`&&d.toB--,n={from:e+d.from,to:e+d.toA,insert:Lq.of(t.text.slice(d.from,d.toB).split(UQ))})}else r&&(!e.hasFocus&&i.facet(TZ)||n$(r,a))&&(r=null);if(!n&&!r)return!1;if((Z.mac||Z.android)&&n&&n.from==n.to&&n.from==a.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute(`autocorrect`)==`off`?(r&&n.insert.length==2&&(r=Y.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:Lq.of([n.insert.toString().replace(`.`,` `)])}):i.doc.lineAt(a.from).to<a.to&&e.docView.lineHasWidget(a.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:a.from,to:a.to,insert:i.toText(e.inputState.insertingText)}:Z.chrome&&n&&n.from==n.to&&n.from==a.head&&n.insert.toString()==`
27
+ `&&e.lineWrapping&&(r&&=Y.single(r.main.anchor-1,r.main.head-1),n={from:a.from,to:a.to,insert:Lq.of([` `])}),n)return ZQ(e,n,r,o);if(r&&!n$(r,a)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin,n==`select.pointer`&&(r=RQ(i.facet(FZ).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}return!1}function ZQ(e,t,n,r=-1){if(Z.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(Z.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==` `)&&t.insert.length==1&&t.insert.lines==2&&NX(e.contentDOM,`Enter`,13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&NX(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&NX(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||=QQ(e,t,n);return e.state.facet(mZ).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function QQ(e,t,n){let r,i=e.state,a=i.selection.main,o=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let n=t.from<a.from?-1:1,r=n<0?a.from:a.to,s=LQ(i.facet(FZ).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:Y.cursor(t.from+t.insert.length,-1)};else if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=a.from<t.from?i.sliceDoc(a.from,t.from):``,o=a.to>t.to?i.sliceDoc(t.to,a.to):``;r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=i.changes(t),s=n&&n.main.to<=o.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&bQ(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(a.head);let d=a.to-t.to;r=i.changeByRange(n=>{if(n.from==a.from&&n.to==a.to)return{changes:o,range:s||n.map(o)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=l.from&&u<=l.to)return{range:n};let f=i.changes({from:u,to:r,insert:t.insert}),p=n.to-a.to;return{changes:f,range:s?Y.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(f)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let s=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=`.compose`,e.inputState.compositionFirstChange&&(s+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function $Q(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let o=e.length,s=t.length;for(;o>0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if(r==`end`){let e=Math.max(0,a-Math.min(o,s));n-=o+e-a}if(o<a&&e.length<t.length){let e=n<=a&&n>=o?a-n:0;a-=e,s=a+(s-o),o=a}else if(s<a){let e=n<=a&&n>=s?a-n:0;a-=e,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function e$(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new qQ(n,r)),(i!=n||a!=r)&&t.push(new qQ(i,a))),t}function t$(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n<0||r<0?null:n==r?Y.create([Y.cursor(r+t,-1)]):Y.single(n+t,r+t)}function n$(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}var r$=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText=``,this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Z.safari&&e.contentDOM.addEventListener(`input`,()=>null),Z.gecko&&B$(e.contentDOM.ownerDocument)}handleEvent(e){_$(this.view,e)&&!this.ignoreDuringComposition(e)&&(e.type==`keydown`&&this.keydown(e)||(this.view.updateState==0?this.runHandlers(e.type,e):Promise.resolve().then(()=>this.runHandlers(e.type,e))))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=o$(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if(e!=`scroll`){let i=!t[e].handlers.length,a=n[e];a&&i!=!a.handlers.length&&(r.removeEventListener(e,this.handleEvent),a=null),a||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)e!=`scroll`&&!t[e]&&r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&l$.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Z.android&&Z.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(Z.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(s$.some(t=>t.keyCode==e.keyCode)&&!e.ctrlKey||c$.indexOf(e.key)>-1&&e.ctrlKey)){let t={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};t.shiftKey&&Z.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&i$(this.view.win)&&(t.shiftKey=!1);let n=this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:t};return setTimeout(()=>{this.pendingIOSKey==n&&this.flushIOSKey()},50),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let t=this.pendingIOSKey;return!t||this.view.observer.pendingRecords().length||t.key==`Enter`&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,NX(this.view.contentDOM,t.key,t.keyCode,t.mods))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Z.safari&&!Z.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function i$(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function a$(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){wZ(n.state,e)}}}function o$(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(a$(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(a$(t.value,r))}}for(let e in v$)n(e).handlers.push(v$[e]);for(let e in y$)n(e).observers.push(y$[e]);return t}var s$=[{key:`Backspace`,keyCode:8,inputType:`deleteContentBackward`},{key:`Enter`,keyCode:13,inputType:`insertParagraph`},{key:`Enter`,keyCode:13,inputType:`insertLineBreak`},{key:`Delete`,keyCode:46,inputType:`deleteContentForward`}],c$=`dthko`,l$=[16,17,18,20,91,92,224,225],u$=6;function d$(e){return Math.max(0,e)*.7+8}function f$(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}var p$=class{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=TX(e.contentDOM),this.atoms=e.state.facet(FZ).map(t=>t(e));let i=e.contentDOM.ownerDocument;i.addEventListener(`mousemove`,this.move=this.move.bind(this)),i.addEventListener(`mouseup`,this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(tY.allowMultipleSelections)&&m$(e,t),this.dragging=g$(e,t)&&k$(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&f$(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,i=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:o}=this.scrollParents.y.getBoundingClientRect());let s=zZ(this.view);e.clientX-s.left<=r+u$?t=-d$(r-e.clientX):e.clientX+s.right>=a-u$&&(t=d$(e.clientX-a)),e.clientY-s.top<=i+u$?n=-d$(i-e.clientY):e.clientY+s.bottom>=o-u$&&(n=d$(e.clientY-o)),this.setScrollSpeed(t,n)}up(e){this.dragging??this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener(`mousemove`,this.move),e.removeEventListener(`mouseup`,this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=RQ(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:`select.pointer`}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent(`input.type`))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function m$(e,t){let n=e.state.facet(lZ);return n.length?n[0](t):Z.mac?t.metaKey:t.ctrlKey}function h$(e,t){let n=e.state.facet(uZ);return n.length?n[0](t):Z.mac?!t.altKey:!t.ctrlKey}function g$(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=fX(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}function _$(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=WZ.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}var v$=Object.create(null),y$=Object.create(null),b$=Z.ie&&Z.ie_version<15||Z.ios&&Z.webkit_version<604;function x$(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement(`textarea`));n.style.cssText=`position: fixed; left: -10000px; top: 10px`,n.focus(),setTimeout(()=>{e.focus(),n.remove(),C$(e,n.value)},50)}function S$(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function C$(e,t){t=S$(e.state,gZ,t);let{state:n}=e,r,i=1,a=n.toText(t),o=a.lines==n.selection.ranges.length;if(F$!=null&&n.selection.ranges.every(e=>e.empty)&&F$==a.toString()){let e=-1;r=n.changeByRange(r=>{let s=n.doc.lineAt(r.from);if(s.from==e)return{range:r};e=s.from;let c=n.toText((o?a.line(i++).text:t)+n.lineBreak);return{changes:{from:s.from,insert:c},range:Y.cursor(r.from+c.length,-1)}})}else r=o?n.changeByRange(e=>{let t=a.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:Y.cursor(e.from+t.length,-1)}}):n.replaceSelection(a);e.dispatch(r,{userEvent:`input.paste`,scrollIntoView:!0})}y$.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,Z.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())},y$.wheel=y$.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},v$.keydown=(e,t)=>(e.inputState.setSelectionOrigin(`select`),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),y$.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin(`select.pointer`)},y$.touchmove=e=>{e.inputState.setSelectionOrigin(`select.pointer`)},y$.touchend=(e,t)=>{e.inputState.touchActive=!1},v$.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(dZ))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=A$(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new p$(e,t,n,r)),r&&e.observer.ignore(()=>{AX(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin(`select.pointer`);return!1};function w$(e,t,n,r){if(r==1)return Y.cursor(t,n);if(r==2)return AQ(e.state,t,n);{let r=e.docView.lineAt(t,n),i=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:i.from,o=r?r.posAtEnd:i.to;return o<e.state.doc.length&&o==i.to&&o++,Y.undirectionalRange(a,o)}}var T$=Z.ie&&Z.ie_version<=11,E$=null,D$=0,O$=0;function k$(e){if(!T$)return e.detail;let t=E$,n=O$;return E$=e,O$=Date.now(),D$=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(D$+1)%3:1}function A$(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=k$(t),i=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),i=i.map(e.changes))},get(t,a,o){let s=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),c,l=w$(e,s.pos,s.assoc,r);if(n.pos!=s.pos&&!a){let t=w$(e,n.pos,n.assoc,r),i=Math.min(t.from,l.from),a=Math.max(t.to,l.to);l=i<l.from?Y.range(i,a,l.assoc):Y.range(a,i,l.assoc)}return a?i.replaceRange(i.main.extend(l.from,l.to,l.assoc)):o&&r==1&&i.ranges.length>1&&(c=j$(i,s.pos))?c:o?i.addRange(l):Y.create([l])}}}function j$(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return Y.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-+(e.mainIndex>n))}return null}v$.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=Y.undirectionalRange(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData(`Text`,S$(e.state,_Z,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed=`copyMove`),!1},v$.dragend=e=>(e.inputState.draggedContent=null,!1);function M$(e,t,n,r){if(n=S$(e.state,gZ,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,o=r&&a&&h$(e,t)?{from:a.from,to:a.to}:null,s={from:i,insert:n},c=e.state.changes(o?[o,s]:s);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:o?`move.drop`:`input.drop`}),e.inputState.draggedContent=null}v$.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,a=()=>{++i==n.length&&M$(e,t,r.filter(e=>e!=null).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=a,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),a()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData(`Text`);if(n)return M$(e,t,n,!0),!0}return!1},v$.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=b$?null:t.clipboardData;return n?(C$(e,n.getData(`text/plain`)||n.getData(`text/uri-list`)),!0):(x$(e),!1)};function N$(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement(`textarea`));r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function P$(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let a=e.doc.lineAt(r);a.number>i&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),i=a.number}r=!0}return{text:S$(e,_Z,t.join(e.lineBreak)),ranges:n,linewise:r}}var F$=null;v$.copy=v$.cut=(e,t)=>{if(!mX(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=P$(e.state);if(!n&&!i)return!1;F$=i?n:null,t.type==`cut`&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:`delete.cut`});let a=b$?null:t.clipboardData;return a?(a.clearData(),a.setData(`text/plain`,n),!0):(N$(e,n),!1)};var I$=LJ.define();function L$(e,t){let n=[];for(let r of e.facet(hZ)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:I$.of(!0)}):null}function R$(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=L$(e.state,t);n?e.dispatch(n):e.update([])}},10)}y$.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),R$(e)},y$.blur=e=>{e.observer.clearSelectionRange(),R$(e)},y$.compositionstart=y$.compositionupdate=e=>{if(!e.observer.editContext&&(e.inputState.compositionFirstChange??(e.inputState.compositionFirstChange=!0),e.inputState.composing<0)){let{main:t}=e.state.selection;!t.empty&&e.lineBlockAt(t.from).from!=e.lineBlockAt(t.to).from&&e.dispatch({changes:e.state.selection.ranges.filter(e=>!e.empty).map(e=>({from:e.from,to:e.to})),userEvent:`input`}),e.inputState.composing=0}},y$.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,Z.chrome&&Z.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},y$.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},v$.beforeinput=(e,t)=>{if((t.inputType==`insertText`||t.inputType==`insertCompositionText`)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType==`insertReplacementText`&&e.observer.editContext){let n=t.dataTransfer?.getData(`text/plain`),r=t.getTargetRanges();if(n&&r.length){let t=r[0];return ZQ(e,{from:e.posAtDOM(t.startContainer,t.startOffset),to:e.posAtDOM(t.endContainer,t.endOffset),insert:e.state.toText(n)},null),!0}}let n;if(Z.chrome&&Z.android&&(n=s$.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(n.key,n.keyCode),n.key==`Backspace`||n.key==`Delete`)){let t=window.visualViewport?.height||0;setTimeout(()=>{(window.visualViewport?.height||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return Z.ios&&t.inputType==`deleteContentForward`&&e.observer.flushSoon(),Z.safari&&t.inputType==`insertText`&&e.inputState.composing>=0&&setTimeout(()=>y$.compositionend(e,t),20),!1};var z$=new Set;function B$(e){z$.has(e)||(z$.add(e),e.addEventListener(`copy`,()=>{}),e.addEventListener(`cut`,()=>{}))}var V$=[`pre-wrap`,`normal`,`pre-line`,`break-spaces`],H$=!1;function U$(){H$=!1}var W$=class{constructor(e){this.lineWrapping=e,this.doc=Lq.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return V$.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,i,a){let o=V$.indexOf(e)>-1,s=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,s){this.heightSamples={};for(let e=0;e<a.length;e++){let t=a[e];t<0?e++:this.heightSamples[Math.floor(t*10)]=!0}}return s}},G$=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},K$=class e{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return typeof this._content==`number`?iX.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof sX?this._content.widget:null}get widgetLineBreaks(){return typeof this._content==`number`?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new e(this.from,this.length+t.length,this.top,this.height+t.height,n)}},q$=(function(e){return e[e.ByPos=0]=`ByPos`,e[e.ByHeight=1]=`ByHeight`,e[e.ByPosNoHeight=2]=`ByPosNoHeight`,e})(q$||={}),J$=.001,Y$=class e{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>J$&&(H$=!0),this.height=e)}replace(t,n,r){return e.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,a=n.doc;for(let o=r.length-1;o>=0;o--){let{fromA:s,toA:c,fromB:l,toB:u}=r[o],d=i.lineAt(s,q$.ByPosNoHeight,n.setDoc(t),0,0),f=d.to>=c?d:i.lineAt(c,q$.ByPosNoHeight,n,0,0);for(u+=f.to-c,c=f.to;o>0&&d.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s<d.from&&(d=i.lineAt(s,q$.ByPosNoHeight,n,0,0));l+=d.from-s,s=d.from;let p=i1.build(n.setDoc(a),e,l,u);i=X$(i,i.replace(s,c,p))}return i.updateHeight(n,0)}static empty(){return new $$(0,0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,a=0;for(;;)if(n==r){if(i>a*2){let e=t[n-1];e.break?t.splice(--n,1,e.left,null,e.right):t.splice(--n,1,e.left,e.right),r+=1+e.break,i-=e.size}else if(a>i*2){let e=t[r];e.break?t.splice(r,1,e.left,null,e.right):t.splice(r,1,e.left,e.right),r+=2+e.break,a-=e.size}else break}else if(i<a){let e=t[n++];e&&(i+=e.size)}else{let e=t[--r];e&&(a+=e.size)}let o=!1;return t[n-1]==null?(o=!0,n--):t[n]??(o=!0,r++),new t1(e.of(t.slice(0,n)),o,e.of(t.slice(r)))}};function X$(e,t){return e==t?e:(e.constructor!=t.constructor&&(H$=!0),t)}Y$.prototype.size=1;var Z$=Q.replace({}),Q$=class extends Y${constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new K$(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new K$(r,0,n,this.spaceAbove,Z$):this.mainBlock(n,r)}lineAt(e,t,n,r,i){let a=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,n,r,i).join(a):a}forEachLine(e,t,n,r,i,a){e<=i+this.length&&t>=i&&a(this.lineAt(0,q$.ByPos,n,r,i))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},$$=class e extends Q${constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new K$(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof e||i instanceof e1&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof e1?i=new e(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Y$.of(r)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:``}${this.widgetHeight?`:`+this.widgetHeight:``})`}},e1=class e extends Y${constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,a,o=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);a=t/i,this.length>i+1&&(o=(this.height-t)/(this.length-i-1))}else a=this.height/i;return{firstLine:n,lastLine:r,perLine:a,perChar:o}}blockAt(e,t,n,r){let{firstLine:i,lastLine:a,perLine:o,perChar:s}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),a=t.doc.lineAt(i),c=o+a.length*s,l=Math.max(n,e-c/2);return new K$(a.from,a.length,l,c,0)}{let r=Math.max(0,Math.min(a-i,Math.floor((e-n)/o))),{from:s,length:c}=t.doc.line(i+r);return new K$(s,c,n+o*r,o,0)}}lineAt(e,t,n,r,i){if(t==q$.ByHeight)return this.blockAt(e,n,r,i);if(t==q$.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new K$(t,r-t,0,0,0)}let{firstLine:a,perLine:o,perChar:s}=this.heightMetrics(n,i),c=n.doc.lineAt(e),l=o+c.length*s,u=c.number-a,d=r+o*u+s*(c.from-i-u);return new K$(c.from,c.length,Math.max(r,Math.min(d,r+this.height-l)),l,0)}forEachLine(e,t,n,r,i,a){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:o,perLine:s,perChar:c}=this.heightMetrics(n,i);for(let l=e,u=r;l<=t;){let t=n.doc.lineAt(l);if(l==e){let n=t.number-o;u+=s*n+c*(e-i-n)}let r=s+c*t.length;a(new K$(t.from,t.length,u,r,0)),u+=r,l=t.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let t=r[r.length-1];t instanceof e?r[r.length-1]=new e(t.length+i):r.push(null,new e(i-1))}if(t>0){let n=r[0];n instanceof e?r[0]=new e(t+n.length):r.unshift(new e(t-1),null)}return Y$.of(r)}decomposeLeft(t,n){n.push(new e(t-1),null)}decomposeRight(t,n){n.push(null,new e(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let a=n+this.length;if(i&&i.from<=n+this.length&&i.more){let r=[],o=Math.max(n,i.from),s=-1;for(i.from>n&&r.push(new e(i.from-n-1).updateHeight(t,n));o<=a&&i.more;){let e=t.doc.lineAt(o).length;r.length&&r.push(null);let n=i.heights[i.index++],a=0;n<0&&(a=-n,n=i.heights[i.index++]),s==-1?s=n:Math.abs(n-s)>=J$&&(s=-2);let c=new $$(e,n,a);c.outdated=!1,r.push(c),o+=e+1}o<=a&&r.push(null,new e(a-o).updateHeight(t,o));let c=Y$.of(r);return(s<0||Math.abs(c.height-this.height)>=J$||Math.abs(s-this.heightMetrics(t,n).perLine)>=J$)&&(H$=!0),X$(this,c)}return(r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}},t1=class extends Y${constructor(e,t,n){super(e.length+ +!!t+n.length,e.height+n.height,+!!t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let a=r+this.left.height,o=i+this.left.length+this.break,s=t==q$.ByHeight?e<a:e<o,c=s?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,a,o);if(this.break||(s?c.to<o:c.from>o))return c;let l=t==q$.ByPosNoHeight?q$.ByPosNoHeight:q$.ByPos;return s?c.join(this.right.lineAt(o,l,n,a,o)):this.left.lineAt(o,l,n,r,i).join(c)}forEachLine(e,t,n,r,i,a){let o=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,r,i,a),t>=s&&this.right.forEachLine(e,t,n,o,s,a);else{let c=this.lineAt(s,q$.ByPos,n,r,i);e<c.from&&this.left.forEachLine(e,Math.min(t,c.from-1),n,r,i,a),c.to>=e&&c.from<=t&&a(c),t>c.to&&this.right.forEachLine(Math.max(e,c.to+1),t,n,o,s,a)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let e of n)i.push(e);if(e>0&&n1(i,a-1),t<this.length){let e=i.length;this.decomposeRight(t,i),n1(i,e)}return Y$.of(i)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?Y$.of(this.break?[e,null,t]:[e,t]):(this.left=X$(this.left,e),this.right=X$(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:a}=this,o=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=o+a.length&&r.more?s=a=a.updateHeight(e,o,n,r):a.updateHeight(e,o,n),s?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?` `:`-`)+this.right}};function n1(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof e1&&(r=e[t+1])instanceof e1&&e.splice(t-1,3,new e1(n.length+1+r.length))}var r1=5,i1=class e{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof $$?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new $$(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=t-e;n.block?this.addBlock(new Q$(a,r,n)):(a||i||r>=r1)&&this.addLineDeco(r,i,a)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new $$(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new e1(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof $$)return e;let t=new $$(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos+=e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos+=n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof $$)&&!this.isCovered?this.nodes.push(new $$(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let e of this.nodes)e instanceof $$&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(t,n,r,i){let a=new e(r,t);return cY.spans(n,r,i,a,0),a.finish(r)}};function a1(e,t,n){let r=new o1;return cY.compare(e,t,n,r,0),r.changes}var o1=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&uX(e,t,this.changes,5)}};function s1(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,a=Math.max(0,n.left),o=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),c=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(t.nodeType==1){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&r.overflow!=`visible`){let r=n.getBoundingClientRect();a=Math.max(a,r.left),o=Math.min(o,r.right),s=Math.max(s,r.top),c=Math.min(t==e.parentNode?i.innerHeight:c,r.bottom)}t=r.position==`absolute`||r.position==`fixed`?n.offsetParent:n.parentNode}else if(t.nodeType==11)t=t.host;else break;return{left:a-n.left,right:Math.max(a,o)-n.left,top:s-(n.top+t),bottom:Math.max(s,c)-(n.top+t)}}function c1(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function l1(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}var u1=class{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return Q.replace({widget:new d1(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},d1=class extends rX{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement(`div`);return this.vertical?e.style.height=this.size+`px`:(e.style.width=this.size+`px`,e.style.height=`2px`,e.style.display=`inline-block`),e}get estimatedHeight(){return this.vertical?this.size:-1}},f1=class{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=v1,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=BX.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(jZ).some(e=>typeof e!=`function`&&e.class==`cm-lineWrapping`);this.heightOracle=new W$(n),this.stateDeco=y1(t),this.heightMap=Y$.empty().applyChanges(this.stateDeco,Lq.empty,this.heightOracle.setDoc(t.doc),[new VZ(0,0,0,t.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Q.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new p1(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?v1:new b1(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(x1(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=y1(this.state);let r=e.changedRanges,i=VZ.extendWithRanges(r,a1(n,this.stateDeco,e?e.changes:rJ.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);U$(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||H$)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let s=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<s.from||t.range.head>s.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t));let c=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(yZ)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,i=n.whiteSpace;this.defaultTextDirection=n.direction==`rtl`?BX.RTL:BX.LTR;let a=this.heightOracle.mustRefreshForWrapping(i)||this.mustMeasureContent===`refresh`,o=t.getBoundingClientRect(),s=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,l=0;if(o.width&&o.height){let{scaleX:e,scaleY:n}=CX(t,o);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,c|=16,a=s=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=d)&&(this.paddingTop=u,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(s=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let f=TX(this.view.contentDOM,!1).y;f!=this.scrollParent&&(this.scrollParent=f,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=IX(this.scrollParent||e.win);let m=(this.printing?l1:s1)(t,this.paddingTop),h=m.top-this.pixelViewport.top,g=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let _=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(_!=this.inView&&(this.inView=_,_&&(s=!0)),!this.inView&&!this.scrollTarget&&!c1(e.dom))return 0;let v=o.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),s){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(a=!0),a||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:o,textHeight:s}=e.docView.measureTextSize();a=n>0&&r.refresh(i,n,o,s,Math.max(5,v/o),t),a&&(e.docView.minWidth=0,c|=16)}h>0&&g>0?l=Math.max(h,g):h<0&&g<0&&(l=Math.min(h,g)),U$();for(let n of this.viewports){let i=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(a?Y$.empty().applyChanges(this.stateDeco,Lq.empty,this.heightOracle,[new VZ(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new G$(n.from,i))}H$&&(c|=2)}let y=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return y&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(l,this.scrollTarget),c|=this.updateForViewport()),(c&2||y)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,s=new p1(r.lineAt(a-n*1e3,q$.ByHeight,i,0,0).from,r.lineAt(o+(1-n)*1e3,q$.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(e<s.from||e>s.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),a=r.lineAt(e,q$.ByPos,i,0,0),o;o=t.y==`center`?(a.top+a.bottom)/2-n/2:t.y==`start`||t.y==`nearest`&&e<s.from?a.top:a.bottom-n,s=new p1(r.lineAt(o-500,q$.ByHeight,i,0,0).from,r.lineAt(o+n+500,q$.ByHeight,i,0,0).to)}}return s}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new p1(this.heightMap.lineAt(n,q$.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,q$.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,q$.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,q$.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:o}=this;return(e==0||r<=a-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=o+Math.max(10,Math.min(n,250)))&&r>a-2e3&&i<o+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new u1(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,a=r<<1;if(this.defaultTextDirection!=BX.LTR&&!n)return[];let o=[],s=(r,a,c,l)=>{if(a-r<i)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<a){s(r,e-10,c,l),s(e+10,a,c,l);return}let f=_1(e,e=>e.from>=c.from&&e.to<=c.to&&Math.abs(e.from-r)<i&&Math.abs(e.to-a)<i&&!d.some(t=>e.from<t&&e.to>t));if(!f){if(a<c.to&&t&&n&&t.visibleRanges.some(e=>e.from<=a&&e.to>=a)){let e=t.moveToLineBoundary(Y.cursor(a),!1,!0).head;e>r&&(a=e)}let e=this.gapSize(c,r,a,l);f=new u1(r,a,e,n||e<2e6?e:2e6)}o.push(f)},c=t=>{if(t.length<a||t.type!=iX.Text)return;let i=m1(t.from,t.to,this.stateDeco);if(i.total<a)return;let o=this.scrollTarget?this.scrollTarget.range.head:null,c,l;if(n){let e=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,n,a;if(o!=null){let r=g1(i,o),s=((this.visibleBottom-this.visibleTop)/2+e)/t.height;n=r-s,a=r+s}else n=(this.visibleTop-t.top-e)/t.height,a=(this.visibleBottom-t.top+e)/t.height;c=h1(i,n),l=h1(i,a)}else{let n=i.total*this.heightOracle.charWidth,a=r*this.heightOracle.charWidth,s=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=n.size-n.displaySize);let u=this.pixelViewport.left+s,d=this.pixelViewport.right+s,f,p;if(o!=null){let e=g1(i,o),t=((d-u)/2+a)/n;f=e-t,p=e+t}else f=(u-a)/n,p=(d+a)/n;c=h1(i,f),l=h1(i,p)}c>t.from&&s(t.from,c,t,i),l<t.to&&s(l,t.to,t,i)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(c):c(e);return o}gapSize(e,t,n,r){let i=g1(r,n)-g1(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){u1.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Q.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];cY.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(r&8);t++){let i=this.visibleRanges[t],a=n[t];(i.from!=a.from||i.to!=a.to)&&(r|=4,e&&e.mapPos(i.from,-1)==a.from&&e.mapPos(i.to,1)==a.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||x1(this.heightMap.lineAt(e,q$.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||x1(this.heightMap.lineAt(this.scaler.fromDOM(e),q$.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop*this.scaleY:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return x1(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},p1=class{constructor(e,t){this.from=e,this.to=t}};function m1(e,t,n){let r=[],i=e,a=0;return cY.spans(n,e,t,{span(){},point(e,t){e>i&&(r.push({from:i,to:e}),a+=e-i),i=t}},20),i<t&&(r.push({from:i,to:t}),a+=t-i),{total:a,ranges:r}}function h1({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],a=i-n;if(r<=a)return n+r;r-=a}}function g1(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function _1(e,t){for(let n of e)if(t(n))return n}var v1={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function y1(e){let t=e.facet(MZ).filter(e=>typeof e!=`function`),n=e.facet(PZ).filter(e=>typeof e!=`function`);return n.length&&t.push(cY.join(n)),t}var b1=class e{constructor(e,t,n){let r=0,i=0,a=0;this.viewports=n.map(({from:n,to:i})=>{let a=t.lineAt(n,q$.ByPos,e,0,0).top,o=t.lineAt(i,q$.ByPos,e,0,0).bottom;return r+=o-a,{from:n,to:i,top:a,bottom:o,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=a+(e.top-i)*this.scale,a=e.domBottom=e.domTop+(e.bottom-e.top),i=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(t){return t instanceof e&&this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,n)=>e.from==t.viewports[n].from&&e.to==t.viewports[n].to)}};function x1(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new K$(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>x1(e,t)):e._content)}var S1=X.define({combine:e=>e.join(` `)}),C1=X.define({combine:e=>e.indexOf(!0)>-1}),w1=OY.newName(),T1=OY.newName(),E1=OY.newName(),D1={"&light":`.`+T1,"&dark":`.`+E1};function O1(e,t,n){return new OY(t,{finish(t){return/&/.test(t)?t.replace(/&\w*/,t=>{if(t==`&`)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+` `+t}})}var k1=O1(`.`+w1,{"&":{position:`relative !important`,boxSizing:`border-box`,"&.cm-focused":{outline:`1px dotted #212121`},display:`flex !important`,flexDirection:`column`},".cm-scroller":{display:`flex !important`,alignItems:`flex-start !important`,fontFamily:`monospace`,lineHeight:1.4,height:`100%`,overflowX:`auto`,position:`relative`,zIndex:0,overflowAnchor:`none`},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:`block`,whiteSpace:`pre`,wordWrap:`normal`,boxSizing:`border-box`,minHeight:`100%`,padding:`4px 0`,outline:`none`,"&[contenteditable=true]":{WebkitUserModify:`read-write-plaintext-only`}},".cm-lineWrapping":{whiteSpace_fallback:`pre-wrap`,whiteSpace:`break-spaces`,wordBreak:`break-word`,overflowWrap:`anywhere`,flexShrink:1},"&light .cm-content":{caretColor:`black`},"&dark .cm-content":{caretColor:`white`},".cm-line":{display:`block`,padding:`0 2px 0 6px`},".cm-layer":{userSelect:`none`,position:`absolute`,left:0,top:0,contain:`size style`,"& > *":{position:`absolute`}},"&light .cm-selectionBackground":{background:`#d9d9d9`},"&dark .cm-selectionBackground":{background:`#222`},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#d7d4f0`},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#233`},".cm-cursorLayer":{pointerEvents:`none`},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:`steps(1) cm-blink 1.2s infinite`},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:`1.2px solid black`,marginLeft:`-0.6px`,pointerEvents:`none`},".cm-cursor":{display:`none`},"&dark .cm-cursor":{borderLeftColor:`#ddd`},".cm-selectionHandle":{backgroundColor:`currentColor`,width:`1.5px`},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:`""`,backgroundColor:`inherit`,borderRadius:`50%`,width:`8px`,height:`8px`,position:`absolute`,left:`-3.25px`},".cm-selectionHandle-start::before":{top:`-8px`},".cm-selectionHandle-end::before":{bottom:`-8px`},".cm-dropCursor":{position:`absolute`},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:`block`},".cm-iso":{unicodeBidi:`isolate`},".cm-announced":{position:`fixed`,top:`-10000px`},"@media print":{".cm-announced":{display:`none`}},"&light .cm-activeLine":{backgroundColor:`#cceeff44`},"&dark .cm-activeLine":{backgroundColor:`#99eeff33`},"&light .cm-specialChar":{color:`red`},"&dark .cm-specialChar":{color:`#f78`},".cm-gutters":{flexShrink:0,display:`flex`,height:`100%`,boxSizing:`border-box`,zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:`#f5f5f5`,color:`#6c6c6c`,border:`0px solid #ddd`,"&.cm-gutters-before":{borderRightWidth:`1px`},"&.cm-gutters-after":{borderLeftWidth:`1px`}},"&dark .cm-gutters":{backgroundColor:`#333338`,color:`#ccc`},".cm-gutter":{display:`flex !important`,flexDirection:`column`,flexShrink:0,boxSizing:`border-box`,minHeight:`100%`,overflow:`hidden`},".cm-gutterElement":{boxSizing:`border-box`},".cm-lineNumbers .cm-gutterElement":{padding:`0 3px 0 5px`,minWidth:`20px`,textAlign:`right`,whiteSpace:`nowrap`},"&light .cm-activeLineGutter":{backgroundColor:`#e2f2ff`},"&dark .cm-activeLineGutter":{backgroundColor:`#222227`},".cm-panels":{boxSizing:`border-box`,position:`sticky`,left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:`#f5f5f5`,color:`black`},".cm-panels-top":{top:`0`},".cm-panels-bottom":{bottom:`0`},"&light .cm-panels-top":{borderBottom:`1px solid #ddd`},"&light .cm-panels-bottom":{borderTop:`1px solid #ddd`},"&dark .cm-panels":{backgroundColor:`#333338`,color:`white`},".cm-dialog":{padding:`2px 19px 4px 6px`,position:`relative`,"& label":{fontSize:`80%`}},".cm-dialog-close":{position:`absolute`,top:`3px`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,fontSize:`14px`,padding:`0`},".cm-tab":{display:`inline-block`,overflow:`hidden`,verticalAlign:`bottom`},".cm-widgetBuffer":{verticalAlign:`text-top`,height:`1em`,width:0,display:`inline`},".cm-placeholder":{color:`#888`,display:`inline-block`,verticalAlign:`top`,userSelect:`none`},".cm-highlightSpace":{background:`radial-gradient(circle at 50% 55%, #aaa 20%, transparent 0) no-repeat`,backgroundSize:`.4em`,backgroundPosition:`calc(min(50%, 0px)) center`},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:`auto 100%`,backgroundPosition:`right 90%`,backgroundRepeat:`no-repeat`},".cm-trailingSpace":{backgroundColor:`#ff332255`},".cm-button":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,padding:`.2em 1em`,borderRadius:`1px`},"&light .cm-button":{backgroundImage:`linear-gradient(#eff1f5, #d9d9df)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#b4b4b4, #d0d3d6)`}},"&dark .cm-button":{backgroundImage:`linear-gradient(#393939, #111)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#111, #333)`}},".cm-textfield":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,border:`1px solid silver`,padding:`.2em .5em`},"&light .cm-textfield":{backgroundColor:`white`},"&dark .cm-textfield":{border:`1px solid #555`,backgroundColor:`inherit`}},D1),A1={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},j1=Z.ie&&Z.ie_version<=11,M1=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new EX,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(Z.ie&&Z.ie_version<=11||Z.ios&&e.composing)&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Z.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Z.chrome&&Z.chrome_version<126)&&(this.editContext=new I1(e),e.state.facet(TZ)&&(e.contentDOM.editContext=this.editContext.editContext)),j1&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia(`print`)),typeof ResizeObserver==`function`&&(this.resizeScroll=new ResizeObserver(()=>{this.view.docView?.lastUpdate<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver==`function`&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent(`Event`)))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent(`Event`))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers(`scroll`,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type!=`change`&&e.type||e.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(TZ)?n.root.activeElement!=this.dom:!mX(this.dom,r))return;let i=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Z.ie&&Z.ie_version<=11||Z.android&&Z.chrome)&&!n.state.selection.main.empty&&r.focusNode&&gX(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=fX(e.root);if(!t)return!1;let n=Z.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&F1(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=mX(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&FX(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||=this.scrollTargets.slice(0,e),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener(`scroll`,this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||=(this.observer.observe(this.dom,A1),j1&&this.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),j1&&this.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&NX(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}(!this.delayedAndroidKey||e==`Enter`)&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!this.delayedAndroidKey?.force})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),t==-1?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&mX(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new JQ(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=XQ(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!n$(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type==`attributes`),e.type==`childList`){let n=N1(t,e.previousSibling||e.target.previousSibling,-1),r=N1(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return e.type==`characterData`?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener(`change`,this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener(`beforeprint`,this.onPrint),e.addEventListener(`scroll`,this.onScroll),e.document.addEventListener(`selectionchange`,this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener(`scroll`,this.onScroll),e.removeEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener(`change`,this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener(`beforeprint`,this.onPrint),e.document.removeEventListener(`selectionchange`,this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(TZ)!=e.state.facet(TZ)&&(e.view.contentDOM.editContext=e.state.facet(TZ)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)==null||e.disconnect(),(t=this.gapIntersection)==null||t.disconnect(),(n=this.resizeScroll)==null||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function N1(e,t,n){for(;t;){let r=WZ.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i==e.dom?n>0?t.nextSibling:t.previousSibling:i}return null}function P1(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return gX(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function F1(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return P1(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener(`beforeinput`,r,!0),e.dom.ownerDocument.execCommand(`indent`),e.contentDOM.removeEventListener(`beforeinput`,r,!0),n?P1(e,n):null}var I1=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:i,head:a}=r,o=this.toEditorPos(n.updateRangeStart),s=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:o,drifted:!1});let c=s-o>n.text.length;o==this.from&&i<this.from?o=i:s==this.to&&i>this.to&&(s=i);let l=$Q(e.state.sliceDoc(o,s),n.text,(c?r.from:r.to)-o,c?`end`:null);if(!l){let t=Y.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));n$(t,r)||e.dispatch({selection:t,userEvent:`select`});return}let u={from:l.from+o,to:l.toA+o,insert:Lq.of(n.text.slice(l.from,l.toB).split(`
28
+ `))};if((Z.mac||Z.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:Lq.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);ZQ(e,u,Y.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);t<a;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+` `:t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${/thin/i.test(r)?1:2}px`;n.push(Q.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:CZ.of(Q.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{let t=fX(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,a,o,s,c)=>{if(n)return;let l=c.length-(a-i);if(r&&a>=r.to){if(r.from==i&&r.to==a&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=l,this.to+=l;return}r=null,this.revertPending(e.state)}if(i+=t,a+=t,a<=this.from)this.from+=l,this.to+=l;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),c.toString()),this.to+=l}t+=l}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent(`input.type`)&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},$=class e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.clearAnnouncement=-1,this.contentDOM=document.createElement(`div`),this.scrollDOM=document.createElement(`div`),this.scrollDOM.tabIndex=-1,this.scrollDOM.className=`cm-scroller`,this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement(`div`),this.announceDOM.className=`cm-announced`,this.announceDOM.setAttribute(`aria-live`,`polite`),this.dom=document.createElement(`div`),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach(e=>t(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||PX(e.parent)||document,this.viewState=new f1(this,e.state||tY.create(e)),e.scrollTo&&e.scrollTo.is(SZ)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(DZ).map(e=>new kZ(e));for(let e of this.plugins)e.update(this);this.observer=new M1(this),this.inputState=new r$(this),this.inputState.ensureHandlers(this.plugins),this.docView=new _Q(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),document.fonts?.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=`refresh`,this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof VJ?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(t){if(this.updateState!=0)throw Error(`Calls to EditorView.update are not allowed while an update is in progress`);let n=!1,r=!1,i,a=this.state;for(let e of t){if(e.startState!=a)throw RangeError(`Trying to update state with a transaction that doesn't start from the previous state.`);a=e.state}if(this.destroyed){this.viewState.state=a;return}let o=this.hasFocus,s=0,c=null;t.some(e=>e.annotation(I$))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=L$(a,o),c||(s=1));let l=this.observer.delayedAndroidKey,u=null;if(l?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(u=null)):this.observer.clear(),a.facet(tY.phrases)!=this.state.facet(tY.phrases))return this.setState(a);i=HZ.create(this,a,t),i.flags|=s;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let n of t){if(d&&=d.map(n.changes),n.scrollIntoView){let{main:t}=n.state.selection,{x:r,y:i}=this.state.facet(e.cursorScrollMargin);d=new xZ(t.empty?t:Y.cursor(t.head,t.head>t.anchor?-1:1),`nearest`,`nearest`,i,r)}for(let e of n.effects)e.is(SZ)&&(d=e.value.clip(this.state))}this.viewState.update(i,d),this.bidiCache=z1.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(BZ)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(e=>e.isUserEvent(`select.pointer`)))}finally{this.updateState=0}if(i.startState.facet(S1)!=i.state.facet(S1)&&(this.viewState.mustMeasureContent=!0),(n||r||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let e of this.state.facet(pZ))try{e(i)}catch(e){wZ(this.state,e,`update listener`)}(c||u)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),u&&!XQ(this,u)&&l.force&&NX(this.contentDOM,l.key,l.keyCode)})}setState(e){if(this.updateState!=0)throw Error(`Calls to EditorView.setState are not allowed while an update is in progress`);if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new f1(this,e),this.plugins=e.facet(DZ).map(e=>new kZ(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new _Q(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(DZ),n=e.state.facet(DZ);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new kZ(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){wZ(this.state,e,`doc view update listener`)}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:i,scrollAnchorHeight:a,scaleY:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(a<0){if(IX(n||this.win))i=-1,a=this.viewState.heightMap.height/this.viewState.scaleY;else{let e=this.viewState.scrollAnchorAt(r);i=e.from,a=e.top}o=this.viewState.scaleY}this.updateState=1;let s=this.viewState.measure();if(!s&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(e>5){console.warn(this.measureRequests.length?`Measure loop restarted more than 5 times`:`Viewport failed to stabilize`);break}let c=[];s&4||([this.measureRequests,c]=[c,this.measureRequests]);let l=c.map(e=>{try{return e.read(this)}catch(e){return wZ(this.state,e),R1}}),u=HZ.create(this,this.state,[]),d=!1;u.flags|=s,t?t.flags|=s:t=u,this.updateState=2,u.empty||(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),d=this.docView.update(u),d&&this.docViewUpdate());for(let e=0;e<c.length;e++)if(l[e]!=R1)try{let t=c[e];t.write&&t.write(l[e],this)}catch(e){wZ(this.state,e)}if(d&&this.docView.updateSelection(!0),!u.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}{let e=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)/this.viewState.scaleY-a/o;if((e>1||e<-1)&&!(Z.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r+=e,n?i<0?n.scrollTop=n.scrollHeight:n.scrollTop+=e:this.win.scrollBy(0,e),a=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(pZ))e(t)}get themeClasses(){return w1+` `+(this.state.facet(C1)?E1:T1)+` `+this.state.facet(S1)}updateAttrs(){let e=B1(this,AZ,{class:`cm-editor`+(this.hasFocus?` cm-focused `:` `)+this.themeClasses}),t={spellcheck:`false`,autocorrect:`off`,autocapitalize:`off`,writingsuggestions:`false`,translate:`no`,contenteditable:this.state.facet(TZ)?`true`:`false`,class:`cm-content`,style:`${Z.tabSize}: ${this.state.tabSize}`,role:`textbox`,"aria-multiline":`true`};this.state.readOnly&&(t[`aria-readonly`]=`true`),B1(this,jZ,t);let n=this.observer.ignore(()=>{let n=tX(this.contentDOM,this.contentAttrs,t),r=tX(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(t){let n=!0;for(let r of t)for(let t of r.effects)if(t.is(e.announce)){n&&=(this.announceDOM.textContent=``,this.win.clearTimeout(this.clearAnnouncement),this.clearAnnouncement=this.win.setTimeout(()=>{this.announceDOM.textContent=`\xA0`},200),!1);let e=this.announceDOM.appendChild(document.createElement(`div`));e.textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(BZ);let t=this.state.facet(e.cspNonce);OY.mount(this.root,this.styleModules.concat(k1).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw Error(`Reading the editor layout isn't allowed during an update`);this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return zQ(this,e,PQ(this,e,t,n))}moveByGroup(e,t){return zQ(this,e,PQ(this,e,t,t=>FQ(this,e.head,t)))}visualLineSide(e,t){return t?Y.cursor(e.to,1):Y.cursor(e.from,-1)}moveToLineBoundary(e,t,n=!0){return NQ(this,e,t,n)}moveVertically(e,t,n){return zQ(this,e,IQ(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=VQ(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),VQ(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.state.doc.lineAt(e),r=this.bidiSpans(n),i=r[XX.find(r,e-n.from,-1,t)];return n.length&&(e==n.from&&t<0||e==n.to&&t>0)&&i.dir!=this.textDirectionAt(n.from)&&(e==n.to?(e=n.from+i.from,t=1):(e=n.from+i.to,t=-1)),this.docView.coordsAt(e,t,i.dir==BX.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(vZ)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>L1)return aZ(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||ZX(r.isolates,n=LZ(this,e))))return r.order;n||=LZ(this,e);let r=iZ(e.text,t,n);return this.bidiCache.push(new z1(e.from,e.to,t,n,!0,r)),r}get hasFocus(){return(this.dom.ownerDocument.hasFocus()||Z.safari&&this.inputState?.lastContextMenu>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{AX(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.win.clearTimeout(this.clearAnnouncement),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return SZ.of(new xZ(typeof e==`number`?Y.cursor(e):e,t.y??`nearest`,t.x??`nearest`,t.yMargin??5,t.xMargin??5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return SZ.of(new xZ(Y.cursor(n.from),`start`,`start`,n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e==`boolean`?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return OZ.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return OZ.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=OY.newName(),r=[S1.of(n),BZ.of(O1(`.${n}`,e))];return t&&t.dark&&r.push(C1.of(!0)),r}static baseTheme(e){return SJ.lowest(BZ.of(O1(`.`+w1,e,D1)))}static findFromDOM(e){let t=e.querySelector(`.cm-content`);return(t&&WZ.get(t)||WZ.get(e))?.root?.view||null}};$.styleModule=BZ,$.inputHandler=mZ,$.clipboardInputFilter=gZ,$.clipboardOutputFilter=_Z,$.scrollHandler=bZ,$.focusChangeEffect=hZ,$.perLineTextDirection=vZ,$.exceptionSink=fZ,$.updateListener=pZ,$.editable=TZ,$.mouseSelectionStyle=dZ,$.dragMovesSelection=uZ,$.clickAddsSelectionRange=lZ,$.decorations=MZ,$.blockWrappers=NZ,$.outerDecorations=PZ,$.atomicRanges=FZ,$.bidiIsolatedRanges=IZ,$.cursorScrollMargin=X.define({combine:e=>{let t=5,n=5;for(let r of e)typeof r==`number`?t=n=r:{x:t,y:n}=r;return{x:t,y:n}}}),$.scrollMargins=RZ,$.darkTheme=C1,$.cspNonce=X.define({combine:e=>e.length?e[0]:``}),$.contentAttributes=jZ,$.editorAttributes=AZ,$.lineWrapping=$.contentAttributes.of({class:`cm-lineWrapping`}),$.announce=BJ.define();var L1=4096,R1={},z1=class e{constructor(e,t,n,r,i,a){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=a}static update(t,n){if(n.empty&&!t.some(e=>e.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:BX.LTR;for(let a=Math.max(0,t.length-10);a<t.length;a++){let o=t[a];o.dir==i&&!n.touchesRange(o.from,o.to)&&r.push(new e(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}};function B1(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],a=typeof t==`function`?t(e):t;a&&ZY(a,n)}return n}var V1=Z.mac?`mac`:Z.windows?`win`:Z.linux?`linux`:`key`;function H1(e,t){let n=e.split(/-(?!$)/),r=n[n.length-1];r==`Space`&&(r=` `);let i,a,o,s;for(let e=0;e<n.length-1;++e){let r=n[e];if(/^(cmd|meta|m)$/i.test(r))s=!0;else if(/^a(lt)?$/i.test(r))i=!0;else if(/^(c|ctrl|control)$/i.test(r))a=!0;else if(/^s(hift)?$/i.test(r))o=!0;else if(/^mod$/i.test(r))t==`mac`?s=!0:a=!0;else throw Error(`Unrecognized modifier name: `+r)}return i&&(r=`Alt-`+r),a&&(r=`Ctrl-`+r),s&&(r=`Meta-`+r),o&&(r=`Shift-`+r),r}function U1(e,t,n){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n!==!1&&t.shiftKey&&(e=`Shift-`+e),e}var W1=SJ.default($.domEventHandlers({keydown(e,t){return $1(q1(t.state),e,t,`editor`)}})),G1=X.define({enables:W1}),K1=new WeakMap;function q1(e){let t=e.facet(G1),n=K1.get(t);return n||K1.set(t,n=Z1(t.reduce((e,t)=>e.concat(t),[]))),n}function J1(e,t,n){return $1(q1(e.state),t,e,n)}var Y1=null,X1=4e3;function Z1(e,t=V1){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(n==null)r[e]=t;else if(n!=t)throw Error(`Key binding `+e+` is used both as a regular binding and as a multi-stroke prefix`)},a=(e,r,a,o,s)=>{let c=n[e]||(n[e]=Object.create(null)),l=r.split(/ (?!$)/).map(e=>H1(e,t));for(let t=1;t<l.length;t++){let n=l.slice(0,t).join(` `);i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=Y1={view:t,prefix:n,scope:e};return setTimeout(()=>{Y1==r&&(Y1=null)},X1),!0}]})}let u=l.join(` `);i(u,!1);let d=c[u]||(c[u]={preventDefault:!1,stopPropagation:!1,run:(c._any?.run)?.slice()||[]});a&&d.run.push(a),o&&(d.preventDefault=!0),s&&(d.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(` `):[`editor`];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||={preventDefault:!1,stopPropagation:!1,run:[]};let{any:i}=r;for(let t in e)e[t].run.push(e=>i(e,Q1))}let i=r[t]||r.key;if(i)for(let t of e)a(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&a(t,`Shift-`+i,r.shift,r.preventDefault,r.stopPropagation)}return n}var Q1=null;function $1(e,t,n,r){Q1=t;let i=LY(t),a=$q(Zq(i,0))==i.length&&i!=` `,o=``,s=!1,c=!1,l=!1;Y1&&Y1.view==n&&Y1.scope==r&&(o=Y1.prefix+` `,l$.indexOf(t.keyCode)<0&&(c=!0,Y1=null));let u=new Set,d=e=>{if(e){for(let t of e.run)if(!u.has(t)&&(u.add(t),t(n)))return e.stopPropagation&&(l=!0),!0;e.preventDefault&&(e.stopPropagation&&(l=!0),c=!0)}return!1},f=e[r],p,m;return f&&(d(f[o+U1(i,t,!a)])?s=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(Z.windows&&t.ctrlKey&&t.altKey)&&!(Z.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=jY[t.keyCode])&&p!=i?(d(f[o+U1(p,t,!0)])||t.shiftKey&&(m=MY[t.keyCode])!=i&&m!=p&&d(f[o+U1(m,t,!1)]))&&(s=!0):a&&t.shiftKey&&d(f[o+U1(i,t,!0)])&&(s=!0),!s&&d(f._any)&&(s=!0)),c&&(s=!0),s&&l&&t.stopPropagation(),Q1=null,s}var e0=class e{constructor(e,t,n,r,i){this.className=e,this.left=t,this.top=n,this.width=r,this.height=i}draw(){let e=document.createElement(`div`);return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+`px`,e.style.top=this.top+`px`,this.width!=null&&(e.style.width=this.width+`px`),e.style.height=this.height+`px`}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(t,n,r){if(r.empty){let i=t.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let a=t0(t);return[new e(n,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}return r0(t,n,r)}};function t0(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==BX.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function n0(e,t,n,r){let i=e.coordsAtPos(t,n*2);if(!i)return r;let a=e.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,s=e.posAtCoords({x:a.left+1,y:o}),c=e.posAtCoords({x:a.right-1,y:o});return s==null||c==null?r:{from:Math.max(r.from,Math.min(s,c)),to:Math.min(r.to,Math.max(s,c))}}function r0(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),a=e.textDirection==BX.LTR,o=e.contentDOM,s=o.getBoundingClientRect(),c=t0(e),l=o.querySelector(`.cm-line`),u=l&&window.getComputedStyle(l),d=s.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),f=s.right-(u?parseInt(u.paddingRight):0),p=MQ(e,r,1),m=MQ(e,i,-1),h=p.type==iX.Text?p:null,g=m.type==iX.Text?m:null;if(h&&(e.lineWrapping||p.widgetLineBreaks)&&(h=n0(e,r,1,h)),g&&(e.lineWrapping||m.widgetLineBreaks)&&(g=n0(e,i,-1,g)),h&&g&&h.from==g.from&&h.to==g.to)return v(y(n.from,n.to,h));{let t=h?y(n.from,null,h):b(p,!1),r=g?y(null,n.to,g):b(m,!0),i=[];return(h||p).to<(g||m).from-(h&&g?1:0)||p.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<r.top?i.push(_(d,t.bottom,f,r.top)):t.bottom<r.top&&e.elementAtHeight((t.bottom+r.top)/2).type==iX.Text&&(t.bottom=r.top=(t.bottom+r.top)/2),v(t).concat(i).concat(v(r))}function _(e,n,r,i){return new e0(t,e-c.left,n-c.top,Math.max(0,r-e),i-n)}function v({top:e,bottom:t,horizontal:n}){let r=[];for(let i=0;i<n.length;i+=2)r.push(_(n[i],e,n[i+1],t));return r}function y(t,n,r){let i=1e9,o=-1e9,s=[];function c(t,n,c,l,u){let p=e.coordsAtPos(t,t==r.to?-2:2),m=e.coordsAtPos(c,c==r.from?2:-2);p&&m&&(i=Math.min(p.top,m.top,i),o=Math.max(p.bottom,m.bottom,o),u==BX.LTR?s.push(a&&n?d:p.left,a&&l?f:m.right):s.push(!a&&l?d:m.left,!a&&n?f:p.right))}let l=t??r.from,u=n??r.to;for(let r of e.visibleRanges)if(r.to>l&&r.from<u)for(let i=Math.max(r.from,l),a=Math.min(r.to,u);;){let r=e.state.doc.lineAt(i);for(let o of e.bidiSpans(r)){let e=o.from+r.from,s=o.to+r.from;if(e>=a)break;s>i&&c(Math.max(e,i),t==null&&e<=l,Math.min(s,a),n==null&&s>=u,o.dir)}if(i=r.to+1,i>=a)break}return s.length==0&&c(l,t==null,u,n==null,e.textDirection),{top:i,bottom:o,horizontal:s}}function b(e,t){let n=s.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}function i0(e,t){return e.constructor==t.constructor&&e.eq(t)}var a0=class{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement(`div`)),this.dom.classList.add(`cm-layer`),t.above&&this.dom.classList.add(`cm-layer-above`),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute(`aria-hidden`,`true`),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(o0)!=e.state.facet(o0)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(o0);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>!i0(e,this.drawn[t]))){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e,Z.webkit&&(this.dom.style.display=this.dom.firstChild?``:`none`)}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}},o0=X.define();function s0(e){return[OZ.define(t=>new a0(t,e)),o0.of(e)]}var c0=X.define({combine(e){return nY(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function l0(e={}){return[c0.of(e),d0,p0,h0,yZ.of(!0)]}function u0(e){return e.startState.facet(c0)!=e.state.facet(c0)}var d0=s0({above:!0,markers(e){let{state:t}=e,n=t.facet(c0),r=[];for(let i of t.selection.ranges){let a=i==t.selection.main;if(i.empty||n.drawRangeCursor&&!(a&&Z.ios&&n.iosSelectionHandles)){let t=a?`cm-cursor cm-cursor-primary`:`cm-cursor cm-cursor-secondary`,n=i.empty?i:Y.cursor(i.head,i.assoc);for(let i of e0.forRange(e,t,n))r.push(i)}}return r},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName=t.style.animationName==`cm-blink`?`cm-blink2`:`cm-blink`);let n=u0(e);return n&&f0(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){f0(t.state,e)},class:`cm-cursorLayer`});function f0(e,t){t.style.animationDuration=e.facet(c0).cursorBlinkRate+`ms`}var p0=s0({above:!1,markers(e){let t=[],{main:n,ranges:r}=e.state.selection;for(let n of r)if(!n.empty)for(let r of e0.forRange(e,`cm-selectionBackground`,n))t.push(r);if(Z.ios&&!n.empty&&e.state.facet(c0).iosSelectionHandles){for(let r of e0.forRange(e,`cm-selectionHandle cm-selectionHandle-start`,Y.cursor(n.from,1)))t.push(r);for(let r of e0.forRange(e,`cm-selectionHandle cm-selectionHandle-end`,Y.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||u0(e)},class:`cm-selectionLayer`}),m0=Z.gecko&&Z.gecko_version==153?`#ffffff01`:`transparent`,h0=SJ.highest($.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:`${m0} !important`},caretColor:`transparent !important`},".cm-content":{caretColor:`transparent !important`,"& :focus":{caretColor:`initial !important`,"&::selection, & ::selection":{backgroundColor:`Highlight !important`}}}})),g0=BJ.define({map(e,t){return e==null?null:t.mapPos(e)}}),_0=yJ.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(g0)?t.value:e,e)}}),v0=OZ.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(_0);n==null?this.cursor!=null&&((t=this.cursor)==null||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement(`div`)),this.cursor.className=`cm-dropCursor`),(e.startState.field(_0)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(_0),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+`px`,this.cursor.style.top=e.top/n+`px`,this.cursor.style.height=e.height/n+`px`):this.cursor.style.left=`-100000px`}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(_0)!=e&&this.view.dispatch({effects:g0.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function y0(){return[_0,v0]}function b0(e,t,n,r,i){t.lastIndex=0;for(let a=e.iterRange(n,r),o=n,s;!a.next().done;o+=a.value.length)if(!a.lineBreak)for(;s=t.exec(a.value);)i(o+s.index,s)}function x0(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:a}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),a=Math.min(e.state.doc.lineAt(a).to,a+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=a:r.push({from:i,to:a});return r}var S0=class{constructor(e){let{regexp:t,decoration:n,decorate:r,boundary:i,maxLength:a=1e3}=e;if(!t.global)throw RangeError(`The regular expression given to MatchDecorator should have its 'g' flag set`);if(this.regexp=t,r)this.addMatch=(e,t,n,i)=>r(i,n,n+e[0].length,e,t);else if(typeof n==`function`)this.addMatch=(e,t,r,i)=>{let a=n(e,t,r);a&&i(r,r+e[0].length,a)};else if(n)this.addMatch=(e,t,r,i)=>i(r,r+e[0].length,n);else throw RangeError(`Either 'decorate' or 'decoration' should be provided to MatchDecorator`);this.boundary=i,this.maxLength=a}createDeco(e){let t=new dY,n=t.add.bind(t);for(let{from:t,to:r}of x0(e,this.maxLength))b0(e.state.doc,this.regexp,t,r,(t,r)=>this.addMatch(r,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((t,i,a,o)=>{o>=e.view.viewport.from&&a<=e.view.viewport.to&&(n=Math.min(a,n),r=Math.max(o,r))}),e.viewportMoved||r-n>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let i of e.visibleRanges){let a=Math.max(i.from,n),o=Math.min(i.to,r);if(o>=a){let n=e.state.doc.lineAt(a),r=n.to<o?e.state.doc.lineAt(o):n,s=Math.max(i.from,n.from),c=Math.min(i.to,r.to);if(this.boundary){for(;a>n.from;a--)if(this.boundary.test(n.text[a-1-n.from])){s=a;break}for(;o<r.to;o++)if(this.boundary.test(r.text[o-r.from])){c=o;break}}let l=[],u,d=(e,t,n)=>l.push(n.range(e,t));if(n==r)for(this.regexp.lastIndex=s-n.from;(u=this.regexp.exec(n.text))&&u.index<c-n.from;)this.addMatch(u,e,u.index+n.from,d);else b0(e.state.doc,this.regexp,s,c,(t,n)=>this.addMatch(n,e,t,d));t=t.update({filterFrom:s,filterTo:c,filter:(e,t)=>e<s||t>c,add:l})}}return t}},C0=/x/.unicode==null?`g`:`gu`,w0=RegExp(`[\0-\b
29
+ --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩-]`,C0),T0={0:`null`,7:`bell`,8:`backspace`,10:`newline`,11:`vertical tab`,13:`carriage return`,27:`escape`,8203:`zero width space`,8204:`zero width non-joiner`,8205:`zero width joiner`,8206:`left-to-right mark`,8207:`right-to-left mark`,8232:`line separator`,8237:`left-to-right override`,8238:`right-to-left override`,8294:`left-to-right isolate`,8295:`right-to-left isolate`,8297:`pop directional isolate`,8233:`paragraph separator`,65279:`zero width no-break space`,65532:`object replacement`},E0=null;function D0(){if(E0==null&&typeof document<`u`&&document.body){let e=document.body.style;E0=(e.tabSize??e.MozTabSize)!=null}return E0||!1}var O0=X.define({combine(e){let t=nY(e,{render:null,specialChars:w0,addSpecialChars:null});return(t.replaceTabs=!D0())&&(t.specialChars=RegExp(` |`+t.specialChars.source,C0)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+`|`+t.addSpecialChars.source,C0)),t}});function k0(e={}){return[O0.of(e),j0()]}var A0=null;function j0(){return A0||=OZ.fromClass(class{constructor(e){this.view=e,this.decorations=Q.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(O0)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new S0({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,a=Zq(t[0],0);if(a==9){let e=i.lineAt(r),t=n.state.tabSize,a=SY(e.text,t,r-e.from);return Q.replace({widget:new F0((t-a%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=Q.replace({widget:new P0(e,a)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(O0);e.startState.facet(O0)==t?this.decorations=this.decorator.updateDeco(e,this.decorations):(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view))}},{decorations:e=>e.decorations})}var M0=`•`;function N0(e){return e>=32?M0:e==10?`␤`:String.fromCharCode(9216+e)}var P0=class extends rX{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=N0(this.code),n=e.state.phrase(`Control character`)+` `+(T0[this.code]||`0x`+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let i=document.createElement(`span`);return i.textContent=t,i.title=n,i.setAttribute(`aria-label`,n),i.className=`cm-specialChar`,i}ignoreEvent(){return!1}},F0=class extends rX{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement(`span`);return e.textContent=` `,e.className=`cm-tab`,e.style.width=this.width+`px`,e}ignoreEvent(){return!1}};function I0(){return R0}var L0=Q.line({class:`cm-activeLine`}),R0=OZ.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(L0.range(i.from)),t=i.from)}return Q.set(n)}},{decorations:e=>e.decorations}),z0=class extends rX{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement(`span`);return t.className=`cm-placeholder`,t.style.pointerEvents=`none`,t.appendChild(typeof this.content==`string`?document.createTextNode(this.content):typeof this.content==`function`?this.content(e):this.content.cloneNode(!0)),t.setAttribute(`aria-hidden`,`true`),t}coordsAt(e){let t=e.firstChild?hX(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=xX(t[0],n.direction!=`rtl`),i=parseInt(n.lineHeight);return r.bottom-r.top>i*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+i}:r}ignoreEvent(){return!1}};function B0(e){let t=OZ.fromClass(class{constructor(t){this.view=t,this.placeholder=e?Q.set([Q.widget({widget:new z0(e),side:1}).range(0)]):Q.none}get decorations(){return this.view.state.doc.length?Q.none:this.placeholder}},{decorations:e=>e.decorations});return typeof e==`string`?[t,$.contentAttributes.of({"aria-placeholder":e})]:t}var V0=2e3;function H0(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),a=[];if(t.off>V0||n.off>V0||t.col<0||n.col<0){let o=Math.min(t.off,n.off),s=Math.max(t.off,n.off);for(let t=r;t<=i;t++){let n=e.doc.line(t);n.length<=s&&a.push(Y.range(n.from+o,n.to+s))}}else{let o=Math.min(t.col,n.col),s=Math.max(t.col,n.col);for(let t=r;t<=i;t++){let n=e.doc.line(t),r=CY(n.text,o,e.tabSize,!0);if(r<0)a.push(Y.cursor(n.to));else{let t=CY(n.text,s,e.tabSize);a.push(Y.range(n.from+r,n.from+t))}}}return a}function U0(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function W0(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,a=i>V0?-1:i==r.length?U0(e,t.clientX):SY(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:a,off:i}}function G0(e,t){let n=W0(e,t),r=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),i=e.state.doc.lineAt(t);n={line:i.number,col:n.col,off:Math.min(n.off,i.length)},r=r.map(e.changes)}},get(t,i,a){let o=W0(e,t);if(!o)return r;let s=H0(e.state,n,o);return s.length?a?Y.create(s.concat(r.ranges)):Y.create(s):r}}:null}function K0(e){let t=e?.eventFilter||(e=>e.altKey&&e.button==0);return $.mouseSelectionStyle.of((e,n)=>t(n)?G0(e,n):null)}var q0={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},J0={style:`cursor: crosshair`};function Y0(e={}){let[t,n]=q0[e.key||`Alt`],r=OZ.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){(e.keyCode==t||!n(e))&&this.set(!1)},mousemove(e){this.set(n(e))}}});return[r,$.contentAttributes.of(e=>e.plugin(r)?.isDown?J0:null)]}var X0=`-10000px`,Z0=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let a=[],o=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)a[n]=this.createTooltipView(r,n?a[n-1]:null),o&&(o[n]=!!r.above);else{let r=a[n]=this.tooltipViews[s];o&&(o[n]=t[s]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)a.indexOf(e)<0&&(this.removeTooltipView(e),(n=e.destroy)==null||n.call(e));return t&&(o.forEach((e,n)=>t[n]=e),t.length=o.length),this.input=r,this.tooltips=i,this.tooltipViews=a,!0}};function Q0(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}var $0=X.define({combine:e=>({position:Z.ios?`absolute`:e.find(e=>e.position)?.position||`fixed`,parent:e.find(e=>e.parent)?.parent||null,tooltipSpace:e.find(e=>e.tooltipSpace)?.tooltipSpace||Q0})}),e2=new WeakMap,t2=OZ.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet($0);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver==`function`?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Z0(e,i2,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver==`function`?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener(`resize`,this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement(`div`),this.container.style.position=`relative`,this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet($0);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add(`cm-tooltip`),e.arrow&&!n.dom.querySelector(`.cm-tooltip > .cm-tooltip-arrow`)){let e=document.createElement(`div`);e.className=`cm-tooltip-arrow`,n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=X0,n.dom.style.left=`0px`,this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener(`resize`,this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(e=t.destroy)==null||e.call(t);this.parent&&this.container.remove(),(t=this.resizeObserver)==null||t.disconnect(),(n=this.intersectionObserver)==null||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position==`fixed`&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(Z.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||this.position==`absolute`){if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState)}let r=this.view.scrollDOM.getBoundingClientRect(),i=zZ(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet($0).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){if(e.makeAbsolute){this.madeAbsolute=!0,this.position=`absolute`;for(let e of this.manager.tooltipViews)e.dom.style.position=`absolute`}let{visible:t,space:n,scaleX:r,scaleY:i}=e,a=[];for(let o=0;o<this.manager.tooltips.length;o++){let s=this.manager.tooltips[o],c=this.manager.tooltipViews[o],{dom:l}=c,u=e.pos[o],d=e.size[o];if(!u||s.clip!==!1&&(u.bottom<=Math.max(t.top,n.top)||u.top>=Math.min(t.bottom,n.bottom)||u.right<Math.max(t.left,n.left)-.1||u.left>Math.min(t.right,n.right)+.1)){l.style.top=X0;continue}let f=s.arrow?c.dom.querySelector(`.cm-tooltip-arrow`):null,p=f?7:0,m=d.right-d.left,h=e2.get(c)??d.bottom-d.top,g=c.offset||Qne,_=this.view.textDirection==BX.LTR,v=d.width>n.right-n.left?_?n.left:n.right-d.width:_?Math.max(n.left,Math.min(u.left-(f?14:0)+g.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(f?14:0)-g.x),n.right-m),y=this.above[o];!s.strictSide&&(y?u.top-h-p-g.y<n.top:u.bottom+h+p+g.y>n.bottom)&&y==n.bottom-u.bottom>u.top-n.top&&(y=this.above[o]=!y);let b=(y?u.top-n.top:n.bottom-u.bottom)-p;if(b<h&&c.resize!==!1){if(b<this.view.defaultLineHeight){l.style.top=X0;continue}e2.set(c,h),l.style.height=(h=b)/i+`px`}else l.style.height&&(l.style.height=``);let x=y?u.top-h-p-g.y:u.bottom+p+g.y,S=v+m;if(c.overlap!==!0)for(let e of a)e.left<S&&e.right>v&&e.top<x+h&&e.bottom>x&&(x=y?e.top-h-2-p:e.bottom+p+2);if(this.position==`absolute`?(l.style.top=(x-e.parent.top)/i+`px`,n2(l,(v-e.parent.left)/r)):(l.style.top=x/i+`px`,n2(l,v/r)),f){let e=u.left+(_?g.x:-g.x)-(v+14-7);f.style.left=e/r+`px`}c.overlap!==!0&&a.push({left:v,top:x,right:S,bottom:x+h}),l.classList.toggle(`cm-tooltip-above`,y),l.classList.toggle(`cm-tooltip-below`,!y),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=X0}},{eventObservers:{scroll(){this.maybeMeasure()}}});function n2(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+`px`)}var r2=$.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:`border-box`},"&light .cm-tooltip":{border:`1px solid #bbb`,backgroundColor:`#f5f5f5`},"&light .cm-tooltip-section:not(:first-child)":{borderTop:`1px solid #bbb`},"&dark .cm-tooltip":{backgroundColor:`#333338`,color:`white`},".cm-tooltip-arrow":{height:`7px`,width:`14px`,position:`absolute`,zIndex:-1,overflow:`hidden`,"&:before, &:after":{content:`''`,position:`absolute`,width:0,height:0,borderLeft:`7px solid transparent`,borderRight:`7px solid transparent`},".cm-tooltip-above &":{bottom:`-7px`,"&:before":{borderTop:`7px solid #bbb`},"&:after":{borderTop:`7px solid #f5f5f5`,bottom:`1px`}},".cm-tooltip-below &":{top:`-7px`,"&:before":{borderBottom:`7px solid #bbb`},"&:after":{borderBottom:`7px solid #f5f5f5`,top:`1px`}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:`#333338`,borderBottomColor:`#333338`},"&:after":{borderTopColor:`transparent`,borderBottomColor:`transparent`}}}),Qne={x:0,y:0},i2=X.define({enables:[t2,r2]}),a2=X.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])}),o2=class e{static create(t){return new e(t)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement(`div`),this.dom.classList.add(`cm-tooltip-hover`),this.manager=new Z0(e,a2,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add(`cm-tooltip-section`),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)==null||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp(`offset`)}get getCoords(){return this.passProp(`getCoords`)}get overlap(){return this.passProp(`overlap`)}get resize(){return this.passProp(`resize`)}},s2=i2.compute([a2],e=>{let t=e.facet(a2);return t.length===0?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>e.end??e.pos)),create:o2.create,above:t[0].above,arrow:t.some(e=>e.arrow)}}),c2=X.define(),l2=class{constructor(e,t,n,r,i,a){this.view=e,this.source=t,this.field=n,this.locked=r,this.setHover=i,this.hoverTime=a,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener(`mouseleave`,this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener(`mousemove`,this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let r,i=1;if(n.isWidget())r=n.posAtStart;else{if(r=e.posAtCoords(t),r==null)return;let n=e.coordsAtPos(r);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(r)).find(e=>e.from<=r&&e.to>=r),o=a&&a.dir==BX.RTL?-1:1;i=t.x<n.left?-o:o}this.activateHover(e,r,i)}activateHover(e,t,n,r){let i=this.source(e,t,n),a=t=>{if(t&&(!Array.isArray(t)||t.length)){let n=Array.isArray(t)?t:[t];r&&this.locked.set(n,r),e.dispatch({effects:this.setHover.of(n)})}};if(i&&`then`in i){let n=this.pending={pos:t};i.then(e=>{this.pending==n&&(this.pending=null,a(e))},t=>wZ(e.state,t,`hover tooltip`))}else a(i)}get tooltip(){let e=this.view.plugin(t2),t=e?e.manager.tooltips.findIndex(e=>e.create==o2.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:t,tooltip:n}=this;if(t.length&&!this.locked.has(t)&&n&&!d2(n.dom,e)||this.pending){let{pos:n}=t[0]||this.pending,r=t[0]?.end??n;(n==r?this.view.posAtCoords(this.lastMove)!=n:!f2(this.view,n,r,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length&&!this.locked.has(t)){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener(`mouseleave`,t);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener(`mouseleave`,t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener(`mouseleave`,this.mouseleave),this.view.dom.removeEventListener(`mousemove`,this.mousemove)}},u2=4;function d2(e,t){let{left:n,right:r,top:i,bottom:a}=e.getBoundingClientRect(),o;if(o=e.querySelector(`.cm-tooltip-arrow`)){let e=o.getBoundingClientRect();i=Math.min(e.top,i),a=Math.max(e.bottom,a)}return t.clientX>=n-u2&&t.clientX<=r+u2&&t.clientY>=i-u2&&t.clientY<=a+u2}function f2(e,t,n,r,i,a){let o=e.scrollDOM.getBoundingClientRect(),s=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>r||o.right<r||o.top>i||Math.min(o.bottom,s)<i)return!1;let c=e.posAtCoords({x:r,y:i},!1);return c>=t&&c<=n}function p2(e,t={}){let n=BJ.define(),r=new WeakMap,i=yJ.define({create(){return[]},update(e,a){let o=r.get(e);if(e.length&&(t.hideOnChange&&(a.docChanged||a.selection)||o&&o(a)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(a,e)))),a.docChanged&&e.length){let t=[];for(let n of e){let e=a.changes.mapPos(n.pos,-1,tJ.TrackDel);if(e!=null){let r=Object.assign(Object.create(null),n);r.pos=e,r.end!=null&&(r.end=a.changes.mapPos(r.end)),t.push(r)}}e=t}for(let t of a.effects)t.is(n)&&(e=t.value,o=void 0),(t.is(g2)&&!t.value||t.value==i)&&(e=[]);return e.length&&o&&r.set(e,o),e},provide:e=>a2.from(e)}),a=OZ.define(a=>new l2(a,e,i,r,n,t.hoverTime||300));return{active:i,extension:[i,a,c2.of(a),s2]}}function m2(e,t,n,r={}){let i=e.state.facet(c2).map(t=>e.plugin(t)).filter(e=>!!e);if(r.tooltip&&r.tooltip.active){let e=i.find(e=>e.field==r.tooltip.active);e&&(i=[e])}for(let a of i)a.activateHover(e,t,n,r.until??(()=>!1))}function h2(e,t){let n=e.plugin(t2);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}var g2=BJ.define(),_2=X.define({combine(e){let t,n;for(let r of e)t||=r.topContainer,n||=r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function v2(e,t){let n=e.plugin(y2),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}var y2=OZ.fromClass(class{constructor(e){this.input=e.state.facet(S2),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(_2);this.top=new b2(e,!0,t.topContainer),this.bottom=new b2(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}update(e){let t=e.state.facet(_2);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new b2(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new b2(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(S2);if(n!=this.input){let t=n.filter(e=>e),r=[],i=[],a=[],o=[];for(let n of t){let t=this.specs.indexOf(n),s;t<0?(s=n(e.view),o.push(s)):(s=this.panels[t],s.update&&s.update(e)),r.push(s),(s.top?i:a).push(s)}this.specs=t,this.panels=r,this.top.sync(i),this.bottom.sync(a);for(let e of o)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>$.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})}),b2=class{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes=``,this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&=(this.dom.remove(),void 0);return}if(!this.dom){this.dom=document.createElement(`div`),this.dom.className=this.top?`cm-panels cm-panels-top`:`cm-panels cm-panels-bottom`;let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=x2(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=x2(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(` `))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(` `))e&&this.container.classList.add(e)}}};function x2(e){let t=e.nextSibling;return e.remove(),t}var S2=X.define({enables:y2});function C2(e,t){let n,r=new Promise(e=>n=e),i=e=>O2(e,t,n);e.state.field(T2,!1)?e.dispatch({effects:E2.of(i)}):e.dispatch({effects:BJ.appendConfig.of(T2.init(()=>[i]))});let a=D2.of(i);return{close:a,result:r.then(t=>((e.win.queueMicrotask||(t=>e.win.setTimeout(t,10)))(()=>{e.state.field(T2).indexOf(i)>-1&&e.dispatch({effects:a})}),t))}}function w2(e,t){let n=e.state.field(T2,!1)||[];for(let r of n){let n=v2(e,r);if(n&&n.dom.classList.contains(t))return n}return null}var T2=yJ.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(E2)?e=[n.value].concat(e):n.is(D2)&&(e=e.filter(e=>e!=n.value));return e},provide:e=>S2.computeN([e],t=>t.field(e))}),E2=BJ.define(),D2=BJ.define();function O2(e,t,n){let r=t.content?t.content(e,()=>o(null)):null;if(!r){if(r=RY(`form`),t.input){let e=RY(`input`,t.input);/^(text|password|number|email|tel|url)$/.test(e.type)&&e.classList.add(`cm-textfield`),e.name||=`input`,r.appendChild(RY(`label`,(t.label||``)+`: `,e))}else r.appendChild(document.createTextNode(t.label||``));r.appendChild(document.createTextNode(` `)),r.appendChild(RY(`button`,{class:`cm-button`,type:`submit`},t.submitLabel||`OK`))}let i=r.nodeName==`FORM`?[r]:r.querySelectorAll(`form`);for(let e=0;e<i.length;e++){let t=i[e];t.addEventListener(`keydown`,e=>{e.keyCode==27?(e.preventDefault(),o(null)):e.keyCode==13&&(e.preventDefault(),o(t))}),t.addEventListener(`submit`,e=>{e.preventDefault(),o(t)})}let a=RY(`div`,r,RY(`button`,{onclick:()=>o(null),"aria-label":e.state.phrase(`close`),class:`cm-dialog-close`,type:`button`},[`×`]));t.class&&(a.className=t.class),a.classList.add(`cm-dialog`);function o(t){a.contains(a.ownerDocument.activeElement)&&e.focus(),n(t)}return{dom:a,top:t.top,mount:()=>{if(t.focus){let e;e=typeof t.focus==`string`?r.querySelector(t.focus):r.querySelector(`input`)||r.querySelector(`button`),e&&`select`in e?e.select():e&&`focus`in e&&e.focus()}}}}var k2=class extends rY{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};k2.prototype.elementClass=``,k2.prototype.toDOM=void 0,k2.prototype.mapMode=tJ.TrackBefore,k2.prototype.startSide=k2.prototype.endSide=-1,k2.prototype.point=!0;var A2=X.define(),j2=X.define(),M2={class:``,renderEmptyElements:!1,elementStyle:``,markers:()=>cY.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:`before`},N2=X.define();function P2(e){return[I2(),N2.of({...M2,...e})]}var F2=X.define({combine:e=>e.some(e=>e)});function I2(e){let t=[L2];return e&&e.fixed===!1&&t.push(F2.of(!0)),t}var L2=OZ.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement(`div`),this.dom.className=`cm-gutters cm-gutters-before`,this.dom.setAttribute(`aria-hidden`,`true`),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.gutters=e.state.facet(N2).map(t=>new V2(e,t)),this.fixed=!e.state.facet(F2);for(let e of this.gutters)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position=`sticky`),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement(`div`),this.domAfter.className=`cm-gutters cm-gutters-after`,this.domAfter.setAttribute(`aria-hidden`,`true`),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.domAfter.style.position=this.fixed?`sticky`:``,this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+`px`;this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(F2)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?`sticky`:``,this.domAfter&&(this.domAfter.style.position=this.fixed?`sticky`:``)),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=cY.iter(this.view.state.facet(A2),this.view.viewport.from),r=[],i=this.gutters.map(e=>new B2(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let a of e.type)if(a.type==iX.Text&&t){z2(n,r,a.from);for(let e of i)e.line(this.view,a,r);t=!1}else if(a.widget)for(let e of i)e.widget(this.view,a)}else if(e.type==iX.Text){z2(n,r,e.from);for(let t of i)t.line(this.view,e,r)}else if(e.widget)for(let t of i)t.widget(this.view,e);for(let e of i)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(N2),n=e.state.facet(N2),r=e.docChanged||e.heightChanged||e.viewportChanged||!cY.eq(e.startState.facet(A2),e.state.facet(A2),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let i=[];for(let r of n){let n=t.indexOf(r);n<0?i.push(new V2(this.view,r)):(this.gutters[n].update(e),i.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),i.indexOf(e)<0&&e.destroy();for(let e of i)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>$.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==BX.LTR?{left:r,right:i}:{right:r,left:i}})});function R2(e){return Array.isArray(e)?e:[e]}function z2(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}var B2=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=cY.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,i=(t.top-this.height)/e.scaleY,a=t.height/e.scaleY;if(this.i==r.elements.length){let t=new H2(e,a,i,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,a,i,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];z2(this.cursor,r,t.from),n.length&&(r=r.concat(n));let i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);let a=this.gutter;(r.length!=0||a.config.renderEmptyElements)&&this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let n of e.state.facet(j2)){let i=n(e,t.widget,t);i&&(r||=[]).push(i)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},V2=class{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement(`div`),this.dom.className=`cm-gutter`+(this.config.class?` `+this.config.class:``);for(let n in t.domEventHandlers)this.dom.addEventListener(n,r=>{let i=r.target,a;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();a=(e.top+e.bottom)/2}else a=r.clientY;let o=e.lineBlockAtHeight(a-e.documentTop);t.domEventHandlers[n](e,o,r)&&r.preventDefault()});this.markers=R2(t.markers(e)),t.initialSpacer&&(this.spacer=new H2(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+=`visibility: hidden; pointer-events: none`)}update(e){let t=this.markers;if(this.markers=R2(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!cY.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},H2=class{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement(`div`),this.dom.className=`cm-gutterElement`,this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+`px`),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+`px`:``),U2(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n=`cm-gutterElement`,r=this.dom.firstChild;for(let i=0,a=0;;){let o=a,s=i<t.length?t[i++]:null,c=!1;if(s){let e=s.elementClass;e&&(n+=` `+e);for(let e=a;e<this.markers.length;e++)if(this.markers[e].compare(s)){o=e,c=!0;break}}else o=this.markers.length;for(;a<o;){let e=this.markers[a++];if(e.toDOM){e.destroy(r);let t=r.nextSibling;r.remove(),r=t}}if(!s)break;s.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(s.toDOM(e),r)),c&&a++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}};function U2(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}var W2=X.define(),G2=X.define(),K2=X.define({combine(e){return nY(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],i=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||i(e,t,n):i}return n}})}}),q2=class extends k2{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function J2(e,t){return e.state.facet(K2).formatNumber(t,e.state)}var Y2=N2.compute([K2],e=>({class:`cm-lineNumbers`,renderEmptyElements:!1,markers(e){return e.state.facet(W2)},lineMarker(e,t,n){return n.some(e=>e.toDOM)?null:new q2(J2(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let r of e.state.facet(G2)){let i=r(e,t,n);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(K2)!=e.state.facet(K2),initialSpacer(e){return new q2(J2(e,Z2(e.state.doc.lines)))},updateSpacer(e,t){let n=J2(t.view,Z2(t.view.state.doc.lines));return n==e.number?e:new q2(n)},domEventHandlers:e.facet(K2).domEventHandlers,side:`before`}));function X2(e={}){return[K2.of(e),I2(),Y2]}function Z2(e){let t=9;for(;t<e;)t=t*10+9;return t}var Q2=new class extends k2{constructor(){super(...arguments),this.elementClass=`cm-activeLineGutter`}},$2=A2.compute([`selection`],e=>{let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(Q2.range(i)))}return cY.of(t)});function e4(){return $2}var t4=new qG;function n4(e){return X.define({combine:e?t=>t.concat(e):void 0})}var r4=new qG,i4=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,tY.prototype.hasOwnProperty(`tree`)||Object.defineProperty(tY.prototype,"tree",{get(){return s4(this)}}),this.parser=t,this.extension=[g4.of(this),tY.languageData.of((e,t,n)=>{let r=a4(e,t,n),i=r.type.prop(t4);if(!i)return[];let a=e.facet(i),o=r.type.prop(r4);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return a4(e,t,n).type.prop(t4)==this.data}findRegions(e){let t=e.facet(g4);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(t4)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(qG.mounted);if(i){if(i.tree.prop(t4)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof tK&&r(i,e.positions[n]+t)}};return r(s4(e),0),n}get allowsNesting(){return!0}};i4.setState=BJ.define();function a4(e,t,n){let r=e.facet(g4),i=s4(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,eK.ExcludeBuffers|eK.EnterBracketed))e.type.isTop&&(i=e);return i}var o4=class e extends i4{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(t){let n=n4(t.languageData);return new e(n,t.parser.configure({props:[t4.add(e=>e.isTop?n:void 0)]}),t.name)}configure(t,n){return new e(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function s4(e){let t=e.field(i4.state,!1);return t?t.tree:tK.empty}var c4=class{constructor(e){this.doc=e,this.cursorPos=0,this.string=``,this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},l4=null,u4=class e{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new e(t,n,[],tK.empty,0,r,[],null)}startParse(){return this.parser.startParse(new c4(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=tK.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||=this.startParse(),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n){if(this.fragments=this.withoutTempSkipped(xK.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=this.parse.stoppedAt??this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0}if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(xK.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=l4;l4=this;try{return e()}finally{l4=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=d4(e,t.from,t.to);return e}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})),r=xK.applyChanges(r,e),i=tK.empty,a=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&s.push({from:n,to:r})}}}return new e(this.parser,n,r,i,a,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=d4(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&=(this.takeTree(),null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends SK{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=l4;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new tK(XG.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return l4}};function d4(e,t,n){return xK.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}var f4=class e{constructor(e){this.context=e,this.tree=e.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=u4.create(t.facet(g4).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}};i4.state=yJ.define({create:f4.init,update(e,t){for(let e of t.effects)if(e.is(i4.setState))return e.value;return t.startState.facet(g4)==t.state.facet(g4)?e.apply(t):f4.init(t.state)}});var p4=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<`u`&&(p4=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});var m4=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,h4=OZ.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(i4.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(i4.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=p4(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(i4.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!m4?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>m4&&m4()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:i4.setState.of(new f4(i.context))})),this.chunkBudget>0&&(!s||o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&=(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>wZ(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),g4=X.define({combine(e){return e.length?e[0]:null},enables:e=>[i4.state,h4,$.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),_4=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},v4=X.define(),y4=X.define({combine:e=>{if(!e.length)return` `;let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error(`Invalid indent unit: `+JSON.stringify(e[0]));return t}});function b4(e){let t=e.facet(y4);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function x4(e,t){let n=``,r=e.tabSize,i=e.facet(y4)[0];if(i==` `){for(;t>=r;)n+=` `,t-=r;i=` `}for(let e=0;e<t;e++)n+=i;return n}function S4(e,t){e instanceof tY&&(e=new C4(e));for(let n of e.state.facet(v4)){let r=n(e,t);if(r!==void 0)return r}let n=s4(e.state);return n.length>=t?T4(e,n,t):null}var C4=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=b4(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return r!=null&&r>=n.from&&r<=n.to?i&&r==e?{text:``,from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return``;let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(i+=a-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return SY(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},w4=new qG;function T4(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return E4(r,e,n)}function E4(e,t,n){for(let r=e;r;r=r.next){let e=O4(r.node);if(e)return e(A4.create(t,n,r))}return 0}function D4(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function O4(e){let t=e.type.prop(w4);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(qG.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>N4(e,!0,1,void 0,n&&!D4(e)?t.from:void 0)}return e.parent==null?k4:null}function k4(){return 0}var A4=class e extends C4{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(t,n,r){return new e(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(j4(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return E4(this.context.next,this.base,this.pos)}};function j4(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function M4(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,a=e.state.doc.lineAt(n.from),o=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=o)return null;let e=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}function N4(e,t,n,r,i){let a=e.textAfter,o=a.match(/^\s*/)[0].length,s=r&&a.slice(o,o+r.length)==r||i==e.pos+o,c=t?M4(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}function P4({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}var F4=200;function I4(){return tY.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent(`input.type`)&&!e.isUserEvent(`input.complete`))return e;let t=e.startState.languageDataAt(`indentOnInput`,e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+F4)return e;let a=n.sliceString(i.from,r);if(!t.some(e=>e.test(a)))return e;let{state:o}=e,s=-1,c=[];for(let{head:e}of o.selection.ranges){let t=o.doc.lineAt(e);if(t.from==s)continue;s=t.from;let n=S4(o,t.from);if(n==null)continue;let r=/^\s*/.exec(t.text)[0],i=x4(o,n);r!=i&&c.push({from:t.from,to:t.from+r.length,insert:i})}return c.length?[e,{changes:c,sequential:!0}]:e})}var L4=X.define(),R4=new qG;function z4(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}function B4(e,t,n){let r=s4(e);if(r.length<n)return null;let i=r.resolveStack(n,1),a=null;for(let o=i;o;o=o.next){let i=o.node;if(i.to<=n||i.from>n)continue;if(a&&i.from<t)break;let s=i.type.prop(R4);if(s&&(i.to<r.length-50||r.length==e.doc.length||!V4(i))){let r=s(i,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(a=r)}}return a}function V4(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function H4(e,t,n){for(let r of e.facet(L4)){let i=r(e,t,n);if(i)return i}return B4(e,t,n)}function U4(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}var W4=BJ.define({map:U4}),G4=BJ.define({map:U4});function K4(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}var q4=yJ.define({create(){return Q.none},update(e,t){t.isUserEvent(`delete`)&&t.changes.iterChangedRanges((t,n)=>e=J4(e,t,n)),e=e.map(t.changes);let n=[];for(let r of t.effects)r.is(W4)&&!X4(e,r.value.from,r.value.to)?n.push(r.value):r.is(G4)&&(e=e.update({filter:(e,t)=>r.value.from!=e||r.value.to!=t,filterFrom:r.value.from,filterTo:r.value.to}));if(n.length){let{preparePlaceholder:r}=t.state.facet(r3),i=n.map(e=>(r?Q.replace({widget:new s3(r(t.state,e))}):o3).range(e.from,e.to));e=e.update({add:i})}return t.selection&&(e=J4(e,t.selection.main.head)),e},provide:e=>$.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw RangeError(`Invalid JSON for fold state`);let t=[];for(let n=0;n<e.length;){let r=e[n++],i=e[n++];if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid JSON for fold state`);t.push(o3.range(r,i))}return Q.set(t,!0)}});function J4(e,t,n=t){let r=!1;return e.between(t,n,(e,i)=>{e<n&&i>t&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(e,r)=>e>=n||r<=t}):e}function Y4(e,t,n){var r;let i=null;return(r=e.field(q4,!1))==null||r.between(t,n,(e,t)=>{(!i||i.from>e)&&(i={from:e,to:t})}),i}function X4(e,t,n){let r=!1;return e.between(t,t,(e,i)=>{e==t&&i==n&&(r=!0)}),r}function Z4(e,t){return e.field(q4,!1)?t:t.concat(BJ.appendConfig.of(i3()))}var Q4=e=>{for(let t of K4(e)){let n=H4(e.state,t.from,t.to);if(n)return e.dispatch({effects:Z4(e.state,[W4.of(n),e3(e,n)])}),!0}return!1},$4=e=>{if(!e.state.field(q4,!1))return!1;let t=[];for(let n of K4(e)){let r=Y4(e.state,n.from,n.to);r&&t.push(G4.of(r),e3(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function e3(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return $.announce.of(`${e.state.phrase(n?`Folded lines`:`Unfolded lines`)} ${r} ${e.state.phrase(`to`)} ${i}.`)}var t3=[{key:`Ctrl-Shift-[`,mac:`Cmd-Alt-[`,run:Q4},{key:`Ctrl-Shift-]`,mac:`Cmd-Alt-]`,run:$4},{key:`Ctrl-Alt-[`,run:e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),a=H4(t,i.from,i.to);a&&n.push(W4.of(a)),r=(a?e.lineBlockAt(a.to):i).to+1}return n.length&&e.dispatch({effects:Z4(e.state,n)}),!!n.length}},{key:`Ctrl-Alt-]`,run:e=>{let t=e.state.field(q4,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(G4.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],n3={placeholderDOM:null,preparePlaceholder:null,placeholderText:`…`},r3=X.define({combine(e){return nY(e,n3)}});function i3(e){let t=[q4,d3];return e&&t.push(r3.of(e)),t}function a3(e,t){let{state:n}=e,r=n.facet(r3),i=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=Y4(e.state,n.from,n.to);r&&e.dispatch({effects:G4.of(r)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let a=document.createElement(`span`);return a.textContent=r.placeholderText,a.setAttribute(`aria-label`,n.phrase(`folded code`)),a.title=n.phrase(`unfold`),a.className=`cm-foldPlaceholder`,a.onclick=i,a}var o3=Q.replace({widget:new class extends rX{toDOM(e){return a3(e,null)}}}),s3=class extends rX{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return a3(e,this.value)}},c3={openText:`⌄`,closedText:`›`,markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1},l3=class extends k2{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement(`span`);return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?`Fold line`:`Unfold line`),t}};function u3(e={}){let t={...c3,...e},n=new l3(t,!0),r=new l3(t,!1),i=OZ.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(g4)!=e.state.facet(g4)||e.startState.field(q4,!1)!=e.state.field(q4,!1)||s4(e.startState)!=s4(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new dY;for(let i of e.viewportLineBlocks){let a=Y4(e.state,i.from,i.to)?r:H4(e.state,i.from,i.to)?n:null;a&&t.add(i.from,i.from,a)}return t.finish()}}),{domEventHandlers:a}=t;return[i,P2({class:`cm-foldGutter`,markers(e){return e.plugin(i)?.markers||cY.empty},initialSpacer(){return new l3(t,!1)},domEventHandlers:{...a,click:(e,t,n)=>{if(a.click&&a.click(e,t,n))return!0;let r=Y4(e.state,t.from,t.to);if(r)return e.dispatch({effects:G4.of(r)}),!0;let i=H4(e.state,t.from,t.to);return i?(e.dispatch({effects:W4.of(i)}),!0):!1}}}),i3()]}var d3=$.baseTheme({".cm-foldPlaceholder":{backgroundColor:`#eee`,border:`1px solid #ddd`,color:`#888`,borderRadius:`.2em`,margin:`0 1px`,padding:`0 1px`,cursor:`pointer`},".cm-foldGutter span":{padding:`0 1px`,cursor:`pointer`}}),f3=class e{constructor(e,t){this.specs=e;let n;function r(e){let t=OY.newName();return(n||=Object.create(null))[`.`+t]=e,t}let i=typeof t.all==`string`?t.all:t.all?r(t.all):void 0,a=t.scope;this.scope=a instanceof i4?e=>e.prop(t4)==a.data:a?e=>e==a:void 0,this.style=iq(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new OY(n):null,this.themeType=t.themeType}static define(t,n){return new e(t,n||{})}},p3=X.define(),m3=X.define({combine(e){return e.length?[e[0]]:null}});function h3(e){let t=e.facet(p3);return t.length?t:e.facet(m3)}function g3(e,t){let n=[v3],r;return e instanceof f3&&(e.module&&n.push($.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(m3.of(e)):r?n.push(p3.computeN([$.darkTheme],t=>t.facet($.darkTheme)==(r==`dark`)?[e]:[])):n.push(p3.of(e)),n}var _3=class{constructor(e){this.markCache=Object.create(null),this.tree=s4(e.state),this.decorations=this.buildDeco(e,h3(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=s4(e.state),n=h3(e.state),r=n!=h3(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&a>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return Q.none;let n=new dY;for(let{from:r,to:i}of e.visibleRanges)oq(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=Q.mark({class:r})))},r,i);return n.finish()}},v3=SJ.high(OZ.fromClass(_3,{decorations:e=>e.decorations})),y3=f3.define([{tag:J.meta,color:`#404740`},{tag:J.link,textDecoration:`underline`},{tag:J.heading,textDecoration:`underline`,fontWeight:`bold`},{tag:J.emphasis,fontStyle:`italic`},{tag:J.strong,fontWeight:`bold`},{tag:J.strikethrough,textDecoration:`line-through`},{tag:J.keyword,color:`#708`},{tag:[J.atom,J.bool,J.url,J.contentSeparator,J.labelName],color:`#219`},{tag:[J.literal,J.inserted],color:`#164`},{tag:[J.string,J.deleted],color:`#a11`},{tag:[J.regexp,J.escape,J.special(J.string)],color:`#e40`},{tag:J.definition(J.variableName),color:`#00f`},{tag:J.local(J.variableName),color:`#30a`},{tag:[J.typeName,J.namespace],color:`#085`},{tag:J.className,color:`#167`},{tag:[J.special(J.variableName),J.macroName],color:`#256`},{tag:J.definition(J.propertyName),color:`#00c`},{tag:J.comment,color:`#940`},{tag:J.invalid,color:`#f00`}]),b3=$.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:`#328c8252`},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bb555544`}}),x3=1e4,S3=`()[]{}`,C3=X.define({combine(e){return nY(e,{afterCursor:!0,brackets:S3,maxScanDistance:x3,renderMatch:E3})}}),w3=Q.mark({class:`cm-matchingBracket`}),T3=Q.mark({class:`cm-nonmatchingBracket`});function E3(e){let t=[],n=e.matched?w3:T3;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function D3(e){let t=[],n=e.facet(C3);for(let r of e.selection.ranges){if(!r.empty)continue;let i=N3(e,r.head,-1,n)||r.head>0&&N3(e,r.head-1,1,n)||n.afterCursor&&(N3(e,r.head,1,n)||r.head<e.doc.length&&N3(e,r.head+1,-1,n));i&&(t=t.concat(n.renderMatch(i,e)))}return Q.set(t,!0)}var O3=[OZ.fromClass(class{constructor(e){this.paused=!1,this.decorations=D3(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=D3(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),b3];function k3(e={}){return[C3.of(e),O3]}var A3=new qG;function j3(e,t,n){let r=e.prop(t<0?qG.openedBy:qG.closedBy);if(r)return r;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==+(t<0))return[n[r+t]]}return null}function M3(e){let t=e.type.prop(A3);return t?t(e.node):e}function N3(e,t,n,r={}){let i=r.maxScanDistance||x3,a=r.brackets||S3,o=s4(e),s=o.resolveInner(t,n);for(let r=s;r;r=r.parent){let i=j3(r.type,n,a);if(i&&r.from<r.to){let o=M3(r);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return P3(e,t,n,r,o,i,a)}}return F3(e,t,n,o,s.type,i,a)}function P3(e,t,n,r,i,a,o){let s=r.parent,c={from:i.from,to:i.to},l=0,u=s?.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(l==0&&a.indexOf(u.type.name)>-1&&u.from<u.to){let e=M3(u);return{start:c,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if(j3(u.type,n,o))l++;else if(j3(u.type,-n,o)){if(l==0){let e=M3(u);return{start:c,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}l--}}while(n<0?u.prevSibling():u.nextSibling());return{start:c,matched:!1}}function F3(e,t,n,r,i,a,o){if(n<0?!t:t==e.doc.length)return null;let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),c=o.indexOf(s);if(c<0||c%2==0!=n>0)return null;let l={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!u.next().done&&e<=a;){let a=u.value;n<0&&(e+=a.length);let s=t+e*n;for(let e=n>0?0:a.length-1,t=n>0?a.length:-1;e!=t;e+=n){let t=o.indexOf(a[e]);if(!(t<0||r.resolveInner(s+e,1).type!=i)){if(t%2==0==n>0)d++;else if(d==1)return{start:l,end:{from:s+e,to:s+e+1},matched:t>>1==c>>1};else d--}}n>0&&(e+=a.length)}return u.done?{start:l,matched:!1}:null}var I3=Object.create(null),L3=[XG.none],R3=[],z3=Object.create(null),B3=Object.create(null);for(let[e,t]of[[`variable`,`variableName`],[`variable-2`,`variableName.special`],[`string-2`,`string.special`],[`def`,`variableName.definition`],[`tag`,`tagName`],[`attribute`,`attributeName`],[`type`,`typeName`],[`builtin`,`variableName.standard`],[`qualifier`,`modifier`],[`error`,`invalid`],[`header`,`heading`],[`property`,`propertyName`]])B3[e]=H3(I3,t);function V3(e,t){R3.indexOf(e)>-1||(R3.push(e),console.warn(t))}function H3(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||J[n];r?typeof r==`function`?t.length?t=t.map(r):V3(n,`Modifier ${n} used at start of tag`):t.length?V3(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:V3(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,`_`),i=r+` `+n.map(e=>e.id),a=z3[i];if(a)return a.id;let o=z3[i]=XG.define({id:L3.length,name:r,props:[tq({[r]:n})]});return L3.push(o),o.id}BX.RTL,BX.LTR;var U3=()=>e=>{try{JSON.parse(e.state.doc.toString())}catch(t){if(!(t instanceof SyntaxError))throw t;let n=W3(t,e.state.doc);return[{from:n,message:t.message,severity:`error`,to:n}]}return[]};function W3(e,t){let n;return(n=e.message.match(/at position (\d+)/))?Math.min(+n[1],t.length):(n=e.message.match(/at line (\d+) column (\d+)/))?Math.min(t.line(+n[1]).from+ +n[2]-1,t.length):0}var G3=o4.define({name:`json`,parser:wq.configure({props:[w4.add({Object:P4({except:/^\s*\}/}),Array:P4({except:/^\s*\]/})}),R4.add({"Object Array":z4})]}),languageData:{closeBrackets:{brackets:[`[`,`{`,`"`]},indentOnInput:/^\s*[\}\]]$/}});function K3(){return new _4(G3)}var q3=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},J3=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(d6).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new dY,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=C6(s);if(i)o.add(n,n,Q.widget({widget:new g6(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,Q.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,Y3(f))}};function Y3(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0)){if(!r)r=new q3(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new q3(r.from,n,r.diagnostic)}}),r}function X3(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(d6).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is($3))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function Z3(e,t){return e.field(n6,!1)?t:t.concat(BJ.appendConfig.of(T6))}function Q3(e,t){return{effects:Z3(e,[$3.of(t)])}}var $3=BJ.define(),e6=BJ.define(),t6=BJ.define(),n6=yJ.define({create(){return new J3(Q.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=Y3(n,e.selected.diagnostic,i)||Y3(n,null,i)}!n.size&&i&&t.state.facet(d6).autoPanel&&(i=null),e=new J3(n,i,r)}for(let n of t.effects)if(n.is($3)){let r=t.state.facet(d6).autoPanel?n.value.length?v6.open:null:e.panel;e=J3.init(n.value,r,t.state)}else n.is(e6)?e=new J3(e.diagnostics,n.value?v6.open:null,e.selected):n.is(t6)&&(e=new J3(e.diagnostics,e.panel,n.value));return e},provide:e=>[S2.from(e,e=>e.panel),$.decorations.from(e,e=>e.diagnostics)]}),r6=Q.mark({class:`cm-lintRange cm-lintRange-active`});function i6(e,t,n){let{diagnostics:r}=e.state.field(n6),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(d6).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:!0,create(){return{dom:a6(e,i)}}}:null}function a6(e,t){return RY(`ul`,{class:`cm-tooltip-lint`},t.map(t=>h6(e,t,!1)))}var o6=e=>{let t=e.state.field(n6,!1);(!t||!t.panel)&&e.dispatch({effects:Z3(e.state,[e6.of(!0)])});let n=v2(e,v6.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},s6=e=>{let t=e.state.field(n6,!1);return!t||!t.panel?!1:(e.dispatch({effects:e6.of(!1)}),!0)},c6=[{key:`Mod-Shift-m`,run:o6,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(n6,!1);if(!t)return!1;let n=e.state.selection.main,r=Y3(t.diagnostics,null,n.to+1);return!r&&(r=Y3(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),m2(e,r.from,1,{tooltip:w6,until:e=>e.docChanged||e.newSelection.main.head<r.from||e.newSelection.main.head>r.to}),!0)}}],l6=OZ.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(d6);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(d6);t.length&&u6(t.map(e=>Promise.resolve(e(this.view))),t=>{this.view.state.doc==e.doc&&this.view.dispatch(Q3(this.view.state,t.reduce((e,t)=>e.concat(t))))},e=>{wZ(this.view.state,e)})}}update(e){let t=e.state.facet(d6);(e.docChanged||t!=e.startState.facet(d6)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}});function u6(e,t,n){let r=[],i=-1;for(let a of e)a.then(n=>{r.push(n),clearTimeout(i),r.length==e.length?t(r):i=setTimeout(()=>t(r),200)},n)}var d6=X.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...nY(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:f6,tooltipFilter:f6,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function f6(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function p6(e,t={}){return[d6.of({source:e,config:t}),l6,T6]}function m6(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function h6(e,t,n){let r=n?m6(t.actions):[];return RY(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},RY(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=Y3(e.state.field(n6).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),RY(`u`,s.slice(c,c+1)),s.slice(c+1)];return RY(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&RY(`div`,{class:`cm-diagnosticSource`},t.source))}var g6=class extends rX{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return RY(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},_6=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=h6(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},v6=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)s6(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=m6(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=Y3(this.view.state.field(n6).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=RY(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=RY(`div`,{class:`cm-panel-lint`},this.list,RY(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>s6(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(n6).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(n6),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new _6(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new _6(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=Y3(this.view.state.field(n6).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:t6.of(t)})}static open(t){return new e(t)}};function y6(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function b6(e){return y6(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var x6=$.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:b6(`#f11`)},".cm-lintRange-warning":{backgroundImage:b6(`orange`)},".cm-lintRange-info":{backgroundImage:b6(`#999`)},".cm-lintRange-hint":{backgroundImage:b6(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function S6(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function C6(e){let t=`hint`,n=1;for(let r of e){let e=S6(r.severity);e>n&&(n=e,t=r.severity)}return t}var w6=p2(i6,{hideOn:X3}),T6=[n6,$.decorations.compute([n6],e=>{let{selected:t,panel:n}=e.field(n6);return!t||!n||t.from==t.to?Q.none:Q.set([r6.range(t.from,t.to)])}),w6,x6];function E6(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var D6=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=M6(e.state,n.from);return r.line?k6(e):r.block?j6(e):!1};function O6(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var k6=O6(L6,0),A6=O6(I6,0),j6=O6((e,t)=>I6(e,t,F6(t)),0);function M6(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var N6=50;function P6(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-N6,r),o=e.sliceDoc(i,i+N6),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=100?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+N6),d=e.sliceDoc(i-N6,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function F6(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function I6(e,t,n=t.selection.ranges){let r=n.map(e=>M6(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>P6(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function L6(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=M6(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var R6=LJ.define(),z6=LJ.define(),B6=X.define(),V6=X.define({combine(e){return nY(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),H6=yJ.define({create(){return s8.empty},update(e,t){let n=t.state.facet(V6),r=t.annotation(R6);if(r){let i=Y6.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?X6(o,o.length,n.minDepth,i):n8(o,t.startState.selection),new s8(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(z6);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(VJ.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=Y6.fromTransaction(t),o=t.annotation(VJ.time),s=t.annotation(VJ.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new s8(e.done.map(Y6.fromJSON),e.undone.map(Y6.fromJSON))}});function U6(e={}){return[H6,V6.of(e),$.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?G6:e.inputType==`historyRedo`?K6:null;return n?(e.preventDefault(),n(t)):!1}})]}function W6(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(H6,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var G6=W6(0,!1),K6=W6(1,!1),q6=W6(0,!0),J6=W6(1,!0),Y6=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&rJ.fromJSON(t.changes),[],t.mapped&&nJ.fromJSON(t.mapped),t.startSelection&&Y.fromJSON(t.startSelection),t.selectionsAfter.map(Y.fromJSON))}static fromTransaction(t,n){let r=e8;for(let e of t.startState.facet(B6)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,e8)}static selection(t){return new e(void 0,e8,void 0,void 0,t)}};function X6(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function Z6(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function Q6(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function $6(e,t){return e.length?t.length?e.concat(t):e:t}var e8=[],t8=200;function n8(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-t8));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),X6(e,e.length-1,1e9,n.setSelAfter(r)))}return[Y6.selection([t])]}function r8(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function i8(e,t){if(!e.length)return e;let n=e.length,r=e8;for(;n;){let i=a8(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[Y6.selection(r)]:e8}function a8(e,t,n){let r=$6(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):e8,n);if(!e.changes)return Y6.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new Y6(i,BJ.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var o8=/^(input\.type|delete)($|\.)/,s8=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||o8.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,Z6(s.changes,t.changes))||r==`input.type.compose`)?X6(o,o.length-1,i.minDepth,new Y6(t.changes.compose(s.changes),$6(BJ.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,e8)):X6(o,o.length,i.minDepth,t),new e(o,e8,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:e8;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Q6(a[a.length-1],t)?this:new e(n8(this.done,t),this.undone,n,r)}addMapping(t){return new e(i8(this.done,t),i8(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:R6.of({side:e,rest:r8(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?e8:r.slice(0,r.length-1);return i.mapped&&(n=i8(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:R6.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}return null}};s8.empty=new s8(e8,e8);var c8=[{key:`Mod-z`,run:G6,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:K6,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:K6,preventDefault:!0},{key:`Mod-u`,run:q6,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:J6,preventDefault:!0}];function l8(e,t){return Y.create(e.ranges.map(t),e.mainIndex)}function u8(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function d8({state:e,dispatch:t},n){let r=l8(e.selection,n);return!r.eq(e.selection,!0)&&(t(u8(e,r)),!0)}function f8(e,t){return Y.cursor(t?e.to:e.from)}function p8(e,t){return d8(e,n=>n.empty?e.moveByChar(n,t):f8(n,t))}function m8(e){return e.textDirectionAt(e.state.selection.main.head)==BX.LTR}var h8=e=>p8(e,!m8(e)),g8=e=>p8(e,m8(e));function _8(e,t){return d8(e,n=>n.empty?e.moveByGroup(n,t):f8(n,t))}var v8=e=>_8(e,!m8(e)),y8=e=>_8(e,m8(e));typeof Intl<`u`&&Intl.Segmenter;function b8(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function x8(e,t,n){let r=s4(e).resolveInner(t.head),i=n?qG.closedBy:qG.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;b8(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?N3(e,r.from,1):N3(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,Y.cursor(s,n?-1:1)}var S8=e=>d8(e,t=>x8(e.state,t,!m8(e))),C8=e=>d8(e,t=>x8(e.state,t,m8(e)));function w8(e,t){return d8(e,n=>{if(!n.empty)return f8(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var T8=e=>w8(e,!1),E8=e=>w8(e,!0);function D8(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet($.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function O8(e,t){let n=D8(e),{state:r}=e,i=l8(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):f8(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=$.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(u8(r,i),{effects:a}),!0}var k8=e=>O8(e,!1),A8=e=>O8(e,!0);function j8(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=Y.cursor(r.from+n))}return i}var M8=e=>d8(e,t=>j8(e,t,!0)),N8=e=>d8(e,t=>j8(e,t,!1)),P8=e=>d8(e,t=>j8(e,t,!m8(e))),F8=e=>d8(e,t=>j8(e,t,m8(e))),I8=e=>d8(e,t=>e.moveToLineBoundary(t,!1,!1)),L8=e=>d8(e,t=>e.moveToLineBoundary(t,!0,!1));function R8(e,t,n){let r=!1,i=l8(e.selection,t=>{let i=N3(e,t.head,-1)||N3(e,t.head,1)||t.head>0&&N3(e,t.head-1,1)||t.head<e.doc.length&&N3(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?Y.range(t.anchor,a):Y.cursor(a)});return r?(t(u8(e,i)),!0):!1}var z8=({state:e,dispatch:t})=>R8(e,t,!1);function B8(e,t,n){let r=l8(e.state.selection,e=>{e.undirectional&&e.head>=e.anchor!=t&&(e=Y.range(e.head,e.anchor));let r=n(e);return Y.range(e.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return!r.eq(e.state.selection)&&(e.dispatch(u8(e.state,r)),!0)}function V8(e,t){return B8(e,t,n=>e.moveByChar(n,t))}var H8=e=>V8(e,!m8(e)),U8=e=>V8(e,m8(e));function W8(e,t){return B8(e,t,n=>e.moveByGroup(n,t))}var G8=e=>W8(e,!m8(e)),K8=e=>W8(e,m8(e)),q8=e=>{let t=!m8(e);return B8(e,t,n=>x8(e.state,n,t))},J8=e=>{let t=m8(e);return B8(e,t,n=>x8(e.state,n,t))};function Y8(e,t){return B8(e,t,n=>e.moveVertically(n,t))}var X8=e=>Y8(e,!1),Z8=e=>Y8(e,!0);function Q8(e,t){return B8(e,t,n=>e.moveVertically(n,t,D8(e).height))}var $8=e=>Q8(e,!1),e5=e=>Q8(e,!0),t5=e=>B8(e,!0,t=>j8(e,t,!0)),n5=e=>B8(e,!1,t=>j8(e,t,!1)),r5=e=>{let t=!m8(e);return B8(e,t,n=>j8(e,n,t))},i5=e=>{let t=m8(e);return B8(e,t,n=>j8(e,n,t))},a5=e=>B8(e,!1,t=>Y.cursor(e.lineBlockAt(t.head).from)),o5=e=>B8(e,!0,t=>Y.cursor(e.lineBlockAt(t.head).to)),s5=({state:e,dispatch:t})=>(t(u8(e,{anchor:0})),!0),c5=({state:e,dispatch:t})=>(t(u8(e,{anchor:e.doc.length})),!0),l5=({state:e,dispatch:t})=>(t(u8(e,{anchor:e.selection.main.anchor,head:0})),!0),u5=({state:e,dispatch:t})=>(t(u8(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),d5=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),f5=({state:e,dispatch:t})=>{let n=T5(e).map(({from:t,to:n})=>Y.undirectionalRange(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:Y.create(n),userEvent:`select`})),!0},p5=({state:e,dispatch:t})=>{let n=l8(e.selection,t=>{let n=s4(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return Y.undirectionalRange(n.from,n.to)}return t});return!n.eq(e.selection)&&(t(u8(e,n)),!0)};function m5(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}if(r.head==n.head)break;n=r}}return i.length!=r.ranges.length&&(e.dispatch(u8(n,Y.create(i,i.length-1))),!0)}var h5=e=>m5(e,!1),g5=e=>m5(e,!0),_5=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=Y.create([n.main]):n.main.empty||(r=Y.create([Y.cursor(n.main.head)])),r?(t(u8(e,r)),!0):!1};function v5(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=y5(e,o,!1)):o>i&&(n=`delete.forward`,o=y5(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=y5(e,i,!1),a=y5(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:Y.cursor(i,i<r.head?-1:1)}});return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?$.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function y5(e,t,n){if(e instanceof $)for(let r of e.state.facet($.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var b5=(e,t,n)=>v5(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=SY(s,a.tabSize)%b4(a)||b4(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=Jq(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=Jq(o.text,c-o.from,!1,!1)+o.from);return c}),x5=e=>b5(e,!1,!0),S5=e=>b5(e,!0,!1),C5=(e,t)=>v5(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=Jq(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),w5=e=>C5(e,!1),$ne=e=>C5(e,!0),ere=e=>v5(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),tre=e=>v5(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),nre=e=>v5(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),rre=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:Lq.of([``,``])},range:Y.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},ire=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:Jq(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:Jq(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:Y.cursor(a)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function T5(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function E5(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of T5(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(Y.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(Y.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:Y.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var are=({state:e,dispatch:t})=>E5(e,t,!1),ore=({state:e,dispatch:t})=>E5(e,t,!0);function D5(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of T5(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var sre=({state:e,dispatch:t})=>D5(e,t,!1),cre=({state:e,dispatch:t})=>D5(e,t,!0),lre=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(T5(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=l8(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function ure(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=s4(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(qG.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var O5=k5(!1),dre=k5(!0);function k5(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&ure(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new C4(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=S4(s,r);for(c??=SY(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,x4(t,c)];return o&&l.push(x4(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:Lq.of(l)},range:Y.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function A5(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:Y.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var fre=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new C4(e,{overrideIndentation:e=>n[e]??-1}),i=A5(e,(t,i,a)=>{let o=S4(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=x4(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},j5=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(A5(e,(t,n)=>{n.push({from:t.from,insert:e.facet(y4)})}),{userEvent:`input.indent`})),!0),M5=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(A5(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=SY(r,e.tabSize),a=0,o=x4(e,Math.max(0,i-b4(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),pre=e=>(e.setTabFocusMode(),!0),mre=[{key:`Ctrl-b`,run:h8,shift:H8,preventDefault:!0},{key:`Ctrl-f`,run:g8,shift:U8},{key:`Ctrl-p`,run:T8,shift:X8},{key:`Ctrl-n`,run:E8,shift:Z8},{key:`Ctrl-a`,run:I8,shift:a5},{key:`Ctrl-e`,run:L8,shift:o5},{key:`Ctrl-d`,run:S5},{key:`Ctrl-h`,run:x5},{key:`Ctrl-k`,run:ere},{key:`Ctrl-Alt-h`,run:w5},{key:`Ctrl-o`,run:rre},{key:`Ctrl-t`,run:ire},{key:`Ctrl-v`,run:A8}],hre=[{key:`ArrowLeft`,run:h8,shift:H8,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:v8,shift:G8,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:P8,shift:r5,preventDefault:!0},{key:`ArrowRight`,run:g8,shift:U8,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:y8,shift:K8,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:F8,shift:i5,preventDefault:!0},{key:`ArrowUp`,run:T8,shift:X8,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:s5,shift:l5},{mac:`Ctrl-ArrowUp`,run:k8,shift:$8},{key:`ArrowDown`,run:E8,shift:Z8,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:c5,shift:u5},{mac:`Ctrl-ArrowDown`,run:A8,shift:e5},{key:`PageUp`,run:k8,shift:$8},{key:`PageDown`,run:A8,shift:e5},{key:`Home`,run:N8,shift:n5,preventDefault:!0},{key:`Mod-Home`,run:s5,shift:l5},{key:`End`,run:M8,shift:t5,preventDefault:!0},{key:`Mod-End`,run:c5,shift:u5},{key:`Enter`,run:O5,shift:O5},{key:`Mod-a`,run:d5},{key:`Backspace`,run:x5,shift:x5,preventDefault:!0},{key:`Delete`,run:S5,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:w5,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:$ne,preventDefault:!0},{mac:`Mod-Backspace`,run:tre,preventDefault:!0},{mac:`Mod-Delete`,run:nre,preventDefault:!0}].concat(mre.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),gre=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:S8,shift:q8},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:C8,shift:J8},{key:`Alt-ArrowUp`,run:are},{key:`Shift-Alt-ArrowUp`,run:sre},{key:`Alt-ArrowDown`,run:ore},{key:`Shift-Alt-ArrowDown`,run:cre},{key:`Mod-Alt-ArrowUp`,run:h5},{key:`Mod-Alt-ArrowDown`,run:g5},{key:`Escape`,run:_5},{key:`Mod-Enter`,run:dre},{key:`Alt-l`,mac:`Ctrl-l`,run:f5},{key:`Mod-i`,run:p5,preventDefault:!0},{key:`Mod-[`,run:M5},{key:`Mod-]`,run:j5},{key:`Mod-Alt-\\`,run:fre},{key:`Shift-Mod-k`,run:lre},{key:`Shift-Mod-\\`,run:z8},{key:`Mod-/`,run:D6},{key:`Alt-A`,mac:`Ctrl-A`,run:A6},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:pre}].concat(hre),_re={key:`Tab`,run:j5,shift:M5},N5=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,P5=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(N5(e)):N5,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Zq(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Qq(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=$q(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n,a=!0;;e++){let n=r.charCodeAt(e),o=this.match(n,i,a,this.bufferPos+this.bufferStart,e==r.length-1);if(o)return this.value=o,this;if(e==r.length-1)break;a&&e<t.length&&t.charCodeAt(e)==n?i++:a=!1}}}match(e,t,n,r,i){let a=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],o=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?a={from:n.from,to:r,precise:i&&n.precise}:(n.index++,o=!0)),o?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?a={from:t,to:r,precise:n&&i}:this.matches.push({from:t,index:1,precise:n})),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}};typeof Symbol<`u`&&(P5.prototype[Symbol.iterator]=function(){return this});var F5={from:-1,to:-1,match:/.*/.exec(``),precise:!0},I5=`gm`+(/x/.unicode==null?``:`u`),L5=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=F5,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new B5(e,t,n,r,i);this.re=new RegExp(t,I5+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter();let a=e.lineAt(r);this.curLineStart=a.from,this.matchPos=V5(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=V5(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},R5=new WeakMap,z5=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=R5.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return R5.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),R5.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},B5=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=F5,this.matchPos=V5(e,r),this.re=new RegExp(t,I5+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=z5.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=V5(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=z5.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(L5.prototype[Symbol.iterator]=B5.prototype[Symbol.iterator]=function(){return this});function vre(e){try{return new RegExp(e,I5),!0}catch{return!1}}function V5(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var yre=e=>{let t=w2(e,`cm-goto-line`);if(t){let e=t.dom.querySelector(`input[type=text]`);return e&&e.select(),!0}let{state:n}=e,r=String(n.doc.lineAt(e.state.selection.main.head).number),{close:i,result:a}=C2(e,{class:`cm-goto-line`,label:n.phrase(`Go to line`),input:{type:`text`,name:`line`,value:r},focus:!0,submitLabel:n.phrase(`go`)});return a.then(t=>{let r=t&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.elements.line.value);if(!r){e.dispatch({effects:i});return}let a=n.doc.lineAt(n.selection.main.head),[,o,s,c,l]=r,u=c?+c.slice(1):0,d=s?+s:a.number;if(s&&l){let e=d/100;o&&(e=e*(o==`-`?-1:1)+a.number/n.doc.lines),d=Math.round(n.doc.lines*e)}else s&&o&&(d=d*(o==`-`?-1:1)+a.number);let f=n.doc.line(Math.max(1,Math.min(n.doc.lines,d))),p=Y.cursor(f.from+Math.max(0,Math.min(u,f.length)));e.dispatch({effects:[i,$.scrollIntoView(p.from,{y:`center`})],selection:p})}),!0},bre={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},H5=X.define({combine(e){return nY(e,bre,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function xre(e){let t=[Ere,Tre];return e&&t.push(H5.of(e)),t}var Sre=Q.mark({class:`cm-selectionMatch`}),Cre=Q.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function U5(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=XJ.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=XJ.Word)}function wre(e,t,n,r){return e(t.sliceDoc(n,n+1))==XJ.Word&&e(t.sliceDoc(r-1,r))==XJ.Word}var Tre=OZ.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(H5),{state:n}=e,r=n.selection;if(r.ranges.length>1)return Q.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return Q.none;let e=n.wordAt(i.head);if(!e)return Q.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return Q.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(U5(o,n,i.from,i.to)&&wre(o,n,i.from,i.to)))return Q.none}else if(a=n.sliceDoc(i.from,i.to),!a)return Q.none}let s=[];for(let r of e.visibleRanges){let e=new P5(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||U5(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(Cre.range(r,a)):(r>=i.to||a<=i.from)&&s.push(Sre.range(r,a)),s.length>t.maxMatches))return Q.none}}return Q.set(s)}},{decorations:e=>e.decorations}),Ere=$.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),Dre=({state:e,dispatch:t})=>{let{selection:n}=e,r=Y.create(n.ranges.map(t=>e.wordAt(t.head)||Y.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)};function Ore(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new P5(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new P5(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var kre=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return Dre({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=Ore(e,r);return i?(t(e.update({selection:e.selection.addRange(Y.range(i.from,i.to),!1),effects:$.scrollIntoView(i.to)})),!0):!1},W5=X.define({combine(e){return nY(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Ure(e),scrollToMatch:e=>$.scrollIntoView(e)})}}),G5=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||vre(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
30
+ `:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Fre(this):new Mre(this)}getCursor(e,t=0,n){let r=e.doc?e:tY.create({doc:e});return n??=r.doc.length,this.regexp?J5(this,r,t,n):q5(this,r,t,n)}},K5=class{constructor(e){this.spec=e}};function Are(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function q5(e,t,n,r){let i;return e.wholeWord&&(i=jre(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=Are(e.test,t,i)),new P5(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function jre(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(Y5(i,n-a))!=XJ.Word||t(X5(i,n-a))!=XJ.Word)&&(t(X5(i,r-a))!=XJ.Word||t(Y5(i,r-a))!=XJ.Word))}var Mre=class extends K5{constructor(e){super(e)}nextMatch(e,t,n){let r=q5(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=q5(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=q5(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=q5(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=q5(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function Nre(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function J5(e,t,n,r){let i;return e.wholeWord&&(i=Pre(t.charCategorizer(t.selection.main.head))),e.test&&(i=Nre(e.test,t,i)),new L5(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function Y5(e,t){return e.slice(Jq(e,t,!1),t)}function X5(e,t){return e.slice(t,Jq(e,t))}function Pre(e){return(t,n,r)=>!r[0].length||(e(Y5(r.input,r.index))!=XJ.Word||e(X5(r.input,r.index))!=XJ.Word)&&(e(X5(r.input,r.index+r[0].length))!=XJ.Word||e(Y5(r.input,r.index+r[0].length))!=XJ.Word)}var Fre=class extends K5{nextMatch(e,t,n){let r=J5(this.spec,e,n,e.doc.length).next();return r.done&&(r=J5(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=J5(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=J5(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=J5(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},Z5=BJ.define(),Q5=BJ.define(),$5=yJ.define({create(e){return new e7(o7(e).create(),null)},update(e,t){for(let n of t.effects)n.is(Z5)?e=new e7(n.value.create(),e.panel):n.is(Q5)&&(e=new e7(e.query,n.value?a7:null));return e},provide:e=>S2.from(e,e=>e.panel)}),e7=class{constructor(e,t){this.query=e,this.panel=t}},Ire=Q.mark({class:`cm-searchMatch`}),Lre=Q.mark({class:`cm-searchMatch cm-searchMatch-selected`}),Rre=OZ.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field($5))}update(e){let t=e.state.field($5);(t!=e.startState.field($5)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Q.none;let{view:n}=this,r=new dY;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?Lre:Ire)})}return r.finish()}},{decorations:e=>e.decorations});function t7(e){return t=>{let n=t.state.field($5,!1);return n&&n.query.spec.valid?e(t,n):l7(t)}}var n7=t7((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=Y.single(r.from,r.to),a=e.state.facet(W5);return e.dispatch({selection:i,effects:[m7(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),c7(e),!0}),r7=t7((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=Y.single(i.from,i.to),o=e.state.facet(W5);return e.dispatch({selection:a,effects:[m7(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),c7(e),!0}),zre=t7((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:Y.create(n.map(e=>Y.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),Bre=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new P5(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(Y.range(t.value.from,t.value.to))}return t(e.update({selection:Y.create(a,o),userEvent:`select.search.matches`})),!0},i7=t7((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.precise?o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),u.push($.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`))):o=t.nextMatch(n,o.from,o.to);let d=e.state.changes(s);return o&&(c=Y.single(o.from,o.to).map(d),u.push(m7(e,o)),u.push(n.facet(W5).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effects:u,userEvent:`input.replace`}),!0}),Vre=t7((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:e,to:i,precise:a}=r;a&&n.push({from:e,to:i,insert:t.getReplacement(r)})}if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:$.announce.of(r),userEvent:`input.replace.all`}),!0});function a7(e){return e.state.facet(W5).createPanel(e)}function o7(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(W5);return new G5({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function s7(e){let t=v2(e,a7);return t&&t.dom.querySelector(`[main-field]`)}function c7(e){let t=s7(e);t&&t==e.root.activeElement&&t.select()}var l7=e=>{let t=e.state.field($5,!1);if(t&&t.panel){let n=s7(e);if(n&&n!=e.root.activeElement){let r=o7(e.state,t.query.spec);r.valid&&e.dispatch({effects:Z5.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[Q5.of(!0),t?Z5.of(o7(e.state,t.query.spec)):BJ.appendConfig.of(Gre)]});return!0},u7=e=>{let t=e.state.field($5,!1);if(!t||!t.panel)return!1;let n=v2(e,a7);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Q5.of(!1)}),!0},Hre=[{key:`Mod-f`,run:l7,scope:`editor search-panel`},{key:`F3`,run:n7,shift:r7,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:n7,shift:r7,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:u7,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:Bre},{key:`Mod-Alt-g`,run:yre},{key:`Mod-d`,run:kre,preventDefault:!0}],Ure=class{constructor(e){this.view=e;let t=this.query=e.state.field($5).query.spec;this.commit=this.commit.bind(this),this.searchField=RY(`input`,{value:t.search,placeholder:d7(e,`Find`),"aria-label":d7(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=RY(`input`,{value:t.replace,placeholder:d7(e,`Replace`),"aria-label":d7(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=RY(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=RY(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=RY(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return RY(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=RY(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>n7(e),[d7(e,`next`)]),n(`prev`,()=>r7(e),[d7(e,`previous`)]),n(`select`,()=>zre(e),[d7(e,`all`)]),RY(`label`,null,[this.caseField,d7(e,`match case`)]),RY(`label`,null,[this.reField,d7(e,`regexp`)]),RY(`label`,null,[this.wordField,d7(e,`by word`)]),...e.state.readOnly?[]:[RY(`br`),this.replaceField,n(`replace`,()=>i7(e),[d7(e,`replace`)]),n(`replaceAll`,()=>Vre(e),[d7(e,`replace all`)])],RY(`button`,{name:`close`,onclick:()=>u7(e),"aria-label":d7(e,`close`),type:`button`},[`×`])])}commit(){let e=new G5({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Z5.of(e)}))}keydown(e){J1(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?r7:n7)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),i7(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(Z5)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(W5).top}};function d7(e,t){return e.state.phrase(t)}var f7=30,p7=/[\s\.,:;?!]/;function m7(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-f7),o=Math.min(i,n+f7),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<f7;e++)if(!p7.test(s[e+1])&&p7.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-f7;e--)if(!p7.test(s[e-1])&&p7.test(s[e])){s=s.slice(0,e);break}}return $.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var Wre=$.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),Gre=[$5,SJ.low(Rre),Wre],h7=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=s4(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(y7(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function g7(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function Kre(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=g7(t)+g7(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function qre(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:Kre(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}var _7=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function v7(e){return e.selection.main.from}function y7(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var b7=LJ.define();function Jre(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:Y.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}var x7=new WeakMap;function Yre(e){if(!Array.isArray(e))return e;let t=x7.get(e);return t||x7.set(e,t=qre(e)),t}var S7=BJ.define(),C7=BJ.define(),Xre=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=Zq(e,t),r=$q(n);this.chars.push(n);let i=e.slice(t,t+r),a=i.toUpperCase();this.folded.push(Zq(a==i?i.toLowerCase():a,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:a}=this;if(t.length==1){let r=Zq(e,0),i=$q(r),a=i==e.length?0:-100;if(r!=t[0]){if(r==n[0])a+=-200;else return null}return this.ret(a,[0,i])}let o=e.indexOf(this.pattern);if(o==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=t.length,c=0;if(o<0){for(let i=0,a=Math.min(e.length,200);i<a&&c<s;){let a=Zq(e,i);(a==t[c]||a==n[c])&&(r[c++]=i),i+=$q(a)}if(c<s)return null}let l=0,u=0,d=!1,f=0,p=-1,m=-1,h=/[a-z]/.test(e),g=!0;for(let r=0,c=Math.min(e.length,200),_=0;r<c&&u<s;){let c=Zq(e,r);o<0&&(l<s&&c==t[l]&&(i[l++]=r),f<s&&(c==t[f]||c==n[f]?(f==0&&(p=r),m=r+1,f++):f=0));let v,y=c<255?c>=48&&c<=57||c>=97&&c<=122?2:+(c>=65&&c<=90):(v=Qq(c))==v.toLowerCase()?v==v.toUpperCase()?0:2:1;(!r||y==1&&h||_==0&&y!=0)&&(t[u]==c||n[u]==c&&(d=!0)?a[u++]=r:a.length&&(g=!1)),_=y,r+=$q(c)}return u==s&&a[0]==0&&g?this.result(-100+(d?-200:0),a,e):f==s&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):f==s?this.ret(-900-e.length,[p,m]):u==s?this.result(-100+(d?-200:0)+-700+(g?0:-1100),a,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?$q(Zq(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}},Zre=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},w7=X.define({combine(e){return nY(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Qre,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>T7(e(n),t(n)),optionClass:(e,t)=>n=>T7(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function T7(e,t){return e?t?e+` `+t:e:t}function Qre(e,t,n,r,i,a){let o=e.textDirection==BX.RTL,s=o,c=!1,l=`top`,u,d,f=t.left-i.left,p=i.right-t.right,m=r.right-r.left,h=r.bottom-r.top;if(s&&f<Math.min(m,p)?s=!1:!s&&p<Math.min(m,f)&&(s=!0),m<=(s?f:p))u=Math.max(i.top,Math.min(n.top,i.bottom-h))-t.top,d=Math.min(400,s?f:p);else{c=!0,d=Math.min(400,(o?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=h||e>t.top?u=n.bottom-t.top:(l=`bottom`,u=t.bottom-n.top)}let g=(t.bottom-t.top)/a.offsetHeight,_=(t.right-t.left)/a.offsetWidth;return{style:`${l}: ${u/g}px; max-width: ${d/_}px`,class:`cm-completionInfo-`+(c?o?`left-narrow`:`right-narrow`:s?`left`:`right`)}}var E7=BJ.define();function $re(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement(`div`);return t.classList.add(`cm-completionIcon`),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>`cm-completionIcon-`+e)),t.setAttribute(`aria-hidden`,`true`),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function D7(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.ceil((e-t)/n);return{from:e-r*n,to:e-(r-1)*n}}var eie=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass=``;let r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(w7);this.optionContent=$re(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=D7(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains(`cm-completionListIncompleteTop`)&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(`cm-completionListIncompleteBottom`)&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;t!=null&&(e.dispatch({effects:E7.of(t)}),n.preventDefault())}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(w7).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:C7.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(`scroll`,()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=D7(r.length,i,e.state.facet(w7).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(` `))e&&this.dom.classList.remove(e);for(let e of t.split(` `))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=D7(t.options.length,t.selected,this.view.state.facet(w7).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let a=typeof i==`string`?document.createTextNode(i):i(r);if(!a)return;`then`in a?a.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>wZ(this.view.state,e,`completion info`)):(this.addInfoPane(a,r),n.setAttribute(`aria-describedby`,this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,n.id=`cm-completionInfo-`+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&(n.removeAttribute(`aria-selected`),n.removeAttribute(`aria-describedby`));return t&&nie(this.list,t),t}measureInfo(){let e=this.dom.querySelector(`[aria-selected]`);if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(w7).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=`cm-tooltip cm-completionInfo `+(e.class||``)):this.info.style.cssText=`top: -1e6px`)}createListBox(e,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0)){if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}};function tie(e,t){return n=>new eie(n,e,t)}function nie(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function O7(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+ +!!e.type}function rie(e,t){let n=[],r=null,i=null,a=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},o=t.facet(w7);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)a(new _7(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,c=o.filterStrict?new Zre(n):new Xre(n);for(let t of r.result.options)if(s=c.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,o=s.score+(t.boost||0);if(a(new _7(t,r.source,n,o)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(o,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,a=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(a))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let s=[],c=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!c||c.label!=t.label||c.detail!=t.detail||c.type!=null&&t.type!=null&&c.type!=t.type||c.apply!=t.apply||c.boost!=t.boost?s.push(e):O7(e.completion)>O7(c)&&(s[s.length-1]=e),c=e.completion}return s}var iie=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,k7(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=rie(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(w7).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,k7(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:die,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},aie=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(lie,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(w7),i=(r.override||n.languageDataAt(`autocomplete`,v7(n)).map(Yre)).map(e=>(this.active.find(t=>t.source==e)||new j7(e,+!!this.active.some(e=>e.state!=0))).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(N7));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!oie(i,this.active)||o?a=iie.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new j7(e.source,0):e));for(let e of t.effects)e.is(E7)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?sie:cie}};function oie(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}var sie={"aria-autocomplete":`list`},cie={};function k7(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}var lie=[];function A7(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(b7);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}var j7=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=A7(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is(S7))i=new e(i.source,1,n.value);else if(n.is(C7))i=new e(i.source,0);else if(n.is(N7))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(v7(e.state))}},M7=class e extends j7{constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=v7(t.state);if(o>a||!r||n&2&&(v7(t.startState)==this.from||o<this.limit))return new j7(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return uie(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new h7(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??v7(t.state)):new j7(this.source,1,this.explicit)}map(t){if(t.empty)return this;let n=this.result.map?this.result.map(this.result,t):this.result;return n?new e(this.source,this.explicit,t.mapPos(this.limit),n,t.mapPos(this.from),t.mapPos(this.to,1)):new j7(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function uie(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):y7(e,!0).test(i)}var N7=BJ.define({map(e,t){return e.map(e=>e.map(t))}}),P7=yJ.define({create(){return aie.start()},update(e,t){return e.update(t)},provide:e=>[i2.from(e,e=>e.tooltip),$.contentAttributes.from(e,e=>e.attrs)]});function F7(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(P7).active.find(e=>e.source==t.source);return r instanceof M7&&(typeof n==`string`?e.dispatch({...Jre(e.state,n,r.from,r.to),annotations:b7.of(t.completion)}):n(e,t.completion,r.from,r.to),!0)}var die=tie(P7,F7);function I7(e,t=`option`){return n=>{let r=n.state.field(P7,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(w7).interactionDelay)return!1;let i=1,a;t==`page`&&(a=h2(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector(`li`).offsetHeight)-1));let{length:o}=r.open.options,s=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:o-1;return s<0?s=t==`page`?0:o-1:s>=o&&(s=t==`page`?o-1:0),n.dispatch({effects:E7.of(s)}),!0}}var fie=e=>{let t=e.state.field(P7,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(w7).interactionDelay?!1:F7(e,t.open.options[t.open.selected])},L7=e=>e.state.field(P7,!1)?(e.dispatch({effects:S7.of(!0)}),!0):!1,pie=e=>{let t=e.state.field(P7,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:C7.of(null)}),!0)},mie=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},hie=50,gie=1e3,_ie=OZ.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(P7).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(P7),n=e.state.facet(w7);if(!e.selectionSet&&!e.docChanged&&e.startState.field(P7)==t)return;let r=e.transactions.some(e=>{let t=A7(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>hie&&Date.now()-n.time>gie){for(let e of n.context.abortListeners)try{e()}catch(e){wZ(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(S7)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(P7);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(w7).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new h7(t,v7(t),e.explicit,this.view),r=new mie(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:C7.of(null)}),wZ(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(w7).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(w7),n=this.view.state.field(P7);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let n=v7(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+ +!i.active.explicit),a=new M7(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending){if(i.done==null){let n=new j7(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:N7.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field(P7,!1);if(t&&t.tooltip&&this.view.state.facet(w7).closeOnBlur){let n=t.open&&h2(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:C7.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:S7.of(!1)}),20),this.composing=0}}}),vie=typeof navigator==`object`&&/Win/.test(navigator.platform),yie=SJ.highest($.domEventHandlers({keydown(e,t){let n=t.state.field(P7,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(vie&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&F7(t,r),!1}})),bie=$.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`,cursor:`pointer`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),R7={brackets:[`(`,`[`,`{`,`'`,`"`],before:`)]}:;>`,stringPrefixes:[]},z7=BJ.define({map(e,t){return t.mapPos(e,-1,tJ.TrackAfter)??void 0}}),B7=new class extends rY{};B7.startSide=1,B7.endSide=-1;var V7=yJ.define({create(){return cY.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(z7)&&(e=e.update({add:[B7.range(n.value,n.value+1)]}));return e}});function xie(){return[Cie,V7]}var H7=`()[]{}<>«»»«[]{}`;function U7(e){for(let t=0;t<16;t+=2)if(H7.charCodeAt(t)==e)return H7.charAt(t+1);return Qq(e<128?e:e+1)}function W7(e,t){return e.languageDataAt(`closeBrackets`,t)[0]||R7}var Sie=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),Cie=$.inputHandler.of((e,t,n,r)=>{if((Sie?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&$q(Zq(r,0))==1||t!=i.from||n!=i.to)return!1;let a=Tie(e.state,r);return a?(e.dispatch(a),!0):!1}),wie=[{key:`Backspace`,run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=W7(e,e.selection.main.head).brackets||R7.brackets,r=null,i=e.changeByRange(t=>{if(t.empty){let r=Eie(e.doc,t.head);for(let i of n)if(i==r&&K7(e.doc,t.head)==U7(Zq(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:Y.cursor(t.head-i.length)}}return{range:r=t}});return r||t(e.update(i,{scrollIntoView:!0,userEvent:`delete.backward`})),!r}}];function Tie(e,t){let n=W7(e,e.selection.main.head),r=n.brackets||R7.brackets;for(let i of r){let a=U7(Zq(i,0));if(t==i)return a==i?kie(e,i,r.indexOf(i+i+i)>-1,n):Die(e,i,a,n.before||R7.before);if(t==a&&G7(e,e.selection.main.from))return Oie(e,i,a)}return null}function G7(e,t){let n=!1;return e.field(V7).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function K7(e,t){let n=e.sliceString(t,t+2);return n.slice(0,$q(Zq(n,0)))}function Eie(e,t){let n=e.sliceString(t-2,t);return $q(Zq(n,0))==n.length?n:n.slice(1)}function Die(e,t,n,r){let i=null,a=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:z7.of(a.to+t.length),range:Y.range(a.anchor+t.length,a.head+t.length)};let o=K7(e.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:t+n,from:a.head},effects:z7.of(a.head+t.length),range:Y.cursor(a.head+t.length)}:{range:i=a}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:`input.type`})}function Oie(e,t,n){let r=null,i=e.changeByRange(t=>t.empty&&K7(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:Y.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(i,{scrollIntoView:!0,userEvent:`input.type`})}function kie(e,t,n,r){let i=r.stringPrefixes||R7.stringPrefixes,a=null,o=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:z7.of(r.to+t.length),range:Y.range(r.anchor+t.length,r.head+t.length)};let o=r.head,s=K7(e.doc,o),c;if(s==t){if(q7(e,o))return{changes:{insert:t+t,from:o},effects:z7.of(o+t.length),range:Y.cursor(o+t.length)};if(G7(e,o)){let r=n&&e.sliceDoc(o,o+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:o,to:o+r.length,insert:r},range:Y.cursor(o+r.length)}}}else if(n&&e.sliceDoc(o-2*t.length,o)==t+t&&(c=J7(e,o-2*t.length,i))>-1&&q7(e,c))return{changes:{insert:t+t+t+t,from:o},effects:z7.of(o+t.length),range:Y.cursor(o+t.length)};else if(e.charCategorizer(o)(s)!=XJ.Word&&J7(e,o,i)>-1&&!Aie(e,o,t,i))return{changes:{insert:t+t,from:o},effects:z7.of(o+t.length),range:Y.cursor(o+t.length)};return{range:a=r}});return a?null:e.update(o,{scrollIntoView:!0,userEvent:`input.type`})}function q7(e,t){let n=s4(e).resolveInner(t+1);return n.parent&&n.from==t}function Aie(e,t,n,r){let i=s4(e).resolveInner(t,-1),a=r.reduce((e,t)=>Math.max(e,t.length),0);for(let o=0;o<5;o++){let o=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+a)),s=o.indexOf(n);if(!s||s>-1&&r.indexOf(o.slice(0,s))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+s;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let c=i.to==t&&i.parent;if(!c)break;i=c}return!1}function J7(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=XJ.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=XJ.Word)return n}return-1}function jie(e={}){return[yie,P7,w7.of(e),_ie,Mie,bie]}var Y7=[{key:`Ctrl-Space`,run:L7},{mac:"Alt-`",run:L7},{mac:`Alt-i`,run:L7},{key:`Escape`,run:pie},{key:`ArrowDown`,run:I7(!0)},{key:`ArrowUp`,run:I7(!1)},{key:`PageDown`,run:I7(!0,`page`)},{key:`PageUp`,run:I7(!1,`page`)},{key:`Enter`,run:fie}],Mie=SJ.highest(G1.computeN([w7],e=>e.facet(w7).defaultKeymap?[Y7]:[])),X7=function(e){e===void 0&&(e={});var t=e.crosshairCursor,n=t!==void 0&&t,r=[];e.closeBracketsKeymap!==!1&&(r=r.concat(wie)),e.defaultKeymap!==!1&&(r=r.concat(gre)),e.searchKeymap!==!1&&(r=r.concat(Hre)),e.historyKeymap!==!1&&(r=r.concat(c8)),e.foldKeymap!==!1&&(r=r.concat(t3)),e.completionKeymap!==!1&&(r=r.concat(Y7)),e.lintKeymap!==!1&&(r=r.concat(c6));var i=[];return e.lineNumbers!==!1&&i.push(X2()),e.highlightActiveLineGutter!==!1&&i.push(e4()),e.highlightSpecialChars!==!1&&i.push(k0()),e.history!==!1&&i.push(U6()),e.foldGutter!==!1&&i.push(u3()),e.drawSelection!==!1&&i.push(l0()),e.dropCursor!==!1&&i.push(y0()),e.allowMultipleSelections!==!1&&i.push(tY.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&i.push(I4()),e.syntaxHighlighting!==!1&&i.push(g3(y3,{fallback:!0})),e.bracketMatching!==!1&&i.push(k3()),e.closeBrackets!==!1&&i.push(xie()),e.autocompletion!==!1&&i.push(jie()),e.rectangularSelection!==!1&&i.push(K0()),n!==!1&&i.push(Y0()),e.highlightActiveLine!==!1&&i.push(I0()),e.highlightSelectionMatches!==!1&&i.push(xre()),e.tabSize&&typeof e.tabSize==`number`&&i.push(y4.of(` `.repeat(e.tabSize))),i.concat([G1.of(r.flat())]).filter(Boolean)},Nie=`#e5c07b`,Z7=`#e06c75`,Pie=`#56b6c2`,Fie=`#ffffff`,Q7=`#abb2bf`,$7=`#7d8799`,Iie=`#61afef`,Lie=`#98c379`,e9=`#d19a66`,Rie=`#c678dd`,zie=`#21252b`,t9=`#2c313a`,n9=`#282c34`,r9=`#353a42`,Bie=`#3E4451`,i9=`#528bff`,Vie=[$.theme({"&":{color:Q7,backgroundColor:n9},".cm-content":{caretColor:i9},".cm-cursor, .cm-dropCursor":{borderLeftColor:i9},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Bie},".cm-panels":{backgroundColor:zie,color:Q7},".cm-panels.cm-panels-top":{borderBottom:`2px solid black`},".cm-panels.cm-panels-bottom":{borderTop:`2px solid black`},".cm-searchMatch":{backgroundColor:`#72a1ff59`,outline:`1px solid #457dff`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#6199ff2f`},".cm-activeLine":{backgroundColor:`#6699ff0b`},".cm-selectionMatch":{backgroundColor:`#aafe661a`},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bad0f847`},".cm-gutters":{backgroundColor:n9,color:$7,border:`none`},".cm-activeLineGutter":{backgroundColor:t9},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:r9},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:r9,borderBottomColor:r9},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:t9,color:Q7}}},{dark:!0}),g3(f3.define([{tag:J.keyword,color:Rie},{tag:[J.name,J.deleted,J.character,J.propertyName,J.macroName],color:Z7},{tag:[J.function(J.variableName),J.labelName],color:Iie},{tag:[J.color,J.constant(J.name),J.standard(J.name)],color:e9},{tag:[J.definition(J.name),J.separator],color:Q7},{tag:[J.typeName,J.className,J.number,J.changed,J.annotation,J.modifier,J.self,J.namespace],color:Nie},{tag:[J.operator,J.operatorKeyword,J.url,J.escape,J.regexp,J.link,J.special(J.string)],color:Pie},{tag:[J.meta,J.comment],color:$7},{tag:J.strong,fontWeight:`bold`},{tag:J.emphasis,fontStyle:`italic`},{tag:J.strikethrough,textDecoration:`line-through`},{tag:J.link,color:$7,textDecoration:`underline`},{tag:J.heading,fontWeight:`bold`,color:Z7},{tag:[J.atom,J.bool,J.special(J.variableName)],color:e9},{tag:[J.processingInstruction,J.string,J.inserted],color:Lie},{tag:J.invalid,color:Fie}]))],Hie=$.theme({"&":{backgroundColor:`#fff`}},{dark:!1}),Uie=function(e){e===void 0&&(e={});var t=e,n=t.indentWithTab,r=n===void 0||n,i=t.editable,a=i===void 0||i,o=t.readOnly,s=o!==void 0&&o,c=t.theme,l=c===void 0?`light`:c,u=t.placeholder,d=u===void 0?``:u,f=t.basicSetup,p=f===void 0||f,m=[];switch(r&&m.unshift(G1.of([_re])),p&&(typeof p==`boolean`?m.unshift(X7()):m.unshift(X7(p))),d&&m.unshift(B0(d)),l){case`light`:m.push(Hie);break;case`dark`:m.push(Vie);break;case`none`:break;default:m.push(l)}return a===!1&&m.push($.editable.of(!1)),s&&m.push(tY.readOnly.of(!0)),[...m]},Wie=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)}),Gie=class{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(e=>{try{e()}catch(e){console.error(`TimeoutLatch callback error:`,e)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}},a9=class{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}},o9=null,Kie=()=>typeof window>`u`?new a9:(o9||=new a9,o9),qie=$.theme({"& .cm-scroller":{height:`100% !important`}}),s9=null,c9=null;function Jie(e,t,n,r,i,a){if(!e&&!t&&!n&&!r&&!i&&!a)return null;var o=JSON.stringify({height:e,minHeight:t,maxHeight:n,width:r,minWidth:i,maxWidth:a});return o===s9?c9:(s9=o,c9=$.theme({"&":{height:e,minHeight:t,maxHeight:n,width:r,minWidth:i,maxWidth:a}}),c9)}var l9=LJ.define(),Yie=200,Xie=[];function Zie(e){var t=e.value,n=e.selection,r=e.onChange,i=e.onStatistics,a=e.onCreateEditor,o=e.onUpdate,s=e.extensions,c=s===void 0?Xie:s,l=e.autoFocus,u=e.theme,d=u===void 0?`light`:u,f=e.height,p=f===void 0?null:f,m=e.minHeight,h=m===void 0?null:m,g=e.maxHeight,_=g===void 0?null:g,v=e.width,y=v===void 0?null:v,b=e.minWidth,x=b===void 0?null:b,S=e.maxWidth,C=S===void 0?null:S,w=e.placeholder,T=w===void 0?``:w,E=e.editable,D=E===void 0||E,ee=e.readOnly,O=ee!==void 0&&ee,k=e.indentWithTab,te=k===void 0||k,ne=e.basicSetup,re=ne===void 0||ne,ie=e.root,A=e.initialState,ae=(0,P.useState)(),oe=ae[0],se=ae[1],ce=(0,P.useState)(),j=ce[0],le=ce[1],ue=(0,P.useState)(),de=ue[0],fe=ue[1],pe=(0,P.useState)(()=>({current:null}))[0],me=(0,P.useState)(()=>({current:null}))[0],he=Jie(p,h,_,y,x,C),ge=$.updateListener.of(e=>{e.docChanged&&typeof r==`function`&&!e.transactions.some(e=>e.annotation(l9))&&(pe.current?pe.current.reset():(pe.current=new Gie(()=>{if(me.current){var e=me.current;me.current=null,e()}pe.current=null},Yie),Kie().add(pe.current)),r(e.state.doc.toString(),e)),i&&i(Wie(e))}),_e=Uie({theme:d,editable:D,readOnly:O,placeholder:T,indentWithTab:te,basicSetup:re}),ve=[ge,...he?[he]:[],qie,..._e];return o&&typeof o==`function`&&ve.push($.updateListener.of(o)),ve=ve.concat(c),(0,P.useLayoutEffect)(()=>{if(oe&&!de){var e={doc:t,selection:n,extensions:ve},r=A?tY.fromJSON(A.json,e,A.fields):tY.create(e);if(fe(r),!j){var i=new $({state:r,parent:oe,root:ie});le(i),a&&a(i,r)}}return()=>{j&&(fe(void 0),le(void 0))}},[oe,de]),(0,P.useEffect)(()=>{e.container&&se(e.container)},[e.container]),(0,P.useEffect)(()=>()=>{j&&(j.destroy(),le(void 0)),pe.current&&=(pe.current.cancel(),null)},[j]),(0,P.useEffect)(()=>{l&&j&&j.focus()},[l,j]),(0,P.useEffect)(()=>{j&&j.dispatch({effects:BJ.reconfigure.of(ve)})},[d,c,p,h,_,y,x,C,T,D,O,te,re,r,o]),(0,P.useEffect)(()=>{if(t!==void 0){var e=j?j.state.doc.toString():``;if(j&&t!==e){var n=pe.current&&!pe.current.isDone,r=()=>{j&&t!==j.state.doc.toString()&&j.dispatch({changes:{from:0,to:j.state.doc.toString().length,insert:t||``},annotations:[l9.of(!0)]})};n?me.current=r:r()}}},[t,j]),{state:de,setState:fe,view:j,setView:le,container:oe,setContainer:se}}var Qie=[`className`,`value`,`selection`,`extensions`,`onChange`,`onStatistics`,`onCreateEditor`,`onUpdate`,`autoFocus`,`theme`,`height`,`minHeight`,`maxHeight`,`width`,`minWidth`,`maxWidth`,`basicSetup`,`placeholder`,`indentWithTab`,`editable`,`readOnly`,`root`,`initialState`],u9=(0,P.forwardRef)((e,t)=>{var n=e.className,r=e.value,i=r===void 0?``:r,a=e.selection,o=e.extensions,s=o===void 0?[]:o,c=e.onChange,l=e.onStatistics,u=e.onCreateEditor,d=e.onUpdate,f=e.autoFocus,p=e.theme,m=p===void 0?`light`:p,h=e.height,g=e.minHeight,_=e.maxHeight,v=e.width,y=e.minWidth,b=e.maxWidth,x=e.basicSetup,S=e.placeholder,C=e.indentWithTab,w=e.editable,T=e.readOnly,E=e.root,D=e.initialState,ee=E6(e,Qie),O=(0,P.useRef)(null),k=Zie({root:E,value:i,autoFocus:f,theme:m,height:h,minHeight:g,maxHeight:_,width:v,minWidth:y,maxWidth:b,basicSetup:x,placeholder:S,indentWithTab:C,editable:w,readOnly:T,selection:a,onChange:c,onStatistics:l,onCreateEditor:u,onUpdate:d,extensions:s,initialState:D}),te=k.state,ne=k.view,re=k.container,ie=k.setContainer;(0,P.useImperativeHandle)(t,()=>({editor:O.current,state:te,view:ne}),[O,re,te,ne]);var A=(0,P.useCallback)(e=>{O.current=e,ie(e)},[ie]);if(typeof i!=`string`)throw Error(`value must be typeof string but got `+typeof i);var ae=typeof m==`string`?`cm-theme-`+m:`cm-theme`;return(0,F.jsx)(`div`,rt({ref:A,className:``+ae+(n?` `+n:``)},ee))});u9.displayName=`CodeMirror`;function $ie(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t||!n;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}function p(e){r=e,i=``,a=0,o=16,d=0}function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&p9(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46){if(r++,r<e.length&&p9(e.charCodeAt(r)))for(r++;r<e.length&&p9(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r)}let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101)){if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&p9(e.charCodeAt(r))){for(r++;r<e.length&&p9(e.charCodeAt(r));)r++;n=r}else d=3}return e.substring(t,n)}function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
31
+ `;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=f(4,!0);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}i=r;continue}if(a>=0&&a<=31){if(f9(a)){t+=e.substring(i,r),d=2;break}d=6}r++}return t}function g(){if(i=``,d=0,a=r,c=s,u=l,r>=n)return a=n,o=17;let t=e.charCodeAt(r);if(d9(t)){do r++,i+=String.fromCharCode(t),t=e.charCodeAt(r);while(d9(t));return o=15}if(f9(t))return r++,i+=String.fromCharCode(t),t===13&&e.charCodeAt(r)===10&&(r++,i+=`
32
+ `),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!f9(e.charCodeAt(r));)r++;return i=e.substring(c,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;let t=n-1,a=!1;for(;r<t;){let t=e.charCodeAt(r);if(t===42&&e.charCodeAt(r+1)===47){r+=2,a=!0;break}r++,f9(t)&&(t===13&&e.charCodeAt(r)===10&&r++,s++,l=r)}return a||(r++,d=1),i=e.substring(c,r),o=13}return i+=String.fromCharCode(t),r++,o=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!p9(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;r<n&&_(t);)r++,t=e.charCodeAt(r);if(a!==r){switch(i=e.substring(a,r),i){case`true`:return o=8;case`false`:return o=9;case`null`:return o=7}return o=16}return i+=String.fromCharCode(t),r++,o=16}}function _(e){if(d9(e)||f9(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let e;do e=g();while(e>=12&&e<=15);return e}return{setPosition:p,getPosition:()=>r,scan:t?v:g,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>a,getTokenLength:()=>r-a,getTokenStartLine:()=>c,getTokenStartCharacter:()=>a-u,getTokenError:()=>d}}function d9(e){return e===32||e===9}function f9(e){return e===10||e===13}function p9(e){return e>=48&&e<=57}var eae;(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(eae||={}),Array(20).fill(0).map((e,t)=>` `.repeat(t));var m9=200;Array(m9).fill(0).map((e,t)=>`
33
+ `+` `.repeat(t)),Array(m9).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array(m9).fill(0).map((e,t)=>`\r
34
+ `+` `.repeat(t)),Array(m9).fill(0).map((e,t)=>`
35
+ `+` `.repeat(t)),Array(m9).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array(m9).fill(0).map((e,t)=>`\r
36
+ `+` `.repeat(t));var h9;(function(e){e.DEFAULT={allowTrailingComma:!1}})(h9||={});function tae(e,t=[],n=h9.DEFAULT){let r={type:`array`,offset:-1,length:-1,children:[],parent:void 0};function i(e){r.type===`property`&&(r.length=e-r.offset,r=r.parent)}function a(e){return r.children.push(e),e}rae(e,{onObjectBegin:e=>{r=a({type:`object`,offset:e,length:-1,parent:r,children:[]})},onObjectProperty:(e,t,n)=>{r=a({type:`property`,offset:t,length:-1,parent:r,children:[]}),r.children.push({type:`string`,value:e,offset:t,length:n,parent:r})},onObjectEnd:(e,t)=>{i(e+t),r.length=e+t-r.offset,r=r.parent,i(e+t)},onArrayBegin:(e,t)=>{r=a({type:`array`,offset:e,length:-1,parent:r,children:[]})},onArrayEnd:(e,t)=>{r.length=e+t-r.offset,r=r.parent,i(e+t)},onLiteralValue:(e,t,n)=>{a({type:iae(e),offset:t,length:n,parent:r,value:e}),i(t+n)},onSeparator:(e,t,n)=>{r.type===`property`&&(e===`:`?r.colonOffset=t:e===`,`&&i(t))},onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n);let o=r.children[0];return o&&delete o.parent,o}function nae(e,t){if(!e)return;let n=e;for(let e of t)if(typeof e==`string`){if(n.type!==`object`||!Array.isArray(n.children))return;let t=!1;for(let r of n.children)if(Array.isArray(r.children)&&r.children[0].value===e&&r.children.length===2){n=r.children[1],t=!0;break}if(!t)return}else{let t=e;if(n.type!==`array`||t<0||!Array.isArray(n.children)||t>=n.children.length)return;n=n.children[t]}return n}function rae(e,t,n=h9.DEFAULT){let r=$ie(e,!1),i=[],a=0;function o(e){return e?()=>a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function s(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function c(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function l(e){return e?()=>{a>0?a++:e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice())===!1&&(a=1)}:()=>!0}function u(e){return e?()=>{a>0&&a--,a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}let d=l(t.onObjectBegin),f=c(t.onObjectProperty),p=u(t.onObjectEnd),m=l(t.onArrayBegin),h=u(t.onArrayEnd),g=c(t.onLiteralValue),_=s(t.onSeparator),v=o(t.onComment),y=s(t.onError),b=n&&n.disallowComments,x=n&&n.allowTrailingComma;function S(){for(;;){let e=r.scan();switch(r.getTokenError()){case 4:C(14);break;case 5:C(15);break;case 3:C(13);break;case 1:b||C(11);break;case 2:C(12);break;case 6:C(16)}switch(e){case 12:case 13:b?C(10):v();break;case 16:C(1);break;case 15:case 14:break;default:return e}}}function C(e,t=[],n=[]){if(y(e),t.length+n.length>0){let e=r.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){S();break}if(n.indexOf(e)!==-1)break;e=S()}}}function w(e){let t=r.getTokenValue();return e?g(t):(f(t),i.push(t)),S(),!0}function T(){switch(r.getToken()){case 11:let e=r.getTokenValue(),t=Number(e);isNaN(t)&&(C(2),t=0),g(t);break;case 7:g(null);break;case 8:g(!0);break;case 9:g(!1);break;default:return!1}return S(),!0}function E(){return r.getToken()===10?(w(!1),r.getToken()===6?(_(`:`),S(),O()||C(4,[],[2,5])):C(5,[],[2,5]),i.pop(),!0):(C(3,[],[2,5]),!1)}function D(){d(),S();let e=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(e||C(4,[],[]),_(`,`),S(),r.getToken()===2&&x)break}else e&&C(6,[],[]);E()||C(4,[],[2,5]),e=!0}return p(),r.getToken()===2?S():C(7,[2],[]),!0}function ee(){m(),S();let e=!0,t=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(t||C(4,[],[]),_(`,`),S(),r.getToken()===4&&x)break}else t&&C(6,[],[]);e?(i.push(0),e=!1):i[i.length-1]++,O()||C(4,[],[4,5]),t=!0}return h(),e||i.pop(),r.getToken()===4?S():C(8,[4],[]),!0}function O(){switch(r.getToken()){case 3:return ee();case 1:return D();case 10:return w(!0);default:return T()}}return S(),r.getToken()===17?n.allowEmptyContent?!0:(C(4,[],[]),!1):O()?(r.getToken()!==17&&C(9,[],[]),!0):(C(4,[],[]),!1)}function iae(e){switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`string`:return`string`;case`object`:return e?Array.isArray(e)?`array`:`object`:`null`;default:return`null`}}var aae;(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(aae||={});var oae;(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(oae||={});var sae=tae,cae=nae,lae;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(lae||={});function uae(e,t){let n=sae(e);return n===void 0?[]:t.map(e=>{let t=cae(n,dae(e.path))??n;return{from:t.offset,to:t.offset+t.length,severity:e.kind===`binding`?`warning`:`error`,message:e.message}})}function dae(e){if(e===``)return[];let t=[];for(let n of e.matchAll(/\[("(?:[^"\\]|\\.)*")\]|([^.[]+)/g))n[1]===void 0?t.push(/^\d+$/.test(n[2])?Number(n[2]):n[2]):t.push(JSON.parse(n[1]));return t}function fae({recipe:e,onSave:t}){let[n,r]=(0,P.useState)(e?.text??``),[i,a]=(0,P.useState)(!1),[o,s]=(0,P.useState)();(0,P.useEffect)(()=>{r(e?.text??``)},[e?.file,e?.text]);let c=(0,P.useMemo)(()=>[K3(),p6(t=>{let n=U3()(t);return e===void 0||n.length>0?n:uae(t.state.doc.toString(),e.issues)})],[e]);if(e===void 0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(V,{children:`Select a recipe to see its JSON.`})});let l=mae(n),u=n!==e.text,d=async()=>{if(l===void 0){a(!0),s(void 0);try{await t(e.file,JSON.parse(n))}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}};return(0,F.jsxs)(mw,{h:`full`,p:2,gap:2,children:[(0,F.jsxs)(mw,{direction:`row`,align:`center`,justify:`space-between`,children:[(0,F.jsx)(pae,{issueCount:e.issues.length,syntaxError:l}),(0,F.jsx)(ew,{size:`sm`,onClick:()=>{d()},disabled:l!==void 0||i||!u,loading:i,children:`Save`})]}),e.issues.length>0&&l===void 0&&(0,F.jsx)(mw,{gap:0,fontSize:`xs`,color:`fg.muted`,children:e.issues.map(e=>(0,F.jsxs)(V,{children:[(0,F.jsx)(V,{as:`span`,fontFamily:`mono`,children:e.path}),`: `,e.message]},`${e.path}:${e.message}`))}),o!==void 0&&(0,F.jsx)(V,{color:`fg.error`,fontSize:`sm`,children:o}),(0,F.jsx)(I,{flex:`1`,minH:0,fontFamily:`mono`,fontSize:`sm`,borderWidth:`1px`,borderColor:`border`,rounded:`md`,overflow:`hidden`,children:(0,F.jsx)(u9,{value:n,height:`100%`,extensions:c,onChange:e=>{r(e)},basicSetup:{tabSize:2}})})]})}function pae({issueCount:e,syntaxError:t}){return t===void 0?e>0?(0,F.jsxs)(JC,{colorPalette:`orange`,children:[e,` issue`,e===1?``:`s`]}):(0,F.jsx)(JC,{colorPalette:`green`,children:`valid`}):(0,F.jsxs)(JC,{colorPalette:`red`,children:[`invalid JSON: `,t]})}function mae(e){try{JSON.parse(e);return}catch(e){return e instanceof Error?e.message:String(e)}}function hae({records:e,onCellClick:t,highlightedField:n,onHoverField:r,onSelectRecord:i}){if(e.length===0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(V,{children:`No records yet. Run a sample to see them here.`})});let a=g9(e);if(a.length===0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsxs)(V,{children:[e.length,` record`,e.length===1?``:`s`,` emitted, but no output field is mapped yet, so there is nothing to show as columns. Pick a value from the page or document on the left, then add it as a field in the Record tab.`]})});let o=e=>r===void 0?{}:{onMouseEnter:()=>{r(e)},onMouseLeave:()=>{r(void 0)}};return(0,F.jsx)(OT,{h:`full`,children:(0,F.jsxs)(ET,{size:`sm`,stickyHeader:!0,children:[(0,F.jsx)(kT,{children:(0,F.jsx)(DT,{children:a.map(e=>(0,F.jsx)(AT,{bg:e===n?`orange.subtle`:void 0,"data-highlighted":e===n,...o(e),children:e},e))})}),(0,F.jsx)(MT,{children:e.map((e,r)=>(0,F.jsx)(DT,{cursor:i===void 0?void 0:`pointer`,onClick:i===void 0?void 0:()=>{i(r)},children:a.map(i=>(0,F.jsx)(gae,{value:e.data[i],highlighted:i===n,onClick:t===void 0?void 0:e=>{e.stopPropagation(),t(r,i)},...o(i)},i))},e.key??`row-${r}`))})]})})}function gae({value:e,onClick:t,highlighted:n=!1,onMouseEnter:r,onMouseLeave:i}){let a=n?`orange.subtle`:void 0;return e===void 0?(0,F.jsx)(jT,{color:`fg.muted`,fontStyle:`italic`,bg:a,"data-highlighted":n,onMouseEnter:r,onMouseLeave:i,children:`missing`}):e===null?t===void 0?(0,F.jsx)(jT,{color:`fg.muted`,fontStyle:`italic`,bg:a,"data-highlighted":n,onMouseEnter:r,onMouseLeave:i,children:`null`}):(0,F.jsx)(jT,{color:`fg.muted`,fontStyle:`italic`,cursor:`pointer`,textDecoration:`underline`,title:`Why is this missing?`,bg:a,"data-highlighted":n,onClick:t,onMouseEnter:r,onMouseLeave:i,children:`null`}):(0,F.jsx)(jT,{bg:a,"data-highlighted":n,onMouseEnter:r,onMouseLeave:i,children:typeof e==`object`?JSON.stringify(e):String(e)})}function g9(e){let t=[];for(let n of e)for(let e of Object.keys(n.data))t.includes(e)||t.push(e);return t}var _ae={json:`application/json`,jsonl:`application/x-ndjson`,csv:`text/csv`};function vae(e,t,n=`records`){return{filename:`${n}.${t}`,mimeType:_ae[t],content:yae(e,t)}}function yae(e,t){return t===`json`?bae(e):t===`jsonl`?_9(e):xae(e)}function bae(e){return JSON.stringify(e.map(e=>e.data),null,2)}function _9(e){return e.map(e=>JSON.stringify(e.data)).join(`
37
+ `)+(e.length===0?``:`
38
+ `)}function xae(e){let t=g9(e),n=[t.map(e=>v9(e)).join(`,`)];for(let r of e)n.push(t.map(e=>v9(Sae(r.data[e]))).join(`,`));return n.join(`\r
39
+ `)+(e.length===0?``:`\r
40
+ `)}function Sae(e){return e==null?``:typeof e==`object`?JSON.stringify(e):String(e)}function v9(e){return/["\r\n,]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function Cae({records:e,onSelectRecord:t}){return e.length===0?(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(V,{children:`No records yet. Run a sample to see them here.`})}):(0,F.jsx)(I,{as:`pre`,p:2,h:`full`,overflow:`auto`,fontFamily:`mono`,fontSize:`xs`,whiteSpace:`pre-wrap`,children:_9(e).trimEnd().split(`
41
+ `).map((e,n)=>(0,F.jsx)(I,{as:`span`,display:`block`,cursor:t===void 0?void 0:`pointer`,_hover:t===void 0?void 0:{bg:`bg.muted`},onClick:t===void 0?void 0:()=>{t(n)},children:e},n))})}function wae({record:e,index:t,onClose:n}){return(0,F.jsx)(_w,{open:e!==void 0,onOpenChange:e=>{e.open||n()},size:`lg`,placement:`center`,scrollBehavior:`inside`,children:(0,F.jsxs)(v_,{children:[(0,F.jsx)(Sw,{}),(0,F.jsx)(vw,{children:(0,F.jsxs)(yw,{children:[(0,F.jsxs)(ww,{display:`flex`,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,children:[(0,F.jsxs)(I,{minW:0,children:[(0,F.jsxs)(bw,{children:[`Record `,t===void 0?``:t+1]}),e?.key!=null&&(0,F.jsx)(V,{fontSize:`xs`,color:`fg.muted`,truncate:!0,title:e.key,children:e.key})]}),(0,F.jsx)(xw,{asChild:!0,children:(0,F.jsx)(dw,{size:`sm`,"aria-label":`Close record`})})]}),(0,F.jsx)(Cw,{pb:4,children:(0,F.jsx)(I,{as:`pre`,fontFamily:`mono`,fontSize:`xs`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,children:e===void 0?``:JSON.stringify(e.data,null,2)})})]})})]})})}function Tae({records:e,onCellClick:t,highlightedField:n,onHoverField:r}){let[i,a]=(0,P.useState)(`table`),[o,s]=(0,P.useState)(!1),[c,l]=(0,P.useState)();function u(t){let n=vae(e,t);Eae(n.filename,n.mimeType,n.content)}return(0,F.jsxs)(I,{flex:`1`,minH:`0`,display:`flex`,flexDirection:`column`,children:[(0,F.jsx)(b9,{view:i,onViewChange:a,onExport:u,onEnlarge:()=>{s(!0)},exportDisabled:e.length===0}),(0,F.jsx)(I,{flex:`1`,minH:`0`,overflow:`auto`,children:(0,F.jsx)(y9,{view:i,records:e,onCellClick:t,highlightedField:n,onHoverField:r,onSelectRecord:l})}),(0,F.jsx)(_w,{open:o,onOpenChange:e=>{s(e.open)},size:`cover`,placement:`center`,children:(0,F.jsxs)(v_,{children:[(0,F.jsx)(Sw,{}),(0,F.jsx)(vw,{children:(0,F.jsxs)(yw,{h:`85vh`,display:`flex`,flexDirection:`column`,children:[(0,F.jsxs)(ww,{display:`flex`,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,children:[(0,F.jsxs)(bw,{children:[`Records (`,e.length,`)`]}),(0,F.jsx)(xw,{asChild:!0,children:(0,F.jsx)(dw,{size:`sm`,"aria-label":`Close`})})]}),(0,F.jsxs)(Cw,{flex:`1`,minH:`0`,display:`flex`,flexDirection:`column`,gap:2,pb:4,children:[(0,F.jsx)(b9,{view:i,onViewChange:a,onExport:u,exportDisabled:e.length===0}),(0,F.jsx)(I,{flex:`1`,minH:`0`,overflow:`auto`,children:(0,F.jsx)(y9,{view:i,records:e,onCellClick:t,highlightedField:n,onHoverField:r,onSelectRecord:l})})]})]})})]})}),(0,F.jsx)(wae,{record:c===void 0?void 0:e[c],index:c,onClose:()=>{l(void 0)}})]})}function y9({view:e,records:t,onCellClick:n,highlightedField:r,onHoverField:i,onSelectRecord:a}){return e===`table`?(0,F.jsx)(hae,{records:t,onCellClick:n,highlightedField:r,onHoverField:i,onSelectRecord:a}):(0,F.jsx)(Cae,{records:t,onSelectRecord:a})}function b9({view:e,onViewChange:t,onExport:n,onEnlarge:r,exportDisabled:i}){return(0,F.jsxs)(W,{px:2,py:1,gap:2,borderBottomWidth:`1px`,flexShrink:0,children:[(0,F.jsx)(ew,{size:`2xs`,colorPalette:`brand`,variant:e===`table`?`solid`:`outline`,onClick:()=>{t(`table`)},children:`Table`}),(0,F.jsx)(ew,{size:`2xs`,colorPalette:`brand`,variant:e===`jsonl`?`solid`:`outline`,onClick:()=>{t(`jsonl`)},children:`JSONL`}),(0,F.jsx)(Jw,{size:`xs`,width:`7em`,variant:`outline`,disabled:i,children:(0,F.jsxs)(Xw,{"aria-label":`Export records`,value:``,onChange:e=>{let t=e.target.value;t!==``&&n(t),e.target.value=``},children:[(0,F.jsx)(`option`,{value:``,disabled:!0,children:`Export…`}),(0,F.jsx)(`option`,{value:`json`,children:`JSON`}),(0,F.jsx)(`option`,{value:`jsonl`,children:`JSONL`}),(0,F.jsx)(`option`,{value:`csv`,children:`CSV`})]})}),r!==void 0&&(0,F.jsx)(ew,{size:`2xs`,variant:`outline`,onClick:r,marginStart:`auto`,children:`Enlarge`})]})}function Eae(e,t,n){let r=new Blob([n],{type:t}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,document.body.append(a),a.click(),a.remove(),URL.revokeObjectURL(i)}function Dae({rejected:e,onClick:t}){return e.length===0?null:(0,F.jsxs)(mw,{borderTopWidth:`1px`,gap:0,flexShrink:0,maxH:`30%`,overflow:`auto`,children:[(0,F.jsxs)(I,{px:3,py:1,fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:[`Rejected (`,e.length,`)`]}),(0,F.jsx)(ET,{size:`sm`,children:(0,F.jsx)(MT,{children:e.map((e,n)=>(0,F.jsxs)(DT,{cursor:t===void 0?void 0:`pointer`,onClick:t===void 0?void 0:()=>{t(n)},children:[(0,F.jsx)(jT,{fontFamily:`mono`,fontWeight:`medium`,children:e.field}),(0,F.jsx)(jT,{color:`fg.error`,children:(0,F.jsx)(V,{truncate:!0,children:e.reason})})]},`${e.field}-${n}`))})})]})}function Oae({lines:e}){return e.length===0?(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(V,{children:`No trace yet. Run a sample to see it here.`})}):(0,F.jsx)(I,{as:`pre`,p:2,h:`full`,overflow:`auto`,fontFamily:`mono`,fontSize:`xs`,whiteSpace:`pre-wrap`,children:e.join(`
42
+ `)})}function kae({loading:e,view:t,error:n}){return e===!0?(0,F.jsxs)(mw,{p:4,direction:`row`,align:`center`,color:`fg.muted`,children:[(0,F.jsx)(XC,{size:`sm`}),(0,F.jsx)(V,{children:`Working it out…`})]}):n===void 0?t===void 0?(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(V,{children:`Click a missing or rejected value in the Records tab to see why here.`})}):(0,F.jsxs)(mw,{p:4,gap:2,children:[(0,F.jsxs)(mw,{direction:`row`,gap:2,align:`center`,children:[(0,F.jsx)(JC,{colorPalette:t.outcome===`rejected`?`red`:`orange`,children:t.outcome}),(0,F.jsx)(V,{fontFamily:`mono`,fontSize:`sm`,fontWeight:`medium`,children:t.field})]}),(0,F.jsx)(V,{children:t.sentence}),t.policy!==void 0&&(0,F.jsxs)(V,{fontSize:`xs`,color:`fg.muted`,children:[`policy: `,t.policy]}),t.stepPath!==void 0&&(0,F.jsxs)(V,{fontSize:`xs`,color:`fg.muted`,children:[`step: `,t.stepPath]})]}):(0,F.jsx)(I,{p:4,children:(0,F.jsx)(V,{color:`fg.error`,children:n})})}function Aae({records:e,traceLines:t,rejected:n=[],onExplainMissing:r,onExplainRejected:i,whyLoading:a,whyView:o,whyError:s,highlightedField:c,onHoverField:l}){return(0,F.jsxs)(Hc,{colorPalette:`brand`,defaultValue:`records`,h:`full`,display:`flex`,flexDirection:`column`,children:[(0,F.jsxs)(Gc,{children:[(0,F.jsxs)(Uc,{value:`records`,children:[`Records (`,e.length,`)`]}),(0,F.jsx)(Uc,{value:`trace`,children:`Trace`}),(0,F.jsx)(Uc,{value:`why`,children:`Why?`})]}),(0,F.jsxs)(Wc,{value:`records`,flex:`1`,minH:`0`,p:0,display:`flex`,flexDirection:`column`,children:[(0,F.jsx)(Tae,{records:e,onCellClick:r,highlightedField:c,onHoverField:l}),(0,F.jsx)(Dae,{rejected:n,onClick:i})]}),(0,F.jsx)(Wc,{value:`trace`,flex:`1`,minH:`0`,overflow:`auto`,p:0,children:(0,F.jsx)(Oae,{lines:t})}),(0,F.jsx)(Wc,{value:`why`,flex:`1`,minH:`0`,overflow:`auto`,p:0,children:(0,F.jsx)(kae,{loading:a,view:o,error:s})})]})}function x9(e){if(Array.isArray(e))return e.some(e=>x9(e));if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`emit`||Object.values(t).some(e=>x9(e))}function jae(e){return[...Array.isArray(e)?e:[],{type:`emit`}]}var Mae={string:`gray`,number:`blue`,integer:`blue`,boolean:`green`,date:`purple`,datetime:`purple`,currency:`orange`,url:`cyan`,enum:`pink`,array:`teal`,object:`teal`,json:`yellow`};function S9(e){return Mae[e]??`gray`}function C9(e){return e!==void 0&&`each`in e}function Nae(e){let t={};for(let[n,r]of Object.entries(e))!C9(r)&&typeof r.from==`string`&&(t[n]=r.from);return t}var Pae=[`string`,`number`,`integer`,`boolean`,`date`,`datetime`,`currency`,`url`,`enum`,`array`,`object`,`json`],w9=[`fail`,`skip-record`,`null`,`default`],T9=/^[A-Z_][\w-]*$/i,Fae=`trim.lowercase.uppercase.replace.regex.split.join.first.last.nth.slice.concat.coalesce.default.number.integer.boolean.toString.padStart.padEnd.currency.date.absoluteUrl.urlEncode.flatten.unique.sum.count.template.jsonpath.lookup.group`.split(`.`),Iae={replace:[{name:`pattern`},{name:`replacement`},{name:`flags`}],regex:[{name:`pattern`},{name:`group`,numeric:!0},{name:`flags`}],split:[{name:`separator`}],join:[{name:`separator`}],nth:[{name:`index`,numeric:!0}],slice:[{name:`start`,numeric:!0},{name:`end`,numeric:!0}],concat:[{name:`separator`}],default:[{name:`value`}],number:[{name:`locale`}],boolean:[{name:`truthy`}],padStart:[{name:`length`,numeric:!0},{name:`char`}],padEnd:[{name:`length`,numeric:!0},{name:`char`}],currency:[{name:`locale`},{name:`currency`}],date:[{name:`format`},{name:`timezone`}],absoluteUrl:[{name:`base`}],template:[{name:`value`}],jsonpath:[{name:`path`}],lookup:[{name:`in`},{name:`key`},{name:`pick`}],group:[{name:`by`}]};function Lae(e){return Iae[e]??[]}function Rae({transforms:e,trace:t,onChange:n}){let[r,i]=(0,P.useState)(!1),a=Ok(),o=(t,r)=>{n(e.map((e,n)=>n===t?r:e))},s=t=>{n(e.filter((e,n)=>n!==t))},c=(t,r)=>{let i=t+r;if(i<0||i>=e.length)return;let a=[...e],o=a[t];a[t]=a[i],a[i]=o,n(a)},l=t=>{n([...e,t===`hook`?{op:t,name:a?.[0]??`myHook`}:{op:t}]),i(!1)};return(0,F.jsxs)(mw,{direction:`row`,gap:2,wrap:`wrap`,align:`flex-start`,children:[e.map((n,r)=>(0,F.jsx)(zae,{transform:n,value:t?.steps[r]?.value,failed:t!==void 0&&t.steps.length<=r,onChange:e=>{o(r,e)},onRemove:()=>{s(r)},onMoveLeft:r===0?void 0:()=>{c(r,-1)},onMoveRight:r===e.length-1?void 0:()=>{c(r,1)}},r)),r?(0,F.jsx)(Jw,{size:`xs`,width:`140px`,children:(0,F.jsxs)(Xw,{defaultValue:``,onChange:e=>{e.target.value!==``&&l(e.target.value)},children:[(0,F.jsx)(`option`,{value:``,disabled:!0,children:`op…`}),Fae.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e)),(0,F.jsx)(`option`,{value:`hook`,children:`hook (your code)`})]})}):(0,F.jsx)(ew,{size:`xs`,variant:`outline`,onClick:()=>{i(!0)},children:`+ transform`})]})}function zae({transform:e,value:t,failed:n,onChange:r,onRemove:i,onMoveLeft:a,onMoveRight:o}){let[s,c]=(0,P.useState)(!1),l=e.op===`hook`,u=l?[]:Lae(e.op),d=l||u.length>0;return(0,F.jsxs)(I,{borderWidth:`1px`,borderRadius:`md`,borderColor:n?`red.subtle`:void 0,px:2,py:1,fontSize:`xs`,children:[(0,F.jsxs)(W,{gap:1,children:[a!==void 0&&(0,F.jsx)(uw,{"aria-label":`Move left`,size:`2xs`,variant:`ghost`,onClick:a,children:`‹`}),(0,F.jsxs)(V,{as:d?`button`:`span`,fontWeight:`medium`,cursor:d?`pointer`:void 0,onClick:d?()=>{c(!s)}:void 0,children:[e.op,l&&typeof e.name==`string`?`: ${e.name}`:``]}),o!==void 0&&(0,F.jsx)(uw,{"aria-label":`Move right`,size:`2xs`,variant:`ghost`,onClick:o,children:`›`}),(0,F.jsx)(uw,{"aria-label":`Remove ${e.op}`,size:`2xs`,variant:`ghost`,colorPalette:`red`,onClick:i,children:`×`})]}),t!==void 0&&(0,F.jsxs)(JC,{mt:1,size:`sm`,colorPalette:n?`red`:`gray`,fontFamily:`mono`,maxW:`160px`,overflow:`hidden`,textOverflow:`ellipsis`,children:[`→ `,typeof t==`object`?JSON.stringify(t):String(t)]}),s&&l&&(0,F.jsx)(mw,{mt:1,gap:1,children:(0,F.jsx)(kk,{size:`xs`,ariaLabel:`Hook name`,value:typeof e.name==`string`?e.name:``,onChange:t=>{r({...e,name:t})}})}),s&&u.length>0&&(0,F.jsx)(mw,{mt:1,gap:1,children:u.map(t=>(0,F.jsxs)(W,{gap:1,children:[(0,F.jsx)(V,{color:`fg.muted`,minW:`70px`,children:t.name}),(0,F.jsx)(Rw,{size:`2xs`,value:e[t.name]===void 0?``:String(e[t.name]),onChange:n=>{let i=n.target.value;r({...e,[t.name]:t.numeric?Number(i):i})}})]},t.name))})]})}function E9({name:e,field:t,rule:n,scopeIds:r,trace:i,value:a,missing:o,rejected:s,depth:c=0,stepId:l,highlighted:u=!1,onHoverStepId:d,onFieldChange:f,onRuleChange:p,onRename:m,onRemove:h,onExplainMissing:g,onExplainRejected:_}){let[v,y]=(0,P.useState)(!1),[b,x]=(0,P.useState)(e),[S,C]=(0,P.useState)(),[w,T]=(0,P.useState)(!1),E=t.generated!==void 0;return(0,F.jsxs)(I,{"data-testid":`${e}-row`,"data-highlighted":u,borderWidth:`1px`,borderRadius:`md`,p:2,ml:c*5,borderColor:u?`orange.solid`:s===void 0?void 0:`red.subtle`,bg:u?`orange.subtle`:void 0,onMouseEnter:l===void 0||d===void 0?void 0:()=>{d(l)},onMouseLeave:l===void 0||d===void 0?void 0:()=>{d(void 0)},children:[(0,F.jsxs)(W,{"data-testid":`${e}-summary`,gap:2,mb:2,align:`center`,wrap:`wrap`,fontSize:`xs`,children:[(0,F.jsx)(JC,{size:`sm`,colorPalette:S9(t.type),children:t.type}),E?(0,F.jsx)(JC,{size:`sm`,colorPalette:`gray`,children:`generated`}):l===void 0?(0,F.jsx)(JC,{size:`sm`,colorPalette:`orange`,children:n===void 0?`not mapped`:`from a template`}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(V,{color:`fg.muted`,children:`←`}),(0,F.jsx)(SB,{name:l,draggable:!1})]}),a!==void 0&&(0,F.jsxs)(V,{color:`fg.muted`,truncate:!0,maxW:`260px`,title:D9(a),children:[`= `,D9(a)]})]}),(0,F.jsxs)(W,{gap:2,align:`center`,wrap:`wrap`,children:[(0,F.jsxs)(mw,{gap:0,children:[(0,F.jsx)(Rw,{size:`xs`,width:`140px`,value:b,onChange:e=>{x(e.target.value)},onBlur:()=>{if(b!==e){if(!T9.test(b)){C(`a field name has no dots`);return}C(void 0),m(b)}}}),S!==void 0&&(0,F.jsx)(V,{fontSize:`2xs`,color:`fg.error`,children:S})]}),(0,F.jsx)(Jw,{size:`xs`,width:`110px`,children:(0,F.jsx)(Xw,{value:t.type,onChange:e=>{f({...t,type:e.target.value})},children:Pae.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))})}),(0,F.jsx)(I,{"data-testid":`${e}-source-drop`,minW:`140px`,borderWidth:`1px`,borderStyle:`dashed`,borderRadius:`sm`,px:2,py:`2px`,fontSize:`xs`,bg:w?`colorPalette.subtle`:void 0,colorPalette:`brand`,onDragOver:e=>{e.dataTransfer.types.includes(`application/x-opencraw-pill`)&&(e.preventDefault(),T(!0))},onDragLeave:()=>{T(!1)},onDrop:e=>{e.preventDefault(),T(!1);let t=e.dataTransfer.getData(`application/x-opencraw-pill`)||e.dataTransfer.getData(`text/plain`);t!==``&&p({...n,from:t})},children:E?(0,F.jsxs)(V,{color:`fg.muted`,children:[`generated: `,t.generated]}):(0,F.jsx)(Jw,{size:`xs`,children:(0,F.jsxs)(Xw,{value:typeof n?.from==`string`?n.from:``,onChange:e=>{p(e.target.value===``?void 0:{...n,from:e.target.value})},children:[(0,F.jsx)(`option`,{value:``,children:`(drop a pill, or pick)`}),r.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))]})})}),(0,F.jsxs)(aw,{size:`xs`,checked:t.key===!0,onCheckedChange:e=>{f({...t,key:e.checked===!0})},children:[(0,F.jsx)(lw,{}),(0,F.jsx)(cw,{}),(0,F.jsx)(ow,{children:`key`})]}),(0,F.jsxs)(aw,{size:`xs`,checked:t.required===!0,disabled:E,onCheckedChange:e=>{f({...t,required:e.checked===!0})},children:[(0,F.jsx)(lw,{}),(0,F.jsx)(cw,{}),(0,F.jsx)(ow,{children:`required`})]}),o===!0&&(0,F.jsx)(ew,{size:`2xs`,variant:`outline`,colorPalette:`orange`,onClick:g,children:`Why null?`}),s!==void 0&&(0,F.jsxs)(ew,{size:`2xs`,variant:`outline`,colorPalette:`red`,onClick:_,title:s.reason,children:[s.count,` rejected`]}),(0,F.jsx)(ew,{size:`2xs`,variant:`ghost`,onClick:()=>{y(!v)},children:v?`less`:`more`}),(0,F.jsx)(uw,{"aria-label":`Remove ${e}`,size:`2xs`,variant:`ghost`,colorPalette:`red`,onClick:h,ml:`auto`,children:`×`})]}),!E&&t.type!==`object`&&(0,F.jsx)(I,{mt:2,children:(0,F.jsx)(Rae,{transforms:n?.transform??[],trace:i,onChange:e=>{p(n===void 0?void 0:{...n,transform:e.length===0?void 0:e})}})}),v&&(0,F.jsxs)(mw,{mt:2,direction:`row`,gap:3,wrap:`wrap`,fontSize:`xs`,children:[(0,F.jsxs)(aw,{size:`xs`,checked:t.nullable===!0,onCheckedChange:e=>{f({...t,nullable:e.checked===!0})},children:[(0,F.jsx)(lw,{}),(0,F.jsx)(cw,{}),(0,F.jsx)(ow,{children:`nullable`})]}),(0,F.jsxs)(W,{gap:1,children:[(0,F.jsx)(V,{color:`fg.muted`,children:`onMissing`}),(0,F.jsx)(Jw,{size:`xs`,width:`110px`,children:(0,F.jsxs)(Xw,{value:t.onMissing??``,onChange:e=>{f({...t,onMissing:e.target.value===``?void 0:e.target.value})},children:[(0,F.jsx)(`option`,{value:``,children:`(recipe default)`}),w9.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))]})})]}),(0,F.jsxs)(W,{gap:1,children:[(0,F.jsx)(V,{color:`fg.muted`,children:`default`}),(0,F.jsx)(Rw,{size:`xs`,width:`120px`,value:t.default===void 0?``:String(t.default),onChange:e=>{f({...t,default:e.target.value===``?void 0:e.target.value})}})]}),t.type===`currency`&&(0,F.jsxs)(W,{gap:1,children:[(0,F.jsx)(V,{color:`fg.muted`,children:`currency`}),(0,F.jsx)(Rw,{size:`xs`,width:`60px`,value:t.currency??``,onChange:e=>{f({...t,currency:e.target.value||void 0})}})]}),(t.type===`date`||t.type===`datetime`)&&(0,F.jsxs)(W,{gap:1,children:[(0,F.jsx)(V,{color:`fg.muted`,children:`format`}),(0,F.jsx)(Rw,{size:`xs`,width:`100px`,value:t.format??``,onChange:e=>{f({...t,format:e.target.value||void 0})}})]}),t.type===`enum`&&(0,F.jsxs)(W,{gap:1,children:[(0,F.jsx)(V,{color:`fg.muted`,children:`values`}),(0,F.jsx)(Rw,{size:`xs`,width:`160px`,placeholder:`a, b, c`,value:(t.values??[]).join(`, `),onChange:e=>{f({...t,values:e.target.value.split(`,`).map(e=>e.trim()).filter(e=>e!==``)})}})]}),(0,F.jsxs)(W,{gap:1,children:[(0,F.jsx)(V,{color:`fg.muted`,children:`pattern`}),(0,F.jsx)(Rw,{size:`xs`,width:`120px`,value:t.pattern??``,onChange:e=>{f({...t,pattern:e.target.value||void 0})}})]}),(0,F.jsxs)(W,{gap:1,children:[(0,F.jsx)(V,{color:`fg.muted`,children:`min`}),(0,F.jsx)(Rw,{size:`xs`,width:`60px`,value:t.min??``,onChange:e=>{f({...t,min:e.target.value===``?void 0:Number(e.target.value)})}})]}),(0,F.jsxs)(W,{gap:1,children:[(0,F.jsx)(V,{color:`fg.muted`,children:`max`}),(0,F.jsx)(Rw,{size:`xs`,width:`60px`,value:t.max??``,onChange:e=>{f({...t,max:e.target.value===``?void 0:Number(e.target.value)})}})]})]})]})}function D9(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,79)}…`:t}function Bae({suggestions:e,onAdd:t,onAddAll:n}){return e.length===0?null:(0,F.jsxs)(I,{"data-testid":`field-suggestions`,borderWidth:`1px`,borderStyle:`dashed`,borderRadius:`md`,p:2,bg:`bg.subtle`,children:[(0,F.jsxs)(W,{justify:`space-between`,mb:1,children:[(0,F.jsx)(V,{fontSize:`xs`,fontWeight:`medium`,children:`Read by the steps, not in the output yet`}),(0,F.jsxs)(ew,{size:`2xs`,variant:`outline`,onClick:n,children:[`Add all (`,e.length,`)`]})]}),(0,F.jsx)(mw,{direction:`row`,wrap:`wrap`,gap:2,children:e.map(e=>(0,F.jsxs)(W,{"data-testid":`suggestion-${e.source}`,gap:1,borderWidth:`1px`,borderRadius:`full`,pl:1,pr:1,py:`1px`,bg:`bg`,title:`${e.name}: ${e.field.type}, because ${e.reason}`,children:[(0,F.jsx)(SB,{name:e.source,draggable:!1}),(0,F.jsx)(V,{fontSize:`xs`,color:`fg.muted`,children:`→`}),(0,F.jsx)(V,{fontSize:`xs`,fontWeight:`medium`,children:e.name}),(0,F.jsx)(JC,{size:`sm`,colorPalette:S9(e.field.type),children:e.field.type}),(0,F.jsx)(ew,{size:`2xs`,variant:`ghost`,"aria-label":`Add ${e.name}`,onClick:()=>{t(e)},children:`+`})]},e.source))})]})}function O9(e){let t=new Set(e.dataTransfer.types);return t.has(`application/x-opencraw-pill`)||t.has(`application/x-opencraw-card`)}function Vae({onPill:e,onCard:t,children:n}){let[r,i]=(0,P.useState)(!1);function a(e){!e.defaultPrevented&&O9(e)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,i(!0))}function o(n){if(i(!1),n.defaultPrevented||!O9(n))return;n.preventDefault();let r=wk(n.dataTransfer);if(r!==void 0){t(r);return}let a=n.dataTransfer.getData(xB);a!==``&&e(a)}return(0,F.jsx)(I,{"data-testid":`output-drop-zone`,"data-drop-over":r,borderWidth:`2px`,borderStyle:`dashed`,borderColor:r?`brand.solid`:`transparent`,bg:r?`brand.subtle`:void 0,borderRadius:`md`,minH:`4em`,onDragOver:a,onDragLeave:()=>{i(!1)},onDrop:o,children:n})}function Hae(e){let t=A9(e);if(t===void 0)return[];let n=[];return k9(t,n),n}function k9(e,t){for(let n of e){if(typeof n!=`object`||!n)continue;let e=n;for(let n of[`id`,`as`]){let r=e[n];typeof r==`string`&&r.length>0&&!t.includes(r)&&t.push(r)}let r=A9(e);r!==void 0&&k9(r,t),Array.isArray(e.else)&&k9(e.else,t)}}function A9(e){if(typeof e!=`object`||!e)return;let t=e.steps;return Array.isArray(t)?t:void 0}var Uae=new Set([`attr:href`,`attr:src`,`attr:data-src`]),Wae=[[[`url`,`link`,`href`,`website`,`homepage`,`image`,`img`,`photo`,`thumbnail`,`src`],{type:`url`,reason:`its name says a link`}],[[`datetime`,`timestamp`],{type:`datetime`,reason:`its name says a moment in time`}],[[`date`,`day`,`published`,`created`,`updated`,`released`,`expires`,`expiry`,`until`,`since`],{type:`date`,reason:`its name says a date`}],[[`available`,`availability`,`active`,`enabled`,`instock`,`is`,`has`],{type:`boolean`,reason:`its name says yes or no`}],[[`qty`,`quantity`,`count`,`pages`,`year`,`age`,`rank`,`position`,`votes`,`reviews`],{type:`integer`,reason:`its name says a whole number`}],[[`price`,`cost`,`amount`,`total`,`fee`,`discount`,`salary`,`rate`,`rating`,`score`,`weight`,`height`,`width`,`length`,`percent`,`sconto`],{type:`number`,reason:`its name says an amount`}]];function j9(e,t,n){let r=P9(N9(e)),i=new Set(r.flatMap(e=>typeof e.over==`string`?[e.over]:[])),a=Jae(n),o=new Set(Object.keys(t)),s=[],c=new Set;for(let e of r){let t=e.id;if(typeof t!=`string`||t===``||!qae(e)||i.has(t)||a.has(t)||c.has(t))continue;c.add(t);let n=Kae(t,e),r=M9(t,o);o.add(r),s.push({source:t,name:r,field:{type:n.type,...n.items!==void 0&&{items:n.items}},rule:{from:n.from??t,...n.transform!==void 0&&{transform:n.transform}},reason:n.reason})}return s}function Gae(e,t,n,r){let i=j9(t,n,r).find(t=>t.source===e);return i===void 0?{source:e,name:M9(e,new Set(Object.keys(n))),field:{type:`string`},rule:{from:e},reason:`text, the safe default`}:i}function Kae(e,t){if(t.kind===`table`)return{type:`json`,from:`${e}.rows`,reason:`the rows of the table, as a list`};if(t.many===!0)return{type:`array`,items:{type:`string`},reason:`it reads every match, a list`};let n=typeof t.take==`string`?t.take:void 0;if(n!==void 0&&Uae.has(n))return{type:`url`,transform:[{op:`absoluteUrl`}],reason:`it takes ${n}, a link (made absolute)`};if(t.kind===`section`)return{type:`string`,reason:`it reads a block of text`};let r=Yae(e);for(let[e,t]of Wae)if(r.some(t=>e.includes(t)))return t;return{type:`string`,reason:`text, the safe default`}}function qae(e){return e.type===`set`||e.type===`extract`&&(e.kind!==`table`||e.many!==!0)}function Jae(e){let t=new Set,n=e=>{let n=Array.isArray(e.from)?e.from:[e.from];for(let e of n)t.add(e.split(`.`,1)[0])};for(let r of Object.values(e))if(`each`in r){t.add(r.each);for(let e of Object.values(r.fields))n(e)}else n(r);return t}function Yae(e){return e.replace(/([a-z\d])([A-Z])/g,`$1 $2`).toLowerCase().split(/[^a-z\d]+/).filter(e=>e!==``)}function M9(e,t){let n=e.replace(/[^\w-]/g,`_`);T9.test(n)||(n=`field_${n}`);let r=n,i=2;for(;t.has(r);)r=`${n}${String(i)}`,i+=1;return r}function N9(e){if(typeof e!=`object`||!e)return[];let t=e.steps;return Array.isArray(t)?t:[]}function P9(e){return e.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e,n=Array.isArray(t.else)?t.else:[];return[t,...P9(N9(t)),...P9(n)]})}function Xae({inputRecipe:e,outputRecipe:t,records:n,rejected:r,onSaveInput:i,onSaveOutput:a,onSaveOutline:o,onExplainMissing:s,onExplainRejected:c}){let[l,u]=(0,P.useState)(),[d,f]=(0,P.useState)(),[p,m]=(0,P.useState)(),[h,g]=(0,P.useState)(),[_,v]=(0,P.useState)(0),[y,b]=(0,P.useState)(!1),[x,S]=(0,P.useState)(),C=G(e=>e.hoveredStepId),w=G(e=>e.setHoveredStepId),T=(0,P.useRef)(new Set);if((0,P.useEffect)(()=>{let n=t===void 0?void 0:JSON.parse(t.text),r=e===void 0?void 0:JSON.parse(e.text);m(n===void 0?void 0:JSON.stringify(n)),g(r===void 0?void 0:JSON.stringify(r));let i=T.current;if(n!==void 0&&r!==void 0&&i.size>0){T.current=new Set;let e=j9(r,n.fields,r.mapping).filter(e=>i.has(e.source)),t={...n.fields},a={...r.mapping};for(let n of e)t[n.name]=n.field,a[n.name]=n.rule;u({...n,fields:t}),f({...r,mapping:a})}else u(n),f(r);v(0)},[e?.file,e?.text,t?.file,t?.text]),e===void 0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(V,{children:`Select a recipe to see its output fields.`})});if(t===void 0||l===void 0||d===void 0)return(0,F.jsx)(I,{p:4,color:`fg.muted`,children:(0,F.jsx)(V,{children:`This recipe names no output recipe found in this workspace.`})});let E=Hae(d),D=j9(d,l.fields,d.mapping),ee=n[_],O=JSON.stringify(l)!==p||JSON.stringify(d)!==h,k=(e,t)=>{let n={...l.fields};t===void 0?delete n[e]:n[e]=t,u({...l,fields:n})},te=(e,t)=>{if(t===e||l.fields[t]!==void 0)return;let n={};for(let[r,i]of Object.entries(l.fields))n[r===e?t:r]=i;u({...l,fields:n});let r={...d.mapping};r[e]!==void 0&&(r[t]=r[e],delete r[e]),f({...d,mapping:r})},ne=(e,t)=>{let n={...d.mapping};t===void 0?delete n[e]:n[e]=t,f({...d,mapping:n})},re=e=>{let t={...l.fields},n={...d.mapping};for(let r of e)t[r.name]=r.field,n[r.name]=r.rule;u({...l,fields:t}),f({...d,mapping:n})},ie=e=>{re([Gae(e,d,l.fields,d.mapping)])},A=()=>{let e=`field`,t=1;for(;l.fields[e]!==void 0;)e=`field${t}`,t+=1;k(e,{type:`string`})},ae=async()=>{b(!0),S(void 0);try{await a(t.file,l),await i(e.file,d)}catch(e){S(e instanceof Error?e.message:String(e))}finally{b(!1)}},oe=async t=>{let n=e.outline;if(o!==void 0&&n!==void 0){S(void 0);try{O&&await ae(),T.current=new Set(F9(t)),await o(e.file,{...n,steps:[...n.steps,{...t,path:`steps.${String(n.steps.length)}`}]})}catch(e){T.current=new Set,S(e instanceof Error?e.message:String(e))}}};return(0,F.jsxs)(mw,{h:`full`,p:2,gap:2,overflow:`auto`,children:[(0,F.jsxs)(W,{justify:`space-between`,wrap:`wrap`,children:[(0,F.jsxs)(W,{gap:3,fontSize:`xs`,color:`fg.muted`,children:[(0,F.jsxs)(W,{gap:1,children:[(0,F.jsx)(V,{children:`onMissing`}),(0,F.jsx)(Jw,{size:`xs`,width:`110px`,children:(0,F.jsxs)(Xw,{value:l.onMissing??``,onChange:e=>{u({...l,onMissing:e.target.value===``?void 0:e.target.value})},children:[(0,F.jsx)(`option`,{value:``,children:`(fail/null)`}),w9.filter(e=>e!=="default").map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))]})})]}),n.length>0&&(0,F.jsxs)(W,{gap:1,children:[(0,F.jsx)(V,{children:`record`}),(0,F.jsx)(Jw,{size:`xs`,width:`70px`,children:(0,F.jsx)(Xw,{value:_,onChange:e=>{v(Number(e.target.value))},children:n.map((e,t)=>(0,F.jsxs)(`option`,{value:t,children:[`#`,t+1]},e.key??t))})})]})]}),(0,F.jsxs)(W,{children:[x!==void 0&&(0,F.jsx)(V,{color:`fg.error`,fontSize:`xs`,children:x}),(0,F.jsx)(ew,{size:`xs`,onClick:()=>{ae()},disabled:!O||y,loading:y,children:`Save`})]})]}),!x9(d.steps)&&(Object.keys(l.fields).length>0||D.length>0)&&(0,F.jsxs)(W,{role:`alert`,"data-testid":`missing-emit`,gap:2,p:2,borderWidth:`1px`,borderColor:`orange.300`,rounded:`md`,fontSize:`xs`,justify:`space-between`,children:[(0,F.jsx)(V,{children:`This recipe has no Emit step, so a run reads these values but returns no records.`}),(0,F.jsx)(ew,{size:`xs`,variant:`outline`,onClick:()=>{f({...d,steps:jae(d.steps)})},children:`Add Emit step`})]}),(0,F.jsx)(Bae,{suggestions:D,onAdd:e=>{re([e])},onAddAll:()=>{re(D)}}),(0,F.jsxs)(Vae,{onPill:ie,onCard:e=>{oe(e)},children:[Object.keys(l.fields).length===0&&D.length===0&&(0,F.jsx)(V,{fontSize:`xs`,color:`fg.muted`,p:2,children:`No output fields yet. Drag a pill from a Steps card, or a selection from the content pane, onto this list; or pick values and they show up above as proposals; or add a field by hand.`}),(0,F.jsx)(mw,{gap:2,children:Object.entries(l.fields).map(([e,t])=>(0,F.jsx)(I9,{name:e,field:t,target:e,input:d,record:ee,rejected:r,scopeIds:E,hoveredStepId:C,onHoverStepId:w,setRule:ne,onFieldChange:t=>{k(e,t)},onRename:t=>{te(e,t)},onRemove:()=>{k(e,void 0)},onExplainMissing:s===void 0?void 0:()=>{s(_,e)},onExplainRejected:c===void 0?void 0:()=>{let t=r.findIndex(t=>t.field===e);t!==-1&&c(t)}},e))})]}),(0,F.jsx)(I,{children:(0,F.jsx)(ew,{size:`xs`,variant:`outline`,onClick:A,children:`+ field`})})]})}function F9(e){let t=typeof e.step.id==`string`?[e.step.id]:[];return e.kind===`bracket`?[...t,...e.children.flatMap(e=>F9(e)),...(e.elseChildren??[]).flatMap(e=>F9(e))]:t}function I9({name:e,field:t,target:n,input:r,record:i,rejected:a,scopeIds:o,depth:s=0,hoveredStepId:c,onHoverStepId:l,setRule:u,onFieldChange:d,onRename:f,onRemove:p,onExplainMissing:m,onExplainRejected:h}){if(t.type===`object`&&t.fields!==void 0)return(0,F.jsxs)(mw,{gap:1,children:[(0,F.jsx)(E9,{name:e,field:t,scopeIds:o,depth:s,onFieldChange:d,onRename:f,onRemove:p,onRuleChange:()=>{}}),Object.entries(t.fields).map(([e,f])=>(0,F.jsx)(I9,{name:e,field:f,target:`${n}.${e}`,input:r,record:i,rejected:a,scopeIds:o,depth:s+1,hoveredStepId:c,onHoverStepId:l,setRule:u,onFieldChange:n=>{d({...t,fields:{...t.fields,[e]:n}})},onRename:n=>{let r={},i=Object.entries(t.fields??{});for(let[t,a]of i)r[t===e?n:t]=a;d({...t,fields:r})},onRemove:()=>{let n={...t.fields};delete n[e],d({...t,fields:n})}},e))]});if(t.type===`array`&&t.items?.type===`object`&&t.items.fields!==void 0){let i=r.mapping[n],a=C9(i)?i:void 0,f=t.items,p=f.fields;return(0,F.jsxs)(mw,{gap:1,borderWidth:`1px`,borderRadius:`md`,p:2,ml:s*5,children:[(0,F.jsxs)(W,{gap:2,children:[(0,F.jsx)(V,{fontWeight:`medium`,fontSize:`sm`,children:e}),(0,F.jsx)(V,{fontSize:`xs`,color:`fg.muted`,children:`each`}),(0,F.jsx)(Rw,{size:`xs`,width:`140px`,placeholder:`list id (e.g. items)`,value:a?.each??``,onChange:e=>{u(n,e.target.value===``?void 0:{each:e.target.value,fields:a?.fields??{}})}})]}),Object.entries(p).map(([e,r])=>{let i=a?.fields[e],m=typeof i?.from==`string`?i.from:void 0;return(0,F.jsx)(E9,{name:e,field:r,rule:i,scopeIds:o,depth:s+1,stepId:m,highlighted:m!==void 0&&m===c,onHoverStepId:l,onFieldChange:n=>{d({...t,items:{...f,fields:{...p,[e]:n}}})},onRename:n=>{let r={};for(let[t,i]of Object.entries(p))r[t===e?n:t]=i;d({...t,items:{...f,fields:r}})},onRemove:()=>{let n={...p};delete n[e],d({...t,items:{...f,fields:n}})},onRuleChange:t=>{let r={...a?.fields};t===void 0?delete r[e]:r[e]=t,u(n,{each:a?.each??``,fields:r})}},e)})]})}let g=r.mapping[n],_=g===void 0||C9(g)?void 0:g,v=i?.data[e],y=i?.mapping?.[n],b=a.filter(e=>e.field===n),x=typeof _?.from==`string`?_.from:void 0;return(0,F.jsx)(E9,{name:e,field:t,rule:_,scopeIds:o,trace:y,value:v,missing:v===null,rejected:b.length===0?void 0:{count:b.length,reason:b[b.length-1].reason},depth:s,stepId:x,highlighted:x!==void 0&&x===c,onHoverStepId:l,onFieldChange:d,onRename:f,onRemove:p,onRuleChange:e=>{u(n,e)},onExplainMissing:m,onExplainRejected:h})}function L9(e){if(e.trim()===``)return{ok:!1};try{return{ok:!0,value:JSON.parse(e)}}catch{return{ok:!1}}}function Zae(e){let t={};for(let[n,r]of Object.entries(e)){if(!r.enabled)continue;let e=L9(r.text);e.ok&&(t[n]=e.value)}return Object.keys(t).length===0?void 0:t}var R9=sD(e=>({entries:{},setEnabled:(t,n)=>{e(e=>({entries:{...e.entries,[t]:{text:e.entries[t]?.text??`null`,enabled:n}}}))},setText:(t,n)=>{e(e=>({entries:{...e.entries,[t]:{enabled:e.entries[t]?.enabled??!1,text:n}}}))}})),Qae={hook:`hook`,captcha:`captcha solver`,access:`access plugin`};function $ae({remote:e}){let t=R9(e=>e.entries),n=R9(e=>e.setEnabled),r=R9(e=>e.setText);return e.length===0?null:(0,F.jsxs)(mw,{gap:1,mt:1,"data-testid":`hook-stubs`,children:[(0,F.jsx)(V,{fontSize:`xs`,children:`These call outside this machine: a sample run waits for them, and they may cost.`}),e.map(e=>{let i=t[e.name],a=e.kind===`hook`,o=i?.text??`null`,s=i?.enabled??!1,c=L9(o).ok;return(0,F.jsxs)(W,{gap:2,wrap:`wrap`,"data-testid":`remote-${e.name}`,children:[(0,F.jsx)(V,{fontSize:`xs`,children:`${Qae[e.kind]} ${e.name} → ${e.label}`}),a&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(aw,{size:`xs`,checked:s,onCheckedChange:t=>{n(e.name,t.checked===!0)},children:[(0,F.jsx)(lw,{}),(0,F.jsx)(cw,{}),(0,F.jsx)(ow,{children:`stub ${e.name}`})]}),(0,F.jsx)(Rw,{size:`xs`,width:`220px`,fontFamily:`mono`,"aria-label":`stub value of ${e.name}`,"aria-invalid":!c,value:o,onChange:t=>{r(e.name,t.target.value)}}),!c&&(0,F.jsx)(V,{fontSize:`xs`,color:`red.fg`,children:`not JSON: the hook is called`})]})]},`${e.kind}:${e.name}`)})]})}var eoe=/^[a-z0-9][a-z0-9-]*$/,toe=`https://example.com`;function z9(e){if(e.trim()!==``)try{let{protocol:t}=new URL(e.trim());return t===`http:`||t===`https:`?void 0:`use an http:// or https:// address`}catch{return`use a full address, like https://example.com/books`}}function B9(e,t,n=toe){return V9(e,t,{mode:`web`,start:[{url:n}],steps:[{type:`goto`,url:`{{start.url}}`},{type:`emit`}]})}function noe(e,t,n,r){return V9(e,t,{mode:`api`,start:[{url:n}],steps:[{type:`request`,id:`doc`,url:`{{start.url}}`,as:r}]})}function roe(e,t,n){return V9(e,t,{mode:`api`,start:[{url:n}],steps:[{type:`request`,id:`doc`,url:`{{start.url}}`}]})}function V9(e,t,n){let r=e.endsWith(`/`)?e.slice(0,-1):e;return{outputPath:`${r}/${t}.ocw-out.json`,output:{kind:`output`,id:t,version:1,fields:{}},inputPath:`${r}/${t}.ocw-in.json`,input:{kind:`input`,id:t,output:t,...n,mapping:{}}}}function H9(e){let t=e.replace(/\.[^.]+$/,``).toLowerCase().split(/[^a-z0-9]+/).filter(e=>e!==``).join(`-`);return t===``?`document`:t}var ioe=new Set([`www`,`en`,`uk`,`com`,`co`,`org`,`net`,`gov`,`edu`,`io`,`eu`,`us`,`de`,`fr`,`es`,`it`,`nl`,`info`,`app`,`dev`]);function aoe(e){let t;try{t=new URL(e)}catch{return`document`}let n=t.hostname.split(`.`).filter(e=>!ioe.has(e)).slice(0,2),r=t.pathname.split(`/`).filter(e=>e!==``).map(e=>e.replace(/\.[^.]+$/,``)),i=r.length===0?void 0:r[r.length-1],a=r.length<2?void 0:r[r.length-2],o=i===void 0?[]:a!==void 0&&/^\d+$/.test(i)?[a,i]:[i];return H9([...n,...o].join(` `)).slice(0,48).replace(/-$/,``)}function U9(e,t){let n=new Set(t);if(!n.has(e))return e;for(let t=2;;t+=1)if(!n.has(`${e}-${t}`))return`${e}-${t}`}function ooe({folder:e,open:t,onClose:n,onCreated:r}){let[i,a]=(0,P.useState)(``),[o,s]=(0,P.useState)(``),[c,l]=(0,P.useState)(),u=dO(),d=i.length===0?void 0:W9(i),f=z9(o);function p(){n(),a(``),s(``),l(void 0)}async function m(){if(e===void 0||W9(i)!==void 0||z9(o)!==void 0)return;l(void 0);let t=B9(e,i,o.trim()===``?void 0:o.trim());try{await u.mutateAsync({path:t.outputPath,recipe:t.output}),await u.mutateAsync({path:t.inputPath,recipe:t.input}),r(i),p()}catch(e){l(e instanceof Error?e.message:String(e))}}return(0,F.jsx)(_w,{open:t,onOpenChange:e=>{e.open||p()},children:(0,F.jsxs)(v_,{children:[(0,F.jsx)(Sw,{}),(0,F.jsx)(vw,{children:(0,F.jsxs)(yw,{children:[(0,F.jsxs)(ww,{display:`flex`,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,children:[(0,F.jsx)(bw,{children:`New recipe`}),(0,F.jsx)(xw,{asChild:!0,children:(0,F.jsx)(dw,{size:`sm`,"aria-label":`Close`})})]}),(0,F.jsxs)(Cw,{display:`flex`,flexDirection:`column`,gap:3,pb:4,children:[(0,F.jsxs)(Mw,{invalid:d!==void 0,children:[(0,F.jsx)(Nw,{children:`Recipe id`}),(0,F.jsx)(Rw,{size:`sm`,placeholder:`books`,value:i,onChange:e=>{a(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&m()}}),d!==void 0&&(0,F.jsx)(Fw,{children:d})]}),(0,F.jsxs)(Mw,{invalid:f!==void 0,children:[(0,F.jsx)(Nw,{children:`Start URL (optional)`}),(0,F.jsx)(Rw,{size:`sm`,placeholder:`https://example.com/books`,value:o,onChange:e=>{s(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&m()}}),f!==void 0&&(0,F.jsx)(Fw,{children:f})]}),(0,F.jsxs)(V,{fontSize:`xs`,color:`fg.muted`,children:[`Writes `,(0,F.jsxs)(V,{as:`span`,fontFamily:`mono`,children:[i||`<id>`,`.ocw-in.json`]}),` and`,` `,(0,F.jsxs)(V,{as:`span`,fontFamily:`mono`,children:[i||`<id>`,`.ocw-out.json`]})," into the open folder: a `web` recipe with one page and no fields mapped yet, ready to build out in the Steps tab."]}),c!==void 0&&(0,F.jsx)(V,{color:`fg.error`,fontSize:`sm`,children:c}),(0,F.jsx)(ew,{size:`sm`,colorPalette:`brand`,alignSelf:`flex-end`,onClick:()=>{m()},disabled:e===void 0||i.length===0||d!==void 0||f!==void 0||u.isPending,loading:u.isPending,children:`Create`})]})]})})]})})}function W9(e){return eoe.test(e)?void 0:`lowercase letters, digits and hyphens, starting with a letter or digit`}function G9(e){return[...e.dataTransfer.types].includes(`Files`)}function soe(e){G9(e)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`)}function coe({onFile:e,children:t,...n}){let[r,i]=(0,P.useState)(0),a=r>0;function o(e){G9(e)&&(e.preventDefault(),i(e=>e+1))}function s(e){G9(e)&&i(e=>Math.max(0,e-1))}function c(t){if(!G9(t))return;t.preventDefault(),i(0);let n=t.dataTransfer.files[0];n!==void 0&&e(n)}return(0,F.jsxs)(I,{position:`relative`,"data-testid":`document-drop-zone`,onDragEnter:o,onDragOver:soe,onDragLeave:s,onDrop:c,...n,children:[t,a&&(0,F.jsx)(I,{role:`status`,position:`absolute`,inset:0,zIndex:`overlay`,display:`flex`,alignItems:`center`,justifyContent:`center`,bg:`brand.subtle/80`,borderWidth:`3px`,borderStyle:`dashed`,borderColor:`brand.solid`,pointerEvents:`none`,children:(0,F.jsx)(V,{fontSize:`lg`,fontWeight:`semibold`,color:`brand.fg`,children:`Drop to load this file`})})]})}function K9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function loe(e){let t=Array.isArray(e.steps)?e.steps[0]:void 0;return e.mode===`api`&&K9(t)&&t.type===`request`&&t.url===`{{start.url}}`}function uoe(e,t){if(!K9(e)||e.kind!==`input`||!Array.isArray(e.start))return{kind:`new`};let[n,...r]=e.start;if(!K9(n)||!(t.kind===`document`?loe(e):e.mode===`web`))return{kind:`new`};let i=typeof n.url==`string`?n.url:void 0;return{kind:`replace`,recipe:{...e,start:[{...n,url:t.url},...r]},previous:i}}function doe(e){if(e!==void 0)try{return JSON.parse(e)}catch{return}}function q9(e,t){return e.kind===`document`?t:e.url}function J9(){let e=LT(),t=dO();return async(n,r,i)=>{let{openFolder:a,selectedRecipeId:o}=G.getState(),s=a===void 0?void 0:e.getQueryData(QD(a))?.recipes.find(e=>e.id===o),c=uoe(doe(s?.text),n);if(sO(),s!==void 0&&c.kind===`replace`)return await t.mutateAsync({path:s.file,recipe:c.recipe}),`Loaded ${q9(n,r)} into “${s.id??s.file}”${c.previous===void 0?``:`, replacing ${c.previous}`}.`;if(await i(),s!==void 0)return`“${s.id??s.file}” reads ${n.kind===`document`?`a web page`:`a document`}, so ${q9(n,r)} started a new recipe instead. “${s.id??s.file}” is unchanged.`}}var foe={ods:{what:`an OpenDocument spreadsheet`,instead:`Open it in Excel or LibreOffice, save it as .xlsx or .csv, and load that file.`},odt:{what:`an OpenDocument text document`,instead:`Open it in Word or LibreOffice, save it as .docx or .pdf, and load that file.`},odp:{what:`an OpenDocument presentation`,instead:`Open it in PowerPoint or LibreOffice, save it as .pptx or .pdf, and load that file.`},rtf:{what:`a Rich Text document`,instead:`Open it in Word, save it as .docx or .pdf, and load that file.`},pages:{what:`an Apple Pages document`,instead:`Export it from Pages as .pdf or .docx, and load that file.`},numbers:{what:`an Apple Numbers spreadsheet`,instead:`Export it from Numbers as .xlsx or .csv, and load that file.`},key:{what:`an Apple Keynote presentation`,instead:`Export it from Keynote as .pptx or .pdf, and load that file.`},zip:{what:`a compressed archive`,instead:`Unpack it and load the file you want from inside.`},rar:{what:`a compressed archive`,instead:`Unpack it and load the file you want from inside.`},"7z":{what:`a compressed archive`,instead:`Unpack it and load the file you want from inside.`},png:{what:`a picture`,instead:`The Studio reads text, tables and data, not pictures. If it is a scan, use the text version of the document.`},jpg:{what:`a picture`,instead:`The Studio reads text, tables and data, not pictures. If it is a scan, use the text version of the document.`},jpeg:{what:`a picture`,instead:`The Studio reads text, tables and data, not pictures. If it is a scan, use the text version of the document.`},gif:{what:`a picture`,instead:`The Studio reads text, tables and data, not pictures.`}};function Y9(e){let t=/\.([a-z0-9]+)$/i.exec(e.split(/[?#]/,1)[0])?.[1]?.toLowerCase(),n=t===void 0?void 0:foe[t];if(n!==void 0)return`“${e.split(/[\\/]/).pop()??e}” is ${n.what}, which the Studio cannot read yet. ${n.instead}`}function X9(){let e=XD(),t=dO(),n=G(e=>e.commitFolder),r=G(e=>e.selectRecipe);return async(i,a,o)=>{let s=(await e.openWorkspace(i)).recipes.map(e=>e.id).filter(e=>e!==void 0),c=U9(H9(a),s),l=roe(i,c,o);await t.mutateAsync({path:l.outputPath,recipe:l.output}),await t.mutateAsync({path:l.inputPath,recipe:l.input}),G.getState().openFolder!==i&&n(i),r(c)}}function poe(){let e=pO(),t=X9(),n=J9(),r=G(e=>e.folder),i=G(e=>e.openFolder),[a,o]=(0,P.useState)(),[s,c]=(0,P.useState)(!1),[l,u]=(0,P.useState)();async function d(a){let s=(i??r).trim();if(s===``){o(`Type a workspace folder in the toolbar first, then drop the file again: that is where the copy and the recipe go.`);return}let l=Y9(a.name);if(l!==void 0){o(l);return}o(void 0),u(void 0),c(!0);try{let{url:r}=await e.mutateAsync({folder:s,name:a.name,bytes:await moe(a)});u(await n({kind:`document`,url:r},a.name,async()=>{await t(s,a.name,r)}))}catch(e){o(e instanceof Error?e.message:String(e))}finally{c(!1)}}return{importFile:d,pending:s,error:a,notice:l}}function moe(e){return new Promise((t,n)=>{let r=new FileReader;r.addEventListener(`error`,()=>{n(r.error??Error(`could not read ${e.name}`))}),r.addEventListener(`load`,()=>{let e=String(r.result);t(e.slice(e.indexOf(`,`)+1))}),r.readAsDataURL(e)})}function hoe(e){return e.slice(Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`))+1)}function goe(){let e=XD(),t=G(e=>e.commitFolder),n=G(e=>e.selectRecipe),r=X9(),[i,a]=(0,P.useState)();return(0,P.useEffect)(()=>{let i=e.initialOpen;if(i===void 0)return;let o=()=>{let e=new URLSearchParams(globalThis.location.search);e.delete(`open`),globalThis.history.replaceState({},``,`${globalThis.location.pathname}?${e.toString()}`)};(async()=>{try{let a=await e.openPath(i,e.initialFolder);a.kind===`document`?await r(a.folder,hoe(a.path),a.url):(t(a.folder),a.kind===`recipe`&&a.recipeId!==void 0&&n(a.recipeId))}catch(e){a(e instanceof Error?e.message:String(e))}finally{o()}})()},[]),i}function _oe({open:e,onClose:t,onLoad:n}){let[r,i]=(0,P.useState)(``),a=r.trim()===``?void 0:z9(r),o=r.trim()!==``&&a===void 0;function s(){i(``),t()}function c(){o&&(n(r.trim()),s())}return(0,F.jsx)(_w,{open:e,onOpenChange:e=>{e.open||s()},children:(0,F.jsxs)(v_,{children:[(0,F.jsx)(Sw,{}),(0,F.jsx)(vw,{children:(0,F.jsxs)(yw,{children:[(0,F.jsxs)(ww,{display:`flex`,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,children:[(0,F.jsx)(bw,{children:`Load a web page`}),(0,F.jsx)(xw,{asChild:!0,children:(0,F.jsx)(dw,{size:`sm`,"aria-label":`Close`})})]}),(0,F.jsxs)(Cw,{display:`flex`,flexDirection:`column`,gap:3,pb:4,children:[(0,F.jsxs)(Mw,{invalid:a!==void 0,children:[(0,F.jsx)(Nw,{children:`Page address`}),(0,F.jsx)(Rw,{size:`sm`,placeholder:`https://example.com/books`,value:r,onChange:e=>{i(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&c()}}),a!==void 0&&(0,F.jsx)(Fw,{children:a}),(0,F.jsx)(Pw,{children:`Becomes the open recipe's start page, or a new recipe when none reads a web page.`})]}),(0,F.jsx)(ew,{size:`sm`,colorPalette:`brand`,alignSelf:`flex-end`,disabled:!o,onClick:c,children:`Load`})]})]})})]})})}function voe(){let e=XD(),t=dO(),n=J9(),r=G(e=>e.folder),i=G(e=>e.openFolder),a=G(e=>e.commitFolder),o=G(e=>e.selectRecipe),[s,c]=(0,P.useState)(!1),[l,u]=(0,P.useState)(),[d,f]=(0,P.useState)();async function p(n,r){let i=(await e.openWorkspace(n)).recipes.map(e=>e.id).filter(e=>e!==void 0),{kind:s}=await e.detectUrl(r),c=U9(aoe(r),i),l=s===`html`||s===`unknown`?B9(n,c,r):noe(n,c,r,s);await t.mutateAsync({path:l.outputPath,recipe:l.output}),await t.mutateAsync({path:l.inputPath,recipe:l.input}),G.getState().openFolder!==n&&a(n),o(c)}async function m(e){let t=(i??r).trim();if(t===``){u(`Open a workspace folder first (Recipe ▾ → Open folder…): that is where the recipe is written.`);return}let a=Y9(e.trim());if(a!==void 0){u(a);return}u(void 0),f(void 0),c(!0);try{let r=e.trim();f(await n({kind:`url`,url:r},r,async()=>{await p(t,r)}))}catch(e){u(e instanceof Error?e.message:String(e))}finally{c(!1)}}return{loadUrl:m,pending:s,error:l,notice:d}}function yoe(){let e=globalThis.opencrawDesktop;return typeof e?.chooseFolder==`function`?{chooseFolder:e.chooseFolder}:void 0}function boe({hooks:e}){return e===void 0?null:(0,F.jsxs)(I,{px:4,py:1,bg:`orange.subtle`,color:`orange.fg`,fontSize:`sm`,"data-testid":`hooks-bar`,children:[`Hooks loaded from ${e.source} (runs as your code): ${e.names.length===0?`none exported`:e.names.join(`, `)}`,e.remote!==void 0&&(0,F.jsx)($ae,{remote:e.remote})]})}function xoe(){let e=XD(),t=G(e=>e.commitFolder),[n,r]=(0,P.useState)(!1),[i,a]=(0,P.useState)();async function o(){a(void 0),r(!0);try{let n=await e.chooseFolder();return n===void 0?`cancelled`:(t(n),`picked`)}catch(e){return a(e instanceof Error?e.message:String(e)),`unavailable`}finally{r(!1)}}return{browse:o,pending:n,error:i}}function Z9({label:e,title:t,disabled:n,loading:r,items:i}){let[a,o]=(0,P.useState)(!1),s=(0,P.useRef)(null);return(0,P.useEffect)(()=>{if(!a)return;let e=e=>{if(e instanceof KeyboardEvent){e.key===`Escape`&&o(!1);return}s.current!==null&&!s.current.contains(e.target)&&o(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,e)}},[a]),(0,F.jsxs)(I,{ref:s,position:`relative`,flexShrink:0,children:[(0,F.jsx)(ew,{size:`sm`,variant:`outline`,maxW:`16em`,title:t,disabled:n,loading:r,"aria-haspopup":`menu`,"aria-expanded":a,onClick:()=>{o(e=>!e)},children:(0,F.jsx)(I,{as:`span`,display:`block`,truncate:!0,maxW:`15em`,title:e,children:e})}),a&&(0,F.jsx)(I,{role:`menu`,position:`absolute`,top:`100%`,left:0,mt:1,zIndex:`dropdown`,minW:`14em`,py:1,bg:`bg`,borderWidth:`1px`,borderRadius:`md`,boxShadow:`md`,children:i.map(e=>(0,F.jsxs)(I,{children:[e.divider===!0&&(0,F.jsx)(I,{borderTopWidth:`1px`,my:1}),e.heading!==void 0&&(0,F.jsx)(I,{px:3,py:1,fontSize:`xs`,color:`fg.muted`,children:e.heading}),(0,F.jsx)(I,{as:`button`,role:`menuitem`,display:`block`,w:`full`,textAlign:`left`,px:3,py:1,fontSize:`sm`,cursor:e.disabled===!0?`not-allowed`:`pointer`,opacity:e.disabled===!0?.5:1,_hover:e.disabled===!0?void 0:{bg:`bg.muted`},"aria-disabled":e.disabled===!0,onClick:()=>{e.disabled!==!0&&(o(!1),e.onSelect())},children:e.label})]},e.label))})]})}function Soe({loading:e,onLoadDocument:t,onLoadUrl:n}){return(0,F.jsx)(Z9,{label:`Load ▾`,title:`Bring in the document or page the recipe reads (a file can also be dropped anywhere)`,disabled:e,loading:e,items:[{label:`Document…`,onSelect:t},{label:`Web page (URL)…`,onSelect:n}]})}function Coe({open:e,onClose:t,folder:n,onFolderChange:r,onOpen:i,onBrowse:a,browsing:o}){function s(){n.trim()!==``&&(i(),t())}return(0,F.jsx)(_w,{open:e,onOpenChange:e=>{e.open||t()},children:(0,F.jsxs)(v_,{children:[(0,F.jsx)(Sw,{}),(0,F.jsx)(vw,{children:(0,F.jsxs)(yw,{children:[(0,F.jsxs)(ww,{display:`flex`,flexDirection:`row`,alignItems:`center`,justifyContent:`space-between`,children:[(0,F.jsx)(bw,{children:`Open folder`}),(0,F.jsx)(xw,{asChild:!0,children:(0,F.jsx)(dw,{size:`sm`,"aria-label":`Close`})})]}),(0,F.jsxs)(Cw,{display:`flex`,flexDirection:`column`,gap:3,pb:4,children:[(0,F.jsx)(Rw,{size:`sm`,placeholder:`recipe folder`,value:n,onChange:e=>{r(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&s()}}),(0,F.jsxs)(V,{fontSize:`xs`,color:`fg.muted`,children:[`A folder of `,(0,F.jsx)(V,{as:`span`,fontFamily:`mono`,children:`.ocw-in.json`}),` and `,(0,F.jsx)(V,{as:`span`,fontFamily:`mono`,children:`.ocw-out.json`}),` recipes, or an empty one to start in.`]}),(0,F.jsxs)(W,{justifyContent:`flex-end`,children:[a!==void 0&&(0,F.jsx)(ew,{size:`sm`,variant:`outline`,onClick:a,disabled:o,loading:o,title:`Pick the folder in the operating system dialog`,children:`Browse…`}),(0,F.jsx)(ew,{size:`sm`,colorPalette:`brand`,onClick:s,disabled:n.trim()===``,children:`Open`})]})]})]})})]})})}function woe({inputs:e,selectedRecipeId:t,hasFolder:n,onSelectRecipe:r,onNewRecipe:i,onOpenFolder:a}){let o=e.length===0?[{label:n?`No recipes in this folder`:`Open a folder first`,onSelect:()=>{},disabled:!0,heading:`Open recipe`}]:e.map((e,n)=>{let i=e.id??e.file;return{label:i===t?`✓ ${i}`:i,onSelect:()=>{r(i)},...n===0&&{heading:`Open recipe`}}});return(0,F.jsx)(Z9,{label:t===void 0?`Recipe ▾`:`Recipe: ${t} ▾`,title:`Open, create or switch the recipe being edited`,items:[...o,{label:`New recipe…`,onSelect:i,disabled:!n,divider:!0},{label:`Open folder…`,onSelect:a}]})}function Toe(){let e=ite()>0;return(0,F.jsx)(V,{role:`status`,fontSize:`sm`,color:`fg.muted`,flexShrink:0,children:e?`Saving…`:`All changes saved`})}var Eoe=`.pdf,.xlsx,.xlsm,.xls,.csv,.tsv,.pptx,.docx,.md,.markdown,.html,.htm,.json,.jsonl,.yaml,.yml,.xml`;function Doe(e){return/[^/\\]+(?=[/\\]*$)/u.exec(e)?.[0]??``}function Ooe({folder:e,onFolderChange:t,onOpen:n,onChooseFolder:r,onBrowse:i,browsing:a,openFolder:o,inputs:s,selectedRecipeId:c,onSelectRecipe:l,onRecipeCreated:u,onImportFile:d,onLoadUrl:f,importing:p,running:m,onRunSample:h,onStop:g,onClear:_}){let v=(0,P.useRef)(null),[y,b]=(0,P.useState)(!1),[x,S]=(0,P.useState)(!1),[C,w]=(0,P.useState)(!1);return(0,F.jsxs)(W,{gap:2,p:2,borderBottomWidth:`1px`,wrap:`wrap`,children:[(0,F.jsx)(ste,{}),(0,F.jsx)(woe,{inputs:s,selectedRecipeId:c,hasFolder:o!==void 0,onSelectRecipe:l,onNewRecipe:()=>{b(!0)},onOpenFolder:()=>{r===void 0?i===void 0?w(!0):i().then(e=>{e===`unavailable`&&w(!0)}):r()}}),(0,F.jsx)(Soe,{loading:p,onLoadDocument:()=>{v.current?.click()},onLoadUrl:()=>{S(!0)}}),(0,F.jsx)(`input`,{ref:v,type:`file`,accept:Eoe,"aria-label":`Load document`,hidden:!0,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t!==void 0&&d(t)}}),o!==void 0&&(0,F.jsx)(V,{fontSize:`sm`,color:`fg.muted`,truncate:!0,maxW:`14em`,title:o,children:Doe(o)}),(0,F.jsx)(Toe,{}),(0,F.jsxs)(W,{gap:2,flexShrink:0,ml:`auto`,children:[(0,F.jsx)(hte,{}),(0,F.jsx)(ew,{size:`sm`,colorPalette:`brand`,onClick:h,disabled:c===void 0||m,loading:m,children:`Run sample`}),(0,F.jsx)(ew,{size:`sm`,variant:`outline`,onClick:g,disabled:!m,children:`Stop`}),(0,F.jsx)(ew,{size:`sm`,variant:`ghost`,onClick:_,disabled:m,title:`Clear the records, trace and selection left from the last source`,children:`Clear`})]}),(0,F.jsx)(ooe,{folder:o,open:y,onClose:()=>{b(!1)},onCreated:u}),(0,F.jsx)(_oe,{open:x,onClose:()=>{S(!1)},onLoad:f}),(0,F.jsx)(Coe,{open:C,onClose:()=>{w(!1)},folder:e,onFolderChange:t,onOpen:n,onBrowse:i===void 0?void 0:()=>{i()},browsing:a})]})}var koe=8e3;function Aoe(){let[e]=(0,P.useState)(()=>ZD());return(0,F.jsx)(RT,{client:e,children:(0,F.jsx)(nn,{value:ote,children:(0,F.jsx)(joe,{})})})}function joe(){let e=XD();Pte(),pte();let t=G(e=>e.folder),n=G(e=>e.openFolder),r=G(e=>e.selectedRecipeId),i=G(e=>e.editorTab),a=G(e=>e.setFolder),o=G(e=>e.commitFolder),s=G(e=>e.selectRecipe),c=G(e=>e.setEditorTab),l=G(e=>e.hoveredStepId),u=G(e=>e.setHoveredStepId),[d,f]=(0,P.useState)([70,30]),[p,m]=(0,P.useState)([50,50]),h=$D(n),g=lO(),_=cO(),v=oO(e=>e.running),y=oO(e=>e.error),b=Mte(),x=R9(e=>e.entries),S=Nte(),C=dO(),w=jte(),T=Lte(),E=poe(),D=voe(),ee=xoe(),O=goe();(0,P.useEffect)(()=>{e.initialFolder!==void 0&&o(e.initialFolder)},[]),(0,P.useEffect)(()=>{if(r!==void 0||h.data===void 0)return;let e=h.data.recipes.find(e=>e.kind===`input`);e?.id!==void 0&&s(e.id)},[h.data,r,s]);let k=(0,P.useMemo)(()=>{if(_!==void 0&&_.kind===`input`)try{let e=JSON.parse(_.text).output;return h.data?.recipes.find(t=>t.kind===`output`&&t.id===e)}catch{return}},[_,h.data]),te=(0,P.useMemo)(()=>{if(_===void 0||_.kind!==`input`)return{};try{let e=JSON.parse(_.text).mapping;return e===void 0?{}:Nae(e)}catch{return{}}},[_]),ne=Object.keys(te).find(e=>te[e]===l&&l!==void 0),re=(0,P.useMemo)(()=>yoe(),[]),ie=re===void 0?void 0:()=>{re.chooseFolder()},A=e=>{T.mutate(e)},ae=O??E.error??D.error??ee.error??Q9(h.error)??(y===void 0?void 0:KD(y)),oe=E.notice??D.notice,[se,ce]=(0,P.useState)();(0,P.useEffect)(()=>{if(oe===void 0)return;let e=setTimeout(()=>{ce(oe)},koe);return()=>{clearTimeout(e)}},[oe]);let j=oe===se?void 0:oe;return(0,F.jsx)(Ek.Provider,{value:h.data?.hooks?.names,children:(0,F.jsxs)(coe,{onFile:e=>{E.importFile(e)},h:`100vh`,display:`flex`,flexDirection:`column`,children:[(0,F.jsx)(Ooe,{folder:t,onFolderChange:a,onOpen:()=>{o(t)},onChooseFolder:ie,onBrowse:ee.browse,browsing:ee.pending,openFolder:n,inputs:g,selectedRecipeId:r,onSelectRecipe:s,onRecipeCreated:s,onImportFile:e=>{E.importFile(e)},onLoadUrl:e=>{D.loadUrl(e)},importing:E.pending||D.pending,running:v,onRunSample:()=>{r!==void 0&&b.mutate({recipeId:r,stubs:Zae(x)})},onStop:()=>{S.mutate()},onClear:()=>{sO(),T.reset()}}),(0,F.jsx)(boe,{hooks:h.data?.hooks}),j!==void 0&&ae===void 0&&(0,F.jsx)(I,{role:`status`,px:4,py:1,bg:`brand.subtle`,color:`brand.fg`,fontSize:`sm`,children:j}),ae!==void 0&&(0,F.jsx)(I,{px:4,py:1,bg:`red.subtle`,color:`red.fg`,fontSize:`sm`,children:ae}),(0,F.jsxs)(lT,{orientation:`vertical`,panels:[{id:`workspace`,minSize:20},{id:`preview`,minSize:10}],size:d,onResize:e=>{f(e.size)},flex:`1`,minH:`0`,children:[(0,F.jsx)(uT,{id:`workspace`,overflow:`hidden`,children:(0,F.jsxs)(lT,{panels:[{id:`content`,minSize:20},{id:`editor`,minSize:20}],size:p,onResize:e=>{m(e.size)},h:`full`,children:[(0,F.jsx)(uT,{id:`content`,overflow:`auto`,children:(0,F.jsx)(HG,{recipe:_,onSaveOutline:async(e,t)=>{await w.mutateAsync({path:e,outline:t})},onSaveRecipe:async(e,t)=>{await C.mutateAsync({path:e,recipe:t})}})}),(0,F.jsx)(pT,{id:`content:editor`}),(0,F.jsxs)(uT,{id:`editor`,overflow:`hidden`,display:`flex`,flexDirection:`column`,children:[(0,F.jsxs)(W,{gap:1,px:2,pt:2,borderBottomWidth:`1px`,flexShrink:0,children:[(0,F.jsx)($9,{label:`Steps`,active:i===`steps`,onClick:()=>{c(`steps`)}}),(0,F.jsx)($9,{label:`Record`,active:i===`record`,onClick:()=>{c(`record`)},switchOnDrag:!0}),(0,F.jsx)($9,{label:`JSON`,active:i===`json`,onClick:()=>{c(`json`)}}),i===`steps`&&(0,F.jsx)(I,{ml:`auto`,pb:1,children:(0,F.jsx)(yte,{})})]}),(0,F.jsxs)(I,{flex:`1`,minH:`0`,overflow:`auto`,children:[i===`steps`&&(0,F.jsx)(oH,{recipe:_,onSaveOutline:async(e,t)=>{await w.mutateAsync({path:e,outline:t})}}),i===`record`&&(0,F.jsx)(Moe,{inputRecipe:_,outputRecipe:k,onSaveInput:async(e,t)=>{await C.mutateAsync({path:e,recipe:t})},onSaveOutput:async(e,t)=>{await C.mutateAsync({path:e,recipe:t})},onSaveOutline:async(e,t)=>{await w.mutateAsync({path:e,outline:t})},onExplainMissing:r===void 0?void 0:(e,t)=>{A({kind:`missing`,recipeId:r,recordIndex:e,field:t})},onExplainRejected:r===void 0?void 0:e=>{A({kind:`rejected`,recipeId:r,rejectedIndex:e})}}),i===`json`&&(0,F.jsx)(fae,{recipe:_,onSave:async(e,t)=>{await C.mutateAsync({path:e,recipe:t})}})]})]})]})}),(0,F.jsx)(pT,{id:`workspace:preview`}),(0,F.jsx)(uT,{id:`preview`,overflow:`hidden`,borderTopWidth:`1px`,children:(0,F.jsx)(Noe,{onExplainMissing:r===void 0?void 0:(e,t)=>{A({kind:`missing`,recipeId:r,recordIndex:e,field:t})},onExplainRejected:r===void 0?void 0:e=>{A({kind:`rejected`,recipeId:r,rejectedIndex:e})},whyLoading:T.isPending,whyView:T.data,whyError:Q9(T.error),highlightedField:ne,onHoverField:e=>{u(e===void 0?void 0:te[e])}})})]})]})})}function Moe(e){let t=oO(e=>e.records),n=oO(e=>e.rejected);return(0,F.jsx)(Xae,{...e,records:t,rejected:n})}function Noe(e){let t=oO(e=>e.records),n=oO(e=>e.rejected),r=oO(e=>e.traceLines);return(0,F.jsx)(Aae,{...e,records:t,traceLines:r,rejected:n})}function Q9(e){if(e!=null)return KD(e instanceof Error?e.message:String(e))}function Poe(e){let t=new Set(e.dataTransfer.types);return t.has(`application/x-opencraw-pill`)||t.has(`application/x-opencraw-card`)}var Foe=450;function $9({label:e,active:t,onClick:n,switchOnDrag:r=!1}){let i=(0,P.useRef)(void 0),a=()=>{i.current!==void 0&&clearTimeout(i.current),i.current=void 0},o=e=>{r&&!t&&Poe(e)&&(e.preventDefault(),i.current??=setTimeout(()=>{i.current=void 0,n()},Foe))};return(0,F.jsx)(V,{as:`button`,px:3,py:1,fontSize:`sm`,fontWeight:t?`semibold`:`normal`,color:t?`fg`:`fg.muted`,borderBottomWidth:`2px`,borderColor:t?`colorPalette.solid`:`transparent`,colorPalette:`brand`,cursor:`pointer`,onClick:n,onDragEnter:o,onDragOver:o,onDragLeave:a,onDrop:a,children:e})}nt.createRoot(document.getElementById(`root`)).render((0,F.jsx)(P.StrictMode,{children:(0,F.jsx)(Aoe,{})}));export{NW as t};