frameboard 0.25.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +667 -207
- package/dist/client/assets/index-DevfxYLc.js +114 -0
- package/dist/client/assets/index-DqicY-g0.css +2 -0
- package/dist/client/index.html +2 -2
- package/package.json +10 -2
- package/dist/client/assets/index-BL6hzziB.css +0 -2
- package/dist/client/assets/index-BPHCKLmi.js +0 -114
|
@@ -0,0 +1,114 @@
|
|
|
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,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var L=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function R(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,L)}catch(e){L(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function z(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else R(z.bind(null,e))}var B={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=B,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=z,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=R,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),m=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),P=Symbol.for(`react.consumer`),F=Symbol.for(`react.context`),I=Symbol.for(`react.forward_ref`),L=Symbol.for(`react.suspense`),R=Symbol.for(`react.suspense_list`),z=Symbol.for(`react.memo`),B=Symbol.for(`react.lazy`),V=Symbol.for(`react.activity`),ee=Symbol.for(`react.legacy_hidden`),te=Symbol.for(`react.memo_cache_sentinel`),ne=Symbol.for(`react.view_transition`),re=Symbol.for(`react.recoverable`),H=Symbol.iterator;function U(e){return typeof e!=`object`||!e?null:(e=H&&e[H]||e[`@@iterator`],typeof e==`function`?e:null)}var ie=Symbol.for(`react.client.reference`);function ae(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ie?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case L:return`Suspense`;case R:return`SuspenseList`;case V:return`Activity`;case ne:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case F:return e.displayName||`Context`;case P:return(e._context.displayName||`Context`)+`.Consumer`;case I:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case z:return t=e.displayName||null,t===null?ae(e.type)||`Memo`:t;case B:t=e._payload,e=e._init;try{return ae(e(t))}catch{}}return null}var oe=Array.isArray,W=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},le=[],ue=-1;function de(e){return{current:e}}function fe(e){0>ue||(e.current=le[ue],le[ue]=null,ue--)}function pe(e,t){ue++,le[ue]=e.current,e.current=t}var me=de(null),he=de(null),ge=de(null),_e=de(null);function ve(e,t){switch(pe(ge,t),pe(he,e),pe(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?fp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=fp(t),e=pp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}fe(me),pe(me,e)}function ye(){fe(me),fe(he),fe(ge)}function G(e){var t=e.memoizedState;t!==null&&(lh._currentValue=t.memoizedState,pe(_e,e)),t=me.current;var n=pp(t,e.type);t!==n&&(pe(he,e),pe(me,n))}function be(e){he.current===e&&(fe(me),fe(he)),_e.current===e&&(fe(_e),lh._currentValue=ce)}var xe,Se;function Ce(e){if(xe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);xe=t&&t[1]||``,Se=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+xe+e+Se}var we=!1;function Te(e,t){if(!e||we)return``;we=!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{we=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ce(n):``}function Ee(e,t){switch(e.tag){case 26:case 27:case 5:return Ce(e.type);case 16:return Ce(`Lazy`);case 13:return e.child!==t&&t!==null?Ce(`Suspense Fallback`):Ce(`Suspense`);case 19:return Ce(`SuspenseList`);case 0:case 15:return Te(e.type,!1);case 11:return Te(e.type.render,!1);case 1:return Te(e.type,!0);case 31:return Ce(`Activity`);case 30:return Ce(`ViewTransition`);default:return``}}function De(e){try{var t=``,n=null;do t+=Ee(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var Oe=Object.prototype.hasOwnProperty,ke=t.unstable_scheduleCallback,Ae=t.unstable_cancelCallback,je=t.unstable_shouldYield,Me=t.unstable_requestPaint,Ne=t.unstable_now,Pe=t.unstable_getCurrentPriorityLevel,Fe=t.unstable_ImmediatePriority,Ie=t.unstable_UserBlockingPriority,Le=t.unstable_NormalPriority,Re=t.unstable_LowPriority,ze=t.unstable_IdlePriority,Be=t.log,Ve=t.unstable_setDisableYieldValue,K=null,He=null;function Ue(e){if(typeof Be==`function`&&Ve(e),He&&typeof He.setStrictMode==`function`)try{He.setStrictMode(K,e)}catch{}}var We=Math.clz32?Math.clz32:qe,Ge=Math.log,Ke=Math.LN2;function qe(e){return e>>>=0,e===0?32:31-(Ge(e)/Ke|0)|0}var Je=256,Ye=262144,Xe=4194304;function Ze(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 Qe(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=Ze(n))):i=Ze(o):i=Ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ze(n))):i=Ze(o)):i=Ze(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 $e(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function et(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-We(n),i=1<<r;t|=e[r],n&=~i}return t}function tt(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 nt(){var e=Xe;return Xe<<=1,!(Xe&62914560)&&(Xe=4194304),e}function rt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function it(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function at(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-We(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&&ot(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ot(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-We(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function st(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-We(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ct(e,t){var n=t&-t;return n=n&42?1:lt(n),(n&(e.suspendedLanes|t))===0?n:0}function lt(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 ut(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function dt(){var e=se.p;return e===0?(e=window.event,e===void 0?32:Th(e.type)):e}function ft(e,t){var n=se.p;try{return se.p=e,t()}finally{se.p=n}}var pt=Math.random().toString(36).slice(2),mt=`__reactFiber$`+pt,ht=`__reactProps$`+pt,gt=`__reactContainer$`+pt,_t=`__reactEvents$`+pt,vt=`__reactListeners$`+pt,yt=`__reactHandles$`+pt,bt=`__reactResources$`+pt,xt=`__reactMarker$`+pt,St=`__reactLoad$`+pt;function Ct(e){delete e[mt],delete e[ht],delete e[vt],delete e[yt]}function wt(e){var t;if(t=e[mt])return t;for(var n=e.parentNode;n;){if(t=n[gt]||n[mt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mm(e);e!==null;){if(n=e[mt])return n;e=mm(e)}return t}e=n,n=e.parentNode}return null}function Tt(e){if(e=e[mt]||e[gt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Et(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Dt(e){var t=e[bt];return t||=e[bt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Ot(e){e[xt]=!0}function kt(e){e[St]=void 0}var At=new Set,jt={};function Mt(e,t){Nt(e,t),Nt(e+`Capture`,t)}function Nt(e,t){for(jt[e]=t,e=0;e<t.length;e++)At.add(t[e])}var Pt=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]*$`),Ft={},It={};function Lt(e){return Oe.call(It,e)?!0:Oe.call(Ft,e)?!1:Pt.test(e)?It[e]=!0:(Ft[e]=!0,!1)}var Rt=!1;function zt(){var e=Rt;return Rt=!1,e}function Bt(e,t,n){if(Lt(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 Vt(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 Ht(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 Ut(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Wt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Gt(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 Kt(e){if(!e._valueTracker){var t=Wt(e)?`checked`:`value`;e._valueTracker=Gt(e,t,``+e[t])}}function qt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Wt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Jt=/[\n"\\]/g;function Yt(e){return e.replace(Jt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Xt(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=``+Ut(t)):e.value!==``+Ut(t)&&(e.value=``+Ut(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Qt(e,Ut(n)):o===`number`&&e.value==t?Qt(e,Ut(e.value)):Qt(e,Ut(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=``+Ut(s):e.removeAttribute(`name`)}function Zt(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)){Kt(e);return}n=n==null?``:``+Ut(n),t=t==null?n:``+Ut(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),Kt(e)}function Qt(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function $t(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=``+Ut(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 en(e,t,n){t!=null&&(t=``+Ut(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Ut(n)}function tn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(oe(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Ut(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Kt(e)}function nn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var rn=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 an(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||rn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function on(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]=``,Rt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(an(e,a,r),Rt=!0)}else for(var o in t)t.hasOwnProperty(o)&&an(e,o,t[o])}function sn(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 cn=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`]]),ln=/^[\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 un(e){return ln.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function dn(){}var fn=null;function pn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mn=null,hn=null;function gn(e){var t=Tt(e);if(t&&(e=t.stateNode)){var n=e[ht]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Xt(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="`+Yt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ht]||null;if(!a)throw Error(i(90));Xt(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&&qt(r)}break a;case`textarea`:en(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&$t(e,!!n.multiple,t,!1)}}}var _n=!1;function vn(e,t,n){if(_n)return e(t,n);_n=!0;try{return e(t)}finally{if(_n=!1,(mn!==null||hn!==null)&&(Rd(),mn&&(t=mn,e=hn,hn=mn=null,gn(t),e)))for(t=0;t<e.length;t++)gn(e[t])}}function yn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ht]||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 bn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,xn=!1;if(bn)try{var Sn={};Object.defineProperty(Sn,"passive",{get:function(){xn=!0}}),window.addEventListener(`test`,Sn,Sn),window.removeEventListener(`test`,Sn,Sn)}catch{xn=!1}var Cn=null,wn=null,Tn=null;function En(){if(Tn)return Tn;var e,t=wn,n=t.length,r,i=`value`in Cn?Cn.value:Cn.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 Tn=i.slice(e,1<r?1-r:void 0)}function Dn(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 On(){return!0}function kn(){return!1}function An(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)?On:kn,this.isPropagationStopped=kn,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=On)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=On)},persist:function(){},isPersistent:On}),t}var jn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Mn=An(jn),Nn=D({},jn,{view:0,detail:0}),Pn=An(Nn),Fn,In,Ln,Rn=D({},Nn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yn,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!==Ln&&(Ln&&e.type===`mousemove`?(Fn=e.screenX-Ln.screenX,In=e.screenY-Ln.screenY):In=Fn=0,Ln=e),Fn)},movementY:function(e){return`movementY`in e?e.movementY:In}}),zn=An(Rn),Bn=An(D({},Rn,{dataTransfer:0})),Vn=An(D({},Nn,{relatedTarget:0})),Hn=An(D({},jn,{animationName:0,elapsedTime:0,pseudoElement:0})),Un=An(D({},jn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Wn=An(D({},jn,{data:0})),Gn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Kn={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`},qn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Jn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=qn[e])?!!t[e]:!1}function Yn(){return Jn}var Xn=An(D({},Nn,{key:function(e){if(e.key){var t=Gn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Dn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Kn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yn,charCode:function(e){return e.type===`keypress`?Dn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Dn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Zn=An(D({},Rn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Qn=An(D({},jn,{submitter:0})),$n=An(D({},Nn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yn})),er=An(D({},jn,{propertyName:0,elapsedTime:0,pseudoElement:0})),tr=An(D({},Rn,{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})),nr=An(D({},jn,{newState:0,oldState:0,source:0})),rr=[9,13,27,32],ir=bn&&`CompositionEvent`in window,ar=null;bn&&`documentMode`in document&&(ar=document.documentMode);var or=bn&&`TextEvent`in window&&!ar,sr=bn&&(!ir||ar&&8<ar&&11>=ar),cr=` `,lr=!1;function ur(e,t){switch(e){case`keyup`:return rr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function dr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var fr=!1;function pr(e,t){switch(e){case`compositionend`:return dr(t);case`keypress`:return t.which===32?(lr=!0,cr):null;case`textInput`:return e=t.data,e===cr&&lr?null:e;default:return null}}function mr(e,t){if(fr)return e===`compositionend`||!ir&&ur(e,t)?(e=En(),Tn=wn=Cn=null,fr=!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 sr&&t.locale!==`ko`?null:t.data;default:return null}}var hr={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 gr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!hr[e.type]:t===`textarea`}function _r(e,t,n,r){mn?hn?hn.push(r):hn=[r]:mn=r,t=Yf(t,`onChange`),0<t.length&&(n=new Mn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var vr=null,yr=null;function br(e){Vf(e,0)}function xr(e){if(qt(Et(e)))return e}function Sr(e,t){if(e===`change`)return t}var Cr=!1;if(bn){var wr;if(bn){var Tr=`oninput`in document;if(!Tr){var Er=document.createElement(`div`);Er.setAttribute(`oninput`,`return;`),Tr=typeof Er.oninput==`function`}wr=Tr}else wr=!1;Cr=wr&&(!document.documentMode||9<document.documentMode)}function Dr(){vr&&(vr.detachEvent(`onpropertychange`,Or),yr=vr=null)}function Or(e){if(e.propertyName===`value`&&xr(yr)){var t=[];_r(t,yr,e,pn(e)),vn(br,t)}}function kr(e,t,n){e===`focusin`?(Dr(),vr=t,yr=n,vr.attachEvent(`onpropertychange`,Or)):e===`focusout`&&Dr()}function Ar(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return xr(yr)}function jr(e,t){if(e===`click`)return xr(t)}function Mr(e,t){if(e===`input`||e===`change`)return xr(t)}function Nr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Pr=typeof Object.is==`function`?Object.is:Nr;function Fr(e,t){if(Pr(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(!Oe.call(t,i)||!Pr(e[i],t[i]))return!1}return!0}function Ir(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 Lr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Rr(e,t){var n=Lr(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=Lr(n)}}function zr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?zr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Br(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ir(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=Ir(e.document)}return t}function Vr(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 Hr=bn&&`documentMode`in document&&11>=document.documentMode,Ur=null,Wr=null,Gr=null,Kr=!1;function qr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Kr||Ur==null||Ur!==Ir(r)||(r=Ur,`selectionStart`in r&&Vr(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}),Gr&&Fr(Gr,r)||(Gr=r,r=Yf(Wr,`onSelect`),0<r.length&&(t=new Mn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Ur)))}function Jr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Yr={animationend:Jr(`Animation`,`AnimationEnd`),animationiteration:Jr(`Animation`,`AnimationIteration`),animationstart:Jr(`Animation`,`AnimationStart`),transitionrun:Jr(`Transition`,`TransitionRun`),transitionstart:Jr(`Transition`,`TransitionStart`),transitioncancel:Jr(`Transition`,`TransitionCancel`),transitionend:Jr(`Transition`,`TransitionEnd`)},Xr={},Zr={};bn&&(Zr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Yr.animationend.animation,delete Yr.animationiteration.animation,delete Yr.animationstart.animation),`TransitionEvent`in window||delete Yr.transitionend.transition);function Qr(e){if(Xr[e])return Xr[e];if(!Yr[e])return e;var t=Yr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Zr)return Xr[e]=t[n];return e}var $r=Qr(`animationend`),ei=Qr(`animationiteration`),ti=Qr(`animationstart`),ni=Qr(`transitionrun`),ri=Qr(`transitionstart`),ii=Qr(`transitioncancel`),ai=Qr(`transitionend`),oi=new Map,si=`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(` `);si.push(`scrollEnd`);function ci(e,t){oi.set(e,t),Mt(t,[e])}var li=0;function ui(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=yd.identifierPrefix;var n=li++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function di(e){if(e==null||typeof e==`string`)return e;var t=null,n=Dd;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 fi(e,t){return e=di(e),t=di(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var pi=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)},mi=[],hi=0,gi=0;function _i(){for(var e=hi,t=gi=hi=0;t<e;){var n=mi[t];mi[t++]=null;var r=mi[t];mi[t++]=null;var i=mi[t];mi[t++]=null;var a=mi[t];if(mi[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&&xi(n,i,a)}}function vi(e,t,n,r){mi[hi++]=e,mi[hi++]=t,mi[hi++]=n,mi[hi++]=r,gi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function yi(e,t,n,r){return vi(e,t,n,r),Si(e)}function bi(e,t){return vi(e,null,null,t),Si(e)}function xi(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-We(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Si(e){if(50<Od)throw Od=0,kd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ci={};function wi(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 Ti(e,t,n,r){return new wi(e,t,n,r)}function Ei(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Di(e,t){var n=e.alternate;return n===null?(n=Ti(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 Oi(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 ki(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Ei(r)&&(s=1);else if(typeof r==`string`)s=Ym(e,n,me.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case V:return e=Ti(31,n,t,a),e.elementType=V,e.lanes=o,e;case j:return Ai(n.children,a,o,t);case M:s=8,a|=24;break;case N:return e=Ti(12,n,t,a|2),e.elementType=N,e.lanes=o,e;case L:return e=Ti(13,n,t,a),e.elementType=L,e.lanes=o,e;case R:return e=Ti(19,n,t,a),e.elementType=R,e.lanes=o,e;case ee:case ne:return e=a|32,e=Ti(30,n,t,e),e.elementType=ne,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:s=10;break a;case P:s=9;break a;case I:s=11;break a;case z:s=14;break a;case B:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ti(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ai(e,t,n,r){return e=Ti(7,e,r,t),e.lanes=n,e}function ji(e,t,n){return e=Ti(6,e,null,t),e.lanes=n,e}function Mi(e){var t=Ti(18,null,null,0);return t.stateNode=e,t}function Ni(e,t,n){return t=Ti(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Pi=new WeakMap;function Fi(e,t){if(typeof e==`object`&&e){var n=Pi.get(e);return n===void 0?(t={value:e,source:t,stack:De(t)},Pi.set(e,t),t):n}return{value:e,source:t,stack:De(t)}}var Ii=[],Li=0,Ri=null,zi=0,Bi=[],Vi=0,Hi=null,Ui=1,Wi=``;function Gi(e,t){Ii[Li++]=zi,Ii[Li++]=Ri,Ri=e,zi=t}function Ki(e,t,n){Bi[Vi++]=Ui,Bi[Vi++]=Wi,Bi[Vi++]=Hi,Hi=e;var r=Ui;e=Wi;var i=32-We(r)-1;r&=~(1<<i),n+=1;var a=32-We(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ui=1<<32-We(t)+i|n<<i|r,Wi=a+e}else Ui=1<<a|n<<i|r,Wi=e}function qi(e){e.return!==null&&(Gi(e,1),Ki(e,1,0))}function Ji(e){for(;e===Ri;)Ri=Ii[--Li],Ii[Li]=null,zi=Ii[--Li],Ii[Li]=null;for(;e===Hi;)Hi=Bi[--Vi],Bi[Vi]=null,Wi=Bi[--Vi],Bi[Vi]=null,Ui=Bi[--Vi],Bi[Vi]=null}function Yi(e,t){Bi[Vi++]=Ui,Bi[Vi++]=Wi,Bi[Vi++]=Hi,Ui=t.id,Wi=t.overflow,Hi=e}var Xi=null,Zi=null,Qi=!1,$i=null,ea=!1,ta=Error(i(519));function na(e){throw ca(Fi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ta}function ra(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[mt]=e,t[ht]=r,n){case`dialog`:Hf(`cancel`,t),Hf(`close`,t);break;case`iframe`:case`object`:case`embed`:Hf(`load`,t);break;case`video`:case`audio`:for(n=0;n<zf.length;n++)Hf(zf[n],t);break;case`source`:Hf(`error`,t);break;case`img`:case`image`:case`link`:Hf(`error`,t),Hf(`load`,t);break;case`details`:Hf(`toggle`,t);break;case`input`:Hf(`invalid`,t),Zt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Hf(`invalid`,t);break;case`textarea`:Hf(`invalid`,t),tn(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||tp(t.textContent,n)?(r.popover!=null&&(Hf(`beforetoggle`,t),Hf(`toggle`,t)),r.onScroll!=null&&Hf(`scroll`,t),r.onScrollEnd!=null&&Hf(`scrollend`,t),r.onClick!=null&&(t.onclick=dn),t=!0):t=!1,t||na(e,!0)}function ia(e){for(Xi=e.return;Xi;)switch(Xi.tag){case 5:case 31:case 13:ea=!1;return;case 27:case 3:ea=!0;return;default:Xi=Xi.return}}function aa(e){if(e!==Xi)return!1;if(!Qi)return ia(e),Qi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||hp(e.type,e.memoizedProps)),n=!n),n&&Zi&&na(e),ia(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Zi=pm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Zi=pm(e)}else t===27?(t=Zi,wp(e.type)?(e=fm,fm=null,Zi=e):Zi=t):Zi=Xi?dm(e.stateNode.nextSibling):null;return!0}function oa(){Zi=Xi=null,Qi=!1}function sa(){var e=$i;return e!==null&&(dd===null?dd=e:dd.push.apply(dd,e),$i=null),e}function ca(e){$i===null?$i=[e]:$i.push(e)}var la=de(null),ua=null,da=null;function fa(e,t,n){pe(la,t._currentValue),t._currentValue=n}function pa(e){e._currentValue=la.current,fe(la)}function ma(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 ha(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),ma(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),ma(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),ma(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 ga(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;Pr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===_e.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[lh]:e.push(lh))}a=a.return}return e!==null&&ha(t,e,n,r),t.flags|=262144,e!==null}function _a(e){for(e=e.firstContext;e!==null;){if(!Pr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function va(e){ua=e,da=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ya(e){return xa(ua,e)}function ba(e,t){return ua===null&&va(e),xa(e,t)}function xa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},da===null){if(e===null)throw Error(i(308));da=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else da=da.next=t;return n}var Sa=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()})}},Ca=t.unstable_scheduleCallback,wa=t.unstable_NormalPriority,Ta={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ea(){return{controller:new Sa,data:new Map,refCount:0}}function Da(e){e.refCount--,e.refCount===0&&Ca(wa,function(){e.controller.abort()})}function Oa(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 ka=null;function Aa(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var ja=null,Ma=0,Na=0,Pa=null;function Fa(e,t){if(ja===null){var n=ja=[];Ma=0,Na=Pf(),Pa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ma++,t.then(Ia,Ia),t}function Ia(){if(--Ma===0&&(ka=null,ja!==null)){Pa!==null&&(Pa.status=`fulfilled`);var e=ja;ja=null,Na=0,Pa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function La(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 Ra=W.S;W.S=function(e,t){if(md=Ne(),typeof t==`object`&&t&&typeof t.then==`function`&&Fa(e,t),ka!==null)for(var n=bf;n!==null;)Oa(n,ka),n=n.next;if(n=e.types,n!==null){for(var r=bf;r!==null;)Oa(r,n),r=r.next;if(Na!==0){r=ka,r===null&&(r=ka=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ra!==null&&Ra(e,t)};var za=de(null);function Ba(){var e=za.current;return e===null?Yu.pooledCache:e}function Va(e,t){t===null?pe(za,za.current):pe(za,t.pool)}function Ha(){var e=Ba();return e===null?null:{parent:Ta._currentValue,pool:e}}var Ua=Error(i(460)),Wa=Error(i(474)),Ga=Error(i(542)),Ka={then:function(){}};function qa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ja(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(dn,dn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Qa(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(dn,dn);else{if(e=Yu,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,Qa(e),e}throw Xa=t,Ua}}function Ya(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Xa=e,Ua):e}}var Xa=null;function Za(){if(Xa===null)throw Error(i(459));var e=Xa;return Xa=null,e}function Qa(e){if(e===Ua||e===Ga)throw Error(i(483))}var $a=null,eo=0;function to(e){var t=eo;return eo+=1,$a===null&&($a=[]),Ja($a,e,t)}function no(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ro(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function q(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=Di(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=ji(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===j?(e=d(e,t,n.props.children,r,n.key),no(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===B&&Ya(i)===t.type)?(t=a(t,n.props),no(t,n),t.return=e,t):(t=ki(n.type,n.key,n.props,null,e.mode,r),no(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=Ni(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=Ai(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=ji(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=ki(t.type,t.key,t.props,null,e.mode,n),no(n,t),n.return=e,n;case A:return t=Ni(t,e.mode,n),t.return=e,t;case B:return t=Ya(t),f(e,t,n)}if(oe(t)||U(t))return t=Ai(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,to(t),n);if(t.$$typeof===F)return f(e,ba(e,t),n);ro(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case B:return n=Ya(n),p(e,t,n,r)}if(oe(n)||U(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,to(n),r);if(n.$$typeof===F)return p(e,t,ba(e,n),r);ro(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case B:return r=Ya(r),m(e,t,n,r,i)}if(oe(r)||U(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,to(r),i);if(r.$$typeof===F)return m(e,t,n,ba(t,r),i);ro(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),Qi&&Gi(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 Qi&&Gi(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)}),Qi&&Gi(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),Qi&&Gi(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 Qi&&Gi(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)}),Qi&&Gi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),no(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===B&&Ya(l)===r.type){n(e,r.sibling),c=a(r,o.props),no(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Ai(o.props.children,e.mode,c,o.key),no(c,o),c.return=e,e=c):(c=ki(o.type,o.key,o.props,null,e.mode,c),no(c,o),c.return=e,e=c)}return s(e);case A:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ni(o,e.mode,c),c.return=e,e=c}return s(e);case B:return o=Ya(o),_(e,r,o,c)}if(oe(o))return h(e,r,o,c);if(U(o)){if(l=U(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,to(o),c);if(o.$$typeof===F)return _(e,r,ba(e,o),c);ro(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=ji(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{eo=0;var i=_(e,t,n,r);return $a=null,i}catch(t){if(t===Ua||t===Ga)throw t;var a=Ti(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var io=q(!0),ao=q(!1),oo=!1;function so(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function co(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 lo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function uo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ju&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Si(e),xi(e,null,n),t}return vi(e,r,t,n),Si(e)}function fo(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,st(e,n)}}function po(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}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var mo=!1;function ho(){if(mo){var e=Pa;if(e!==null)throw e}}function go(e,t,n,r){mo=!1;var i=e.updateQueue;oo=!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?(Zu&f)===f:(r&f)===f){f!==0&&f===Na&&(mo=!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:oo=!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),ad|=o,e.lanes=o,e.memoizedState=d}}function _o(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function vo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)_o(n[e],t)}var yo=de(null),bo=de(0);function xo(e,t){e=rd,pe(bo,e),pe(yo,t),rd=e|t.baseLanes}function So(){pe(bo,rd),pe(yo,yo.current)}function Co(){rd=bo.current,fe(yo),fe(bo)}var wo=de(null),To=null;function Eo(e){var t=e.alternate;pe(Ao,Ao.current&1),pe(wo,e),To===null&&(t===null||yo.current!==null||t.memoizedState!==null)&&(To=e)}function Do(e){pe(Ao,Ao.current),pe(wo,e),To===null&&(To=e)}function Oo(e){e.tag===22?(pe(Ao,Ao.current),pe(wo,e),To===null&&(To=e)):ko()}function ko(){pe(Ao,Ao.current),pe(wo,wo.current)}function J(e){fe(wo),To===e&&(To=null),fe(Ao)}var Ao=de(0);function jo(e,t){pe(wo,wo.current),pe(Ao,t)}function Mo(e){fe(Ao),fe(wo),To===e&&(To=null)}function No(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||cm(n)||lm(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 Po=0,Y=null,Fo=null,Io=null,Lo=!1,Ro=!1,zo=!1,Bo=0,Vo=0,Ho=null,Uo=0;function Wo(){throw Error(i(321))}function Go(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pr(e[n],t[n]))return!1;return!0}function Ko(e,t,n,r,i,a){return Po=a,Y=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,W.H=e===null||e.memoizedState===null?cc:lc,zo=!1,a=n(r,i),zo=!1,Ro&&(a=Jo(t,n,r,i)),qo(e),a}function qo(e){W.H=sc;var t=Fo!==null&&Fo.next!==null;if(Po=0,Io=Fo=Y=null,Lo=!1,Vo=0,Ho=null,t)throw Error(i(300));e===null||Ec||(e=e.dependencies,e!==null&&_a(e)&&(Ec=!0))}function Jo(e,t,n,r){Y=e;var a=0;do{if(Ro&&(Ho=null),Vo=0,Ro=!1,25<=a)throw Error(i(301));if(a+=1,Io=Fo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}W.H=uc,o=t(n,r)}while(Ro);return o}function Yo(){var e=W.H,t=e.useState()[0];return t=typeof t.then==`function`?ns(t):t,e=e.useState()[0],(Fo===null?null:Fo.memoizedState)!==e&&(Y.flags|=1024),t}function Xo(){var e=Bo!==0;return Bo=0,e}function Zo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Qo(e){if(Lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Lo=!1}Po=0,Io=Fo=Y=null,Ro=!1,Vo=Bo=0,Ho=null}function $o(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Io===null?Y.memoizedState=Io=e:Io=Io.next=e,Io}function es(){if(Fo===null){var e=Y.alternate;e=e===null?null:e.memoizedState}else e=Fo.next;var t=Io===null?Y.memoizedState:Io.next;if(t!==null)Io=t,Fo=e;else{if(e===null)throw Y.alternate===null?Error(i(467)):Error(i(310));Fo=e,e={memoizedState:Fo.memoizedState,baseState:Fo.baseState,baseQueue:Fo.baseQueue,queue:Fo.queue,next:null},Io===null?Y.memoizedState=Io=e:Io=Io.next=e}return Io}function ts(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ns(e){var t=Vo;return Vo+=1,Ho===null&&(Ho=[]),e=Ja(Ho,e,t),t=Y,(Io===null?t.memoizedState:Io.next)===null&&(t=t.alternate,W.H=t===null||t.memoizedState===null?cc:lc),e}function rs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ns(e);if(e.$$typeof===re)return;if(e.$$typeof===F)return ya(e)}throw Error(i(438,String(e)))}function is(e){var t=null,n=Y.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Y.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=ts(),Y.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=te;return t.index++,n}function as(e,t){return typeof t==`function`?t(e):t}function os(e){return ss(es(),Fo,e)}function ss(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?(Po&f)===f:(Zu&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===Na&&(d=!0);else if((Po&p)===p){u=u.next,p===Na&&(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,Y.lanes|=p,ad|=p;f=u.action,zo&&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,Y.lanes|=f,ad|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Pr(o,e.memoizedState)&&(Ec=!0,d&&(n=Pa,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 cs(e){var t=es(),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);Pr(o,t.memoizedState)||(Ec=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ls(e,t,n){var r=Y,a=es(),o=Qi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Pr((Fo||a).memoizedState,n);if(s&&(a.memoizedState=n,Ec=!0),a=a.queue,Ps(fs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Io!==null&&!!(Io.memoizedState.tag&1),ks(e?9:8,{destroy:void 0},ds.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Yu===null)throw Error(i(349));o||Po&127||us(r,t,n)}return n}function us(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Y.updateQueue,t===null?(t=ts(),Y.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ds(e,t,n,r){t.value=n,t.getSnapshot=r,ps(t)&&ms(e)}function fs(e,t,n){return n(function(){ps(t)&&ms(e)})}function ps(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pr(e,n)}catch{return!0}}function ms(e){var t=bi(e,2);t!==null&&Nd(t,e,2)}function hs(e){var t=$o();if(typeof e==`function`){var n=e;if(e=n(),zo){Ue(!0);try{n()}finally{Ue(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:e},t}function gs(e,t,n,r){return e.baseState=n,ss(e,Fo,typeof r==`function`?r:as)}function _s(e,t,n,r,a){if(ic(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)}};W.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,vs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function vs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=W.T,o={};o.types=a===null?null:a.types,W.T=o;try{var s=n(i,r),c=W.S;c!==null&&c(o,s),ys(e,t,s)}catch(n){xs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),W.T=a}}else try{a=n(i,r),ys(e,t,a)}catch(n){xs(e,t,n)}}function ys(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){bs(e,t,n)},function(n){return xs(e,t,n)}):bs(e,t,n)}function bs(e,t,n){t.status=`fulfilled`,t.value=n,Ss(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,vs(e,n)))}function xs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ss(t),t=t.next;while(t!==r)}e.action=null}function Ss(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Cs(e,t){return t}function ws(e,t){if(Qi){var n=Yu.formState;if(n!==null){a:{var r=Y;if(Qi){if(Zi){b:{for(var i=Zi,a=ea;i.nodeType!==8;)if(!a||(i=dm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Zi=dm(i.nextSibling),r=i.data===`F!`;break a}}na(r)}r=!1}r&&(t=n[0])}}return n=$o(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cs,lastRenderedState:t},n.queue=r,n=tc.bind(null,Y,r),r.dispatch=n,r=hs(!1),a=rc.bind(null,Y,!1,r.queue),r=$o(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=_s.bind(null,Y,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ts(e){return Es(es(),Fo,e)}function Es(e,t,n){if(t=ss(e,t,Cs)[0],e=os(as)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ns(t)}catch(e){throw e===Ua?Ga:e}else r=t;t=es();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Y.flags|=2048,ks(9,{destroy:void 0},Ds.bind(null,i,n),null)),[r,a,e]}function Ds(e,t){e.action=t}function Os(e){var t=es(),n=Fo;if(n!==null)return Es(t,n,e);es(),t=t.memoizedState,n=es();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ks(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Y.updateQueue,t===null&&(t=ts(),Y.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 As(){return es().memoizedState}function js(e,t,n,r){var i=$o();Y.flags|=e,i.memoizedState=ks(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ms(e,t,n,r){var i=es();r=r===void 0?null:r;var a=i.memoizedState.inst;Fo!==null&&r!==null&&Go(r,Fo.memoizedState.deps)?i.memoizedState=ks(t,a,n,r):(Y.flags|=e,i.memoizedState=ks(1|t,a,n,r))}function Ns(e,t){js(8390656,8,e,t)}function Ps(e,t){Ms(2048,8,e,t)}function X(e){Y.flags|=4;var t=Y.updateQueue;if(t===null)t=ts(),Y.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Fs(e){var t=es().memoizedState;return X({ref:t,nextImpl:e}),function(){if(Ju&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Is(e,t){return Ms(4,2,e,t)}function Ls(e,t){return Ms(4,4,e,t)}function Rs(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 zs(e,t,n){n=n==null?null:n.concat([e]),Ms(4,4,Rs.bind(null,t,e),n)}function Bs(){}function Vs(e,t){var n=es();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Go(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Hs(e,t){var n=es();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Go(t,r[1]))return r[0];if(r=e(),zo){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r}function Us(e,t,n){return n===void 0||Po&1073741824&&!(Zu&261930)?e.memoizedState=t:(e.memoizedState=n,e=jd(),Y.lanes|=e,ad|=e,n)}function Ws(e,t,n,r){return Pr(n,t)?n:yo.current===null?!(Po&106)||Po&1073741824&&!(Zu&261930)?(Ec=!0,e.memoizedState=n):(e=jd(),Y.lanes|=e,ad|=e,t):(e=Us(e,n,r),Pr(e,t)||(Ec=!0),e)}function Gs(e,t,n,r,i){var a=se.p;se.p=a!==0&&8>a?a:8;var o=W.T,s={};s.types=o===null?null:o.types,W.T=s,rc(e,!1,t,n);try{var c=i(),l=W.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?nc(e,t,La(c,r),Ad(e)):nc(e,t,r,Ad(e))}catch(n){nc(e,t,{then:function(){},status:`rejected`,reason:n},Ad())}finally{se.p=a,o!==null&&s.types!==null&&(o.types=s.types),W.T=o}}function Ks(){}function qs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Js(e).queue;Gs(e,a,t,ce,n===null?Ks:function(){return Ys(e),n(r)})}function Js(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:ce},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ys(e){var t=Js(e);t.next===null&&(t=e.alternate.memoizedState),nc(e,t.next.queue,{},Ad())}function Xs(){return ya(lh)}function Zs(){return es().memoizedState}function Qs(){return es().memoizedState}function $s(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ad();e=lo(n);var r=uo(t,e,n);r!==null&&(Nd(r,t,n),fo(r,t,n)),t={cache:Ea()},e.payload=t;return}t=t.return}}function ec(e,t,n){var r=Ad();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ic(e)?ac(t,n):(n=yi(e,t,n,r),n!==null&&(Nd(n,e,r),oc(n,t,r)))}function tc(e,t,n){nc(e,t,n,Ad())}function nc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ic(e))ac(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,Pr(s,o))return vi(e,t,i,0),Yu===null&&_i(),!1}catch{}if(n=yi(e,t,i,r),n!==null)return Nd(n,e,r),oc(n,t,r),!0}return!1}function rc(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ic(e)){if(t)throw Error(i(479))}else t=yi(e,n,r,2),t!==null&&Nd(t,e,2)}function ic(e){var t=e.alternate;return e===Y||t!==null&&t===Y}function ac(e,t){Ro=Lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function oc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,st(e,n)}}var sc={readContext:ya,use:rs,useCallback:Wo,useContext:Wo,useEffect:Wo,useImperativeHandle:Wo,useLayoutEffect:Wo,useInsertionEffect:Wo,useMemo:Wo,useReducer:Wo,useRef:Wo,useState:Wo,useDebugValue:Wo,useDeferredValue:Wo,useTransition:Wo,useSyncExternalStore:Wo,useId:Wo,useHostTransitionStatus:Wo,useFormState:Wo,useActionState:Wo,useOptimistic:Wo,useMemoCache:Wo,useCacheRefresh:Wo,useEffectEvent:Wo},cc={readContext:ya,use:rs,useCallback:function(e,t){return $o().memoizedState=[e,t===void 0?null:t],e},useContext:ya,useEffect:Ns,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),js(4194308,4,Rs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return js(4194308,4,e,t)},useInsertionEffect:function(e,t){js(4,2,e,t)},useMemo:function(e,t){var n=$o();t=t===void 0?null:t;var r=e();if(zo){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=$o();if(n!==void 0){var i=n(t);if(zo){Ue(!0);try{n(t)}finally{Ue(!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=ec.bind(null,Y,e),[r.memoizedState,e]},useRef:function(e){var t=$o();return e={current:e},t.memoizedState=e},useState:function(e){e=hs(e);var t=e.queue,n=tc.bind(null,Y,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Bs,useDeferredValue:function(e,t){return Us($o(),e,t)},useTransition:function(){var e=hs(!1);return e=Gs.bind(null,Y,e.queue,!0,!1),$o().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Y,a=$o();if(Qi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Yu===null)throw Error(i(349));Zu&127||us(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ns(fs.bind(null,r,o,e),[e]),r.flags|=2048,ks(9,{destroy:void 0},ds.bind(null,r,o,n,t),null),n},useId:function(){var e=$o(),t=Yu.identifierPrefix;if(Qi){var n=Wi,r=Ui;n=(r&~(1<<32-We(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Bo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Uo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Xs,useFormState:ws,useActionState:ws,useOptimistic:function(e){var t=$o();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=rc.bind(null,Y,!0,n),n.dispatch=t,[e,t]},useMemoCache:is,useCacheRefresh:function(){return $o().memoizedState=$s.bind(null,Y)},useEffectEvent:function(e){var t=$o(),n={impl:e};return t.memoizedState=n,function(){if(Ju&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},lc={readContext:ya,use:rs,useCallback:Vs,useContext:ya,useEffect:Ps,useImperativeHandle:zs,useInsertionEffect:Is,useLayoutEffect:Ls,useMemo:Hs,useReducer:os,useRef:As,useState:function(){return os(as)},useDebugValue:Bs,useDeferredValue:function(e,t){return Ws(es(),Fo.memoizedState,e,t)},useTransition:function(){var e=os(as)[0],t=es().memoizedState;return[typeof e==`boolean`?e:ns(e),t]},useSyncExternalStore:ls,useId:Zs,useHostTransitionStatus:Xs,useFormState:Ts,useActionState:Ts,useOptimistic:function(e,t){return gs(es(),Fo,e,t)},useMemoCache:is,useCacheRefresh:Qs,useEffectEvent:Fs},uc={readContext:ya,use:rs,useCallback:Vs,useContext:ya,useEffect:Ps,useImperativeHandle:zs,useInsertionEffect:Is,useLayoutEffect:Ls,useMemo:Hs,useReducer:cs,useRef:As,useState:function(){return cs(as)},useDebugValue:Bs,useDeferredValue:function(e,t){var n=es();return Fo===null?Us(n,e,t):Ws(n,Fo.memoizedState,e,t)},useTransition:function(){var e=cs(as)[0],t=es().memoizedState;return[typeof e==`boolean`?e:ns(e),t]},useSyncExternalStore:ls,useId:Zs,useHostTransitionStatus:Xs,useFormState:Os,useActionState:Os,useOptimistic:function(e,t){var n=es();return Fo===null?(n.baseState=e,[e,n.queue.dispatch]):gs(n,Fo,e,t)},useMemoCache:is,useCacheRefresh:Qs,useEffectEvent:Fs};function dc(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 fc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ad(),i=lo(r);i.payload=t,n!=null&&(i.callback=n),t=uo(e,i,r),t!==null&&(Nd(t,e,r),fo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ad(),i=lo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=uo(e,i,r),t!==null&&(Nd(t,e,r),fo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ad(),r=lo(n);r.tag=2,t!=null&&(r.callback=t),t=uo(e,r,n),t!==null&&(Nd(t,e,n),fo(t,e,n))}};function pc(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?!Fr(n,r)||!Fr(i,a):!0}function mc(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&&fc.enqueueReplaceState(t,t.state,null)}function hc(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 gc(e){pi(e)}function _c(e){console.error(e)}function vc(e){pi(e)}function yc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function bc(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 xc(e,t,n){return n=lo(n),n.tag=3,n.payload={element:null},n.callback=function(){yc(e,t)},n}function Sc(e){return e=lo(e),e.tag=3,e}function Cc(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(){bc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){bc(t,n,r),typeof i!=`function`&&(_d===null?_d=new Set([this]):_d.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function wc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ga(t,n,a,!0),n=wo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return To===null?Gd():n.alternate===null&&id===0&&(id=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ka?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),mf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ka?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)),mf(e,r,a)),!1}throw Error(i(435,n.tag))}return mf(e,r,a),Gd(),!1}if(Qi)return t=wo.current,t===null?(r!==ta&&(t=Error(i(423),{cause:r}),ca(Fi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Fi(r,n),a=xc(e.stateNode,r,a),po(e,a),id!==4&&(id=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ta&&(e=Error(i(422),{cause:r}),ca(Fi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Fi(o,n),ud===null?ud=[o]:ud.push(o),id!==4&&(id=2),t===null)return!0;r=Fi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=xc(n.stateNode,r,e),po(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`&&(_d===null||!_d.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Sc(a),Cc(a,e,n,r),po(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Tc=Error(i(461)),Ec=!1;function Dc(e,t,n,r){t.child=e===null?ao(t,null,n,r):io(t,e.child,n,r)}function Oc(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 va(t),r=Ko(e,t,n,o,a,i),s=Xo(),e!==null&&!Ec?(Zo(e,t,i),nl(e,t,i)):(Qi&&s&&qi(t),t.flags|=1,Dc(e,t,r,i),t.child)}function kc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ei(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Ac(e,t,a,r,i)):(e=ki(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!rl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Fr:n,n(o,r)&&e.ref===t.ref)return nl(e,t,i)}return t.flags|=1,e=Di(a,r),e.ref=t.ref,e.return=t,t.child=e}function Ac(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Fr(a,r)&&e.ref===t.ref){if(Ec=!1,t.pendingProps=r=a,rl(e,i))e.flags&131072&&(Ec=!0);else return t.lanes=e.lanes,nl(e,t,i)}}return Rc(e,t,n,r,i)}function jc(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 Nc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Va(t,a===null?null:a.cachePool),a===null?So():xo(t,a),Oo(t);else return r=t.lanes=536870912,Nc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Va(t,null),So(),ko()):(Va(t,a.cachePool),xo(t,a),ko(),t.memoizedState=null);return Dc(e,t,i,n),t.child}function Mc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Nc(e,t,n,r,i){var a=Ba();return a=a===null?null:{parent:Ta._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Va(t,null),So(),Oo(t),e!==null&&ga(e,t,r,!0),t.childLanes=i,null}function Pc(e,t){return t=qc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Fc(e,t,n){return io(t,e.child,null,n),e=Pc(t,t.pendingProps),e.flags|=2,J(t),t.memoizedState=null,e}function Ic(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Qi){if(r.mode===`hidden`)return e=Pc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Mc(null,e);if(Do(t),(e=Zi)?(e=sm(e,ea),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hi===null?null:{id:Ui,overflow:Wi},retryLane:536870912,hydrationErrors:null},n=Mi(e),n.return=t,t.child=n,Xi=t,Zi=null)):e=null,e===null)throw na(t);return t.lanes=536870912,null}return Pc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Do(t),a){if(t.flags&256)t.flags&=-257,t=Fc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Ec||ga(e,t,n,!1),a=(n&e.childLanes)!==0,Ec||a){if(yo.current===null){if(r=Yu,r!==null&&(s=ct(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,bi(e,s),Nd(r,e,s),Tc;Gd()}t=Fc(e,t,n)}else e=o.treeContext,Zi=dm(s.nextSibling),Xi=t,Qi=!0,$i=null,ea=!1,e!==null&&Yi(t,e),t=Pc(t,r),t.flags|=134221824;return t}return e=Di(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Lc(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 Rc(e,t,n,r,i){return va(t),n=Ko(e,t,n,r,void 0,i),r=Xo(),e!==null&&!Ec?(Zo(e,t,i),nl(e,t,i)):(Qi&&r&&qi(t),t.flags|=1,Dc(e,t,n,i),t.child)}function zc(e,t,n,r,i,a){return va(t),t.updateQueue=null,n=Jo(t,r,n,i),qo(e),r=Xo(),e!==null&&!Ec?(Zo(e,t,a),nl(e,t,a)):(Qi&&r&&qi(t),t.flags|=1,Dc(e,t,n,a),t.child)}function Bc(e,t,n,r,i){if(va(t),t.stateNode===null){var a=Ci,o=n.contextType;typeof o==`object`&&o&&(a=ya(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=fc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},so(t),o=n.contextType,a.context=typeof o==`object`&&o?ya(o):Ci,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(dc(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&&fc.enqueueReplaceState(a,a.state,null),go(t,r,a,i),ho(),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=hc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ci,typeof u==`object`&&u&&(o=ya(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)&&mc(t,a,r,o),oo=!1;var f=t.memoizedState;a.state=f,go(t,r,a,i),ho(),l=t.memoizedState,s||f!==l||oo?(typeof d==`function`&&(dc(t,n,d,r),l=t.memoizedState),(c=oo||pc(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,co(e,t),o=t.memoizedProps,u=hc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ci,typeof l==`object`&&l&&(c=ya(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)&&mc(t,a,r,c),oo=!1,f=t.memoizedState,a.state=f,go(t,r,a,i),ho();var p=t.memoizedState;o!==d||f!==p||oo||e!==null&&e.dependencies!==null&&_a(e.dependencies)?(typeof s==`function`&&(dc(t,n,s,r),p=t.memoizedState),(u=oo||pc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&_a(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,Lc(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=io(t,e.child,null,i),t.child=io(t,null,n,i)):Dc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=nl(e,t,i),e}function Vc(e,t,n,r){return oa(),t.flags|=256,Dc(e,t,n,r),t.child}var Hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Uc(e){return{baseLanes:e,cachePool:Ha()}}function Wc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=cd),e}function Gc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Ao.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(Qi){if(i?Eo(t):ko(),(e=Zi)?(e=sm(e,ea),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hi===null?null:{id:Ui,overflow:Wi},retryLane:536870912,hydrationErrors:null},n=Mi(e),n.return=t,t.child=n,Xi=t,Zi=null)):e=null,e===null)throw na(t);return t.lanes=lm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(ko(),i=t.mode,a=qc({mode:`hidden`,children:a},i),r=Ai(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Uc(n),r.childLanes=Wc(e,o,n),t.memoizedState=Hc,Mc(null,r)):(Eo(t),Kc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Yc(e,t,a,o,r,c,s,n)}return i?(ko(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Di(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ai(i,a,n,null),i.flags|=2):i=Di(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Mc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Uc(n):(a=i.cachePool,a===null?a=Ha():(s=Ta._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Wc(e,o,n),t.memoizedState=Hc,Mc(e.child,r)):(Eo(t),n=e.child,e=n.sibling,n=Di(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 Kc(e,t){return t=qc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function qc(e,t){return e=Ti(22,e,null,t),e.lanes=0,e}function Jc(e,t,n){return io(t,e.child,null,n),e=Kc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Yc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Eo(t),t.flags&=-257,Jc(e,t,c)):t.memoizedState===null?(ko(),o=a.fallback,s=t.mode,a=qc({mode:`visible`,children:a.children},s),o=Ai(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,io(t,e.child,null,c),a=t.child,a.memoizedState=Uc(c),a.childLanes=Wc(e,r,c),t.memoizedState=Hc,Mc(null,a)):(ko(),t.child=e.child,t.flags|=128,null);if(Eo(t),lm(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,ca({value:a,source:null,stack:null})),Jc(e,t,c)}if(Ec||ga(e,t,c,!1),r=(c&e.childLanes)!==0,Ec||r){if(yo.current!==null)return Jc(e,t,c);if(r=Yu,r!==null&&(a=ct(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,bi(e,a),Nd(r,e,a),Tc;return cm(o)||Gd(),Jc(e,t,c)}return cm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,Zi=dm(o.nextSibling),Xi=t,Qi=!0,$i=null,ea=!1,e!==null&&Yi(t,e),t=Kc(t,a.children),t.flags|=134221824,t)}function Xc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ma(e.return,t,n)}function Zc(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&No(n)===null&&(t=e),e=e.sibling}return t}function Qc(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 $c(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 el(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Ao.current;if(t.flags&128)return jo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,jo(t,o),i===`backwards`&&e!==null?($c(e),Dc(e,t,r,n),$c(e)):Dc(e,t,r,n),r=Qi?zi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xc(e,n,t);else if(e.tag===19)Xc(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=Zc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,$c(t)),Qc(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&&No(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Qc(t,!0,n,null,a,r);break;case`together`:Qc(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=Zc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Qc(t,!1,i,n,a,r)}return t.child}function tl(e,t,n){var r=t.pendingProps;return fa(t,t.type,r.value),Dc(e,t,r.children,n),t.child}function nl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ad|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ga(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=Di(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Di(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function rl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&_a(e)))}function il(e,t,n){switch(t.tag){case 3:ve(t,t.stateNode.containerInfo),fa(t,Ta,e.memoizedState.cache),oa();break;case 27:case 5:G(t);break;case 4:ve(t,t.stateNode.containerInfo);break;case 10:fa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Do(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Eo(t),t.flags|=128,null;r=ga(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Gc(e,t,n):(Eo(t),e=nl(e,t,n),e===null?null:e.sibling)}Eo(t);break;case 19:if(t.flags&128)return el(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ga(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return el(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),jo(t,Ao.current),r)break;return null;case 22:return t.lanes=0,jc(e,t,n,t.pendingProps);case 24:fa(t,Ta,e.memoizedState.cache)}return nl(e,t,n)}function al(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Ec=!0;else{if(!rl(e,n)&&!(t.flags&128))return Ec=!1,il(e,t,n);Ec=!!(e.flags&131072)}}else Ec=!1,Qi&&t.flags&1048576&&Ki(t,zi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ya(t.elementType),t.type=e,typeof e==`function`)Ei(e)?(r=hc(e,r),t.tag=1,t=Bc(null,t,e,r,n)):(t.tag=0,t=Rc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===I){t.tag=11,t=Oc(null,t,e,r,n);break a}if(a===z){t.tag=14,t=kc(null,t,e,r,n);break a}if(a===F){t.tag=10,t.type=e,t=tl(null,t,n);break a}}throw t=ae(e)||e,Error(i(306,t,``))}}return t;case 0:return Rc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=hc(r,t.pendingProps),Bc(e,t,r,a,n);case 3:a:{if(ve(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,co(e,t),go(t,r,null,n);var s=t.memoizedState;if(r=s.cache,fa(t,Ta,r),r!==o.cache&&ha(t,[Ta],n,!0),ho(),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=Vc(e,t,r,n);break a}if(r!==a){a=Fi(Error(i(424)),t),ca(a),t=Vc(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(Zi=dm(e.firstChild),Xi=t,Qi=!0,$i=null,ea=!0,n=ao(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(oa(),r===a){t=nl(e,t,n);break a}Dc(e,t,r,n)}t=t.child}return t;case 26:return Lc(e,t),e===null?(n=Fm(t.type,null,t.pendingProps,null))?t.memoizedState=n:Qi||(t.stateNode=mp(t.type,t.pendingProps,ge.current,t)):t.memoizedState=Fm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return G(t),e===null&&Qi&&(r=t.stateNode=_m(t.type,t.pendingProps,ge.current),Xi=t,ea=!0,a=Zi,wp(t.type)?(fm=a,Zi=dm(r.firstChild)):Zi=a),Dc(e,t,t.pendingProps.children,n),Lc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Qi&&((a=r=Zi)&&(r=am(r,t.type,t.pendingProps,ea),r===null?a=!1:(t.stateNode=r,Xi=t,Zi=dm(r.firstChild),ea=!1,a=!0)),a||na(t)),G(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,hp(a,o)?r=null:s!==null&&hp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Ko(e,t,Yo,null,null,n),lh._currentValue=a),Lc(e,t),Dc(e,t,r,n),t.child;case 6:return e===null&&Qi&&((e=n=Zi)&&(n=om(n,t.pendingProps,ea),n===null?e=!1:(t.stateNode=n,Xi=t,Zi=null,e=!0)),e||na(t)),null;case 13:return Gc(e,t,n);case 4:return ve(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=io(t,null,r,n):Dc(e,t,r,n),t.child;case 11:return Oc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Lc(e,t),Dc(e,t,r,n),t.child;case 8:return Dc(e,t,t.pendingProps.children,n),t.child;case 12:return Dc(e,t,t.pendingProps.children,n),t.child;case 10:return tl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,va(t),a=ya(a),r=r(a),t.flags|=1,Dc(e,t,r,n),t.child;case 14:return kc(e,t,t.type,t.pendingProps,n);case 15:return Ac(e,t,t.type,t.pendingProps,n);case 19:return el(e,t,n);case 31:return Ic(e,t,n);case 22:return jc(e,t,n,t.pendingProps);case 24:return va(t),r=ya(Ta),e===null?(a=Ba(),a===null&&(a=Yu,o=Ea(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},so(t),fa(t,Ta,a)):((e.lanes&n)!==0&&(co(e,t),go(t,null,null,n),ho()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,fa(t,Ta,r),r!==a.cache&&ha(t,[Ta],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),fa(t,Ta,r))),Dc(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:Qi&&qi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Lc(e,t),Dc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ol(e){e.flags|=4}function sl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Xm(t,r):Xm(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(Hd())e.flags|=8192;else throw Xa=Ka,Wa}}else e.flags&=-16777217}function cl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Zm(t)){if(Hd())e.flags|=8192;else throw Xa=Ka,Wa}}function ll(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:nt(),e.lanes|=t,ld|=t)}function ul(e,t){if(!Qi)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 dl(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 fl(e,t,n){var r=t.pendingProps;switch(Ji(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dl(t),null;case 1:return dl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),pa(Ta),ye(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(aa(t)?ol(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,sa())),dl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ol(t),o===null?(dl(t),sl(t,a,null,r,n)):(dl(t),cl(t,o))):o?o===e.memoizedState?(dl(t),t.flags&=-16777217):(ol(t),dl(t),cl(t,o)):(e=e.memoizedProps,e!==r&&ol(t),dl(t),sl(t,a,e,r,n)),null;case 27:if(be(t),n=ge.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ol(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return dl(t),t.subtreeFlags&=-33554433,null}e=me.current,aa(t)?ra(t,e):(e=_m(a,r,n),t.stateNode=e,ol(t))}return dl(t),t.subtreeFlags&=-33554433,null;case 5:if(be(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ol(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return dl(t),t.subtreeFlags&=-33554433,null}if(o=me.current,aa(t))ra(t,o);else{var s=dp(ge.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[mt]=t,o[ht]=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(ip(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&&ol(t)}}return dl(t),t.subtreeFlags&=-33554433,sl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ol(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ge.current,aa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Xi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[mt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||tp(e.nodeValue,n)),e||na(t,!0)}else e=dp(e).createTextNode(r),e[mt]=t,t.stateNode=e}return dl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=aa(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[mt]=t}else oa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;dl(t),e=!1}else n=sa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(J(t),t):(J(t),null);if(t.flags&128)throw Error(i(558))}return dl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=aa(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[mt]=t}else oa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;dl(t),a=!1}else a=sa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(J(t),t):(J(t),null)}return J(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),ll(t,t.updateQueue),dl(t),null);case 4:return ye(),e===null&&Gf(t.stateNode.containerInfo),t.flags|=67108864,dl(t),null;case 10:return pa(t.type),dl(t),null;case 19:if(Mo(t),r=t.memoizedState,r===null)return dl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)ul(r,!1);else{if(id!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=No(e),o!==null){for(t.flags|=128,ul(r,!1),e=o.updateQueue,t.updateQueue=e,ll(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Oi(n,e),n=n.sibling;return jo(t,Ao.current&1|2),Qi&&Gi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ne()>hd&&(t.flags|=128,a=!0,ul(r,!1),t.lanes=4194304)}}else{if(!a){if(e=No(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,ll(t,e),ul(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!Qi)return dl(t),null}else 2*Ne()-r.renderingStartTime>hd&&n!==536870912&&(t.flags|=128,a=!0,ul(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=Ne(),e.sibling=null,o=Ao.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||Qi?jo(t,o):(n=o,pe(wo,t),pe(Ao,n),To===null&&(To=t)),Qi&&Gi(t,r.treeForkCount),e}return dl(t),null;case 22:case 23:return J(t),Co(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(dl(t),t.subtreeFlags&6&&(t.flags|=8192)):dl(t),n=t.updateQueue,n!==null&&ll(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&fe(za),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),pa(Ta),dl(t),null;case 25:return null;case 30:return t.flags|=33554432,dl(t),null}throw Error(i(156,t.tag))}function pl(e,t){switch(Ji(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pa(Ta),ye(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return be(t),null;case 31:if(t.memoizedState!==null){if(J(t),t.alternate===null)throw Error(i(340));oa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(J(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));oa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Mo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return ye(),null;case 10:return pa(t.type),null;case 22:case 23:return J(t),Co(),e!==null&&fe(za),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return pa(Ta),null;case 25:return null;default:return null}}function ml(e,t){switch(Ji(t),t.tag){case 3:pa(Ta),ye();break;case 26:case 27:case 5:be(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&J(t);break;case 13:J(t);break;case 19:Mo(t);break;case 10:pa(t.type);break;case 22:case 23:J(t),Co(),e!==null&&fe(za);break;case 24:pa(Ta)}}function hl(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){pf(t,t.return,e)}}function gl(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){pf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){pf(t,t.return,e)}}function _l(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{vo(t,n)}catch(t){pf(e,e.return,t)}}}function vl(e,t,n){n.props=hc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){pf(e,t,n)}}function yl(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=ui(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Ip(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Lp(e);h(e.child,!1,em,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){pf(e,t,n)}}function bl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){pf(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){pf(e,t,n)}else n.current=null}}function xl(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++)nm(e.stateNode,t[n])}function Sl(e){for(var t=e.return;t!==null&&(Tl(t)&&nm(e.stateNode,t.stateNode),!wl(t));)t=t.return}function Cl(e){for(var t=e.return;t!==null&&(Tl(t)&&rm(e.stateNode,t.stateNode),!wl(t));)t=t.return}function wl(e){return e.tag===5||e.tag===3||e.tag===27}function Tl(e){return e&&e.tag===7&&e.stateNode!==null}function El(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){pf(e,e.return,t)}}function Dl(e,t,n){try{var r=e.stateNode;op(r,e.type,n,t),r[ht]=t}catch(t){pf(e,e.return,t)}}function Ol(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wp(e.type)||e.tag===4}function kl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ol(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&&wp(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 Al(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=dn)),xl(e,r),Rt=!0;else if(i!==4&&(i===27&&(xl(e,r),r=null,wp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Al(e,t,n,r),e=e.sibling;e!==null;)Al(e,t,n,r),e=e.sibling}function jl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),xl(e,r),Rt=!0;else if(i!==4&&(i===27&&(xl(e,r),r=null,wp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(jl(e,t,n,r),e=e.sibling;e!==null;)jl(e,t,n,r),e=e.sibling}function Ml(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);ip(t,r,n),t[mt]=e,t[ht]=n}catch(t){pf(e,e.return,t)}}var Z=!1,Nl=null;function Pl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Z=!0)}var Fl=null;function Il(){var e=Fl;return Fl=null,e}var Ll=0;function Rl(e,t,n,r,i){return Ll=0,zl(e.child,t,n,r,i)}function zl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Ap(o);r.push(s),s.view&&(a=!0)}else a||Ap(o).view&&(a=!0);Z=!0,Dp(o,Ll===0?t:t+`_`+Ll,n),Ll++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||zl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Bl(e,t){for(;e!==null;)e.tag===5?Op(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Bl(e.child,t),e=e.sibling}function Vl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Vl(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=fi(t.default,t.share),t!==`none`&&(Rl(e,n,t,null,!1)||Bl(e.child,!1))}e=e.sibling}}function Hl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=ui(r,n),a=fi(r.default,n.paired?r.share:r.enter);a===`none`?Vl(e):Rl(e,i,a,null,!1)?(Vl(e),n.paired||t||Md(e,r.onEnter)):Bl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Hl(e,t),e=e.sibling;else Vl(e)}function Ul(e){if(Nl!==null&&Nl.size!==0){var t=Nl;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=fi(n.default,n.share);if(a!==`none`&&(Rl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Md(e,n.onShare)):Bl(e.child,!1)),t.delete(r),t.size===0)break}}}Ul(e)}e=e.sibling}}}function Wl(e){if(e.tag===30){var t=e.memoizedProps,n=ui(t,e.stateNode),r=Nl===null?void 0:Nl.get(n),i=fi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Rl(e,n,i,null,!1)?r===void 0?Md(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Nl.delete(n),Md(e,t.onShare)):Bl(e.child,!1)),Nl!==null&&Ul(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Wl(e),e=e.sibling;else Nl!==null&&Ul(e)}function Gl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=ui(t,e.stateNode);t=fi(t.default,t.update),e.flags&=-5,t!==`none`&&Rl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Gl(e);e=e.sibling}}function Kl(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,Bl(e.child,!1))}Kl(e)}e=e.sibling}}function ql(e){if(e.tag===30)e.stateNode.paired=null,Bl(e.child,!1),Kl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ql(e),e=e.sibling;else Kl(e)}function Jl(e){for(e=e.child;e!==null;)e.tag===30?Bl(e.child,!1):e.subtreeFlags&33554432&&Jl(e),e=e.sibling}function Yl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Ll<a.length){var l=a[Ll],u=Ap(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&&Dp(c,Ll===0?n:n+`_`+Ll,i),s&&e.flags&4||(Fl===null&&(Fl=[]),Fl.push(c,Ll===0?r:r+`_`+Ll,t.memoizedProps)),Ll++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Yl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Xl(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=ui(n,r),a=fi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(jp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Ll=0,i=Yl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Md(e,n.onUpdate))}else e.subtreeFlags&33554432&&Xl(e,t);e=e.sibling}}var Zl=!1,Ql=!1,$l=!1,eu=!1,tu=typeof WeakSet==`function`?WeakSet:Set,nu=null,ru=!1,iu=!1,au=!1,ou=!1;function su(e,t,n){if(e=e.containerInfo,lp=vh,e=Br(e),Vr(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(up={focusedElem:e,selectionRange:r},vh=!1,n=(n&335544064)===n,nu=t,t=n?9270:1024;nu!==null;){if(e=nu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Wl(r[a]);if(e.alternate===null&&e.flags&2)n&&Pl(e),cu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Wl(r),cu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Pl(e),cu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,nu=r):(n&&Gl(e),cu(n))}}Nl=null}function cu(e){for(;nu!==null;){var t=nu,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=hc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){pf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)im(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:im(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=ui(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=fi(a.default,a.update),a!==`none`&&Rl(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,nu=r;break}nu=t.return}}function lu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ku(e,n),r&4&&hl(5,n);break;case 1:if(ku(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){pf(n,n.return,e)}else{var i=hc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){pf(n,n.return,e)}}}r&64&&_l(n),r&512&&yl(n,n.return);break;case 3:if(ku(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{vo(e,t)}catch(e){pf(n,n.return,e)}}break;case 27:t===null&&r&4&&Ml(n);case 26:case 5:ku(e,n),t===null&&r&4&&El(n),r&512&&yl(n,n.return);break;case 12:ku(e,n);break;case 31:ku(e,n),r&4&&vu(e,n);break;case 13:ku(e,n),r&4&&yu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=_f.bind(null,n),um(e,n))));break;case 22:if(r=n.memoizedState!==null||Zl,!r){var a=t!==null&&t.memoizedState!==null||Ql;t=Zl,i=Ql,Zl=r,(Ql=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),ju(e,n,r)):ku(e,n),Zl=t,Ql=i}break;case 30:ku(e,n),r&512&&yl(n,n.return);break;case 7:r&512&&yl(n,n.return);default:ku(e,n)}}function uu(e,t){for(e=e.child;e!==null;)du(e,t),e=e.sibling}function du(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){pf(e,e.return,t)}fu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Rt=!0}catch(t){pf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Ep(s,!0):Ep(e.stateNode,!1)}catch(t){pf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&uu(e,t);break;default:uu(e,t)}}function fu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:du(n,r);break a;case 22:n.memoizedState===null&&fu(n,r);break a;default:fu(n,r)}}e=e.sibling}}function pu(e){var t=e.alternate;t!==null&&(e.alternate=null,pu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ct(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 mu=null,hu=!1;function gu(e,t,n){for(n=n.child;n!==null;)_u(e,t,n),n=n.sibling}function _u(e,t,n){if(He&&typeof He.onCommitFiberUnmount==`function`)try{He.onCommitFiberUnmount(K,n)}catch{}switch(n.tag){case 26:Ql||bl(n,t),gu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!Ql&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ql||bl(n,t),Cl(n);var r=mu,i=hu;wp(n.type)&&(mu=n.stateNode,hu=!1),gu(e,t,n),vm(n.stateNode,n.type,n.memoizedProps),mu=r,hu=i;break;case 5:Ql||bl(n,t),Cl(n);case 6:if(n.tag===6&&Cl(n),r=mu,i=hu,mu=null,gu(e,t,n),mu=r,hu=i,mu!==null){if(hu)try{(mu.nodeType===9?mu.body:mu.nodeName===`HTML`?mu.ownerDocument.body:mu).removeChild(n.stateNode),Rt=!0}catch(e){pf(n,t,e)}else try{mu.removeChild(n.stateNode),Rt=!0}catch(e){pf(n,t,e)}}break;case 18:mu!==null&&(hu?(e=mu,Tp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Wh(e)):Tp(mu,n.stateNode));break;case 4:r=mu,i=hu,mu=n.stateNode.containerInfo,hu=!0,gu(e,t,n),mu=r,hu=i;break;case 0:case 11:case 14:case 15:gl(2,n,t),Ql||gl(4,n,t),gu(e,t,n);break;case 1:Ql||(bl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&vl(n,t,r)),gu(e,t,n);break;case 21:gu(e,t,n);break;case 22:Ql=(r=Ql)||n.memoizedState!==null,gu(e,t,n),Ql=r;break;case 30:bl(n,t),gu(e,t,n);break;case 7:Ql||bl(n,t),gu(e,t,n);break;default:gu(e,t,n)}}function vu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wh(e)}catch(e){pf(t,t.return,e)}}}function yu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wh(e)}catch(e){pf(t,t.return,e)}}function bu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new tu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new tu),t;default:throw Error(i(435,e.tag))}}function xu(e,t){var n=bu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=vf.bind(null,e,t);t.then(r,r)}})}function Su(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(wp(l.type)){mu=l.stateNode,hu=!1;break a}break;case 5:mu=l.stateNode,hu=!1;break a;case 3:case 4:mu=l.stateNode.containerInfo,hu=!0;break a}l=l.return}if(mu===null)throw Error(i(160));_u(s,c,o),mu=null,hu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)wu(t,e,n),t=t.sibling}var Cu=null;function wu(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}Su(t,e,n),Tu(e),a&4&&(gl(3,e,e.return),hl(3,e),gl(5,e,e.return));break;case 1:Su(t,e,n),Tu(e),a&512&&(Ql||r===null||bl(r,r.return)),a&64&&Zl&&(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=Cu,Su(t,e,n),Tu(e),a&512&&(Ql||r===null||bl(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(Zl)e.stateNode=mp(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[xt]||r[mt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),ip(r,t,n),r[mt]=e,Ot(r),t=r;break a;case`link`:if(o=qm(`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),ip(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=qm(`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),ip(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[mt]=e,Ot(r),t=r}e.stateNode=t}}else Zl||Jm(o,e.type,e.stateNode)}else e.stateNode=Hm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Dl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||Ql||t.parentNode.removeChild(t)):a.count--,n===null?Zl||Jm(o,e.type,e.stateNode):Hm(o,n,e.memoizedProps))}break;case 27:Su(t,e,n),Tu(e),a&512&&(Ql||r===null||bl(r,r.return)),r!==null&&a&4&&Dl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=$l,$l=!1,Su(t,e,n),$l=o,Tu(e),a&512&&(Ql||r===null||bl(r,r.return)),e.flags&32){t=e.stateNode;try{nn(t,``),Rt=!0}catch(t){pf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Dl(e,t,r===null?t:r.memoizedProps)),a&1024&&(eu=!0);break;case 6:if(Su(t,e,n),Tu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Rt=!0}catch(t){pf(e,e.return,t)}}break;case 3:if(Rt=!1,Km=null,o=Cu,Cu=Sm(t.containerInfo),Su(t,e,n),Cu=o,Tu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Wh(t.containerInfo)}catch(t){pf(e,e.return,t)}eu&&(eu=!1,Eu(e)),Rt=!1;break;case 4:a=$l,$l=Zl,r=zt(),o=Cu,Cu=Sm(e.stateNode.containerInfo),Su(t,e,n),Tu(e),Cu=o,Rt&&iu&&(au=!0),Rt=r,$l=a;break;case 12:Su(t,e,n),Tu(e);break;case 31:Su(t,e,n),Tu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,xu(e,t)));break;case 13:Su(t,e,n),Tu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(pd=Ne()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,xu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=Zl,l=Ql,u=$l;Zl=c||o,$l=u||o,Ql=l||s,Su(t,e,n),Ql=l,$l=u,Zl=c,Tu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||Zl||Ql||(t=s||Ql,n=Zl,r=Ql,Zl=o||Zl,Ql=t,Au(e,2),Zl=n,Ql=r),!o&&$l||uu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,xu(e,n))));break;case 19:Su(t,e,n),Tu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,xu(e,t)));break;case 30:a&512&&(Ql||r===null||bl(r,r.return)),a=zt(),o=iu,s=(n&335544064)===n,c=e.memoizedProps,iu=s&&fi(c.default,c.update)!==`none`,Su(t,e,n),Tu(e),s&&r!==null&&Rt&&(e.flags|=4),iu=o,Rt=a;break;case 21:break;case 7:a&512&&(Ql||r===null||bl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Su(t,e,n),Tu(e)}}function Tu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ol(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Tl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(wl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;jl(e,kl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(nn(l,``),n.flags&=-33),jl(e,kl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Al(e,kl(e),u,s);break;default:throw Error(i(161))}}catch(t){pf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Eu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Eu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,vh=!0,t.reset(),vh=!1),e=e.sibling}}function Du(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Ou(t,e),t=t.sibling;else Xl(t,!1)}function Ou(e,t){var n=e.alternate;if(n===null)Hl(e,!1);else switch(e.tag){case 3:if(ou=ru=!1,Il(),Du(t,e),!ru&&!au){if(e=Fl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Op(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`})),ou=!0}Fl=null;break;case 5:Du(t,e);break;case 4:r=ru,ru=!1,Du(t,e),ru&&(au=!0),ru=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Du(t,e):Hl(e,!1));break;case 30:r=ru,i=Il(),ru=!1,Du(t,e),ru&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=ui(a,o),o=ui(n.memoizedProps,o);var s=fi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Ll=0,t=Yl(e,n,t,o,s,a,!0),Ll!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Md(e,e.memoizedProps.onUpdate),Fl=i):i!==null&&(i.push.apply(i,Fl),Fl=i),ru=e.flags&32?!0:r;break;default:Du(t,e)}}function ku(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)lu(e,t.alternate,t),t=t.sibling}function Au(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:gl(4,n,n.return),Au(n,r);break;case 1:bl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&vl(n,n.return,i),Au(n,r);break;case 27:r&2&&vm(n.stateNode,n.type,n.memoizedProps);case 5:bl(n,n.return),n.tag!==5&&n.tag!==27||Cl(n),Au(n,r);break;case 6:Cl(n);break;case 26:bl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||Ql||i.parentNode.removeChild(i),Au(n,r);break;case 22:n.memoizedState===null&&Au(n,r);break;case 30:bl(n,n.return),Au(n,r);break;case 7:bl(n,n.return);default:Au(n,r)}e=e.sibling}}function ju(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:ju(i,a,n),hl(4,a);break;case 1:if(ju(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){pf(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++)_o(l[i],c)}catch(e){pf(r,r.return,e)}}s&&o&64&&_l(a),yl(a,a.return);break;case 27:n&2&&Ml(a);case 5:a.tag!==5&&a.tag!==27||Sl(a),ju(i,a,n),s&&r===null&&o&4&&El(a),yl(a,a.return);break;case 6:Sl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||Zl||Jm(Sm(c.ownerDocument),a.type,c),ju(i,a,n),s&&r===null&&o&4&&El(a),yl(a,a.return);break;case 12:ju(i,a,n);break;case 31:ju(i,a,n),s&&o&4&&vu(i,a);break;case 13:ju(i,a,n),s&&o&4&&yu(i,a);break;case 22:a.memoizedState===null&&ju(i,a,n),yl(a,a.return);break;case 30:ju(i,a,n),yl(a,a.return);break;case 7:yl(a,a.return);default:ju(i,a,n)}t=t.sibling}}function Mu(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&&Da(n))}function Nu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Da(e))}function Pu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Fu(e,t,n,r),t=t.sibling;else i&&Jl(t)}function Fu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&ql(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Pu(e,t,n,r),a&2048&&hl(9,t);break;case 1:Pu(e,t,n,r);break;case 3:Pu(e,t,n,r),i&&ou&&(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&&Da(a)));break;case 12:if(a&2048){Pu(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){pf(t,t.return,e)}}else Pu(e,t,n,r);break;case 31:Pu(e,t,n,r);break;case 13:Pu(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&&ql(t),o._visibility&2?Pu(e,t,n,r):(o._visibility|=2,Iu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&ql(s),o._visibility&2?Pu(e,t,n,r):Lu(e,t)),a&2048&&Mu(s,t);break;case 24:Pu(e,t,n,r),a&2048&&Nu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Bl(a.child,!0),Bl(t.child,!0))),Pu(e,t,n,r);break;default:Pu(e,t,n,r)}}function Iu(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:Iu(a,o,s,c,i),hl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Iu(a,o,s,c,i)):u._visibility&2?Iu(a,o,s,c,i):Lu(a,o),i&&l&2048&&Mu(o.alternate,o);break;case 24:Iu(a,o,s,c,i),i&&l&2048&&Nu(o.alternate,o);break;default:Iu(a,o,s,c,i)}t=t.sibling}}function Lu(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:Lu(n,r),i&2048&&Mu(r.alternate,r);break;case 24:Lu(n,r),i&2048&&Nu(r.alternate,r);break;default:Lu(n,r)}t=t.sibling}}var Ru=8192;function zu(e,t,n){if(e.subtreeFlags&Ru)for(e=e.child;e!==null;)Bu(e,t,n),e=e.sibling}function Bu(e,t,n){switch(e.tag){case 26:zu(e,t,n),e.flags&Ru&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&$m(n,e)):eh(n,Cu,e.memoizedState,e.memoizedProps));break;case 5:zu(e,t,n),e.flags&Ru&&(e=e.stateNode,(t&335544128)===t&&$m(n,e));break;case 3:case 4:var r=Cu;Cu=Sm(e.stateNode.containerInfo),zu(e,t,n),Cu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ru,Ru=16777216,zu(e,t,n),Ru=r):zu(e,t,n));break;case 30:if((e.flags&Ru)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Nl===null&&(Nl=new Map),Nl.set(r,i)}zu(e,t,n);break;default:zu(e,t,n)}}function Vu(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 Hu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nu=r,Gu(r,e)}Vu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Uu(e),e=e.sibling}function Uu(e){switch(e.tag){case 0:case 11:case 15:Hu(e),e.flags&2048&&gl(9,e,e.return);break;case 3:Hu(e);break;case 12:Hu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Wu(e)):Hu(e);break;default:Hu(e)}}function Wu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nu=r,Gu(r,e)}Vu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:gl(8,t,t.return),Wu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Wu(t));break;default:Wu(t)}e=e.sibling}}function Gu(e,t){for(;nu!==null;){var n=nu;switch(n.tag){case 0:case 11:case 15:gl(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:Da(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,nu=r;else a:for(n=e;nu!==null;){r=nu;var i=r.sibling,a=r.return;if(pu(r),r===n){nu=null;break a}if(i!==null){i.return=a,nu=i;break a}nu=a}}}var Ku={getCacheForType:function(e){var t=ya(Ta),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ya(Ta).controller.signal}},qu=typeof WeakMap==`function`?WeakMap:Map,Ju=0,Yu=null,Xu=null,Zu=0,Qu=0,$u=null,ed=!1,td=!1,nd=!1,rd=0,id=0,ad=0,od=0,sd=0,cd=0,ld=0,ud=null,dd=null,fd=!1,pd=0,md=0,hd=1/0,gd=null,_d=null,vd=0,yd=null,bd=null,xd=0,Sd=0,Cd=null,wd=null,Td=null,Ed=null,Dd=null,Od=0,kd=null;function Ad(){return Ju&2&&Zu!==0?Zu&-Zu:W.T===null?dt():Pf()}function jd(){if(cd===0){if(!(Zu&536870912)||Qi){var e=Ye;Ye<<=1,!(Ye&3932160)&&(Ye=262144),cd=e}else cd=536870912}return e=wo.current,e!==null&&(e.flags|=32),cd}function Md(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Ip(ui(e.memoizedProps,n))),Ed===null&&(Ed=[]),Ed.push(t.bind(null,r))}}function Nd(e,t,n){(e===Yu&&(Qu===2||Qu===9)||e.cancelPendingCommit!==null)&&(Bd(e,0),Ld(e,Zu,cd,!1)),it(e,n),Ju&2&&e===Yu||(e===Yu&&(!(Ju&2)&&(od|=n),id===4&&Ld(e,Zu,cd,!1)),Ef(e))}function Pd(e,t,n){if(Ju&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||$e(e,t),a=r?Jd(e,t):Kd(e,t,!0),o=r;do{if(a===0){td&&!r&&Ld(e,t,0,!1);break}if(n=e.current.alternate,o&&!Id(n))a=Kd(e,t,!1),o=!1;else{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=ud;var l=c.current.memoizedState.isDehydrated;if(l&&(Bd(c,s).flags|=256),s=Kd(c,s,!1),s!==2&&s!==6){if(nd&&!l){c.errorRecoveryDisabledLanes|=o,od|=o,a=4;break a}o=dd,dd=a,o!==null&&(dd===null?dd=o:dd.push.apply(dd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Bd(e,0),Ld(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:Ld(r,t,cd,!ed);break a;case 2:dd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=pd+300-Ne(),10<a)){if(Ld(r,t,cd,!ed),Qe(r,0,!0)!==0)break a;xd=t,r.timeoutHandle=vp(Fd.bind(null,r,n,dd,gd,fd,t,cd,od,ld,ed,o,`Throttled`,-0,0),a);break a}Fd(r,n,dd,gd,fd,t,cd,od,ld,ed,o,null,-0,0)}break}}while(1);Ef(e)}function Fd(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;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:dn},Nl=null,Bu(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=ih.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?pd-Ne():(a&4194048)===a?md-Ne():0,m=nh(d,m),m!==null)?(xd=a,e.cancelPendingCommit=m(tf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ld(e,a,o,!l)):tf(e,t,a,n,r,i,o,s,c,l,u,d)}function Id(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(!Pr(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 Ld(e,t,n,r){t=et(e,t),t&=~sd,t&=~od,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-We(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ot(e,n,t)}function Rd(){return Ju&6?!0:(Df(0,!1),!1)}function zd(){if(Xu!==null){if(Qu===0)var e=Xu.return;else e=Xu,da=ua=null,Qo(e),$a=null,eo=0,e=Xu;for(;e!==null;)ml(e.alternate,e),e=e.return;Xu=null}}function Bd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,yp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),xd=0,zd(),Yu=e,Xu=n=Di(e.current,null),Zu=t,Qu=0,$u=null,ed=!1,td=$e(e,t),nd=!1,ld=cd=sd=od=ad=id=0,dd=ud=null,fd=!1,rd=et(e,t),_i(),n}function Vd(e,t){Y=null,W.H=sc,t===Ua||t===Ga?(t=Za(),Qu=3):t===Wa?(t=Za(),Qu=4):Qu=t===Tc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,$u=t,Xu===null&&(id=1,yc(e,Fi(t,e.current)))}function Hd(){var e=wo.current;return e===null?!0:(Zu&4194048)===Zu?To===null:(Zu&62914560)===Zu||Zu&536870912?e===To:!1}function Ud(){var e=W.H;return W.H=sc,e===null?sc:e}function Wd(){var e=W.A;return W.A=Ku,e}function Gd(){id=4,ed||(Zu&4194048)!==Zu&&wo.current!==null||(td=!0),!(ad&134217727)&&!(od&134217727)||Yu===null||Ld(Yu,Zu,cd,!1)}function Kd(e,t,n){var r=Ju;Ju|=2;var i=Ud(),a=Wd();(Yu!==e||Zu!==t)&&(gd=null,Bd(e,t)),t=!1;var o=id;a:do try{if(Qu!==0&&Xu!==null){var s=Xu,c=$u;switch(Qu){case 8:zd(),o=6;break a;case 3:case 2:case 9:case 6:wo.current===null&&(t=!0);var l=Qu;if(Qu=0,$u=null,Qd(e,s,c,l),n&&td){o=0;break a}break;default:l=Qu,Qu=0,$u=null,Qd(e,s,c,l)}}qd(),o=id;break}catch(t){Vd(e,t)}while(1);return t&&e.shellSuspendCounter++,da=ua=null,Ju=r,W.H=i,W.A=a,Xu===null&&(Yu=null,Zu=0,_i()),o}function qd(){for(;Xu!==null;)Xd(Xu)}function Jd(e,t){var n=Ju;Ju|=2;var r=Ud(),a=Wd();Yu!==e||Zu!==t?(gd=null,hd=Ne()+500,Bd(e,t)):td=$e(e,t);a:do try{if(Qu!==0&&Xu!==null){t=Xu;var o=$u;b:switch(Qu){case 1:Qu=0,$u=null,Qd(e,t,o,1);break;case 2:case 9:if(qa(o)){Qu=0,$u=null,Zd(t);break}t=function(){Qu!==2&&Qu!==9||Yu!==e||(Qu=7),Ef(e)},o.then(t,t);break a;case 3:Qu=7;break a;case 4:Qu=5;break a;case 7:qa(o)?(Qu=0,$u=null,Zd(t)):(Qu=0,$u=null,Qd(e,t,o,7));break;case 5:var s=null;switch(Xu.tag){case 26:s=Xu.memoizedState;case 5:case 27:var c=Xu;if(s?Zm(s):c.stateNode.complete){Qu=0,$u=null;var l=c.sibling;if(l!==null)Xu=l;else{var u=c.return;u===null?Xu=null:(Xu=u,$d(u))}break b}}Qu=0,$u=null,Qd(e,t,o,5);break;case 6:Qu=0,$u=null,Qd(e,t,o,6);break;case 8:zd(),id=6;break a;default:throw Error(i(462))}}Yd();break}catch(t){Vd(e,t)}while(1);return da=ua=null,W.H=r,W.A=a,Ju=n,Xu===null?(Yu=null,Zu=0,_i(),id):0}function Yd(){for(;Xu!==null&&!je();)Xd(Xu)}function Xd(e){var t=al(e.alternate,e,rd);e.memoizedProps=e.pendingProps,t===null?$d(e):Xu=t}function Zd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=zc(n,t,t.pendingProps,t.type,void 0,Zu);break;case 11:t=zc(n,t,t.pendingProps,t.type.render,t.ref,Zu);break;case 5:Qo(t);var r=t;r===Xi&&(Qi?(ia(r),r.tag===5&&r.stateNode!=null&&(Zi=r.stateNode)):(ia(r),Qi=!0));default:ml(n,t),t=Xu=Oi(t,rd),t=al(n,t,rd)}e.memoizedProps=e.pendingProps,t===null?$d(e):Xu=t}function Qd(e,t,n,r){da=ua=null,Qo(t),$a=null,eo=0;var i=t.return;try{if(wc(e,i,t,n,Zu)){id=1,yc(e,Fi(n,e.current)),Xu=null;return}}catch(t){if(i!==null)throw Xu=i,t;id=1,yc(e,Fi(n,e.current)),Xu=null;return}t.flags&32768?(Qi||r===1?e=!0:td||Zu&536870912?e=!1:(ed=e=!0,(r===2||r===9||r===3||r===6)&&(r=wo.current,r!==null&&r.tag===13&&(r.flags|=16384))),ef(t,e)):$d(t)}function $d(e){var t=e;do{if(t.flags&32768){ef(t,ed);return}e=t.return;var n=fl(t.alternate,t,rd);if(n!==null){Xu=n;return}if(t=t.sibling,t!==null){Xu=t;return}Xu=t=e}while(t!==null);id===0&&(id=5)}function ef(e,t){do{var n=pl(e.alternate,e);if(n!==null){n.flags&=32767,Xu=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Xu=e;return}Xu=e=n}while(e!==null);id=6,Xu=null}function tf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do uf();while(vd!==0);if(Ju&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Yu&&(Xu=Yu=null,Zu=0),bd=t,yd=e,xd=n,Cd=a,wd=r,nf(e,t,n,s,c,l,f)}}function nf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Sd=s,s|=gi,at(e,n,s,r,i,a),Ed=null,(n&335544064)===n?(Dd=Aa(e),r=10262):(Dd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,yf(Le,function(){return df(),null})):(e.callbackNode=null,e.callbackPriority=0),Z=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=W.T,W.T=null,i=se.p,se.p=2,a=Ju,Ju|=4;try{su(e,t,n)}finally{Ju=a,se.p=i,W.T=r}}vd=1,Z?Td=Pp(o,e.containerInfo,Dd,of,sf,af,cf,df,rf,null,null):(of(),sf(),cf())}function rf(e){if(vd!==0){var t=yd.onRecoverableError;t(e,{componentStack:null})}}function af(){vd===3&&(vd=0,Ou(bd,yd),vd=4)}function of(){if(vd===1){vd=0;var e=yd,t=bd,n=xd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=W.T,W.T=null;var i=se.p;se.p=2;var a=Ju;Ju|=4;try{iu=au=!1,wu(t,e,n),n=up;var o=Br(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&zr(s.ownerDocument.documentElement,s)){if(c!==null&&Vr(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 _=Rr(s,h),v=Rr(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}}vh=!!lp,up=lp=null}finally{Ju=a,se.p=i,W.T=r}}e.current=t,vd=2}}function sf(){if(vd===2){vd=0;var e=yd,t=bd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=W.T,W.T=null;var r=se.p;se.p=2;var i=Ju;Ju|=4;try{lu(e,t.alternate,t)}finally{Ju=i,se.p=r,W.T=n}}vd=3}}function cf(){if(vd===4||vd===3){vd=0;var e=Td;Td=null,Me();var t=yd,n=bd,r=xd,i=wd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?vd=5:(vd=0,bd=yd=null,lf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(_d=null),ut(r),n=n.stateNode,He&&typeof He.onCommitFiberRoot==`function`)try{He.onCommitFiberRoot(K,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=W.T,a=se.p,se.p=2,W.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{W.T=n,se.p=a}}if(i=Ed,o=Dd,Dd=null,i!==null&&(Ed=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);xd&3&&uf(),Ef(t),a=t.pendingLanes,r&261930&&a&42?t===kd?Od++:(Od=0,kd=t):(Od=0,kd=null),Df(0,!1)}}function lf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Da(t)))}function uf(){return Td!==null&&(Td.skipTransition(),Td=null),of(),sf(),cf(),df()}function df(){if(vd!==5)return!1;var e=yd,t=Sd;Sd=0;var n=ut(xd),r=W.T,a=se.p;try{se.p=32>n?32:n,W.T=null,n=Cd,Cd=null;var o=yd,s=xd;if(vd=0,bd=yd=null,xd=0,Ju&6)throw Error(i(331));var c=Ju;if(Ju|=4,Uu(o.current),Fu(o,o.current,s,n),Ju=c,Df(0,!1),He&&typeof He.onPostCommitFiberRoot==`function`)try{He.onPostCommitFiberRoot(K,o)}catch{}return!0}finally{se.p=a,W.T=r,lf(e,t)}}function ff(e,t,n){t=Fi(n,t),t=xc(e.stateNode,t,2),e=uo(e,t,2),e!==null&&(it(e,2),Ef(e))}function pf(e,t,n){if(e.tag===3)ff(e,e,n);else for(;t!==null;){if(t.tag===3){ff(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(_d===null||!_d.has(r))){e=Fi(n,e),n=Sc(2),r=uo(t,n,2),r!==null&&(Cc(n,r,t,e),it(r,2),Ef(r));break}}t=t.return}}function mf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new qu;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)||(nd=!0,i.add(n),e=hf.bind(null,e,t,n),t.then(e,e))}function hf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Yu===e&&(Zu&n)===n&&(id===4||id===3&&(Zu&62914560)===Zu&&300>Ne()-pd?Ju&2?sd|=n:Bd(e,0):sd|=n,ld===Zu&&(ld=0)),Ef(e)}function gf(e,t){t===0&&(t=nt()),e=bi(e,t),e!==null&&(it(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gf(e,n)}function vf(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),gf(e,n)}function yf(e,t){return ke(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;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-We(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=Zu,a=Qe(r,r===Yu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||$e(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&_p()&&(e=Tf);for(var t=Ne(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}vd!==0&&vd!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-We(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=tt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Yu,n=Zu,n=Qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Qu===2||Qu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ae(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||$e(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ae(r),ut(n)){case 2:case 8:n=Ie;break;case 32:n=Le;break;case 268435456:n=ze;break;default:n=Le}return r=jf.bind(null,e),n=ke(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ae(r),e.callbackPriority=2,e.callbackNode=null,2}function jf(e,t){if(vd!==0&&vd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(uf()&&e.callbackNode!==n)return null;var r=Zu;return r=Qe(e,e===Yu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Pd(e,r,t),Af(e,Ne()),e.callbackNode!=null&&e.callbackNode===n?jf.bind(null,e):null)}function Mf(e,t){if(uf())return null;Pd(e,t,!0)}function Nf(){Sp(function(){Ju&6?ke(Fe,Of):kf()})}function Pf(){if(Tf===0){var e=Na;e===0&&(e=Je,Je<<=1,!(Je&261888)&&(Je=256)),Tf=e}return Tf}function Ff(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:un(e)}function If(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Ff((i[ht]||null).action),o=r.submitter;o&&(t=(t=o[ht]||null)?Ff(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Mn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tf!==0){var e=new FormData(i,o);qs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),qs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Lf=0;Lf<si.length;Lf++){var Rf=si[Lf];ci(Rf.toLowerCase(),`on`+(Rf[0].toUpperCase()+Rf.slice(1)))}ci($r,`onAnimationEnd`),ci(ei,`onAnimationIteration`),ci(ti,`onAnimationStart`),ci(`dblclick`,`onDoubleClick`),ci(`focusin`,`onFocus`),ci(`focusout`,`onBlur`),ci(ni,`onTransitionRun`),ci(ri,`onTransitionStart`),ci(ii,`onTransitionCancel`),ci(ai,`onTransitionEnd`),Nt(`onMouseEnter`,[`mouseout`,`mouseover`]),Nt(`onMouseLeave`,[`mouseout`,`mouseover`]),Nt(`onPointerEnter`,[`pointerout`,`pointerover`]),Nt(`onPointerLeave`,[`pointerout`,`pointerover`]),Mt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Mt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Mt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Mt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Mt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Mt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var zf=`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(` `),Bf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(zf));function Vf(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){pi(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){pi(e)}i.currentTarget=null,a=c}}}}function Hf(e,t){var n=t[_t];n===void 0&&(n=t[_t]=new Set);var r=e+`__bubble`;n.has(r)||(Kf(t,e,2,!1),n.add(r))}function Uf(e,t,n){var r=0;t&&(r|=4),Kf(n,e,r,t)}var Wf=`_reactListening`+Math.random().toString(36).slice(2);function Gf(e){if(!e[Wf]){e[Wf]=!0,At.forEach(function(t){t!==`selectionchange`&&(Bf.has(t)||Uf(t,!1,e),Uf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Wf]||(t[Wf]=!0,Uf(`selectionchange`,!1,t))}}function Kf(e,t,n,r){switch(Th(t)){case 2:var i=yh;break;case 8:i=bh;break;default:i=xh}n=i.bind(null,t,n,e),i=void 0,!xn||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 qf(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=wt(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}vn(function(){var r=a,i=pn(n),s=[];a:{var c=oi.get(e);if(c!==void 0){var l=Mn,u=e;switch(e){case`keypress`:if(Dn(n)===0)break a;case`keydown`:case`keyup`:l=Xn;break;case`focusin`:u=`focus`,l=Vn;break;case`focusout`:u=`blur`,l=Vn;break;case`beforeblur`:case`afterblur`:l=Vn;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=zn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Bn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=$n;break;case $r:case ei:case ti:l=Hn;break;case ai:l=er;break;case`scroll`:case`scrollend`:l=Pn;break;case`wheel`:l=tr;break;case`copy`:case`cut`:case`paste`:l=Un;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Zn;break;case`submit`:l=Qn;break;case`toggle`:case`beforetoggle`:l=nr}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=yn(m,p),g!=null&&d.push(Jf(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!==fn&&(u=n.relatedTarget||n.fromElement)&&(wt(u)||u[gt]))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?wt(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=zn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Zn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Et(c),h=l==null?u:Et(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,wt(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,Xf):null,c!==null&&Zf(s,u,c,d,!1),l!==null&&f!==null&&Zf(s,f,l,d,!0)))}a:{if(c=r?Et(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Sr;else if(gr(c)){if(Cr)_=Mr;else{_=Ar;var v=kr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&sn(r.elementType)&&(_=Sr):_=jr;if(_&&=_(e,r)){_r(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Et(r):window,e){case`focusin`:(gr(v)||v.contentEditable===`true`)&&(Ur=v,Wr=r,Gr=null);break;case`focusout`:Gr=Wr=Ur=null;break;case`mousedown`:Kr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Kr=!1,qr(s,n,i);break;case`selectionchange`:if(Hr)break;case`keydown`:case`keyup`:qr(s,n,i)}var y;if(ir)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 fr?ur(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(sr&&n.locale!==`ko`&&(fr||b!==`onCompositionStart`?b===`onCompositionEnd`&&fr&&(y=En()):(Cn=i,wn=`value`in Cn?Cn.value:Cn.textContent,fr=!0)),v=Yf(r,b),0<v.length&&(b=new Wn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=dr(n),y!==null&&(b.data=y)))),(y=or?pr(e,n):mr(e,n))&&(b=Yf(r,`onBeforeInput`),0<b.length&&(v=new Wn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),If(s,e,r,n,i)}Vf(s,t)})}function Jf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Yf(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=yn(e,n),i!=null&&r.unshift(Jf(e,i,a)),i=yn(e,t),i!=null&&r.push(Jf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Xf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zf(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=yn(n,a),l!=null&&o.unshift(Jf(n,l,c))):i||(l=yn(n,a),l!=null&&o.push(Jf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Qf=/\r\n?/g,$f=/\u0000|\uFFFD/g;function ep(e){return(typeof e==`string`?e:``+e).replace(Qf,`
|
|
9
|
+
`).replace($f,``)}function tp(e,t){return t=ep(t),ep(e)===t}function np(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||nn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&nn(e,``+r);else return;break;case`className`:Vt(e,`class`,r);break;case`tabIndex`:Vt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Vt(e,n,r);break;case`style`:on(e,r,o);return;case`data`:if(t!==`object`){Vt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=un(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`&&np(e,t,`name`,a.name,a,null),np(e,t,`formEncType`,a.formEncType,a,null),np(e,t,`formMethod`,a.formMethod,a,null),np(e,t,`formTarget`,a.formTarget,a,null)):(np(e,t,`encType`,a.encType,a,null),np(e,t,`method`,a.method,a,null),np(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=un(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=dn);return;case`onScroll`:r!=null&&Hf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Hf(`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=un(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`:Hf(`beforetoggle`,e),Hf(`toggle`,e),Bt(e,`popover`,r);break;case`xlinkActuate`:Ht(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ht(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ht(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ht(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ht(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ht(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ht(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ht(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ht(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Bt(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=cn.get(n)||n,Bt(e,n,r);else return}Rt=!0}function rp(e,t,n,r,a,o){switch(n){case`style`:on(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`)nn(e,r);else if(typeof r==`number`||typeof r==`bigint`)nn(e,``+r);else return;break;case`onScroll`:r!=null&&Hf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Hf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=dn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!jt.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[ht]||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}Rt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Bt(e,n,r)}return}Rt=!0}function ip(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Hf(`error`,e),Hf(`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:np(e,t,o,s,n,null)}}a&&np(e,t,`srcSet`,n.srcSet,n,null),r&&np(e,t,`src`,n.src,n,null);return;case`input`:Hf(`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:np(e,t,r,d,n,null)}}Zt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Hf(`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:np(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&$t(e,!!r,n,!0):$t(e,!!r,t,!1);return;case`textarea`:for(s in Hf(`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:np(e,t,s,c,n,null)}tn(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:np(e,t,l,r,n,null)}return;case`dialog`:Hf(`beforetoggle`,e),Hf(`toggle`,e),Hf(`cancel`,e),Hf(`close`,e);break;case`iframe`:case`object`:Hf(`load`,e);break;case`video`:case`audio`:for(r=0;r<zf.length;r++)Hf(zf[r],e);break;case`image`:Hf(`error`,e),Hf(`load`,e);break;case`details`:Hf(`toggle`,e);break;case`embed`:case`source`:case`link`:Hf(`error`,e),Hf(`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:np(e,t,u,r,n,null)}return;default:if(sn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&rp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&np(e,t,c,r,n,null))}var ap={};function op(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)||np(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&&(Rt=!0),o=m;break;case`name`:m!==f&&(Rt=!0),a=m;break;case`checked`:m!==f&&(Rt=!0),u=m;break;case`defaultChecked`:m!==f&&(Rt=!0),d=m;break;case`value`:m!==f&&(Rt=!0),s=m;break;case`defaultValue`:m!==f&&(Rt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&np(e,t,p,m,r,f)}}Xt(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)||np(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&&(Rt=!0),p=o;break;case`defaultValue`:o!==l&&(Rt=!0),c=o;break;case`multiple`:o!==l&&(Rt=!0),s=o;default:o!==l&&np(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?$t(e,!!n,n?[]:``,!1):$t(e,!!n,t,!0)):$t(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:np(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&&(Rt=!0),p=a;break;case`defaultValue`:a!==o&&(Rt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&np(e,t,s,a,r,o)}en(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:np(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&&(Rt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:np(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)&&np(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:np(e,t,u,p,r,m)}return;default:if(sn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&rp(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||rp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&np(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||np(e,t,f,p,r,m)}function sp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function cp(){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&&sp(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&&sp(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 lp=null,up=null;function dp(e){return e.nodeType===9?e:e.ownerDocument}function fp(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 pp(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 mp(e,t,n,r){return n=dp(n).createElement(e),n[mt]=r,n[ht]=t,ip(n,e,t),Ot(n),n}function hp(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 gp=null;function _p(){var e=window.event;return e&&e.type===`popstate`?e!==gp&&(gp=e,!0):(gp=null,!1)}var vp=typeof setTimeout==`function`?setTimeout:void 0,yp=typeof clearTimeout==`function`?clearTimeout:void 0,bp=typeof Promise==`function`?Promise:void 0,xp=typeof requestAnimationFrame==`function`?requestAnimationFrame:vp,Sp=typeof queueMicrotask==`function`?queueMicrotask:bp===void 0?vp:function(e){return bp.resolve(null).then(e).catch(Cp)};function Cp(e){setTimeout(function(){throw e})}function wp(e){return e===`head`}function Tp(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),Wh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)ym(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,ym(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[xt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&ym(e.ownerDocument.body)}n=i}while(n);Wh(t)}function Ep(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 Dp(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 Op(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 kp(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 Ap(e){return kp(e.getBoundingClientRect(),getComputedStyle(e),e)}function jp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return kp(t,n,e)}function Mp(e){return e.documentElement.clientHeight}function Np(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Pp(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`&&(Mp(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+=Qm(f),u>th){s.length=o;break}f=new Promise(Np.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 Fp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Fp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Fp.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},Fp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Ip(e){return{name:e,group:new Fp(`group`,e),imagePair:new Fp(`image-pair`,e),old:new Fp(`old`,e),new:new Fp(`new`,e)}}function Lp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Lp.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(Hp(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=Bp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Rp,e,s,r)}this._eventListeners=a}};function Rp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Lp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Hp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Bp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,zp,e,n,i),r.splice(t,1),a!==null&&a()}};function zp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Bp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Vp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Hp(e,t,n,r){if(e.length===0)return-1;r=Vp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Vp(a.optionsOrUseCapture)===r)return i}return-1}Lp.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,Bp(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,Bp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Lp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Up,e,void 0,void 0)};function Up(e,t){return e.tag!==6&&(e=b(e),hm(e,t))}Lp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Wp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Up(t[n],e);n--);};function Wp(e,t){return t.push(e),!1}Lp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=dp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Gp,e,void 0,void 0))};function Gp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Lp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Kp,e,void 0,void 0)};function Kp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Lp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,qp,e,void 0,void 0);for(var n=t=0;n<Jp.length;n++){var r=Jp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Jp[t++]=r}Jp.length=t}};function qp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Jp=[],Yp=!1;function Xp(e,t,n){Jp.push({fragmentInstance:e,observer:t,instance:n}),Yp||(Yp=!0,gm(function(){Yp=!1;var e=Jp;Jp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Lp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,Zp,e,void 0,void 0),e};function Zp(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}Lp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Lp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Wp,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||Qp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Qp(e,t,n,r,i){var a=wt(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 $p(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)}Lp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,Wp,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),$p(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),$p(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function em(e,t){return e=b(e),tm(e,t),!1}function tm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function nm(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,Bp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Jp.length;i++){var a=Jp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Jp[r++]=a)}Jp.length=r,n.observe(e)}),tm(e,t))}function rm(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,Bp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Xp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function im(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`:im(n),Ct(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function am(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[xt])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=dm(e.nextSibling),e===null)break}return null}function om(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=dm(e.nextSibling),e===null))return null;return e}function sm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=dm(e.nextSibling),e===null))return null;return e}function cm(e){return e.data===`$?`||e.data===`$~`}function lm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function um(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 dm(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 fm=null;function pm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return dm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function mm(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 hm(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 gm(e){xp(function(){xp(function(t){return e(t)})})}function _m(e,t,n){switch(t=dp(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 vm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&np(e,t,r,null,ap,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===dn&&(e.onclick=null),Ct(e)}function ym(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ct(e)}var bm=new Map,xm=new Set;function Sm(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 Cm=se.d;se.d={f:wm,r:Tm,D:Om,C:km,L:Am,m:jm,X:Nm,S:Mm,M:Pm};function wm(){var e=Cm.f(),t=Rd();return e||t}function Tm(e){var t=Tt(e);t!==null&&t.tag===5&&t.type===`form`?Ys(t):Cm.r(e)}var Em=typeof document>`u`?null:document;function Dm(e,t,n){var r=Em;if(r&&typeof t==`string`&&t){var i=Yt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),xm.has(i)||(xm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),ip(t,`link`,e),Ot(t),r.head.appendChild(t)))}}function Om(e){Cm.D(e),Dm(`dns-prefetch`,e,null)}function km(e,t){Cm.C(e,t),Dm(`preconnect`,e,t)}function Am(e,t,n){Cm.L(e,t,n);var r=Em;if(r&&e&&t){var i=`link[rel="preload"][as="`+Yt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Yt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Yt(n.imageSizes)+`"]`)):i+=`[href="`+Yt(e)+`"]`;var a=i;switch(t){case`style`:a=Im(e);break;case`script`:a=Bm(e)}if(!(bm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),bm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Lm(a))||t===`script`&&r.querySelector(Vm(a))))){var o=r.createElement(`link`);ip(o,`link`,e),t===`style`&&(o[St]=!0,o.onload=o.onerror=function(){kt(o)}),Ot(o),r.head.appendChild(o)}}}function jm(e,t){Cm.m(e,t);var n=Em;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Yt(r)+`"][href="`+Yt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Bm(e)}if(!bm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),bm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Vm(a)))return}r=n.createElement(`link`),ip(r,`link`,e),Ot(r),n.head.appendChild(r)}}}function Mm(e,t,n){Cm.S(e,t,n);var r=Em;if(r&&e){var i=Dt(r).hoistableStyles,a=Im(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Lm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=bm.get(a))&&Wm(e,n);var c=o=r.createElement(`link`);Ot(c),ip(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,Um(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Nm(e,t){Cm.X(e,t);var n=Em;if(n&&e){var r=Dt(n).hoistableScripts,i=Bm(e),a=r.get(i);a||(a=n.querySelector(Vm(i)),a||(e=D({src:e,async:!0},t),(t=bm.get(i))&&Gm(e,t),a=n.createElement(`script`),Ot(a),ip(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pm(e,t){Cm.M(e,t);var n=Em;if(n&&e){var r=Dt(n).hoistableScripts,i=Bm(e),a=r.get(i);a||(a=n.querySelector(Vm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=bm.get(i))&&Gm(e,t),a=n.createElement(`script`),Ot(a),ip(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Fm(e,t,n,r){var a=(a=ge.current)?Sm(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=Im(n.href),t=Dt(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=Im(n.href);var o=Dt(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(Lm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=bm.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},bm.set(e,o)),zm(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=Bm(n),t=Dt(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 Im(e){return`href="`+Yt(e)+`"`}function Lm(e){return`link[rel="stylesheet"][`+e+`]`}function Rm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function zm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[St]){r.loading=1;return}}else t=e.createElement(`link`),t[St]=!0,t.onload=t.onerror=kt.bind(null,t),ip(t,`link`,n),Ot(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 Bm(e){return`[src="`+Yt(e)+`"]`}function Vm(e){return`script[async]`+e}function Hm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Yt(n.href)+`"]`);if(r)return t.instance=r,Ot(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`),Ot(r),ip(r,`style`,a),Um(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Im(n.href);var o=e.querySelector(Lm(a));if(o)return t.state.loading|=4,t.instance=o,Ot(o),o;r=Rm(n),(a=bm.get(a))&&Wm(r,a),o=(e.ownerDocument||e).createElement(`link`),Ot(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),ip(o,`link`,r),t.state.loading|=4,Um(o,n.precedence,e),t.instance=o;case`script`:return o=Bm(n.src),(a=e.querySelector(Vm(o)))?(t.instance=a,Ot(a),a):(r=n,(a=bm.get(o))&&(r=D({},n),Gm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ot(a),ip(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,Um(r,n.precedence,e));return t.instance}function Um(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 Wm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Gm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Km=null;function qm(e,t,n){if(Km===null){var r=new Map,i=Km=new Map;i.set(n,r)}else i=Km,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[xt]||a[mt]||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 Jm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Ym(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 Xm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Zm(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Qm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function $m(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Qm(t),e.suspenseyImages.push(t)),e=ah.bind(e),t.decode().then(e,e))}function eh(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=Im(r.href),a=t.querySelector(Lm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ih.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ot(a);return}a=t.ownerDocument||t,r=Rm(r),(i=bm.get(i))&&Wm(r,i),a=a.createElement(`link`),Ot(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),ip(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=ih.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var th=0;function nh(e,t){return e.stylesheets&&e.count===0&&sh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&sh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&th===0&&(th=62500*cp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&sh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>th?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function rh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)sh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ih(){this.count--,rh(this)}function ah(){this.imgCount--,rh(this)}var oh=null;function sh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,oh=new Map,t.forEach(ch,e),oh=null,ih.call(e))}function ch(e,t){if(!(t.state.loading&4)){var n=oh.get(e);if(n)var r=n.get(null);else{n=new Map,oh.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=ih.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 lh={$$typeof:F,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function uh(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=rt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rt(0),this.hiddenUpdates=rt(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 dh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new uh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ti(3,null,null,t),e.current=a,a.stateNode=e,t=Ea(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},so(a),e}function fh(e){return e?(e=Ci,e):Ci}function ph(e,t,n,r,i,a){i=fh(i),r.context===null?r.context=i:r.pendingContext=i,r=lo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=uo(e,r,t),n!==null&&(Nd(n,e,t),fo(n,e,t))}function mh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function hh(e,t){mh(e,t),(e=e.alternate)&&mh(e,t)}function gh(e){if(e.tag===13||e.tag===31){var t=bi(e,67108864);t!==null&&Nd(t,e,67108864),hh(e,67108864)}}function _h(e){if(e.tag===13||e.tag===31){var t=Ad();t=lt(t);var n=bi(e,t);n!==null&&Nd(n,e,t),hh(e,t)}}var vh=!0;function yh(e,t,n,r){var i=W.T;W.T=null;var a=se.p;try{se.p=2,xh(e,t,n,r)}finally{se.p=a,W.T=i}}function bh(e,t,n,r){var i=W.T;W.T=null;var a=se.p;try{se.p=8,xh(e,t,n,r)}finally{se.p=a,W.T=i}}function xh(e,t,n,r){if(vh){var i=Sh(r);if(i===null)qf(e,t,r,Ch,n),Ph(e,r);else if(Ih(i,e,t,n,r))r.stopPropagation();else if(Ph(e,r),t&4&&-1<Nh.indexOf(e)){for(;i!==null;){var a=Tt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-We(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(Ju&6)&&(hd=Ne()+500,Df(0,!1))}}break;case 31:case 13:s=bi(a,2),s!==null&&Nd(s,a,2),Rd(),hh(a,2)}if(a=Sh(r),a===null&&qf(e,t,r,Ch,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else qf(e,t,r,null,n)}}function Sh(e){return e=pn(e),wh(e)}var Ch=null;function wh(e){if(Ch=null,e=wt(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 Ch=e,null}function Th(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(Pe()){case Fe:return 2;case Ie:return 8;case Le:case Re:return 32;case ze:return 268435456;default:return 32}default:return 32}}var Eh=!1,Dh=null,Oh=null,kh=null,Ah=new Map,jh=new Map,Mh=[],Nh=`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 Ph(e,t){switch(e){case`focusin`:case`focusout`:Dh=null;break;case`dragenter`:case`dragleave`:Oh=null;break;case`mouseover`:case`mouseout`:kh=null;break;case`pointerover`:case`pointerout`:Ah.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:jh.delete(t.pointerId)}}function Fh(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=Tt(t),t!==null&&gh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ih(e,t,n,r,i){switch(t){case`focusin`:return Dh=Fh(Dh,e,t,n,r,i),!0;case`dragenter`:return Oh=Fh(Oh,e,t,n,r,i),!0;case`mouseover`:return kh=Fh(kh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ah.set(a,Fh(Ah.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,jh.set(a,Fh(jh.get(a)||null,e,t,n,r,i)),!0}return!1}function Lh(e){var t=wt(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,ft(e.priority,function(){_h(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ft(e.priority,function(){_h(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 Rh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);fn=r,n.target.dispatchEvent(r),fn=null}else return t=Tt(n),t!==null&&gh(t),e.blockedOn=n,!1;t.shift()}return!0}function zh(e,t,n){Rh(e)&&n.delete(t)}function Bh(){Eh=!1,Dh!==null&&Rh(Dh)&&(Dh=null),Oh!==null&&Rh(Oh)&&(Oh=null),kh!==null&&Rh(kh)&&(kh=null),Ah.forEach(zh),jh.forEach(zh)}function Vh(e,n){e.blockedOn===n&&(e.blockedOn=null,Eh||(Eh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Bh)))}var Hh=null;function Uh(e){Hh!==e&&(Hh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Hh===e&&(Hh=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(wh(r||n)===null)continue;break}var a=Tt(n);a!==null&&(e.splice(t,3),t-=3,qs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Wh(e){function t(t){return Vh(t,e)}Dh!==null&&Vh(Dh,e),Oh!==null&&Vh(Oh,e),kh!==null&&Vh(kh,e),Ah.forEach(t),jh.forEach(t);for(var n=0;n<Mh.length;n++){var r=Mh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Mh.length&&(n=Mh[0],n.blockedOn===null);)Lh(n),n.blockedOn===null&&Mh.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[ht]||null;if(typeof a==`function`)o||Uh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ht]||null)s=o.formAction;else if(wh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Uh(n)}}}function Gh(){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 Kh(e){this._internalRoot=e}qh.prototype.render=Kh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ph(n,Ad(),e,t,null,null)},qh.prototype.unmount=Kh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ph(e.current,2,null,e,null,null),Rd(),t[gt]=null}};function qh(e){this._internalRoot=e}qh.prototype.unstable_scheduleHydration=function(e){if(e){var t=dt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Mh.length&&t!==0&&t<Mh[n].priority;n++);Mh.splice(n,0,e),n===0&&Lh(e)}};var Jh=n.version;if(Jh!==`19.3.1`)throw Error(i(527,Jh,`19.3.1`));se.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 Yh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:W,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Xh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xh.isDisabled&&Xh.supportsFiber)try{K=Xh.inject(Yh),He=Xh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=gc,s=_c,c=vc;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=dh(e,1,!1,null,null,n,r,null,o,s,c,Gh),e[gt]=t.current,Gf(e),new Kh(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()})),_=c(u(),1),v=g(),y=[`Shift`,`Meta`,`Alt`,`Control`],b=1e3,x=`keydown`,S=typeof navigator==`object`?navigator.platform:``,C=/Mac|iPod|iPhone|iPad/.test(S)?`Meta`:`Control`,w=S===`Win32`?[`Control`,`Alt`]:[`Alt`];function T(e){return!!(e.key&&e.code&&e.getModifierState)}function E(e){let t=e.target;return e.repeat||e.isComposing||t!==e.currentTarget&&t.matches(`[contenteditable],input,select,textarea`)}function D(e,t){return typeof e.getModifierState==`function`?e.getModifierState(t)||w.includes(t)&&e.getModifierState(`AltGraph`):!1}function O(e){return e.trim().split(` `).map(e=>{let t=e.split(/(?<=\w|\])\+/),n=t.pop(),r=n.match(/^\((.+)\)$/),i=r?RegExp(`^(?:${r[1]})$`,`iv`):n,a=[],o=[];for(let e of t){let t=e.match(/^\[(.*)\]$/),n=t?.[1]??e;n=n===`$mod`?C:n,t?o.push(n):a.push(n)}return[a,o,i]})}function k(e,[t,n,r]){let i=t.includes(`AltGraph`);return!((r instanceof RegExp?!(r.test(e.key)||r.test(e.code)):r.toUpperCase()!==e.key.toUpperCase()&&r!==e.code)||t.find(t=>!D(e,t))||y.find(a=>!t.includes(a)&&!n.includes(a)&&r!==a&&D(e,a)&&!(i&&w.includes(a))))}function A(e,t={}){let n=t.timeout??b,r=t.ignore??E,i=Object.keys(e).map(t=>[t,O(t),e[t]]),a=new Map,o=null;return e=>{if(!T(e)||r(e))return;let t=[];for(let[n,r,o]of i){let[i,...s]=a.get(n)||r;if(!k(e,i))D(e,e.key)||a.delete(n);else if(s.length>0)a.set(n,s),t.push(n);else if(a.delete(n),t.length)console.warn(`tinykeys: Conflict found, "${n}" did not fire, waiting for:`,t);else{o(e);break}}o&&clearTimeout(o),o=setTimeout(()=>a.clear(),n)}}function j(e,t,n={}){let r=n.event??x,i=A(t,n);return e.addEventListener(r,i,n.capture),()=>{e.removeEventListener(r,i,n.capture)}}var M=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},N=(e=>e?M(e):M),P=e=>e;function F(e,t=P){let n=_.useSyncExternalStore(e.subscribe,_.useCallback(()=>t(e.getState()),[e,t]),()=>t(e.getInitialState()));return _.useDebugValue(n),n}var I=e=>Symbol.iterator in e,L=e=>`entries`in e,R=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},z=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function B(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:I(e)&&I(t)?L(e)&&L(t)?R(e,t):z(e,t):R({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function V(e){let t=_.useRef(void 0);return n=>{let r=e(n);return B(t.current,r)?t.current:t.current=r}}var ee={$mod:`⌘`,Meta:`⌘`,Control:`⌃`,Alt:`⌥`,Shift:`⇧`},te=[`Control`,`Alt`,`Shift`,`$mod`,`Meta`],ne={$mod:`Ctrl`,Meta:`Win`,Control:`Ctrl`,Alt:`Alt`,Shift:`Shift`},re={Backslash:`\\`,BracketLeft:`[`,BracketRight:`]`,Equal:`=`,Minus:`-`,Escape:`Esc`,Enter:`↵`,Backspace:`⌫`,Tab:`Tab`,ArrowUp:`↑`,ArrowDown:`↓`,ArrowLeft:`←`,ArrowRight:`→`},H=/Mac|iPod|iPhone|iPad/.test(navigator.platform);function U(e,t=H){return ie(e,t).join(t?``:`+`)}function ie(e,t=H){let n=e.split(`+`),r=n.pop()??``,i=t?ee:ne,a=t?[...n].sort((e,t)=>te.indexOf(e)-te.indexOf(t)):n;return[...(ae(r)?a.filter(e=>e!==`Shift`):a).map(e=>i[e]??e),oe(r)]}function ae(e){return e.length===1&&!/[a-z0-9]/i.test(e)}function oe(e){return re[e]||(/^(?:Key|Digit)(.)$/.exec(e)?.[1]??e).toUpperCase()}var W=new Set([`Backquote`,`Backslash`,`BracketLeft`,`BracketRight`,`Comma`,`Equal`,`Minus`,`Period`,`Quote`,`Semicolon`,`Slash`]);function se(e){let t=e.split(`+`),n=t.pop()??``;return t.some(e=>e!==`Shift`)?!1:n.length===1||/^(?:Key|Digit).$/.test(n)||W.has(n)}var ce=`frameboard.characterKeys`;function le(e){let t=N()(()=>({on:me(e)}));return t.subscribe((t,n)=>{t.on!==n.on&&he(e,t.on)}),t}function ue(e,t=_e){t.setState({on:e})}function de(e=_e){return e.getState().on}function fe(e=_e){return F(e,e=>e.on)}function pe(e,t=de()){return e?.find(e=>t||!se(e))}function me(e){try{return e?.getItem(ce)!==`off`}catch{return!0}}function he(e,t){try{e?.setItem(ce,t?`on`:`off`)}catch{}}function ge(){try{return window.localStorage}catch{return null}}var _e=le(ge()),ve=N()(()=>({actions:[],version:0}));function ye(e){return ve.setState(t=>({actions:[...t.actions,...e]})),()=>ve.setState(t=>({actions:t.actions.filter(t=>!e.includes(t))}))}function G(){ve.setState(e=>({version:e.version+1}))}function be(e){return e.enabled?.()??!0}function xe(e){return F(ve,V(t=>[t.version,...e.map(e=>t.actions.find(t=>t.id===e))])).slice(1)}function Se(e){return ve.getState().actions.find(t=>t.id===e)}function Ce(){return F(ve,V(e=>{let t=new Set,n=e.actions.filter(e=>!e.command||t.has(e.id)?!1:(t.add(e.id),be(e)));return[e.version,...n]})).slice(1)}function we(e){return F(ve,V(t=>[t.version,...t.actions.filter(t=>t.group===e)])).slice(1)}function Te(e,t){let n=n=>{let r=new Set(n.flatMap(e=>e.keys??[]).filter(e=>!t||t.includes(e)));return j(e,Object.fromEntries([...r].map(e=>[e,t=>Ee(e,t)])),{ignore:De})},r=n(ve.getState().actions),i=ve.subscribe((e,t)=>{e.actions!==t.actions&&(r(),r=n(e.actions))});return()=>{i(),r()}}function Ee(e,t){if(se(e)&&!de())return;let n=ve.getState().actions.find(t=>t.keys?.includes(e)&&be(t));n&&(t.preventDefault(),n.run())}function De(e){let t=e.target;return typeof t?.matches==`function`?E(e)||t.isContentEditable?!0:t.closest?.(`[data-slot="toast"]`)==null?t.closest?.(`[role="dialog"]`)!=null:e.key===`Enter`:!1}var Oe=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function ke(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Oe(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Ae=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},je=e=>{let t=Ae(e);return t.charAt(0).toUpperCase()+t.slice(1)},Me=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Ne={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Pe(e){return e!=null}function Fe(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Ne.width,a=e.size??e.height??Ne.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?Me(...c):Me(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Ne[`stroke-width`])*Number(e.size??e.width??Ne.width)/Number(t.size??t.width??Ne.width):t.strokeWidth??Ne[`stroke-width`];return[`svg`,{...Object.entries(Ne).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Pe(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Pe(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Pe(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function Ie(e,t={}){return Fe(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Le=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Re=(0,_.createContext)({});function ze({children:e,size:t,color:n,strokeWidth:r,absoluteStrokeWidth:i,nonScalingStroke:a,className:o}){let s=(0,_.useMemo)(()=>({size:t,color:n,strokeWidth:r,absoluteStrokeWidth:i,nonScalingStroke:a,className:o}),[t,n,r,i,a,o]);return(0,_.createElement)(Re.Provider,{value:s},e)}var Be=()=>(0,_.useContext)(Re),Ve=(0,_.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:v=`currentColor`,className:y=``}=Be()??{},b=!!c||Le(d),[x,S,C=[]]=Ie(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Me(y,s),hasA11yProp:b,attributes:d});return(0,_.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function K(e,t=[],n=[]){let r=typeof e==`string`?ke(e,t,n):e,i=(0,_.forwardRef)(({className:e,...t},n)=>(0,_.createElement)(Ve,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=je(r.name)),i}var He={name:`align-center-horizontal`,size:24,node:[[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`M10 16v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4`,key:`11f1s0`}],[`path`,{d:`M10 8V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4`,key:`t14dx9`}],[`path`,{d:`M20 16v1a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-1`,key:`1w07xs`}],[`path`,{d:`M14 8V7c0-1.1.9-2 2-2h2a2 2 0 0 1 2 2v1`,key:`1apec2`}]]};He.node;var Ue=K(He),We={name:`align-center-vertical`,size:24,node:[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4`,key:`14d6g8`}],[`path`,{d:`M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4`,key:`1e2lrw`}],[`path`,{d:`M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1`,key:`1fkdwx`}],[`path`,{d:`M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1`,key:`1euafb`}]]};We.node;var Ge=K(We),Ke={name:`align-end-horizontal`,size:24,node:[[`rect`,{width:`6`,height:`16`,x:`4`,y:`2`,rx:`2`,key:`z5wdxg`}],[`rect`,{width:`6`,height:`9`,x:`14`,y:`9`,rx:`2`,key:`um7a8w`}],[`path`,{d:`M22 22H2`,key:`19qnx5`}]]};Ke.node;var qe=K(Ke),Je={name:`align-end-vertical`,size:24,node:[[`rect`,{width:`16`,height:`6`,x:`2`,y:`4`,rx:`2`,key:`10wcwx`}],[`rect`,{width:`9`,height:`6`,x:`9`,y:`14`,rx:`2`,key:`4p5bwg`}],[`path`,{d:`M22 22V2`,key:`12ipfv`}]]};Je.node;var Ye=K(Je),Xe={name:`align-horizontal-distribute-center`,size:24,node:[[`rect`,{width:`6`,height:`14`,x:`4`,y:`5`,rx:`2`,key:`1wwnby`}],[`rect`,{width:`6`,height:`10`,x:`14`,y:`7`,rx:`2`,key:`1fe6j6`}],[`path`,{d:`M17 22v-5`,key:`4b6g73`}],[`path`,{d:`M17 7V2`,key:`hnrr36`}],[`path`,{d:`M7 22v-3`,key:`1r4jpn`}],[`path`,{d:`M7 5V2`,key:`liy1u9`}]]};Xe.node;var Ze=K(Xe),Qe={name:`align-horizontal-space-between`,size:24,node:[[`rect`,{width:`6`,height:`14`,x:`3`,y:`5`,rx:`2`,key:`j77dae`}],[`rect`,{width:`6`,height:`10`,x:`15`,y:`7`,rx:`2`,key:`bq30hj`}],[`path`,{d:`M3 2v20`,key:`1d2pfg`}],[`path`,{d:`M21 2v20`,key:`p059bm`}]]};Qe.node;var $e=K(Qe),et={name:`align-start-horizontal`,size:24,node:[[`rect`,{width:`6`,height:`16`,x:`4`,y:`6`,rx:`2`,key:`1n4dg1`}],[`rect`,{width:`6`,height:`9`,x:`14`,y:`6`,rx:`2`,key:`17khns`}],[`path`,{d:`M22 2H2`,key:`fhrpnj`}]]};et.node;var tt=K(et),nt={name:`align-start-vertical`,size:24,node:[[`rect`,{width:`9`,height:`6`,x:`6`,y:`14`,rx:`2`,key:`lpm2y7`}],[`rect`,{width:`16`,height:`6`,x:`6`,y:`4`,rx:`2`,key:`rdj6ps`}],[`path`,{d:`M2 2v20`,key:`1ivd8o`}]]};nt.node;var rt=K(nt),it={name:`align-vertical-distribute-center`,size:24,node:[[`path`,{d:`M22 17h-3`,key:`1lwga1`}],[`path`,{d:`M22 7h-5`,key:`o2endc`}],[`path`,{d:`M5 17H2`,key:`1gx9xc`}],[`path`,{d:`M7 7H2`,key:`6bq26l`}],[`rect`,{x:`5`,y:`14`,width:`14`,height:`6`,rx:`2`,key:`1qrzuf`}],[`rect`,{x:`7`,y:`4`,width:`10`,height:`6`,rx:`2`,key:`we8e9z`}]]};it.node;var at=K(it),ot={name:`archive-arrow-up`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]],aliases:[`archive-restore`]};ot.node;var st=K(ot),ct={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};ct.node;var lt=K(ct),ut={name:`arrow-down-up`,size:24,node:[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`m21 8-4-4-4 4`,key:`1c9v7m`}],[`path`,{d:`M17 4v16`,key:`7dpous`}]]};ut.node;var dt=K(ut),ft={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};ft.node;var pt=K(ft),mt={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};mt.node;var ht=K(mt),gt={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};gt.node;var _t=K(gt),vt={name:`arrow-up-down`,size:24,node:[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]};vt.node;var yt=K(vt),bt={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};bt.node;var xt=K(bt),St={name:`bring-to-front`,size:24,node:[[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`2`,key:`yj20xf`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2`,key:`1ltk23`}],[`path`,{d:`M14 20a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2`,key:`1q24h9`}]]};St.node;var Ct=K(St),wt={name:`calendar-plus`,size:24,node:[[`path`,{d:`M16 18h6`,key:`987eiv`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M19 15v6`,key:`10aioa`}],[`path`,{d:`M21 11.5V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h8.3`,key:`jgwkxf`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}]]};wt.node;var Tt=K(wt),Et={name:`case-lower`,size:24,node:[[`path`,{d:`M10 9v7`,key:`ylp826`}],[`path`,{d:`M14 6v10`,key:`1jy4vg`}],[`circle`,{cx:`17.5`,cy:`12.5`,r:`3.5`,key:`1a9481`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`3.5`,key:`2jlv1r`}]]};Et.node;var Dt=K(Et),Ot={name:`case-sensitive`,size:24,node:[[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M22 9v7`,key:`pvm9v3`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}],[`circle`,{cx:`18.5`,cy:`12.5`,r:`3.5`,key:`z97x68`}]]};Ot.node;var kt=K(Ot),At={name:`case-upper`,size:24,node:[[`path`,{d:`M15 11h4.5a1 1 0 0 1 0 5h-4a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h3a1 1 0 0 1 0 5`,key:`nxs35`}],[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}]]};At.node;var jt=K(At),Mt={name:`check-check`,size:24,node:[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]};Mt.node;var Nt=K(Mt),Pt={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Pt.node;var Ft=K(Pt),It={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};It.node;var Lt=K(It),Rt={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Rt.node;var zt=K(Rt),Bt={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Bt.node;var Vt=K(Bt),Ht={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};Ht.node;var Ut=K(Ht),Wt={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};Wt.node;var Gt=K(Wt),Kt={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};Kt.node;var qt=K(Kt),Jt={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Jt.node;var Yt=K(Jt),Xt={name:`clipboard-paste`,size:24,node:[[`path`,{d:`M11 14h10`,key:`1w8e9d`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v1.344`,key:`1e62lh`}],[`path`,{d:`m17 18 4-4-4-4`,key:`z2g111`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113`,key:`bjbb7m`}],[`rect`,{x:`8`,y:`2`,width:`8`,height:`4`,rx:`1`,key:`ublpy`}]]};Xt.node;var Zt=K(Xt),Qt={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};Qt.node;var $t=K(Qt),en={name:`columns-2`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]],aliases:[`columns`]};en.node;var tn=K(en),nn={name:`command`,size:24,node:[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]};nn.node;var rn=K(nn),an={name:`copy-plus`,size:24,node:[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};an.node;var on=K(an),sn={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};sn.node;var cn=K(sn),ln={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};ln.node;var un=K(ln),dn={name:`eighth-notes`,size:24,node:[[`path`,{d:`M21 16V3a1 1 0 0 0-1.28-.96l-10 2.917a1 1 0 0 0-.72.96V19`,key:`uy6ho8`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}],[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}]],aliases:[`music`]};dn.node;var fn=K(dn),pn={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};pn.node;var mn=K(pn),hn={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};hn.node;var gn=K(hn),_n={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};_n.node;var vn=K(_n),yn={name:`file-plus`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]};yn.node;var bn=K(yn),xn={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};xn.node;var Sn=K(xn),Cn={name:`fold-vertical`,size:24,node:[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3-3-3 3`,key:`e37ymu`}],[`path`,{d:`m15 5-3 3-3-3`,key:`19d6lf`}]]};Cn.node;var wn=K(Cn),Tn={name:`folder-minus`,size:24,node:[[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Tn.node;var En=K(Tn),Dn={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};Dn.node;var On=K(Dn),kn={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};kn.node;var An=K(kn),jn={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};jn.node;var Mn=K(jn),Nn={name:`frame`,size:24,node:[[`line`,{x1:`22`,x2:`2`,y1:`6`,y2:`6`,key:`15w7dq`}],[`line`,{x1:`22`,x2:`2`,y1:`18`,y2:`18`,key:`1ip48p`}],[`line`,{x1:`6`,x2:`6`,y1:`2`,y2:`22`,key:`a2lnyx`}],[`line`,{x1:`18`,x2:`18`,y1:`2`,y2:`22`,key:`8vb6jd`}]]};Nn.node;var Pn=K(Nn),Fn={name:`git-compare-arrows`,size:24,node:[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`,key:`16sdep`}],[`path`,{d:`m9 15 3 3-3 3`,key:`1m3kbl`}]]};Fn.node;var In=K(Fn),Ln={name:`hand`,size:24,node:[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]};Ln.node;var Rn=K(Ln),zn={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]};zn.node;var Bn=K(zn),Vn={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};Vn.node;var Hn=K(Vn),Un={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};Un.node;var Wn=K(Un),Gn={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};Gn.node;var Kn=K(Gn),qn={name:`layout-grid`,size:24,node:[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]};qn.node;var Jn=K(qn),Yn={name:`letter-spacing`,size:24,node:[[`path`,{d:`M15 14H9`,key:`u4f7rb`}],[`path`,{d:`M21 3v18`,key:`fnf4zc`}],[`path`,{d:`M3 3v18`,key:`k760nc`}],[`path`,{d:`m8 16 3.453-7.648a.6.6 0 011.094.001L16 16`,key:`16ilm2`}]]};Yn.node;var Xn=K(Yn),Zn={name:`line-height`,size:24,node:[[`path`,{d:`M15 14H9`,key:`u4f7rb`}],[`path`,{d:`M21 21H3`,key:`oafrgs`}],[`path`,{d:`M21 3H3`,key:`e9iw4c`}],[`path`,{d:`m8 16 3.453-7.648a.6.6 0 011.094.001L16 16`,key:`16ilm2`}]]};Zn.node;var Qn=K(Zn),$n={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]};$n.node;var er=K($n),tr={name:`link`,size:24,node:[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]};tr.node;var nr=K(tr),rr={name:`list-chevrons-up-down`,size:24,node:[[`path`,{d:`M3 5h8`,key:`18g2rq`}],[`path`,{d:`M3 12h8`,key:`1xfjp6`}],[`path`,{d:`M3 19h8`,key:`fpbke4`}],[`path`,{d:`m15 8 3-3 3 3`,key:`bc4io6`}],[`path`,{d:`m15 16 3 3 3-3`,key:`9wmg1l`}]]};rr.node;var ir=K(rr),ar={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]};ar.node;var or=K(ar),sr={name:`locate-fixed`,size:24,node:[[`line`,{x1:`2`,x2:`5`,y1:`12`,y2:`12`,key:`bvdh0s`}],[`line`,{x1:`19`,x2:`22`,y1:`12`,y2:`12`,key:`1tbv5k`}],[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`5`,key:`11lu5j`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}],[`circle`,{cx:`12`,cy:`12`,r:`7`,key:`fim9np`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};sr.node;var cr=K(sr),lr={name:`locate-off`,size:24,node:[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M12 2v3`,key:`qbqxhf`}],[`path`,{d:`M18.89 13.24a7 7 0 0 0-8.13-8.13`,key:`1v9jrh`}],[`path`,{d:`M19 12h3`,key:`osuazr`}],[`path`,{d:`M2 12h3`,key:`1wrr53`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M7.05 7.05a7 7 0 0 0 9.9 9.9`,key:`rc5l2e`}]]};lr.node;var ur=K(lr),dr={name:`lock-open`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]],aliases:[`unlock`]};dr.node;var fr=K(dr),pr={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};pr.node;var mr=K(pr),hr={name:`maximize`,size:24,node:[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]};hr.node;var gr=K(hr),_r={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};_r.node;var vr=K(_r),yr={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};yr.node;var br=K(yr),xr={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};xr.node;var Sr=K(xr),Cr={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};Cr.node;var wr=K(Cr),Tr={name:`mouse-pointer-2`,size:24,node:[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]};Tr.node;var Er=K(Tr),Dr={name:`move-horizontal`,size:24,node:[[`path`,{d:`m18 8 4 4-4 4`,key:`1ak13k`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}]]};Dr.node;var Or=K(Dr),kr={name:`octagon-x`,size:24,node:[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-octagon`]};kr.node;var Ar=K(kr),jr={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};jr.node;var Mr=K(jr),Nr={name:`panel-top`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};Nr.node;var Pr=K(Nr),Fr={name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]};Fr.node;var Ir=K(Fr),Lr={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};Lr.node;var Rr=K(Lr),zr={name:`pipette`,size:24,node:[[`path`,{d:`m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12`,key:`1y3wsu`}],[`path`,{d:`m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z`,key:`110lr1`}],[`path`,{d:`m2 22 .414-.414`,key:`jhxm08`}]]};zr.node;var Br=K(zr),Vr={name:`pin`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]};Vr.node;var Hr=K(Vr),Ur={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};Ur.node;var Wr=K(Ur),Gr={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Gr.node;var Kr=K(Gr),qr={name:`presentation`,size:24,node:[[`path`,{d:`M2 3h20`,key:`91anmk`}],[`path`,{d:`M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3`,key:`2k9sn8`}],[`path`,{d:`m7 21 5-5 5 5`,key:`bip4we`}]]};qr.node;var Jr=K(qr),Yr={name:`redo-2`,size:24,node:[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]]};Yr.node;var Xr=K(Yr),Zr={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};Zr.node;var Qr=K(Zr),$r={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};$r.node;var ei=K($r),ti={name:`scaling`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M14 15H9v-5`,key:`pi4jk9`}],[`path`,{d:`M16 3h5v5`,key:`1806ms`}],[`path`,{d:`M21 3 9 15`,key:`15kdhq`}]]};ti.node;var ni=K(ti),ri={name:`scan-eye`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`path`,{d:`M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0`,key:`11ak4c`}]]};ri.node;var ii=K(ri),ai={name:`scan-search`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m16 16-1.9-1.9`,key:`1dq9hf`}]]};ai.node;var oi=K(ai),si={name:`scan`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}]]};si.node;var ci=K(si),li={name:`scissors`,size:24,node:[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M8.12 8.12 12 12`,key:`1alkpv`}],[`path`,{d:`M20 4 8.12 15.88`,key:`xgtan2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M14.8 14.8 20 20`,key:`ptml3r`}]]};li.node;var ui=K(li),di={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};di.node;var fi=K(di),pi={name:`send-to-back`,size:24,node:[[`rect`,{x:`14`,y:`14`,width:`8`,height:`8`,rx:`2`,key:`1b0bso`}],[`rect`,{x:`2`,y:`2`,width:`8`,height:`8`,rx:`2`,key:`1x09vl`}],[`path`,{d:`M7 14v1a2 2 0 0 0 2 2h1`,key:`pao6x6`}],[`path`,{d:`M14 7h1a2 2 0 0 1 2 2v1`,key:`19tdru`}]]};pi.node;var mi=K(pi),hi={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]};hi.node;var gi=K(hi),_i={name:`share-2`,size:24,node:[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]};_i.node;var vi=K(_i),yi={name:`smartphone`,size:24,node:[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]};yi.node;var bi=K(yi),xi={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};xi.node;var Si=K(xi),Ci={name:`strikethrough`,size:24,node:[[`path`,{d:`M16 4H9a3 3 0 0 0-2.83 4`,key:`43sutm`}],[`path`,{d:`M14 12a4 4 0 0 1 0 8H6`,key:`nlfj13`}],[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}]]};Ci.node;var wi=K(Ci),Ti={name:`sun-moon`,size:24,node:[[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715`,key:`xlf6rm`}],[`path`,{d:`M16 12a4 4 0 0 0-4-4`,key:`6vsxu`}],[`path`,{d:`m19 5-1.256 1.256`,key:`1yg6a6`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}]]};Ti.node;var Ei=K(Ti),Di={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};Di.node;var Oi=K(Di),ki={name:`tablet`,size:24,node:[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,ry:`2`,key:`76otgf`}],[`line`,{x1:`12`,x2:`12.01`,y1:`18`,y2:`18`,key:`1dp563`}]]};ki.node;var Ai=K(ki),ji={name:`text-align-center`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M17 12H7`,key:`16if0g`}],[`path`,{d:`M19 19H5`,key:`vjpgq2`}]],aliases:[`align-center`]};ji.node;var Mi=K(ji),Ni={name:`text-align-end`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M21 19H7`,key:`4cu937`}]],aliases:[`align-right`]};Ni.node;var Pi=K(Ni),Fi={name:`text-align-justify`,size:24,node:[[`path`,{d:`M3 5h18`,key:`1u36vt`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 19h18`,key:`awlh7x`}]],aliases:[`align-justify`]};Fi.node;var Ii=K(Fi),Li={name:`text-align-start`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]],aliases:[`text`,`align-left`]};Li.node;var Ri=K(Li),zi={name:`text-wrap`,size:24,node:[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]],aliases:[`wrap-text`]};zi.node;var Bi=K(zi),Vi={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Vi.node;var Hi=K(Vi),Ui={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};Ui.node;var Wi=K(Ui),Gi={name:`triangles-centerline-dashed-horizontal`,size:24,node:[[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M7.298 20.288A1 1 0 008 22h8a1 1 0 00.703-1.712l-3.991-3.99a1 1 0 00-1.424-.001z`,key:`15ue1v`}],[`path`,{d:`M7.298 3.712A1 1 0 018 2h8a1 1 0 01.703 1.712l-3.991 3.99a1 1 0 01-1.424.001z`,key:`lzh03e`}]],aliases:[`flip-horizontal-2`]};Gi.node;var Ki=K(Gi),qi={name:`triangles-centerline-dashed-vertical`,size:24,node:[[`path`,{d:`M12 14v2`,key:`8jcxud`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 8v2`,key:`1woqiv`}],[`path`,{d:`M20.288 16.703A1 1 0 0022 16V8a1 1 0 00-1.712-.703l-3.99 3.991a1 1 0 00-.001 1.424z`,key:`1ewq2t`}],[`path`,{d:`M3.712 16.703A1 1 0 012 16V8a1 1 0 011.712-.703l3.99 3.991a1 1 0 01.001 1.424z`,key:`1c1klx`}]],aliases:[`flip-vertical-2`]};qi.node;var Ji=K(qi),Yi={name:`type`,size:24,node:[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]};Yi.node;var Xi=K(Yi),Zi={name:`underline`,size:24,node:[[`path`,{d:`M6 4v6a6 6 0 0 0 12 0V4`,key:`9kb039`}],[`line`,{x1:`4`,x2:`20`,y1:`20`,y2:`20`,key:`nun2al`}]]};Zi.node;var Qi=K(Zi),$i={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};$i.node;var ea=K($i),ta={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};ta.node;var na=K(ta),ra={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};ra.node;var ia=K(ra),aa={name:`zoom-in`,size:24,node:[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]};aa.node;var oa=K(aa),sa={name:`zoom-out`,size:24,node:[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]};sa.node;var ca=K(sa);function la(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(n),s+=i[1]===`?`?`(?:/(.*))?`:`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var ua=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})),da=o(((e,t)=>{t.exports=ua()})),fa=da(),pa=_.useInsertionEffect,ma=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?_.useLayoutEffect:_.useEffect,ha=pa||ma,ga=e=>{let t=_.useRef([e,(...e)=>t[0](...e)]).current;return ha(()=>{t[0]=e}),t[1]},_a=[`popstate`,`pushState`,`replaceState`,`hashchange`],va=[],ya=()=>va.forEach(e=>e()),ba=e=>(va.push(e)===1&&_a.forEach(e=>addEventListener(e,ya)),()=>{va=va.filter(t=>t!==e),va.length||_a.forEach(e=>removeEventListener(e,ya))}),xa=(e,t)=>(0,fa.useSyncExternalStore)(ba,e,t),Sa=()=>location.search,Ca=({ssrSearch:e}={})=>xa(Sa,e==null?Sa:()=>e),wa=()=>location.pathname,Ta=({ssrPath:e}={})=>xa(wa,e==null?wa:()=>e),Ea=(e,{replace:t=!1,state:n=null}={})=>history[t?`replaceState`:`pushState`](n,``,e),Da=e=>[Ta(e),Ea],Oa=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[Oa]===void 0){for(let e of[`pushState`,`replaceState`]){let t=history[e];history[e]=function(){let n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,Oa,{value:!0})}var ka=(e=``)=>e===`/`?``:e,Aa=(e,t)=>e[0]===`~`?e.slice(1):ka(t)+e,ja=(e,t)=>(e=Ma(ka(e)),t=Ma(t),!e||(t.toLowerCase()+`/`).startsWith(e.toLowerCase()+`/`)?t.slice(e.length)||`/`:`~`+t),Ma=e=>{try{return e.includes(`%`)?decodeURI(e):e}catch{return e}},Na={hook:Da,searchHook:Ca,parser:la,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,n)=>e(t,n)},Pa=(0,_.createContext)(Na),Fa=()=>(0,_.useContext)(Pa),Ia={},La=(0,_.createContext)(Ia),Ra=()=>(0,_.useContext)(La),za=(e,t=e.base)=>ja(t,e.hook(e)[0]),Ba=e=>{let[t,n]=e.hook(e);return[ja(e.base,t),ga((t,r)=>e.aroundNav(n,Aa(t,e.base),r))]},Va=()=>Ba(Fa()),Ha=(e,t,n,r)=>{let{pattern:i,keys:a}=t instanceof RegExp?{pattern:t}:e(t||`*`,r),o=i.exec(n);if(!o)return[!1,null];let s={};for(let e=1;e<o.length;e++)s[e-1]=o[e];if(a)for(let e=0;e<a.length;e++)s[a[e]]=o[e+1];else Object.assign(s,o.groups);return r?[!0,s,o[0]]:[!0,s]},Ua=e=>{let t=Fa(),n=/^~\//.test(e);return Ha(t.parser,n?e.slice(1):e,za(t,n?``:t.base))},Wa=({children:e,...t})=>{let n=Fa(),r=t.hook?Na:n,i=r;if(t.ssrPath){let[e,n=t.ssrSearch??``]=t.ssrPath.split(`?`);e&&(t.ssrSearch=n,t.ssrPath=e)}t.hrefs=t.hrefs??t.hook?.hrefs,t.searchHook=t.searchHook??t.hook?.searchHook;let a=(0,_.useRef)(r),o=a.current,s=o;for(let e in r){let n=e===`base`?r[e]+(t[e]??``):t[e]??r[e];n!==s[e]&&(o===s&&(a.current=s={...s}),s[e]=n),(n!==r[e]||n!==i[e])&&(i=s)}return(0,_.createElement)(Pa.Provider,{value:i},e)},Ga=({children:e,component:t},n)=>t?(0,_.createElement)(t,{params:n}):typeof e==`function`?e(n):e,Ka=e=>{let t=(0,_.useRef)(Ia),n=t.current,r=Object.keys(e);return t.current=r.length!==Object.keys(n).length||r.some(t=>e[t]!==n[t])?e:n},qa=({path:e,nest:t,match:n,...r})=>{let i=Fa(),a=za(i),[o,s,c]=n??Ha(i.parser,e,a,t),l=Ka({...Ra(),...s});if(!o)return null;let u=Ga(r,l);return(0,_.createElement)(La.Provider,{value:l},c?(0,_.createElement)(Wa,{base:c},u):u)},Ja=(0,_.forwardRef)((e,t)=>{let n=Fa(),[r,i]=Ba(n),{to:a=``,href:o=a,onClick:s,asChild:c,children:l,className:u,replace:d,state:f,transition:p,...m}=e;return m.onClick=ga(t=>{t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button!==0||(s?.(t),t.defaultPrevented||(t.preventDefault(),i(o,e)))}),m.href=n.hrefs(o[0]===`~`?o.slice(1):n.base+o,n),u!==void 0&&(m.className=u?.call?u(r===o):u),t&&(m.ref=t),c&&(0,_.isValidElement)(l)?(0,_.cloneElement)(l,m):(0,_.createElement)(`a`,m,l)}),Ya=(e,t=[])=>{if(Array.isArray(e))for(let n of e)Ya(n&&n.type===_.Fragment?n.props.children:n,t);else t.push(e);return t},Xa=({children:e,location:t})=>{let n=Fa(),r=za(n);for(let i of Ya(e)){let e=0;if((0,_.isValidElement)(i)&&(e=Ha(n.parser,i.props.path,t||r,i.props.nest))[0])return(0,_.cloneElement)(i,{match:e})}return null},Za=e=>{let{to:t,href:n=t}=e,r=Fa(),[,i]=Ba(r),a=ga(()=>i(t||n,e)),{ssrContext:o}=r;return ma(()=>{a()},[]),o&&(o.redirectTo=t),null};function Qa(){}var $a=Object.freeze([]),eo=Object.freeze({});function to(e){_.useEffect(e,$a)}var no={};function ro(e,t){let n=_.useRef(no);return n.current===no&&(n.current=e(t)),n}var q=typeof document<`u`?_.useLayoutEffect:()=>{};function io(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var ao=io(`https://base-ui.com/production-error`,`Base UI`),oo=_.createContext(void 0);function so(){let e=_.useContext(oo);if(!e)throw Error(ao(73));return e}var co=o((e=>{var t=u(),n=da();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}})),lo=o(((e,t)=>{t.exports=co()})),uo=19;function fo(e){return uo>=e}var po=[],mo=void 0;function ho(){return mo}function go(e){po.push(e)}function _o(e){let t=(t,n)=>{let r=ro(yo).current,i;try{mo=r;for(let e of po)e.before(r);i=e(t,n);for(let e of po)e.after(r);r.didInitialize=!0}finally{mo=void 0}return i};return t.displayName=e.displayName||e.name,t}function vo(e){return _.forwardRef(_o(e))}function yo(){return{didInitialize:!1}}var bo=lo(),xo=fo(19)?wo:To;function So(e,t,n,r,i){return xo(e,t,n,r,i)}function Co(e,t,n,r,i){let a=_.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,fa.useSyncExternalStore)(e.subscribe,a,a)}go({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,fa.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function wo(e,t,n,r,i){let a=ho();if(!a)return Co(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function To(e,t,n,r,i){return(0,bo.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Eo=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return So(this,e,t,n,r)}},Do={..._},Oo=Do.useInsertionEffect,ko=Oo&&Oo!==Do.useLayoutEffect?Oo:e=>e();function J(e){let t=ro(Ao).current;return t.next=e,ko(t.effect),t.trampoline}function Ao(){let e={next:void 0,callback:jo,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function jo(){}var Mo=class extends Eo{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){_.useDebugValue(e);let n=this;q(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;q(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){_.useDebugValue(e);let n=this,r=t!==void 0;q(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return _.useDebugValue(e),So(this,this.selectors[e],t,n,r)}useContextCallback(e,t){_.useDebugValue(e);let n=J(t??Qa);this.context[e]=n}useStateSetter(e){let t=_.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};function No(){return typeof window<`u`}function Po(e){return Io(e)?(e.nodeName||``).toLowerCase():`#document`}function Y(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Fo(e){return((Io(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Io(e){return No()?e instanceof Node||e instanceof Y(e).Node:!1}function Lo(e){return No()?e instanceof Element||e instanceof Y(e).Element:!1}function Ro(e){return No()?e instanceof HTMLElement||e instanceof Y(e).HTMLElement:!1}function zo(e){return!No()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Y(e).ShadowRoot}function Bo(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Zo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Vo(e){return/^(table|td|th)$/.test(Po(e))}function Ho(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Uo=/transform|translate|scale|rotate|perspective|filter/,Wo=/paint|layout|strict|content/,Go=e=>!!e&&e!==`none`,Ko;function qo(e){let t=Lo(e)?Zo(e):e;return Go(t.transform)||Go(t.translate)||Go(t.scale)||Go(t.rotate)||Go(t.perspective)||!Yo()&&(Go(t.backdropFilter)||Go(t.filter))||Uo.test(t.willChange||``)||Wo.test(t.contain||``)}function Jo(e){let t=$o(e);for(;Ro(t)&&!Xo(t);){if(qo(t))return t;if(Ho(t))return null;t=$o(t)}return null}function Yo(){return Ko??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ko}function Xo(e){return/^(html|body|#document)$/.test(Po(e))}function Zo(e){return Y(e).getComputedStyle(e)}function Qo(e){return Lo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $o(e){if(Po(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||zo(e)&&e.host||Fo(e);return zo(t)?t.host:t}function es(e){let t=$o(e);return Xo(t)?(e.ownerDocument||e).body:Ro(t)&&Bo(t)?t:es(t)}function ts(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=es(e),i=r===e.ownerDocument?.body,a=Y(r);if(i){let e=ns(a);return t.concat(a,a.visualViewport||[],Bo(r)?r:[],e&&n?ts(e):[])}return t.concat(r,ts(r,[],n))}function ns(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function rs(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function is(e){return e?.ownerDocument||document}function as(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function os(){let[,e]=_.useState({});return _.useCallback(()=>{e({})},[])}var ss=null;globalThis.requestAnimationFrame;var cs=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},ls=class e{static create(){return new e}static request(e){return cs.request(e)}static cancel(e){return cs.cancel(e)}currentId=ss;request(e){this.cancel(),this.currentId=cs.request(()=>{this.currentId=ss,e()})}cancel=()=>{this.currentId!==ss&&(cs.cancel(this.currentId),this.currentId=ss)};disposeEffect=()=>this.cancel};function us(){let e=ro(ls.create).current;return to(e.disposeEffect),e}var ds=0,fs=class e{static create(){return new e}currentId=ds;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ds,t()},e)}isStarted(){return this.currentId!==ds}clear=()=>{this.currentId!==ds&&(clearTimeout(this.currentId),this.currentId=ds)};disposeEffect=()=>this.clear};function ps(){let e=ro(fs.create).current;return to(e.disposeEffect),e}var ms=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})),hs=o(((e,t)=>{t.exports=ms()})),gs=0;function _s(e){return gs+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${gs}`}function vs(e,t){if(typeof e==`string`)return{description:e};if(typeof e==`function`){let n=e(t);return typeof n==`string`?{description:n}:n}return e}function ys(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:bs,platform:xs,maxTouchPoints:Ss}=ys(),Cs=bs.toLowerCase(),ws=xs.toLowerCase(),Ts=/^i(os$|p)/.test(ws)||ws===`macintel`&&Ss>1,Es=`android`,Ds=ws===Es||Cs.includes(Es),Os=!Ts&&ws.startsWith(`mac`);ws.startsWith(`win`),!Ds&&/^(linux|chrome os)/.test(ws);var ks=Os||Ts,As=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),js=!As&&Cs.includes(`firefox`);!As&&Cs.includes(`chrom`);var Ms=ks,Ns=/jsdom|happydom/.test(Cs);function Ps(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function X(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&zo(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Fs(e,t){let n=e;for(;n;){if(Lo(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(zo(n)?n.host:null)}return null}function Is(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Ls=`data-base-ui-focusable`,Rs=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,zs=`ArrowLeft`,Bs=`ArrowRight`,Vs=`ArrowUp`,Hs=`ArrowDown`,Us=`data-starting-style`,Ws=`data-ending-style`,Gs={[Us]:``},Ks={[Ws]:``},qs={transitionStatus(e){return e===`starting`?Gs:e===`ending`?Ks:null}},Js=`data-open`,Ys=`data-closed`,Xs=`data-anchor-hidden`,Zs=`data-popup-open`,Qs=`data-pressed`,$s={[Zs]:``},ec={[Zs]:``,[Qs]:``},tc={[Js]:``},nc={[Ys]:``},rc={[Xs]:``},ic={open(e){return e?$s:null}},ac={open(e){return e?ec:null}},oc={open(e){return e?tc:nc},anchorHidden(e){return e?rc:null}},sc={...oc,...qs},cc=`data-trigger-disabled`;function lc(e,t){if(!Lo(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(cc);for(let[,e]of t.entries())if(X(e,n))return!e.hasAttribute(cc);return!1}function uc(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function dc(e){return e.matches(`html,body`)}function fc(e){return Ro(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function pc(e){return Fs(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Rs}`)!=null}function mc(e){return e?e.getAttribute(`role`)===`combobox`&&fc(e):!1}function hc(e){if(!e||Ns)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function gc(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function _c(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],..._c(e,t.id,n)])}function vc(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function yc(e){e.preventDefault(),e.stopPropagation()}function bc(e){return`nativeEvent`in e}function xc(e){return e.pointerType===``&&e.isTrusted?!0:Ds&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Sc(e){return Ns?!1:!Ds&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(Ds||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Cc(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function wc(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Tc=Math.min,Ec=Math.max,Dc=Math.round,Oc=Math.floor,kc=e=>({x:e,y:e}),Ac={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function jc(e,t,n){return Ec(e,Tc(t,n))}function Mc(e,t){return typeof e==`function`?e(t):e}function Nc(e){return e.split(`-`)[0]}function Pc(e){return e.split(`-`)[1]}function Fc(e){return e===`x`?`y`:`x`}function Ic(e){return e===`y`?`height`:`width`}function Lc(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Rc(e){return Fc(Lc(e))}function zc(e,t,n){n===void 0&&(n=!1);let r=Pc(e),i=Rc(e),a=Ic(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Jc(o)),[o,Jc(o)]}function Bc(e){let t=Jc(e);return[Vc(e),t,Vc(t)]}function Vc(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Hc=[`left`,`right`],Uc=[`right`,`left`],Wc=[`top`,`bottom`],Gc=[`bottom`,`top`];function Kc(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Uc:Hc:t?Hc:Uc;case`left`:case`right`:return t?Wc:Gc;default:return[]}}function qc(e,t,n,r){let i=Pc(e),a=Kc(Nc(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Vc)))),a}function Jc(e){let t=Nc(e);return Ac[t]+e.slice(t.length)}function Yc(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Xc(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Yc(e)}function Zc(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 Qc(e,t){return t<0||t>=e.length}function $c(e,t){return nl(e.current,{disabledIndices:t})}function el(e,t){return nl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function tl(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>nl(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:Qc(e,u)?-1:u,wrapped:d}}function nl(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&rl(e,a,r));return a}function rl(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!al(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function il(e){return e.visibility===`hidden`||e.visibility===`collapse`}function al(e,t=e?Zo(e):null){return!e||!e.isConnected||!t||il(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var ol=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function sl(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return zo(n)?n.host:null}function cl(e){for(let t of Array.from(e.children))if(Po(t)===`summary`)return t;return null}function ll(e,t){let n=cl(t);return!!n&&(e===n||X(n,e))}function ul(e){let t=e?Po(e):``;return e!=null&&e.matches(ol)&&(t!==`summary`||e.parentElement!=null&&Po(e.parentElement)===`details`&&cl(e.parentElement)===e)&&(t!==`details`||cl(e)==null)&&(t!==`input`||e.type!==`hidden`)}function dl(e){if(!ul(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=sl(t)){let n=t!==e,r=Po(t)===`slot`;if(t.hasAttribute(`inert`)||n&&Po(t)===`details`&&!t.open&&!ll(e,t)||t.hasAttribute(`hidden`)||!r&&!fl(t,n))return!1}return!0}function fl(e,t){let n=Zo(e);return t?n.display!==`none`:al(e,n)}function pl(e){let t=e.tabIndex;if(t<0){let t=Po(e);if(t===`details`||t===`audio`||t===`video`||Ro(e)&&e.isContentEditable)return 0}return t}function ml(e){if(Po(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function hl(e,t){let n=ml(e);if(!n)return!0;let r=t.find(e=>{let t=ml(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=ml(e);return t?.name===n.name&&t.form===n.form})===n}function gl(e){if(Ro(e)&&Po(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Ro(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function _l(e,t){gl(e).forEach(e=>{ul(e)&&t.push(e),_l(e,t)})}function vl(e,t,n){gl(e).forEach(e=>{Ro(e)&&e.matches(t)&&n.push(e),vl(e,t,n)})}function yl(e){return dl(e)&&pl(e)>=0}function bl(e){let t=[];return _l(e,t),t.filter(dl)}function xl(e){let t=bl(e);return t.filter(e=>pl(e)>=0&&hl(e,t))}function Sl(e,t){let n=xl(e),r=n.length;if(r===0)return;let i=Ps(is(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Cl(e){return Sl(is(e).body,1)||e}function wl(e){return Sl(is(e).body,-1)||e}function Tl(e,t,n){if(!e)return null;let r=[];_l(is(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(dl);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!X(n,o)&&yl(o)&&hl(o,a))return o}return r[i]}function El(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!X(n,r)}function Dl(e){xl(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Ol(e){let t=[];vl(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function kl(e){let t=new Map,n=0,r=0;return e.forEach((e,i)=>{let a=e.transitionStatus===`ending`;t.set(e.id,{value:e,domIndex:i,visibleIndex:a?-1:n,offsetY:r}),r+=e.height||0,a||(n+=1)}),t}function Al(e,t){let n=0;return e.map(e=>{if(e.transitionStatus===`ending`)return e;let r=n>=t;return n+=1,e.limited===r?e:{...e,limited:r}})}var jl={toasts:e=>e.toasts,isEmpty:e=>e.toasts.length===0,toast:(e,t)=>e.toastMetadata.get(t)?.value,toastIndex:(e,t)=>e.toastMetadata.get(t)?.domIndex??-1,toastOffsetY:(e,t)=>e.toastMetadata.get(t)?.offsetY??0,toastVisibleIndex:(e,t)=>e.toastMetadata.get(t)?.visibleIndex??-1,focused:e=>e.focused,expanded:e=>e.hovering||e.focused,expandedOrOutOfFocus:e=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:e=>e.prevFocusElement},Ml=class extends Mo{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:kl(e.toasts)},{},jl)}setViewport=e=>{this.set(`viewport`,e)};syncProviderProps(e,t){let n=this.state.limit!==t;if(this.state.timeout===e&&!n)return;let r={timeout:e,limit:t};if(n){let e=Al(this.state.toasts,t);r.toasts=e,r.toastMetadata=kl(e)}this.update(r)}disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t=!1){let n=jl.toastIndex(this.state,e);if(n===-1)return;let r=this.state.toasts[n];t||r?.onRemove?.();let i=[...this.state.toasts];i.splice(n,1),this.setToasts(i)}addToast=e=>{let{timeout:t,limit:n}=this.state,r=e.id||_s(`toast`);if(e.id){let t=jl.toast(this.state,e.id);if(t){if(t.transitionStatus===`ending`)this.removeToast(e.id,!0);else{let{id:t,transitionStatus:n,...r}=e;return this.updateToastInternal(e.id,r,!0,!0),e.id}}}let i={...e,id:r,updateKey:0,transitionStatus:`starting`},a=[i,...this.state.toasts];this.setToasts(Al(a,n));let o=i.timeout??t;return i.type!==`loading`&&o>0&&this.scheduleTimer(r,o,()=>this.closeToast(r)),jl.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),r};updateToast=(e,t)=>{let n=jl.toast(this.state,e);n&&n.transitionStatus!==`ending`&&this.updateToastInternal(e,typeof t==`function`?t(n):t,!1,!0)};updateToastInternal=(e,t,n=!1,r=!1)=>{let{timeout:i,toasts:a}=this.state,o=jl.toast(this.state,e);if(!o||o.transitionStatus===`ending`)return;let s={...o,...t,...r&&{updateKey:o.updateKey+1}};this.setToasts(a.map(t=>t.id===e?s:t));let c=s.timeout??i,l=o.timeout??i,u=Object.hasOwn(t,`timeout`),d=s.transitionStatus!==`ending`&&s.type!==`loading`&&c>0,f=this.timers.has(e),p=l!==c,m=o.type===`loading`;!d&&f?this.clearTimer(e):d&&(!f||p||u||m||n)&&(this.clearTimer(e),this.scheduleTimer(e,c,()=>this.closeToast(e)),jl.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=e=>{let t=e===void 0,{limit:n,toasts:r}=this.state,i;if(t)i=r,this.clearTimers();else{let t=jl.toast(this.state,e);if(!t)return;i=[t],this.clearTimer(e)}let a=Al(r.map(n=>t||n.id===e?{...n,transitionStatus:`ending`,height:0}:n),n);this.setToasts(a,!a.some(e=>e.transitionStatus!==`ending`)),i.forEach(e=>{e.transitionStatus!==`ending`&&e.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let n=vs(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=vs(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=vs(t.error,e);return this.updateToast(r,{...n,type:`error`,timeout:n.timeout}),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{e.timeout&&(e.timeout.clear(),e.remaining=Math.max(e.remaining-(Date.now()-e.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=fs.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(t),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!==`touch`)return;let t=Is(e);X(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=jl.expandedOrOutOfFocus(this.state)?void 0:fs.create();i?.start(t,()=>{this.handleTimerFired(e),n()}),this.timers.set(e,{timeout:i,start:r,delay:t,remaining:t,callback:n})}clearTimers(){this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(e,t=e.length===0){let n={toasts:e,toastMetadata:kl(e)};t&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(e){let t=Ps(is(this.state.viewport));if(!this.state.viewport||!X(this.state.viewport,t)||!hc(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let n=jl.toasts(this.state),r=jl.toastIndex(this.state,e),i=(e,t)=>{for(let r=e;r>=0&&r<n.length;r+=t)if(n[r].transitionStatus!==`ending`)return n[r];return null},a=i(r+1,1)??i(r-1,-1);a?a.ref?.current?.focus():this.restoreFocusToPrevElement()}},Z=hs(),Nl=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=ro(()=>new Ml({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return to(a.disposeEffect),_.useEffect(function(){if(i)return i[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?a.promiseToast(t.promise,t):e===`update`&&n?a.updateToast(n,t.updates):e===`close`?a.closeToast(n):a.addToast(t)})},[a,i]),(0,Z.jsxs)(oo.Provider,{value:a,children:[(0,Z.jsx)(Pl,{store:a,timeout:n,limit:r}),t]})};function Pl(e){let{store:t,timeout:n,limit:r}=e;return q(()=>{t.syncProviderProps(n,r)},[t,n,r]),null}var Fl={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Il={...Fl,position:`fixed`,margin:0,top:0,left:0},Ll={...Fl,position:`absolute`},Rl=_.forwardRef(function(e,t){let[n,r]=_.useState();q(()=>{Ms&&As&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,Z.jsx)(`span`,{...e,ref:t,style:Il,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function zl(e,t,n,r){let i=ro(Vl).current;return Hl(i,e,t,n,r)&&Wl(i,[e,t,n,r]),i.callback}function Bl(e){let t=ro(Vl).current;return Ul(t,e)&&Wl(t,e),t.callback}function Vl(){return{callback:null,cleanup:null,refs:[]}}function Hl(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Ul(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Wl(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function Gl(e){if(!_.isValidElement(e))return null;let t=e,n=t.props;return(fo(19)?n?.ref:t.ref)??null}function Kl(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function ql(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Jl(e,t){return typeof e==`function`?e(t):e}function Yl(e,t){return typeof e==`function`?e(t):e}var Xl={};function Zl(e,t,n,r,i){if(!n&&!r&&!i&&!e)return $l(t);let a=$l(e);return t&&(a=eu(a,t)),n&&(a=eu(a,n)),r&&(a=eu(a,r)),i&&(a=eu(a,i)),a}function Ql(e){if(e.length===0)return Xl;if(e.length===1)return $l(e[0]);let t=$l(e[0]);for(let n=1;n<e.length;n+=1)t=eu(t,e[n]);return t}function $l(e){return iu(e)?{...e(Xl)}:tu(e)}function eu(e,t){return iu(t)?t(e):nu(e,t)}function tu(e){let t={...e};for(let e in t){let n=t[e];ru(e,n)&&(t[e]=ou(n))}return t}function nu(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Kl(e.style,r);break;case`className`:e[n]=cu(e.className,r);break;default:e[n]=ru(n,r)?au(e[n],r):r}}return e}function ru(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function iu(e){return typeof e==`function`}function au(e,t){return t?e?(...n)=>{let r=n[0];if(lu(r)){let i=r;su(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:ou(t):e}function ou(e){return e&&((...t)=>{let n=t[0];return lu(n)&&su(n),e(...t)})}function su(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function cu(e,t){return t?e?t+` `+e:t:e}function lu(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function uu(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=mu(r));let i=du(t,n,r);if(n.enabled===!1)return null;let a=n.state??eo;return hu(e,r,i,a)}function du(e,t,n){let{className:r,style:i}=e,{state:a=eo,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Jl(r,a):void 0,d=l?Yl(i,a):void 0,f=l?ql(a,c):eo,p=l&&s?fu(s):void 0,m=l?Kl(f,p)??{}:eo;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?Bl([m.ref,Gl(n),...o]):zl(m.ref,Gl(n),o):zl(null,null)),l?(u!==void 0&&(m.className=cu(m.className,u)),d!==void 0&&(m.style=Kl(m.style,d)),m):eo}function fu(e){return Array.isArray(e)?Ql(e):Zl(void 0,e)}var pu=Symbol.for(`react.lazy`);function mu(e){if(e?.$$typeof!==pu)return e;let t=_.Children.toArray(e)[0];return _.isValidElement(t)?t:e}function hu(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Zl(n,t.props);return e.ref=n.ref,_.cloneElement(t,e)}return gu(e,n)}function gu(e,t){return e===`button`?(0,_.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,_.createElement)(`img`,{alt:``,...t,key:t.key}):_.createElement(e,t)}var _u=`--toast-frontmost-height`,vu=_.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=so(),c=ps(),l=_.useRef(!1),u=_.useRef(!1),d=_.useRef(!1),f=s.useState(`isEmpty`),p=s.useState(`toasts`),m=s.useState(`focused`),h=s.useState(`expanded`),g=s.useState(`prevFocusElement`),v=p[0]?.height,y=p.some(e=>e.transitionStatus===`ending`),b=p.filter(e=>e.priority===`high`);_.useEffect(()=>{let e=s.state.viewport;if(!e||f)return;let t=Y(e),n=is(e);function r(t){t.key===`F6`&&Is(t)!==e&&(t.preventDefault(),s.set(`prevFocusElement`,Ps(n)),e?.focus({preventScroll:!0}),s.pauseTimers(),s.set(`focused`,!0))}function i(e){Is(e)===t&&(s.set(`isWindowFocused`,!1),s.pauseTimers())}function a(n){if(n.relatedTarget)return;let r=Is(n),i=Ps(is(e));r!==t&&X(e,r)&&hc(i)||s.resumeTimers(),c.start(0,()=>s.set(`isWindowFocused`,!0))}return rs(as(t,`keydown`,r),as(t,`blur`,i,!0),as(t,`focus`,a,!0),as(n,`pointerdown`,s.handleDocumentPointerDown,!0))},[s,c,f]);function x(e){l.current=!0;let t=e.relatedTarget===s.state.viewport?p.find(e=>e.transitionStatus!==`ending`&&!e.limited):void 0;t?t.ref?.current?.focus():s.restoreFocusToPrevElement()}function S(e){e.key===`Tab`&&e.shiftKey&&Is(e.nativeEvent)===s.state.viewport&&(e.preventDefault(),s.restoreFocusToPrevElement())}function C(){s.state.toasts.some(e=>e.transitionStatus===`ending`)||d.current||!u.current||(s.set(`hovering`,!1),s.select(`expandedOrOutOfFocus`)||s.resumeTimers(),u.current=!1)}_.useEffect(C,[y,s]);function w(){s.pauseTimers(),s.set(`hovering`,!0),u.current=!1}function T(){u.current=!0,C()}function E(e){e.pointerType===`touch`&&(d.current=!0)}function D(e){e.pointerType===`touch`&&(d.current=!1,C())}function O(){l.current?l.current=!1:m||hc(Ps(is(s.state.viewport)))&&(s.set(`focused`,!0),s.pauseTimers())}function k(e){m&&!X(s.state.viewport,e.relatedTarget)&&(s.set(`focused`,!1),s.select(`expandedOrOutOfFocus`)||s.resumeTimers())}let A={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:w,onMouseMove:w,onMouseLeave:T,onFocus:O,onBlur:k,onKeyDown:S,onClick:O,onPointerDown:E,onPointerUp:D,onPointerCancel:D,style:{[_u]:v?`${v}px`:void 0}},j={expanded:h},M=!f&&g&&(0,Z.jsx)(Rl,{onFocus:x}),N=uu(`div`,e,{ref:[t,s.setViewport],state:j,props:[A,o,{children:(0,Z.jsxs)(_.Fragment,{children:[M,a,M]})}]});return(0,Z.jsxs)(_.Fragment,{children:[M,N,!m&&b.length>0&&(0,Z.jsx)(`div`,{style:Il,children:b.map(e=>(0,Z.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,Z.jsx)(`div`,{children:e.title}),(0,Z.jsx)(`div`,{children:e.description})]},e.id))})]})});function yu(e){return fo(19)?e:e?`true`:void 0}var bu=_.createContext(void 0);function xu(){let e=_.useContext(bu);if(!e)throw Error(ao(66));return e}function Su(e){return e==null?e:`current`in e?e.current:e}function Cu(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var wu=c(m(),1),Tu=null;function Eu(e){if(!Tu){let e=[];Tu=e,queueMicrotask(()=>{Tu=null,wu.flushSync(()=>{for(let t of e)t()})})}Tu.push(e)}function Du(e,t=!1,n=!1){let r=us();return J((i,a=null)=>{r.cancel();let o=Su(e);if(o==null)return;let s=o,c=()=>{n?Eu(()=>{a?.aborted||i()}):wu.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Cu(s).map(e=>e.finished.then(Qa))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(Cu(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=Us;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function Ou(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=J(a),s=Du(r,n,i);_.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var ku={style:{transition:`none`}},Au=`data-base-ui-click-trigger`,ju=`data-base-ui-swipe-ignore`,Mu=`data-swipe-ignore`,Nu=`[${ju}]`,Pu=`[${Mu}]`,Fu={fallbackAxisSide:`none`},Iu={fallbackAxisSide:`end`},Lu={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0};function Ru(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function zu(e,t){let n=(t??Y(e).getComputedStyle(e)).transform,r=0,i=0,a=1;if(n&&n!==`none`){let e=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(r=t[4],i=t[5],a=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(r=t[12],i=t[13],a=t[0])}}return{x:r,y:i,scale:a}}function Bu(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}var Vu=`--toast-index`,Hu=`--toast-offset-y`,Uu=`--toast-height`,Wu=`--toast-swipe-movement-x`,Gu=`--toast-swipe-movement-y`,Ku=`data-swipe-direction`,qu={...qs,swipeDirection(e){return e?{[Ku]:e}:null}},Ju=40,Yu=10,Xu=.5,Zu=1,Qu=`${Nu},${Pu}`,$u=_.forwardRef(function(e,t){let{toast:n,render:r,className:i,swipeDirection:a=[`down`,`right`],style:o,...s}=e,c=n.positionerProps?.anchor!==void 0,l=[];c||(l=Array.isArray(a)?a:[a]);let u=l.length>0,d=so(),[f,p]=_.useState(void 0),[m,h]=_.useState(!1),[g,v]=_.useState(!1),[y,b]=_.useState({x:0,y:0}),[x,S]=_.useState({x:0,y:0,scale:1}),[C,w]=_.useState(),[T,E]=_.useState(),[D,O]=_.useState(null),k=_.useRef(null),A=_.useRef(void 0),j=_.useRef({x:0,y:0}),M=_.useRef({x:0,y:0,scale:1}),N=_.useRef(void 0),P=_.useRef(0),F=_.useRef(!1),I=_.useRef({x:0,y:0}),L=_.useRef(!1),R=_.useRef({x:0,y:0}),z=_.useRef(null),B=_.useRef(null),V=d.useState(`toastIndex`,n.id),ee=d.useState(`toastVisibleIndex`,n.id),te=d.useState(`toastOffsetY`,n.id),ne=d.useState(`focused`),re=d.useState(`expanded`);Ou({open:n.transitionStatus!==`ending`,ref:k,onComplete(){n.transitionStatus===`ending`&&d.removeToast(n.id)}});let H=J((e=!1)=>{let t=k.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=r;function a(){d.updateToastInternal(n.id,{ref:k,height:i,transitionStatus:void 0})}e?wu.flushSync(a):a()});q(()=>{let e=A.current;(n.transitionStatus===`starting`||e!==n.id)&&(e!==void 0&&(p(void 0),S({x:0,y:0,scale:1}),U({x:0,y:0})),A.current=n.id,H())},[H,n.id,n.transitionStatus]);function U(e){R.current=e,b(e)}q(()=>()=>{B.current?.abort()},[]);function ie(e,t){let n=e=>e>0?e**Xu:-(Math.abs(e)**Xu),r=e>0&&!l.includes(`right`)||e<0&&!l.includes(`left`),i=t>0&&!l.includes(`down`)||t<0&&!l.includes(`up`);return{x:r?n(e):e,y:i?n(t):t}}let ae=J(e=>{if(e.pointerId!==z.current)return;z.current=null,B.current?.abort(),B.current=null,h(!1),v(!1),O(null);let t=M.current;if(e.type===`pointercancel`||F.current){U({x:t.x,y:t.y}),p(void 0);return}let r=R.current,i=r.x-t.x,a=r.y-t.y,o;for(let e of l)if(Bu(e,i,a)>Ju){o=e;break}o?(p(o),d.closeToast(n.id)):(U({x:t.x,y:t.y}),p(void 0))});function oe(e){if(e.button!==0||(e.pointerType===`touch`&&d.pauseTimers(),Fs(Is(e.nativeEvent),`button,a,input,textarea,[role="button"],${Qu}`)))return;F.current=!1,N.current=void 0,P.current=0,z.current=e.pointerId,j.current={x:e.clientX,y:e.clientY},I.current=j.current;let t=e.currentTarget,n=zu(t);M.current=n,S(n),U({x:n.x,y:n.y}),d.set(`hovering`,!0),h(!0),v(!1),O(null),L.current=!0,B.current?.abort();let r=new AbortController;B.current=r;let i=is(t);i.addEventListener(`pointerup`,ae,{signal:r.signal}),i.addEventListener(`pointercancel`,ae,{signal:r.signal}),t.setPointerCapture?.(e.pointerId)}function W(e){if(e.pointerId!==z.current)return;e.preventDefault(),L.current&&=(j.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>I.current.y||i>0&&t<I.current.y)&&(I.current={x:I.current.x,y:t}),(r<0&&n>I.current.x||r>0&&n<I.current.x)&&(I.current={x:n,y:I.current.y});let a=n-j.current.x,o=t-j.current.y,s=t-I.current.y,c=n-I.current.x,u=D;if(!g&&Math.sqrt(a*a+o*o)>=Zu){v(!0);let e=l.includes(`left`)||l.includes(`right`),t=l.includes(`up`)||l.includes(`down`);e&&t&&(u=Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`,O(u))}let d;if(!N.current)u===`vertical`?o>0?d=`down`:o<0&&(d=`up`):u===`horizontal`?a>0?d=`right`:a<0&&(d=`left`):d=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,d&&l.includes(d)&&(N.current=d,P.current=Bu(d,a,o),p(d));else{let e=N.current,t=Bu(e,c,s);t>Ju?(F.current=!1,p(e)):!(l.includes(`left`)&&l.includes(`right`))&&!(l.includes(`up`)&&l.includes(`down`))&&P.current-t>=Yu&&(F.current=!0)}let f=ie(a,o),m=M.current.x,h=M.current.y,_=l.includes(`left`)||l.includes(`right`),y=l.includes(`up`)||l.includes(`down`);u!==`vertical`&&_&&(m+=f.x),u!==`horizontal`&&y&&(h+=f.y),U({x:m,y:h})}function se(e){if(e.key===`Escape`){if(!k.current||!X(k.current,Ps(is(k.current))))return;d.closeToast(n.id)}}_.useEffect(()=>{let e=k.current;if(!u||!e)return;function t(t){z.current!==null&&X(e,Is(t))&&t.preventDefault()}return as(e,`touchmove`,t,{passive:!1})},[u]);function ce(){let e=y.x-x.x,t=y.y-x.y;return{transition:m?`none`:void 0,transform:m?`translateX(${y.x}px) translateY(${y.y}px) scale(${x.scale})`:void 0,[Wu]:`${e}px`,[Gu]:`${t}px`}}let le=n.priority===`high`,ue={role:le?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":C,"aria-describedby":T,"aria-hidden":le&&!ne?!0:void 0,onPointerDown:u?oe:void 0,onPointerMove:u?W:void 0,onPointerUp:u?ae:void 0,onPointerCancel:u?ae:void 0,onKeyDown:se,inert:yu(n.limited),style:{...ce(),[Vu]:n.transitionStatus===`ending`?V:ee,[Hu]:`${te}px`,[Uu]:n.height?`${n.height}px`:void 0}},de=_.useMemo(()=>({toast:n,setTitleId:w,setDescriptionId:E,recalculateHeight:H,visibleIndex:ee,expanded:re}),[n,w,E,H,ee,re]),fe={transitionStatus:n.transitionStatus,expanded:re,limited:n.limited||!1,type:n.type,swiping:m,swipeDirection:f},pe=uu(`div`,e,{ref:[t,k],state:fe,stateAttributesMapping:qu,props:[ue,s]});return(0,Z.jsx)(bu.Provider,{value:de,children:pe})}),ed=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{visibleIndex:o,expanded:s,recalculateHeight:c}=xu(),l=_.useRef(null);return q(()=>{c();let e=l.current;if(!e||typeof ResizeObserver!=`function`||typeof MutationObserver!=`function`)return;let t=new ResizeObserver(()=>c(!0)),n=new MutationObserver(()=>c(!0));return t.observe(e),n.observe(e,{childList:!0,subtree:!0,characterData:!0}),()=>{t.disconnect(),n.disconnect()}},[c]),uu(`div`,e,{ref:[t,l],state:{expanded:s,behind:o>0},props:a})}),td=0;function nd(e,t=`mui`){let n=_.useRef(void 0),r=os(),i=e??n.current;return _.useEffect(()=>{n.current??(td+=1,n.current=`${t}-${td}`,e??r())},[e,t,r]),i}var rd=Do.useId;function id(e,t){if(rd!==void 0){let n=rd();return e??(t?`${t}-${n}`:n)}return nd(e,t)}function ad(e){return e==null||typeof e==`boolean`||e===``?!1:!Array.isArray(e)||e.some(ad)}function od(e){return _.isValidElement(e)&&ad(e.props.children)}function sd(e,t,n){let{toast:r,setTitleId:i,setDescriptionId:a}=xu(),o=n===`title`?i:a,s=t??(n===`title`?r.title:r.description);return{id:id(e),children:s,type:r.type,setId:o}}function cd(e,t,n){let r=od(e);return q(()=>{if(r)return n(t),()=>{n(e=>e===t?void 0:e)}},[r,t,n]),r?e:null}var ld=_.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{id:c,children:l,type:u,setId:d}=sd(a,o,`description`);return cd(uu(`p`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),ud=_.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{id:c,children:l,type:u,setId:d}=sd(a,o,`title`);return cd(uu(`h2`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),dd=_.createContext(void 0);function fd(e=!1){let t=_.useContext(dd);if(t===void 0&&!e)throw Error(ao(16));return t}function pd(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:_.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function md(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(Y(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function hd(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=_.useRef(null),s=fd(!0),c=a??s!==void 0,{props:l}=pd({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=_.useCallback(()=>{let e=o.current;gd(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return q(u,[u]),{getButtonProps:_.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Zl({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(su(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=gd(r),s=!i&&_d(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),md(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),md(r,e)))},onKeyUp(e){t||(su(e),a?.(e),e.target===e.currentTarget&&i&&c&&gd(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||c||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),md(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:J(e=>{o.current=e,u()})}}function gd(e){return Ro(e)&&e.tagName===`BUTTON`}function _d(e){return Ro(e)&&e.tagName===`A`&&!!e.href}var vd=_.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,c=so(),{toast:l,expanded:u}=xu(),[d,f]=_.useState(!1),{getButtonProps:p,buttonRef:m}=hd({disabled:a,native:o}),h={type:l.type};return uu(`button`,e,{ref:[t,m],state:h,props:[{"aria-hidden":!u&&!d,onClick(){c.closeToast(l.id)},onFocus(){f(!0)},onBlur(){f(!1)}},s,p]})}),yd=_.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,{toast:c}=xu(),l=c.actionProps?.children??s.children,{getButtonProps:u,buttonRef:d}=hd({disabled:a,native:o}),f={type:c.type},p=uu(`button`,e,{ref:[t,d],state:f,props:[s,c.actionProps,u,{children:l}]});return od(p)?p:null});function bd(e,t,n,r){let i=!1,a=!1,o=r??eo;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function xd(e,t,n){let r=n??eo;return{reason:e,event:t??new Event(`base-ui`),...r}}var Sd=`none`,Cd=`trigger-press`,wd=`trigger-hover`,Td=`trigger-focus`,Ed=`outside-press`,Dd=`item-press`,Od=`close-press`,kd=`track-press`,Ad=`input-change`,jd=`input-clear`,Md=`input-blur`,Nd=`input-paste`,Pd=`focus-out`,Fd=`escape-key`,Id=`list-navigation`,Ld=`keyboard`,Rd=`pointer`,zd=`drag`,Bd=`wheel`,Vd=`scrub`,Hd=`cancel-open`,Ud=`sibling-open`,Wd=`disabled`,Gd=`missing`,Kd=`initial`,qd=`imperative-action`;function Jd(e){return`data-base-ui-${e}`}var Yd=_.createContext(null),Xd=()=>_.useContext(Yd),Zd=Jd(`portal`);function Qd(e={}){let{ref:t,container:n,componentProps:r=eo,elementProps:i}=e,a=id(),o=Xd()?.portalNode,[s,c]=_.useState(null),[l,u]=_.useState(null),d=J(e=>{e!==null&&u(e)}),f=_.useRef(null);q(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(Io(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=uu(`div`,r,{ref:[t,d],props:[{id:a,[Zd]:``},i]}),m=s&&p?wu.createPortal(p,s):null;return{node:l,nodeId:_.isValidElement(p)?p.props.id:void 0,subtree:m}}var $d=_.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=Qd({container:o,ref:t,componentProps:e,elementProps:c}),f=_.useRef(null),p=_.useRef(null),m=_.useRef(null),h=_.useRef(null),[g,v]=_.useState(null),y=_.useRef(!1),b=g?.modal,x=g?.open,S=!!g&&!g.modal&&g.open&&!!l;_.useEffect(()=>{if(!l||b)return;function e(e){l&&e.relatedTarget&&El(e)&&(e.type===`focusin`?y.current&&=(Ol(l),!1):(Dl(l),y.current=!0))}return rs(as(l,`focusin`,e,!0),as(l,`focusout`,e,!0))},[l,b]),q(()=>{l&&x===!0&&y.current&&(Ol(l),y.current=!1)},[x,l]);let C=_.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:v}),[l]);return(0,Z.jsxs)(_.Fragment,{children:[d,(0,Z.jsxs)(Yd.Provider,{value:C,children:[S&&l&&(0,Z.jsx)(Rl,{"data-type":`outside`,ref:f,onFocus:e=>{El(e,l)?m.current?.focus():wl(g?g.domReference:null)?.focus()}}),S&&l&&(0,Z.jsx)(`span`,{role:s,"aria-owns":u,style:Lu}),l&&wu.createPortal(a,l),S&&l&&(0,Z.jsx)(Rl,{"data-type":`outside`,ref:p,onFocus:e=>{El(e,l)?h.current?.focus():(Cl(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,bd(`focus-out`,e.nativeEvent)))}})]})]})}),ef=_.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=Qd({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,Z.jsxs)(_.Fragment,{children:[l,c&&wu.createPortal(n,c)]})}),tf=_.forwardRef(function(e,t){return(0,Z.jsx)(ef,{ref:t,...e})});function nf(e){let t=ro(rf,e).current;return t.next=e,q(t.effect),t}function rf(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function af(e,t){return t!=null&&!Cc(t)?0:typeof e==`function`?e():e}function of(e,t,n){let r=af(e,n);return typeof r==`number`?r:r?.[t]}function sf(e){return typeof e==`function`?e():e}function cf(e,t){return t||e===`click`||e===`mousedown`}function lf(e){return e?.includes(`mouse`)&&e!==`mousedown`}var uf=_.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new fs,currentIdRef:{current:null},currentContextRef:{current:null}});function df(e,t){e.current=t.current}function ff(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=_.useRef(n),a=_.useRef(n),o=_.useRef(null),s=_.useRef(null),c=ps();return q(()=>{a.current=n,o.current?i.current={open:of(i.current,`open`),close:of(n,`close`)}:i.current=n},[n,o,i,a]),(0,Z.jsx)(uf.Provider,{value:_.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function pf(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=_.useContext(uf),[d,f]=_.useState(!1),p=_.useRef(n);return q(()=>{p.current=n},[n]),q(()=>{function t(){c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(p.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),q(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:of(s.current,`close`)},o!==null&&o!==r?(f(!0),t?.setIsInstantPhase(!0),t?.onOpenChange(!1,bd(Sd))):(f(!1),t?.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),q(()=>()=>{if(i.current===r){if(c.current=null,!p.current)return;i.current=null,df(a,s),u.clear()}},[c,i,a,r,s,u]),_.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}var mf=0;function hf(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(mf);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),Qa;let o=requestAnimationFrame(a);return mf=o,()=>{mf===o&&(cancelAnimationFrame(o),mf=0)}}var gf=`data-base-ui-inert`,_f=new WeakMap,vf=new WeakSet,yf=new WeakMap,bf=0;function xf(e){return e?zo(e)?e.host:xf(e.parentNode):null}var Sf=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=xf(t);return e.contains(n)?n:null}).filter(e=>e!=null),Cf=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},wf=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{Po(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Tf(e,t,n,{mark:r=!0}){let i=Sf(t,e),a=r?wf(t,Cf(i),new Set(i)):[],o=[],s=[];if(n){let e=Sf(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);wf(t,Cf(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(_f.get(e)||0)+1;_f.set(e,r),o.push(e),r===1&&n&&vf.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(yf.get(e)||0)+1;yf.set(e,t),s.push(e),t===1&&e.setAttribute(gf,``)}),bf+=1,()=>{o.forEach(e=>{let t=(_f.get(e)||0)-1;_f.set(e,t),t||(vf.has(e)||e.removeAttribute(`aria-hidden`),vf.delete(e))}),r&&s.forEach(e=>{let t=(yf.get(e)||0)-1;yf.set(e,t),t||e.removeAttribute(gf)}),--bf,bf||(_f=new WeakMap,vf=new WeakSet,yf=new WeakMap)}}function Ef(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=is(e[0]).body;return Tf(e,i,n,{mark:r})}function Df(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Of=class{nodesRef={current:[]};events=Df();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},kf=_.createContext(null),Af=_.createContext(null),jf=()=>_.useContext(kf)?.id||null,Mf=e=>{let t=_.useContext(Af);return e??t};function Nf(e){let t=id(),n=Mf(e),r=jf();return q(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Pf(e){let{children:t,id:n}=e,r=jf();return(0,Z.jsx)(kf.Provider,{value:_.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Ff(e){let{children:t,externalTree:n}=e,r=ro(()=>n??new Of).current;return(0,Z.jsx)(Af.Provider,{value:r,children:t})}function If(e,t){let n=Y(Is(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(xc(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Lf=20,Rf=[];function zf(){Rf=Rf.filter(e=>e.deref()?.isConnected)}function Bf(e){zf(),e&&Po(e)!==`body`&&(Rf.push(new WeakRef(e)),Rf.length>Lf&&(Rf=Rf.slice(-20)))}function Vf(){return zf(),Rf[Rf.length-1]?.deref()}function Hf(e){return e?yl(e)?e:xl(e)[0]||e:null}function Uf(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=bl(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return yl(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Wf(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),v=t.useState(`domReferenceElement`),y=t.useState(`floatingElement`),{events:b,dataRef:x}=t.context,S=J(()=>x.current.floatingContext?.nodeId),C=i===!1,w=mc(v)&&C,T=nf(i),E=nf(a),D=nf(o),O=nf(u),k=nf(g),A=Mf(m),j=Xd(),M=_.useRef(!1),N=_.useRef(!1),P=_.useRef(!1),F=_.useRef(null),I=_.useRef(``),L=_.useRef(``),R=_.useRef(null),z=_.useRef(null),B=zl(R,p,j?.beforeInsideRef),V=zl(z,j?.afterInsideRef),ee=ps(),te=ps(),ne=us(),re=j!=null,H=gc(y),U=J((e=H)=>e?xl(e):[]),ie=J(()=>h?.().filter(e=>e!=null)??[]);_.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&X(H,Ps(is(H)))&&U().length===0&&!w&&yc(e)}return as(is(H),`keydown`,e)},[r,H,c,w,U]),_.useEffect(()=>{if(r||!g)return;let e=is(H);function t(){P.current=!1}function n(e){let t=Is(e),n=ie(),r=X(y,t)||X(v,t)||X(j?.portalNode,t)||n.some(e=>e===t||X(e,t));P.current=!r,L.current=e.pointerType||`keyboard`,Fs(t,`[data-base-ui-click-trigger]`)&&(N.current=!0,te.start(0,()=>{N.current=!1}))}function i(){L.current=`keyboard`}return rs(as(e,`pointerdown`,n,!0),as(e,`pointerup`,t,!0),as(e,`pointercancel`,t,!0),as(e,`keydown`,i,!0),t)},[r,y,v,H,g,j,te,ie]),_.useEffect(()=>{if(r||!l)return;let e=is(H);function n(){N.current=!0,te.start(0,()=>{N.current=!1})}function i(e){let t=Is(e);yl(t)&&(F.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=Is(n);c&&r==null&&a!=null&&X(y,a)&&Bf(a),queueMicrotask(()=>{let o=S(),l=t.context.triggerElements,u=ie(),p=r?.hasAttribute(Jd(`focus-guard`))&&[R.current,z.current,j?.beforeInsideRef.current,j?.afterInsideRef.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,Su(f),Su(d)].includes(r),m=!(X(v,r)||X(y,r)||X(r,y)||X(j?.portalNode,r)||u.some(e=>e===r||X(e,r))||l.hasMatchingElement(e=>X(e,r))||p||A&&(_c(A.nodesRef.current,o).find(e=>X(e.context?.elements.floating,r)||X(e.context?.elements.domReference,r))||vc(A.nodesRef.current,o).find(e=>[e.context?.elements.floating,gc(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===v&&H&&Uf(H),s&&i!==v&&!al(a)&&Ps(e)===e.body){if(Ro(H)&&(H.focus(),s===`popup`)){ne.request(()=>{H.focus()});return}let e=U(),t=F.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||H;Ro(n)&&n.focus()}x.current.insideReactTree?x.current.insideReactTree=!1:(w||!c)&&r&&m&&!N.current&&(w||r!==Vf())&&(M.current=!0,t.setOpen(!1,bd(Pd,n)))})}function o(){P.current||(x.current.insideReactTree=!0,ee.start(0,()=>{x.current.insideReactTree=!1}))}let u=Ro(v)?v:null;if(y||u)return rs(u&&as(u,`focusout`,a),u&&as(u,`pointerdown`,n),y&&as(y,`focusin`,i),y&&as(y,`focusout`,a),y&&j&&as(y,`focusout`,o,!0))},[r,v,y,H,c,A,j,t,l,s,U,w,S,x,ee,te,ne,d,f,ie]),_.useEffect(()=>{if(r||!y||!g)return;let e=Array.from(j?.portalNode?.querySelectorAll(`[${Jd(`portal`)}]`)||[]),t=(A?vc(A.nodesRef.current,S()):[]).find(e=>mc(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Ef([y,...e,R.current,z.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,...ie(),t,Su(f),Su(d),w?v:null].filter(e=>e!=null),{ariaHidden:c||w,mark:!1}),i=Ef([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,v,y,c,j,w,A,S,d,f,ie]),q(()=>{if(!g||r||!Ro(H))return;I.current=``,L.current=``;let e=is(H),t=Ps(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(O.current||``):n;if(r===void 0||r===!1||X(H,t))return;let i=null,a=()=>(i??=U(H),i[0]||H),o;o=r===!0||r===null?a():Su(r),o||=a();let s=X(H,Ps(e)),c=x.current.openEvent,l=c?.type===`mousedown`&&xc(c);hf(o,{sync:l,preventScroll:o===H,shouldFocus(){if(!k.current)return!1;if(s)return!0;let t=Ps(e);return!(t!==o&&X(H,t))}})})},[r,g,H,U,T,O,k,x]);let ae=_.useRef(null);q(()=>{if(r||!H){ae.current=null;return}ae.current&&=(ae.current.cancelled=!0,null);let e=is(H),t=Ps(e),n=O.current==null;Bf(t);function i(e){if(e.open||(I.current=If(e.nativeEvent,L.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(Jd(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(M.current=!0),e.reason===`outside-press`){if(e.nested)M.current=!1;else if(xc(e.nativeEvent)||Sc(e.nativeEvent))M.current=!1;else{let e=!1;is(H).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?M.current=!1:M.current=!0}}}b.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=v?.isConnected?v:null,o=t?.isConnected&&Po(t)!==`body`?t:null,s=n?o||a:a||o;return s||=Vf()||null,typeof i==`boolean`?s:Su(i)||s||null}return()=>{b.off(`openchange`,i);let t=Ps(e),n=ie(),r=X(y,t)||n.some(e=>e===t||X(e,t))||A&&_c(A.nodesRef.current,S(),!1).some(e=>X(e.context?.elements.floating,t)),o=E.current,s=I.current,c=a(s),l={cancelled:!1};ae.current=l,queueMicrotask(()=>{ae.current===l&&(ae.current=null);let n=Hf(c),i=D.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!M.current&&Ro(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}M.current=!1})}},[r,y,H,E,D,O,b,A,v,S,ie]),q(()=>{if(!As||g||!y)return;let e=Ps(is(y));Ro(e)&&fc(e)&&X(y,e)&&e.blur()},[g,y]),q(()=>{if(!r&&j)return j.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:v}),()=>{j.setFocusManagerState(null)}},[r,j,c,g,t,l,v]),q(()=>{if(!r&&H)return Uf(H),()=>{queueMicrotask(zf)}},[r,H]);let oe=!r&&(!c||!w)&&(re||c);return(0,Z.jsxs)(_.Fragment,{children:[oe&&(0,Z.jsx)(Rl,{"data-type":`inside`,ref:B,onFocus:e=>{if(c){let e=U();hf(e[e.length-1])}else j?.portalNode&&(M.current=!1,El(e,j.portalNode)?Cl(v)?.focus():Su(f??j.beforeOutsideRef)?.focus())}}),n,oe&&(0,Z.jsx)(Rl,{"data-type":`inside`,ref:V,onFocus:e=>{c?hf(U()[0]):j?.portalNode&&(l&&(M.current=!0),El(e,j.portalNode)?wl(v)?.focus():Su(d??j.afterOutsideRef)?.focus())}})]})}function Gf(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Cd}=t,l=e.context.dataRef,u=_.useRef(void 0),d=us(),f=ps(),p=_.useMemo(()=>{function t(t,n,r,i){let a=bd(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=Cc(e.pointerType,!0)&&Sc(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||Cc(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=Is(s),p=fc(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:Cc(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return _.useMemo(()=>n?{reference:p}:eo,[n,p])}function Kf(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,(!i||c)&&(d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function qf(e){return e!=null&&e.clientX!=null}function Jf(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=_.useRef(!1),l=_.useRef(null),[u,d]=_.useState(),[f,p]=_.useState([]),m=J(t=>{e.set(`positionReference`,t)}),h=J((t,n,i)=>{c.current||(!s.current.openEvent||qf(s.current.openEvent))&&e.set(`positionReference`,Kf(i??o,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),g=J(e=>{i?l.current||(h(e.clientX,e.clientY,e.currentTarget),p([])):h(e.clientX,e.clientY,e.currentTarget)}),v=Cc(u)?a:i;_.useEffect(()=>{if(!n){m(o);return}if(!v)return;function e(){l.current?.(),l.current=null}let t=Y(a);function r(t){let n=Is(t);X(a,n)?e():h(t.clientX,t.clientY)}return!s.current.openEvent||qf(s.current.openEvent)?l.current=as(t,`mousemove`,r):m(o),e},[v,n,a,s,o,e,h,m,f]),_.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),_.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),_.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let y=_.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return _.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function Yf(){return!1}function Xf(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Zf(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=Yf,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=Mf(c),m=J(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,v=J(()=>a),{escapeKey:y,outsidePress:b}=Xf(s),x=_.useRef(!1),S=_.useRef(!1),C=_.useRef(!1),w=_.useRef(!1),T=_.useRef(!1),E=_.useRef(``),D=_.useRef(null),O=ps(),k=ps(),A=ps(),j=J(()=>{k.clear(),d.current.insideReactTree=!1}),M=J(e=>{let t=d.current.floatingContext?.nodeId;return(p?_c(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=J(t=>uc(t,e.select(`floatingElement`))||uc(t,e.select(`domReferenceElement`))),P=J(t=>{o()&&e.setOpen(!1,bd(Cd,t.nativeEvent))}),F=J(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=bc(t)?t.nativeEvent:t;if(T.current||i.isComposing||!y&&M(`__escapeKeyBubbles`))return;let a=bd(Fd,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!y&&!a.isPropagationAllowed&&t.stopPropagation()}),I=J(()=>{d.current.insideReactTree=!0,k.start(0,j)}),L=J(t=>{if(!l||!n||t.button!==0)return;let r=Is(t.nativeEvent);X(e.select(`floatingElement`),r)&&(x.current||(x.current=!0,S.current=!1))}),R=J(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});_.useEffect(()=>{function e(e){e.open||(w.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),_.useEffect(()=>j,[j]),_.useEffect(()=>{if(!l||!n)return l||(w.current=!1,T.current=!1,E.current=``,D.current=null),j;d.current.__escapeKeyBubbles=y,d.current.__outsidePressBubbles=b;let t=new fs,i=is(u);function a(){A.clear(),T.current=!0}function o(){T.current=!0,A.start(As?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function f(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function _(e){let t=d.current.floatingContext?.nodeId,n=p&&_c(p.nodesRef.current,t).some(t=>uc(e,t.context?.elements.floating));return N(e)||n}function k(n){if(m(n)){n.type!==`click`&&!N(n)&&(t.clear(),C.current=!1),j();return}if(d.current.insideReactTree){j();return}let r=Is(n),i=`[${Jd(`inert`)}]`,a=Lo(r)?r.getRootNode():null,o=Array.from((zo(a)?a:is(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>X(e,r))))return;let c=Lo(r)?r:null;for(;c&&!Xo(c);){let e=$o(c);if(Xo(e)||!Lo(e))break;c=e}if(!(o.length&&Lo(r)&&!dc(r)&&!X(r,e.select(`floatingElement`))&&o.every(e=>!X(c,e)))){if(Ro(r)&&!(`touches`in n)){let e=Xo(r),t=Zo(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!_(n)){if(f()===`intentional`){if(n.detail!==0&&!xc(n)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}typeof h==`function`&&!h(n)||M(`__outsidePressBubbles`)||(e.setOpen(!1,bd(Ed,n)),j())}}}function P(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!N(t)&&k(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||N(t))return;let r=t.touches[0];r&&(D.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=Is(e);if(!n)return;let r=as(n,e.type,()=>{t(e),r()})}function R(e){E.current=`touch`,L(e,I)}function z(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):k(e)})}function B(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():_(e)||(n?s():(typeof h!=`function`||h(e))&&(t.clear(),C.current=!0,j())))}function V(e){if(f()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function ee(e){L(e,V)}function te(e){f()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function ne(e){L(e,te)}let re=rs(r&&rs(as(i,`keydown`,F),as(i,`compositionstart`,a),as(i,`compositionend`,o)),g&&rs(as(i,`click`,z,!0),as(i,`pointerdown`,z,!0),as(i,`pointerup`,B,!0),as(i,`pointercancel`,B,!0),as(i,`mousedown`,z,!0),as(i,`mouseup`,B,!0),as(i,`touchstart`,R,{capture:!0,passive:!0}),as(i,`touchmove`,ee,{capture:!0,passive:!0}),as(i,`touchend`,ne,{capture:!0,passive:!0})));return()=>{re(),t.clear(),c(),C.current=!1}},[d,u,r,g,h,l,n,y,b,F,j,v,M,N,p,e,O,A]);let z=_.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),B=_.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return _.useMemo(()=>n?{reference:z,floating:B,trigger:z}:{},[n,z,B])}function Qf(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),q(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};Lo(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function $f(e,t=!1,n=!1,r=!1){let[i,a]=_.useState(e&&t?`idle`:void 0),[o,s]=_.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),q(()=>{if(!e&&o&&i!==`ending`&&n){let e=ls.request(()=>{a(`ending`)});return()=>{ls.cancel(e)}}},[e,o,i,n]),q(()=>{if(!e||t||i===void 0)return;let n=ls.request(()=>{a(void 0)});return()=>{ls.cancel(n)}},[t,e,i]),q(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=ls.request(()=>{a(`idle`)});return()=>{ls.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function ep(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=J(i),{mounted:c,setMounted:l,transitionStatus:u}=$f(t,!1,!1,o),d=!t&&r;q(()=>{t&&s(!1)},[t,s]);let f=_.useRef(c),p=_.useRef(!1),m=os(),h=()=>{f.current=!1,l(!1),a()};q(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=J(()=>{f.current&&(t?(p.current=!0,m()):h())});return Ou({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var tp={tabIndex:-1,[Ls]:``};function np(e){return t=>t!==`touch`||e.current}function rp(e,t=!1){let n=id(),r=jf()!=null,i=ro(()=>e(n,r)).current;return Qf({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function ip({handle:e,store:t}){return q(()=>e.attachStore(t),[e,t]),null}function ap(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function op(e,t){let n=_.useRef(null);return J(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),ap(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),ap(t))})}function sp(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function cp(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function lp(e,t,n,r={}){let i=n.reason,a=i===wd,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=cp(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=sp(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?wu.flushSync(l):l()}function up(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=op(e,n),o=J(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=J(e=>{a(e),e&&o(e)});return q(()=>(s(t.current),()=>s(null)),[s,t,n,e]),q(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function dp(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=_.useRef(null),i=e.useState(`open`);q(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=bd(Sd);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function fp(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=ep({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return ro(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function pp(e,t){e.useSyncedValues(t),q(()=>()=>{e.update({activeTriggerProps:eo,inactiveTriggerProps:eo,popupProps:eo})},[e])}function mp(e,t){q(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),q(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var hp=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},gp={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},_p=class extends Mo{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Df(),nested:n,triggerElements:i},gp),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&wc(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function vp(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new _p({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:eo,inactiveTriggerProps:eo,popupProps:eo}}var yp=e=>e.triggerIdProp??e.activeTriggerId,bp=e=>e.openProp??e.open,xp=e=>(e.popupElement?.id??e.floatingId)||void 0;function Sp(e,t){return t!==void 0&&bp(e)&&yp(e)===t}function Cp(e,t){return Sp(e,t)?!0:t!==void 0&&bp(e)&&yp(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var wp={open:bp,mounted:e=>e.mounted,transitionStatus:e=>bp(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:yp,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:xp,isTriggerActive:(e,t)=>t!==void 0&&yp(e)===t,isOpenedByTrigger:(e,t)=>Sp(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&yp(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Cp(e,t)?xp(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Tp(e){let t=_.useCallback(t=>e===void 0?Qa:e.subscribeStore(t),[e]),n=_.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,fa.useSyncExternalStore)(t,n,()=>e?.serverStore)}var Ep=Os&&As;function Dp(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=_.useRef(!1),s=_.useRef(null),c=_.useRef(!0),l=ps();_.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=Y(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&Ro(t)&&t===Ps(is(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return rs(as(r,`blur`,i),Ep&&as(r,`keydown`,a,!0),Ep&&as(r,`pointerdown`,l,!0))},[e,n]),_.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);Lo(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=_.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=Is(n.nativeEvent);if(Lo(a)){if(Ep&&!n.relatedTarget){if(!c.current&&!fc(a))return}else if(!hc(a))return}let u=lc(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,bd(Td,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,bd(Td,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=Lo(r)&&r.hasAttribute(Jd(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=Ps(is(t));!r&&n===t||X(a.current.floatingContext?.refs.floating.current,n)||X(t,n)||o||lc(r??n,e.context.triggerElements)||e.setOpen(!1,bd(Td,i))})}}},[a,r,e,l]);return _.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var Op=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new fs;restTimeout=new fs;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},kp=new WeakMap;function Ap(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&kp.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),kp.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function jp(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=kp.get(n);a&&a!==e&&Ap(a),Ap(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,kp.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Mp(e){let t=e.context.dataRef.current,n=ro(()=>t.hoverInteractionState??Op.create()).current;return t.hoverInteractionState||=n,to(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Np(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=Mf(),u=jf(),d=Mp(e),f=ps(),p=J(()=>cf(c.current.openEvent?.type,d.interactedInside)),m=J(()=>lf(c.current.openEvent?.type)),h=J(()=>{Ap(d)});q(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),_.useEffect(()=>h,[h]),q(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&Lo(s)&&o){let e=s,t=o,n=is(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??Fs(e,`[data-rootownerid]`)??n.body;return jp(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),_.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&_c(l.nodesRef.current,u).length>0)}function a(t){let n=of(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,bd(wd,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=Is(e);pc(t)?d.interactedInside=Fs(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(lc(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&Lo(o)&&_c(l.nodesRef.current,r,!1).some(e=>X(e.context?.elements.floating,o))||(d.handler?d.handler(n):(h(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,bd(wd,n)),l.events.emit(`floating.closed`,n)})}let y=o;return rs(y&&as(y,`mouseenter`,g),y&&as(y,`mouseleave`,_),y&&as(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var Pp={current:null};function Fp(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Pp,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,v=Mf(l),y=Mp(e),b=_.useRef(!1),x=nf(i),S=nf(r),C=nf(o),w=nf(n),T=nf(p),E=nf(f),D=J(()=>cf(h.current.openEvent?.type,y.interactedInside)),O=J(()=>T.current?.()!==!1),k=J((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!X(t,n);if(!Lo(r))return!1;let a=r;return i.hasMatchingElement(e=>X(e,a))&&(!t||!X(t,a))}),A=J(()=>{y.handler&&=(is(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),j=J(()=>{Ap(y)});return u&&(y.handleCloseOptions=i?.__options),_.useEffect(()=>A,[A]),_.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===wd,A(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,y,A]),_.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=of(S.current,`close`,y.pointerType);r?y.openChangeTimeout.start(r,()=>{e.setOpen(!1,bd(wd,t)),v?.events.emit(`floating.closed`,t)}):n&&(y.openChangeTimeout.clear(),e.setOpen(!1,bd(wd,t)),v?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!Lo(r))return;function i(t){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!Cc(y.pointerType))return;let n=sf(C.current),r=of(S.current,`open`,y.pointerType),i=Is(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(Lo(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(X(t,i)){c=t;break}}Lo(o)&&Lo(s)&&!e.context.triggerElements.hasElement(o)&&X(o,s)&&(c=s);let l=c!=null&&k(s,c,i),u=e.select(`open`),d=E.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&b.current,p=!l&&Lo(c)&&Lo(s)&&X(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?O()&&e.setOpen(!0,bd(wd,t,c)):m||(r?y.openChangeTimeout.start(r,()=>{g&&O()&&e.setOpen(!0,bd(wd,t,c))}):g&&O()&&e.setOpen(!0,bd(wd,t,c)))}function o(n){if(D()){j();return}A();let r=is(e.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!lc(n.relatedTarget,e.context.triggerElements)){if(x.current&&i){e.select(`open`)||y.openChangeTimeout.clear();let a=c.current;y.handler=x.current({...i,tree:v,x:n.clientX,y:n.clientY,onClose(){j(),A(),w.current&&!D()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,y.handler),y.handler(n)}else y.pointerType===`touch`&&X(e.select(`floatingElement`),n.relatedTarget)||t(n)}}function l(e){X(r,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let f=m?as(r,`mouseout`,l):void 0;return s?rs(as(r,`mousemove`,i,{once:!0}),as(r,`mouseenter`,i),as(r,`mouseleave`,o),f):rs(as(r,`mouseenter`,i),as(r,`mouseleave`,o),f)},[A,j,h,S,e,n,x,y,u,k,D,a,s,C,c,v,w,d,E,O,m]),_.useMemo(()=>{if(!n)return;function t(e){y.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=k(i,r,t.target);if(a&&!Cc(y.pointerType))return;if(o&&s&&y.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=y.handleCloseOptions?.getScope?.()??r.ownerDocument.body;jp(y,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=sf(C.current);if(o&&!s||c===0||!s&&y.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;y.restTimeout.clear();function l(){if(y.restTimeoutPending=!1,D())return;let t=e.select(`open`);!y.blockMouseMove&&(!t||s)&&O()&&e.setOpen(!0,bd(wd,n,r))}y.pointerType===`touch`?wu.flushSync(()=>{l()}):s&&o?l():(y.restTimeoutPending=!0,y.restTimeout.start(c,l))}}},[n,y,D,k,a,e,C,O])}function Ip(e){return As&&e.movementX===0&&e.movementY===0}function Lp(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Rp(e,t){return Lp(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function zp(e,t,n){return Lp(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Bp(e,t,n){return Lp(t,n?e===zs:e===Bs,e===Hs)}function Vp(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:Lp(t,n?e===Bs:e===zs,e===Vs)}function Hp(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,triggerOrientation:v=g,parentOrientation:y,id:b,resetOnPointerLeave:x=!0,externalTree:S,nestedReturnFocusRef:C,grid:w}=t,T=w!=null,E=e.useState(`open`),D=e.useState(`floatingElement`),O=e.useState(`domReferenceElement`),k=e.context.dataRef,A=gc(D),j=mc(O),M=nf(A),N=jf(),P=Mf(S),F=_.useRef(f),I=_.useRef(o??-1),L=_.useRef(null),R=_.useRef(!0),z=J(e=>{i(I.current===-1?null:I.current,e)}),B=_.useRef(!!D),V=_.useRef(E),ee=_.useRef(!1),te=_.useRef(!1),ne=_.useRef(null),re=nf(h),H=nf(E),U=nf(o),ie=nf(x),ae=us(),oe=us(),W=J(()=>{ae.cancel();function e(e){d||(ne.current=hf(e,{sync:ee.current,preventScroll:!0}))}let t=n.current[I.current],r=te.current;t&&e(t),(ee.current?e=>e():e=>ae.request(e))(()=>{let i=n.current[I.current]||t;i&&(t||e(i),fe&&(r||!R.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});q(()=>{k.current.orientation=g},[k,g]),q(()=>{E||(L.current=null),E&&f===`auto`||(F.current=f)},[E,f]),q(()=>{a&&(E&&D?(I.current=o??-1,F.current&&o!=null&&(te.current=!0,z())):B.current&&(I.current=-1,z()))},[a,E,D,o,z]),q(()=>{if(a){if(!E)ee.current=!1;else if(D){if(r==null){if(ee.current=!1,U.current!=null)return;if(B.current&&(I.current=-1,W()),(!V.current||!B.current)&&F.current&&(L.current!=null||F.current===!0&&L.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>oe.request(e):queueMicrotask)(t),e+=1):(I.current=L.current==null||zp(L.current,v,u)||l?$c(n):el(n),L.current=null,z())};t()}}else Qc(n.current,r)||(I.current=r,W(),te.current=!1)}}},[a,E,D,r,U,l,n,v,u,z,W,oe]),q(()=>{if(!a||D||!P||d||!B.current)return;let e=P.nodesRef.current,t=e.find(e=>e.id===N)?.context?.elements.floating,n=Ps(is(O??t??null)),r=e.some(e=>e.context&&X(e.context.elements.floating,n));t&&!r&&R.current&&t.focus({preventScroll:!0})},[a,D,O,P,N,d]),q(()=>{V.current=E,B.current=!!D});let se=r!=null,ce=J(e=>{if(!H.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(I.current!==t||r!==t)&&(I.current=t,z(e))}),le=J(()=>y??P?.nodesRef.current.find(e=>e.id===N)?.context?.dataRef?.current.orientation),ue=J(()=>$c(n,re.current)),de=J(t=>{if(R.current=!1,ee.current=!0,t.which===229||!H.current&&t.currentTarget===M.current)return;if(l&&Vp(t.key,g,u,T)){Rp(t.key,le())||yc(t),e.setOpen(!1,bd(Id,t.nativeEvent));let n=C?.current??O;Ro(n)&&n.focus();return}r!=null&&r!==I.current&&!Qc(n.current,r)&&(I.current=r);let i=I.current,a=$c(n,h),o=el(n,h);if(j||(t.key===`Home`&&(yc(t),I.current=a,z(t)),t.key===`End`&&(yc(t),I.current=o,z(t))),w!=null){let e=w(t,I.current,n,g,c,u,h,a,o);if(e!=null&&e!==I.current&&(I.current=e,z(t)),g===`both`)return}if(Rp(t.key,g)){yc(t);let e=Ps(t.currentTarget.ownerDocument);if(E&&!d&&X(t.currentTarget,e)&&!n.current.some(t=>t!=null&&X(t,e))){I.current=zp(t.key,g,u)?a:o,z(t),r===I.current&&W();return}let{index:l,wrapped:f}=tl(n.current,i,{decrement:!zp(t.key,g,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(ee.current=!1),I.current=l,z(t)}}),fe=_.useMemo(()=>({onFocus(e){ee.current=!0,ce(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){Ip(e)||(ee.current=!0,te.current=!1,p&&ce(e))},onPointerLeave(e){if(!H.current||!R.current||e.pointerType===`touch`)return;ee.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&ie.current&&(ne.current?.(),ne.current=null,I.current=-1,z(e),!d)){let e=M.current,t=Ps(is(e));e&&X(e,t)&&e.focus({preventScroll:!0})}}}),[ce,H,M,p,n,z,ie,d]),pe=_.useMemo(()=>d&&E&&se&&{"aria-activedescendant":`${b}-${r}`},[d,E,se,b,r]),me=_.useMemo(()=>({...j?{}:pe,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&E&&!d){let n=Is(t.nativeEvent);if(n&&!X(M.current,n))return;yc(t);let r=bd(Pd,t.nativeEvent);e.setOpen(!1,r);let i=C?.current??O;!r.isCanceled&&Ro(i)&&i.focus()}else de(t)},onPointerMove(e){Ip(e)||(R.current=!0)}}),[pe,de,M,j,e,E,d,O,C]),he=_.useMemo(()=>{function t(t){e.setOpen(!0,bd(Id,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&xc(e.nativeEvent)&&(F.current=!d)}function r(e){F.current=f,f===`auto`&&Sc(e.nativeEvent)&&(F.current=!0)}return{onKeyDown(n){let r=e.select(`open`);R.current=!1;let i=n.key.startsWith(`Arrow`),a=Bp(n.key,le(),u),o=Rp(n.key,r?g:v),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||fc(n.currentTarget)))return de(n);if(r||m||!i){if(s){let e=Rp(n.key,le());L.current=l&&e?null:n.key}l?a&&(yc(n),r?(I.current=ue(),z(n),d&&M.current?.focus()):t(n)):o&&(U.current!=null&&(I.current=U.current),yc(n),!r&&m?t(n):de(n),r&&z(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(I.current=-1,z(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[de,f,ue,l,z,e,m,g,v,le,u,U,d,M]),ge=_.useMemo(()=>({...pe,...he}),[pe,he]);return _.useMemo(()=>a?{reference:ge,floating:me,item:fe,trigger:he}:{},[a,ge,me,he,fe])}function Up(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=J(s),f=e.useState(`open`),p=ps(),m=_.useRef(``),h=_.useRef(u??i??-1),g=_.useRef(null),v=J(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!al(n)||n?.matches(`:disabled`)?!1:o==null||!rl($a,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(yc(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(yc(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),y=J(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);X(r,n)||X(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});q(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let b=_.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]);return _.useMemo(()=>c?{reference:b,floating:b}:{},[c,b])}var Wp=.1,Gp=Wp*Wp,Kp=.5;function qp(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Jp(e,t,n,r,i,a,o,s,c,l){let u=!1;return qp(e,t,n,r,i,a)&&(u=!u),qp(e,t,i,a,o,s)&&(u=!u),qp(e,t,o,s,c,l)&&(u=!u),qp(e,t,c,l,n,r)&&(u=!u),u}function Yp(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Xp(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Zp(e={}){let{blockPointerEvents:t=!1}=e,n=new fs,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Gp;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=Is(r),g=r.type===`mouseleave`,_=X(u,h),v=X(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&Lo(r.relatedTarget)&&X(u,r.relatedTarget))return;function y(){return!!(s&&_c(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Xp(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Xp(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Xp(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Xp(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!Yp(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Kp/2:Kp*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Kp+1,o=C||T?S.bottom-Kp:S.top,s=C?T?S.bottom-Kp:S.top:S.bottom-Kp;M=Jp(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Kp/2:Kp*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Kp,o=C||T?S.top+Kp:S.bottom,s=C?T?S.top+Kp:S.bottom:S.top+Kp;M=Jp(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Kp/2:Kp*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Kp+1,o=w||E?S.right-Kp:S.left,s=w?E?S.right-Kp:S.left:S.right-Kp;M=Jp(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Kp/2:Kp*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Kp,o=w||E?S.left+Kp:S.right,s=w?E?S.left+Kp:S.right:S.left+Kp;M=Jp(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function Qp(e,t,n){let{reference:r,floating:i}=e,a=Lc(t),o=Rc(t),s=Ic(o),c=Nc(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=Pc(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function $p(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}=Mc(t,e),p=Xc(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Zc(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=Zc(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 em=50,tm=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:$p},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Qp(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<em&&(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}=Qp(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},nm=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}=Mc(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Nc(r),_=Lc(o),v=Nc(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Jc(o)]:Bc(o)),x=p!==`none`;!d&&x&&b.push(...qc(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=zc(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`||_===Lc(t)||T.every(e=>Lc(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=Lc(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{}}}},rm=new Set([`left`,`top`]);async function im(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Nc(n),s=Pc(n),c=Lc(n)===`y`,l=rm.has(o)?-1:1,u=a&&c?-1:1,d=Mc(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 am=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 im(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}}}}},om=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}=Mc(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Lc(i),p=Fc(f),m=u[p],h=u[f],g=(e,t)=>jc(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}}}}}},sm=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}=Mc(e,t),u={x:n,y:r},d=Lc(i),f=Fc(d),p=u[f],m=u[d],h=Mc(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=rm.has(Nc(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}}}},cm=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}=Mc(e,t),c=await i.detectOverflow(t,s),l=Nc(n),u=Pc(n),d=Lc(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=Tc(p-c[m],g),y=Tc(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*Ec(c.left,c.right):S=p-2*Ec(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 lm(e){let t=Zo(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ro(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Dc(n)!==a||Dc(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function um(e){return Lo(e)?e:e.contextElement}function dm(e){let t=um(e);if(!Ro(t))return kc(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=lm(t),o=(a?Dc(n.width):n.width)/r,s=(a?Dc(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var fm=kc(0);function pm(e){let t=Y(e);return!Yo()||!t.visualViewport?fm:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function mm(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Y(e)}function hm(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=um(e),o=kc(1);t&&(r?Lo(r)&&(o=dm(r)):o=dm(e));let s=mm(a,n,r)?pm(a):kc(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=Y(a),t=Lo(r)?Y(r):r,n=e,i=ns(n);for(;i&&t!==n;){let e=dm(i),t=i.getBoundingClientRect(),r=Zo(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=Y(i),i=ns(n)}}return Zc({width:u,height:d,x:c,y:l})}function gm(e,t){let n=Qo(e).scrollLeft;return t?t.left+n:hm(Fo(e)).left+n}function _m(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-gm(e,n),y:n.top+t.scrollTop}}function vm(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Fo(r),s=t?Ho(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=kc(1),u=kc(0),d=Ro(r);if((d||!a)&&((Po(r)!==`body`||Bo(o))&&(c=Qo(r)),d)){let e=hm(r);l=dm(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?_m(o,c):kc(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 ym(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function bm(e){let t=Qo(e),n=e.ownerDocument.body,r=Ec(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Ec(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+gm(e),o=-t.scrollTop;return Zo(n).direction===`rtl`&&(a+=Ec(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var xm=25;function Sm(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Y(e),a=Fo(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Yo()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(gm(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<=xm&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Cm(e,t){let n=hm(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=dm(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function wm(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Sm(e,n,t);else if(t===`document`)r=bm(Fo(e));else if(Lo(t))r=Cm(t,n);else{let n=pm(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Zc(r)}function Tm(e,t){let n=t.get(e);if(n)return n;let r=ts(e,[],!1).filter(e=>Lo(e)&&Po(e)!==`body`),i=null,a=Zo(e).position===`fixed`,o=a?$o(e):e;for(;Lo(o)&&!Xo(o);){let e=Zo(o),t=qo(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=$o(o)}return t.set(e,r),r}function Em(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ho(t)?[]:Tm(t,this._c):[].concat(n),r],o=wm(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=wm(t,a[e],i);s=Ec(n.top,s),c=Tc(n.right,c),l=Tc(n.bottom,l),u=Ec(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Dm(e){let{width:t,height:n}=lm(e);return{width:t,height:n}}function Om(e,t,n){let r=Ro(t),i=Fo(t),a=n===`fixed`,o=hm(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=kc(0);if((r||!a)&&((Po(t)!==`body`||Bo(i))&&(s=Qo(t)),r)){let e=hm(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=gm(i));let l=i&&!r&&!a?_m(i,s):kc(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 km(e){return Zo(e).position===`static`}function Am(e,t){if(!Ro(e)||Zo(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Fo(e)===n&&(n=n.ownerDocument.body),n}function jm(e,t){let n=Y(e);if(Ho(e))return n;if(!Ro(e)){let t=$o(e);for(;t&&!Xo(t);){if(Lo(t)&&!km(t))return t;t=$o(t)}return n}let r=Am(e,t);for(;r&&Vo(r)&&km(r);)r=Am(r,t);return r&&Xo(r)&&km(r)&&!qo(r)?n:r||Jo(e)||n}var Mm=async function(e){let t=this.getOffsetParent||jm,n=this.getDimensions,r=await n(e.floating);return{reference:Om(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Nm(e){return Zo(e).direction===`rtl`}var Pm={convertOffsetParentRelativeRectToViewportRelativeRect:vm,getDocumentElement:Fo,getClippingRect:Em,getOffsetParent:jm,getElementRects:Mm,getClientRects:ym,getDimensions:Dm,getScale:dm,isElement:Lo,isRTL:Nm};function Fm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Im(e,t,n){let r=null,i,a=Fo(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=Oc(d),h=Oc(a.clientWidth-(u+f)),g=Oc(a.clientHeight-(d+p)),_=Oc(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Ec(0,Tc(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Fm(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=Y(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Lm(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=um(e),u=i||a?[...l?ts(l):[],...t?ts(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Im(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?hm(e):null;c&&g();function g(){let t=hm(e);h&&!Fm(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 Rm=am,zm=om,Bm=nm,Vm=cm,Hm=sm,Um=(e,t,n)=>{let r=new Map,i=n??{},a={...Pm,...i.platform,_c:r};return tm(e,t,{...i,platform:a})},Wm=typeof document<`u`?_.useLayoutEffect:function(){};function Gm(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Gm(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Gm(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Km(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qm(e,t){let n=Km(e);return Math.round(t*n)/n}function Jm(e){let t=_.useRef(e);return Wm(()=>{t.current=e}),t}function Ym(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);Gm(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,D=Jm(c),O=Jm(i),k=Jm(l),A=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Um(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Gm(T.current,t)&&(T.current=t,wu.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Wm(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=_.useRef(!1);Wm(()=>(j.current=!0,()=>{j.current=!1}),[]),Wm(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=_.useMemo(()=>({reference:x,floating:S}),[x,S]),P=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=qm(N.floating,u.x),r=qm(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Km(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Xm=(e,t)=>{let n=Rm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zm=(e,t)=>{let n=zm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qm=(e,t)=>({fn:Hm(e).fn,options:[e,t]}),$m=(e,t)=>{let n=Bm(e);return{name:n.name,fn:n.fn,options:[e,t]}},eh=(e,t)=>{let n=Vm(e);return{name:n.name,fn:n.fn,options:[e,t]}};function th(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=_.useState(null),d=_.useRef(null),f=Mf(n),p=_.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=Ym({...e,elements:{...p,...l&&{reference:l}}}),h=_.useCallback(e=>{let t=Lo(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=_.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),v=_.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),y=_.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:v,nodeId:t,rootStore:r}),[m,g,v,t,r,s,c]);return q(()=>{o&&(d.current=o)},[o]),q(()=>{r.context.dataRef.current.floatingContext=y;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),_.useMemo(()=>({...m,context:y,refs:g,elements:v,rootStore:r}),[m,g,v,y,r])}var nh=_.createContext(void 0);function rh(){return _.useContext(nh)?.direction??`ltr`}var ih=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}=Mc(e,t)||{};if(l==null)return{};let d=Xc(u),f={x:n,y:r},p=Rc(i),m=Ic(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=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=jc(D,k,O),j=!c.arrow&&Pc(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),ah=(e,t)=>{let{name:n,fn:r}=ih(e);return{name:n,fn:r,options:[e,t]}},oh={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},sh={sideX:`left`,sideY:`top`},ch=`--available-width`,lh=`--available-height`,uh=`--anchor-width`,dh=`--anchor-height`,fh=`--transform-origin`,ph=ch,mh=lh;function hh(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function gh(e,t,n){let{rects:r,placement:i}=e;return{side:hh(t,Nc(i),n),align:Pc(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function _h(e){return vh(e,th)}function vh(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,w=v.side||`flip`,T=v.align||`flip`,E=v.fallbackAxisSide||`end`,D=y?.crossAxis??!1,O=y?.rootBoundary,k=typeof n==`function`?n:void 0,A=J(k),j=k?A:n,M=nf(n),N=nf(g),P=rh()===`rtl`,[F,I]=_.useState(null);!g&&F!==null&&I(null);let L=S===`placement`,R=F?Nc(F):null,z=F&&L?Pc(F)||`center`:null,B=R||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":P?`left`:`right`,"inline-start":P?`right`:`left`}[i],V=z||o,ee=V===`center`?B:`${B}-${V}`,te=l;typeof te==`number`?te={top:te,right:te,bottom:te,left:te}:te&&={top:te.top||0,right:te.right||0,bottom:te.bottom||0,left:te.left||0};let ne=+(i===`bottom`),re=+(i===`top`),H=+(i===`right`),U=+(i===`left`),ie={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:te},ae=_.useRef(null),oe=nf(a),W=nf(s),se=typeof a==`function`?0:a,ce=typeof s==`function`?0:s,le=[];p&&le.push(p),le.push(Xm(e=>{let t=gh(e,i,P),n=typeof oe.current==`function`?oe.current(t):oe.current,r=typeof W.current==`function`?W.current(t):W.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[se,ce,P,i]));let ue=T===`none`&&w!==`shift`,de=!ue&&(u||D||w===`shift`),fe=w===`none`?null:$m({...ie,padding:{top:te.top+1+ne,right:te.right+1+U,bottom:te.bottom+1+re,left:te.left+1+H},mainAxis:!D&&w===`flip`,crossAxis:T===`flip`&&`alignment`,fallbackAxisSideDirection:E}),pe=ue?null:Zm({...ie,rootBoundary:O,mainAxis:T!==`none`,crossAxis:de,limiter:u||D?void 0:Qm(e=>{if(!ae.current)return{};let{width:t,height:n}=ae.current.getBoundingClientRect(),r=Lc(Nc(e.placement)),i=r===`y`?t:n,a=r===`y`?te.left+te.right:te.top+te.bottom;return{offset:i/2+a/2}})},[ie,u,D,O,te,T]);w===`shift`||T===`shift`||V===`center`?le.push(pe,fe):le.push(fe,pe),le.push(eh({...ie,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!N.current)return;let i=e.style;i.setProperty(ph,`${t}px`),i.setProperty(mh,`${n}px`);let a=Y(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(uh,`${u}px`),i.setProperty(dh,`${d}px`)}}),ah(e=>({element:ae.current||is(e.elements.floating).createElement(`div`),padding:ae.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=Nc(r),u=Pc(r),d=Lc(l)===`y`,f=ae.current,p=typeof a==`function`?a(gh(e,i,P)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return de&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(fh,d?`${m} ${h}`:`${h} ${m}`),{}}},oh,x),q(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let me=_.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:he,elements:ge,x:_e,y:ve,middlewareData:ye,update:G,placement:be,context:xe,isPositioned:Se,floatingStyles:Ce}=t({rootContext:h,open:m?g:void 0,placement:ee,middleware:le,strategy:r,whileElementsMounted:m?void 0:(...e)=>Lm(...e,me),nodeId:b,externalTree:C}),{sideX:we,sideY:Te}=ye.adaptiveOrigin||sh,Ee=Se?r:`fixed`,De=_.useMemo(()=>{let e;return e=Se?x?{position:Ee,[we]:_e,[Te]:ve}:{...Ce,position:Ee}:{position:Ee,top:0,left:0},e[ph]=`100vw`,e[mh]=`100vh`,Se||(e.opacity=0),e},[x,Ee,we,_e,Te,ve,Ce,Se]),Oe=_.useRef(null);q(()=>{if(!g)return;let e=M.current,t=typeof e==`function`?e():e,n=(yh(t)?t.current:t)||null;n!==Oe.current&&(he.setPositionReference(n),Oe.current=n)},[g,he,j,M]),_.useEffect(()=>{if(!g)return;let e=M.current;typeof e!=`function`&&yh(e)&&e.current!==Oe.current&&(he.setPositionReference(e.current),Oe.current=e.current)},[g,he,j,M]),_.useEffect(()=>{if(m&&g&&ge.reference&&ge.floating)return Lm(ge.reference,ge.floating,G,me)},[m,g,ge,G,me]);let ke=Nc(be),Ae=hh(i,ke,P),je=Pc(be)||`center`,Me=!!ye.hide?.referenceHidden;q(()=>{S&&g&&Se&&(ke!==B||L&&je!==V)&&I(be)},[S,L,g,Se,be,ke,je,B,V]);let Ne=_.useMemo(()=>({position:`absolute`,top:ye.arrow?.y,left:ye.arrow?.x}),[ye.arrow]),Pe=ye.arrow?.centerOffset!==0;return _.useMemo(()=>({positionerStyles:De,arrowStyles:Ne,arrowRef:ae,arrowUncentered:Pe,side:Ae,align:je,physicalSide:ke,anchorHidden:Me,refs:he,context:xe,isPositioned:Se,update:G}),[De,Ne,ae,Pe,Ae,je,ke,Me,he,xe,Se,G])}function yh(e){return e!=null&&`current`in e}function bh(e){return e===`starting`?ku:eo}function xh(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),uu(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},bh(r),i],stateAttributesMapping:oc})}function Sh(){let e=so(),t=e.useState(`toasts`);return _.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function Ch(){let e=new Set;function t(t){e.forEach(e=>e(t))}return{" subscribe":function(t){return e.add(t),()=>{e.delete(t)}},add(e){let n=e.id||_s(`toast`);return t({action:`add`,options:{...e,id:n,transitionStatus:`starting`}}),n},close(e){t({action:`close`,options:{id:e}})},update(e,n){t({action:`update`,options:{id:e,updates:n}})},promise(e,n){let r=e;return t({action:`promise`,options:{...n,promise:e,setPromise(e){r=e}}}),r}}}var wh=_.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=hd({disabled:i,focusableWhenDisabled:a,native:o});return uu(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})});function Th(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Th(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Eh(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Th(e))&&(r&&(r+=` `),r+=t);return r}var Dh=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Oh=Eh,kh=(e,t)=>n=>{if(t?.variants==null)return Oh(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Dh(t)||Dh(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Oh(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Ah=Object.defineProperty,jh=((e,t)=>{let n={};for(var r in e)Ah(n,r,{get:e[r],enumerable:!0});return t||Ah(n,Symbol.toStringTag,{value:`Module`}),n})({isAny:()=>Gh,isAnyNonArbitrary:()=>Xh,isArbitraryFamilyName:()=>pg,isArbitraryImage:()=>hg,isArbitraryLength:()=>ug,isArbitraryNumber:()=>dg,isArbitraryPosition:()=>mg,isArbitraryShadow:()=>gg,isArbitrarySize:()=>cg,isArbitraryValue:()=>lg,isArbitraryVariable:()=>_g,isArbitraryVariableFamilyName:()=>yg,isArbitraryVariableImage:()=>Sg,isArbitraryVariableLength:()=>vg,isArbitraryVariablePosition:()=>bg,isArbitraryVariableShadow:()=>Cg,isArbitraryVariableSize:()=>xg,isArbitraryVariableWeight:()=>wg,isArbitraryWeight:()=>fg,isFraction:()=>Bh,isInteger:()=>Hh,isNamedContainerQuery:()=>Zh,isNumber:()=>Vh,isPercent:()=>Uh,isTshirtSize:()=>Wh}),Mh=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Nh=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ph=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Fh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ih=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Lh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Rh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Bh=e=>Ph.test(e),Vh=e=>!!e&&!Number.isNaN(Number(e)),Hh=e=>!!e&&Number.isInteger(Number(e)),Uh=e=>e.endsWith(`%`)&&Vh(e.slice(0,-1)),Wh=e=>Fh.test(e),Gh=()=>!0,Kh=e=>Ih.test(e)&&!Lh.test(e),qh=()=>!1,Jh=e=>Rh.test(e),Yh=e=>zh.test(e),Xh=e=>!lg(e)&&!_g(e),Zh=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Qh=(e,t,n)=>{let r=Mh.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},$h=(e,t,n=!1)=>{let r=Nh.exec(e);return r?r[1]?t(r[1]):n:!1},eg=e=>e===`position`||e===`percentage`,tg=e=>e===`image`||e===`url`,ng=e=>e===`length`||e===`size`||e===`bg-size`,rg=e=>e===`length`,ig=e=>e===`number`,ag=e=>e===`family-name`,og=e=>e===`number`||e===`weight`,sg=e=>e===`shadow`,cg=e=>Qh(e,ng,qh),lg=e=>Mh.test(e),ug=e=>Qh(e,rg,Kh),dg=e=>Qh(e,ig,Vh),fg=e=>Qh(e,og,Gh),pg=e=>Qh(e,ag,qh),mg=e=>Qh(e,eg,qh),hg=e=>Qh(e,tg,Yh),gg=e=>Qh(e,sg,Jh),_g=e=>Nh.test(e),vg=e=>$h(e,rg),yg=e=>$h(e,ag),bg=e=>$h(e,eg),xg=e=>$h(e,ng),Sg=e=>$h(e,tg),Cg=e=>$h(e,sg,!0),wg=e=>$h(e,og,!0),Tg=(e,t)=>{let n=Object.keys(e);return n.length===1&&n[0]===t&&typeof e[t]==`string`},Eg=e=>typeof e==`function`&&e.isThemeGetter===!0,Dg=e=>({...e,theme:{...e.theme},classGroups:{...e.classGroups},conflictingClassGroups:{...e.conflictingClassGroups},conflictingClassGroupModifiers:{...e.conflictingClassGroupModifiers},orderSensitiveModifiers:[...e.orderSensitiveModifiers],postfixLookupClassGroups:[...e.postfixLookupClassGroups??[]]}),Og=(e,t)=>{let n=Dg(e);t.prefix!==void 0&&(n.prefix=t.prefix);let r=(e,t)=>{if(t)for(let n in t)t[n]!==void 0&&(e[n]=t[n])},i=t.override;i&&(i.orderSensitiveModifiers&&(n.orderSensitiveModifiers=[...i.orderSensitiveModifiers]),r(n.theme,i.theme),r(n.classGroups,i.classGroups),r(n.conflictingClassGroups,i.conflictingClassGroups),r(n.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers));let a=(e,t)=>{if(t)for(let n in t){let r=t[n];r&&(e[n]=(e[n]??[]).concat(r))}},o=t.extend;return o&&(o.orderSensitiveModifiers&&(n.orderSensitiveModifiers=[...n.orderSensitiveModifiers,...o.orderSensitiveModifiers]),a(n.theme,o.theme),a(n.classGroups,o.classGroups),a(n.conflictingClassGroups,o.conflictingClassGroups),a(n.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers)),n},kg={isAny:0,isAnyNonArbitrary:1,isArbitraryValue:2,isArbitraryVariable:3,isFraction:4,isNumber:5,isInteger:6,isPercent:7,isTshirtSize:8,isNamedContainerQuery:9,isArbitraryLength:10,isArbitraryNumber:11,isArbitraryWeight:12,isArbitraryFamilyName:13,isArbitraryPosition:14,isArbitrarySize:15,isArbitraryImage:16,isArbitraryShadow:17,isArbitraryVariableLength:18,isArbitraryVariableFamilyName:19,isArbitraryVariablePosition:20,isArbitraryVariableSize:21,isArbitraryVariableImage:22,isArbitraryVariableShadow:23,isArbitraryVariableWeight:24},Ag=25,jg=()=>({names:[],idByName:new Map,impls:{},fnName:new Map,classifierFns:new Map}),Mg=(e,t,n)=>{let r=e.idByName.get(t);return r===void 0&&(r=e.names.length,e.names.push(t),e.idByName.set(t,r),e.classifierFns.set(t,n)),r},Ng=(e,t)=>{if(typeof t==`function`){let n=e.fnName.get(t);return n===void 0&&(n=`$c`+e.fnName.size,e.fnName.set(t,n),e.impls[n]=t),Mg(e,n,t)}let n=t.$v,r=jh[n];if(kg[n]===void 0||!r)throw Error(`cn: unknown validator "${n}"`);return Mg(e,n,r)},Pg=()=>({nextPart:new Map,validators:null,classGroupId:-1,lit:[]}),Fg=(e,t)=>e.theme[t]??[],Ig=(e,t,n)=>{let r=Pg(),i=(e,t)=>{for(let n of t.split(`-`)){let t=e.nextPart.get(n);t||(t=Pg(),e.nextPart.set(n,t)),e=t}return e},a=(n,r,o)=>{if(typeof n==`string`){let e=n===``?r:i(r,n);e.classGroupId=o}else if(typeof n==`function`){if(Eg(n)){for(let t of n(e.theme))a(t,r,o);return}(r.validators??=[]).push({validatorId:Ng(t,n),groupId:o})}else if(Tg(n,`$t`))for(let t of Fg(e,n.$t))a(t,r,o);else if(Tg(n,`$v`))(r.validators??=[]).push({validatorId:Ng(t,n),groupId:o});else for(let[e,t]of Object.entries(n)){let n=i(r,e);for(let e of t)a(e,n,o)}};for(let[t,i]of Object.entries(e.classGroups)){let e=n(t);for(let t of i)a(t,r,e)}return r},Lg=e=>{let t=jg(),n=[],r=new Map,i=e=>{let t=r.get(e);return t===void 0&&(t=n.length,n.push(e),r.set(e,t)),t},a=Ig(e,t,i),o=e=>{if(e.validators)return!1;for(let t of e.nextPart.values())if(!o(t))return!1;return!0},s=(e,t,n)=>{e.classGroupId>=0&&n.push({tail:t,gid:e.classGroupId});for(let[r,i]of e.nextPart)s(i,t+`-`+r,n)},c=e=>{for(let[t,n]of[...e.nextPart])o(n)?(s(n,t,e.lit),e.nextPart.delete(t)):c(n)};c(a);let l=[{edges:new Map,groupId:-1,vlist:-1}],u=()=>(l.push({edges:new Map,groupId:-1,vlist:-1}),l.length-1),d=[],f=new Map,p=e=>{let t=e.map(e=>e.validatorId+`:`+e.groupId).join(`,`),n=f.get(t);return n===void 0&&(n=d.length,d.push(e.map(e=>[e.validatorId,e.groupId])),f.set(t,n)),n},m=(e,t)=>{let n=e;for(let e=0;e<t.length;e++){let r=t.charCodeAt(e),i=l[n].edges.get(r);i===void 0&&(i=u(),l[n].edges.set(r,i)),n=i}return n},h=[],g=(e,t,n)=>{e.classGroupId>=0&&(l[t].groupId=e.classGroupId),e.validators&&(l[t].vlist=p(e.validators));for(let{tail:n,gid:r}of e.lit)h.push({anchor:t,tail:n,gid:r});for(let[r,i]of e.nextPart){let e=t;if(!n){let n=l[t].edges.get(45);n===void 0&&(n=u(),l[t].edges.set(45,n)),e=n}let a=m(e,r);g(i,a,!1)}};g(a,0,!0);let _=new Set(h.map(e=>e.anchor)),v=e=>l[e].groupId>=0||l[e].vlist>=0||_.has(e),y=new Map,b=[],x=e=>{let t=b.length;y.set(e,t);let n={edges:[],groupId:l[e].groupId,vlist:l[e].vlist};b.push(n);let r=[...l[e].edges.entries()].sort((e,t)=>e[0]-t[0]);for(let[e,t]of r){let r=String.fromCharCode(e),i=t;for(;l[i].edges.size===1&&!v(i);){let[[e,t]]=l[i].edges.entries();r+=String.fromCharCode(e),i=t}n.edges.push({label:r,oldTarget:i})}for(let e of n.edges)x(e.oldTarget);return t};x(0);let S=b.length,C=0;for(let e of b)C+=e.edges.length;let w=new Int32Array(S),T=new Int32Array(C),E=``,D=new Int32Array(S),O=new Int32Array(S),k=[];{let e=0;for(let t=0;t<S;t++){let n=b[t];w[t]=n.edges.length;for(let t of n.edges)T[e]=t.label.length,E+=t.label,k.push(y.get(t.oldTarget)),e++;D[t]=n.groupId,O[t]=n.vlist}}{let e=new Int32Array(S);for(let t=S-1;t>=0;t--){let n=1,r=t+1;for(let i=0;i<w[t];i++)n+=e[r],r+=e[r];e[t]=n}let t=0;for(let n=0;n<S;n++){let r=n+1;for(let i=0;i<w[n];i++){if(r!==k[t])throw Error(`cn compiler: edge target mismatch at ${t}`);r+=e[r],t++}}}for(let e of h)e.anchor=y.get(e.anchor);{let e=new Int32Array(d.length).fill(-1),t=[];for(let n=0;n<S;n++){let r=O[n];r>=0&&(e[r]===-1&&(e[r]=t.length,t.push(d[r])),O[n]=e[r])}d.length=0,d.push(...t)}let A=0;for(let e of d)A+=e.length;let j=new Int32Array(A),M=new Int32Array(A);{let e=0;for(let t of d)for(let[n,r]of t)j[e]=n,M[e]=r,e++}h.sort((e,t)=>e.anchor-t.anchor||e.gid-t.gid||(e.tail<t.tail?-1:1));let N=[];for(let e of h){let t=N[N.length-1];t&&t.anchor===e.anchor&&t.gid===e.gid?t.tails.push(e.tail):N.push({anchor:e.anchor,gid:e.gid,tails:[e.tail],set:-1})}let P=new Map,F=[];for(let e of N){let t=e.tails.join(` `),n=P.get(t);n===void 0&&(n=F.length,P.set(t,n),F.push(e.tails)),e.set=n}for(let e of F.flat())if(e.includes(`|`)||e.includes(` `))throw Error(`cn compiler: tail contains delimiter: `+e);let I=new Set(F.flat()).size;N.sort((e,t)=>e.anchor-t.anchor||e.set-t.set);for(let t of Object.values(e.conflictingClassGroups))for(let e of t)i(e);for(let t of Object.values(e.conflictingClassGroupModifiers))for(let e of t)i(e);for(let t of e.postfixLookupClassGroups??[])i(t);let L=n.length,R=new Int32Array(L).fill(-1),z=0,B=e=>(R[e]===-1&&(R[e]=z++),R[e]);for(let e=0;e<M.length;e++)M[e]=B(M[e]);for(let e of N)e.gid=B(e.gid);for(let e=0;e<D.length;e++)D[e]>=0&&(D[e]=B(D[e]));for(let e=0;e<L;e++)R[e]===-1&&(R[e]=z++);let V=Array(L);for(let e=0;e<L;e++)V[R[e]]=n[e];let ee=[],te=[],ne=[],re=[],H=[];for(let t=0;t<L;t++){let n=V[t],i=(e.conflictingClassGroups[n]??[]).map(e=>R[r.get(e)]),a=(e.conflictingClassGroupModifiers[n]??[]).map(e=>R[r.get(e)]);i.length&&(ee.push(t),te.push(i.length),ne.push(...i));for(let e of a)re.push(t),H.push(e)}let U=(e.postfixLookupClassGroups??[]).map(e=>R[r.get(e)]),ie=[],ae=new Int32Array(j.length);for(let e=0;e<j.length;e++){let n=t.names[j[e]],r=kg[n];if(r!==void 0)ae[e]=r;else{let t=ie.indexOf(n);t===-1&&(t=ie.length,ie.push(n)),ae[e]=Ag+t}}let oe=new Map,W=[],se=[],ce=[];{let e=0;for(let t of d){let n=[];for(let r=0;r<t.length;r++)n.push(ae[e++]);let r=n.join(`,`),i=oe.get(r);i===void 0&&(i=W.length,oe.set(r,i),W.push(n.length),se.push(...n)),ce.push(i)}}let le={};for(let e of ie)le[e]=t.classifierFns.get(e);return{G:L,customNames:ie,impls:le,edgeCounts:w,edgeLabelLen:T,labelText:E,edgeTargetActual:k,nodeGroup:D,nodeVlist:O,nodeCount:S,totalEdges:C,patCounts:W,patOps:se,listPat:ce,vlistGroup:M,litEntries:h,sets:F,attachments:N,uniqueTailCount:I,adjGid:ee,adjCnt:te,adjTgt:ne,patGid:re,patTgt:H,postfixLookup:U,orderSensitiveModifiers:e.orderSensitiveModifiers.join(` `),prefix:e.prefix}},Rg=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},eee=e=>{let t=Lg(e),n=t.litEntries.length,r=new Int32Array(n),i=new Int32Array(n),a=new Int32Array(n),o=``,s=new Int32Array(t.uniqueTailCount*2);{let e=new Map,n=0,c=0;for(let l of t.attachments)for(let u of t.sets[l.set]){let t=e.get(u);t===void 0&&(t=n++,e.set(u,t),s[t*2]=o.length,s[t*2+1]=u.length,o+=u),r[c]=l.anchor,i[c]=l.gid,a[c]=t,c++}}return{tables:{GROUP_COUNT:t.G,edgeStart:Rg(t.edgeCounts),labelStart:Rg(t.edgeLabelLen),labelText:t.labelText,edgeTarget:Int32Array.from(t.edgeTargetActual),nodeGroup:t.nodeGroup,nodeVlist:t.nodeVlist,vlistPat:Rg(t.patCounts),vlistOps:Int32Array.from(t.patOps),vlistRef:Int32Array.from(t.listPat),vlistGroup:t.vlistGroup,litAnchor:r,litGroup:i,litPool:a,poolOffsets:s,poolText:o,adjGid:Int32Array.from(t.adjGid),adjStart:Rg(t.adjCnt),adjTgt:Int32Array.from(t.adjTgt),patGid:Int32Array.from(t.patGid),patTgt:Int32Array.from(t.patTgt),postfixLookupGroups:Int32Array.from(t.postfixLookup),customValidatorNames:t.customNames,orderSensitiveModifiers:t.orderSensitiveModifiers},validatorImpls:t.impls,prefix:t.prefix}},tee=`line`in Error(),zg=-1,Bg=-1,Vg=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},Hg=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},nee=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let L=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(Vg(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;L[n]!==-1;)n=n+1&I-1;L[n]=e}let R=(e,t,n,r)=>{let i=(Vg(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=L[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},z=n.cacheSize??8192,B=n.prefix??e.prefix??``,V=B===``?``:B+`:`,ee=V.length,te=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),ne=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,re=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,H=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,U=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ie=0,ae=-1,oe=-1,W=-1,se=-1,ce=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,le=e=>/\s/.test(String.fromCharCode(e)),ue=(e,t,n)=>{if(ie=0,ae=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)ie=1;else if(r===40&&i===41)ie=2;else return;W=t+1,se=n-1;let a=t+1;if(ce(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!ce(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(ae=t+1,oe=a,W=a+1)}},de=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},fe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,pe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,me=e=>!!e&&!Number.isNaN(Number(e)),he=(e,t,n)=>{if(n-t<11||!de(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&de(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&de(e,t+10,t+18,`-normal/`)},ge=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],_e=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),ve=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],ye=(e,t,n,r)=>{if(e>=10){if(e>=25)return te[e-25](t.slice(n,r));let i=e-10;if(ie!==ge[i])return!1;if(ae>=0){for(let e of _e[i])if(de(t,ae,oe,e))return!0;return!1}switch(ve[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(W,se);return ne.test(e)&&!re.test(e)}case 3:return me(t.slice(W,se));case 4:return U.test(t.slice(W,se));default:return H.test(t.slice(W,se))}}switch(e){case 0:return!0;case 1:return ie===0;case 2:return ie===1;case 3:return ie===2;case 4:return fe.test(t.slice(n,r));case 5:return me(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&me(t.slice(n,r-1));case 8:return pe.test(t.slice(n,r));default:return he(t,n,r)}},G=new Set(typeof E==`string`?E.split(` `):E),be=(e,t,n,r,i,a)=>{let o=Vg(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},xe=new Map,Se=new Map,Ce=2,we=4096,Te=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||G.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=Se.get(s);return c===void 0&&Se.set(s,c=Ce++),c},Ee=new Map,De=r,Oe=r+4096,ke=()=>De++,Ae=2097152,je=8192,Me=new Int32Array(je),Ne=Array(je).fill(null),Pe=new Int32Array(je),Fe=new Int32Array(je),Ie=new Uint8Array(je),Le=0,Re=(e,t,n,r,i,a,o,s)=>{let c=e;if(Ne[e]!==null){if(Ne[e|1]===null)c=e|1;else if(!(Le++&3))c=e|Le>>2&1;else return}Ne[c]=t.slice(n,r),Me[c]=i,Pe[c]=a,Fe[c]=o,Ie[c]=s},ze=()=>Ne.fill(null),Be=256,Ve=[new Int32Array(Be),new Int32Array(Be),new Int32Array(Be),new Int32Array(Be)],[K,He,Ue,We]=Ve,Ge=new Uint8Array(Be),Ke=new Uint8Array(Be),qe=()=>{Be*=2,Ve=Ve.map(e=>{let t=new Int32Array(Be);return t.set(e),t}),[K,He,Ue,We]=Ve;let e=new Uint8Array(Be);e.set(Ge),Ge=e,Ke=new Uint8Array(Be)},Je=64,Ye=new Int32Array(Je),Xe=new Int32Array(Je),Ze=new Int32Array(r),Qe=2048,$e=21,et=new Float64Array(Qe),tt=new Int32Array(Qe),nt=0,rt=(e,t)=>{if(e===0&&t<r)return Ze[t]===nt?1:(Ze[t]=nt,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>$e;for(;tt[i]===nt;){if(et[i]===n)return 1;i=i+1&Qe-1}return et[i]=n,tt[i]=nt,0},it=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?zg:be(Ee,e,t+1,r,0,ke)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=Xe[t];if(r>n)continue;let i=Ye[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=R(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;ue(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(ye(d[t],e,r,n))return p[h+t]}return zg},at=e=>{let t=e.length,n=0,c=0,u=!1;(Ce>we||xe.size>we)&&(xe=new Map,Se=new Map,Ce=2,ze()),De>Oe&&(Ee=new Map,De=r,ze());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&le(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&le(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Be&&qe();let _=n++;K[_]=p,He[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(Me[y]===v&&Ne[y]!==null&&Ne[y].length===g?t=y:Me[y|1]===v&&Ne[y|1]!==null&&Ne[y|1].length===g&&(t=y|1),t>=0){let n=Ne[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){Ue[_]=Pe[t],We[_]=Fe[t],Ge[_]=Ie[t];continue}}}let b=p;if(ee!==0){if(h-p<=ee||!e.startsWith(V,p)){Ue[_]=zg,Re(y,e,p,h,v,zg,0,0);continue}b=p+ee}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,L=-1,R=0;(l[0]>=0||N[0]===1)&&(Ye[0]=0,Xe[0]=M,R=1);let z=Bg,B=0;for(let t=M;t<D;t++)if(t===A&&(z=F<I?Bg:P,B=R),P!==Bg){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=L)):P=Bg;else{let e=i[P],t=i[P+1],c=Bg;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],L=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(R===Je){Je*=2;let e=new Int32Array(Je);e.set(Ye),Ye=e;let t=new Int32Array(Je);t.set(Xe),Xe=t}Ye[R]=r,Xe[R]=t+2,R++}}A===D&&(z=F<I?Bg:P,B=R);let te=F<I?Bg:P,ne,re=!1;if(A>=0){if(re=!0,ne=it(e,E,A,z,B),ne!==zg&&ne<r&&j[ne]){let t=it(e,E,D,te,R);t!==zg&&t!==ne&&(ne=t,re=!1)}else ne===zg&&(ne=it(e,E,D,te,R),re=!1)}else ne=it(e,E,D,te,R);let H=0,U=0;ne===zg?Ue[_]=zg:(U=+!!re,H=b>=C?+!!O:be(xe,e,b,C,+!!O,e=>Te(e,O)),Ue[_]=ne,Ge[_]=U,We[_]=H),Re(y,e,p,h,v,ne,H,U)}if(n===0)return``;if(n===1)return K[0]===0&&He[0]===t?e:e.slice(K[0],He[0]);if(n*k>Qe){for(;n*k>Qe;)Qe<<=1,$e--;et=new Float64Array(Qe),tt=new Int32Array(Qe)}if(Ce>=Ae||De>=Ae)throw Error(`cn: too many distinct classes in one merge`);nt=nt+1|0,nt===0&&(Ze.fill(0),tt.fill(0),nt=1);let f=!1;for(let e=n-1;e>=0;e--){let t=Ue[e];if(t===zg){Ke[e]=1;continue}let n=We[e];if(rt(n,t)===1)Ke[e]=0,f=!0;else if(Ke[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)rt(n,x[e]);if(Ge[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&rt(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!Ke[m]){m++;continue}let t=K[m],r=He[m],i=m+1;for(;i<n&&Ke[i]&&K[i]===r+1&&e.charCodeAt(r)===32;)r=He[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},ot=16384,st=new Int32Array(ot*2),ct=0,lt=1,ut=Object.create(null),dt=Object.create(null),ft=new Map,pt=new Map,mt=0,ht=0,gt=()=>{ct^=ot,lt=lt+1|0,ht=0},_t=e=>{let t=ut[e];if(t!==void 0)return t;let n=Hg(e,0,e.length),r=(n&16383)+ct,i=st[r]===(n^lt)||st[r^ot]===(n^lt-1);return i&&(t=dt[e],t!==void 0)?(ut[e]=t,t):(t=at(e),i?(ut[e]=t,++mt>z&&(mt=0,dt=ut,ut=Object.create(null),gt())):(st[r]=n^lt,++ht>ot&>()),t)},vt=e=>{let t=ft.get(e);if(t!==void 0)return t;let n=Hg(e,0,e.length),r=(n&16383)+ct,i=st[r]===(n^lt)||st[r^ot]===(n^lt-1);return i&&(t=pt.get(e),t!==void 0)?(ft.set(e,t),t):(t=at(e),i?(ft.set(e,t),++mt>z&&(mt=0,pt=ft,ft=new Map,gt())):(st[r]=n^lt,++ht>ot&>()),t)},yt=e=>{let t=Hg(e,0,e.length),n=(t&16383)+ct;return st[n]===(t^lt)||st[n^ot]===(t^lt-1)||(st[n]=t^lt,++ht>ot&>(),!1)},bt=z===0?at:tee?e=>{let t=ft.get(e);return t===void 0?vt(e):t}:_t;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?bt(arguments[0]):bt(iee.apply(null,arguments))},mergeString:bt,seenBefore:z===0?()=>!1:yt,mergeUncached:at}},Ug=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:Ug(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},ree=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:Ug(i,t);a&&(n&&(n+=` `),n+=a)}return n},iee=function(){return ree(arguments,!1)},Wg=256,Gg=16,Kg=1024,qg=4096,Jg=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(qg).fill(``),l=Array(qg).fill(``),u=Array(qg).fill(``));let i=Hg(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=Ug(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>Gg&&(_.miss=Gg,_.skip=Kg,_.e.length=0,_.at=0);let u=_.e;u.length<Wg?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(Ug(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},Yg=`{"theme":{"animate":["spin","ping","pulse","bounce"],"aspect":["video"],"blur":[{"$v":"isTshirtSize"}],"breakpoint":[{"$v":"isTshirtSize"}],"color":[{"$v":"isAny"}],"container":[{"$v":"isTshirtSize"}],"drop-shadow":[{"$v":"isTshirtSize"}],"ease":["in","out","in-out"],"font":[{"$v":"isAnyNonArbitrary"}],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[{"$v":"isTshirtSize"}],"leading":["none","tight","snug","normal","relaxed","loose"],"perspective":["dramatic","near","normal","midrange","distant","none"],"radius":[{"$v":"isTshirtSize"}],"shadow":[{"$v":"isTshirtSize"}],"spacing":["px",{"$v":"isNumber"}],"text":[{"$v":"isTshirtSize"}],"text-shadow":[{"$v":"isTshirtSize"}],"tracking":["tighter","tight","normal","wide","wider","widest"]},"classGroups":{"aspect":[{"aspect":["auto","square",{"$v":"isFraction"},{"$v":"isArbitraryValue"},{"$v":"isArbitraryVariable"},{"$t":"aspect"}]}],"container":["container"],"container-type":[{"@container":["","normal","size",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"container-named":[{"$v":"isNamedContainerQuery"}],"columns":[{"columns":[{"$v":"isNumber"},"auto",{"$v":"isArbitraryValue"},{"$v":"isArbitraryVariable"},{"$t":"container"}]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],"box":[{"box":["border","content"]}],"display":["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],"sr":["sr-only","not-sr-only"],"float":[{"float":["right","left","none","start","end"]}],"clear":[{"clear":["left","right","both","none","start","end"]}],"isolation":["isolate","isolation-auto"],"object-fit":[{"object":["contain","cover","fill","none","scale-down"]}],"object-position":[{"object":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"overflow":[{"overflow":["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],"overscroll":[{"overscroll":["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],"position":["static","fixed","absolute","relative","sticky"],"inset":[{"inset":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-x":[{"inset-x":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-y":[{"inset-y":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"start":[{"inset-s":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}],"start":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"end":[{"inset-e":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}],"end":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-bs":[{"inset-bs":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-be":[{"inset-be":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"top":[{"top":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"right":[{"right":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"bottom":[{"bottom":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"left":[{"left":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"visibility":["visible","invisible","collapse"],"z":[{"z":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"basis":[{"basis":[{"$v":"isFraction"},"full","auto",{"$t":"container"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"flex-direction":[{"flex":["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{"flex":["nowrap","wrap","wrap-reverse"]}],"flex":[{"flex":[{"$v":"isNumber"},{"$v":"isFraction"},"auto","initial","none",{"$v":"isArbitraryValue"}]}],"grow":[{"grow":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"shrink":[{"shrink":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"order":[{"order":[{"$v":"isInteger"},"first","last","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grid-cols":[{"grid-cols":[{"$v":"isInteger"},"none","subgrid",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"col-start-end":[{"col":["auto",{"span":["full",{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"col-start":[{"col-start":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"col-end":[{"col-end":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grid-rows":[{"grid-rows":[{"$v":"isInteger"},"none","subgrid",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"row-start-end":[{"row":["auto",{"span":["full",{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"row-start":[{"row-start":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"row-end":[{"row-end":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"auto-cols":[{"$t":"spacing"}]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"auto-rows":[{"$t":"spacing"}]}],"gap":[{"gap":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"gap-x":[{"gap-x":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"gap-y":[{"gap-y":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"justify-content":[{"justify":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{"content":["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{"items":["start","end","center","stretch","center-safe","end-safe",{"baseline":["","last"]}]}],"align-self":[{"self":["auto","start","end","center","stretch","center-safe","end-safe",{"baseline":["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"p":[{"p":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"px":[{"px":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"py":[{"py":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"ps":[{"ps":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pe":[{"pe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pbs":[{"pbs":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pbe":[{"pbe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pt":[{"pt":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pr":[{"pr":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pb":[{"pb":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pl":[{"pl":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"m":[{"m":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mx":[{"mx":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"my":[{"my":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"ms":[{"ms":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"me":[{"me":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mbs":[{"mbs":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mbe":[{"mbe":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mt":[{"mt":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mr":[{"mr":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mb":[{"mb":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"ml":[{"ml":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"space-x":[{"space-x":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"space-y-reverse":["space-y-reverse"],"size":[{"size":[{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inline-size":[{"inline":["auto",{"$t":"container"},{"$v":"isFraction"},"screen","full","dvw","lvw","svw","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-inline-size":[{"min-inline":["auto",{"$t":"container"},{"$v":"isFraction"},"screen","full","dvw","lvw","svw","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-inline-size":[{"max-inline":["none",{"$t":"container"},{"$v":"isFraction"},"screen","full","dvw","lvw","svw","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"block-size":[{"block":["auto",{"$v":"isFraction"},"screen","full","lh","dvh","lvh","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-block-size":[{"min-block":["auto",{"$v":"isFraction"},"screen","full","lh","dvh","lvh","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-block-size":[{"max-block":["none",{"$v":"isFraction"},"screen","full","lh","dvh","lvh","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"w":[{"w":[{"$t":"container"},"screen",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-w":[{"min-w":[{"$t":"container"},"screen","none",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-w":[{"max-w":[{"$t":"container"},"screen","none","prose",{"screen":[{"$t":"breakpoint"}]},{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"h":[{"h":["screen","lh",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-h":[{"min-h":["screen","lh","none",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-h":[{"max-h":["screen","lh","none",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"font-size":[{"text":["base",{"$t":"text"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{"font":[{"$t":"font-weight"},{"$v":"isArbitraryVariableWeight"},{"$v":"isArbitraryWeight"}]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",{"$v":"isPercent"},{"$v":"isArbitraryValue"}]}],"font-family":[{"font":[{"$v":"isArbitraryVariableFamilyName"},{"$v":"isArbitraryFamilyName"},{"$t":"font"}]}],"font-features":[{"font-features":[{"$v":"isArbitraryValue"}]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],"tracking":[{"tracking":[{"$t":"tracking"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"line-clamp":[{"line-clamp":[{"$v":"isNumber"},"none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryNumber"}]}],"leading":[{"leading":["none",{"$t":"leading"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"list-image":[{"list-image":["none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"list-style-position":[{"list":["inside","outside"]}],"list-style-type":[{"list":["disc","decimal","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-alignment":[{"text":["left","center","right","justify","start","end"]}],"placeholder-color":[{"placeholder":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-color":[{"text":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{"decoration":["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{"decoration":[{"$v":"isNumber"},"from-font","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryLength"}]}],"text-decoration-color":[{"decoration":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"underline-offset":[{"underline-offset":[{"$v":"isNumber"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{"text":["wrap","nowrap","balance","pretty"]}],"indent":[{"indent":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"tab-size":[{"tab":[{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"vertical-align":[{"align":["baseline","top","middle","bottom","text-top","text-bottom","sub","super",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"whitespace":[{"whitespace":["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],"break":[{"break":["normal","words","all","keep"]}],"wrap":[{"wrap":["break-word","anywhere","normal"]}],"hyphens":[{"hyphens":["none","manual","auto"]}],"content":[{"content":["none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"bg-attachment":[{"bg":["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{"bg":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"},{"position":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"bg-repeat":[{"bg":["no-repeat",{"repeat":["","x","y","space","round"]}]}],"bg-size":[{"bg":["auto","cover","contain",{"$v":"isArbitraryVariableSize"},{"$v":"isArbitrarySize"},{"size":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"bg-image":[{"bg":["none",{"linear":[{"to":["t","tr","r","br","b","bl","l","tl"]},{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}],"radial":["",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}],"conic":["",{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"$v":"isArbitraryVariableImage"},{"$v":"isArbitraryImage"}]},{"bg-gradient-to":["t","tr","r","br","b","bl","l","tl"]}],"bg-color":[{"bg":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"gradient-from-pos":[{"from":[{"$v":"isPercent"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"gradient-via-pos":[{"via":[{"$v":"isPercent"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"gradient-to-pos":[{"to":[{"$v":"isPercent"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"gradient-from":[{"from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"gradient-via":[{"via":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"gradient-to":[{"to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded":[{"rounded":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-s":[{"rounded-s":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-e":[{"rounded-e":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-t":[{"rounded-t":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-r":[{"rounded-r":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-b":[{"rounded-b":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-l":[{"rounded-l":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-ss":[{"rounded-ss":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-se":[{"rounded-se":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-ee":[{"rounded-ee":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-es":[{"rounded-es":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-tl":[{"rounded-tl":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-tr":[{"rounded-tr":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-br":[{"rounded-br":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-bl":[{"rounded-bl":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-w":[{"border":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-x":[{"border-x":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-y":[{"border-y":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-s":[{"border-s":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-e":[{"border-e":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-bs":[{"border-bs":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-be":[{"border-be":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-t":[{"border-t":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-r":[{"border-r":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-b":[{"border-b":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-l":[{"border-l":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"divide-x":[{"divide-x":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{"border":["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{"divide":["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{"border":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-x":[{"border-x":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-y":[{"border-y":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-s":[{"border-s":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-e":[{"border-e":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-bs":[{"border-bs":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-be":[{"border-be":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-t":[{"border-t":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-r":[{"border-r":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-b":[{"border-b":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-l":[{"border-l":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"divide-color":[{"divide":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"outline-style":[{"outline":["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"outline-w":[{"outline":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"outline-color":[{"outline":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"shadow":[{"shadow":["","inner","none",{"$t":"shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"shadow-color":[{"shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"inset-shadow":[{"inset-shadow":["none",{"$t":"inset-shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"inset-shadow-color":[{"inset-shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"ring-w":[{"ring":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"ring-w-inset":["ring-inset"],"ring-color":[{"ring":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"ring-offset-w":[{"ring-offset":[{"$v":"isNumber"},{"$v":"isArbitraryLength"}]}],"ring-offset-color":[{"ring-offset":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"inset-ring-w":[{"inset-ring":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"inset-ring-color":[{"inset-ring":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-shadow":[{"text-shadow":["none",{"$t":"text-shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"text-shadow-color":[{"text-shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"opacity":[{"opacity":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{"mask":["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[{"$v":"isNumber"}]}],"mask-image-linear-from-pos":[{"mask-linear-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-linear-to-pos":[{"mask-linear-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-linear-from-color":[{"mask-linear-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-linear-to-color":[{"mask-linear-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-t-from-pos":[{"mask-t-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-t-to-pos":[{"mask-t-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-t-from-color":[{"mask-t-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-t-to-color":[{"mask-t-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-r-from-pos":[{"mask-r-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-r-to-pos":[{"mask-r-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-r-from-color":[{"mask-r-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-r-to-color":[{"mask-r-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-b-from-pos":[{"mask-b-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-b-to-pos":[{"mask-b-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-b-from-color":[{"mask-b-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-b-to-color":[{"mask-b-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-l-from-pos":[{"mask-l-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-l-to-pos":[{"mask-l-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-l-from-color":[{"mask-l-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-l-to-color":[{"mask-l-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-x-from-pos":[{"mask-x-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-x-to-pos":[{"mask-x-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-x-from-color":[{"mask-x-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-x-to-color":[{"mask-x-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-y-from-pos":[{"mask-y-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-y-to-pos":[{"mask-y-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-y-from-color":[{"mask-y-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-y-to-color":[{"mask-y-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial":[{"mask-radial":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial-from-pos":[{"mask-radial-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-radial-to-pos":[{"mask-radial-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-radial-from-color":[{"mask-radial-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial-to-color":[{"mask-radial-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{"closest":["side","corner"],"farthest":["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[{"$v":"isNumber"}]}],"mask-image-conic-from-pos":[{"mask-conic-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-conic-to-pos":[{"mask-conic-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-conic-from-color":[{"mask-conic-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-conic-to-color":[{"mask-conic-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-mode":[{"mask":["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{"mask":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"},{"position":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"mask-repeat":[{"mask":["no-repeat",{"repeat":["","x","y","space","round"]}]}],"mask-size":[{"mask":["auto","cover","contain",{"$v":"isArbitraryVariableSize"},{"$v":"isArbitrarySize"},{"size":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{"mask":["none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"filter":[{"filter":["","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"blur":[{"blur":["","none",{"$t":"blur"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"brightness":[{"brightness":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"contrast":[{"contrast":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"drop-shadow":[{"drop-shadow":["","none",{"$t":"drop-shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"drop-shadow-color":[{"drop-shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grayscale":[{"grayscale":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"hue-rotate":[{"hue-rotate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"invert":[{"invert":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"saturate":[{"saturate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"sepia":[{"sepia":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-filter":[{"backdrop-filter":["","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-blur":[{"backdrop-blur":["","none",{"$t":"blur"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-brightness":[{"backdrop-brightness":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-contrast":[{"backdrop-contrast":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-grayscale":[{"backdrop-grayscale":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-invert":[{"backdrop-invert":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-opacity":[{"backdrop-opacity":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-saturate":[{"backdrop-saturate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-sepia":[{"backdrop-sepia":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-collapse":[{"border":["collapse","separate"]}],"border-spacing":[{"border-spacing":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"border-spacing-x":[{"border-spacing-x":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"border-spacing-y":[{"border-spacing-y":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"table-layout":[{"table":["auto","fixed"]}],"caption":[{"caption":["top","bottom"]}],"transition":[{"transition":["","all","colors","opacity","shadow","transform","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"transition-behavior":[{"transition":["normal","discrete"]}],"duration":[{"duration":[{"$v":"isNumber"},"initial",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"ease":[{"ease":["linear","initial",{"$t":"ease"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"delay":[{"delay":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"animate":[{"animate":["none",{"$t":"animate"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backface":[{"backface":["hidden","visible"]}],"perspective":[{"perspective":[{"$t":"perspective"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"perspective-origin":[{"perspective-origin":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate":[{"rotate":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate-x":[{"rotate-x":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate-y":[{"rotate-y":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate-z":[{"rotate-z":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale":[{"scale":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-x":[{"scale-x":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-y":[{"scale-y":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-z":[{"scale-z":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-3d":["scale-3d"],"skew":[{"skew":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"skew-x":[{"skew-x":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"skew-y":[{"skew-y":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"transform":[{"transform":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},"","none","gpu","cpu"]}],"transform-origin":[{"origin":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"transform-style":[{"transform":["3d","flat"]}],"translate":[{"translate":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-x":[{"translate-x":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-y":[{"translate-y":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-z":[{"translate-z":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-none":["translate-none"],"zoom":[{"zoom":[{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"accent":[{"accent":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"appearance":[{"appearance":["none","auto"]}],"caret-color":[{"caret":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"color-scheme":[{"scheme":["normal","dark","light","light-dark","only-dark","only-light"]}],"cursor":[{"cursor":["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],"resize":[{"resize":["none","","y","x"]}],"scroll-behavior":[{"scroll":["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scrollbar-track-color":[{"scrollbar-track":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{"scrollbar":["auto","thin","none"]}],"scroll-m":[{"scroll-m":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mx":[{"scroll-mx":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-my":[{"scroll-my":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-ms":[{"scroll-ms":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-me":[{"scroll-me":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mbs":[{"scroll-mbs":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mbe":[{"scroll-mbe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mt":[{"scroll-mt":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mr":[{"scroll-mr":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mb":[{"scroll-mb":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-ml":[{"scroll-ml":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-p":[{"scroll-p":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-px":[{"scroll-px":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-py":[{"scroll-py":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-ps":[{"scroll-ps":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pe":[{"scroll-pe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pbs":[{"scroll-pbs":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pbe":[{"scroll-pbe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pt":[{"scroll-pt":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pr":[{"scroll-pr":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pb":[{"scroll-pb":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pl":[{"scroll-pl":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"snap-align":[{"snap":["start","end","center","align-none"]}],"snap-stop":[{"snap":["normal","always"]}],"snap-type":[{"snap":["none","x","y","both"]}],"snap-strictness":[{"snap":["mandatory","proximity"]}],"touch":[{"touch":["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],"select":[{"select":["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"fill":[{"fill":["none",{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"stroke-w":[{"stroke":[{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"},{"$v":"isArbitraryNumber"}]}],"stroke":[{"stroke":["none",{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}],"contain":[{"contain":["none","content","strict",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"contain-size":[{"contain":["size","inline-size"]}],"contain-layout":["contain-layout"],"contain-paint":["contain-paint"],"contain-style":["contain-style"]},"conflictingClassGroups":{"container-named":["container-type"],"overflow":["overflow-x","overflow-y"],"overscroll":["overscroll-x","overscroll-y"],"inset":["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],"flex":["basis","grow","shrink"],"gap":["gap-x","gap-y"],"p":["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],"px":["ps","pe","pr","pl"],"py":["pbs","pbe","pt","pb"],"m":["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],"mx":["ms","me","mr","ml"],"my":["mbs","mbe","mt","mb"],"size":["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],"rounded":["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],"translate":["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],"touch":["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"],"contain":["contain-size","contain-layout","contain-paint","contain-style"],"contain-size":["contain"],"contain-layout":["contain"],"contain-paint":["contain"],"contain-style":["contain"]},"conflictingClassGroupModifiers":{"font-size":["leading"]},"orderSensitiveModifiers":["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"],"postfixLookupClassGroups":["container-type"]}`,Xg=()=>JSON.parse(Yg),Zg=e=>`classGroups`in e&&`theme`in e&&`conflictingClassGroups`in e,Qg=e=>e===void 0?{config:Xg()}:typeof e==`function`?{config:e(Xg())}:Zg(e)?{config:e}:{config:Og(Xg(),e),cacheSize:e.cacheSize},$g=e=>{let{config:t,cacheSize:n}=Qg(e),{tables:r,validatorImpls:i,prefix:a}=eee(t);return nee(r,i,{cacheSize:n,prefix:a})},Q=(e=>{let t=null,n=()=>t??=$g(e);return Jg(e=>n().mergeString(e),{seenBefore:e=>n().seenBefore(e),mergeUncached:e=>n().mergeUncached(e)})})({extend:{classGroups:{"font-size":[{text:[`title`,`panel`,`body`,`label`,`caption`]}]}}}),e_=kh(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function t_({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,Z.jsx)(wh,{"data-slot":`button`,className:Q(e_({variant:t,size:n,className:e})),...r})}var n_=Ch();function r_({...e}){return(0,Z.jsx)(Nl,{...e})}function i_({...e}){return(0,Z.jsx)(tf,{"data-slot":`toast-portal`,...e})}function a_({className:e,...t}){return(0,Z.jsx)(vu,{"data-slot":`toast-viewport`,className:Q(`pointer-events-none fixed right-4 bottom-[var(--toast-lift,1rem)] z-50 w-[340px] max-w-[calc(100vw-2rem)] outline-none`,e),...t})}function o_({className:e,...t}){return(0,Z.jsx)($u,{"data-slot":`toast`,className:Q(`group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-[10px] border border-border bg-card text-card-foreground shadow-[0_12px_40px_rgba(0,0,0,.3)] will-change-transform outline-none select-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,`[--gap:0.25rem] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))]`,`h-(--toast-height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms] motion-reduce:transition-none`,`after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']`,`data-limited:opacity-0 data-ending-style:opacity-0 data-starting-style:[transform:translateY(150%)]`,`[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]`,`data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]`,`data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]`,`data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]`,`data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]`,`data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]`,`data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]`,e),...t})}function s_({className:e,...t}){return(0,Z.jsx)(ed,{"data-slot":`toast-content`,className:Q(`flex h-full items-start gap-2.5 overflow-hidden px-3.5 py-3 text-xs`,e),...t})}function c_({className:e,...t}){return(0,Z.jsx)(ud,{"data-slot":`toast-title`,className:Q(`mb-0.5 text-xs font-semibold`,e),...t})}function l_({className:e,...t}){return(0,Z.jsx)(ld,{"data-slot":`toast-description`,className:Q(`text-xs leading-[1.45] text-muted-foreground`,e),...t})}function u_({className:e,render:t=(0,Z.jsx)(t_,{variant:`outline`,size:`sm`}),...n}){return(0,Z.jsx)(yd,{"data-slot":`toast-action`,render:t,className:Q(`shrink-0`,e),...n})}function d_({className:e,children:t,render:n=(0,Z.jsx)(t_,{variant:`ghost`,size:`icon-xs`}),...r}){return(0,Z.jsx)(vd,{"data-slot":`toast-close`,"aria-label":`Close`,render:n,className:Q(`absolute top-1.5 right-1.5 text-muted-foreground opacity-0 group-hover/toast:opacity-100 hover:text-foreground focus-visible:opacity-100`,e),...r,children:t??(0,Z.jsx)(ia,{"aria-hidden":`true`})})}function f_({type:e}){let t=null;return e===`success`&&(t=(0,Z.jsx)(Gt,{className:`text-success`,"aria-hidden":`true`})),e===`info`&&(t=(0,Z.jsx)(Wn,{"aria-hidden":`true`})),e===`warning`&&(t=(0,Z.jsx)(Ut,{className:`text-note`,"aria-hidden":`true`})),e===`error`&&(t=(0,Z.jsx)(Ar,{className:`text-destructive`,"aria-hidden":`true`})),t?(0,Z.jsx)(`span`,{"data-slot":`toast-icon`,className:`mt-px shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,children:t}):null}function p_({bodies:e}){let{toasts:t}=Sh();return t.map(t=>{let n=t.type?e?.[t.type]:void 0;return n?(0,Z.jsx)(n,{toast:t},t.id):(0,Z.jsx)(m_,{toastItem:t},t.id)})}function m_({toastItem:e}){return(0,Z.jsx)(o_,{toast:e,children:(0,Z.jsxs)(s_,{children:[(0,Z.jsx)(f_,{type:e.type}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col pr-4`,children:[(0,Z.jsx)(c_,{}),(0,Z.jsx)(l_,{}),(0,Z.jsx)(u_,{className:`mt-2 self-start`})]}),(0,Z.jsx)(d_,{})]})})}function h_({children:e,toastManager:t=n_,bodies:n,...r}){return(0,Z.jsxs)(r_,{toastManager:t,...r,children:[e,(0,Z.jsx)(i_,{children:(0,Z.jsx)(a_,{children:(0,Z.jsx)(p_,{bodies:n})})})]})}function g_(){return N()(()=>({board:null,reloads:{},connected:!1,canWrite:!1,dispatch:!1,accessKnown:!1,focus:null,findings:{},notes:{},listeners:[],history:{undo:0,redo:0},claims:{},thumbnails:{light:{},dark:{}},aliases:{}}))}function __(e,t){let n=t.split(`/`);for(let t=n.length;t>0;t--){let r=e[n.slice(0,t).join(`/`)];if(r!==void 0)return[r,...n.slice(t)].join(`/`)}return t}function v_(e,t,n){let r=e.getState(),{board:i}=r;if(!i||!y_(e,t,n))return;let a=e=>x_(e,t,n),o=t.split(`/`).length===3?r.aliases:{...a(r.aliases),[n]:__(r.aliases,t)},s=E_(i,t,n);e.setState({board:s,reloads:a(r.reloads),findings:a(r.findings),notes:a(r.notes),claims:a(r.claims),thumbnails:{light:a(r.thumbnails.light),dark:a(r.thumbnails.dark)},aliases:C_(o,s)})}function y_(e,t,n){let{board:r}=e.getState();return!!r&&T_(r,t)&&!T_(r,n)}function b_(e,t,n){return S_(e,t)?`${n}${e.slice(t.length)}`:e}function x_(e,t,n){return Object.fromEntries(Object.entries(e).filter(([e])=>!S_(e,n)).map(([e,r])=>[b_(e,t,n),r]))}function S_(e,t){return e===t||e.startsWith(`${t}/`)}function C_(e,t){let n=Object.entries(e).filter(([e,n])=>e!==n&&!T_(t,n));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function w_(e,t,n){if(t.aliases===e.aliases||!e.board||!t.board||!T_(e.board,n)||T_(t.board,n))return null;let r=__(e.aliases,n);return t.board.projects.flatMap(e=>e.pages).find(e=>__(t.aliases,e.ref)===r)?.ref??null}function T_(e,t){return e.projects.some(e=>e.name===t||e.pages.some(e=>e.ref===t||e.frames.some(e=>e.ref===t)))}function E_(e,t,n){let[r=``,i,a]=t.split(`/`),o=n.split(`/`).at(-1)??n,s=(e,t)=>n=>n===e||n.startsWith(`${e}/`)?`${t}${n.slice(e.length)}`:n;return{...e,projects:e.projects.map(e=>{if(e.name!==r)return e;if(a!==void 0)return{...e,pages:e.pages.map(e=>e.name===i?{...e,frames:e.frames.map(e=>e.ref===t?{...e,ref:n,name:o,path:D_(e.path,`${o}.html`)}:e)}:e)};if(i===void 0){let t=s(e.path,D_(e.path,o));return{...e,name:o,path:t(e.path),pages:e.pages.map(e=>({...e,ref:`${o}/${e.name}`,project:o,path:t(e.path),frames:e.frames.map(n=>({...n,ref:`${o}/${e.name}/${n.name}`,project:o,path:t(n.path)}))}))}}return{...e,pages:e.pages.map(e=>{if(e.name!==i)return e;let t=s(e.path,D_(e.path,o));return{...e,ref:n,name:o,path:t(e.path),frames:e.frames.map(e=>({...e,ref:`${n}/${e.name}`,page:o,path:t(e.path)}))}})}})}}function D_(e,t){return`${e.slice(0,e.lastIndexOf(`/`)+1)}${t}`}function O_(e,t){let n=t.projects.flatMap(e=>e.pages),r=new Set(n.flatMap(e=>e.frames.map(e=>e.ref))),i=new Set(n.map(e=>e.ref)),a=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>t.has(e))),{reloads:o,findings:s,notes:c,claims:l,aliases:u}=e.getState();e.setState({board:t,reloads:a(o,r),findings:a(s,r),notes:a(c,i),claims:a(l,r),aliases:C_(u,t)})}function k_(e,t,n){e.setState({notes:{...e.getState().notes,[t]:n}})}function A_(e,t){e.setState({listeners:t})}function j_(e,t){e.setState({history:t})}function M_(e,t){e.setState({claims:Object.fromEntries(t.map(e=>[e.frame,e]))})}function N_(e,t,n){let{thumbnails:r}=e.getState(),i={...r[t]};for(let[e,t]of Object.entries(n))t===null?delete i[e]:i[e]=t;e.setState({thumbnails:{...r,[t]:i}})}function P_(e){e.setState({connected:!1,canWrite:!1,dispatch:!1,accessKnown:!1,notes:{},listeners:[],history:{undo:0,redo:0},claims:{},thumbnails:{light:{},dark:{}}})}function F_(e,t){e.setState({findings:{...e.getState().findings,...t}})}function I_(e,t,n=!1){e.setState({canWrite:t,dispatch:n,accessKnown:!0})}function L_(e,t){let n={...e.getState().reloads};for(let e of t)n[e]=(n[e]??0)+1;e.setState({reloads:n})}var R_=g_();function z_(e){return F(R_,e)}var B_=`link`,V_=`expired`;function H_(e=R_,t=U_){if(new URLSearchParams(location.search).get(B_)!==V_)return()=>{};let n=()=>{let{accessKnown:n,canWrite:r}=e.getState();if(!n)return!1;let i=new URL(location.href);return i.searchParams.delete(B_),history.replaceState(history.state,``,i),r||t(),!0};if(n())return()=>{};let r=e.subscribe(()=>{n()&&r()});return r}function U_(){n_.add({title:`This edit link has expired`,description:`A link works once, for two minutes. Run frameboard open for a new one.`,type:`warning`,timeout:0})}var aee=1024;function oee(e){return N()(()=>({mode:`edit`,tool:`move`,hideUi:e<aee,spacePan:!1}))}function see(e,t=W_){let n=e=>{e.code!==`Space`||cee(e.target)||(e.preventDefault(),t.getState().spacePan||t.setState({spacePan:!0}))},r=()=>{t.getState().spacePan&&t.setState({spacePan:!1})},i=e=>{e.code===`Space`&&r()};return e.addEventListener(`keydown`,n),e.addEventListener(`keyup`,i),e.addEventListener(`blur`,r),()=>{e.removeEventListener(`keydown`,n),e.removeEventListener(`keyup`,i),e.removeEventListener(`blur`,r),r()}}function cee(e){return e instanceof Element&&e.closest(`input, textarea, select, button, a[href], [contenteditable=""], [contenteditable="true"], [role="menu"], [role="menuitem"], [role="dialog"], [role="option"], [role="switch"], [role="tab"], [role="checkbox"], [role="radio"], [role="button"]`)!=null}var W_=oee(window.innerWidth);function G_(e){return F(W_,e)}function K_(){return z_(e=>e.connected&&e.accessKnown&&!e.canWrite)}function lee(){let e=K_(),[t]=Ua(`/p/*`),n=G_(e=>e.mode===`play`);return!e||t&&n?null:(0,Z.jsx)(`p`,{role:`status`,"data-view-only-notice":!0,className:`absolute top-3 left-1/2 -translate-x-1/2 rounded-xl border border-border bg-card px-3 py-1 text-body text-muted-foreground`,children:`View only. Run frameboard open to edit`})}function uee(e){let[t=``,n=``,r=``]=e.split(`/`);return`/frames/${encodeURIComponent(t)}/${encodeURIComponent(n)}/${encodeURIComponent(r)}.html`}function q_(e,t){return`/p/${encodeURIComponent(e)}/${encodeURIComponent(t)}`}var J_=null,Y_=null,X_=1,Z_=new Set,Q_=new Set,$_=new Set,ev={zoom:()=>X_,attached:()=>J_!==null,page:()=>Y_,onZoom:e=>iv(Z_,e),onAttach:e=>iv(Q_,e),onHandMove:e=>iv($_,e),zoomBy:e=>J_?.zoomBy(e),zoomTo:e=>J_?.zoomTo(e),fit:()=>J_?.fit(),fitTo:e=>J_?.fitTo(e),panBy:(e,t)=>J_?.panBy(e,t),centerOn:(e,t)=>J_?.centerOn(e,t),reveal:e=>{J_&&!dee(J_.visible(),e)&&(nv(),J_.centerOn(e))}};function dee(e,t){return t.x>=e.x&&t.y>=e.y&&t.x+t.width<=e.x+e.width&&t.y+t.height<=e.y+e.height}function tv(e,t){return J_=e,Y_=t,av(Q_),()=>{J_===e&&(J_=null,Y_=null,av(Q_))}}function nv(){av($_)}function rv(e){e!==X_&&(X_=e,av(Z_))}function iv(e,t){return e.add(t),()=>{e.delete(t)}}function av(e){for(let t of e)t()}var ov=[`dropdown-menu-content`,`context-menu-content`,`popover-content`,`dialog-content`].map(e=>`[data-slot="${e}"][data-open]`).join(`,`),sv=`input:not([type=button],[type=checkbox],[type=radio],[type=submit]),textarea,select,[contenteditable=""],[contenteditable="true"]`;function fee(e=document){let t=e.defaultView??window,n=new Set,r=!1,i,a=()=>r||(e.activeElement?.matches(sv)??!1)||e.querySelector(ov)!==null,o=()=>{clearTimeout(i),i=setTimeout(()=>{if(!a())for(let e of[...n])n.delete(e),e()})},s=()=>{r=!0},c=()=>{r=!1,o()},l=[[e,`pointerdown`,s],[e,`pointerup`,c],[e,`pointercancel`,c],[t,`blur`,c],[e,`focusout`,o]];for(let[e,t,n]of l)e.addEventListener(t,n,!0);let u=new MutationObserver(o);return u.observe(e.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`data-open`]}),{busy:a,whenIdle:e=>(n.add(e),o(),()=>n.delete(e)),dispose:()=>{clearTimeout(i),u.disconnect();for(let[e,t,n]of l)e.removeEventListener(t,n,!0);n.clear()}}}var cv=`frameboard.seen`,lv=`frameboard.seen-shows`;function pee(e){let t=N()(()=>({unseen:{},seen:wv(e,cv),shows:wv(e,lv),absorbed:{},cursor:null,base:{},lastCleared:null,clears:0}));return Object.assign(t,{storage:e})}function mee(e,t){let{unseen:n,seen:r,shows:i,absorbed:a,base:o}=e.getState(),s={...n},c={...o},l={...a};for(let e of t){let t=s[e.frame];e.shown&&t&&!t.shown?l[e.frame]=Cv(e):(e.shown||delete l[e.frame],s[e.frame]||(e.before?c[e.frame]=e.before:delete c[e.frame]),(e.shown?i[e.frame]===Cv(e):r[e.frame]===e.hash)?delete s[e.frame]:s[e.frame]=e)}e.setState({unseen:s,base:c,absorbed:l})}function uv(e,t){let{unseen:n,seen:r,shows:i,absorbed:a}=e.getState(),o=n[t];if(!o)return;let{[t]:s,...c}=n,l={...r,[t]:o.hash},u={...i,...Sv([o],a)},{[t]:d,...f}=a;e.setState({unseen:c,seen:l,shows:u,absorbed:f}),Tv(e.storage,l,u)}function dv(e){let{unseen:t,seen:n,shows:r,absorbed:i,clears:a}=e.getState(),o=Object.values(t);if(o.length===0)return;let s=Object.fromEntries(o.map(e=>[e.frame,{change:e,seenBefore:n[e.frame]}])),c={...n,...Object.fromEntries(o.map(e=>[e.frame,e.hash]))},l={...r,...Sv(o,i)};e.setState({unseen:{},seen:c,shows:l,absorbed:{},lastCleared:s,clears:a+1}),Tv(e.storage,c,l)}function fv(e){let{unseen:t,seen:n,shows:r,lastCleared:i}=e.getState();if(!i)return;let a={...t},o={...n},s={...r};for(let[e,{change:r,seenBefore:c}]of Object.entries(i))e in t||n[e]!==r.hash||(a[e]=r,c===void 0?delete o[e]:o[e]=c,r.shown&&s[e]===Cv(r)&&delete s[e]);e.setState({unseen:a,seen:o,shows:s,lastCleared:null}),Tv(e.storage,o,s)}function pv(e,t){let n=new Set(t.projects.flatMap(e=>e.pages.flatMap(e=>e.frames.map(e=>e.ref)))),{unseen:r,base:i,lastCleared:a}=e.getState(),o=gv(r,n),s=gv(i,n),c=a&&gv(a,n);(o!==r||s!==i||c!==a)&&e.setState({unseen:o,base:s,lastCleared:c})}function mv(e,t,n){let{unseen:r,seen:i,shows:a,absorbed:o,base:s,cursor:c,lastCleared:l}=e.getState(),u=Object.fromEntries(Object.entries(x_(r,t,n)).map(([e,t])=>[e,{...t,frame:e}])),d=x_(i,t,n),f=x_(a,t,n);e.setState({unseen:u,seen:d,shows:f,absorbed:x_(o,t,n),base:x_(s,t,n),lastCleared:l&&Object.fromEntries(Object.entries(x_(l,t,n)).map(([e,t])=>[e,{...t,change:{...t.change,frame:e}}])),cursor:c===null?null:b_(c,t,n)}),Tv(e.storage,d,f)}function hv(e,t){let{base:n}=e.getState();if(!(t in n))return;let{[t]:r,...i}=n;e.setState({base:i})}function gv(e,t){let n=Object.fromEntries(Object.entries(e).filter(([e])=>t.has(e)));return Object.keys(n).length===Object.keys(e).length?e:n}function _v(e,t){e.setState({cursor:t})}function vv(e,t){let n=`${t}/`;return Object.keys(e).filter(e=>e.startsWith(n)).length}function yv(e){return Object.values(e).sort((e,t)=>e.at.localeCompare(t.at)||e.id.localeCompare(t.id,void 0,{numeric:!0}))}function bv(e,t){let n=yv(e);return n[(n.findIndex(e=>e.frame===t)+1)%n.length]??null}function xv(e,t){let n=yv(e),r=n.findIndex(e=>e.frame===t);return n[(r<0?n.length-1:r-1+n.length)%n.length]??null}function Sv(e,t){return Object.fromEntries(e.flatMap(e=>{let n=e.shown?Cv(e):t[e.frame];return n===void 0?[]:[[e.frame,n]]}))}function Cv(e){return`${e.id} ${e.at}`}function wv(e,t){try{let n=JSON.parse(e?.getItem(t)??`{}`);return typeof n!=`object`||!n?{}:Object.fromEntries(Object.entries(n).filter(e=>typeof e[1]==`string`))}catch{return{}}}function Tv(e,t,n){try{e?.setItem(cv,JSON.stringify(t)),e?.setItem(lv,JSON.stringify(n))}catch{}}function Ev(){try{return window.localStorage}catch{return null}}var Dv=pee(Ev());function Ov(e){return F(Dv,e)}var kv=N()(()=>({session:null})),Av=null;function jv(e,{live:t=R_,unseen:n=Dv,go:r=Ea}={}){Mv();let i=ev.page(),a=null,o,s=()=>{if(a===null)return;let[e=``,n=``]=a.split(`/`),s=Pv(a);if(ev.page()!==s){i!==s&&(i=s,o=ev.zoom(),r(q_(e,n)));return}let c=Fv(t.getState().board,a);c&&(a=null,ev.centerOn(c,o),o=void 0)},c=e=>{e!==null&&(a=e,s())},l=n.subscribe((t,n)=>{let r=yv(t.unseen).filter(t=>t.author?.session===e&&n.unseen[t.frame]?.id!==t.id);c(r.at(-1)?.frame??null)}),u=t.subscribe((t,n)=>{if(!t.listeners.some(t=>t.session===e)){Mv();return}let r=Object.values(t.claims).filter(t=>t.session===e&&n.claims[t.frame]?.session!==e);r.length>0?c(r.at(-1)?.frame??null):t.board!==n.board&&s()}),d=ev.onHandMove(Mv),f=ev.onAttach(()=>{let e=ev.page();if(e===null)return;let n=t.getState().focus;n!==null&&e===Pv(n)&&(i=e),e===i?s():Mv()}),p=ye([{id:`follow.stop`,label:`Stop following`,group:`changes`,run:Mv,command:{label:`Stop following the agent`,icon:ur}}]);Av=()=>{p(),f(),d(),u(),l()},kv.setState({session:e})}function Mv(){if(!Av)return;let e=Av;Av=null,e(),kv.setState({session:null})}function Nv(e=R_){(0,_.useEffect)(()=>{let t=()=>{let{listeners:t}=e.getState();return t.length===1?t[0]:void 0},n=ye([{id:`follow.start`,label:`Follow the agent`,group:`changes`,run:()=>{let n=t();n&&jv(n.session,{live:e})},enabled:()=>t()!==void 0&&kv.getState().session===null,command:{label:`Follow the agent`,icon:cr,hint:()=>t()?.tag??``}}]),r=e.subscribe((e,t)=>{e.listeners!==t.listeners&&G()}),i=kv.subscribe(G);return()=>{i(),r(),n()}},[e])}function Pv(e){let[t=``,n=``]=e.split(`/`);return`${t}/${n}`}function Fv(e,t){for(let n of e?.projects??[])for(let e of n.pages){let n=e.frames.find(e=>e.ref===t);if(n)return n.box}return null}var Iv=`show-offer`,Lv={live:R_,busy:Gv,toasts:n_,go:Ea,following:()=>kv.getState().session!==null,project:()=>/^\/p\/([^/]+)/.exec(location.pathname)?.[1]??null},Rv=null,zv=null;function hee(e,t=Lv){qv(),Hv(e,t)}function Bv(e,{go:t,live:n}=Lv){let[r=``,i=``]=e.split(`/`);t(q_(r,i)),n.setState({focus:e})}function Vv(e,t=Lv){Bv(e,t),zv?.()}function gee(e){let[t=``,n=``,r=``]=e.split(`/`);return{ref:e,title:`An agent showed ${r}`,detail:`${n} in ${t}`}}function Hv(e,t){let[n=``]=e.split(`/`),r=t.following();if(n!==t.project()&&!r)return Uv(e,t);if(!t.busy().busy())return Bv(e,t);if(!r)return Uv(e,t);Rv=t.busy().whenIdle(()=>{Rv=null,Hv(e,t)})}function Uv(e,t){let[n=``,r=``]=e.split(`/`),i=t.toasts.add({type:Iv,timeout:0,data:gee(e),onClose:()=>{o(),zv===a&&(zv=null)}}),a=()=>t.toasts.close(i),o=ev.onAttach(()=>{ev.page()===`${n}/${r}`&&a()});zv=a}var Wv=null;function Gv(){return Wv??=fee()}function Kv(){Rv?.(),Rv=null}function qv(){Kv(),zv?.()}var Jv=N()(()=>({glowing:{},replays:{}})),Yv=new Set;function Xv(e){Jv.setState(t=>({replays:{...t.replays,[e]:!0}}))}function Zv(e=Dv){let{unseen:t,cursor:n}=e.getState();return(n===null?void 0:t[n])??yv(t)[0]??null}function Qv(e,t=Ea){let[n=``,r=``]=e.split(`/`),i=q_(n,r);decodeURIComponent(location.pathname)!==decodeURIComponent(i)&&t(i),R_.setState({focus:e}),Xv(e)}function $v(e=Dv,t=Ea){(0,_.useEffect)(()=>{let n=()=>Object.keys(e.getState().unseen).length>0,r=n=>()=>{let r=n(e.getState().unseen,Zv(e)?.frame??null);r&&(_v(e,r.frame),Qv(r.frame,t))},i=ye([{id:`changes.markAllSeen`,label:`Mark all seen`,group:`changes`,keys:[`Shift+BracketRight`],run:()=>dv(e),enabled:n,command:{label:`Mark all agent changes seen`,icon:Nt}},{id:`changes.show`,label:`Show change`,group:`changes`,keys:[`Backslash`],run:()=>{let n=Zv(e);n&&(_v(e,n.frame),Qv(n.frame,t))},enabled:n,command:{label:`Show the agent change`,icon:ii}},{id:`changes.next`,label:`Next change`,group:`changes`,keys:[`BracketRight`],run:r(bv),enabled:n,command:{label:`Next agent change`,icon:_t}},{id:`changes.previous`,label:`Previous change`,group:`changes`,keys:[`BracketLeft`],run:r(xv),enabled:n,command:{label:`Previous agent change`,icon:ht}},{id:`changes.undoMarkAll`,label:`Undo mark all seen`,group:`changes`,run:()=>fv(e),enabled:()=>e.getState().lastCleared!==null,command:{label:`Undo marking agent changes seen`,icon:ea}}]),a=e.subscribe(G);return()=>{a(),i()}},[e,t])}function ey(e,t,n){let r=yv(e),i=r.length,a=r.length>0&&r.every(e=>e.shown);if(i<=1){let e=t.author?.agent??null,[r=``,i=``,a=t.frame]=t.frame.split(`/`);if(t.shown)return{initial:ry(e),title:e?`${ny(e)} showed ${a}`:`${a} shown`,detail:`${i} in ${r}`,show:!0,next:!1,markAll:!1,undo:!1,width:340};let o=t.whole?1:Math.max(t.elements.length,1),s=`${o} ${o===1?`change`:`changes`}`;return{initial:ry(e),title:e?`${ny(e)} updated ${a}`:`${a} changed`,detail:n?`${s}, glowing on the frame`:s,show:!n,next:!1,markAll:!1,undo:!1,width:n?300:340}}let o=new Set(r.map(e=>e.author?.agent??null)),[s]=o,c=o.size===1&&s?s:null,l=new Set(r.map(e=>e.frame.split(`/`).slice(0,2).join(`/`))).size,u=r.findIndex(e=>e.id===t.id)+1;return{initial:ry(c),title:a?c?`${ny(c)} showed ${i} frames`:`${i} frames shown`:c?`${ny(c)} changed ${i} frames`:`${i} frames changed`,detail:`on ${l} ${l===1?`page`:`pages`} · ${u} of ${i}`,show:!0,next:!0,markAll:!0,undo:!1,width:600}}function ty(e){return{initial:null,title:`${e} ${e===1?`change`:`changes`} marked seen`,detail:`Every page is clear`,show:!1,next:!1,markAll:!1,undo:!0,width:300}}function ny(e){return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function ry(e){return e?e.charAt(0).toUpperCase():null}var iy=5e3,ay=`change`;function oy({store:e=Dv,toasts:t=n_}){return(0,Z.jsx)(sy,{store:e,toasts:t})}function sy({store:e,toasts:t}){return(0,_.useEffect)(()=>{let n=null,r,i=!1,a=null,o=()=>{a!==null&&t.close(a),a=null},s=(e,r=0)=>{if(n===null){let i=t.add({type:ay,timeout:r,data:e,onClose:()=>{n===i&&(n=null),a===i&&(a=null)}});n=i}else t.update(n,{data:e,timeout:r})},c=()=>{let o=Zv(e);if(o)n!==null&&i&&(a=n,n=null),i=!1,clearTimeout(r),r=void 0,s(ey(e.getState().unseen,o,o.frame in Jv.getState().glowing));else if(n!==null&&!i&&r===void 0){let e=n;r=setTimeout(()=>{r=void 0,n===e&&t.close(e)},iy)}},l=e=>{o(),clearTimeout(r),r=void 0,s(ty(e),iy),i=!0},u=(e,t)=>{e.clears!==t.clears&&e.lastCleared?l(Object.keys(e.lastCleared).length):(t.lastCleared&&!e.lastCleared&&(a===null?i=!1:o()),c())};c();let d=e.subscribe(u),f=Jv.subscribe(c);return()=>{d(),f(),clearTimeout(r),o(),n!==null&&t.close(n)}},[e,t]),null}function cy({toast:e}){let[t,n,r,i,a]=xe([`changes.show`,`changes.previous`,`changes.next`,`changes.markAllSeen`,`changes.undoMarkAll`]),o=(0,_.useRef)(null),s=(0,_.useRef)(!1),c=e.data,l=c?.undo??!1;if((0,_.useEffect)(()=>{if(!s.current)return;s.current=!1;let e=o.current;(e?.querySelector(`button`)??e?.closest(`[data-slot="toast"]`))?.focus()},[l]),!c)return null;let u=e=>t=>{s.current=t.currentTarget===document.activeElement,e?.run()};return(0,Z.jsx)(o_,{toast:e,"data-change-toast":!0,style:{width:c.width},onKeyDown:e=>{e.key===`Enter`&&e.target===e.currentTarget&&c.show&&(e.preventDefault(),t?.run())},children:(0,Z.jsxs)(s_,{ref:o,className:`items-center`,children:[c.initial?(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`font-bold text-claim`,children:c.initial}):null,(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,Z.jsx)(c_,{children:c.title}),(0,Z.jsx)(l_,{children:c.detail})]}),c.show?(0,Z.jsx)(ly,{action:t,label:`Show`,keys:uy,className:`bg-[color-mix(in_srgb,var(--claim)_22%,transparent)] text-claim`}):null,c.next?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ly,{action:n,label:`Previous`,keys:dy}),(0,Z.jsx)(ly,{action:r,label:`Next`,keys:fy})]}):null,c.markAll?(0,Z.jsx)(ly,{action:i,label:`Mark all seen`,keys:py,onClick:u(i)}):null,c.undo?(0,Z.jsx)(`button`,{type:`button`,onClick:u(a),className:Q(my,`bg-secondary text-foreground`),children:`Undo`}):null]})})}function ly({action:e,label:t,keys:n,className:r=`bg-secondary text-foreground`,onClick:i}){let a=pe(e?.keys??n,fe());return(0,Z.jsx)(`button`,{type:`button`,"aria-keyshortcuts":a?U(a):void 0,onClick:i??(()=>e?.run()),className:Q(my,r),children:a?`${t} ${U(a)}`:t})}var uy=[`Backslash`],dy=[`BracketLeft`],fy=[`BracketRight`],py=[`Shift+BracketRight`],my=`ml-2 shrink-0 rounded-md px-2 py-[3px] font-medium whitespace-nowrap outline-none hover:brightness-95 focus-visible:ring-2 focus-visible:ring-ring/50`;function hy({toast:e}){let t=e.data;return t?(0,Z.jsxs)(o_,{toast:e,"data-show-offer":!0,style:{width:340},onKeyDown:e=>{e.key===`Enter`&&e.target===e.currentTarget&&(e.preventDefault(),Vv(t.ref))},children:[(0,Z.jsxs)(s_,{className:`items-center`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,Z.jsx)(c_,{children:t.title}),(0,Z.jsx)(l_,{children:t.detail})]}),(0,Z.jsx)(`button`,{type:`button`,onClick:()=>Vv(t.ref),className:Q(my,`bg-[color-mix(in_srgb,var(--claim)_22%,transparent)] text-claim`),children:`Go`})]}),(0,Z.jsx)(d_,{})]}):null}function gy(e){return(typeof e==`number`||typeof e==`string`)&&e!==``}function _y(e){let t=(0,_.useId)();return gy(e)?`${e}`:t}var vy=typeof window<`u`?_.useLayoutEffect:_.useEffect;function yy(e){let t=(0,_.useRef)(e);return vy(()=>{t.current=e},[e]),(0,_.useCallback)((...e)=>t.current?.(...e),[t])}function by(...e){return yy(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t}})})}function xy(e,t){let n=e?.[`data-testid`];return gy(n)?`${n}`:gy(t)?`${t}`:void 0}function Sy(e,t=`Assertion error`){if(!e)throw Error(t)}(0,_.createContext)(null);var Cy;function wy(){return Cy===void 0&&(Cy=typeof matchMedia==`function`&&!!matchMedia(`(pointer:coarse)`).matches),Cy}function Ty({expandHitTargets:e,axis:t,rect:n}){let r=e?wy()?t.resizeTargetMinimumSize.coarse:t.resizeTargetMinimumSize.fine:0;if(n.width<r){let e=r-n.width;n=new DOMRect(n.x-e/2,n.y,n.width+e,n.height)}if(n.height<r){let e=r-n.height;n=new DOMRect(n.x,n.y-e/2,n.width,n.height+e)}return n}function Ey(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}var Dy=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0){if(n.length===1){n[0].call(null,t);return}let e,r=Array.from(n);for(let n=0;n<r.length;n++){let i=r[n];try{i.call(null,t)}catch(t){e??={error:t}}}if(e)throw e.error}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}};function Oy(e){let t=e=>{e.preventDefault(),e.stopPropagation(),n()},n=()=>{e.removeEventListener(`click`,t,!0)};e.addEventListener(`click`,t,!0),setTimeout(n,0)}var ky={cursorFlags:0,state:`inactive`},Ay=new Dy;function jy(){return ky}function My(e){return Ay.addListener(`change`,e)}function Ny(e,t=[],n,r=!1){let i=ky,a={...ky};a.cursorFlags=e,a.state===`active`&&(a.didPointerMove||=r,a.previews=t,n&&(a.previewLayoutMap=n)),ky=a,Ay.emit(`change`,{prev:i,next:a})}function Py(e){let t=ky;ky=e,t.state===`active`&&e.state!==`active`&&t.didPointerMove&&(t.hitRegions.forEach(({separator:e})=>{e&&e.element.ownerDocument.activeElement===e.element&&e.element.blur()}),Oy(t.ownerDocument)),Ay.emit(`change`,{prev:t,next:e})}function Fy(e){ky.state!==`active`||!ky.previews.some(t=>t.separator===e)||Py({...ky,previews:ky.previews.map(t=>t.separator===e?{...t}:t)})}function Iy(e){if(ky.state===`inactive`)return;let t=ky.hitRegions.filter(t=>t.axis!==e),n=ky.state===`active`&&ky.previews.some(t=>t.axis===e);if(t.length!==ky.hitRegions.length||n){if(t.length===0)Py({cursorFlags:0,state:`inactive`});else if(ky.state===`active`){let n=new Map(ky.initialLayoutMap),r=new Map(ky.previewLayoutMap);n.delete(e),r.delete(e),Py({...ky,cursorFlags:0,hitRegions:t,initialLayoutMap:n,previewLayoutMap:r,previews:ky.previews.filter(t=>t.axis!==e)})}else Py({...ky,hitRegions:t})}}var Ly=e=>e,Ry=()=>{},zy=1,By=2,Vy=4,Hy=8,Uy=3,Wy=12,Gy;function Ky(){return Gy===void 0&&(Gy=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(Gy=!0)),Gy}function qy({cursorFlags:e,axes:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++}})}if(r!==0||i!==0){if(n===`active`&&e&&Ky()){let t=(e&zy)!==0,n=(e&By)!==0,r=(e&Vy)!==0,i=(e&Hy)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}return Ky()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var Jy=new WeakMap;function Yy(e){if(!e.defaultView||!e.adoptedStyleSheets)return;let{prevStyle:t,styleSheet:n}=Jy.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));let r=jy();switch(r.state!==`inactive`&&r.ownerDocument!==e&&(r={cursorFlags:0,state:`inactive`}),r.state){case`active`:case`hover`:{let e=qy({cursorFlags:r.cursorFlags,axes:r.hitRegions.map(e=>e.axis),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0)}Jy.set(e,{prevStyle:t,styleSheet:n})}function Xy(e){return e.state===`inactive`?void 0:e.ownerDocument}function Zy({next:e,prev:t}){let n=Xy(t),r=Xy(e);n&&n!==r&&Yy(n),r&&Yy(r)}function Qy({axis:e}){let{layoutStrategy:t,orientation:n,items:r}=e;return t?t.calculateAvailableSize():r.reduce((e,t)=>(e+=n===`horizontal`?t.element.offsetWidth:t.element.offsetHeight,e),0)}function $y(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_DISCONNECTED?0:n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0}function eb(e,t){return Array.from(t).sort((t,n)=>{let r=e===`horizontal`?tb(t,n):nb(t,n);return r===0?$y(t.element,n.element):r})}function tb(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function nb(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function rb(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function ib(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function ab({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=ib(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return Sy(i,`No rect found`),i}function ob({expandHitTargets:e=!0,axis:t,includeDisabled:n=!1}){if(t.layoutStrategy)return t.layoutStrategy.calculateHitRegions({expandHitTargets:e,axis:t,includeDisabled:n});let{element:r,orientation:i,items:a,separators:o}=t,s=eb(i,Array.from(r.children).filter(rb).filter(e=>!e.hasAttribute(`data-resize-preview`)).map(e=>({element:e}))).map(({element:e})=>e),c=[],l=!1,u=!1,d=-1,f,p=-1,m=0,h,g=[];{let e=-1;for(let t of s)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(m++,d===-1&&(d=e),p=e))}if(n||m>1){let r=-1;for(let m of s)if(m.hasAttribute(`data-panel`)){r++;let o=a.find(e=>e.element===m);if(o){if(h){let a=h.element.getBoundingClientRect(),s=m.getBoundingClientRect(),_;if(u){let e=i===`horizontal`?new DOMRect(a.right,a.top,0,a.height):new DOMRect(a.left,a.bottom,a.width,0),t=i===`horizontal`?new DOMRect(s.left,s.top,0,s.height):new DOMRect(s.left,s.top,s.width,0);switch(g.length){case 0:_=[e,t];break;case 1:{let n=g[0];_=[n,ab({orientation:i,rects:[a,s],targetRect:n.element.getBoundingClientRect()})===a?t:e];break}default:_=g}}else _=g.length?g:[i===`horizontal`?new DOMRect(a.right,s.top,s.left-a.right,s.height):new DOMRect(s.left,a.bottom,s.width,s.top-a.bottom)];for(let i of _){let a=Ty({expandHitTargets:e,axis:t,rect:`width`in i?i:i.element.getBoundingClientRect()});(n||!l&&!(r<=d||r>p))&&(f??=Qy({axis:t}),c.push({axis:t,axisSize:f,items:[h,o],separator:`width`in i?void 0:i,rect:a})),l=!1}}u=!1,h=o,g=[]}}else if(m.hasAttribute(`data-separator`)){m.ariaDisabled!==null&&(l=!0);let e=o.find(e=>e.element===m);e?g.push(e):(h=void 0,g=[])}else u=!0}return c}function sb(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function cb(e,t){let n=getComputedStyle(e.ownerDocument.documentElement);return t*parseFloat(n.fontSize)}function lb(e){return e/100*window.innerHeight}function ub(e){return e/100*window.innerWidth}function db({axisSize:e,itemElement:t,styleProp:n}){let r,[i,a]=Ey(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=cb(t,i);break;case`em`:r=sb(t,i);break;case`vh`:r=lb(i);break;case`vw`:r=ub(i)}return r}function fb(e){return parseFloat(e.toFixed(3))}function pb(e,t=Qy({axis:e})){let{items:n}=e;return t===0?n.map(e=>({groupResizeBehavior:e.constraintProps.groupResizeBehavior,collapsedSize:0,collapsible:e.constraintProps.collapsible===!0,defaultSize:void 0,disabled:e.constraintProps.disabled,minSize:0,maxSize:100,itemId:e.id})):n.map(e=>{let{element:n,constraintProps:r}=e,i=0;r.collapsedSize!==void 0&&(i=fb(db({axisSize:t,itemElement:n,styleProp:r.collapsedSize})/t*100));let a;r.collapsedThreshold!==void 0&&(a=fb(db({axisSize:t,itemElement:n,styleProp:r.collapsedThreshold})/t*100));let o;r.defaultSize!==void 0&&(o=fb(db({axisSize:t,itemElement:n,styleProp:r.defaultSize})/t*100));let s=0;r.minSize!==void 0&&(s=fb(db({axisSize:t,itemElement:n,styleProp:r.minSize})/t*100));let c=100;return r.maxSize!==void 0&&(c=fb(db({axisSize:t,itemElement:n,styleProp:r.maxSize})/t*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsedThreshold:a,collapsible:r.collapsible===!0,defaultSize:o,disabled:r.disabled,minSize:s,maxSize:c,itemId:e.id}})}var mb=new Map,hb=new Dy,gb=0,_b=[],vb;function yb(){gb++}function bb(){for(let e=0;e<_b.length;e++)try{hb.emit(`axisChange`,_b[e])}catch(e){vb??={error:e}}_b.length=0}function xb(){if(gb===1&&bb(),gb--,gb===0&&vb){let{error:e}=vb;throw vb=void 0,e}}function Sb(e){mb=new Map(mb),mb.delete(e)}function Cb(e,t){for(let[t]of mb)if(t.id===e)return t}function wb(e,t){for(let[t,n]of mb)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function Tb(){return mb}function Eb(e,t){return hb.addListener(`axisChange`,n=>{n.axis.id===e&&t(n)})}function Db(e,t,n){let r=mb.get(e);mb=new Map(mb),mb.set(e,t);let i={axis:e,isUserInteraction:n?.isUserInteraction===!0,prev:r,next:t};gb>0?_b.push(i):hb.emit(`axisChange`,i)}function Ob(e,{pointerId:t,pointerType:n}){return t===e.pointerId||n===`pen`&&e.pointerType===`pen`}function kb(e,t,n={}){return e.ownerDocument===t&&(n.pointerId===void 0||Ob(e,n))}function Ab(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function jb(e,t,n=0){return Math.abs(fb(e)-fb(t))<=n}function Mb(e,t){return jb(e,t)?0:e>t?1:-1}function Nb({overrideDisabledItems:e,itemConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsedThreshold:a,collapsible:o,disabled:s,maxSize:c=100,minSize:l=0}=t;if(s&&!e)return n;if(Mb(r,l)<0){if(o){let e=a??(l-i)/2,t=Mb(n,i)<=0,o=t?i+e:l-e,s=Mb(r,o);r=Mb(r,i)<=0||s<0||a!==void 0&&t&&s===0?i:l}else r=l}return r=Math.min(c,r),r=fb(r),r}function Pb({delta:e,initialLayout:t,itemConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(jb(e,0))return t;let o=a===`imperative-api`,s=n.map(({itemId:e})=>t[e]),c=n.map(({itemId:e})=>i[e]),l=[...s],[u,d]=r;Sy(u!=null,`Invalid first pivot index`),Sy(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];Sy(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Sy(n!=null,`Previous layout not found for panel index ${t}`),jb(n,i)){let t=o-n;Mb(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];Sy(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Sy(n!=null,`Previous layout not found for panel index ${t}`),jb(n,o)){let t=n-i;Mb(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];Sy(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsedSize:a,collapsedThreshold:o,collapsible:c,minSize:l}=r;if(c&&Mb(i,l)<0){let t=l-a,n=o??t/2;if(Mb(i+Math.abs(e),l)<0){let r=Mb(Math.abs(e),n);e=r>0||r===0&&o===void 0&&e<0?e<0?-t:t:0}}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];Sy(e!=null,`Previous layout not found for panel index ${r}`);let a=Nb({overrideDisabledItems:o,itemConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];Sy(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=Nb({overrideDisabledItems:o,itemConstraints:n[t],prevSize:i,size:a});if(!jb(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(Ab(c,l))return i;{let t=e<0?d:u,r=s[t];Sy(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=Nb({overrideDisabledItems:o,itemConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!jb(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];Sy(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=Nb({overrideDisabledItems:o,itemConstraints:n[r],prevSize:i,size:a});if(jb(i,s)||(t-=s-i,l[r]=s),jb(t,0))break;e>0?r--:r++}}}return jb(Object.values(l).reduce((e,t)=>t+e,0),100,.1)?l.reduce((e,t,r)=>(e[n[r].itemId]=t,e),{}):i}function Fb(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||Mb(e[n],t[n])!==0)return!1;return!0}function Ib(e){yb();try{_ee(e)}finally{xb()}}function _ee({commit:e,event:t,hitRegions:n,initialLayoutMap:r,mountedAxes:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0,c=jy(),l=c.state===`active`?c.previews:[],u=new Map(c.state===`active`?c.previewLayoutMap:void 0);n.forEach(n=>{let{axis:o,axisSize:c}=n,{orientation:d,items:f}=o;if(e&&o.resizePreviewMode!==`separator`)return;let{disableCursor:p}=o.mutableState,m=0;m=a?d===`horizontal`?(t.clientX-a.x)/c*100:(t.clientY-a.y)/c*100:d===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let h=r.get(o),g=i.get(o);if(!h||!g)return;let{defaultLayoutDeferred:_,derivedItemConstraints:v,axisSize:y,layout:b,separatorToItems:x}=g;if(v&&b&&x){let t=o.resizePreviewMode===`separator`?u.get(o)??b:b,r=Pb({delta:m,initialLayout:h,itemConstraints:v,pivotIndices:n.items.map(e=>f.indexOf(e)),prevLayout:t,trigger:`mouse-or-touch`});if(o.resizePreviewMode===`separator`&&!e&&!Fb(r,t)){u.set(o,r);let e=0,t=f.map(t=>(e+=r[t.id]-h[t.id],c/100*e));l=l.map(e=>{if(e.axis!==o)return e;let n=t[e.itemIndex];return n===e.offset?e:{...e,offset:n}})}if(Fb(r,t)&&m!==0&&!p)switch(d){case`horizontal`:s|=m<0?zy:By;break;case`vertical`:s|=m<0?Vy:Hy}(o.resizePreviewMode!==`separator`||e)&&!Fb(r,b)&&Db(n.axis,{defaultLayoutDeferred:_,derivedItemConstraints:v,axisSize:y,layout:r,requestedAxisSize:y,requestedLayout:r,separatorToItems:x})}});let d=0;t.movementX===0?d|=o&Uy:d|=s&Uy,t.movementY===0?d|=o&Wy:d|=s&Wy;let f=c.state===`active`&&(t.clientX!==c.pointerDownAtPoint.x||t.clientY!==c.pointerDownAtPoint.y);Ny(d,l,u,f)}function Lb(e,t){let n=jy();if(n.state!==`active`||!kb(n,e,t))return;let r=Tb();yb();try{Ib({commit:!0,event:t,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedAxes:r,pointerDownAtPoint:n.pointerDownAtPoint,prevCursorFlags:n.cursorFlags}),bb(),Py({cursorFlags:0,state:`inactive`}),n.hitRegions.length>0&&(t.preventDefault?.(),n.hitRegions.forEach(e=>{if(!r.has(e.axis))return;let t=wb(e.axis.id,!0);Db(e.axis,t,{isUserInteraction:!0})}))}finally{xb()}}function Rb(e){if(e.defaultPrevented)return;let{clientX:t,clientY:n,movementX:r,movementY:i}=e;Lb(e.currentTarget,{clientX:t,clientY:n,movementX:r,movementY:i})}function vee(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=ib(n,a.rect);switch(e){case`horizontal`:(t.x<i.x||t.x===i.x&&t.y<=i.y)&&(r=a,i=t);break;case`vertical`:(t.y<i.y||t.y===i.y&&t.x<=i.x)&&(r=a,i=t)}}return r?{distance:i,hitRegion:r}:void 0}function yee(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function bee(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:Vb(e),b:Vb(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();Sy(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:Bb(zb(n.a)),b:Bb(zb(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 xee=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function See(e){let t=getComputedStyle(Hb(e)??e).display;return t===`flex`||t===`inline-flex`}function Cee(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||See(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||xee.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function zb(e){let t=e.length;for(;t--;){let n=e[t];if(Sy(n,`Missing node`),Cee(n))return n}return null}function Bb(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Vb(e){let t=[];for(;e;)t.push(e),e=Hb(e);return t}function Hb(e){let{parentNode:t}=e;return yee(t)?t.host:t}function wee(e,t){return 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 Tee(e){try{return e.matches(`:modal`)}catch{return!1}}function Eee({axisElement:e,hitRegion:t,pointerEventTarget:n}){if(rb(n)){let t=n.closest(`dialog`);if(t&&!t.contains(e)&&Tee(t))return!1}if(!rb(n)||n.contains(e)||e.contains(n)||!n.isConnected||!e.isConnected)return!0;if(bee(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(wee(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function Ub(e,t,n){let r=[];return t.forEach((t,i)=>{if(i.disabled||i.element.ownerDocument!==n)return;let a=ob({axis:i}),o=vee(i.orientation,a,{x:e.clientX,y:e.clientY});o&&o.distance.x<=0&&o.distance.y<=0&&Eee({axisElement:i.element,hitRegion:o.hitRegion.rect,pointerEventTarget:e.target})&&r.push(o.hitRegion)}),r}function Dee(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=fb(i.defaultSize);n+=e,r[i.itemId]=e}else r[i.itemId]=void 0;let i=e.length-t;if(i!==0){let t=fb((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.itemId]=t)}return r}function Oee(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}function Wb({axis:e,itemConstraints:t}){let n=e.items.map(({id:e})=>e).join(`,`),r=e.mutableState.defaultLayout;return e.mutableState.layouts[n]??(r&&Oee(e.items,r)?r:Dee(t))}function Gb(e,t){if(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 kee(e,t){return e.length===t.length&&e.every((e,n)=>Gb(e,t[n]))}function Kb({layout:e,itemConstraints:t}){let n=t.map(({itemId:t})=>e[t]),r=[...n],i=r.reduce((e,t)=>e+t,0);if(Object.keys(e).length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${Object.values(e).map(e=>`${e}%`).join(`, `)}`);if(!jb(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];Sy(t!=null,`No layout data found for index ${e}`);let n=100/i*t;r[e]=n}let a=0;for(let e=0;e<t.length;e++){let i=n[e];Sy(i!=null,`No layout data found for index ${e}`);let o=r[e];Sy(o!=null,`No layout data found for index ${e}`);let s=Nb({overrideDisabledItems:!0,itemConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!jb(a,0))for(let e=0;e<t.length;e++){let n=r[e];Sy(n!=null,`No layout data found for index ${e}`);let i=n+a,o=Nb({overrideDisabledItems:!0,itemConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,jb(a,0)))break}return r.reduce((e,n,r)=>(e[t[r].itemId]=n,e),{})}function qb({itemIds:e,layout:t}){return Kb({layout:t,itemConstraints:e.map(e=>({collapsedSize:0,collapsible:!1,defaultSize:void 0,disabled:void 0,itemId:e,maxSize:100,minSize:0}))})}function Aee({axis:e,nextAxisSize:t,prevAxisSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.items){let e=r[l.id]??0;switch(l.constraintProps.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=fb(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=fb((r[e]??0)/a*l);else{let e=fb(l/c.length);for(let t of c)u[t]=e}return u}function Jb({axis:e,axisState:t}){let n=Qy({axis:e});if(n===0)return;let r=pb(e,n),i=t.requestedAxisSize,a=t.requestedLayout;t.defaultLayoutDeferred&&(i=n,a=qb({itemIds:e.items.map(({id:e})=>e),layout:Wb({axis:e,itemConstraints:r})}));let o=Kb({layout:Aee({axis:e,nextAxisSize:n,prevAxisSize:i,prevLayout:a}),itemConstraints:r});return{changed:t.defaultLayoutDeferred||!Fb(t.layout,o)||!kee(t.derivedItemConstraints,r)||t.axisSize!==n,state:{defaultLayoutDeferred:!1,derivedItemConstraints:r,axisSize:n,layout:o,requestedAxisSize:i,requestedLayout:a,separatorToItems:t.separatorToItems}}}function Yb({axisId:e,itemId:t}){let n=()=>{let t=Tb();for(let[n,r]of t)if(n.id===e)return{axis:n,...r};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedItemConstraints.find(e=>e.itemId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let{axis:e,...r}=n(),i=Jb({axis:e,axisState:r}),a=i?.state??r,o=a.derivedItemConstraints.find(e=>e.itemId===t);if(o===void 0)throw Error(`Panel constraints not found for Panel ${t}`);let s=a.layout[t];if(s===void 0)throw Error(`Layout not found for Panel ${t}`);return{axis:e,changed:i?.changed===!0,itemConstraints:o,itemSize:s,state:a}},a=()=>{let e=n().axis.items.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},s=({allowPartialSize:e=!1,nextSize:n,items:r,prevLayout:i,derivedItemConstraints:a})=>{let o=i[t],s=r.findIndex(e=>e.id===t),c=s===0,l=s===r.length-1;if(l&&n<o&&(c||r.slice(0,s).every((e,t)=>{let n=a[t];return n?.collapsible&&jb(n.collapsedSize,i[n.itemId])}))){let e=r.slice(0,s).reduce((e,t)=>e+i[t.id],0);return{...i,[t]:fb(100-e)}}let u=a[s],d=Nb({overrideDisabledItems:!0,itemConstraints:u,prevSize:o,size:n}),f={...i},p=d-o;for(let e of c?[1]:l?[-1]:[1,-1])for(let t=s+e;t>=0&&t<r.length&&!jb(p,0);t+=e){let e=a[t],n=f[e.itemId];if(Xb(e,f)||(p>0?Mb(n,e.minSize)<=0:Mb(n,e.maxSize)>=0))continue;let r=p>0?Math.max(e.minSize,n-p):Math.min(e.maxSize,n-p);p-=n-r,f[e.itemId]=fb(r)}if(f[t]=fb(d-p),jb(p,0)||e&&Mb(f[t],u.minSize)>=0)return f;let m=(e,t,n)=>{let i=e===`after`?1:-1,o=e=>{for(let n=s+i;n>=0&&n<r.length;n+=i){let r=a[n];if(!Xb(r,t)&&e(r))return n}},c=o(({itemId:e,maxSize:r,minSize:i})=>n>0?Mb(t[e],i)>0:Mb(t[e],r)<0)??o(()=>!0)??s+i;return Pb({delta:e===`after`?n:-n,initialLayout:t,itemConstraints:a,pivotIndices:e===`after`?[s,c]:[c,s],prevLayout:t,trigger:`imperative-api`})};if(c||l)return m(l?`before`:`after`,i,n-o);let h=e=>{let r=m(e,i,n-o),a=n-r[t];return jb(a,0)?r:m(e===`after`?`before`:`after`,r,a)},g=h(`after`);if(Zb({itemConstraints:a,itemId:t,nextLayout:g,prevLayout:i})){let e=h(`before`);if(!Zb({itemConstraints:a,itemId:t,nextLayout:e,prevLayout:i}))return e}return g},c=(e,{axis:t,changed:n,itemSize:r,state:i},{allowPartialSize:a=!1}={})=>{if(e===r)return;let{derivedItemConstraints:o,axisSize:c,layout:l}=i,u=Kb({layout:s({allowPartialSize:a,nextSize:e,items:t.items,prevLayout:l,derivedItemConstraints:o}),itemConstraints:o});(n||!Fb(l,u))&&Db(t,{...i,layout:u,requestedAxisSize:c,requestedLayout:u})};return{collapse:()=>{let e=i(),{collapsible:t,collapsedSize:n}=e.itemConstraints,{mutableValues:r}=a(),o=e.itemSize;t&&o!==n&&(r.expandToSize=o,c(n,e))},expand:()=>{let e=i(),{collapsible:t,collapsedSize:n,minSize:r}=e.itemConstraints,{mutableValues:o}=a(),s=e.itemSize;if(t&&s===n){let t=o.expandToSize??r;t===0&&(t=1),c(t,e,{allowPartialSize:!0})}},getSize:()=>{let{axis:e}=n(),r=o(),{element:i}=a();return{asPercentage:r,inPixels:e.layoutStrategy?e.layoutStrategy.getItemSizeInPixels(t):e.orientation===`horizontal`?i.offsetWidth:i.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=o();return e&&jb(t,n)},resize:e=>{let t=i(),{axisSize:n}=t.state,{element:r}=a(),o=fb(db({axisSize:n,itemElement:r,styleProp:e})/n*100);c(o,t)}}}function Xb({collapsedSize:e,collapsible:t,itemId:n},r){return t&&jb(r[n],e)}function Zb({itemConstraints:e,itemId:t,nextLayout:n,prevLayout:r}){return e.some(e=>e.itemId!==t&&Xb(e,r)!==Xb(e,n))}function Qb(e){e.defaultPrevented||Ub(e,Tb(),e.currentTarget).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.items.find(e=>e.constraintProps.defaultSize!==void 0);if(n){let r=n.constraintProps.defaultSize,i=Yb({axisId:t.axis.id,itemId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function $b(e){let t=Tb();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function ex({axisId:e}){let t=()=>{let t=Tb();for(let[n,r]of t)if(n.id===e)return{axis:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{axis:n,...r}=t(),i=Jb({axis:n,axisState:r}),a=i?.state??r,{defaultLayoutDeferred:o,derivedItemConstraints:s,axisSize:c,layout:l}=a,u=Kb({layout:e,itemConstraints:s});return o?l:((i?.changed||!Fb(l,u))&&Db(n,{...a,layout:u,requestedAxisSize:c,requestedLayout:u}),u)}}}function tx(e,t){let n=$b(e),r=wb(n.id,!0),i=n.separators.find(t=>t.element===e);Sy(i,`Matching separator not found`);let a=r.separatorToItems.get(i);Sy(a,`Matching panels not found`);let o=a.map(e=>n.items.indexOf(e)),s=ex({axisId:n.id}).getLayout(),c=Kb({layout:Pb({delta:t,initialLayout:s,itemConstraints:r.derivedItemConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),itemConstraints:r.derivedItemConstraints});Fb(s,c)||Db(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedItemConstraints:r.derivedItemConstraints,axisSize:r.axisSize,layout:c,requestedAxisSize:r.axisSize,requestedLayout:c,separatorToItems:r.separatorToItems},{isUserInteraction:!0})}function nx(e){return e.separators.filter(e=>!e.disabled)}function rx(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=$b(t);if(!(n.disabled||n.separators.find(e=>e.element===t)?.disabled))switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&tx(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&tx(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&tx(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&tx(t,-5);break;case`End`:e.preventDefault(),tx(t,100);break;case`Enter`:{e.preventDefault();let{derivedItemConstraints:r,layout:i,separatorToItems:a}=wb(n.id,!0),o=n.separators.find(e=>e.element===t);Sy(o,`Matching separator not found`);let s=a.get(o);Sy(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.itemId===c.id);if(Sy(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];tx(t,(l.collapsedSize===e?n.mutableState.expandedItemSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let t=nx(n).map(e=>e.element),r=t.findIndex(t=>t===e.currentTarget);Sy(r!==-1,`Index not found`),t[e.shiftKey?r>0?r-1:t.length-1:r+1<t.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),tx(t,-100)}}function ix(e,t){let n=jy();if(n.state!==`active`||!kb(n,e,t))return!1;let r=Tb();yb();try{n.previewLayoutMap.forEach((e,t)=>{let n=r.get(t);t.resizePreviewMode===`separator`&&n&&!Fb(e,n.layout)&&Db(t,{...n,layout:e,requestedAxisSize:n.axisSize,requestedLayout:e})}),bb(),Py({cursorFlags:0,state:`inactive`}),n.hitRegions.forEach(e=>{if(!r.has(e.axis))return;let t=wb(e.axis.id,!0);Db(e.axis,t,{isUserInteraction:!0})})}finally{xb()}return!0}function ax(e){let t=jy();if(t.state!==`active`)return;let n=t.hitRegions.flatMap(({separator:e})=>e?[e.element]:[]);!n.some(t=>t===e.target)||n.some(t=>t.hasPointerCapture?.(e.pointerId))||ix(e.currentTarget,e)}function ox(e){ix(e.currentTarget,e)}function sx(e,t){let{element:n,orientation:r,items:i}=e,a=n.getBoundingClientRect(),o=r===`horizontal`;return ob({expandHitTargets:!1,axis:e,includeDisabled:!0}).map(({items:r,rect:s,separator:c},l)=>{let u=i.indexOf(r[0]),d=o?s.left+s.width/2:s.top+s.height/2;return{active:t.some(t=>{if(t.axis!==e||t.items[0]!==r[0])return!1;if(c||t.separator)return t.separator===c;let n=o?t.rect.left+t.rect.width/2:t.rect.top+t.rect.height/2;return jb(d,n)}),axis:e,key:c?`separator-${c.id}`:`panel-${r[0].id}-${l}`,offset:0,itemIndex:u,rect:new DOMRect((o&&!c?d:s.left)-a.left-n.clientLeft+n.scrollLeft,(!o&&!c?d:s.top)-a.top-n.clientTop+n.scrollTop,o&&!c?0:s.width,!o&&!c?0:s.height),separator:c}})}function cx(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=jy();if(t.state===`active`){Ob(t,e)&&ix(t.ownerDocument,t);return}let n=Tb(),r=Ub(e,n,e.currentTarget);if(r.length===0)return;let i=new Map,a=!1;r.forEach(e=>{e.separator&&(a||(a=!0,e.separator.element.focus({focusVisible:!1,preventScroll:!0})));let t=n.get(e.axis);t&&i.set(e.axis,t.layout)});let o=Array.from(i.keys()).flatMap(e=>e.resizePreviewMode===`separator`?sx(e,r):[]);Py({cursorFlags:0,didPointerMove:!1,hitRegions:r,initialLayoutMap:i,ownerDocument:e.currentTarget,pointerDownAtPoint:{x:e.clientX,y:e.clientY},pointerId:e.pointerId,pointerType:e.pointerType,previewLayoutMap:new Map(i),previews:o,state:`active`}),e.preventDefault()}function lx(e){let t=e.currentTarget,n=Tb(),r=jy();if(r.state===`active`){if(!kb(r,t,e))return;Ib({commit:!1,event:e,hitRegions:r.hitRegions,initialLayoutMap:r.initialLayoutMap,mountedAxes:n,prevCursorFlags:r.cursorFlags})}}function ux(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=jy(),r=Tb();switch(n.state){case`active`:if(!kb(n,t,e))return;if(e.buttons===0){ix(t,e);return}for(let t of n.hitRegions)if(t.separator){let{element:n}=t.separator;n.isConnected&&!n.hasPointerCapture?.(e.pointerId)&&n.setPointerCapture?.(e.pointerId)}Ib({commit:!1,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedAxes:r,pointerDownAtPoint:n.pointerDownAtPoint,prevCursorFlags:n.cursorFlags});break;default:{let i=Ub(e,r,t);i.length===0?n.state!==`inactive`&&Py({cursorFlags:0,state:`inactive`}):Py({cursorFlags:0,hitRegions:i,ownerDocument:t,state:`hover`});break}}}function dx(e){if(e.relatedTarget instanceof HTMLIFrameElement){let t=jy();t.state===`hover`&&t.ownerDocument===e.currentTarget&&Py({cursorFlags:0,state:`inactive`})}}function fx(e){e.defaultPrevented||e.pointerType===`mouse`&&e.button>0||Lb(e.currentTarget,e)}function px(e){e.target===e.currentTarget&&ix(e.currentTarget.document)}function mx(e){ix(e.currentTarget.document)}function hx(e,t,n){if(!n[0])return;let r=e.items.find(e=>e.element===t);if(!r||!r.onResize)return;let i=Qy({axis:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:fb(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}var gx=new Map,_x=!1;function vx(e){let t=!0;Sy(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{let r;yb();try{for(let i of n){let{borderBoxSize:n,target:a}=i;if(a===e.element){if(t){let t=wb(e.id);if(!t)break;let n=Jb({axis:e,axisState:t});if(!n)break;if(!n.changed)continue;Db(e,n.state)}}else try{hx(e,a,n)}catch(e){r??={error:e}}}}finally{xb()}if(r)throw r.error});a.observe(e.element),e.items.forEach(e=>{Sy(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=Qy({axis:e}),s=pb(e,o),c=Wb({axis:e,itemConstraints:s}),l=Kb({layout:c,itemConstraints:s}),u=e.element.ownerDocument,d=u.defaultView;gx.set(u,(gx.get(u)??0)+1);let f=new Map;return ob({axis:e,includeDisabled:!0}).forEach(e=>{e.separator&&f.set(e.separator,e.items)}),Db(e,{defaultLayoutDeferred:o===0,derivedItemConstraints:s,axisSize:o,layout:l,requestedAxisSize:o,requestedLayout:qb({itemIds:e.items.map(({id:e})=>e),layout:c}),separatorToItems:f}),e.separators.forEach(e=>{Sy(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,rx)}),_x||(_x=!0,My(Zy)),gx.get(u)===1&&(u.addEventListener(`contextmenu`,Rb,!0),u.addEventListener(`dblclick`,Qb,!0),u.addEventListener(`lostpointercapture`,ax,!0),u.addEventListener(`pointercancel`,ox,!0),u.addEventListener(`pointerdown`,cx,!0),u.addEventListener(`pointerleave`,lx),u.addEventListener(`pointermove`,ux),u.addEventListener(`pointerout`,dx),u.addEventListener(`pointerup`,fx,!0),d?.addEventListener(`blur`,px),d?.addEventListener(`pagehide`,mx)),function(){t=!1,gx.set(u,Math.max(0,(gx.get(u)??0)-1)),Sb(e),Iy(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,rx)}),gx.get(u)||(u.removeEventListener(`contextmenu`,Rb,!0),u.removeEventListener(`dblclick`,Qb,!0),u.removeEventListener(`lostpointercapture`,ax,!0),u.removeEventListener(`pointercancel`,ox,!0),u.removeEventListener(`pointerdown`,cx,!0),u.removeEventListener(`pointerleave`,lx),u.removeEventListener(`pointermove`,ux),u.removeEventListener(`pointerout`,dx),u.removeEventListener(`pointerup`,fx,!0),d?.removeEventListener(`blur`,px),d?.removeEventListener(`pagehide`,mx)),a.disconnect()}}function yx({derivedItemConstraints:e,axis:t,layout:n,prevLayout:r,requestedLayout:i}){let a=t.items.map(({id:e})=>e).join(`,`);t.mutableState.layouts[a]=i,r&&e.forEach(e=>{if(e.collapsible){let i=jb(e.collapsedSize,n[e.itemId]),a=jb(e.collapsedSize,r[e.itemId]);i&&!a&&(t.mutableState.expandedItemSizes[e.itemId]=r[e.itemId])}})}function bx(){let[e,t]=(0,_.useState)({});return[e,(0,_.useCallback)(()=>t({}),[])]}function xx(e){let t=(0,_.useRef)({...e});return vy(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var Sx=(0,_.createContext)(null);(0,_.createContext)(null);function Cx({layout:e,itemConstraints:t,itemId:n,itemIndex:r}){let i,a,o=e[n],s=t.find(e=>e.itemId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=Kb({layout:Pb({delta:l-o,initialLayout:e,itemConstraints:t,pivotIndices:u,prevLayout:e}),itemConstraints:t})[n],i=Kb({layout:Pb({delta:c-o,initialLayout:e,itemConstraints:t,pivotIndices:u,prevLayout:e}),itemConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function wx({attributes:e,axisId:t,axisOrientation:n,children:r,className:i,"data-testid":a,disableCursor:o,disabled:s,disableDoubleClick:c,elementRef:l,id:u,isSharedHitRegion:d,preview:f,registerSeparator:p,requiredStyle:m,style:h,styleDefaults:g,tabIndex:v=0,updateSeparatorProps:y}){let b=xx({disabled:s,disableDoubleClick:c,children:r,className:i,preview:f,style:h}),[x,S]=(0,_.useState)({}),[C,w]=(0,_.useState)(`inactive`),[T,E]=(0,_.useState)(!1),D=(0,_.useRef)(null),O=(0,_.useRef)(null),k=by(D,l),A=n===`horizontal`?`vertical`:`horizontal`;vy(()=>{let e=D.current;if(e!==null){let n={disabled:b.disabled,disableDoubleClick:b.disableDoubleClick,element:e,id:u,get children(){return b.children},get className(){return b.className},get preview(){return b.preview},get style(){return b.style}};O.current=n;let r=p(n),i=My(e=>{w(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===n||(d?.(e)??!1))?e.next.state:`inactive`)}),a=Eb(t,e=>{let{derivedItemConstraints:t,layout:r,separatorToItems:i}=e.next,a=i.get(n);if(a){let n=a[0],i=t.findIndex(e=>e.itemId===n.id),{layoutStrategy:o}=e.axis;S({...Cx({layout:r,itemConstraints:t,itemId:n.id,itemIndex:i}),...o?.getItemAriaControls&&{valueControls:o.getItemAriaControls(n.id)}})}});return()=>{O.current=null,i(),a(),r()}}},[t,u,d,p,b]),vy(()=>{let e=O.current;e&&Fy(e)},[f]),(0,_.useEffect)(()=>{y(u,{disabled:s,disableDoubleClick:c})},[s,c,u,y]);let j;s&&!o&&(j=`not-allowed`);let M;if(s)M=`disabled`;else switch(C){case`active`:M=`active`;break;default:M=T?`focus`:C}return(0,Z.jsx)(`div`,{...e,"aria-controls":x.valueControls,"aria-disabled":s||void 0,"aria-orientation":A,"aria-valuemax":x.valueMax,"aria-valuemin":x.valueMin,"aria-valuenow":x.valueNow,children:r,className:i,"data-separator":M,"data-testid":a,id:u,onBlur:()=>E(!1),onFocus:()=>E(!0),ref:k,role:`separator`,style:{...g,cursor:j,...h,...m,touchAction:`none`},tabIndex:s?void 0:v})}function Tx(e){for(let t=1;t<e.length;t++)if($y(e[t-1],e[t])>0)return!1;return!0}function Ex({separator:e}){let{element:t}=e,n=(0,_.useRef)(null);return vy(()=>{let e=t.cloneNode(!0),r=[t,...t.querySelectorAll(`*`)],i=[e,...e.querySelectorAll(`*`)],a=t.ownerDocument.defaultView;return r.forEach((e,t)=>{let n=i[t];if(n instanceof a.HTMLElement||n instanceof a.SVGElement){let t=a.getComputedStyle(e);for(let e=0;e<t.length;e++){let r=t.item(e);n.style.setProperty(r,t.getPropertyValue(r))}}n.removeAttribute(`data-testid`),n.removeAttribute(`id`)}),Object.assign(e.style,{boxSizing:`border-box`,height:`100%`,margin:`0`,position:`static`,transform:`none`,width:`100%`}),n.current.appendChild(e),()=>e.remove()},[t]),(0,Z.jsx)(`div`,{ref:n,style:{height:`100%`,opacity:.65,pointerEvents:`none`,width:`100%`}})}function Dx(){let e=(0,_.useContext)(Sx);return Sy(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function Ox(e){let{registerOverlay:t}=Dx(),n=(0,_.useRef)(e);Gb(n.current,e)||(n.current=e);let r=n.current;return vy(()=>t(r),[t,r]),null}Ox.displayName=`SeparatorOverlay`;function kx({active:e,orientation:t,style:n,...r}){let i;switch(t){case`horizontal`:i={height:`100%`,minWidth:`1px`};break;case`vertical`:i={minHeight:`1px`,width:`100%`}}return(0,Z.jsx)(`div`,{...r,"data-separator-overlay":e?`active`:`inactive`,style:{...i,...n,flexShrink:0,pointerEvents:`none`}})}function Ax({overlay:e,preview:t}){let{axis:n,offset:r,rect:i,separator:a}=t,o=n.orientation===`horizontal`,s=a?.preview,c=e;return(0,_.isValidElement)(s)&&s.type===Ox&&(c=s.props,s=void 0),s??(c?s=(0,Z.jsx)(kx,{...c,active:t.active,orientation:n.orientation}):a&&(s=(0,Z.jsx)(Ex,{separator:a}))),(0,Z.jsx)(`div`,{"aria-hidden":`true`,"data-resize-preview":!0,inert:!0,style:{height:i.height,left:i.left,pointerEvents:`none`,position:`absolute`,top:i.top,transform:o?`translateX(${r}px)`:`translateY(${r}px)`,width:i.width},children:s})}function jx(e){return Array.from(e).sort($y)}var Mx=(0,_.createContext)(null);function Nx(e,t){let n=(0,_.useRef)({getLayout:()=>({}),setLayout:Ly});return(0,_.useImperativeHandle)(t,()=>n.current,[]),vy(()=>{Object.assign(n.current,ex({axisId:e}))}),n}function Px({groupId:e,resizePreviewMode:t}){let[n,r]=(0,_.useState)([]),i=(0,_.useRef)(n);return vy(()=>{let n=n=>{let a=Cb(e),o=t===`separator`&&n.state===`active`?n.previews.filter(e=>e.axis===a&&(e.active||!jb(e.offset,0))):[],s=i.current;s.length===o.length&&o.every((e,t)=>e===s[t])||(i.current=o,r(o))};if(t!==`separator`){n(jy());return}let a=My(({next:e})=>n(e));return n(jy()),a},[e,t]),n}function Fx({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizePreviewMode:d=`panel`,resizeTargetMinimumSize:f={coarse:20,fine:10},style:p,...m}){let h=(0,_.useRef)({onLayoutChange:{},onLayoutChanged:{}}),g=yy(e=>{Fb(h.current.onLayoutChange,e)||(h.current.onLayoutChange=e,c?.(e))}),v=yy((e,t,n)=>{Fb(h.current.onLayoutChanged,e)||(h.current.onLayoutChanged=e,l?.(e,{isUserInteraction:t,requestedLayout:n}))}),y=_y(s),[b,x]=(0,_.useState)(),S=Px({groupId:y,resizePreviewMode:d}),C=(0,_.useRef)(null),[w,T]=bx(),E=(0,_.useRef)([]),D=(0,_.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],separators:[]}),O=by(C,a),k=Nx(y,o),A=(0,_.useMemo)(()=>({getLayout:()=>k.current.getLayout(),id:y,orientation:u,setLayout:e=>k.current.setLayout(e)}),[y,k,u]),j=yy((e,t)=>{let r=wb(e);if(r)return{flexGrow:r.layout[t]??1};if(n?.[t])return{flexGrow:n?.[t]}}),M=xx({defaultLayout:n,disableCursor:r,resizeTargetMinimumSize:f}),N=(0,_.useMemo)(()=>({get disableCursor(){return!!M.disableCursor},getPanelStyles:j,id:y,orientation:u,registerPanel:e=>{let t=D.current;return t.panels=eb(u,[...t.panels,e]),T(),()=>{t.panels=t.panels.filter(t=>t!==e),T()}},registerOverlay:e=>(x(e),()=>{x(void 0)}),registerSeparator:e=>{let t=D.current;return t.separators=eb(u,[...t.separators,e]),T(),()=>{t.separators=t.separators.filter(t=>t!==e),T()}},updatePanelProps:(e,{disabled:t})=>{let n=D.current.panels.find(t=>t.id===e);if(!n||n.constraintProps.disabled===t)return;n.constraintProps.disabled=t;let r=Cb(y),i=wb(y);r&&i&&Db(r,{...i,derivedItemConstraints:pb(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=D.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[j,y,T,u,M]),P=(0,_.useRef)(null);return vy(()=>{let e=C.current;if(e===null)return;let t=D.current;t.panels=eb(u,t.panels),t.separators=eb(u,t.separators),E.current=jx([...t.panels.map(({element:e})=>e),...t.separators.map(({element:e})=>e)]);let n;if(M.defaultLayout!==void 0&&Object.keys(M.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=M.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:y,mutableState:{defaultLayout:n,disableCursor:!!M.disableCursor,expandedItemSizes:D.current.lastExpandedPanelSizes,layouts:D.current.layouts},orientation:u,items:t.panels,resizePreviewMode:d,get resizeTargetMinimumSize(){return M.resizeTargetMinimumSize},separators:t.separators};P.current=r;let a=vx(r),{defaultLayoutDeferred:o,derivedItemConstraints:s,layout:c,requestedLayout:l}=wb(r.id,!0);if(!o&&s.length>0)try{try{g(c)}finally{v(c,!1,l)}}catch(e){throw P.current=null,a(),e}let f=Eb(y,e=>{let{defaultLayoutDeferred:t,derivedItemConstraints:n,layout:i,requestedLayout:a}=e.next;if(t||n.length===0)return;yx({derivedItemConstraints:n,axis:r,layout:i,prevLayout:e.prev?.layout,requestedLayout:a});let o=jy(),s=o.state!==`active`||!o.hitRegions.some(e=>e.axis===r);try{g(i)}finally{s&&v(i,e.isUserInteraction,a)}});return()=>{P.current=null,a(),f()}},[i,y,v,g,u,w,d,M]),vy(()=>{Tx(E.current)||T()}),(0,_.useEffect)(()=>{let e=P.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,Z.jsx)(Mx.Provider,{value:A,children:(0,Z.jsx)(Sx.Provider,{value:N,children:(0,Z.jsxs)(`div`,{...m,className:t,"data-group":!0,"data-testid":xy(m,s),id:y,ref:O,style:{height:`100%`,width:`100%`,overflow:`hidden`,position:d===`separator`?`relative`:void 0,...p,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:[e,S.map(e=>(0,Z.jsx)(Ax,{overlay:b,preview:e},e.key))]})})})}Fx.displayName=`Group`;function Ix(e,t){return`react-resizable-panels:${[e,...t].join(`:`)}`}function Lx({id:e,panelIds:t,storage:n}){let r=Ix(e,[]),i=n.getItem(r);if(i)try{let e=JSON.parse(i);if(t){let n=e[t.join(`,`)];if(n&&Array.isArray(n.layout)&&t.length===n.layout.length){let e={};for(let r=0;r<t.length;r++)e[t[r]]=n.layout[r];return e}}else{let t=Object.keys(e);if(t.length===1){let n=e[t[0]];if(n&&Array.isArray(n.layout)){let e=t[0].split(`,`);if(e.length===n.layout.length){let t={};for(let r=0;r<e.length;r++)t[e[r]]=n.layout[r];return t}}}}}catch{}}function Rx({debounceSaveMs:e=100,onlySaveAfterUserInteractions:t,panelIds:n,storage:r=localStorage,...i}){let a=n!==void 0,o=`id`in i?i.id:i.groupId,s=Ix(o,n??[]),c=(0,_.useSyncExternalStore)(zx,()=>r.getItem(s),()=>r.getItem(s)),l=(0,_.useMemo)(()=>{if(c){let e=JSON.parse(c),t=Object.values(e);if(Array.from(t).every(e=>typeof e==`number`))return e}},[c]),u=(0,_.useMemo)(()=>{if(!l)return Lx({id:o,panelIds:n,storage:r})},[l,o,n,r]),d=l??u,f=(0,_.useRef)(null),p=(0,_.useCallback)(()=>{let e=f.current;e&&(f.current=null,clearTimeout(e))},[]);(0,_.useLayoutEffect)(()=>()=>{p()},[p]);let m=(0,_.useCallback)((e,n)=>{if(t&&!n.isUserInteraction)return;p();let i=n.requestedLayout??e,s;s=a?Ix(o,Object.keys(i)):Ix(o,[]);try{r.setItem(s,JSON.stringify(i))}catch(e){console.error(e)}},[p,a,o,t,r]);return{defaultLayout:d,onLayoutChange:(0,_.useCallback)(t=>{p(),e===0?m(t,{isUserInteraction:!1}):f.current=setTimeout(()=>{m(t,{isUserInteraction:!1})},e)},[p,e,m]),onLayoutChanged:m}}function zx(){return function(){}}var Bx=(0,_.createContext)(null);function Vx(e,t){let{id:n}=Dx(),r=(0,_.useRef)({collapse:Ry,expand:Ry,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Ry});return(0,_.useImperativeHandle)(t,()=>r.current,[]),vy(()=>{Object.assign(r.current,Yb({axisId:n,itemId:e}))}),r}function Hx({children:e,className:t,collapsedSize:n=`0%`,collapsedThreshold:r,collapsible:i=!1,defaultSize:a,disabled:o,elementRef:s,groupResizeBehavior:c=`preserve-relative-size`,id:l,maxSize:u=`100%`,minSize:d=`0%`,onResize:f,panelRef:p,style:m,...h}){let g=gy(l),v=_y(l),y=xx({disabled:o}),b=(0,_.useRef)(null),x=by(b,s),{getPanelStyles:S,id:C,orientation:w,registerPanel:T,updatePanelProps:E}=Dx(),D=f!==null,O=yy((e,t,n)=>{f?.(e,l,n)});vy(()=>{let e=b.current;if(e!==null){let t={element:e,id:v,idIsStable:g,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:D?O:void 0,constraintProps:{groupResizeBehavior:c,collapsedSize:n,collapsedThreshold:r,collapsible:i,defaultSize:a,disabled:y.disabled,maxSize:u,minSize:d}};return T(t)}},[c,n,r,i,a,D,v,g,u,d,O,T,y]),(0,_.useEffect)(()=>{E(v,{disabled:o})},[o,v,E]);let k=Vx(v,p),A=(0,_.useMemo)(()=>({collapse:()=>k.current.collapse(),expand:()=>k.current.expand(),getSize:()=>k.current.getSize(),groupId:C,id:v,isCollapsed:()=>k.current.isCollapsed(),resize:e=>k.current.resize(e)}),[C,v,k]),j=()=>{let e=S(C,v);if(e)return JSON.stringify(e)},M=(0,_.useSyncExternalStore)(e=>Eb(C,e),j,j),N;return N=M?JSON.parse(M):a===void 0?{flexGrow:1}:{flexGrow:void 0,flexShrink:void 0,flexBasis:a},(0,Z.jsx)(`div`,{...h,"data-disabled":o||void 0,"data-panel":!0,"data-testid":xy(h,l),id:v,ref:x,style:{...Ux,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...N},children:(0,Z.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...m,touchAction:w===`horizontal`?`pan-y`:`pan-x`},children:(0,Z.jsx)(Bx.Provider,{value:A,children:e})})})}Hx.displayName=`Panel`;var Ux={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function Wx(){return(0,_.useRef)(null)}var Gx={flexBasis:`auto`},Kx={flexGrow:0,flexShrink:0};function qx({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,preview:o,style:s,...c}){let l=_y(a),{disableCursor:u,id:d,orientation:f,registerSeparator:p,updateSeparatorProps:m}=Dx();return(0,Z.jsx)(wx,{attributes:c,axisId:d,axisOrientation:f,className:t,"data-testid":xy(c,a),disableCursor:u,disabled:n,disableDoubleClick:r,elementRef:i,id:l,preview:o,registerSeparator:p,requiredStyle:Kx,style:s,styleDefaults:Gx,updateSeparatorProps:m,children:e})}qx.displayName=`Separator`;function Jx({className:e,...t}){return(0,Z.jsx)(Fx,{"data-slot":`resizable-panel-group`,className:Q(`flex h-full w-full aria-[orientation=vertical]:flex-col`,e),...t})}function Yx({...e}){return(0,Z.jsx)(Hx,{"data-slot":`resizable-panel`,...e})}function Xx({withHandle:e,className:t,children:n,...r}){return(0,Z.jsxs)(qx,{"data-slot":`resizable-handle`,className:Q(`relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,t),...r,children:[e&&(0,Z.jsx)(`div`,{className:`z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border`}),n]})}var Zx=class extends Error{code;details;constructor(e,t,n={}){super(t),this.name=`BoardWriteError`,this.code=e,this.details=n}};async function Qx(e,t,n=`POST`,r=fetch){let i=await r(e,t instanceof FormData?{method:n,body:t}:{method:n,headers:{"content-type":`application/json`},body:JSON.stringify(t)});i.status===401&&R_.setState({canWrite:!1});let a=await i.json().catch(()=>null);if(a===null)throw new Zx(`internal`,`The board answered ${i.status}.`);if(!a.ok)throw new Zx(a.error.code,a.error.message,a.error.details);return a.data}function $x(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function eS(e,t=`|`){return e.map(e=>TS(e)).join(t)}function tS(e,t){return typeof t==`bigint`?t.toString():t}var nS=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function rS(e){return new nS(e)}function iS(e){return e==null}function aS(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function oS(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function sS(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function cS(e){return sS(e._zod.def)??e._zod.def.shape}function lS(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return oS(this,t,e),e},enumerable:!0,configurable:!0})}function uS(e,t,n){t in e?oS(e,t,n):e[t]=n}function dS(e,t,n,r){let i=cS(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?lS(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):uS(e,a,r?r(n.value,a):n.value))}}function fS(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?lS(e,n,()=>t[n]):uS(e,n,r.value))}}function pS(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function mS(e){return JSON.stringify(e)}function hS(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var gS=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function _S(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var vS=rS(()=>{if(hC.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function yS(e){if(_S(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return _S(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function bS(e){return yS(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var xS=new Set([`string`,`number`,`symbol`]);function SS(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function CS(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function wS(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function TS(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ES(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var DS={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},OS={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function kS(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return dS(i,e,AS(e,t)),CS(e,pS(n,{shape:i,checks:[]}))}function AS(e,t){let n=cS(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function jS(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(AS(e,t)),a={};return dS(a,e,Reflect.ownKeys(cS(e)).filter(e=>!i.has(e))),CS(e,pS(n,{shape:a,checks:[]}))}function MS(e,t){if(!yS(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=cS(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return CS(e,pS(e._zod.def,{shape:NS(e,t)}))}function NS(e,t){let n={};return dS(n,e,Reflect.ownKeys(cS(e))),fS(n,t),n}function PS(e,t){if(!yS(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return CS(e,pS(e._zod.def,{shape:NS(e,t)}))}function FS(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return dS(n,e,Reflect.ownKeys(cS(e))),dS(n,t,Reflect.ownKeys(cS(t))),CS(e,pS(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function IS(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(AS(t,n)):void 0,o={};return dS(o,t,Reflect.ownKeys(cS(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),CS(t,pS(t._zod.def,{shape:o,checks:[]}))}function LS(e,t,n){let r=n?new Set(AS(t,n)):void 0,i={};return dS(i,t,Reflect.ownKeys(cS(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),CS(t,pS(t._zod.def,{shape:i}))}function RS(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function zS(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function BS(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function VS(e){return typeof e==`string`?e:e?.message}function HS(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function US(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function WS(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:VS(e.inst?._zod.def?.error?.(e))??VS(a?.(e))??VS(t?.error?.(e))??VS(n.customError?.(e))??VS(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var GS=/[\uD800-\uDBFF]/;function KS(e){let t=e.length;if(!GS.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function qS(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function JS(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function YS(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function XS(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):eC(e,n,r.value)}}function ZS(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function QS(e,t,n){return ZS(e,t,n,!1)}function $S(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return ZS(this,n,r(this))},set(e){ZS(this,n,e)}})}return t}function eC(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:ZS(this,t,n.bind(this))},set(e){ZS(this,t,e)}})}function tC(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var nC,rC=!1,iC={configurable:!0,get(){rC=!0}};function aC(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&nC!==e._zod?nC=void 0:(nC=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,iC);let e=rC;rC=!1;try{let r=n(this);return rC?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),rC||=e,r}catch(n){throw delete this[t],rC||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function oC(e,t,n,r){let i=tC(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var sC=`~constantCatch`;function cC(e){let t=()=>e;return t[sC]=!0,t}var lC,uC={value:void 0,enumerable:!1},dC=`captureStackTrace`in Error?Error:null;function fC(e){let t=dC;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return dC=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function $(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){uC.value=new a(r);try{Object.defineProperty(n,"_zod",uC)}finally{uC.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),XS(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?fC(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var pC=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},mC=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(lC=globalThis).__zod_globalConfig??(lC.__zod_globalConfig={});var hC=globalThis.__zod_globalConfig;function gC(e){return e&&Object.assign(hC,e),hC}function _C(){let e=this._zod;return e.message??=JSON.stringify(e.def,tS,2),e.message}function vC(e){this._zod.message=e}var yC={get:_C,set:vC,enumerable:!0,configurable:!0},bC={value:void 0,enumerable:!1},xC=new WeakSet([Object.prototype,Error.prototype]),SC=$(`$ZodError`,(e,t)=>{e.name=`$ZodError`,bC.value=t,Object.defineProperty(e,"issues",bC),bC.value=void 0,Object.defineProperty(e,"message",yC);let n=Object.getPrototypeOf(e);xC.has(n)||(xC.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function CC(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function wC(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?CC(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function TC(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function EC(e,t){return{callee:t?.callee??e,Err:t?.Err}}var DC=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new pC;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>WS(e,o,gC())));throw gS(n,a?.callee??t),n}return s.value};return t},OC=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>WS(e,o,gC())));throw gS(n,a?.callee??t),n}return s.value};return t},kC=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new pC;return a.issues.length?AC(e,a.issues,i):{success:!0,data:a.value}};function AC(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>WS(e,n,gC()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var jC=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?AC(e,a.issues,i):{success:!0,data:a.value}},MC=Symbol.for(`zod.compile.invalid`),NC=Symbol.for(`zod.compile.fallback`),PC=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==MC)return!0;if(r.definite===!0&&n===void 0)return!1}return FC(e,t,n)});function FC(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[NC]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new pC;return a.issues.length===0}var IC=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},LC=e=>{let t=DC(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,EC(n,a))};return n},RC=e=>{let t=DC(e),n=(e,r,i,a)=>t(e,r,i,EC(n,a));return n},zC=e=>{let t=OC(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,EC(n,a))};return n},BC=e=>{let t=OC(e),n=async(e,r,i,a)=>await t(e,r,i,EC(n,a));return n},VC=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return kC(e)(t,n,i)},HC=e=>(t,n,r)=>kC(e)(t,n,r),UC=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return jC(e)(t,n,i)},WC=e=>async(t,n,r)=>jC(e)(t,n,r),GC=/^[cC][0-9a-z]{6,}$/,KC=/^[0-9a-z]+$/,qC=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,JC=/^[0-9a-vA-V]{20}$/,YC=/^[A-Za-z0-9]{27}$/,XC=/^[a-zA-Z0-9_-]{21}$/;function ZC(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var QC=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,$C=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ew=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,tw=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,nw=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function rw(){return new RegExp(nw,`u`)}var iw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,aw=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ow=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,sw=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,cw=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,lw=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,uw=/^https?$/,dw=/^\+[1-9]\d{6,14}$/,fw=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function pw(e){return RegExp(`^${e}$`)}var mw=pw(fw);function hw(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function gw(e){return RegExp(`^${hw(e)}$`)}function _w(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${hw({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${hw({precision:e.precision})}`:n;return RegExp(`^${fw}T(?:${r})$`)}var vw=/^[\s\S]{0,}$/,yw=/^(?:true|false)$/i,bw=/^[^A-Z]*$/,xw=/^[^a-z]*$/,Sw=$(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Cw=e=>{let t=e.value;return!iS(t)&&t.length!==void 0},ww=$(`$ZodCheckMaxLength`,(e,t)=>{var n;Sw.init(e,t),(n=e._zod.def).when??(n.when=Cw),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?KS(r):i)<=t.maximum)return;let a=qS(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Tw=$(`$ZodCheckMinLength`,(e,t)=>{var n;Sw.init(e,t),(n=e._zod.def).when??(n.when=Cw),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?KS(r):i)>=t.minimum)return;let a=qS(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ew=$(`$ZodCheckLengthEquals`,(e,t)=>{var n;Sw.init(e,t),(n=e._zod.def).when??(n.when=Cw),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?KS(r):i;if(a===t.length)return;let o=qS(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Dw=$(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Sw.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Ow=$(`$ZodCheckRegex`,(e,t)=>{Dw.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),kw=$(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=bw,Dw.init(e,t)}),Aw=$(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=xw,Dw.init(e,t)}),jw=$(`$ZodCheckIncludes`,(e,t)=>{Sw.init(e,t);let n=SS(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Mw=$(`$ZodCheckStartsWith`,(e,t)=>{Sw.init(e,t);let n=RegExp(`^${SS(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Nw=$(`$ZodCheckEndsWith`,(e,t)=>{Sw.init(e,t);let n=RegExp(`.*${SS(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Pw=$(`$ZodCheckOverwrite`,(e,t)=>{Sw.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Fw=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
10
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
11
|
+
`)}\n};`)(...Object.values(this.closed))}},Iw={major:4,minor:6,patch:7},Lw=$(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Iw;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=RS(t),a;for(let o of n){if(o._zod.def.when){if(zS(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new pC;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(US(t.issues,n,e),i||=RS(t,n))});else{if(t.issues.length===n)continue;US(t.issues,n,e),i||=RS(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(RS(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new pC;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new pC;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return QS(this,`~standard`,Bw(this))},set"~standard"(e){ZS(this,`~standard`,e)}}),Rw=(e,t)=>e.issues.length?{issues:e.issues.map(e=>WS(e,t,gC()))}:{value:e.value};async function zw(e,t){let n={async:!0};return Rw(await e._zod.run({value:t,issues:[]},n),n)}function Bw(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Rw(r,n)}catch{}return zw(e,t)},vendor:`zod`,version:1}}var Vw=$(`$ZodString`,(e,t)=>{Lw.init(e,t),e._zod.pattern=t.pattern??vw,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Hw=$(`$ZodStringFormat`,(e,t)=>{Dw.init(e,t),Vw.init(e,t)}),Uw=$(`$ZodGUID`,(e,t)=>{t.pattern??=$C,Hw.init(e,t)}),Ww=$(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=ew(e)}else t.pattern??=ew();Hw.init(e,t)}),Gw=$(`$ZodEmail`,(e,t)=>{t.pattern??=tw,Hw.init(e,t)});function Kw(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function qw(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Kw(e)||2:Jw(e,t)}function Jw(e,t){if(!t.normalize&&t.protocol?.source===uw.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var Yw=/[\t\n\r]/g;function Xw(e){return e.replace(Yw,``)}function Zw(e,t){return t.lastIndex=0,t.test(e.hostname)}function Qw(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var $w=$(`$ZodURL`,(e,t)=>{Hw.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=qw(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=Xw(r);return}t.hostname&&!Zw(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Qw(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Xw(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),eT=$(`$ZodEmoji`,(e,t)=>{t.pattern??=rw(),Hw.init(e,t)}),tT=$(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?XC:ZC(t.length),Hw.init(e,t)}),nT=$(`$ZodCUID`,(e,t)=>{t.pattern??=GC,Hw.init(e,t)}),rT=$(`$ZodCUID2`,(e,t)=>{t.pattern??=KC,Hw.init(e,t)}),iT=$(`$ZodULID`,(e,t)=>{t.pattern??=qC,Hw.init(e,t)}),aT=$(`$ZodXID`,(e,t)=>{t.pattern??=JC,Hw.init(e,t)}),oT=$(`$ZodKSUID`,(e,t)=>{t.pattern??=YC,Hw.init(e,t)}),sT=$(`$ZodISODateTime`,(e,t)=>{t.pattern??=_w(t),Hw.init(e,t)}),cT=$(`$ZodISODate`,(e,t)=>{t.pattern??=mw,Hw.init(e,t)}),lT=$(`$ZodISOTime`,(e,t)=>{t.pattern??=gw(t),Hw.init(e,t)}),uT=$(`$ZodISODuration`,(e,t)=>{t.pattern??=QC,Hw.init(e,t)}),dT=$(`$ZodIPv4`,(e,t)=>{t.pattern??=iw,Hw.init(e,t)}),fT=/^[0-9a-fA-F:.]+$/;function pT(e){return fT.test(e)?Kw(`http://[${e}]`):!1}var mT=$(`$ZodIPv6`,(e,t)=>{t.pattern??=aw,Hw.init(e,t),e._zod.check=n=>{pT(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),hT=$(`$ZodCIDRv4`,(e,t)=>{t.pattern??=ow,Hw.init(e,t)});function gT(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:pT(n)}var _T=$(`$ZodCIDRv6`,(e,t)=>{t.pattern??=sw,Hw.init(e,t),e._zod.check=n=>{gT(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function vT(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var yT=/^[0-9a-zA-Z+/]*={0,2}$/,bT=$(`$ZodBase64`,(e,t)=>{t.pattern??=yT,Hw.init(e,t),e._zod.check=n=>{vT(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),xT=/^[A-Za-z0-9_-]*$/;function ST(e){if(!xT.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return vT(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var CT=$(`$ZodBase64URL`,(e,t)=>{t.pattern??=xT,Hw.init(e,t),e._zod.check=n=>{ST(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),wT=$(`$ZodE164`,(e,t)=>{t.pattern??=dw,Hw.init(e,t)});function TT(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var ET=$(`$ZodJWT`,(e,t)=>{Hw.init(e,t),e._zod.check=n=>{TT(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),DT=$(`$ZodBoolean`,(e,t)=>{Lw.init(e,t),e._zod.pattern=yw,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),OT=$(`$ZodUnknown`,(e,t)=>{Lw.init(e,t),e._zod.parse=e=>e}),kT=$(`$ZodNever`,(e,t)=>{Lw.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function AT(e,t){let n=HS(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of HS(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,US(n.issues,t,e),n}}return i(n,a)}}var jT=e=>Array.isArray(e)?e.length:-1;function MT(e,t,n){e.issues.length&&t.issues.push(...BS(n,e.issues)),t.value[n]=e.value}var NT=$(`$ZodArray`,(e,t)=>{Lw.init(e,t);let n=hC.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>MT(t,r,e)));else if(MT(c,r,e),s&&c.issues.length!==0&&RS(c))break}return o.length?Promise.all(o).then(()=>r):r},AT(e,jT)});function PT(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...BS(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var FT=[];function IT(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:FT,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=ES(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function LT(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(RS(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>PT(e,n,i,t,d,f))):PT(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var RT=$(`$ZodObject`,(e,t)=>{Lw.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=rS(()=>IT(t));aC(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||oS(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=_S,o=t.catchall,s,c=hC.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(RS(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>PT(n,t,e,r,a,o))):PT(s,t,e,r,a,o)}return o?LT(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),zT=$(`$ZodObjectJIT`,(e,t)=>{RT.init(e,t);let n=e._zod.parse,r=rS(()=>IT(t)),i=hC.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Fw([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
12
|
+
let ${e}_ab = false;
|
|
13
|
+
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
14
|
+
const iss = ${e}.issues[i];
|
|
15
|
+
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
16
|
+
payload.issues.push(iss);
|
|
17
|
+
if (iss.continue !== true) ${e}_ab = true;
|
|
18
|
+
}
|
|
19
|
+
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
20
|
+
payload.value = newResult;
|
|
21
|
+
return payload;
|
|
22
|
+
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:mS(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
23
|
+
const ${n}_present = ${i};
|
|
24
|
+
if (!${n}.issues.length || ${n}_present) {
|
|
25
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (${e}) {
|
|
29
|
+
newResult[${r}] = ${n}.value;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
`)}else f?(o.write(`
|
|
34
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
35
|
+
}
|
|
36
|
+
`),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
|
|
37
|
+
if (${n}.value !== undefined || ${i}) {
|
|
38
|
+
newResult[${r}] = ${n}.value;
|
|
39
|
+
}
|
|
40
|
+
`)):o.write(`
|
|
41
|
+
const ${n}_present = ${i};
|
|
42
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
43
|
+
}
|
|
44
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
45
|
+
payload.issues.push({
|
|
46
|
+
code: "invalid_type",
|
|
47
|
+
expected: "nonoptional",
|
|
48
|
+
input: undefined,
|
|
49
|
+
path: [${r}]
|
|
50
|
+
});
|
|
51
|
+
if (ctx && ctx.abortEarly) {
|
|
52
|
+
payload.value = newResult;
|
|
53
|
+
return payload;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (${n}_present) {
|
|
58
|
+
newResult[${r}] = ${n}.value;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=_S,c=!hC.jitless,l=c&&vS.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?LT([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function BT(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!RS(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>WS(e,r,gC())))}),t)}var VT=$(`$ZodUnion`,(e,t)=>{Lw.init(e,t),aC(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),aC(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),aC(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),aC(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>aS(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>BT(t,r,e,i)):BT(o,r,e,i)}}),HT=$(`$ZodIntersection`,(e,t)=>{Lw.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>WT(e,t,n)):WT(e,i,a)}});function UT(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(yS(e)&&yS(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=UT(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=UT(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function WT(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=UT(t.value,n.value);if(!c.valid){if(RS(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var GT=$(`$ZodEnum`,(e,t)=>{Lw.init(e,t);let n=$x(t.entries),r=new Set(n);e._zod.values=r,aC(e,`pattern`,e=>{let t=$x(e.def.entries).filter(e=>xS.has(typeof e));return RegExp(t.length?`^(${t.map(e=>SS(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),KT=$(`$ZodLiteral`,(e,t)=>{Lw.init(e,t);let n=new Set(t.values);e._zod.values=n,aC(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?SS(e):e?SS(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),qT=$(`$ZodTransform`,(e,t)=>{Lw.init(e,t),e._zod.optin=`optional`,hC.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new mC(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new pC;return n.value=i,n}});function JT(e,t){return e.value=t.issues.length?void 0:t.value,e}var YT=$(`$ZodOptional`,(e,t)=>{Lw.init(e,t),aC(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,aC(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),aC(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${aS(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>JT(e,t)):JT(e,r)}return t.innerType._zod.run(e,n)}}),jee=$(`$ZodExactOptional`,(e,t)=>{YT.init(e,t),aC(e,`values`,e=>e.def.innerType._zod.values),aC(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Mee=$(`$ZodNullable`,(e,t)=>{Lw.init(e,t),aC(e,`optin`,e=>e.def.innerType._zod.optin),aC(e,`optout`,e=>e.def.innerType._zod.optout),aC(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${aS(t.source)}|null)$`):void 0}),aC(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Nee=$(`$ZodDefault`,(e,t)=>{Lw.init(e,t),e._zod.optin=`defaulted`,aC(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>XT(e,t)):XT(r,t)}});function XT(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Pee=$(`$ZodPrefault`,(e,t)=>{Lw.init(e,t),e._zod.optin=`defaulted`,aC(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Fee=$(`$ZodNonOptional`,(e,t)=>{Lw.init(e,t),aC(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>ZT(t,e)):ZT(i,e)}});function ZT(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function QT(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>WS(e,r,gC()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Iee=$(`$ZodCatch`,(e,t)=>{Lw.init(e,t),aC(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),aC(e,`optout`,e=>e.def.innerType._zod.optout),aC(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>QT(e,r,t,n)):QT(e,r,t,n)}}),Lee=$(`$ZodPipe`,(e,t)=>{Lw.init(e,t),aC(e,`values`,e=>e.def.in._zod.values),aC(e,`optin`,e=>e.def.in._zod.optin),aC(e,`optout`,e=>e.def.out._zod.optout),aC(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>$T(e,t.in,n)):$T(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>$T(e,t.out,n)):$T(r,t.out,n)}});function $T(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Ree=$(`$ZodReadonly`,(e,t)=>{Lw.init(e,t),aC(e,`propValues`,e=>e.def.innerType._zod.propValues),aC(e,`values`,e=>e.def.innerType._zod.values),aC(e,`optin`,e=>e.def.innerType?._zod?.optin),aC(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(eE):eE(r)}});function eE(e){return e.memo||(e.value=Object.freeze(e.value)),e}var zee=$(`$ZodCustom`,(e,t)=>{Sw.init(e,t),Lw.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>tE(t,n,r,e));tE(i,n,r,e)}});function tE(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(YS(e))}}var Bee=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},nE=`~memo`,rE=[];function iE(e){return typeof e==`object`&&!!e}function aE(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var oE=new WeakMap,sE=0,cE=1,lE=2;function uE(e,t,n){let r=oE.get(e);if(r!==void 0)return r?lE:sE;if(t.has(e))return lE;t.add(e);let i=sE,a=e=>{if(i!==lE&&e?._zod){let r=uE(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=sE;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?cE:o.value?._zod?uE(o.value,t,n):sE;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=sS(c);s(e?o(e,!0):cE),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?uE(r,t,!1):cE);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Vee(e,i)}function Vee(e,t){return t!==cE&&oE.set(e,t===lE),t}function Hee(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var dE,fE=[],Uee={alloc(e,t,n){let r=dE;if(!r)return n;dE=void 0;let i={value:n,issues:null};return r.set(t.value,i),fE.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Gee(n,e.value))throw new Bee;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=uE(e,new Set,!1);if(i===sE)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===lE||r?n=!0:r=!0}let l=s.value;if(!iE(l))return t(s,c);let u=c[nE];u||(u={buckets:new WeakMap,backEdges:void 0},c[nE]=u);let d;i===c?d=a:(d=Hee(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...aE(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;dE=d;let p=fE.length,m=t(s,c);dE=void 0;let h=fE.length>p?fE.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?aE(e.issues):rE),e)):(h&&(h.issues=m.issues.length?aE(m.issues):rE),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Wee(){return Uee}function Gee(e,t){let n=e[nE]?.backEdges;return n!==void 0&&iE(t)&&n.has(t)}var Kee=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(JS(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${TS(e.values[0])}`:`Invalid option: expected one of ${eS(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${eS(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function qee(){return{localeError:Kee()}}var pE,Jee=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Yee(){return new Jee}(pE=globalThis).__zod_globalRegistry??(pE.__zod_globalRegistry=Yee());var mE=globalThis.__zod_globalRegistry;function Xee(e){return e.checks&&=[...e.checks],e}function Zee(e,t){return new e(Xee({type:`string`,...wS(t)}))}function Qee(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...wS(t)})}function $ee(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...wS(t)})}function ete(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...wS(t)})}function tte(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...wS(t)})}function nte(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...wS(t)})}function rte(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...wS(t)})}function ite(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...wS(t)})}function ate(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...wS(t)})}function ote(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...wS(t)})}function ste(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...wS(t)})}function cte(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...wS(t)})}function lte(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...wS(t)})}function ute(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...wS(t)})}function dte(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...wS(t)})}function fte(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...wS(t)})}function pte(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...wS(t)})}function mte(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...wS(t)})}function hte(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...wS(t)})}function gte(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...wS(t)})}function _te(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...wS(t)})}function vte(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...wS(t)})}function yte(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...wS(t)})}function bte(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...wS(t)})}function xte(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...wS(t)})}function Ste(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...wS(t)})}function Cte(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...wS(t)})}function wte(e,t){return new e({type:`boolean`,...wS(t)})}function Tte(e){return new e({type:`unknown`})}function Ete(e,t){return new e({type:`never`,...wS(t)})}function hE(e,t){return new ww({check:`max_length`,...wS(t),maximum:e})}function gE(e,t){return new Tw({check:`min_length`,...wS(t),minimum:e})}function _E(e,t){return new Ew({check:`length_equals`,...wS(t),length:e})}function Dte(e,t){return new Ow({check:`string_format`,format:`regex`,...wS(t),pattern:e})}function Ote(e){return new kw({check:`string_format`,format:`lowercase`,...wS(e)})}function kte(e){return new Aw({check:`string_format`,format:`uppercase`,...wS(e)})}function Ate(e,t){return new jw({check:`string_format`,format:`includes`,...wS(t),includes:e})}function jte(e,t){return new Mw({check:`string_format`,format:`starts_with`,...wS(t),prefix:e})}function Mte(e,t){return new Nw({check:`string_format`,format:`ends_with`,...wS(t),suffix:e})}function vE(e){return new Pw({check:`overwrite`,tx:e})}function Nte(e){return vE(t=>t.normalize(e))}function Pte(){return vE(e=>e.trim())}function yE(){return vE(e=>e.toLowerCase())}function bE(){return vE(e=>e.toUpperCase())}function xE(){return vE(e=>hS(e))}function SE(e,t,n){return new e({type:`array`,element:t,...wS(n)})}function Fte(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...wS(n)})}function CE(e,t){let n=wE(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(YS(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(YS(r))}},e(t.value,t)),t);return n}function wE(e,t){let n=new Sw({check:`custom`,...wS(t)});return n._zod.check=e,n}function TE(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&oS(e,t,n[t]);return e}function EE(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??mE,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function DE(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function OE(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,OE(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&TE(o.schema,c),t.io===`input`&&RE(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function kE(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function AE(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${kE(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+kE(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
62
|
+
|
|
63
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function jE(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;jE(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var ME=new Set([`type`,`properties`,`required`,`additionalProperties`]),NE=[`oneOf`,`anyOf`];function PE(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function FE(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!ME.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??PE(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}oS(n,r,e.length===1?e[0]:FE(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=PE(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function IE(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of ME)if(t in e)return;let n=t.filter(e=>NE.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=FE(t);else{let e=n[0],i=NE.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>FE([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,TE(e,r))}function LE(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):TE(i,s),TE(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())jE(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])IE(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}TE(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,oS(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:zE(t,`input`,e.processors),output:zE(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function RE(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return RE(r.element,n);if(r.type===`set`)return RE(r.valueType,n);if(r.type===`lazy`)return RE(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return RE(r.innerType,n);if(r.type===`intersection`)return RE(r.left,n)||RE(r.right,n);if(r.type===`record`||r.type===`map`)return RE(r.keyType,n)||RE(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:RE(r.in,n)||RE(r.out,n);if(r.type===`object`){for(let e in r.shape)if(RE(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(RE(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(RE(e,n))return!0;return!!(r.rest&&RE(r.rest,n))}return!1}var Ite=(e,t={})=>n=>{let r=EE({...n,processors:t});return OE(e,r),AE(r,e),LE(r,e)},zE=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=EE({...i??{},target:a,io:t,processors:n});return OE(e,o),AE(o,e),LE(o,e)},BE=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},VE=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},HE=(e,t)=>{BE(e,`minimum`,t),VE(e,`maximum`,t)},UE=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},WE=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},GE=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},KE=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},qE=(e,t)=>BE(e,`minimum`,t.minimum),JE=(e,t)=>VE(e,`maximum`,t.maximum),YE=e=>(t,n)=>{KE(t,n.format);let[r,i]=e[n.format];BE(t,`minimum`,r),VE(t,`maximum`,i)},XE={greater_than:(e,t)=>BE(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>VE(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>UE(e,t.value),number_format:YE(DS),bigint_format:YE(OS),min_length:qE,max_length:JE,length_equals:(e,t)=>HE(e,t.length),min_size:qE,max_size:JE,size_equals:(e,t)=>HE(e,t.size),string_format:(e,t)=>{KE(e,t.format),t.pattern&&WE(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>GE(e,t.mime)};function ZE(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)XE[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&BE(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&BE(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&VE(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&VE(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&UE(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&GE(t,i.mime);for(let e of i.patterns??[])WE(t,e);return t}var QE={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},$E=new Map([[yT,cw],[xT,lw]]),eD=e=>$E.get(e)??e,tD=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=ZE(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=QE[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(eD);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},nD=(e,t,n,r)=>{n.type=`boolean`},rD=(e,t,n,r)=>{n.not={}},iD=(e,t,n,r)=>{let i=e._zod.def,a=$x(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},aD=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(DE(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(DE(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},oD=(e,t,n,r)=>{DE(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},sD=(e,t,n,r)=>{DE(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},cD=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=ZE(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=OE(a.element,t,{...r,path:[...r.path,`items`]})};function lD(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?lD(t.out):t.type===`catch`?lD(t.innerType):e._zod.optin}var uD=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&DE(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)oS(i.properties,e,OE(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?lD(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=OE(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},dD=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>OE(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},fD=(e,t,n,r)=>{let i=e._zod.def,a=OE(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=OE(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},pD=(e,t,n,r)=>{let i=e._zod.def,a=OE(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},mD=(e,t,n,r)=>{let i=e._zod.def;OE(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},hD=Symbol();function gD(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(DE(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),hD):JSON.parse(o)}var _D=(e,t,n,r)=>{let i=e._zod.def;OE(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=gD(i.defaultValue,e,t,n,r);o!==hD&&(n.default=o)},vD=(e,t,n,r)=>{let i=e._zod.def;OE(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=gD(i.defaultValue,e,t,n,r);o!==hD&&(n._prefault=o)},yD=(e,t,n,r)=>{let i=e._zod.def;OE(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{DE(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},bD=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;OE(o,t,r);let s=t.seen.get(e);s.ref=o},xD=(e,t,n,r)=>{let i=e._zod.def;OE(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},SD=(e,t,n,r)=>{let i=e._zod.def;OE(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},CD=new WeakSet([Object.prototype,Error.prototype]);function wD(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var TD=$(`ZodError`,(e,t)=>{SC.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);CD.has(n)||(CD.add(n),wD(n,`format`,e=>t=>TC(e,t)),wD(n,`flatten`,e=>t=>wC(e,t)),wD(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,tS,2)}),wD(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,tS,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),ED=DC(TD),Lte=OC(TD),Rte=kC(TD),zte=jC(TD),Bte=LC(TD),Vte=RC(TD),Hte=zC(TD),Ute=BC(TD),Wte=VC(TD),Gte=HC(TD),Kte=UC(TD),qte=WC(TD);function Jte(){hC.localeError||gC(qee())}function DD(){hC.memoizer||gC({memoizer:Wee()})}var OD=$(`ZodType`,(e,t)=>(Jte(),Lw.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(pS(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return CS(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(FO(e,t))},superRefine(e,t){return this.check(IO(e,t))},overwrite(e){return this.check(vE(e))},optional(){return _O(this)},exactOptional(){return yO(this)},nullable(){return xO(this)},nullish(){return _O(xO(this))},nonoptional(e){return DO(this,e)},array(){return nO(this)},or(e){return sO([this,e])},and(e){return lO(this,e)},transform(e){return jO(this,hO(e))},default(e){return CO(this,e)},prefault(e){return TO(this,e)},catch(e){return kO(this,e)},pipe(e){return jO(this,e)},readonly(){return NO(this)},describe(e){let t=this.clone();return mE.add(t,{description:e}),t},meta(...e){if(e.length===0)return mE.get(this);let t=this.clone();return mE.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return QS(this,`~standard`,{...Bw(this),jsonSchema:{input:zE(this,`input`),output:zE(this,`output`)}})},set"~standard"(e){ZS(this,`~standard`,e)},parse:function e(t,n){return ED(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Lte(this,t,n,{callee:e})},safeParse(e,t){return Rte(this,e,t)},async safeParseAsync(e,t){return zte(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){ZS(this,`spa`,e)},validate(e,t){return PC(this,e,t)},validateAsync(e,t){return IC(this,e,t)},encode:function e(t,n){return Bte(this,t,n,{callee:e})},decode:function e(t,n){return Vte(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Hte(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Ute(this,t,n,{callee:e})},safeEncode(e,t){return Wte(this,e,t)},safeDecode(e,t){return Gte(this,e,t)},async safeEncodeAsync(e,t){return Kte(this,e,t)},async safeDecodeAsync(e,t){return qte(this,e,t)},toJSONSchema(e){return Ite(this,{})(e)},get description(){return mE.get(this)?.description},get _def(){return this._zod.def}}),kD=$(`_ZodString`,(e,t)=>{Vw.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tD(e,t,n,r)},$S({format:e=>ZE(e).format??null,minLength:e=>ZE(e).minimum??null,maxLength:e=>ZE(e).maximum??null},{regex(...e){return this.check(Dte(...e))},includes(...e){return this.check(Ate(...e))},startsWith(...e){return this.check(jte(...e))},endsWith(...e){return this.check(Mte(...e))},min(...e){return this.check(gE(...e))},max(...e){return this.check(hE(...e))},length(...e){return this.check(_E(...e))},nonempty(...e){return this.check(gE(1,...e))},lowercase(e){return this.check(Ote(e))},uppercase(e){return this.check(kte(e))},trim(){return this.check(Pte())},normalize(...e){return this.check(Nte(...e))},toLowerCase(){return this.check(yE())},toUpperCase(){return this.check(bE())},slugify(){return this.check(xE())}})),Yte=$(`ZodString`,(e,t)=>{Vw.init(e,t),kD.init(e,t)},{email(e){return this.check(Qee(ene,e))},url(e){return this.check(ite(ND,e))},jwt(e){return this.check(yte(JD,e))},emoji(e){return this.check(ate(PD,e))},guid(e){return this.check($ee(tne,e))},uuid(e){return this.check(ete(MD,e))},uuidv4(e){return this.check(tte(MD,e))},uuidv6(e){return this.check(nte(MD,e))},uuidv7(e){return this.check(rte(MD,e))},nanoid(e){return this.check(ote(FD,e))},cuid(e){return this.check(ste(ID,e))},cuid2(e){return this.check(cte(LD,e))},ulid(e){return this.check(lte(RD,e))},base64(e){return this.check(gte(GD,e))},base64url(e){return this.check(_te(KD,e))},xid(e){return this.check(ute(zD,e))},ksuid(e){return this.check(dte(BD,e))},ipv4(e){return this.check(fte(VD,e))},ipv6(e){return this.check(pte(HD,e))},cidrv4(e){return this.check(mte(UD,e))},cidrv6(e){return this.check(hte(WD,e))},e164(e){return this.check(vte(qD,e))},datetime(e){return this.check(bte(Xte,e))},date(e){return this.check(xte(Zte,e))},time(e){return this.check(Ste(Qte,e))},duration(e){return this.check(Cte($te,e))}});function AD(e){return Zee(Yte,e)}var jD=$(`ZodStringFormat`,(e,t)=>{Hw.init(e,t),kD.init(e,t)}),Xte=$(`ZodISODateTime`,(e,t)=>{sT.init(e,t),jD.init(e,t)}),Zte=$(`ZodISODate`,(e,t)=>{cT.init(e,t),jD.init(e,t)}),Qte=$(`ZodISOTime`,(e,t)=>{lT.init(e,t),jD.init(e,t)}),$te=$(`ZodISODuration`,(e,t)=>{uT.init(e,t),jD.init(e,t)}),ene=$(`ZodEmail`,(e,t)=>{Gw.init(e,t),jD.init(e,t)}),tne=$(`ZodGUID`,(e,t)=>{Uw.init(e,t),jD.init(e,t)}),MD=$(`ZodUUID`,(e,t)=>{Ww.init(e,t),jD.init(e,t)}),ND=$(`ZodURL`,(e,t)=>{$w.init(e,t),jD.init(e,t)}),PD=$(`ZodEmoji`,(e,t)=>{eT.init(e,t),jD.init(e,t)}),FD=$(`ZodNanoID`,(e,t)=>{tT.init(e,t),jD.init(e,t)}),ID=$(`ZodCUID`,(e,t)=>{nT.init(e,t),jD.init(e,t)}),LD=$(`ZodCUID2`,(e,t)=>{rT.init(e,t),jD.init(e,t)}),RD=$(`ZodULID`,(e,t)=>{iT.init(e,t),jD.init(e,t)}),zD=$(`ZodXID`,(e,t)=>{aT.init(e,t),jD.init(e,t)}),BD=$(`ZodKSUID`,(e,t)=>{oT.init(e,t),jD.init(e,t)}),VD=$(`ZodIPv4`,(e,t)=>{dT.init(e,t),jD.init(e,t)}),HD=$(`ZodIPv6`,(e,t)=>{mT.init(e,t),jD.init(e,t)}),UD=$(`ZodCIDRv4`,(e,t)=>{hT.init(e,t),jD.init(e,t)}),WD=$(`ZodCIDRv6`,(e,t)=>{_T.init(e,t),jD.init(e,t)}),GD=$(`ZodBase64`,(e,t)=>{bT.init(e,t),jD.init(e,t)}),KD=$(`ZodBase64URL`,(e,t)=>{CT.init(e,t),jD.init(e,t)}),qD=$(`ZodE164`,(e,t)=>{wT.init(e,t),jD.init(e,t)}),JD=$(`ZodJWT`,(e,t)=>{ET.init(e,t),jD.init(e,t)}),YD=$(`ZodBoolean`,(e,t)=>{DT.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nD(e,t,n,r)});function XD(e){return wte(YD,e)}var ZD=$(`ZodUnknown`,(e,t)=>{OT.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function QD(){return Tte(ZD)}var $D=$(`ZodNever`,(e,t)=>{kT.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rD(e,t,n,r)});function eO(e){return Ete($D,e)}var tO=$(`ZodArray`,(e,t)=>{DD(),NT.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cD(e,t,n,r),e.element=t.element},{min(e,t){return this.check(gE(e,t))},nonempty(e){return this.check(gE(1,e))},max(e,t){return this.check(hE(e,t))},length(e,t){return this.check(_E(e,t))},unwrap(){return this.element}});function nO(e,t){return SE(tO,e,t)}var rO=$(`ZodObject`,(e,t)=>{DD(),zT.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uD(e,t,n,r),oC(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return dO(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(pS(this._zod.def,{catchall:e}))},passthrough(){return this.clone(pS(this._zod.def,{catchall:QD()}))},loose(){return this.clone(pS(this._zod.def,{catchall:QD()}))},strict(){return this.clone(pS(this._zod.def,{catchall:eO()}))},strip(){return this.clone(pS(this._zod.def,{catchall:void 0}))},extend(e){return MS(this,e)},safeExtend(e){return PS(this,e)},merge(e){return FS(this,e)},pick(e){return kS(this,e)},omit(e){return jS(this,e)},partial(...e){return IS(gO,this,e[0])},exactPartial(...e){return IS(vO,this,e[0],`exactPartial`)},required(...e){return LS(EO,this,e[0])}});function iO(e,t){return new rO({type:`object`,shape:e??{},...wS(t)})}function aO(e,t){return new rO({type:`object`,shape:e,catchall:QD(),...wS(t)})}var oO=$(`ZodUnion`,(e,t)=>{VT.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dD(e,t,n,r),e.options=t.options});function sO(e,t){return new oO({type:`union`,options:e,...wS(t)})}var cO=$(`ZodIntersection`,(e,t)=>{HT.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fD(e,t,n,r)});function lO(e,t){return new cO({type:`intersection`,left:e,right:t})}var uO=$(`ZodEnum`,(e,t)=>{GT.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iD(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new uO({...t,checks:[],...wS(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new uO({...t,checks:[],...wS(r),entries:i})}});function dO(e,t){return new uO({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...wS(t)})}var fO=$(`ZodLiteral`,(e,t)=>{KT.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>aD(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function pO(e,t){return new fO({type:`literal`,values:Array.isArray(e)?e:[e],...wS(t)})}var mO=$(`ZodTransform`,(e,t)=>{DD(),qT.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sD(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new mC(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(YS(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(YS(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function hO(e){return new mO({type:`transform`,transform:e})}var gO=$(`ZodOptional`,(e,t)=>{YT.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>SD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _O(e){return new gO({type:`optional`,innerType:e})}var vO=$(`ZodExactOptional`,(e,t)=>{jee.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>SD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function yO(e){return new vO({type:`optional`,innerType:e})}var bO=$(`ZodNullable`,(e,t)=>{Mee.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xO(e){return new bO({type:`nullable`,innerType:e})}var SO=$(`ZodDefault`,(e,t)=>{Nee.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_D(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function CO(e,t){return new SO({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():bS(t)}})}var wO=$(`ZodPrefault`,(e,t)=>{Pee.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function TO(e,t){return new wO({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():bS(t)}})}var EO=$(`ZodNonOptional`,(e,t)=>{Fee.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function DO(e,t){return new EO({type:`nonoptional`,innerType:e,...wS(t)})}var OO=$(`ZodCatch`,(e,t)=>{Iee.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function kO(e,t){return new OO({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:cC(t)})}var AO=$(`ZodPipe`,(e,t)=>{Lee.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bD(e,t,n,r),e.in=t.in,e.out=t.out});function jO(e,t){return new AO({type:`pipe`,in:e,out:t})}var MO=$(`ZodReadonly`,(e,t)=>{Ree.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xD(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function NO(e){return new MO({type:`readonly`,innerType:e})}var PO=$(`ZodCustom`,(e,t)=>{zee.init(e,t),OD.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oD(e,t,n,r)});function FO(e,t={}){return Fte(PO,e,t)}function IO(e,t){return CE(e,t)}var LO=aO({frame:AD(),session:AD(),agent:AD(),tag:AD(),claimedAt:AD(),expiresAt:AD()});function RO(e,t){return t===e||t.startsWith(`${e}/`)}aO({version:pO(1),claims:nO(LO)});var zO=class extends Error{reason;constructor(e){super(`The waiting edit was ${e}.`),this.reason=e,this.name=`WaitDropped`}},BO=1e3,VO=N()(()=>({edits:[]})),HO=new Set,UO=1;function WO(){return F(VO,e=>e.edits)}function GO(e,t,{live:n=R_,replace:r,dropWhen:i}){r&&XO(e,r);let a=()=>Object.values(n.getState().claims).filter(t=>e.some(e=>RO(e,t.frame))),o=a();return o.length===0?null:YO({label:t,refs:e,replace:r,dropWhen:i,live:n,holders:o.map(({frame:e,tag:t,claimedAt:n})=>({frame:e,tag:t,claimedAt:n})),ready:()=>n.getState().connected&&a().length===0})}function KO(e,t,{live:n=R_,replace:r,dropWhen:i}={}){let{frame:a,tag:o,claimedAt:s,expiresAt:c}=e.details;if(typeof a!=`string`)return Promise.reject(e);let l={frame:a,tag:typeof o==`string`?o:a,claimedAt:typeof s==`string`?s:new Date().toISOString()},u=typeof c==`string`?Date.parse(c):NaN,d=Date.now(),f=!1;return r&&XO([a],r),YO({label:t,refs:[a],replace:r,dropWhen:i,live:n,holders:[l],ready:()=>{let{claims:e,connected:t}=n.getState();if(a in e&&(f=!0),!t||a in e)return!1;let r=Date.now();return f||r>=u||r-d>=2e3}})}async function qO(e,t,n,r={}){let i=GO(e,t,r);for(i&&await i;;)try{return await n()}catch(e){if(!(e instanceof Zx)||e.code!==`frame-claimed`)throw e;await KO(e,t,r)}}function JO(){for(let e of[...HO])ZO(e,new zO(`cancelled`))}function YO({label:e,refs:t,replace:n,dropWhen:r,live:i,holders:a,ready:o}){return new Promise((s,c)=>{let l={id:UO++,label:e,holders:a},u=()=>{r?.(i.getState())?ZO(p,new zO(`cancelled`)):o()&&(ZO(p),s())},d=i.subscribe(u),f=setInterval(u,BO),p={edit:l,refs:t,replace:n,reject:c,stop:()=>{d(),clearInterval(f)}};HO.add(p),VO.setState(e=>({edits:[...e.edits,l]})),u()})}function XO(e,t){for(let n of[...HO])n.replace===t&&n.refs.every(t=>e.includes(t))&&ZO(n,new zO(`replaced`))}function ZO(e,t){HO.delete(e)&&(e.stop(),VO.setState(t=>({edits:t.edits.filter(t=>t!==e.edit)})),t&&e.reject(t))}function QO(e=fetch){let t=(t,n)=>Qx(t,n,`POST`,e),n=(e,n,r,i)=>qO(e,n,()=>t(r,i));return{addProject:e=>t(`/api/project/add`,{name:e}),renameProject:(e,n)=>t(`/api/project/rename`,{ref:e,name:n}),duplicateProject:e=>t(`/api/project/duplicate`,{ref:e}),deleteProject:e=>t(`/api/project/delete`,{ref:e}),groupProjects:(e,n)=>t(`/api/project/group`,{refs:e,group:n}),archiveProjects:(e,n)=>t(`/api/project/archive`,{refs:e,archived:n}),projectTokens:(e,n)=>t(`/api/project/tokens`,{ref:e,...n}),addPage:(e,n)=>t(`/api/page/add`,{ref:e,index:n}),duplicatePage:e=>t(`/api/page/duplicate`,{ref:e}),renamePage:(e,t)=>n([e],`rename`,`/api/page/rename`,{ref:e,name:t}),movePage:(e,n)=>t(`/api/page/move`,{ref:e,index:n}),deletePage:e=>n([e],`delete`,`/api/page/delete`,{ref:e}),addFrame:(e,n,r,i)=>t(`/api/frame/add`,{ref:e,...n,x:r,y:i}),duplicateFrames:(e,n)=>t(`/api/frame/duplicate`,{refs:e,offset:n}),renameFrame:(e,t)=>n([e],`rename`,`/api/frame/rename`,{ref:e,name:t}),fitFrame:e=>n([e],`resize`,`/api/frame/fit`,{ref:e}),orderFrame:(e,n)=>t(`/api/frame/order`,{ref:e,index:n}),flagFrames:(e,n,r)=>t(`/api/frame/flag`,{refs:e,flag:n,on:r}),deleteFrames:e=>n(e,`delete`,`/api/frame/delete`,{refs:e}),copyFrames:e=>t(`/api/clipboard/copy`,{refs:e}),cutFrames:e=>n(e,`cut`,`/api/clipboard/cut`,{refs:e}),pasteFrames:(e,n)=>t(`/api/clipboard/paste`,{ref:e,at:n}),addSection:(e,n,r)=>t(`/api/section/add`,{page:e,name:r,box:n}),renameSection:(e,n,r)=>t(`/api/section/rename`,{page:e,section:n,name:r}),deleteSection:(e,n)=>t(`/api/section/delete`,{page:e,section:n}),undo:()=>t(`/api/undo`,{}),redo:()=>t(`/api/redo`,{})}}var $O=QO();function ek(e,t){return e.toLowerCase()===t.toLowerCase()}function tk(e,t){let n=new Set([...t].map(e=>e.toLowerCase()));if(!n.has(e.toLowerCase()))return e;for(let t=2;;t++){let r=`${e}-${t}`;if(!n.has(r.toLowerCase()))return r}}var nk=N()(()=>({ref:null}));function rk(){return F(nk,e=>e.ref)}function ik(e){nk.setState({ref:e})}function ak(){nk.setState({ref:null})}function ok(e){return t=>{t instanceof zO||n_.add({title:e,description:t instanceof Error?t.message:String(t),type:`error`})}}function sk(e){for(let t=e.length+1;;t++){let n=`page-${t}`;if(!e.some(e=>ek(e,n)))return n}}async function ck(e,t,{current:n,navigate:r,calls:i=$O}){try{let a=await i.renamePage(e.ref,t);e.name===n&&r(q_(e.project,a.name))}catch(t){ok(`Couldn't rename ${e.name}`)(t)}}async function lk(e,t,{current:n,navigate:r,calls:i=$O}){let a=t.filter(t=>t.ref!==e.ref),o=a[e.index]??a[e.index-1];try{await i.deletePage(e.ref)}catch(t){ok(`Couldn't delete ${e.name}`)(t);return}e.name===n&&r(o?q_(e.project,o.name):`/p/${encodeURIComponent(e.project)}`)}function uk(e,t,n=$O){let[,r]=Va();(0,_.useEffect)(()=>{let i=()=>R_.getState().board?.projects.find(t=>t.name===e)?.pages??[],a=()=>i().find(e=>e.name===t),o=()=>R_.getState().canWrite,s=()=>o()&&a()!==void 0,c=e=>r(q_(e.project,e.name)),l=ye([{id:`page.new`,label:`Add page`,group:`page`,command:{label:`Add page`,icon:bn},enabled:o,run:()=>{let t=i().map(e=>e.name),r=a();n.addPage(`${e}/${sk(t)}`,r?r.index+1:void 0).then(e=>{c(e),ik(e.ref)},ok(`Couldn't add a page`))}},{id:`page.duplicate`,label:`Duplicate page`,group:`page`,command:{label:`Duplicate page`,icon:cn},enabled:s,run:()=>{let e=a();e&&n.duplicatePage(e.ref).then(c,ok(`Couldn't duplicate ${e.name}`))}},{id:`page.rename`,label:`Rename page`,group:`page`,command:{label:`Rename page`,icon:Ir},enabled:s,run:()=>{let e=a();e&&ik(e.ref)}},...[{id:`page.moveUp`,label:`Move up`,named:`Move page up`,by:-1,icon:xt},{id:`page.moveDown`,label:`Move down`,named:`Move page down`,by:1,icon:pt}].map(({id:e,label:t,named:r,by:o,icon:c})=>({id:e,label:t,group:`page`,command:{label:r,icon:c},enabled:()=>{let e=a(),t=e?e.index+o:-1;return s()&&t>=0&&t<i().length},run:()=>{let e=a();e&&n.movePage(e.ref,e.index+o).catch(ok(`Couldn't move ${e.name}`))}})),...[{id:`page.next`,label:`Next page`,by:1,icon:Lt},{id:`page.previous`,label:`Previous page`,by:-1,icon:Vt}].map(({id:e,label:t,by:n,icon:r})=>{let o=()=>{let e=a();return i().find(t=>e&&t.index===e.index+n)};return{id:e,label:t,group:`page`,command:{label:t,icon:r,keywords:[`go to`,`open`]},enabled:()=>o()!==void 0,run:()=>{let e=o();e&&c(e)}}}),{id:`page.delete`,label:`Delete page`,group:`page`,command:{label:`Delete page`,icon:Hi},enabled:s,run:()=>{let e=a();e&&lk(e,i(),{current:e.name,navigate:r,calls:n})}}]),u=R_.subscribe((e,t)=>{(e.canWrite!==t.canWrite||e.board!==t.board)&&G()});return()=>{u(),l()}},[e,t,r,n])}function dk(e){return e.trim().toLowerCase()}function fk(e){let t=[],n=new Map;for(let r of e){if(r.group===null){t.push({kind:`project`,project:r});continue}let e=dk(r.group),i=n.get(e);if(i){i.projects.push(r),r.modifiedAt>i.modifiedAt&&(i.modifiedAt=r.modifiedAt);continue}let a={key:e,name:r.group,projects:[r],modifiedAt:r.modifiedAt};n.set(e,a),t.push({kind:`folder`,folder:a})}return t}function pk(e){let t=new Map;for(let n of e){if(n.group===null)continue;let e=dk(n.group);t.has(e)||t.set(e,n.group)}return[...t.values()].sort((e,t)=>e.localeCompare(t,`en`,{sensitivity:`base`}))}function mk(e){let t=e.projects.length;return t===1?`1 project`:`${t} projects`}function hk(e){let t=new Set(e.map(dk));for(let e=1;;e+=1){let n=e===1?`Folder`:`Folder ${e}`;if(!t.has(dk(n)))return n}}var gk=`frameboard.home.pins`;function _k(){return(0,_.useSyncExternalStore)(Tk,vk,vk)}function vk(){let e=Ek();return e!==Sk.raw&&(Sk={raw:e,pins:Ok(e)}),Sk.pins}function yk(e){let t=new Set(vk());t.delete(e)||t.add(e),Dk(t)}function bk(e,t){let n=new Set(vk());n.delete(e)&&Dk(n.add(t))}function xk(e){let t=new Set(vk());t.delete(e)&&Dk(t)}var Sk={raw:null,pins:new Set},Ck=null,wk=new Set;function Tk(e){return wk.add(e),()=>wk.delete(e)}function Ek(){if(Ck!==null)return Ck;try{return localStorage.getItem(gk)}catch{return null}}function Dk(e){let t=JSON.stringify([...e]);try{localStorage.setItem(gk,t),Ck=null}catch{Ck=t}for(let e of wk)e();G()}function Ok(e){try{let t=JSON.parse(e??`[]`);return new Set(Array.isArray(t)?t.filter(e=>typeof e==`string`):[])}catch{return new Set}}var kk=N()(()=>({focused:null,folder:null,renaming:null,renamingFolder:null,openFolder:null,pendingRename:null,focusTarget:null}));function Ak(e){return F(kk,t=>t.renaming?.project===e?t.renaming:null)}function jk(e){let{focused:t,folder:n}=kk.getState();(t!==e||n!==null)&&(kk.setState({focused:e,folder:null}),G())}function Mk(e){let{focused:t,folder:n}=kk.getState();(n!==e||t!==null)&&(kk.setState({focused:null,folder:e}),G())}function Nk(e){return F(kk,t=>t.renamingFolder?.folder===e?t.renamingFolder:null)}function Pk(e,t){kk.setState({renamingFolder:{folder:e,draft:t,refusal:null,attempt:0}})}function Fk(){kk.setState({renamingFolder:null})}function Ik(){return R_.getState().board?.projects??[]}function Lk(e){return Ik().filter(t=>t.group!==null&&dk(t.group)===e)}async function Rk(e,t,n=$O){try{return await n.groupProjects(e,t),!0}catch(n){let r=e.length===1?e[0]:`the projects`;return ok(t===null?`Couldn't take ${r} out of its folder`:`Couldn't move ${r} to ${t}`)(n),!1}}async function zk(e,t,n=$O){try{await n.archiveProjects(e,t)}catch(n){let r=e.length===1?e[0]:`the projects`;ok(t?`Couldn't archive ${r}`:`Couldn't restore ${r}`)(n)}}async function Bk(e,t=$O){let n=hk(pk(Ik()));await Rk(e,n,t)&&(Mk(dk(n)),Pk(dk(n),n))}async function nne(e,t,n=$O){let r=pk(Ik()).find(n=>dk(n)===dk(t)&&dk(n)!==e);if(r){kk.setState(({renamingFolder:e})=>({renamingFolder:e&&{...e,draft:t,refusal:`A folder named ${r} already exists.`,attempt:e.attempt+1}}));return}Fk();let i=Lk(e).map(e=>e.name),a=dk(t),o=kk.getState().openFolder===e;o&&kk.setState({openFolder:a,pendingRename:{from:e,to:a}}),await Rk(i,t,n)?Mk(a):o&&kk.setState({openFolder:e,pendingRename:null})}function rne(e){let{openFolder:t,pendingRename:n}=kk.getState();n&&e.has(n.to)?kk.setState({pendingRename:null}):t===null||e.has(t)||n?.to!==t&&kk.setState({openFolder:null})}async function Vk(e,t=$O){let n=Lk(e).map(e=>e.name);if(!await Rk(n,null,t))return;let r=n[0]??null;kk.setState({openFolder:null,focusTarget:r}),r&&jk(r)}function Hk(e){kk.setState({renaming:{project:e,draft:e,refusal:null,attempt:0}})}function Uk(){kk.setState({renaming:null})}function Wk({name:e,pages:t}){let n=t[0];return n?q_(e,n.name):`/p/${encodeURIComponent(e)}`}async function Gk(e,t,n=$O){kk.setState(({renaming:e})=>({renaming:e&&{...e,draft:t}}));try{await n.renameProject(e,t)}catch(t){return t instanceof Zx&&t.code===`invalid-name`?(kk.setState(({renaming:e})=>({renaming:e&&{...e,refusal:t.message,attempt:e.attempt+1}})),null):(Uk(),ok(`Couldn't rename ${e}`)(t),null)}return bk(e,t),Uk(),jk(t),t}function ine(){return kk.getState().focused}function ane(e=$O){(0,_.useEffect)(()=>{let t=()=>R_.getState().canWrite,n=()=>{let e=kk.getState().focused;return Ik().find(t=>t.name===e)},r=()=>{let e=kk.getState().folder,t=e===null?[]:Lk(e),n=t[0];return e!==null&&n?.group?{key:e,name:n.group,members:t}:void 0},i=()=>n()?.name??``,a=()=>r()?.name??``,o=ye([{id:`project.group`,label:`New folder`,group:`project`,command:{label:`Move project to a new folder`,icon:An,hint:i},enabled:()=>t()&&n()!==void 0,run:()=>{let t=n();t&&Bk([t.name],e)}},{id:`project.ungroup`,label:`Remove from folder`,group:`project`,command:{label:`Remove project from its folder`,icon:En,hint:i},enabled:()=>t()&&(n()?.group??null)!==null,run:()=>{let t=n();t&&Rk([t.name],null,e)}},{id:`project.archive`,label:`Archive`,group:`project`,command:{label:`Archive project`,icon:lt,hint:i},enabled:()=>t()&&n()?.archived===!1,run:()=>{let t=n();t&&zk([t.name],!0,e)}},{id:`project.restore`,label:`Restore`,group:`project`,command:{label:`Restore archived project`,icon:st,hint:i},enabled:()=>t()&&n()?.archived===!0,run:()=>{let t=n();t&&zk([t.name],!1,e)}},{id:`folder.rename`,label:`Rename`,group:`project`,command:{label:`Rename folder`,icon:Ir,hint:a},enabled:()=>t()&&r()!==void 0,run:()=>{let e=r();e&&Pk(e.key,e.name)}},{id:`folder.ungroup`,label:`Ungroup`,group:`project`,command:{label:`Ungroup folder`,icon:On,hint:a},enabled:()=>t()&&r()!==void 0,run:()=>{let t=r();t&&Vk(t.key,e)}}]),s=R_.subscribe((e,t)=>{(e.canWrite!==t.canWrite||e.board!==t.board)&&G()});return()=>{s(),o(),kk.setState({folder:null,renamingFolder:null,openFolder:null,pendingRename:null,focusTarget:null})}},[e])}function one(e){(0,_.useEffect)(()=>ye([{id:`nav.home`,label:`All projects`,group:`project`,command:{label:`Go to all projects`,icon:Bn},keys:[`Alt+ArrowUp`],run:e}]),[e])}function Kk(e=$O,t){(0,_.useEffect)(()=>{let n=ye([{id:`project.new`,label:`New project`,group:`project`,command:{label:`New project`,icon:An},enabled:()=>R_.getState().canWrite,run:()=>{t?.(),e.addProject().then(e=>{jk(e.name),Hk(e.name)},ok(`Couldn't add a project`))}}]),r=R_.subscribe((e,t)=>{e.canWrite!==t.canWrite&&G()});return()=>{r(),n()}},[e,t])}function qk(e,{calls:t=$O,onDeleted:n}={}){let[,r]=Va();(0,_.useEffect)(()=>{let i=()=>R_.getState().canWrite,a=()=>{let t=e();return R_.getState().board?.projects.find(e=>e.name===t)},o=()=>i()&&a()!==void 0,s=()=>a()?.name??``,c=ye([{id:`project.open`,label:`Open`,group:`project`,palette:!1,enabled:()=>a()!==void 0,run:()=>{let e=a();e&&r(Wk(e))}},{id:`project.rename`,label:`Rename`,group:`project`,command:{label:`Rename project`,icon:Ir,hint:s},enabled:o,run:()=>{let e=a();e&&Hk(e.name)}},{id:`project.duplicate`,label:`Duplicate`,group:`project`,command:{label:`Duplicate project`,icon:cn,hint:s},enabled:o,run:()=>{let e=a();e&&t.duplicateProject(e.name).then(e=>jk(e.name),ok(`Couldn't duplicate ${e.name}`))}},{id:`project.pin`,label:`Pin`,group:`project`,command:{label:`Pin project`,icon:Hr,hint:s},enabled:()=>a()!==void 0,checked:()=>vk().has(e()??``),run:()=>{let e=a();e&&yk(e.name)}},{id:`project.delete`,label:`Delete`,group:`project`,command:{label:`Delete project`,icon:Hi,hint:s},enabled:o,run:()=>{let e=a();e&&t.deleteProject(e.name).then(()=>{xk(e.name),n?.()},ok(`Couldn't delete ${e.name}`))}}]),l=R_.subscribe((e,t)=>{(e.canWrite!==t.canWrite||e.board!==t.board)&&G()});return()=>{l(),c(),kk.setState({focused:null,renaming:null})}},[t,r,e,n])}var sne=[`all`,`images`,`video`,`fonts`,`other`],cne={all:`All`,images:`Images`,video:`Video`,fonts:`Fonts`,other:`Other`};function Jk(e){switch(e){case`image`:case`gif`:case`svg`:return`images`;case`video`:return`video`;case`font`:return`fonts`;default:return`other`}}function lne(e){return sne.map(t=>({chip:t,count:t===`all`?e.length:e.filter(e=>Jk(e.kind)===t).length})).filter(({chip:e,count:t})=>e===`all`||t>0)}function une(e,{chip:t,search:n}){let r=n.trim().toLowerCase(),i=new Map;for(let n of e){if(t!==`all`&&Jk(n.kind)!==t||r!==``&&!n.path.toLowerCase().includes(r))continue;let e=dne(n.path),a=i.get(e);a?a.push(n):i.set(e,[n])}return[...i].map(([e,t])=>({folder:e,files:t})).sort((e,t)=>pne(e.folder,t.folder))}function dne(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function fne(e){return e.slice(e.lastIndexOf(`/`)+1)}function pne(e,t){return e===``||t===``?e===``?t===``?0:-1:1:e.toLowerCase().localeCompare(t.toLowerCase())}async function Yk(e){let t=await(await fetch(`/api/projects/${encodeURIComponent(e)}/assets`)).json();return t.ok?t.data:null}function mne(e){if(Array.isArray(e))return e}function hne(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Xk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Zk(e,t){if(e){if(typeof e==`string`)return Xk(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xk(e,t):void 0}}function gne(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
64
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qk(e,t){return mne(e)||hne(e,t)||Zk(e,t)||gne()}var $k=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bind=void 0;function t(e,t){var n=t.type,r=t.listener,i=t.options;return e.addEventListener(n,r,i),function(){e.removeEventListener(n,r,i)}}e.bind=t})),_ne=o(((e,t,n)=>{var r=n&&n.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=void 0;var i=$k();function a(e){if(e!==void 0)return typeof e==`boolean`?{capture:e}:e}function o(e,t){return t==null?e:r(r({},e),{options:r(r({},a(t)),a(e.options))})}function s(e,t,n){var r=t.map(function(t){var r=o(t,n);return(0,i.bind)(e,r)});return function(){r.forEach(function(e){return e()})}}e.bindAll=s})),eA=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=e.bind=void 0;var t=$k();Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return t.bind}});var n=_ne();Object.defineProperty(e,"bindAll",{enumerable:!0,get:function(){return n.bindAll}})}))(),vne=`data-pdnd-honey-pot`;function tA(e){return e instanceof Element&&e.hasAttribute(`data-pdnd-honey-pot`)}function nA(e){var t=Qk(document.elementsFromPoint(e.x,e.y),2),n=t[0],r=t[1];return n?tA(n)?r??null:n:null}function rA(e){"@babel/helpers - typeof";return rA=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},rA(e)}function iA(e,t){if(rA(e)!=`object`||!e)return e;var n;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==void 0){var r=n.call(e,t||`default`);if(rA(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function aA(e){var t=iA(e,`string`);return rA(t)==`symbol`?t:t+``}function oA(e,t,n){return(t=aA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var sA=2147483647,cA={inset:`unset`,border:`none`,padding:0,margin:0,overflow:`visible`,color:`inherit`,background:`transparent`,width:`auto`,height:`auto`};function lA(e){var t=null;return function(){if(!t){var n=[...arguments];t={result:e.apply(this,n)}}return t.result}}var uA=lA(function(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype.showPopover==`function`});function dA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dA(Object(n),!0).forEach(function(t){oA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var pA=2,mA=pA/2;function hA(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function gA(e){return{x:e.x-mA,y:e.y-mA}}function _A(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function vA(e){return{x:Math.min(e.x,window.innerWidth-pA),y:Math.min(e.y,window.innerHeight-pA)}}function yA(e){var t=e.client,n=vA(_A(gA(hA(t))));return DOMRect.fromRect({x:n.x,y:n.y,width:pA,height:pA})}function bA(e){var t=e.clientRect;return{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`}}function xA(e){var t=e.client,n=e.clientRect;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function SA(e){var t=e.initial,n=document.createElement(`div`);n.setAttribute(vne,`true`),uA()&&n.setAttribute(`popover`,`manual`);var r=yA({client:t});Object.assign(n.style,fA(fA({position:`fixed`},uA()?cA:{zIndex:sA}),{},{backgroundColor:`transparent`,padding:0,margin:0,boxSizing:`border-box`,pointerEvents:`auto`},bA({clientRect:r}))),document.body.appendChild(n),uA()&&n.showPopover();var i=(0,eA.bind)(window,{type:`pointermove`,listener:function(e){r=yA({client:{x:e.clientX,y:e.clientY}}),Object.assign(n.style,bA({clientRect:r}))},options:{capture:!0}});return function(e){var t=e.current;if(i(),xA({client:t,clientRect:r})){n.remove();return}function a(){o(),n.remove()}var o=(0,eA.bindAll)(window,[{type:`pointerdown`,listener:a},{type:`pointermove`,listener:a},{type:`focusin`,listener:a},{type:`focusout`,listener:a},{type:`dragstart`,listener:a},{type:`dragenter`,listener:a},{type:`dragover`,listener:a}],{capture:!0})}}function CA(){var e=null;function t(){return e=null,(0,eA.bind)(window,{type:`pointermove`,listener:function(t){e={x:t.clientX,y:t.clientY}},options:{capture:!0}})}function n(){var t=null;return function(n){var r=n.eventName,i=n.payload;if(r===`onDragStart`){var a=i.location.initial.input;t=SA({initial:e??{x:a.clientX,y:a.clientY}})}if(r===`onDrop`){var o,s=i.location.current.input;(o=t)==null||o({current:{x:s.clientX,y:s.clientY}}),t=null,e=null}}}return{bindEvents:t,getOnPostDispatch:n}}function wA(e){if(Array.isArray(e))return Xk(e)}function TA(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function EA(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
65
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DA(e){return wA(e)||TA(e)||Zk(e)||EA()}var OA=lA(function(){return navigator.userAgent.includes(`Firefox`)}),kA=lA(function(){var e=navigator.userAgent;return e.includes(`AppleWebKit`)&&!e.includes(`Chrome`)});function AA(e){return`nodeName`in e}function jA(e){return AA(e)&&e.ownerDocument!==document}var MA={isLeavingWindow:Symbol(`leaving`),isEnteringWindow:Symbol(`entering`)};(function(){if(typeof window>`u`||!kA())return;function e(){return{enterCount:0,isOverWindow:!1}}var t=e();function n(){t=e()}(0,eA.bindAll)(window,[{type:`dragstart`,listener:function(){t.enterCount=0,t.isOverWindow=!0}},{type:`drop`,listener:n},{type:`dragend`,listener:n},{type:`dragenter`,listener:function(e){!t.isOverWindow&&t.enterCount===0&&(e[MA.isEnteringWindow]=!0),t.isOverWindow=!0,t.enterCount++}},{type:`dragleave`,listener:function(e){t.enterCount--,t.isOverWindow&&t.enterCount===0&&(e[MA.isLeavingWindow]=!0,t.isOverWindow=!1)}}],{capture:!0})})();function NA(e){var t=e.dragLeave;return kA()?t.hasOwnProperty(MA.isLeavingWindow):!1}function PA(e){var t=e.dragLeave,n=t.type,r=t.relatedTarget;return n===`dragleave`?kA()?NA({dragLeave:t}):r==null?!0:OA()?jA(r):r instanceof HTMLIFrameElement:!1}function FA(e){var t=e.onDragEnd;return[{type:`pointermove`,listener:function(){var e=0;return function(){e<20?e++:t()}}()},{type:`pointerdown`,listener:t}]}function IA(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var LA=function(e){var t=[],n=null,r=function(){t=[...arguments],!n&&(n=requestAnimationFrame(function(){n=null,e.apply(void 0,t)}))};return r.cancel=function(){n&&=(cancelAnimationFrame(n),null)},r}(function(e){return e()}),RA=function(){var e=null;function t(t){e={frameId:requestAnimationFrame(function(){e=null,t()}),fn:t}}function n(){e&&=(cancelAnimationFrame(e.frameId),e.fn(),null)}return{schedule:t,flush:n}}();function zA(e){var t=e.source,n=e.initial,r=e.dispatchEvent,i={dropTargets:[]};function a(e){r(e),i={dropTargets:e.payload.location.current.dropTargets}}return{start:function(e){var r=e.nativeSetDragImage,o={current:n,previous:i,initial:n};a({eventName:`onGenerateDragPreview`,payload:{source:t,location:o,nativeSetDragImage:r}}),RA.schedule(function(){a({eventName:`onDragStart`,payload:{source:t,location:o}})})},dragUpdate:function(e){var r=e.current;RA.flush(),LA.cancel(),a({eventName:`onDropTargetChange`,payload:{source:t,location:{initial:n,previous:i,current:r}}})},drag:function(e){var r=e.current;LA(function(){RA.flush(),a({eventName:`onDrag`,payload:{source:t,location:{initial:n,previous:i,current:r}}})})},drop:function(e){var r=e.current,o=e.updatedSourcePayload;RA.flush(),LA.cancel(),a({eventName:`onDrop`,payload:{source:o??t,location:{current:r,previous:i,initial:n}}})}}}var BA={isActive:!1};function VA(){return!BA.isActive}function HA(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function UA(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var r=0;r<t.length;r++)if(t[r].element!==n[r].element)return!0;return!1}function WA(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=e.dispatchEvent;if(!VA())return;var a=KA({event:t,dragType:n,getDropTargetsOver:r});BA.isActive=!0;var o={current:a};GA({event:t,current:a.dropTargets});var s=zA({source:n.payload,dispatchEvent:i,initial:a});function c(e){var t=UA({current:o.current.dropTargets,next:e.dropTargets});o.current=e,t&&s.dragUpdate({current:o.current})}function l(e){var t=IA(e),i=r({target:tA(e.target)?nA({x:t.clientX,y:t.clientY}):e.target,input:t,source:n.payload,current:o.current.dropTargets});i.length&&(e.preventDefault(),GA({event:e,current:i})),c({dropTargets:i,input:t})}function u(){o.current.dropTargets.length&&c({dropTargets:[],input:o.current.input}),s.drop({current:o.current,updatedSourcePayload:null}),d()}function d(){BA.isActive=!1,f()}var f=(0,eA.bindAll)(window,[{type:`dragover`,listener:function(e){l(e),s.drag({current:o.current})}},{type:`dragenter`,listener:l},{type:`dragleave`,listener:function(e){PA({dragLeave:e})&&(c({input:o.current.input,dropTargets:[]}),n.startedFrom===`external`&&u())}},{type:`drop`,listener:function(e){o.current={dropTargets:o.current.dropTargets,input:IA(e)},o.current.dropTargets.length?(e.preventDefault(),GA({event:e,current:o.current.dropTargets}),s.drop({current:o.current,updatedSourcePayload:n.type===`external`?n.getDropPayload(e):null}),d()):u()}},{type:`dragend`,listener:function(e){o.current={dropTargets:o.current.dropTargets,input:IA(e)},u()}}].concat(DA(FA({onDragEnd:u}))),{capture:!0});s.start({nativeSetDragImage:HA(t)})}function GA(e){var t=e.event,n=e.current[0]?.dropEffect;n!=null&&t.dataTransfer&&(t.dataTransfer.dropEffect=n)}function KA(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=IA(t);return n.startedFrom===`external`?{input:i,dropTargets:[]}:{input:i,dropTargets:r({input:i,source:n.payload,target:t.target,current:[]})}}var qA={canStart:VA,start:WA},JA=new Map;function YA(e){var t=e.typeKey,n=e.mount,r=JA.get(t);if(r)return r.usageCount++,r;var i={typeKey:t,unmount:n(),usageCount:1};return JA.set(t,i),i}function XA(e){var t=YA(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),JA.delete(e.typeKey))}}function ZA(){var e=[...arguments];return function(){e.forEach(function(e){return e()})}}function QA(e,t){var n=t.attribute,r=t.value;return e.setAttribute(n,r),function(){return e.removeAttribute(n)}}function $A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ej(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?$A(Object(n),!0).forEach(function(t){oA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$A(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tj(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=nj(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
66
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function nj(e,t){if(e){if(typeof e==`string`)return rj(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rj(e,t):void 0}}function rj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ij(e){return e.slice(0).reverse()}function aj(e){var t=e.typeKey,n=e.defaultDropEffect,r=new WeakMap,i=`data-drop-target-for-${t}`,a=`[${i}]`;function o(e){return r.set(e.element,e),function(){return r.delete(e.element)}}function s(e){return lA(ZA(QA(e.element,{attribute:i,value:`true`}),o(e)))}function c(e){var t=e.source,i=e.target,o=e.input,s=e.result,l=s===void 0?[]:s;if(i==null)return l;if(!(i instanceof Element))return i instanceof Node?c({source:t,target:i.parentElement,input:o,result:l}):l;var u=i.closest(a);if(u==null)return l;var d=r.get(u);if(d==null)return l;var f={input:o,source:t,element:d.element};if(d.canDrop&&!d.canDrop(f))return c({source:t,target:d.element.parentElement,input:o,result:l});var p=d.getData?.call(d,f)??{},m=d.getDropEffect?.call(d,f)??n,h={data:p,element:d.element,dropEffect:m,isActiveDueToStickiness:!1};return c({source:t,target:d.element.parentElement,input:o,result:[].concat(DA(l),[h])})}function l(e){var t=e.eventName,n=e.payload,i=tj(n.location.current.dropTargets),a;try{for(i.s();!(a=i.n()).done;){var o,s=a.value,c=r.get(s.element),l=ej(ej({},n),{},{self:s});c==null||(o=c[t])==null||o.call(c,l)}}catch(e){i.e(e)}finally{i.f()}}var u={onGenerateDragPreview:l,onDrag:l,onDragStart:l,onDrop:l,onDropTargetChange:function(e){var t=e.payload,n=new Set(t.location.current.dropTargets.map(function(e){return e.element})),i=new Set,a=tj(t.location.previous.dropTargets),o;try{for(a.s();!(o=a.n()).done;){var s,c=o.value;i.add(c.element);var l=r.get(c.element),u=n.has(c.element),d=ej(ej({},t),{},{self:c});if(l==null||(s=l.onDropTargetChange)==null||s.call(l,d),!u){var f;l==null||(f=l.onDragLeave)==null||f.call(l,d)}}}catch(e){a.e(e)}finally{a.f()}var p=tj(t.location.current.dropTargets),m;try{for(p.s();!(m=p.n()).done;){var h,g,_=m.value;if(!i.has(_.element)){var v=ej(ej({},t),{},{self:_}),y=r.get(_.element);y==null||(h=y.onDropTargetChange)==null||h.call(y,v),y==null||(g=y.onDragEnter)==null||g.call(y,v)}}}catch(e){p.e(e)}finally{p.f()}}};function d(e){u[e.eventName](e)}function f(e){var t=e.source,n=e.target,i=e.input,a=e.current,o=c({source:t,target:n,input:i});if(o.length>=a.length)return o;for(var s=ij(a),l=ij(o),u=[],d=0;d<s.length;d++){var f,p=s[d],m=l[d];if(m!=null)u.push(m);else{var h=u[d-1],g=s[d-1];if(h?.element!==g?.element)break;var _=r.get(p.element);if(!_)break;var v={input:i,source:t,element:_.element};if(_.canDrop&&!_.canDrop(v)||!((f=_.getIsSticky)!=null&&f.call(_,v)))break;u.push(ej(ej({},p),{},{isActiveDueToStickiness:!0}))}}return ij(u)}return{dropTargetForConsumers:s,getIsOver:f,dispatchEvent:d}}function oj(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=sj(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
67
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function sj(e,t){if(e){if(typeof e==`string`)return cj(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cj(e,t):void 0}}function cj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function lj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?lj(Object(n),!0).forEach(function(t){oA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dj(){var e=new Set,t=null;function n(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}function r(r){var i=uj({},r);e.add(i),n(i);function a(){e.delete(i),t&&t.active.delete(i)}return lA(a)}function i(r){var i=r.eventName,a=r.payload;if(i===`onGenerateDragPreview`){t={canMonitorArgs:{initial:a.location.initial,source:a.source},active:new Set};var o=oj(e),s;try{for(o.s();!(s=o.n()).done;){var c=s.value;n(c)}}catch(e){o.e(e)}finally{o.f()}}if(t){for(var l=Array.from(t.active),u=0,d=l;u<d.length;u++){var f=d[u];if(t.active.has(f)){var p;(p=f[i])==null||p.call(f,a)}}i===`onDrop`&&(t.active.clear(),t=null)}}return{dispatchEvent:i,monitorForConsumers:r}}function fj(e){var t=e.typeKey,n=e.mount,r=e.dispatchEventToSource,i=e.onPostDispatch,a=e.defaultDropEffect,o=dj(),s=aj({typeKey:t,defaultDropEffect:a});function c(e){r?.(e),s.dispatchEvent(e),o.dispatchEvent(e),i?.(e)}function l(e){var t=e.event,n=e.dragType;qA.start({event:t,dragType:n,getDropTargetsOver:s.getIsOver,dispatchEvent:c})}function u(){function e(){return n({canStart:qA.canStart,start:l})}return XA({typeKey:t,mount:e})}return{registerUsage:u,dropTarget:s.dropTargetForConsumers,monitor:o.monitorForConsumers}}var pj=lA(function(){return navigator.userAgent.toLocaleLowerCase().includes(`android`)}),mj=`pdnd:android-fallback`,hj=`text/plain`,gj=`application/vnd.pdnd`,_j=new WeakMap;function vj(e){return _j.set(e.element,e),function(){_j.delete(e.element)}}var yj=CA(),bj=fj({typeKey:`element`,defaultDropEffect:`move`,mount:function(e){return ZA(yj.bindEvents(),(0,eA.bind)(document,{type:`dragstart`,listener:function(t){if(e.canStart(t)&&!t.defaultPrevented&&t.dataTransfer){var n=t.target;if(n instanceof HTMLElement){var r=_j.get(n);if(r){var i=IA(t),a={element:r.element,dragHandle:r.dragHandle??null,input:i};if(r.canDrag&&!r.canDrag(a))t.preventDefault();else{if(r.dragHandle){var o=nA({x:i.clientX,y:i.clientY});if(!r.dragHandle.contains(o)){t.preventDefault();return}}var s=r.getInitialDataForExternal?.call(r,a)??null;if(s)for(var c=0,l=Object.entries(s);c<l.length;c++){var u=Qk(l[c],2),d=u[0],f=u[1];t.dataTransfer.setData(d,f??``)}pj()&&!t.dataTransfer.types.includes(`text/plain`)&&!t.dataTransfer.types.includes(`text/uri-list`)&&t.dataTransfer.setData(hj,mj),t.dataTransfer.setData(gj,``);var p={type:`element`,payload:{element:r.element,dragHandle:r.dragHandle??null,data:r.getInitialData?.call(r,a)??{}},startedFrom:`internal`};e.start({event:t,dragType:p})}}}}}}))},dispatchEventToSource:function(e){var t,n,r=e.eventName,i=e.payload;(t=_j.get(i.source.element))==null||(n=t[r])==null||n.call(t,i)},onPostDispatch:yj.getOnPostDispatch()}),xj=bj.dropTarget,Sj=bj.monitor;function Cj(e){return lA(ZA(bj.registerUsage(),vj(e),QA(e.element,{attribute:`draggable`,value:`true`})))}var wj=[`image`,`gif`,`svg`,`video`];function Tj(e){return wj.includes(e)}var Ej={image:`image`,gif:`GIF`,svg:`SVG`,video:`video`,audio:`audio`,font:`font`,stylesheet:`stylesheet`,script:`script`,other:`file`};function Dj(e){if(e<1e3)return`${e} B`;let t=Math.round(e/1e3);if(t<1e3)return`${t} KB`;let n=e/1e6;return n<1e3?`${Oj(n)} MB`:`${Oj(n/1e3)} GB`}function Oj(e){return e.toFixed(1).replace(/\.0$/,``)}function kj({kind:e,size:t}){return`${Ej[e]} · ${Dj(t)}`}function Aj(e){return Ej[e]}function jj({frames:e}){return e===void 0?null:e===0?`Unused`:`${e} ${e===1?`frame`:`frames`}`}function Mj(e){return`../assets/${e.split(`/`).map(encodeURIComponent).join(`/`)}`}function Nj(e,t){let n=t.split(`/`).map(encodeURIComponent).join(`/`);return`/frames/${encodeURIComponent(e)}/assets/${n}`}function Pj(e){return Tj(e.kind)}var Fj=Symbol(`asset-tile`);function Ij(e){return{[Fj]:!0,...e}}function Lj(e){let{project:t,path:n,kind:r}=e;return e[Fj]===!0&&typeof t==`string`&&typeof n==`string`&&Tj(r)?{project:t,path:n,kind:r}:null}var Rj=1500;function zj({project:e,file:t}){let[n,r]=(0,_.useState)(`idle`),i=(0,_.useRef)(void 0);(0,_.useEffect)(()=>()=>clearTimeout(i.current),[]);let a=(0,_.useRef)(null),o=z_(e=>e.canWrite),{path:s,kind:c}=t,l=jj(t);(0,_.useEffect)(()=>{let t=a.current;if(t&&o&&Tj(c))return Cj({element:t,getInitialData:()=>Ij({project:e,path:s,kind:c})})},[e,s,c,o]);async function u(){let e=`copied`;try{await navigator.clipboard.writeText(Mj(t.path))}catch{e=`failed`}r(e),clearTimeout(i.current),i.current=setTimeout(()=>r(`idle`),Rj)}return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{ref:a,type:`button`,onClick:()=>void u(),"aria-label":`Copy path of ${[t.path,Aj(c),Dj(t.size),l].filter(Boolean).join(`, `)}`,className:`group relative block w-full overflow-hidden rounded-lg bg-muted text-left outline-none hover:ring-[1.5px] hover:ring-primary focus-visible:ring-[1.5px] focus-visible:ring-primary`,children:[(0,Z.jsx)(Uj,{project:e,file:t}),(0,Z.jsx)(`span`,{"aria-live":`polite`,className:`absolute top-[5px] right-[5px] rounded-[5px] bg-card px-1.5 py-0.5 text-[10px] text-foreground shadow-[0_1px_3px_rgba(0,0,0,.3)] group-hover:visible group-focus-visible:visible ${n===`idle`?`invisible`:``}`,children:Vj[n]}),(0,Z.jsxs)(`span`,{className:`block truncate px-[7px] py-[5px] text-label font-normal`,children:[(0,Z.jsx)(`span`,{title:t.path,children:fne(t.path)}),(0,Z.jsx)(`span`,{className:`block text-[10px] text-muted-foreground`,children:l===null?kj(t):(0,Z.jsxs)(Z.Fragment,{children:[Aj(c),` ·`,` `,(0,Z.jsx)(`span`,{className:t.frames===0?Bj:void 0,children:l})]})})]})]})})}var Bj=`text-[color-mix(in_oklab,var(--note)_70%,var(--foreground))]`,Vj={idle:`Copy path`,copied:`Copied`,failed:`Copy failed`},Hj=`grid h-[72px] place-items-center text-muted-foreground`;function Uj({project:e,file:t}){switch(t.kind){case`image`:case`gif`:case`svg`:return(0,Z.jsx)(`span`,{className:Hj,children:(0,Z.jsx)(`img`,{src:Nj(e,t.path),alt:``,loading:`lazy`,decoding:`async`,className:`h-[72px] w-full object-cover`})});case`video`:return(0,Z.jsx)(`span`,{className:`${Hj} bg-[#111] text-white`,children:(0,Z.jsx)(Wr,{"aria-hidden":!0,className:`size-4`})});case`audio`:return(0,Z.jsx)(`span`,{className:Hj,children:(0,Z.jsx)(fn,{"aria-hidden":!0,className:`size-4`})});case`font`:return(0,Z.jsx)(`span`,{className:`${Hj} text-[26px] text-foreground`,children:`Aa`});default:return(0,Z.jsx)(`span`,{className:`${Hj} font-mono`,children:`{ }`})}}function Wj(e,t){let n=new FormData;for(let e of t)n.append(`files`,e);return Qx(`/api/projects/${encodeURIComponent(e)}/assets`,n)}var Gj=`font-mono text-label font-normal text-foreground`;function Kj({project:e,load:t=Yk,upload:n=Wj}){let r=z_(e=>e.canWrite),[i,a]=(0,_.useState)(0),o=Qj(e,t,i),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)([]),p=(0,_.useRef)(null),[m,h]=(0,_.useState)(``),[g,v]=(0,_.useState)(`all`),[y,b]=(0,_.useState)(new Set);async function x(t){if(r&&t.length!==0){u(!0);try{let r=await n(e,t);f(r.refused.map(e=>({id:crypto.randomUUID(),text:`${e.name}: ${e.message}`})))}catch(e){f([{id:crypto.randomUUID(),text:e instanceof Error?e.message:String(e)}])}finally{u(!1),a(e=>e+1)}}}function S(e){Xj(e)&&(e.preventDefault(),c(!1),x(Zj(e)))}if(o===void 0)return null;if(o===null)return(0,Z.jsx)(`p`,{className:`m-3 text-muted-foreground`,children:`The assets did not load. Reload the board to try again.`});let C=o.files.length,w=lne(o.files),T=w.some(e=>e.chip===g)?g:`all`,E=une(o.files,{chip:T,search:m}),D=()=>{h(``),v(`all`)},O=e=>b(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,Z.jsxs)(`div`,{"aria-busy":l,onDragEnter:e=>Xj(e)&&c(!0),onDragOver:e=>{Xj(e)&&(e.preventDefault(),c(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||c(!1)},onDrop:S,className:`flex h-full flex-col overflow-y-auto pb-2 ${s&&r?`bg-primary/5 ring-[1.5px] ring-primary ring-inset`:``}`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between pt-2.5 pr-1.5 pb-1 pl-3 text-label text-muted-foreground`,children:[(0,Z.jsxs)(`h3`,{children:[`assets/ · `,C,` `,C===1?`file`:`files`]}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Add files`,disabled:!r,onClick:()=>p.current?.click(),className:`grid size-5 place-items-center rounded-md outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50 disabled:hover:bg-transparent`,children:(0,Z.jsx)(Kr,{"aria-hidden":!0,className:`size-3.5`})}),(0,Z.jsx)(`input`,{ref:p,type:`file`,multiple:!0,hidden:!0,"aria-label":`Choose files to add`,onChange:e=>{let t=[...e.target.files??[]];e.target.value=``,x(t)}})]}),C===0?(0,Z.jsxs)(`p`,{className:`mx-3 my-1 text-muted-foreground`,children:[`No files in `,(0,Z.jsx)(`code`,{className:Gj,children:`assets/`}),` yet.`]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`mx-2 mt-1 mb-1.5 flex h-[26px] shrink-0 items-center gap-1.5 rounded-md bg-muted px-2 focus-within:ring-[1.5px] focus-within:ring-primary`,children:[(0,Z.jsx)(fi,{"aria-hidden":!0,className:`size-[13px] shrink-0 text-muted-foreground`}),(0,Z.jsx)(`input`,{type:`search`,"aria-label":`Search assets`,placeholder:`Search assets`,value:m,spellCheck:!1,onChange:e=>h(e.target.value),onKeyDown:e=>{e.key===`Escape`&&m!==``&&(e.preventDefault(),e.stopPropagation(),h(``))},className:`min-w-0 flex-1 bg-transparent text-label outline-none placeholder:text-muted-foreground [&::-webkit-search-cancel-button]:hidden`})]}),(0,Z.jsx)(`div`,{role:`group`,"aria-label":`Filter by kind`,className:`flex flex-wrap gap-1 px-2 pb-1.5`,children:w.map(e=>(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":e.chip===T,onClick:()=>v(e.chip),className:`inline-flex h-6 min-w-6 items-center justify-center rounded-full px-2 text-[10px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 ${e.chip===T?`bg-foreground text-background`:`bg-muted text-muted-foreground hover:text-foreground`}`,children:[cne[e.chip],e.chip===`all`?null:` ${e.count}`]},e.chip))}),E.length===0?(0,Z.jsxs)(`div`,{className:`mx-3 my-1 text-muted-foreground`,children:[(0,Z.jsx)(`p`,{children:Jj(m,T)}),(0,Z.jsx)(`button`,{type:`button`,onClick:D,className:`mt-1 rounded-sm text-foreground underline underline-offset-2 outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:`Clear filter`})]}):E.map(t=>(0,Z.jsx)(qj,{group:t,project:e,open:!y.has(t.folder),onToggle:()=>O(t.folder)},t.folder))]}),(0,Z.jsx)(`div`,{className:`m-2 rounded-[10px] border-[1.5px] border-dashed border-border p-3 text-center leading-normal text-muted-foreground`,children:r?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{children:l?`Adding files…`:`Drop files here to add them.`}),(0,Z.jsx)(`br`,{}),`A frame links one as`,` `,(0,Z.jsx)(`code`,{className:Gj,children:`../assets/hero.png`})]}):(0,Z.jsxs)(Z.Fragment,{children:[`This tab is read-only, so files cannot be added. Run`,` `,(0,Z.jsx)(`code`,{className:Gj,children:`frameboard open`}),` for a tab that can.`]})}),d.length>0?(0,Z.jsx)(`ul`,{role:`alert`,className:`mx-3 text-destructive`,children:d.map(e=>(0,Z.jsx)(`li`,{className:`leading-[1.45]`,children:e.text},e.id))}):null]})}function qj({group:e,project:t,open:n,onToggle:r}){let i=n?Lt:zt,a=e.files.length;return(0,Z.jsxs)(`section`,{"aria-label":e.folder===``?`assets/`:e.folder,children:[(0,Z.jsx)(`h4`,{children:(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:r,className:`mx-1 flex items-center gap-1 rounded-md px-1.5 py-1 text-label font-semibold outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50`,children:[(0,Z.jsx)(i,{"aria-hidden":!0,className:`size-3 text-muted-foreground`}),e.folder===``?`assets/`:e.folder,(0,Z.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`· `,a]})]})}),n?(0,Z.jsx)(`ul`,{className:`grid grid-cols-2 gap-2 px-2 pt-0.5 pb-2`,children:e.files.map(e=>(0,Z.jsx)(zj,{project:t,file:e},e.path))}):null]})}function Jj(e,t){let n=t===`all`?`files`:`${Yj[t]} files`,r=e.trim();return r===``?`No ${n} here.`:`No ${n} match "${r}".`}var Yj={images:`image`,video:`video`,fonts:`font`,other:`other`};function Xj(e){return e.dataTransfer.types.includes(`Files`)}function Zj(e){let{items:t,files:n}=e.dataTransfer,r=[];for(let[e,i]of[...n].entries())t[e]?.webkitGetAsEntry?.()?.isDirectory||r.push(i);return r}function Qj(e,t,n){let r=z_(e=>e.board),[i,a]=(0,_.useState)();return(0,_.useEffect)(()=>{let n=!0;return t(e).catch(()=>null).then(e=>{n&&a(e)}),()=>{n=!1}},[e,r,t,n]),i}var $j=[`light`,`dark`],eM=`theme`,tM=`data-frameboard`;function nM(e){return e===`light`||e===`dark`}function rM(e,t){e.setAttribute(`data-theme`,t),e.style.colorScheme=t,e.classList.toggle(`dark`,t===`dark`),e.classList.toggle(`light`,t===`light`)}function iM(e){return e===`dark`?`light`:`dark`}function aM(e,t,n,r){let i=new URLSearchParams({[eM]:t});return n!==void 0&&i.set(`v`,String(n)),r!==void 0&&i.set(`at`,r),`${uee(e)}?${i}`}var oM=`frameboard.theme`;function sM(){return N()(()=>({choice:`system`,system:`light`,flipped:new Set}))}function cM({choice:e,system:t}){return e===`system`?t:e}function lM(e,t){let n=e=>{t.root.classList.toggle(`dark`,cM(e)===`dark`)},r=()=>{e.setState({system:t.media.matches?`dark`:`light`})};e.setState({choice:yM(t.storage)}),r(),n(e.getState()),t.media.addEventListener(`change`,r);let i=e.subscribe((e,r)=>{n(e),e.choice!==r.choice&&bM(t.storage,e.choice)});return()=>{i(),t.media.removeEventListener(`change`,r)}}function uM(e){let t;try{t=e.localStorage}catch{t=null}return{storage:t,media:e.matchMedia(`(prefers-color-scheme: dark)`),root:e.document.documentElement}}function dM(e,t=xM){t.setState({choice:e})}function fM(e=xM){e.setState({choice:iM(cM(e.getState()))})}function pM(e,t=xM){let n=new Set(t.getState().flipped);n.delete(e)||n.add(e),t.setState({flipped:n})}function mM(e,t,n=xM){let r=Object.fromEntries([...n.getState().flipped].map(e=>[e,!0]));n.setState({flipped:new Set(Object.keys(x_(r,e,t)))})}function hM(e,t=xM){return vM(t.getState(),e)}function gM(e=xM){return F(e,cM)}function _M(e,t=xM){return F(t,t=>vM(t,e))}function vM(e,t){let n=cM(e);return e.flipped.has(t)?iM(n):n}function yM(e){try{let t=e?.getItem(oM);return nM(t)?t:`system`}catch{return`system`}}function bM(e,t){try{e?.setItem(oM,t)}catch{}}var xM=sM(),SM=2,CM=16384;function wM(e,t,n=navigator.clipboard){return n.write([new ClipboardItem({"image/png":kM(e,t)})])}function TM(e,t,n={},r=fetch){return Qx(`/api/frames/clipboard`,Object.keys(n).length>0?{refs:e,theme:t,themes:n}:{refs:e,theme:t},`POST`,r)}function EM(e,t=SM){let n=Math.min(...e.map(e=>e.x)),r=Math.min(...e.map(e=>e.y)),i=Math.max(...e.map(e=>e.x+e.width)),a=Math.max(...e.map(e=>e.y+e.height)),o=Math.min(t,CM/(i-n),CM/(a-r)),s=e=>Math.round(e*o);return{width:s(i-n),height:s(a-r),places:e.map(e=>({x:s(e.x-n),y:s(e.y-r),width:s(e.width),height:s(e.height)}))}}function DM(e,t,n,r=navigator.clipboard){let i=OM(e,t,n);return r.write([new ClipboardItem({"image/png":i})])}async function OM(e,t,n){let r=EM(e.map(e=>e.box)),i=await Promise.all(e.map(async e=>createImageBitmap(await kM(e.ref,e.theme??t)))),a=new OffscreenCanvas(r.width,r.height),o=a.getContext(`2d`);if(!o)throw Error(`This browser has no 2D canvas to compose on.`);return o.fillStyle=n,o.fillRect(0,0,r.width,r.height),i.forEach((e,t)=>{let n=r.places[t];n&&o.drawImage(e,n.x,n.y,n.width,n.height),e.close()}),a.convertToBlob({type:`image/png`})}async function kM(e,t){let n=new URLSearchParams({ref:e,theme:t}),r=await fetch(`/api/frames/png?${n}`);if(!r.ok)throw Error(`The board answered ${r.status}.`);return r.blob()}var AM=null;function jM(){return AM}var MM=0;async function NM(e=fetch){let t=++MM,n=null;try{let t=await(await e(`/api/health`)).json();typeof t.clipboard==`string`&&(n=t.clipboard)}catch{}t===MM&&(AM=n)}var PM=N()(()=>({byRef:{}}));function FM(e){return F(PM,t=>t.byRef[e])}function IM(){return F(PM,e=>e.byRef)}function LM(e){return PM.getState().byRef[e]}function RM(){return PM.getState().byRef}function zM(e){return PM.subscribe(e)}function BM(e,t){let n=Math.max(1,Math.round(t));JM(e,e=>e?.width===n?e:{width:n})}function VM(e){JM(e,()=>void 0)}function HM(e,t,n){JM([e],e=>!e||e.width!==t?e:n===null?e.height===void 0?e:{width:t}:e.height===n?e:{width:t,height:n})}function UM(e,t,n){if(!n)return t;let r=e.hugHeight&&n.height!==void 0?n.height:t.height;return{...t,width:n.width,height:r}}function WM(e,t){return e.map(e=>{let n=t[e.ref];return n?{...e,box:UM(e,e.box,n)}:e})}function GM(e){return WM(e,IM())}function KM(e){return e.subscribe((e,t)=>{e.board&&e.board!==t.board&&qM(e.board)})}function qM(e){let t=new Set(e.projects.flatMap(e=>e.pages.flatMap(e=>e.frames.flatMap(e=>e.hidden?[]:[e.ref])))),{byRef:n}=PM.getState();VM(Object.keys(n).filter(e=>!t.has(e)))}function JM(e,t){let{byRef:n}=PM.getState(),r={...n},i=!1;for(let a of e){let e=t(n[a]);e!==n[a]&&(i=!0,e?r[a]=e:delete r[a])}i&&PM.setState({byRef:r})}function YM(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function XM(e){if(e.length===0)return null;let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y)),r=Math.max(...e.map(e=>e.x+e.width)),i=Math.max(...e.map(e=>e.y+e.height));return{x:t,y:n,width:r-t,height:i-n}}var ZM=2e3,QM=N()(()=>({byRef:{}}));function $M(e){return F(QM,t=>t.byRef[e]?.box)}function eN(e){return aN(e,F(QM,e=>e.byRef))}function tN(e){return aN(e,QM.getState().byRef)}function nN(e){return UM(e,$M(e.ref)??e.box,FM(e.ref))}function rN(e){return GM(eN(e))}function iN(e){return WM(tN(e),RM())}function aN(e,t){return e.map(e=>{let n=t[e.ref];return n?{...e,box:n.box}:e})}function oN(e){VM(Object.keys(e)),pN(Object.keys(e),t=>{let n=e[t];return n&&{box:n}})}var sN=new Map;async function cN(e,t,n,r=fetch,i){if(Object.keys(t).length===0&&!i)return!0;VM(Object.keys(t));let a={...t},o={...n},s={...i?.boxes},c={...i?.expected};for(let e of Object.keys(t)){let t=sN.get(e);if(t){for(let[e,n]of Object.entries(t.owner.sections?.boxes??{})){if(e in s)continue;s[e]=n;let r=t.owner.sections?.expected[e];r&&(c[e]=r)}for(let[e,n]of Object.entries(t.owner.boxes)){if(e in a)continue;a[e]=n;let t=sN.get(e)?.box;t&&(o[e]=t)}}}for(let e of Object.keys(a)){let t=sN.get(e)?.box;t&&(o[e]=t)}let l=Object.keys(a),u=new Map(Object.entries(a).map(([e,t])=>[e,{box:t}]));pN(l,e=>u.get(e));let d=()=>{let{byRef:e}=QM.getState();pN(l.filter(t=>e[t]===u.get(t)),()=>void 0)},f=Object.keys(s).length>0?{boxes:s,expected:c}:void 0,p={boxes:a,sections:f},m=()=>{for(let e of l){let t=o[e];t&&sN.set(e,{box:t,owner:p})}},h=()=>{for(let e of l)sN.get(e)?.owner===p&&sN.delete(e)};m();try{await qO(l,lN(a,o),async()=>{h();try{return await Qx(`/api/frames/boxes`,{page:e,boxes:mN(a),expected:mN(o),sections:f?.boxes,expectedSections:f?.expected},`POST`,r)}catch(e){throw m(),e}},{replace:`boxes`})}catch{return h(),d(),!1}return setTimeout(d,ZM),!0}function lN(e,t){return Object.entries(e).some(([e,n])=>{let r=t[e];return r&&(r.width!==n.width||r.height!==n.height)})?`resize`:`move`}function uN(e){pN(e,()=>void 0)}function dN(e){return e.subscribe((e,t)=>{e.board&&e.board!==t.board&&fN(e.board)})}function fN(e){let t=new Map(e.projects.flatMap(e=>e.pages.flatMap(e=>e.frames.map(e=>[e.ref,e.box])))),{byRef:n}=QM.getState(),r=Object.entries(n).filter(([e,n])=>{let r=t.get(e);return r!==void 0&&!YM(r,n.box)});r.length!==Object.keys(n).length&&QM.setState({byRef:Object.fromEntries(r)})}function pN(e,t){if(e.length===0)return;let n={...QM.getState().byRef};for(let r of e){let e=t(r);e?n[r]=e:delete n[r]}QM.setState({byRef:n})}function mN(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e.slice(e.lastIndexOf(`/`)+1),t]))}var hN=[1,2,3],gN=[{value:`light`,label:`Light`},{value:`dark`,label:`Dark`},{value:`both`,label:`Both themes`}],_N=N()(()=>({scale:2,theme:`both`}));function vN(e,{scale:t,theme:n}){return bN(n).map(n=>`${e}.${n}@${t}x.png`)}async function yN(e,t){let n=vN(e.name,t);(await xN(e.ref,bN(t.theme),t.scale)).forEach((e,t)=>CN(e,n[t]??``))}function bN(e){return e===`both`?$j:[e]}async function xN(e,t,n){let r=[];for(let i of t){let t=new URLSearchParams({ref:e,theme:i,scale:String(n)}),a=await fetch(`/api/frames/png?${t}`);if(!a.ok)throw Error(await SN(a));r.push(await a.blob())}return r}async function SN(e){let t=await e.json().catch(()=>null);return typeof t==`object`&&t&&`error`in t&&typeof t.error==`object`&&t.error!==null&&`message`in t.error&&typeof t.error.message==`string`?t.error.message:`The board answered ${e.status}.`}function CN(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.click(),URL.revokeObjectURL(n)}var wN={phone:{width:390,height:844},tablet:{width:834,height:1194},desktop:{width:1440,height:900}},TN={phone:{min:320,max:479},tablet:{min:480,max:1023},desktop:{min:1024,max:1/0}},EN=[{name:`small-phone`,label:`Small phone`,group:`phone`,width:375,height:667},{name:`iphone-16`,label:`iPhone 16`,group:`phone`,width:393,height:852},{name:`android`,label:`Android`,group:`phone`,width:412,height:917},{name:`iphone-16-pro-max`,label:`iPhone 16 Pro Max`,group:`phone`,width:440,height:956},{name:`ipad-mini`,label:`iPad mini`,group:`tablet`,width:744,height:1133},{name:`ipad-pro-12-9`,label:`iPad Pro 12.9`,group:`tablet`,width:1024,height:1366},{name:`macbook-air`,label:`MacBook Air`,group:`desktop`,width:1280,height:832},{name:`full-hd`,label:`Full HD`,group:`desktop`,width:1920,height:1080},{name:`slide-16-9`,label:`Slide 16:9`,group:`slide`,width:1920,height:1080},{name:`slide-4-3`,label:`Slide 4:3`,group:`slide`,width:1024,height:768},{name:`og-card`,label:`Open Graph`,group:`social`,width:1200,height:630},{name:`linkedin-post`,label:`LinkedIn post`,group:`social`,width:1200,height:627}];[...EN.map(e=>e.name)];var DN=`desktop`;function ON(e){return Object.hasOwn(wN,e)}function kN(e){let{width:t,height:n}=ON(e)?wN[e]:EN.find(t=>t.name===e)??wN.desktop;return{width:t,height:n}}function AN(e){return Object.keys(TN).filter(ON).find(t=>{let{min:n,max:r}=TN[t];return e>=n&&e<=r})}function jN(e,t){return AN(t)===e?t:wN[e].width}var MN=[{preset:`phone`,label:`Phone`,icon:bi},{preset:`tablet`,label:`Tablet`,icon:Ai},{preset:`desktop`,label:`Desktop`,icon:Sr}];function NN(e){let{min:t,max:n}=TN[e];return Number.isFinite(n)?`${t} to ${n}`:`${t} and up`}var PN=[...MN.map(({preset:e,label:t,icon:n})=>({group:e,label:t,icon:n,rows:[{name:e,label:t,...wN[e]},...FN(e)]})),{group:`slide`,label:`Slide`,icon:Jr,rows:FN(`slide`)},{group:`social`,label:`Social`,icon:vi,rows:FN(`social`)}].map(e=>({...e,rows:e.rows.toSorted((e,t)=>e.width-t.width)}));function FN(e){return EN.filter(t=>t.group===e)}function IN(e,t){let n=kN(t),r={},i={};for(let{ref:t,box:a}of e)(a.width!==n.width||a.height!==n.height)&&(r[t]={...a,...n},i[t]=a);return{boxes:r,expected:i}}function LN({width:e,height:t}){for(let{rows:n}of PN){let r=n.find(n=>n.width===e&&n.height===t);if(r)return r}}function RN(e){return`new:${e}`}var zN=N()(()=>({open:null,drafts:{}}));function BN(e){return F(zN,e)}function VN(e,t){zN.setState(({drafts:n})=>{let{[e]:r,...i}=n;return{drafts:t===``?i:{...i,[e]:t}}})}function HN(){zN.setState({open:null})}var UN=()=>R_.getState().canWrite;function WN(){(0,_.useEffect)(()=>{let e=ye([{id:`tool.note`,label:`Note`,group:`tool`,command:{label:`Add a note`,icon:vr},keys:[`n`],enabled:UN,run:()=>W_.setState({tool:`note`,mode:`edit`}),checked:()=>W_.getState().mode===`edit`&&W_.getState().tool===`note`}]),t=R_.subscribe((e,t)=>{e.canWrite!==t.canWrite&&(G(),!e.canWrite&&W_.getState().tool===`note`&&W_.setState({tool:`move`}),!e.canWrite&&zN.getState().open?.kind===`new`&&HN())}),n=W_.subscribe(e=>{let t=zN.getState().open;(e.mode===`play`||t?.kind===`new`&&e.tool!==`note`)&&HN()});return()=>{n(),t(),e(),W_.getState().tool===`note`&&W_.setState({tool:`move`}),zN.getState().open?.kind===`new`&&HN()}},[])}function GN(){return N()(()=>({page:null,frames:[]}))}function KN(e,t,n){e.setState({page:t,frames:[...new Set(n)],element:null,section:void 0})}function qN(e,t,n){e.setState({page:t,frames:[],element:null,section:n})}function JN(e,t,n){e.setState({page:t,frames:[n.frame],element:n,section:void 0})}function YN(e,t,n){let{page:r,frames:i}=e.getState();if(r!==t){KN(e,t,[n]);return}let a=i.includes(n)?i.filter(e=>e!==n):[...i,n];e.setState({page:a.length===0?null:t,frames:a,element:null,section:void 0})}function XN(e){let{page:t,frames:n,element:r,section:i}=e.getState();(t!==null||n.length!==0||r||i)&&e.setState({page:null,frames:[],element:null,section:void 0})}function ZN(e,t,n){let{page:r,frames:i,element:a}=e.getState();if(r===null)return;let o=e=>b_(e,t,n);e.setState({page:o(r),frames:i.map(o),element:a&&{...a,frame:o(a.frame)}})}function QN(e,t){let{page:n,frames:r,section:i}=e.getState();if(n===null)return;let a=t.projects.flatMap(e=>e.pages).find(e=>e.ref===n);if(i!==void 0){a?.sections.some(e=>e.name===i)||XN(e);return}let o=new Set(a?.frames.filter(e=>!e.hidden).map(e=>e.ref)),s=r.filter(e=>o.has(e));s.length!==r.length&&(s.length===0?XN(e):e.setState({frames:s,element:null}))}function $N(e,t,n,r){e.getState().page!==t&&XN(e);let i=n.getState().board;i&&QN(e,i);let a=n.subscribe((t,n)=>{t.board&&t.board!==n.board&&QN(e,t.board)}),o=r.subscribe(t=>{t.mode===`play`&&XN(e)});return()=>{o(),a()}}var eP=new Map;function tP(e){eP.set(e,(eP.get(e)??0)+1);let t=!1;return()=>{t||(t=!0,eP.set(e,(eP.get(e)??1)-1))}}var nP=new Map;function rP(e,t){let n=(nP.get(e)??[]).filter(e=>e!==t);nP.set(e,[...n,t].slice(-100))}function iP(e,t){return(eP.get(e)??0)>0||(eP.get(null)??0)>0||t!=null&&(nP.get(e)?.includes(t)??!1)}function aP(e,t){let{page:n,element:r}=e.getState();if(!n||!r||iP(r.frame))return;let i=t(r.frame);i!==null&&i!==r.hash&&KN(e,n,[r.frame])}function oP(e,t){let{page:n,element:r}=e.getState();if(!n||!r||iP(r.frame))return;let i=t(r.frame);i!==null&&i!==r.hash&&!iP(r.frame,i)&&KN(e,n,[r.frame])}var sP=GN();function cP(e){return F(sP,e)}var lP=2,uP=40,dP=200,fP=[{name:`left`,key:`ArrowLeft`,dx:-1,dy:0},{name:`right`,key:`ArrowRight`,dx:1,dy:0},{name:`up`,key:`ArrowUp`,dx:0,dy:-1},{name:`down`,key:`ArrowDown`,dx:0,dy:1}];function pP(){(0,_.useEffect)(()=>{NM();let e=ye(hP()),t=W_.subscribe(G),n=sP.subscribe(G),r=ev.onAttach(G);return()=>{r(),n(),t(),e()}},[])}function mP(){let{page:e,frames:t}=sP.getState(),n=R_.getState().board?.projects.flatMap(e=>e.pages).find(t=>t.ref===e)?.frames.filter(e=>t.includes(e.ref));return tN(n??[])}function hP(){let e=()=>W_.getState(),t=e=>W_.setState(e),n=e=>({...e,group:`view`,enabled:ev.attached}),r=t=>()=>ev.attached()&&e().mode===`edit`&&t(sP.getState().frames.length);return[{id:`tool.move`,label:`Move`,group:`tool`,command:{label:`Use the move tool`,icon:Er},keys:[`v`],run:()=>t({tool:`move`,mode:`edit`}),checked:()=>e().mode===`edit`&&e().tool===`move`},{id:`tool.hand`,label:`Hand`,group:`tool`,command:{label:`Use the hand tool`,icon:Rn,keywords:[`pan`]},keys:[`h`],run:()=>t({tool:`hand`,mode:`edit`}),checked:()=>e().mode===`edit`&&e().tool===`hand`},{id:`mode.edit`,label:`Edit`,group:`mode`,command:{label:`Switch to Edit`,icon:Rr},run:()=>t({mode:`edit`}),checked:()=>e().mode===`edit`},{id:`mode.play`,label:`Play`,group:`mode`,command:{label:`Switch to Play`,icon:Wr},run:()=>t({mode:`play`}),checked:()=>e().mode===`play`},{id:`mode.toggle`,label:`Edit or Play`,group:`mode`,palette:!1,keys:[`p`],run:()=>t({mode:e().mode===`play`?`edit`:`play`})},{id:`mode.exitPlay`,label:`Exit Play`,group:`mode`,palette:!1,keys:[`Escape`],enabled:()=>e().mode===`play`,run:()=>{document.activeElement instanceof HTMLIFrameElement&&document.activeElement.blur(),t({mode:`edit`})}},{id:`tool.disarm`,label:`Back to Move`,group:`tool`,palette:!1,keys:[`Escape`],enabled:()=>e().mode===`edit`&&e().tool!==`move`&&zN.getState().open===null,run:()=>{let e=document.activeElement;e instanceof HTMLElement&&e.closest(`[role="toolbar"]`)&&e.blur(),t({tool:`move`})}},{id:`view.hideUi`,label:`Hide UI`,group:`view`,command:{label:`Hide UI`,icon:Mr},keys:[`$mod+Backslash`],run:()=>t({hideUi:!e().hideUi}),checked:()=>e().hideUi},n({id:`view.zoomIn`,label:`Zoom in`,command:{label:`Zoom in`,icon:oa},keys:[`$mod+Equal`],run:()=>ev.zoomBy(lP)}),n({id:`view.zoomOut`,label:`Zoom out`,command:{label:`Zoom out`,icon:ca},keys:[`$mod+Minus`],run:()=>ev.zoomBy(1/lP)}),n({id:`view.zoomToFit`,label:`Zoom to fit`,command:{label:`Zoom to fit`,icon:gr},keys:[`Shift+Digit1`],run:ev.fit}),{id:`view.zoomToSelection`,label:`Zoom to selection`,group:`view`,command:{label:`Zoom to selection`,icon:oi},keys:[`Shift+Digit2`],enabled:r(e=>e>0),run:()=>ev.fitTo(mP().map(e=>e.box))},...fP.flatMap(({name:e,key:t,dx:n,dy:i})=>[{id:`view.pan.${e}`,label:`Pan ${e}`,group:`view`,palette:!1,keys:[t],enabled:r(e=>e===0),run:()=>ev.panBy(n*uP,i*uP)},{id:`view.pan.${e}Far`,label:`Pan ${e} further`,group:`view`,palette:!1,keys:[`Shift+${t}`],enabled:r(e=>e===0),run:()=>ev.panBy(n*dP,i*dP)}]),{id:`frame.copyPng`,label:`Copy as PNG`,group:`frame`,command:{label:`Copy as PNG`,icon:cn},keys:[`$mod+Shift+KeyC`],enabled:r(e=>e>0),run:()=>{let e=mP(),[t]=e;if(!t)return;if(e.length>1){gP(e);return}let n=hM(t.ref);wM(t.ref,n).then(()=>n_.add({title:`Copied ${t.name}`,description:`PNG on the clipboard, in the ${n} theme.`,type:`success`}),ok(`Couldn't copy ${t.name}`))}},{id:`frame.copyRef`,label:`Copy frame ref`,group:`frame`,command:{label:`Copy frame ref`,icon:nr,hint:()=>{let{frames:e}=sP.getState();return e.length===1?e[0]??``:`${e.length} frames`},keywords:[`path`,`reference`,`agent`]},enabled:r(e=>e>0),run:()=>{let e=sP.getState().frames;navigator.clipboard.writeText(e.join(`
|
|
68
|
+
`)).then(()=>n_.add({title:e.length===1?`Copied the frame ref`:`Copied ${e.length} frame refs`,description:e.join(`, `),type:`success`}),ok(`Couldn't copy the frame ref`))}},{id:`frame.exportPng`,label:`Export as PNG`,group:`frame`,command:{label:`Export as PNG`,icon:un,hint:()=>{let{scale:e,theme:t}=_N.getState();return`${e}x · ${t===`both`?`both themes`:`${t} theme`}`},keywords:[`download`,`image`,`save`]},enabled:r(e=>e===1),run:()=>{let[e]=mP();if(!e)return;let t=_N.getState();n_.promise(yN(e,t),{loading:{title:`Exporting ${e.name}`,type:`loading`},success:{title:`Exported ${e.name}`,description:vN(e.name,t).join(` and `),type:`success`},error:t=>({title:`Couldn't export ${e.name}`,description:t instanceof Error?t.message:String(t),type:`error`})})}},...PN.flatMap(({rows:e})=>e).map(e=>({id:`frame.resizeTo.${e.name}`,label:`Resize to ${e.label}`,group:`frame`,command:{label:`Resize to ${e.label}`,icon:ni,hint:()=>`${e.width} × ${e.height}`,keywords:[`size`,`device`],searchOnly:!0},enabled:()=>r(e=>e>0)()&&R_.getState().canWrite&&mP().every(e=>!e.locked),run:()=>{let{page:t}=sP.getState();if(!t)return;let{boxes:n,expected:r}=IN(mP(),e.name);cN(t,n,r)}})),n({id:`view.zoom50`,label:`Zoom to 50%`,command:{label:`Zoom to 50%`,icon:ca},run:()=>ev.zoomTo(.5)}),n({id:`view.zoom100`,label:`Zoom to 100%`,command:{label:`Zoom to 100%`,icon:oi,keywords:[`actual size`]},keys:[`Shift+Digit0`],run:()=>ev.zoomTo(1)}),n({id:`view.zoom200`,label:`Zoom to 200%`,command:{label:`Zoom to 200%`,icon:oa},run:()=>ev.zoomTo(2)})]}function gP(e){let t=cM(xM.getState()),n={};for(let r of e){let e=hM(r.ref);e!==t&&(n[r.ref]=e)}let r=e.length;if(jM()!==null&&R_.getState().canWrite){let i=Object.keys(n).length>0;n_.promise(TM(e.map(e=>e.ref),t,n),{loading:{title:`Copying ${r} frames`,type:`loading`},success:{title:`Copied ${r} frames`,description:i?`${r} PNG files on the clipboard, each in the theme it shows.`:`${r} PNG files on the clipboard, in the ${t} theme.`,type:`success`},error:_P});return}let i=document.querySelector(`[data-canvas]`),a=i?getComputedStyle(i).backgroundColor:`white`,o=e.map(e=>({ref:e.ref,box:e.box,theme:n[e.ref]}));n_.promise(DM(o,t,a),{loading:{title:`Copying ${r} frames`,type:`loading`},success:{title:`Copied ${r} frames as one image`,description:`This system takes one image, so the frames are laid out as on the canvas.`,type:`success`},error:_P})}function _P(e){return{title:`Couldn't copy the frames`,description:e instanceof Error?e.message:String(e),type:`error`}}var vP={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function yP(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),vP.hasOwnProperty(t)?{space:vP[t],local:e}:e}function bP(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function xP(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function SP(e){var t=yP(e);return(t.local?xP:bP)(t)}function CP(){}function wP(e){return e==null?CP:function(){return this.querySelector(e)}}function TP(e){typeof e!=`function`&&(e=wP(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new pI(r,this._parents)}function EP(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function DP(){return[]}function OP(e){return e==null?DP:function(){return this.querySelectorAll(e)}}function kP(e){return function(){return EP(e.apply(this,arguments))}}function AP(e){e=typeof e==`function`?kP(e):OP(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new pI(r,i)}function jP(e){return function(){return this.matches(e)}}function MP(e){return function(t){return t.matches(e)}}var NP=Array.prototype.find;function PP(e){return function(){return NP.call(this.children,e)}}function FP(){return this.firstElementChild}function IP(e){return this.select(e==null?FP:PP(typeof e==`function`?e:MP(e)))}var LP=Array.prototype.filter;function RP(){return Array.from(this.children)}function zP(e){return function(){return LP.call(this.children,e)}}function BP(e){return this.selectAll(e==null?RP:zP(typeof e==`function`?e:MP(e)))}function VP(e){typeof e!=`function`&&(e=jP(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new pI(r,this._parents)}function HP(e){return Array(e.length)}function UP(){return new pI(this._enter||this._groups.map(HP),this._parents)}function WP(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}WP.prototype={constructor:WP,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function GP(e){return function(){return e}}function KP(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new WP(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function qP(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new WP(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function JP(e){return e.__data__}function YP(e,t){if(!arguments.length)return Array.from(this,JP);var n=t?qP:KP,r=this._parents,i=this._groups;typeof e!=`function`&&(e=GP(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=XP(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new pI(o,r),o._enter=s,o._exit=c,o}function XP(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function ZP(){return new pI(this._exit||this._groups.map(HP),this._parents)}function QP(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function $P(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new pI(s,this._parents)}function eF(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function tF(e){e||=nF;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new pI(i,this._parents).order()}function nF(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function rF(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function iF(){return Array.from(this)}function aF(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function oF(){let e=0;for(let t of this)++e;return e}function sF(){return!this.node()}function cF(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function lF(e){return function(){this.removeAttribute(e)}}function uF(e){return function(){this.removeAttributeNS(e.space,e.local)}}function dF(e,t){return function(){this.setAttribute(e,t)}}function fF(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function pF(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function mF(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function hF(e,t){var n=yP(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?uF:lF:typeof t==`function`?n.local?mF:pF:n.local?fF:dF)(n,t))}function gF(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function _F(e){return function(){this.style.removeProperty(e)}}function vF(e,t,n){return function(){this.style.setProperty(e,t,n)}}function yF(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function bF(e,t,n){return arguments.length>1?this.each((t==null?_F:typeof t==`function`?yF:vF)(e,t,n??``)):xF(this.node(),e)}function xF(e,t){return e.style.getPropertyValue(t)||gF(e).getComputedStyle(e,null).getPropertyValue(t)}function SF(e){return function(){delete this[e]}}function CF(e,t){return function(){this[e]=t}}function wF(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function TF(e,t){return arguments.length>1?this.each((t==null?SF:typeof t==`function`?wF:CF)(e,t)):this.node()[e]}function EF(e){return e.trim().split(/^|\s+/)}function DF(e){return e.classList||new OF(e)}function OF(e){this._node=e,this._names=EF(e.getAttribute(`class`)||``)}OF.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function kF(e,t){for(var n=DF(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function AF(e,t){for(var n=DF(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function jF(e){return function(){kF(this,e)}}function MF(e){return function(){AF(this,e)}}function NF(e,t){return function(){(t.apply(this,arguments)?kF:AF)(this,e)}}function PF(e,t){var n=EF(e+``);if(arguments.length<2){for(var r=DF(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?NF:t?jF:MF)(n,t))}function FF(){this.textContent=``}function IF(e){return function(){this.textContent=e}}function LF(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function RF(e){return arguments.length?this.each(e==null?FF:(typeof e==`function`?LF:IF)(e)):this.node().textContent}function zF(){this.innerHTML=``}function BF(e){return function(){this.innerHTML=e}}function VF(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function HF(e){return arguments.length?this.each(e==null?zF:(typeof e==`function`?VF:BF)(e)):this.node().innerHTML}function UF(){this.nextSibling&&this.parentNode.appendChild(this)}function WF(){return this.each(UF)}function GF(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function KF(){return this.each(GF)}function qF(e){var t=typeof e==`function`?e:SP(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function JF(){return null}function YF(e,t){var n=typeof e==`function`?e:SP(e),r=t==null?JF:typeof t==`function`?t:wP(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function XF(){var e=this.parentNode;e&&e.removeChild(this)}function ZF(){return this.each(XF)}function QF(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function $F(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function eI(e){return this.select(e?$F:QF)}function tI(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function nI(e){return function(t){e.call(this,t,this.__data__)}}function rI(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function iI(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function aI(e,t,n){return function(){var r=this.__on,i,a=nI(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function oI(e,t,n){var r=rI(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}}else{for(s=t?aI:iI,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function sI(e,t,n){var r=gF(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function cI(e,t){return function(){return sI(this,e,t)}}function lI(e,t){return function(){return sI(this,e,t.apply(this,arguments))}}function uI(e,t){return this.each((typeof t==`function`?lI:cI)(e,t))}function*dI(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var fI=[null];function pI(e,t){this._groups=e,this._parents=t}function mI(){return new pI([[document.documentElement]],fI)}function hI(){return this}pI.prototype=mI.prototype={constructor:pI,select:TP,selectAll:AP,selectChild:IP,selectChildren:BP,filter:VP,data:YP,enter:UP,exit:ZP,join:QP,merge:$P,selection:hI,order:eF,sort:tF,call:rF,nodes:iF,node:aF,size:oF,empty:sF,each:cF,attr:hF,style:bF,property:TF,classed:PF,text:RF,html:HF,raise:WF,lower:KF,append:qF,insert:YF,remove:ZF,clone:eI,datum:tI,on:oI,dispatch:uI,[Symbol.iterator]:dI};function gI(e){return typeof e==`string`?new pI([[document.querySelector(e)]],[document.documentElement]):new pI([[e]],fI)}function _I(e){let t;for(;t=e.sourceEvent;)e=t;return e}function vI(e,t){if(e=_I(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var yI={value:()=>{}};function bI(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new xI(n)}function xI(e){this._=e}function SI(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}xI.prototype=bI.prototype={constructor:xI,on:function(e,t){var n=this._,r=SI(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=CI(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=wI(n[i],e.name,t);else if(t==null)for(i in n)n[i]=wI(n[i],e.name,null);return this}},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new xI(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function CI(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function wI(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=yI,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var TI={passive:!1},EI={capture:!0,passive:!1};function DI(e){e.stopImmediatePropagation()}function OI(e){e.preventDefault(),e.stopImmediatePropagation()}function kI(e){var t=e.document.documentElement,n=gI(e).on(`dragstart.drag`,OI,EI);`onselectstart`in t?n.on(`selectstart.drag`,OI,EI):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function AI(e,t){var n=e.document.documentElement,r=gI(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,OI,EI),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var jI=e=>()=>e;function MI(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}MI.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function yne(e){return!e.ctrlKey&&!e.button}function bne(){return this.parentNode}function xne(e,t){return t??{x:e.x,y:e.y}}function Sne(){return navigator.maxTouchPoints||`ontouchstart`in this}function Cne(){var e=yne,t=bne,n=xne,r=Sne,i={},a=bI(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,TI).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(gI(n.view).on(`mousemove.drag`,m,EI).on(`mouseup.drag`,h,EI),kI(n.view),DI(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(OI(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){gI(e.view).on(`mousemove.drag mouseup.drag`,null),AI(e.view,l),OI(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(DI(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(OI(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(DI(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=vI(l||r,t),p,m,h;if((h=n.call(e,new MI(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=vI(l||a,t),_=o}u.call(r,e,new MI(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:jI(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:jI(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:jI(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:jI(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function NI(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function PI(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function FI(){}var II=.7,LI=1/II,RI=`\\s*([+-]?\\d+)\\s*`,zI=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,BI=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,wne=/^#([0-9a-f]{3,8})$/,Tne=RegExp(`^rgb\\(${RI},${RI},${RI}\\)$`),Ene=RegExp(`^rgb\\(${BI},${BI},${BI}\\)$`),Dne=RegExp(`^rgba\\(${RI},${RI},${RI},${zI}\\)$`),One=RegExp(`^rgba\\(${BI},${BI},${BI},${zI}\\)$`),kne=RegExp(`^hsl\\(${zI},${BI},${BI}\\)$`),Ane=RegExp(`^hsla\\(${zI},${BI},${BI},${zI}\\)$`),VI={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};NI(FI,WI,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:HI,formatHex:HI,formatHex8:jne,formatHsl:Mne,formatRgb:UI,toString:UI});function HI(){return this.rgb().formatHex()}function jne(){return this.rgb().formatHex8()}function Mne(){return tL(this).formatHsl()}function UI(){return this.rgb().formatRgb()}function WI(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=wne.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?GI(t):n===3?new JI(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?KI(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?KI(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Tne.exec(e))?new JI(t[1],t[2],t[3],1):(t=Ene.exec(e))?new JI(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Dne.exec(e))?KI(t[1],t[2],t[3],t[4]):(t=One.exec(e))?KI(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=kne.exec(e))?eL(t[1],t[2]/100,t[3]/100,1):(t=Ane.exec(e))?eL(t[1],t[2]/100,t[3]/100,t[4]):VI.hasOwnProperty(e)?GI(VI[e]):e===`transparent`?new JI(NaN,NaN,NaN,0):null}function GI(e){return new JI(e>>16&255,e>>8&255,e&255,1)}function KI(e,t,n,r){return r<=0&&(e=t=n=NaN),new JI(e,t,n,r)}function Nne(e){return e instanceof FI||(e=WI(e)),e?(e=e.rgb(),new JI(e.r,e.g,e.b,e.opacity)):new JI}function qI(e,t,n,r){return arguments.length===1?Nne(e):new JI(e,t,n,r??1)}function JI(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}NI(JI,qI,PI(FI,{brighter(e){return e=e==null?LI:LI**+e,new JI(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?II:II**+e,new JI(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new JI(QI(this.r),QI(this.g),QI(this.b),ZI(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:YI,formatHex:YI,formatHex8:Pne,formatRgb:XI,toString:XI}));function YI(){return`#${$I(this.r)}${$I(this.g)}${$I(this.b)}`}function Pne(){return`#${$I(this.r)}${$I(this.g)}${$I(this.b)}${$I((isNaN(this.opacity)?1:this.opacity)*255)}`}function XI(){let e=ZI(this.opacity);return`${e===1?`rgb(`:`rgba(`}${QI(this.r)}, ${QI(this.g)}, ${QI(this.b)}${e===1?`)`:`, ${e})`}`}function ZI(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function QI(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function $I(e){return e=QI(e),(e<16?`0`:``)+e.toString(16)}function eL(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new nL(e,t,n,r)}function tL(e){if(e instanceof nL)return new nL(e.h,e.s,e.l,e.opacity);if(e instanceof FI||(e=WI(e)),!e)return new nL;if(e instanceof nL)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new nL(o,s,c,e.opacity)}function Fne(e,t,n,r){return arguments.length===1?tL(e):new nL(e,t,n,r??1)}function nL(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}NI(nL,Fne,PI(FI,{brighter(e){return e=e==null?LI:LI**+e,new nL(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?II:II**+e,new nL(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new JI(aL(e>=240?e-240:e+120,i,r),aL(e,i,r),aL(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new nL(rL(this.h),iL(this.s),iL(this.l),ZI(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=ZI(this.opacity);return`${e===1?`hsl(`:`hsla(`}${rL(this.h)}, ${iL(this.s)*100}%, ${iL(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function rL(e){return e=(e||0)%360,e<0?e+360:e}function iL(e){return Math.max(0,Math.min(1,e||0))}function aL(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var oL=e=>()=>e;function Ine(e,t){return function(n){return e+n*t}}function Lne(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Rne(e){return(e=+e)==1?sL:function(t,n){return n-t?Lne(t,n,e):oL(isNaN(t)?n:t)}}function sL(e,t){var n=t-e;return n?Ine(e,n):oL(isNaN(e)?t:e)}var cL=(function e(t){var n=Rne(t);function r(e,t){var r=n((e=qI(e)).r,(t=qI(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=sL(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function lL(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var uL=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,dL=new RegExp(uL.source,`g`);function zne(e){return function(){return e}}function Bne(e){return function(t){return e(t)+``}}function Vne(e,t){var n=uL.lastIndex=dL.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=uL.exec(e))&&(i=dL.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:lL(r,i)})),n=dL.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Bne(c[0].x):zne(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}var fL=180/Math.PI,pL={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function mL(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*fL,skewX:Math.atan(c)*fL,scaleX:o,scaleY:s}}var hL;function Hne(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?pL:mL(t.a,t.b,t.c,t.d,t.e,t.f)}function Une(e){return e==null||(hL||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),hL.setAttribute(`transform`,e),!(e=hL.transform.baseVal.consolidate()))?pL:(e=e.matrix,mL(e.a,e.b,e.c,e.d,e.e,e.f))}function gL(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:lL(e,i)},{i:c-2,x:lL(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:lL(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:lL(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:lL(e,n)},{i:s-2,x:lL(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var Wne=gL(Hne,`px, `,`px)`,`deg)`),Gne=gL(Une,`, `,`)`,`)`),Kne=1e-12;function _L(e){return((e=Math.exp(e))+1/e)/2}function qne(e){return((e=Math.exp(e))-1/e)/2}function Jne(e){return((e=Math.exp(2*e))-1)/(e+1)}var Yne=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<Kne)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=_L(y),c=s/(n*g)*(i*Jne(t*r+y)-qne(y));return[a+c*d,o+c*f,s*i/_L(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),vL=0,yL=0,bL=0,xL=1e3,SL,CL,wL=0,TL=0,EL=0,DL=typeof performance==`object`&&performance.now?performance:Date,OL=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function kL(){return TL||=(OL(Xne),DL.now()+EL)}function Xne(){TL=0}function AL(){this._call=this._time=this._next=null}AL.prototype=jL.prototype={constructor:AL,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?kL():+n)+(t==null?0:+t),!this._next&&CL!==this&&(CL?CL._next=this:SL=this,CL=this),this._call=e,this._time=n,NL()},stop:function(){this._call&&(this._call=null,this._time=1/0,NL())}};function jL(e,t,n){var r=new AL;return r.restart(e,t,n),r}function Zne(){kL(),++vL;for(var e=SL,t;e;)(t=TL-e._time)>=0&&e._call.call(void 0,t),e=e._next;--vL}function ML(){TL=(wL=DL.now())+EL,vL=yL=0;try{Zne()}finally{vL=0,$ne(),TL=0}}function Qne(){var e=DL.now(),t=e-wL;t>xL&&(EL-=t,wL=e)}function $ne(){for(var e,t=SL,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:SL=n);CL=e,NL(r)}function NL(e){vL||(yL&&=clearTimeout(yL),e-TL>24?(e<1/0&&(yL=setTimeout(ML,e-DL.now()-EL)),bL&&=clearInterval(bL)):(bL||=(wL=DL.now(),setInterval(Qne,xL)),vL=1,OL(ML)))}function PL(e,t,n){var r=new AL;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var ere=bI(`start`,`end`,`cancel`,`interrupt`),tre=[];function FL(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;nre(e,n,{name:t,index:r,group:i,on:ere,tween:tre,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function IL(e,t){var n=RL(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function LL(e,t){var n=RL(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function RL(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function nre(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=jL(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return PL(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(PL(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function zL(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n)(r=n[o]).name===t?(i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]):a=!1;a&&delete e.__transition}}function rre(e){return this.each(function(){zL(this,e)})}function ire(e,t){var n,r;return function(){var i=LL(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function are(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=LL(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function ore(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=RL(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?ire:are)(n,e,t))}function BL(e,t,n){var r=e._id;return e.each(function(){var e=LL(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return RL(e,r).value[t]}}function VL(e,t){var n;return(typeof t==`number`?lL:t instanceof WI?cL:(n=WI(t))?(t=n,cL):Vne)(e,t)}function HL(e){return function(){this.removeAttribute(e)}}function UL(e){return function(){this.removeAttributeNS(e.space,e.local)}}function WL(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function GL(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function KL(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function qL(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function JL(e,t){var n=yP(e),r=n===`transform`?Gne:VL;return this.attrTween(e,typeof t==`function`?(n.local?qL:KL)(n,r,BL(this,`attr.`+e,t)):t==null?(n.local?UL:HL)(n):(n.local?GL:WL)(n,r,t))}function YL(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function XL(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function ZL(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&XL(e,i)),n}return i._value=t,i}function QL(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&YL(e,i)),n}return i._value=t,i}function $L(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=yP(e);return this.tween(n,(r.local?ZL:QL)(r,t))}function eR(e,t){return function(){IL(this,e).delay=+t.apply(this,arguments)}}function tR(e,t){return t=+t,function(){IL(this,e).delay=t}}function nR(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?eR:tR)(t,e)):RL(this.node(),t).delay}function rR(e,t){return function(){LL(this,e).duration=+t.apply(this,arguments)}}function iR(e,t){return t=+t,function(){LL(this,e).duration=t}}function aR(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?rR:iR)(t,e)):RL(this.node(),t).duration}function oR(e,t){if(typeof t!=`function`)throw Error();return function(){LL(this,e).ease=t}}function sR(e){var t=this._id;return arguments.length?this.each(oR(t,e)):RL(this.node(),t).ease}function cR(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();LL(this,e).ease=n}}function lR(e){if(typeof e!=`function`)throw Error();return this.each(cR(this._id,e))}function uR(e){typeof e!=`function`&&(e=jP(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new zR(r,this._parents,this._name,this._id)}function dR(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new zR(o,this._parents,this._name,this._id)}function fR(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function pR(e,t,n){var r,i,a=fR(t)?IL:LL;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function mR(e,t){var n=this._id;return arguments.length<2?RL(this.node(),n).on.on(e):this.each(pR(n,e,t))}function hR(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function gR(){return this.on(`end.remove`,hR(this._id))}function _R(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=wP(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,FL(l[f],t,n,f,l,RL(u,n)));return new zR(a,this._parents,t,n)}function vR(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=OP(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=RL(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&FL(p,t,n,h,f,m);a.push(f),o.push(u)}return new zR(a,o,t,n)}var yR=mI.prototype.constructor;function bR(){return new yR(this._groups,this._parents)}function xR(e,t){var n,r,i;return function(){var a=xF(this,e),o=(this.style.removeProperty(e),xF(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function SR(e){return function(){this.style.removeProperty(e)}}function CR(e,t,n){var r,i=n+``,a;return function(){var o=xF(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function wR(e,t,n){var r,i,a;return function(){var o=xF(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),xF(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function TR(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=LL(this,e),l=c.on,u=c.value[a]==null?s||=SR(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function ER(e,t,n){var r=(e+=``)==`transform`?Wne:VL;return t==null?this.styleTween(e,xR(e,r)).on(`end.style.`+e,SR(e)):typeof t==`function`?this.styleTween(e,wR(e,r,BL(this,`style.`+e,t))).each(TR(this._id,e)):this.styleTween(e,CR(e,r,t),n).on(`end.style.`+e,null)}function DR(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function OR(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&DR(e,a,n)),r}return a._value=t,a}function kR(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,OR(e,t,n??``))}function AR(e){return function(){this.textContent=e}}function jR(e){return function(){var t=e(this);this.textContent=t??``}}function MR(e){return this.tween(`text`,typeof e==`function`?jR(BL(this,`text`,e)):AR(e==null?``:e+``))}function NR(e){return function(t){this.textContent=e.call(this,t)}}function PR(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&NR(r)),t}return r._value=e,r}function FR(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,PR(e))}function IR(){for(var e=this._name,t=this._id,n=BR(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=RL(c,t);FL(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new zR(r,this._parents,e,n)}function LR(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=LL(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var RR=0;function zR(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function BR(){return++RR}var VR=mI.prototype;zR.prototype={constructor:zR,select:_R,selectAll:vR,selectChild:VR.selectChild,selectChildren:VR.selectChildren,filter:uR,merge:dR,selection:bR,transition:IR,call:VR.call,nodes:VR.nodes,node:VR.node,size:VR.size,empty:VR.empty,each:VR.each,on:mR,attr:JL,attrTween:$L,style:ER,styleTween:kR,text:MR,textTween:FR,remove:gR,tween:ore,delay:nR,duration:aR,ease:sR,easeVarying:lR,end:LR,[Symbol.iterator]:VR[Symbol.iterator]};function HR(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var UR={time:null,delay:0,duration:250,ease:HR};function WR(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function GR(e){var t,n;e instanceof zR?(t=e._id,e=e._name):(t=BR(),(n=UR).time=kL(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&FL(c,e,t,l,o,n||WR(c,t));return new zR(r,this._parents,e,t)}mI.prototype.interrupt=rre,mI.prototype.transition=GR;var KR=e=>()=>e;function qR(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function JR(e,t,n){this.k=e,this.x=t,this.y=n}JR.prototype={constructor:JR,scale:function(e){return e===1?this:new JR(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new JR(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var YR=new JR(1,0,0);XR.prototype=JR.prototype;function XR(e){for(;!e.__zoom;)if(!(e=e.parentNode))return YR;return e.__zoom}function ZR(e){e.stopImmediatePropagation()}function QR(e){e.preventDefault(),e.stopImmediatePropagation()}function $R(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function ez(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function tz(){return this.__zoom||YR}function nz(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function rz(){return navigator.maxTouchPoints||`ontouchstart`in this}function iz(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function az(){var e=$R,t=ez,n=iz,r=nz,i=rz,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Yne,l=bI(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,tz).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,tz),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(YR.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new JR(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new JR(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new JR(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=gI(this.that).datum();l.call(e,this.that,new qR(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=vI(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],zL(this),s.start();QR(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=gI(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=vI(t,i),l=t.clientX,u=t.clientY;kI(t.view),ZR(t),a.mouse=[c,this.__zoom.invert(c)],zL(this),a.start();function d(e){if(QR(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=vI(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),AI(e.view,a.moved),QR(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=vI(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);QR(r),s>0?gI(this).transition().duration(s).call(x,d,c,r):gI(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(ZR(t),s=0;s<i;++s)c=r[s],l=vI(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),zL(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(QR(e),s=0;s<a;++s)c=i[s],l=vI(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(ZR(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=vI(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=gI(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:KR(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:KR(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:KR(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:KR([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var oz=`/api/live`,sz=crypto.randomUUID(),cz=500;function lz(e,{onShow:t,onDisconnect:n,unseen:r=Dv,selection:i=sP,theme:a=xM}={}){let o,s,c=!1,l=()=>{let u=location.protocol===`https:`?`wss`:`ws`;o=new WebSocket(`${u}://${location.host}${oz}`),o.addEventListener(`open`,()=>{let t={type:`hello`,role:`board`,tab:sz};o?.send(JSON.stringify(t)),e.setState({connected:!0})}),o.addEventListener(`message`,n=>{let o=JSON.parse(String(n.data));if(o.type===`board`)O_(e,o.data),pv(r,o.data);else if(o.type===`changes`){mee(r,o.changes);let{board:t}=e.getState();t&&pv(r,t)}else if(o.type===`access`)I_(e,o.write,o.dispatch);else if(o.type===`reload`)L_(e,o.refs);else if(o.type===`renamed`){let{before:t,after:n}=o;y_(e,t,n)&&(ZN(i,t,n),mM(t,n,a),mv(r,t,n),v_(e,t,n))}else o.type===`findings`?F_(e,o.findings):o.type===`notes`?k_(e,o.page,o.notes):o.type===`listeners`?A_(e,o.listeners):o.type===`history`?j_(e,{undo:o.undo,redo:o.redo}):o.type===`claims`?M_(e,o.claims):o.type===`thumbnails`?N_(e,o.theme,o.stamps):o.type===`show`&&t?.(o.ref)}),o.addEventListener(`close`,()=>{P_(e),n?.(),c||(s=setTimeout(l,cz))})};return l(),()=>{c=!0,clearTimeout(s),o?.close()}}var uz=1500;function dz(e,{store:t=Dv,doc:n=document}={}){let r=(0,_.useRef)(e),i=(0,_.useRef)(()=>{});(0,_.useEffect)(()=>{let e=new Map,a=t=>{clearTimeout(e.get(t)),e.delete(t)},o=()=>{let i=r.current,{unseen:o}=t.getState(),s=i&&n.visibilityState===`visible`?new Set(i.frames.filter(e=>e.ref in o).filter(e=>fz(e.box,i.view,i.size)).map(e=>e.ref)):new Set;for(let t of[...e.keys()])s.has(t)||a(t);for(let n of s)e.has(n)||e.set(n,setTimeout(()=>{e.delete(n),uv(t,n)},uz))},s=()=>{for(let e of sP.getState().frames)uv(t,e)};i.current=o,o(),s();let c=t.subscribe((e,t)=>{e.unseen!==t.unseen&&(s(),o())}),l=sP.subscribe(s);return n.addEventListener(`visibilitychange`,o),()=>{c(),l(),n.removeEventListener(`visibilitychange`,o);for(let t of[...e.keys()])a(t);i.current=()=>{}}},[t,n]),(0,_.useEffect)(()=>{r.current=e,i.current()},[e])}function fz(e,t,n){let r=Math.max(e.x*t.k+t.x,0),i=Math.max(e.y*t.k+t.y,0),a=Math.min((e.x+e.width)*t.k+t.x,n.width),o=Math.min((e.y+e.height)*t.k+t.y,n.height),s=Math.max(0,a-r)*Math.max(0,o-i),c=e.width*t.k*e.height*t.k;return c>0&&s*2>=c}function pz(e){return[...e.querySelectorAll(`*`)].filter(e=>!e.hasAttribute(tM))}function mz(e,t){let n=pz(e).indexOf(t);return n===-1?null:n}function hz(e,t){return pz(e)[t]??null}function gz(e){return e.querySelector(`style[data-frameboard]`)?.getAttribute(`data-hash`)??null}var _z=e=>`calc(${e}px / var(--zoom, 1))`,vz=`${_z(1.5)} solid var(--primary)`;function yz(e,t){return`${e.width} × ${t===`height`?`Hug`:e.height}`}function bz(e,t){return{left:e.x-(t?.x??0),top:e.y-(t?.y??0),width:e.width,height:e.height}}function xz(e,t,n,r){let i=kz(e,`[data-selection]`);if(!i)return;i.style.transform=`translate(${t}px, ${n}px)`,Az(i,`[data-handles]`,!0),Az(i,`[data-chip]`,!0);let a=kz(i,`[data-move-chip]`);a&&(a.hidden=!1,a.textContent=`${r.x}, ${r.y}`)}function Sz(e,t){let n=kz(e,`[data-selection]`),r=XM(Object.values(t));if(!n||!r)return;Object.assign(n.style,Oz(bz(r)));for(let[e,i]of Object.entries(t)){let t=kz(n,`[data-outline="${CSS.escape(e)}"]`);t&&Object.assign(t.style,Oz(bz(i,r)))}let i=kz(n,`[data-chip]`);i&&Object.keys(t).length===1&&(i.textContent=yz(r))}function Cz(e,t,n){let r=kz(e,`[data-marquee]`);r&&(r.hidden=t===null,t&&Object.assign(r.style,Oz(bz(t)))),kz(e,`[data-marquee-hits]`)?.replaceChildren(...n.map(e=>{let t=document.createElement(`div`);return t.className=`absolute`,Object.assign(t.style,Oz(bz(e)),{outline:vz}),t}))}function wz(e,t,n){kz(e,`[data-guides]`)?.replaceChildren(...t.map(e=>Ez(e.axis===`x`?`vertical`:`horizontal`,e)),...n.flatMap(e=>[Ez(e.axis===`x`?`horizontal`:`vertical`,e),Dz(e)]))}function Tz(e){let t=kz(e,`[data-selection]`);if(t){let e=t.hasAttribute(`data-inside`);t.style.transform=``,Az(t,`[data-handles]`,e),Az(t,`[data-chip]`,e),Az(t,`[data-move-chip]`,!0)}Cz(e,null,[]),wz(e,[],[])}function Ez(e,{at:t,from:n,to:r}){let i=document.createElement(`div`);return i.className=`absolute bg-guide`,i.dataset.guide=e,Object.assign(i.style,e===`vertical`?{left:`${t}px`,top:`${n}px`,height:`${r-n}px`,width:_z(1)}:{top:`${t}px`,left:`${n}px`,width:`${r-n}px`,height:_z(1)}),i}function Dz(e){let t=document.createElement(`span`),n=Math.round(e.to-e.from);t.dataset.gap=String(n),t.textContent=String(n),t.className=`absolute origin-top-left rounded-[4px] bg-guide px-[5px] py-px text-[10px] leading-[14px] text-white tabular-nums`;let r=(e.from+e.to)/2;return Object.assign(t.style,{left:`${e.axis===`x`?r:e.at}px`,top:`${e.axis===`x`?e.at:r}px`,transform:`scale(calc(1 / var(--zoom, 1))) translate(-50%, -120%)`}),t}function Oz(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,`${t}px`]))}function kz(e,t){return e.querySelector(t)}function Az(e,t,n){let r=kz(e,t);r&&(r.hidden=n)}var jz=[`nw`,`ne`,`sw`,`se`],Mz=`${_z(1)} dashed var(--primary)`,Nz=1e6,Pz=`absolute top-full left-1/2 origin-top-left rounded-[4px] bg-primary px-1.5 py-0.5 text-[10px] leading-[14px] whitespace-nowrap text-primary-foreground tabular-nums [transform:scale(calc(1/var(--zoom,1)))_translate(-50%,6px)]`;function Fz({frames:e}){let t=cP(e=>e.frames),n=cP(e=>!!e.element),r=e.filter(e=>t.includes(e.ref)),i=rN(r),a=XM(i.map(e=>e.box)),o=XM(eN(r).map(e=>e.box)),s=IM(),c=r.some(e=>e.ref in s);return(0,Z.jsxs)(`div`,{"data-overlay":!0,className:`pointer-events-none absolute top-0 left-0`,style:{zIndex:Nz},children:[a?(0,Z.jsx)(Iz,{frames:i,bounds:a,size:o??a,previewed:c,inside:n}):null,(0,Z.jsx)(`div`,{"data-marquee-hits":!0}),(0,Z.jsx)(`div`,{"data-marquee":!0,hidden:!0,className:`absolute bg-primary/10`,style:{border:`${_z(1)} solid var(--primary)`}}),(0,Z.jsx)(`div`,{"data-guides":!0})]})}function Iz({frames:e,bounds:t,size:n,previewed:r,inside:i}){let a=e.length>1;return(0,Z.jsxs)(`div`,{"data-selection":!0,"data-inside":i||void 0,className:`absolute`,style:{...bz(t),...i?{outline:Mz,outlineOffset:_z(1)}:{outline:vz}},children:[a?e.map(e=>(0,Z.jsx)(`div`,{"data-outline":e.ref,className:`absolute`,style:{...bz(e.box,t),outline:vz}},e.ref)):null,(0,Z.jsx)(`div`,{"data-handles":!0,hidden:i,children:jz.map(e=>(0,Z.jsx)(`span`,{"data-handle":e,className:`absolute -translate-1/2 border-primary bg-white`,style:{left:e.endsWith(`w`)?0:`100%`,top:e.startsWith(`n`)?0:`100%`,width:_z(7),height:_z(7),borderWidth:_z(1.5)}},e))}),(0,Z.jsx)(`span`,{"data-chip":!0,hidden:i,className:Pz,children:a?`${e.length} frames`:`${r?`Stored `:``}${yz(n)}`}),(0,Z.jsx)(`span`,{"data-move-chip":!0,hidden:!0,className:Pz})]})}var Lz=2e3,Rz=1;function zz({frames:e,container:t}){let n=G_(e=>e.mode===`play`),[r,i]=(0,_.useState)({}),a=(0,_.useRef)(e);if((0,_.useLayoutEffect)(()=>{a.current=e},[e]),(0,_.useEffect)(()=>{if(!t||n)return;let e=new Set,r=(t,n,r)=>{let a=Rz++,{width:o,height:s}=UM(t,t.box,LM(t.ref)),c=n.whole?[{x:0,y:0,width:o,height:s}]:n.elements.flatMap(e=>{let t=hz(r,e);if(!t)return[];let n=t.getBoundingClientRect();return[{x:n.left,y:n.top,width:n.width,height:n.height}]});if(Yv.add(n.id),c.length===0)return;i(e=>({...e,[t.ref]:{key:a,boxes:c}})),Jv.setState(e=>({glowing:{...e.glowing,[t.ref]:a}}));let l=setTimeout(()=>{e.delete(l),i(e=>{if(e[t.ref]?.key!==a)return e;let{[t.ref]:n,...r}=e;return r}),Jv.setState(e=>{if(e.glowing[t.ref]!==a)return e;let{[t.ref]:n,...r}=e.glowing;return{glowing:r}})},Lz);e.add(l)},o=()=>{let{unseen:e}=Dv.getState(),{replays:n}=Jv.getState(),i=[];for(let o of a.current){let a=e[o.ref];if(!a)continue;let s=o.ref in n;if(Yv.has(a.id)&&!s)continue;let c=t.querySelector(`[data-frame="${CSS.escape(o.ref)}"] iframe`)?.contentDocument;c&&gz(c)===a.hash&&(s&&i.push(o.ref),r(o,a,c))}i.length>0&&Jv.setState(e=>({replays:Object.fromEntries(Object.entries(e.replays).filter(([e])=>!i.includes(e)))}))};o(),t.addEventListener(`load`,o,!0);let s=Dv.subscribe((e,t)=>{e.unseen!==t.unseen&&o()}),c=Jv.subscribe((e,t)=>{e.replays!==t.replays&&o()});return()=>{t.removeEventListener(`load`,o,!0),s(),c();for(let t of e)clearTimeout(t);i({}),Jv.setState({glowing:{}})}},[t,n]),n)return null;let o=new Map(e.map(e=>[e.ref,e]));return Object.entries(r).flatMap(([e,{key:t,boxes:n}])=>{let r=o.get(e);return r?n.map((n,i)=>(0,Z.jsx)(`span`,{"data-change-glow":e,"aria-hidden":!0,className:`pointer-events-none absolute rounded-[calc(8px/var(--zoom,1))] bg-[color-mix(in_srgb,var(--claim)_12%,transparent)] motion-safe:animate-change-glow`,style:{left:`calc(${r.box.x+n.x}px - ${_z(4)})`,top:`calc(${r.box.y+n.y}px - ${_z(4)})`,width:`calc(${n.width}px + ${_z(8)})`,height:`calc(${n.height}px + ${_z(8)})`,boxShadow:`0 0 0 ${_z(2)} var(--claim), 0 0 ${_z(18)} color-mix(in srgb, var(--claim) 55%, transparent)`,zIndex:Nz-1}},`${t}-${i}`)):[]})}function Bz(e){return e.slice(0,1).toUpperCase()}var Vz=`claude`;function Hz(e){let[t,n]=e.split(` · `);return n===void 0||!t?Vz:t}function Uz(e,t){let n=Math.max(0,Math.floor((t-Date.parse(e))/1e3));return n<60?`${n}s`:`${Math.floor(n/60)}m`}function Wz(){let[e,t]=(0,_.useState)(()=>Date.now());return(0,_.useEffect)(()=>{let e=setInterval(()=>t(Date.now()),1e3);return()=>clearInterval(e)},[]),e}var Gz=`pointer-events-none w-[280px] rounded-[10px] border border-[color-mix(in_srgb,var(--claim)_50%,var(--border))] bg-card px-3 py-2.5 text-xs leading-[1.45] text-card-foreground shadow-[0_10px_30px_rgba(0,0,0,0.3)]`;function Kz({page:e,frames:t}){let n=WO(),r=G_(e=>e.mode===`play`);(0,_.useEffect)(()=>{r&&JO()},[r]),(0,_.useEffect)(()=>()=>JO(),[e]);let i=n.length>0;(0,_.useEffect)(()=>{if(!i)return;let e=e=>{e.key===`Escape`&&JO()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i]);let a=eN(t);if(r)return null;let o=Jz(n);return a.flatMap(e=>{let t=o.get(e.ref);return t?(0,Z.jsx)(`div`,{className:`absolute origin-top-left [transform:scale(calc(1/var(--zoom,1)))]`,style:{left:`calc(${e.box.x}px + ${_z(72)})`,top:`calc(${e.box.y+e.box.height}px - ${_z(38)})`,zIndex:Nz+1},children:(0,Z.jsx)(Yz,{frame:e.name,...t})},e.ref):[]})}function qz({frames:e}){let t=WO();if(G_(e=>e.mode===`play`))return null;let n=new Set(e.map(e=>e.ref)),r=[...Jz(t)].filter(([e])=>!n.has(e));return r.length===0?null:(0,Z.jsx)(`div`,{"data-waiting-dock":!0,className:`absolute bottom-[4.25rem] left-4 flex flex-col gap-2`,style:{zIndex:Nz+1},children:r.map(([e,t])=>(0,Z.jsx)(Yz,{frame:e.slice(e.lastIndexOf(`/`)+1),...t},e))})}function Jz(e){let t=new Map;for(let n of e)for(let e of n.holders)t.set(e.frame,{label:n.label,holder:e});return t}function Yz({frame:e,label:t,holder:n}){let r=Wz(),i=`${Bz(n.tag)}${n.tag.slice(1)}`;return(0,Z.jsxs)(`div`,{"data-waiting-card":n.frame,role:`status`,className:Gz,children:[(0,Z.jsxs)(`b`,{className:`block font-semibold`,children:[i,` is editing `,e]}),(0,Z.jsxs)(`span`,{className:`text-muted-foreground`,children:[`Your `,t,` will wait until it finishes, about`,` `,(0,Z.jsx)(`span`,{"data-waiting-elapsed":!0,children:Uz(n.claimedAt,r)}),` so far.`]})]})}function Xz(e,t,n){let r=n.width/t.k,i=n.height/t.k,a=-t.x/t.k-r,o=-t.y/t.k-i,s=a+3*r,c=o+3*i,l=new Set;for(let{ref:t,box:n}of e)n.x<s&&n.x+n.width>a&&n.y<c&&n.y+n.height>o&&l.add(t);return l}function Zz(e){let t=N()(()=>({byRef:{}})),n=(e,n,r)=>{let i=t.getState().byRef[e];i&&i.version>r||t.setState(t=>({byRef:{...t.byRef,[e]:{...n,version:r}}}))},r=(e,n)=>{let r=t.getState().byRef[e];r&&r.version>=n||i(e,n)},i=(t,r)=>{n(t,{status:`loading`},r),e(t).then(e=>n(t,{status:`ready`,tree:e},r),e=>n(t,{status:`refused`,message:e instanceof Error?e.message:String(e)},r))},a=(e,n)=>(r(e,n),new Promise(n=>{let r=()=>{let r=t.getState().byRef[e];return!r||r.status===`loading`?!1:(n(r.status===`ready`?r.tree:null),!0)};if(r())return;let i=t.subscribe(()=>{r()&&i()})}));return{store:t,request:r,read:a,catchUp:async(e,n,r)=>{let o=await a(e,r),s=t.getState().byRef[e];!o||o.hash===n||!s||s.version>r||(i(e,r),await a(e,r))}}}async function Qz(e,t=fetch){let n=await t(`/api/frames/elements?ref=${encodeURIComponent(e)}`),r=await n.json().catch(()=>null);if(!r)throw Error(`The board answered ${n.status}.`);if(!r.ok)throw Error(r.error.message);return r.data}var $z=Zz(e=>Qz(e));function eB(e){let t=$z.store.getState().byRef[e];return t?.status===`ready`?t.tree:null}function tB(e){let t=z_(t=>e?t.reloads[e]??0:0);return(0,_.useEffect)(()=>{e&&$z.request(e,t)},[e,t]),F($z.store,t=>e?t.byRef[e]??null:null)}function nB(e){$z.request(e,R_.getState().reloads[e]??0)}function rB(e,t){return $z.catchUp(e,t,R_.getState().reloads[e]??0)}function iB(e){return $z.read(e,R_.getState().reloads[e]??0)}function aB(e,t){return e.find(e=>e.parent===t)?.index}function oB(e,t){return e.find(e=>e.index===t)?.parent}function sB(e,t,n){let r=oB(e,t);if(r===void 0)return;let i=e.filter(e=>e.parent===r),a=i.findIndex(e=>e.index===t),o=i.length;return i[(a+n+o)%o]?.index}function cB(e,t){let n=oB(e,t);if(n===void 0)return;let r=e.filter(e=>e.parent===n),i=r.findIndex(e=>e.index===t);return i<0?void 0:{place:i,count:r.length}}function lB(e,t,n){let r=oB(e,t),i=e[0];if(r===void 0||!i)return;let a=e.filter(e=>e.parent===r),o=a.findIndex(e=>e.index===t),s=n(o,a.length);if(s===o||s<0||s>=a.length)return;let c=a.filter(e=>e.index!==t);return{parent:r??i.index-1,before:c[s]?.index??null}}var uB=new Map,dB=new Map;function fB({frame:e,index:t}){return`${e}\n${t}`}function pB(e){return dB.get(fB(e))??null}function mB(e){dB.delete(fB(e))}function hB(e,t,n,r={}){return gB(t.frame,i=>_B(i,e,t,n,r)).then(e=>e!==null)}function gB(e,t){let n=t(uB.get(e));return uB.set(e,n),n.finally(()=>{uB.get(e)===n&&uB.delete(e)})}async function _B(e,t,n,r,{selection:i=sP,send:a=fetch,notify:o=({copy:e,...t})=>n_.add({...t,type:`warning`,...e===void 0?{}:{actionProps:{children:`Copy text`,onClick:()=>void navigator.clipboard.writeText(e)}}})}){let s=e?await e:void 0;if(s===null)return aP(i,vB),null;let c=s!==void 0&&s.from.includes(n.hash),l=c?s.at.get(n.index):void 0,u=c&&(!s.shifted||l!==void 0),d=u?s.to:n.hash,f=u?l??n.index:n.index,p=()=>{};try{let e=await qO([n.frame],`edit`,async()=>{p=tP(n.frame),rP(n.frame,d);try{return await Qx(`/api/frames/edit`,{ref:n.frame,index:f,hash:d,change:r},`POST`,a)}catch(e){throw p(),e}}),o=e.from!==void 0&&e.from!==d;o&&e.from&&rP(n.frame,e.from),rP(n.frame,e.hash);let{page:l,frames:u,element:m}=i.getState(),h=!m&&l===t&&u.length===1&&u[0]===n.frame;(m?.frame===n.frame&&(m.index===n.index||m.index===f)||o&&h)&&JN(i,t,{frame:n.frame,index:e.index,hash:e.hash}),p(),oP(i,vB);let g=new Map(c?s.at:[]);return g.set(n.index,e.index),{from:c?[...s.from,d]:[n.hash],to:e.hash,at:g,shifted:c&&s.shifted||o}}catch(e){if(!(e instanceof zO)){let t=r.kind===`text`?r.value:void 0,i=e instanceof Zx&&e.code===`stale-address`,a=i&&t!==void 0&&e.details.moved===!1;a&&dB.set(fB(n),t),o({title:`Edit not saved`,description:e instanceof Zx?yB(e.message)+(a?` Press Enter to apply your text anyway.`:``):`The board could not be reached, so nothing was written.`,...i&&t!==void 0?{copy:t}:{}})}return p(),aP(i,vB),null}}function vB(e){let t=document.querySelector(`[data-frame="${CSS.escape(e)}"] iframe`)?.contentDocument;return t?gz(t):null}function yB(e){let t=/^\S+\.html\b/.test(e)?e:e.charAt(0).toUpperCase()+e.slice(1);return/[.!?]$/.test(t)?t:`${t}.`}function bB(e,t,n,r,i){return{onPreview:r=>i?.(e,r?n(r(t)):null),onCommit:i=>r({kind:`style`,property:e,value:n(i(t))})}}var xB={width:240,height:135},SB=3e3,CB=1e4;function wB(e,t){let n=e&&e.width>0&&e.height>0?e:xB,r=Math.min(1,t>0?t/n.width:1,CB/n.width,CB/n.height);return{width:Math.max(1,Math.round(n.width*r)),height:Math.max(1,Math.round(n.height*r))}}function TB(e,t,n=SB){return t===`svg`?DB(e):new Promise(r=>{let i=t===`video`?document.createElement(`video`):new Image,a=e=>{clearTimeout(o),i.removeAttribute(`src`),r(e&&e.width>0&&e.height>0?e:null)},o=setTimeout(()=>a(null),n);i.addEventListener(`error`,()=>a(null),{once:!0}),i instanceof HTMLVideoElement?(i.preload=`metadata`,i.muted=!0,i.addEventListener(`loadedmetadata`,()=>a({width:i.videoWidth,height:i.videoHeight}),{once:!0})):i.addEventListener(`load`,()=>a({width:i.naturalWidth,height:i.naturalHeight}),{once:!0}),i.src=e})}var EB=/^\s*(\d+(?:\.\d+)?)(?:px)?\s*$/;async function DB(e){let t;try{let n=await fetch(e);if(!n.ok)return null;t=await n.text()}catch{return null}let n=new DOMParser().parseFromString(t,`image/svg+xml`).documentElement;if(n.localName!==`svg`)return null;let r=EB.exec(n.getAttribute(`width`)??``)?.[1],i=EB.exec(n.getAttribute(`height`)??``)?.[1];if(r&&i)return OB(Number(r),Number(i));let a=(n.getAttribute(`viewBox`)??``).trim().split(/[\s,]+/).map(Number);return a.length===4?OB(a[2]??0,a[3]??0):null}function OB(e,t){return e>0&&t>0?{width:Math.round(e),height:Math.round(t)}:null}var kB=new Set([`HTML`,`BODY`]);function AB(e,t,n){let r=[...t].filter(e=>!e.hidden&&jB(e.box,n)).sort((e,t)=>t.order-e.order)[0];if(!r)return null;let i=e.querySelector(`[data-frame="${CSS.escape(r.ref)}"] iframe`),a=i?.contentDocument,o=a?.elementFromPoint(n.x-r.box.x,n.y-r.box.y),s=i?.dataset.renderedAt??null,c=a&&o&&s&&!kB.has(o.tagName)?mz(a,o):null;return{frame:{ref:r.ref,name:r.name},element:c,renderedAt:c===null?null:s,at:n}}function jB(e,{x:t,y:n}){return t>=e.x&&t<e.x+e.width&&n>=e.y&&n<e.y+e.height}var MB=new Set(`area.br.col.embed.hr.iframe.img.input.link.meta.noscript.object.picture.script.select.source.style.template.textarea.title.track.video.audio.canvas.wbr.p.h1.h2.h3.h4.h5.h6.pre.button.label.a`.split(`.`)),NB=`http://www.w3.org/1999/xhtml`;function PB(e,t){if(e.localName===`body`)return!0;if(e.namespaceURI!==NB||MB.has(e.localName)||e.childElementCount===0||e.closest(`svg, math`))return!1;let n=t.getComputedStyle(e).display;return n.startsWith(`inline`)||n===`contents`?!1:![...e.childNodes].some(e=>e.nodeType===Node.TEXT_NODE&&(e.textContent??``).trim()!==``)}function FB(e){let t=e.display;if(t.endsWith(`grid`))return{row:!0,reverse:!1,flow:!0};if(!t.endsWith(`flex`))return{row:!1,reverse:!1,flow:!1};let n=e.flexDirection;return{row:n.startsWith(`row`),reverse:n.endsWith(`reverse`),flow:!0}}function IB(e,t){let n=e.ownerDocument,r=e=>{let n=t.getComputedStyle(e);return n.position!==`static`||n.transform!==`none`},i=e===n.body||e===n.documentElement?null:e;for(let t=e;t&&!i;)r(t)&&(i=t),t=t.parentElement;if(!i)return{x:0-t.scrollX,y:0-t.scrollY};let a=i.getBoundingClientRect();return{x:a.left+i.clientLeft-i.scrollLeft,y:a.top+i.clientTop-i.scrollTop}}function LB(e,t,n,r){if(!n){let n=t.top+t.height/2;return r?e.y>n:e.y<n}if(e.y<t.top)return!0;if(e.y>t.bottom)return!1;let i=t.left+t.width/2;return r?e.x>i:e.x<i}function RB(e,t){let n=e.defaultView,r=e.body;if(!n||!r)return null;let i=e.elementFromPoint(t.x,t.y);for(i&&r.contains(i)||(i=r);i&&!PB(i,n);)i=i.parentElement;let a=i&&mz(e,i);if(!i||a==null)return null;let o=n.getComputedStyle(i),{row:s,reverse:c,flow:l}=FB(o),u=[...i.children].flatMap(t=>{let n=mz(e,t),r=t.getBoundingClientRect();return n!==null&&(r.width>0||r.height>0)?[{index:n,box:r}]:[]}),d=u.findIndex(({box:e})=>LB(t,e,s,c)),f=d===-1?u.at(-1):u[d-1],p=d===-1?void 0:u[d],m=e=>Number.parseFloat(o.getPropertyValue(`padding-${e}`))||0;return{parent:a,before:p?.index??null,row:s,flow:l,origin:IB(i,n),room:Math.max(0,i.clientWidth-m(`left`)-m(`right`)),line:zB(i.getBoundingClientRect(),o,s,c,{after:f?.box,ahead:p?.box})}}function zB(e,t,n,r,{after:i,ahead:a}){let o=e=>Number.parseFloat(t.getPropertyValue(`padding-${e}`))||0,s={left:e.left+o(`left`),right:e.right-o(`right`),top:e.top+o(`top`),bottom:e.bottom-o(`bottom`)};if(n){let e=r?a:i,t=r?i:a,n=e&&t?(e.right+t.left)/2:e?.right??t?.left??s.left,o=a??i,c=o?.top??s.top,l=o?.bottom??s.bottom;return{x:n,y:c,width:0,height:Math.max(0,l-c)}}let c=r?a:i,l=r?i:a,u=c&&l?(c.bottom+l.top)/2:c?.bottom??l?.top??s.top;return{x:s.left,y:u,width:Math.max(0,s.right-s.left),height:0}}function BB(e,t,n){let r=AB(e,t,n),i=t.find(e=>e.ref===r?.frame.ref);if(!i)return null;let a=HB(e,i.ref),o=a?gz(a):null,s=a&&o?RB(a,{x:n.x-i.box.x,y:n.y-i.box.y}):null;return o&&s?{frame:i,hash:o,gap:s}:null}function VB(e,t,n,{frame:r,index:i}){let a=BB(e,t,n),o=a?.frame.ref===r?HB(e,r):null,s=o?hz(o,i):null,c=o&&a?hz(o,a.gap.parent):null;if(!a||!o||!s||!c||s.contains(c))return null;let l=s.nextElementSibling;return c===s.parentElement&&(a.gap.before===i||a.gap.before===(l?mz(o,l):null))?null:a}function HB(e,t){return e.querySelector(`[data-frame="${CSS.escape(t)}"] iframe`)?.contentDocument??null}var UB=`tool.image`,WB=[{kind:`rectangle`,id:`tool.rectangle`,label:`Rectangle`,key:`r`,icon:Si},{kind:`ellipse`,id:`tool.ellipse`,label:`Ellipse`,key:`o`,icon:Yt},{kind:`divider`,id:`tool.divider`,label:`Divider`,key:`l`,icon:br}],GB=N()(()=>({shape:`rectangle`})),KB=N()(()=>({placing:`auto`}));function qB(e){let{placing:t}=KB.getState();return t===`free`||t===`auto`&&!e.flow}var JB=N()(()=>({file:null})),YB=N()(()=>({open:!1}));function XB(e){JB.setState({file:e}),YB.setState({open:!1}),W_.setState({tool:`image`,mode:`edit`}),G()}var ZB=N()(()=>({carried:null})),QB=null;function $B(e){QB=e}function eV(){let e=QB;return QB=null,e}function tV(e){return WB.find(t=>t.kind===e)??WB[0]}function nV(){return tV(F(GB,e=>e.shape))}function rV(){let{mode:e,tool:t}=W_.getState();return e===`edit`?t===`text`?`text`:t===`image`?JB.getState().file?`asset`:null:t===`shape`?GB.getState().shape:null:null}function iV(e){return e===`text`||e===`shape`||e===`image`}var aV=()=>R_.getState().canWrite,oV=()=>iV(W_.getState().tool);function sV(){(0,_.useEffect)(()=>{let e=ye([{id:`tool.text`,label:`Text`,group:`tool`,command:{label:`Add text`,icon:Xi},keys:[`t`],enabled:aV,run:()=>W_.setState({tool:`text`,mode:`edit`}),checked:()=>W_.getState().mode===`edit`&&W_.getState().tool===`text`},...WB.map(e=>({id:e.id,label:e.label,group:`tool`,command:{label:`Add ${/^[aeiou]/i.test(e.label)?`an`:`a`} ${e.label.toLowerCase()}`,icon:e.icon},keys:[e.key],enabled:aV,run:()=>{GB.setState({shape:e.kind}),W_.setState({tool:`shape`,mode:`edit`}),G()},checked:()=>W_.getState().mode===`edit`&&W_.getState().tool===`shape`&&GB.getState().shape===e.kind})),{id:UB,label:`Image or video`,group:`tool`,command:{label:`Add an image or video`,icon:Hn},keys:[`$mod+Shift+KeyK`],enabled:aV,run:()=>YB.setState({open:!0}),checked:()=>W_.getState().mode===`edit`&&W_.getState().tool===`image`}]),t=R_.subscribe((e,t)=>{e.canWrite!==t.canWrite&&(G(),!e.canWrite&&(YB.setState({open:!1}),oV()&&W_.setState({tool:`move`})))});return()=>{t(),e(),YB.setState({open:!1}),oV()&&W_.setState({tool:`move`})}},[])}var cV=100;async function lV(e,t,n,r,i,{selection:a=sP,mode:o=W_,live:s=R_,send:c=fetch,notify:l=e=>n_.add({...e,type:`warning`}),size:u,asset:d,corner:f}={}){let p=BB(e,n,r);if(!p||i===`asset`&&!d)return null;let{gap:m}=p,h=i!==`divider`&&qB(m)?{...uV(i,f??r,p,!f&&!u),...KB.getState().placing===`auto`?{orFlow:!0}:{}}:void 0,g=i===`asset`&&d?{kind:i,path:d.path,...u??wB(d.natural,m.room)}:i===`divider`?{kind:i,vertical:m.row}:i===`text`||!u?{kind:i}:{kind:i,...u};return gV(p,`Nothing placed`,e=>({url:`/api/frames/insert`,body:{ref:p.frame.ref,hash:e,parent:m.parent,before:m.before,element:g,...h?{at:h}:{}}}),e=>{JN(a,t,e),o.setState({tool:`move`})},{live:s,send:c,notify:l})}function uV(e,t,{frame:n,gap:r},i){let a=i&&(e===`rectangle`||e===`ellipse`)?cV/2:0,o=e=>Math.round(e*100)/100;return{left:o(t.x-n.box.x-r.origin.x-a),top:o(t.y-n.box.y-r.origin.y-a)}}async function dV(e,t,n,r,i,{measure:a=TB,...o}={}){let s=o.size?null:await a(Nj(i.project,i.path),i.kind);return lV(e,t,n,r,`asset`,{...o,asset:{path:i.path,natural:s}})}async function fV(e,t,n,r,i,{selection:a=sP,live:o=R_,send:s=fetch,notify:c=e=>n_.add({...e,type:`warning`})}={}){let l=VB(e,n,r,i);return l?gV(l,`Nothing moved`,e=>({url:`/api/frames/move`,body:{ref:i.frame,hash:e,index:i.index,parent:l.gap.parent,before:l.gap.before}}),e=>JN(a,t,e),{live:o,send:s,notify:c}):null}async function pV(e,t,n,{selection:r=sP,live:i=R_,send:a=fetch,notify:o=e=>n_.add({...e,type:`warning`}),tree:s=hV}={}){let c=t.frame,l=i.getState().claims[c];if(l)return o({title:`Nothing moved`,description:`${l.tag} is editing ${c.split(`/`).at(-1)??c}, so nothing was written.`}),null;let u=null;return await gB(c,async i=>{let l=i?await i:void 0;if(l===null)return null;let d=l!==void 0&&l.from.includes(t.hash),f=d?l.moves?.get(mV(t.hash,t.index))??l.at.get(t.index):void 0,p=d&&(!l.shifted||f!==void 0),m=p?l.to:t.hash,h=p?f??t.index:t.index,g=await s(c,m);if(!g)return o({title:`Nothing moved`,description:`The frame changed since it was read, so nothing was written.`}),null;let _=lB(g.elements,h,n);if(!_)return l??{from:[m],to:m,at:new Map,shifted:!1};let v=tP(c);rP(c,m);try{let n=await Qx(`/api/frames/move`,{ref:c,hash:m,index:h,parent:_.parent,before:_.before},`POST`,a);rP(c,n.hash),rB(c,n.hash),u={frame:c,index:n.index,hash:n.hash},JN(r,e,u);let i=new Map(d?l.at:[]);i.set(t.index,n.index);let o=new Map;for(let[e,t]of d&&l.moves||[])t===h&&o.set(e,n.index);return o.set(mV(t.hash,t.index),n.index),o.set(mV(m,h),n.index),{from:d?[...l.from,m]:[m],to:n.hash,at:i,shifted:!0,moves:o}}catch(e){return o({title:`Nothing moved`,description:e instanceof Zx?yB(e.message):`The board could not be reached, so nothing was written.`}),null}finally{v()}}),u}function mV(e,t){return`${e}\n${t}`}async function hV(e,t){let n=eB(e);if(n?.hash===t)return n;let r=await Qz(e).catch(()=>null);return r?.hash===t?r:null}async function gV({frame:e,hash:t},n,r,i,{live:a,send:o,notify:s}){let c=e.ref,l=a.getState().claims[c];if(l)return s({title:n,description:`${l.tag} is editing ${e.name}, so nothing was written.`}),null;let u=null;return await gB(c,async e=>{let a=e?await e:void 0;if(a===null)return null;let l=a!==void 0&&a.from.includes(t)&&!a.shifted?a.to:t,d=tP(c);rP(c,l);try{let{url:e,body:t}=r(l),n=await Qx(e,t,`POST`,o);return rP(c,n.hash),rB(c,n.hash),u={frame:c,index:n.index,hash:n.hash},i(u),{from:[l],to:n.hash,at:new Map,shifted:!0}}catch(e){return s({title:n,description:e instanceof Zx?yB(e.message):`The board could not be reached, so nothing was written.`}),null}finally{d()}}),u}async function _V(e,t,{selection:n=sP,live:r=R_,send:i=fetch,notify:a=e=>n_.add({...e,type:`warning`})}={}){let o=t.frame;return await gB(o,async s=>{let c=s?await s:void 0;if(c===null)return null;let l=c!==void 0&&c.from.includes(t.hash)&&!c.shifted?c.to:t.hash,u=()=>{};try{let a=await qO([o],`delete`,async()=>{u=tP(o),rP(o,l);try{return await Qx(`/api/frames/remove`,{ref:o,index:t.index,hash:l},`POST`,i)}catch(e){throw u(),e}},{live:r});return rP(o,a.hash),rB(o,a.hash),KN(n,e,[o]),{from:[l],to:a.hash,at:new Map,shifted:!0}}catch(e){return e instanceof zO||a({title:`Nothing deleted`,description:e instanceof Zx?yB(e.message):`The board could not be reached, so nothing was written.`}),null}finally{u()}})!==null}var vV=new Map;function yV({frame:e,index:t}){return`${e}\n${t}`}async function bV(e,t,n,{selection:r=sP,live:i=R_,send:a=fetch,notify:o=e=>n_.add({...e,type:`warning`}),inline:s}={}){let c=t.frame,l=n?`Nothing placed`:`Nothing moved`,u=vV.get(yV(t))??{},d=n?[]:[`width`,`height`].filter(e=>u[e]!==void 0&&s?.[e]===u[e]),f=i.getState().claims[c];return f?(o({title:l,description:`${f.tag} is editing ${c.split(`/`).at(-1)??c}, so nothing was written.`}),!1):await gB(c,async i=>{let s=i?await i:void 0;if(s===null)return null;let u=s!==void 0&&s.from.includes(t.hash)&&!s.shifted,f=u?s.to:t.hash,p=u?s.at.get(t.index)??t.index:t.index,m=tP(c);rP(c,f);try{let i=await Qx(`/api/frames/place`,{ref:c,hash:f,index:p,spot:n,...d.length>0?{drop:d}:{}},`POST`,a);rP(c,i.hash),rB(c,i.hash),JN(r,e,{frame:c,index:i.index,hash:i.hash});let o=yV({frame:c,index:i.index});n?vV.set(o,Object.fromEntries(i.sized.map(e=>[e,`${n[e]??0}px`]))):vV.delete(o);let l=new Map(u?s.at:[]);return l.set(t.index,i.index),{from:u?[...s.from,f]:[f],to:i.hash,at:l,shifted:!1}}catch(e){return o({title:l,description:e instanceof Zx?yB(e.message):`The board could not be reached, so nothing was written.`}),null}finally{m()}})!==null}var xV=[`layer`,`stack`,`order`];function SV(){let e=document.activeElement;return!e||e===document.body||e.closest(`[data-canvas]`)!==null&&e.closest(`[data-note-marker], [data-note-card]`)===null}function CV(e){let{selection:t,mode:n}=e,r=()=>{let{page:r,frames:i,element:a}=t.getState(),o=i[0];if(n.getState().mode!==`edit`||r!==e.page()||i.length!==1||!o)return null;let s=e.treeOf(o);return!s||a&&a.hash!==s.hash?null:{page:r,frame:o,at:a?.index??null,tree:s}},i=e=>{let n=()=>{let t=r();if(!t)return;let n=e(t.tree.elements,t.at);return n===void 0?void 0:{...t,next:n}};return{enabled:()=>n()!==void 0,run:()=>{let e=n();if(!e)return;let{page:r,frame:i,next:a,tree:o}=e;if(a===null)KN(t,r,[i]);else{let e={frame:i,index:a,hash:o.hash};JN(t,r,e)}}}},a=e=>(t,n)=>n===null?void 0:e(t,n),o=t=>({enabled:()=>e.boardFocused()&&t.enabled(),run:t.run}),s=i(a(oB)),c=()=>{let{page:r,element:i}=t.getState();return n.getState().mode===`edit`&&r===e.page()&&!!i},l=n=>({enabled:()=>c()&&e.writable()&&e.boardFocused(),run:()=>{let{page:r,element:i}=t.getState();r&&i&&e.move(r,i,e=>e+n)}}),u=n=>{let i=()=>{let e=r();if(!e||e.at===null)return!1;let t=cB(e.tree.elements,e.at);if(!t)return!1;let i=n(t.place,t.count);return i!==t.place&&i>=0&&i<t.count};return{enabled:()=>c()&&e.writable()&&i(),run:()=>{let{page:r,element:i}=t.getState();r&&i&&e.move(r,i,n)}}};return[{id:`element.down`,label:`Select child`,group:`selection`,palette:!1,keys:[`Enter`],...o(i(aB))},{id:`element.up`,label:`Select parent`,group:`selection`,palette:!1,keys:[`Escape`],enabled:()=>c()&&(e.noteOpen()||n.getState().tool===`move`&&s.enabled()),run:()=>{e.noteOpen()||s.run()}},{id:`element.delete`,label:`Delete`,group:`selection`,command:{label:`Delete element`,icon:Hi,keywords:[`remove`]},keys:[`Backspace`,`Delete`],enabled:()=>c()&&e.writable(),run:()=>{let{page:n,element:r}=t.getState();n&&r&&e.remove(n,r)}},{id:`element.moveUp`,label:`Move up among siblings`,group:`selection`,palette:!1,keys:[`Alt+Shift+ArrowUp`],...l(-1)},{id:`element.moveDown`,label:`Move down among siblings`,group:`selection`,palette:!1,keys:[`Alt+Shift+ArrowDown`],...l(1)},{id:`element.toFront`,label:`Bring to front`,group:`selection`,command:{label:`Bring to front`,icon:Ct,keywords:xV},...u((e,t)=>t-1)},{id:`element.forward`,label:`Bring forward`,group:`selection`,command:{label:`Bring forward`,icon:xt,keywords:xV},...u(e=>e+1)},{id:`element.backward`,label:`Send backward`,group:`selection`,command:{label:`Send backward`,icon:pt,keywords:xV},...u(e=>e-1)},{id:`element.toBack`,label:`Send to back`,group:`selection`,command:{label:`Send to back`,icon:mi,keywords:xV},...u(()=>0)},{id:`element.next`,label:`Select next sibling`,group:`selection`,palette:!1,keys:[`Tab`],...o(i(a((e,t)=>sB(e,t,1))))},{id:`element.previous`,label:`Select previous sibling`,group:`selection`,palette:!1,keys:[`Shift+Tab`],...o(i(a((e,t)=>sB(e,t,-1))))}]}function wV(e){(0,_.useEffect)(()=>{let t=ye(CV({page:()=>e,selection:sP,mode:W_,treeOf:eB,noteOpen:()=>zN.getState().open!==null,boardFocused:SV,writable:()=>R_.getState().canWrite,remove:(e,t)=>void _V(e,t),move:(e,t,n)=>void pV(e,t,n)})),n=()=>{let{frames:e}=sP.getState();e.length===1&&e[0]&&nB(e[0])};n();let r=[sP.subscribe(n),R_.subscribe((e,t)=>{e.reloads!==t.reloads&&n()}),sP.subscribe(G),W_.subscribe(G),R_.subscribe((e,t)=>{e.canWrite!==t.canWrite&&G()}),zN.subscribe(G),$z.store.subscribe(G)];return()=>{for(let e of r)e();t()}},[e])}var TV=N()(()=>({held:null}));function EV(e){TV.setState({held:e})}function DV(){return TV.getState().held}var OV=1;function kV(e){let t=e.defaultView,n=e.body;if(!t||!n)return[];let r=t.innerWidth,i=t.innerHeight,a=[],o=[];return pz(e).forEach((e,s)=>{if(!n.contains(e)||e===n||o.some(t=>t.contains(e))||t.getComputedStyle(e).position===`fixed`)return;let c=e.getBoundingClientRect();(c.width!==0||c.height!==0)&&(c.left<-1||c.top<-1||c.right>r+OV||c.bottom>i+OV)&&!AV(e,n)&&(o.push(e),a.push({index:s,box:{x:Math.round(c.left),y:Math.round(c.top),width:Math.round(c.width),height:Math.round(c.height)}}))}),a}function AV(e,t){let n=e.ownerDocument.defaultView;if(!n)return!1;let r=e=>n.getComputedStyle(e),i=e=>{let t=e.parentElement;if(r(e).position!==`absolute`)return t;for(;t&&r(t).position===`static`&&r(t).transform===`none`;)t=t.parentElement;return t};for(let n=i(e);n&&n!==t&&t.contains(n);n=i(n)){let e=r(n);if(e.overflowX!==`visible`||e.overflowY!==`visible`)return!0}return!1}function jV(e,t,n){let r=n.width/t.width,i=n.height/t.height;return Object.fromEntries(Object.entries(e).map(([e,a])=>{let o=Math.round(n.x+(a.x-t.x)*r),s=Math.round(n.y+(a.y-t.y)*i),c=Math.round(n.x+(a.x+a.width-t.x)*r),l=Math.round(n.y+(a.y+a.height-t.y)*i);return[e,{x:o,y:s,width:Math.max(1,c-o),height:Math.max(1,l-s)}]}))}function MV(e,t,n,r){let i=t===`nw`||t===`sw`,a=t===`nw`||t===`ne`,o=Math.round(e.x),s=Math.round(e.y),c=Math.round(e.x+e.width),l=Math.round(e.y+e.height),u=i?Math.min(Math.round(o+n),c-1):o,d=a?Math.min(Math.round(s+r),l-1):s;return{x:u,y:d,width:i?c-u:Math.max(1,Math.round(c+n)-o),height:a?l-d:Math.max(1,Math.round(l+r)-s)}}function NV(e,t,n){return e===`grid`||e===`inline-grid`?`grid`:e!==`flex`&&e!==`inline-flex`?`block`:n===`nowrap`?t.startsWith(`column`)?`vertical`:`horizontal`:`wrap`}function PV(e){let[t,n]=(0,_.useState)(null),r=e?.frame,i=e?.index,a=e?.hash,o=e?`${r}:${i}`:null;return(0,_.useEffect)(()=>{if(r===void 0||i===void 0||o===null)return;let e=document.querySelector(`[data-frame="${CSS.escape(r)}"] iframe`);if(!e)return;let t=()=>{let t=e.contentDocument;if(!t||gz(t)!==a)return;let r=hz(t,i),s=t.defaultView;r&&s&&n({at:o,live:IV(r,s)})};return t(),e.addEventListener(`load`,t),()=>e.removeEventListener(`load`,t)},[r,i,a,o]),t?.at===o?t.live:null}function FV(e){let[t,n]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let t=`[data-frame="${CSS.escape(e)}"]`,r=t=>{let r=t?.contentDocument,i=r?gz(r):null,a=r?.body?mz(r,r.body):null;i!==null&&a!==null&&n({frame:e,index:a,hash:i})},i=e=>{let n=e.target;n instanceof HTMLIFrameElement&&n.closest(t)&&r(n)};return r(document.querySelector(`${t} iframe`)),document.addEventListener(`load`,i,!0),()=>document.removeEventListener(`load`,i,!0)},[e]),t?.frame===e?t:null}function IV(e,t){let n=t.getComputedStyle(e),r=e.textContent??``,i=[n.borderTopWidth,n.borderRightWidth,n.borderBottomWidth,n.borderLeftWidth];return{opacity:Number(n.opacity),radius:Math.round(parseFloat(n.borderTopLeftRadius)||0),fontFamily:n.fontFamily,fontSize:KV(n.fontSize),fontWeight:Number(n.fontWeight),lineHeight:n.lineHeight===`normal`?null:KV(n.lineHeight),letterSpacing:n.letterSpacing===`normal`?0:KV(n.letterSpacing),textAlign:JV(n.textAlign,n.direction),textDecorationLine:n.textDecorationLine,textTransform:n.textTransform,textWrapStyle:n.getPropertyValue(`text-wrap-style`)||`auto`,truncated:n.textOverflow===`ellipsis`&&n.overflowX!==`visible`&&n.getPropertyValue(`text-wrap-mode`)===`nowrap`,display:n.display,color:n.color,bordered:i.some(e=>parseFloat(e)>0),holdsText:r.trim()!==``,textOnly:e.childElementCount===0&&r.trim()!==``,text:r,rotation:{degrees:HV(n.rotate),scale:UV(n.scale),own:GV(e,t),translated:WV(n.transform)},placement:LV(e,n,t),layout:BV(e,n,t),inline:qV(e)}}function LV(e,t,n){let r=t.position===`absolute`||t.position===`fixed`,i=e=>{let t=parseFloat(e);return Number.isNaN(t)?null:Math.round(t)},a=i(t.width),o=i(t.height),s=`style`in e?e.style:null,c={width:s?.getPropertyValue(`width`)??``,height:s?.getPropertyValue(`height`)??``};if(r&&t.left.endsWith(`px`)&&t.top.endsWith(`px`))return{free:r,left:Math.round(parseFloat(t.left)),top:Math.round(parseFloat(t.top)),width:a,height:o,inline:c,wordsLeft:null};let l=e.ownerDocument,u=e.parentElement,d=e=>{let t=n.getComputedStyle(e);return t.position!==`static`||t.transform!==`none`},f=null;if(t.position!==`fixed`){if(!r&&u&&u!==l.body&&u!==l.documentElement)f=u;else for(let e=u;e&&!f;e=e.parentElement)d(e)&&(f=e)}let p=t.position===`fixed`?0:-n.scrollX,m=t.position===`fixed`?0:-n.scrollY;if(f){let e=f.getBoundingClientRect();p=e.left+f.clientLeft-f.scrollLeft,m=e.top+f.clientTop-f.scrollTop}let h=e.getBoundingClientRect(),g=parseFloat(t.marginLeft)||0,_=zV(e,t);return{free:r,left:Math.round(h.left-p-g),top:Math.round(h.top-m-(parseFloat(t.marginTop)||0)),width:a,height:o,inline:c,wordsLeft:_===null?null:Math.round(_-p-g)}}var RV=3;function zV(e,t){if(!(e.childNodes.length>0&&[...e.childNodes].every(e=>e.nodeType===RV)&&e.textContent?.trim()))return null;let n=e.ownerDocument.createRange();n.selectNodeContents(e);let r=(parseFloat(t.borderLeftWidth)||0)+(parseFloat(t.paddingLeft)||0);return n.getBoundingClientRect().left-r}function BV(e,t,n){let r=e.parentElement,i=r?n.getComputedStyle(r):null,a=`offsetWidth`in e?e:null,o=e=>KV(e)||0;return{flow:NV(t.display,t.flexDirection,t.flexWrap),inline:t.display.startsWith(`inline-`),direction:t.flexDirection,wrap:t.flexWrap,justify:t.justifyContent,alignItems:t.alignItems,ownJustify:!!a?.style.getPropertyValue(`justify-content`),rowGap:t.rowGap===`normal`?0:o(t.rowGap),columnGap:t.columnGap===`normal`?0:o(t.columnGap),padding:{top:o(t.paddingTop),right:o(t.paddingRight),bottom:o(t.paddingBottom),left:o(t.paddingLeft)},parent:i?NV(i.display,i.flexDirection,i.flexWrap):`block`,parentAlignItems:i?.alignItems??`normal`,width:Math.round(a?.offsetWidth??0),height:Math.round(a?.offsetHeight??0)}}var VV={deg:1,grad:.9,rad:180/Math.PI,turn:360};function HV(e){if(e===`none`||e===``)return 0;let t=/^(-?[\d.]+(?:e[+-]?\d+)?)(deg|grad|rad|turn)$/.exec(e),n=t?.[2]?VV[t[2]]:void 0;return!t||n===void 0?null:Math.round(Number(t[1])*n*100)/100}function UV(e){if(e===`none`||e===``)return{x:1,y:1};let t=e.split(/\s+/).map(e=>e.endsWith(`%`)?parseFloat(e)/100:Number(e)),[n,r=n,i=1]=t;return n===void 0||r===void 0||t.some(Number.isNaN)||t.length>3||i!==1?null:{x:n,y:r}}function WV(e){if(e===`none`||e===``)return!1;let t=/^matrix(3d)?\(([^)]*)\)$/.exec(e);if(!t?.[2])return!0;let n=t[2].split(`,`).map(Number);return(t[1]?n.slice(12,15):n.slice(4,6)).some(e=>e!==0)}function GV(e,t){let n=`style`in e?e:null,r=!!n?.style.getPropertyValue(`rotate`),i=!!n?.style.getPropertyValue(`scale`);if(!n||!r&&!i)return{};let a=n.getAttribute(`style`);n.style.removeProperty(`rotate`),n.style.removeProperty(`scale`);let o=t.getComputedStyle(n),s={...r?{rotate:HV(o.rotate)}:{},...i?{scale:UV(o.scale)}:{}};return a===null?n.removeAttribute(`style`):n.setAttribute(`style`,a),s}function KV(e){return Math.round(parseFloat(e)*100)/100}function qV(e){let t=`style`in e?e.style:null,n=t?Array.from({length:t.length},(e,n)=>t.item(n)):[];return{color:n.includes(`color`),backgroundColor:n.includes(`background-color`),background:/(?:^|;)\s*background\s*:/i.test(e.getAttribute(`style`)??``),border:n.some(e=>e.startsWith(`border-`)&&!e.endsWith(`-radius`))}}function JV(e,t){return e===`start`?t===`rtl`?`right`:`left`:e===`end`?t===`rtl`?`left`:`right`:e}function YV(e,t,n,r=XV){let[i,a]=(0,_.useState)(null),o=e===null?null:`${e}:${t??``}`;return(0,_.useEffect)(()=>{if(e===null||o===null)return;let n=!0;return r(e,t).catch(()=>null).then(e=>{n&&e&&a({at:o,styles:e})}),()=>{n=!1}},[e,t,n,o,r]),i?.at===o?i.styles:null}async function XV(e,t){let n=new URLSearchParams({ref:e});t!==void 0&&n.set(`index`,String(t));let r=await(await fetch(`/api/frames/styles?${n}`)).json();return r.ok?r.data:null}var ZV=new Map;function QV(e,t,n){let r=`${e.frame}:${e.index}:${t}`,i=document.querySelector(`[data-frame="${CSS.escape(e.frame)}"] iframe`)?.contentDocument,a=i?hz(i,e.index):null,o=a&&`style`in a?a:null,s=ZV.get(r);if(n===null){if(ZV.delete(r),!s||s.element!==o||!o)return;s.value===``?o.style.removeProperty(t):o.style.setProperty(t,s.value,s.priority),o.getAttribute(`style`)===``&&o.removeAttribute(`style`)}else o&&(s?.element!==o&&ZV.set(r,{element:o,value:o.style.getPropertyValue(t),priority:o.style.getPropertyPriority(t)}),o.style.setProperty(t,n,`important`))}function $V(e){return e?e.localName===`img`||e.localName===`video`?`media`:e.childElementCount>0?null:(e.textContent??``).trim()===``?e.localName===`div`?`box`:null:`text`:null}function eH(e){let t=$V(e),n=e.ownerDocument.defaultView?.getComputedStyle(e);return!t||!n||HV(n.rotate)!==0||t===`text`&&n.display===`inline`?null:{kind:t,natural:nH(e),hugsHeight:t===`text`&&!aH(e),inset:tH(n)}}function tH(e){if(e.boxSizing!==`content-box`)return{width:0,height:0};let t=(...e)=>e.reduce((e,t)=>e+(parseFloat(t)||0),0);return{width:t(e.paddingLeft,e.paddingRight,e.borderLeftWidth,e.borderRightWidth),height:t(e.paddingTop,e.paddingBottom,e.borderTopWidth,e.borderBottomWidth)}}function nH(e){let[t,n]=rH(e)?[e.naturalWidth,e.naturalHeight]:iH(e)?[e.videoWidth,e.videoHeight]:[0,0];return t>0&&n>0?{width:t,height:n}:null}function rH(e){return e.localName===`img`}function iH(e){return e.localName===`video`}function aH(e){let t=`style`in e?e.style.height:``;return t!==``&&t!==`auto`}function oH(e,t){let n=e.querySelector(`[data-frame="${CSS.escape(t.frame)}"] iframe`)?.contentDocument;if(!n||gz(n)!==t.hash)return null;let r=hz(n,t.index);return r?eH(r):null}function sH(e,t,n,r,i,a=e){let{width:o,height:s}=MV(e,t,n,r);if(!i||a.width<=0||a.height<=0)return{width:o,height:s};let c=Math.max(o/a.width,s/a.height);return{width:Math.max(1,Math.round(a.width*c)),height:Math.max(1,Math.round(a.height*c))}}function cH(e,t,n,r,i,a){return e.kind===`text`?sH(t,n,r,0,!1):sH(t,n,r,i,a,e.natural??t)}function lH({kind:e,inset:t},{width:n,height:r}){let i=(e,t)=>`${Math.max(0,Math.round(e-t))}px`,a={property:`width`,value:i(n,t.width)};return e===`text`?[a]:[a,{property:`height`,value:i(r,t.height)}]}function uH(e,t,n){let r=R_.getState().claims[t.frame];if(r)return n_.add({title:`Nothing resized`,description:`${r.tag} is editing ${t.frame.split(`/`).at(-1)}, so nothing was written.`,type:`warning`}),null;let i=()=>{QV(t,`width`,null),QV(t,`height`,null)};return{preview:e=>{for(let{property:r,value:i}of lH(n,e))QV(t,r,i)},commit:async r=>{let a=await hB(e,t,{kind:`styles`,declarations:lH(n,r)});return a||i(),a},cancel:i}}function dH(e,t){let n=e.querySelector(`[data-frame="${CSS.escape(t.frame)}"] iframe`)?.contentDocument;if(!n||gz(n)!==t.hash)return null;let r=hz(n,t.index),i=r?n.defaultView?.getComputedStyle(r):void 0;if(!i||i.position!==`absolute`&&i.position!==`fixed`)return null;let a=parseFloat(i.left),o=parseFloat(i.top);return Number.isNaN(a)||Number.isNaN(o)?null:{left:a,top:o}}function fH(e,t){let n=R_.getState().claims[t.frame];if(n)return n_.add({title:`Nothing moved`,description:`${n.tag} is editing ${t.frame.split(`/`).at(-1)}, so nothing was written.`,type:`warning`}),null;let r=e=>{QV(t,`left`,e?`${e.left}px`:null),QV(t,`top`,e?`${e.top}px`:null)};return{preview:r,commit:async({left:n,top:i})=>{let a=await hB(e,t,{kind:`styles`,declarations:[{property:`left`,value:`${n}px`},{property:`top`,value:`${i}px`}]});return a||r(null),a},cancel:()=>r(null)}}var pH=[{left:0,top:0},{left:`100%`,top:0},{left:0,top:`100%`},{left:`100%`,top:`100%`}];function mH({frames:e,container:t}){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(hH,{frames:e,container:t}),(0,Z.jsx)(vH,{frames:e,container:t})]})}function hH({frames:e,container:t}){let n=cP(e=>e.frames),r=G_(e=>e.mode===`edit`&&e.tool===`move`),i=eN(e);return _H(t,r?n:[]).map(({key:e,box:t})=>{let n=i.find(({ref:t})=>t===e.frame);return n?(0,Z.jsx)(`div`,{"data-element-ghost":!0,"data-ghost-frame":e.frame,"data-ghost-index":e.index,"data-ghost-hash":e.hash,className:`pointer-events-none absolute bg-primary/28`,style:{left:n.box.x+t.x,top:n.box.y+t.y,width:t.width,height:t.height,outline:`${_z(1.5)} dashed var(--primary)`,outlineOffset:_z(2),clipPath:gH(t,n.box),zIndex:Nz}},`${e.frame}:${e.index}`):null})}function gH(e,t){let n=_z(8),r=`calc(0px - ${n})`,i=`calc(100% + ${n})`,a=`${-e.x}px`,o=`${-e.y}px`,s=`${t.width-e.x}px`,c=`${t.height-e.y}px`;return`polygon(evenodd, ${r} ${r}, ${i} ${r}, ${i} ${i}, ${r} ${i}, ${r} ${r}, ${a} ${o}, ${a} ${c}, ${s} ${c}, ${s} ${o}, ${a} ${o})`}function _H(e,t){let[n,r]=(0,_.useState)(null),i=t.join(`
|
|
69
|
+
`);return(0,_.useEffect)(()=>{if(!e||i===``)return;let t=i.split(`
|
|
70
|
+
`),n=t=>e.querySelector(`[data-frame="${CSS.escape(t)}"] iframe`),a=new WeakSet,o=new WeakSet,s=new WeakSet,c=0,l=()=>{c===0&&(c=requestAnimationFrame(f))},u=new ResizeObserver(e=>{let t=e.filter(({target:e})=>!o.has(e));for(let{target:e}of t)o.add(e);t.length<e.length&&l()}),d=new MutationObserver(l),f=()=>{c=0;let e=t.flatMap(e=>{let t=n(e);if(!t)return[];a.has(t)||(a.add(t),u.observe(t));let r=t.contentDocument,i=r?gz(r):null;return!r||i===null?[]:(s.has(r)||(s.add(r),d.observe(r,{attributes:!0,attributeFilter:[`style`],subtree:!0})),kV(r).map(({index:t,box:n})=>({key:{frame:e,index:t,hash:i},box:n})))});r({key:i,ghosts:e})};return f(),e.addEventListener(`load`,f,!0),()=>{e.removeEventListener(`load`,f,!0),cancelAnimationFrame(c),u.disconnect(),d.disconnect()}},[e,i]),n?.key===i?n.ghosts:[]}function vH({frames:e,container:t}){let n=cP(e=>e.element??null),r=e.find(e=>e.ref===n?.frame),i=$M(r?.ref??``),a=yH(t,n),o=a?.box??null,s=F(TV,e=>e.held),c=i??r?.box,l=s!==null&&s.key.frame===n?.frame,u=l&&o!==null&&!bH(s.key,n);(0,_.useEffect)(()=>{s&&(!l||u)&&EV(null)},[s,l,u]);let d=l&&!u?s.box:c&&o?{...o,x:c.x+o.x,y:c.y+o.y}:null;if(!d)return null;let f=l&&!u?s.read:a?.read??null;return(0,Z.jsxs)(`div`,{"data-element-selection":!0,className:`pointer-events-none absolute`,style:{left:d.x,top:d.y,width:d.width,height:d.height,outline:vz,outlineOffset:_z(2),zIndex:Nz},children:[f?pH.map(e=>(0,Z.jsx)(`span`,{"data-element-corner":!0,className:`absolute -translate-1/2 border-primary bg-white`,style:{...e,width:_z(7),height:_z(7),borderWidth:_z(1.5)}},`${e.left}-${e.top}`)):null,(0,Z.jsx)(`span`,{"data-chip":!0,className:Pz,children:yz(d,f?.hugsHeight?`height`:void 0)})]})}function yH(e,t){let[n,r]=(0,_.useState)(null),i=t?.frame,a=t?.index,o=t?.hash,s=t?`${i}:${a}:${o}`:null;return(0,_.useEffect)(()=>{if(!e||s===null||i===void 0||a===void 0)return;let t=()=>{},n=()=>{t();let n=e.querySelector(`[data-frame="${CSS.escape(i)}"] iframe`)?.contentDocument,c=n&&gz(n)===o?hz(n,a):null,l=n?.defaultView;if(!c||!l){r({key:s,at:null});return}let u=()=>{let e=c.getBoundingClientRect();r({key:s,at:{box:{x:Math.round(e.left),y:Math.round(e.top),width:Math.round(e.width),height:Math.round(e.height)},read:eH(c)}})};u();let d=new l.ResizeObserver(u);d.observe(c),d.observe(c.ownerDocument.documentElement),l.addEventListener(`scroll`,u,!0),t=()=>{d.disconnect(),l.removeEventListener(`scroll`,u,!0)}};return n(),e.addEventListener(`load`,n,!0),()=>{e.removeEventListener(`load`,n,!0),t()}},[e,s,i,a,o]),n?.key===s?n.at:null}function bH(e,t){return t!==null&&e.frame===t.frame&&e.index===t.index&&e.hash===t.hash}function xH(e,t,n,r){let i=AB(e,t,n);if(!i||i.element===null)return null;let a=e.querySelector(`[data-frame="${CSS.escape(i.frame.ref)}"] iframe`)?.contentDocument,o=a?gz(a):null;if(!a||!o)return null;let s=r(i.frame.ref);if(s?.hash!==o)return null;for(let e=hz(a,i.element);e&&e!==a.body;e=e.parentElement){let t=mz(a,e);if(t!==null&&s.elements.find(e=>e.index===t)?.tag===e.localName)return{frame:i.frame.ref,index:t,hash:o}}return null}async function SH(e,t,n,r){let i=AB(e,t,n);if(!i||i.element===null)return null;let a=await r(i.frame.ref);return a?xH(e,t,n,()=>a):null}function CH(e,t,n,r){let i=0,a=0,o=!1,s=()=>{!o&&a!==i&&t.getState().canWrite&&(o=!0,a=i,r({tab:n,...wH(e.getState())}).catch(()=>{}).finally(()=>{o=!1,s()}))},c=()=>{i+=1,s()};c();let l=e.subscribe(c),u=t.subscribe((e,t)=>{e.canWrite&&!t.canWrite&&c()});return()=>{u(),l()}}function wH({page:e,frames:t,element:n}){return{page:e,frames:[...t],element:n?{ref:n.frame,index:n.index,hash:n.hash}:null}}function TH({className:e,...t}){return(0,Z.jsx)(`kbd`,{"data-slot":`kbd`,className:Q(`pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3`,e),...t})}function EH({className:e,...t}){return(0,Z.jsx)(`kbd`,{"data-slot":`kbd-group`,className:Q(`inline-flex items-center gap-1`,e),...t})}function DH({className:e,...t}){return(0,Z.jsx)(`textarea`,{"data-slot":`textarea`,className:Q(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function OH(e){let{nativeEvent:t,currentTarget:n}=e;return t instanceof InputEvent&&(t.inputType===`historyUndo`||t.inputType===`historyRedo`)&&n.ownerDocument.activeElement!==n}var kH=/\r\n|\r|\n/g;function AH({text:e,disabled:t,write:n,element:r}){let[i,a]=(0,_.useState)(()=>pB(r)),[o,s]=(0,_.useState)(null);o&&o.over!==e&&s(null);let c=o?.over===e?o.value:null,[l,u]=(0,_.useState)(!1),d=(0,_.useRef)(!1),f=()=>{d.current?d.current=!1:i!==null&&(a(null),mB(r),i!==e&&(s({value:i,over:e}),n({kind:`text`,value:i}).then(e=>{e||(s(null),a(pB(r)))})))};return(0,Z.jsxs)(`section`,{"aria-labelledby":`inspector-text`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,Z.jsx)(`h2`,{id:`inspector-text`,className:`mb-2 text-xs font-semibold`,children:`Text`}),(0,Z.jsx)(DH,{"aria-labelledby":`inspector-text`,value:i??c??e,disabled:t,onChange:e=>{OH(e)||a(e.currentTarget.value.replace(kH,` `))},onFocus:()=>u(!0),onBlur:()=>{u(!1),f()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),e.shiftKey||f()),e.key===`Escape`&&(a(null),mB(r),d.current=!0,e.currentTarget.blur())},className:`max-h-28 min-h-11 resize-none overflow-y-auto rounded-md border-0 bg-input px-2 py-1.5 text-xs leading-[1.4] md:text-xs dark:bg-input`}),(0,Z.jsxs)(`p`,{className:Q(`mt-2.5 flex items-center gap-1 text-(length:--text-caption) font-normal text-muted-foreground`,!l&&`invisible`),children:[(0,Z.jsx)(TH,{children:`Enter`}),` to apply, `,(0,Z.jsx)(TH,{children:`Esc`}),` to cancel`]})]})}var jH=`data-frameboard-editing`;function MH(e,t,n){let r=e.defaultView,i=hz(e,t.index);if(!r||gz(e)!==t.hash||!(i instanceof r.HTMLElement)||i.childElementCount>0||(i.textContent??``).trim()===``)return null;let a=i,o=a.textContent??``,s=!0,c=()=>{s=!1,a.removeAttribute(`contenteditable`),a.removeAttribute(jH),a.removeEventListener(`keydown`,d),a.removeEventListener(`paste`,f),a.removeEventListener(`blur`,u),r.removeEventListener(`pagehide`,c)},l=()=>{s&&(c(),a.textContent=o)};function u(){if(!s)return;c();let e=(a.textContent??``).replace(kH,` `);a.textContent=e,e!==o&&n({kind:`text`,value:e}).then(e=>{!e&&a.isConnected&&(a.textContent=o)})}function d(e){e.key===`Enter`&&(e.preventDefault(),e.shiftKey?p(` `):u()),e.key===`Escape`&&(e.preventDefault(),l())}function f(e){e.preventDefault(),p((e.clipboardData?.getData(`text/plain`)??``).replace(kH,` `))}let p=t=>{let n=r.getSelection()?.getRangeAt(0);if(!n||!a.contains(n.commonAncestorContainer))return;n.deleteContents();let i=e.createTextNode(t);n.insertNode(i),n.setStartAfter(i),n.collapse(!0),a.normalize()};a.setAttribute(`contenteditable`,`plaintext-only`),a.setAttribute(jH,``),a.addEventListener(`keydown`,d),a.addEventListener(`paste`,f),a.addEventListener(`blur`,u),r.addEventListener(`pagehide`,c),a.focus();let m=e.createRange();m.selectNodeContents(a);let h=r.getSelection();return h?.removeAllRanges(),h?.addRange(m),l}function NH(e,t){return e.querySelector(`[data-frame="${CSS.escape(t)}"] iframe`)?.contentDocument??null}function PH(e,t,n,r){let i=t.find(e=>e.ref===n.frame),a=i&&NH(e,i.ref),o=a&&hz(a,n.index);if(!i||!o)return!1;let s=o.getBoundingClientRect(),c=r.x-i.box.x,l=r.y-i.box.y;return c>=s.left&&c<s.right&&l>=s.top&&l<s.bottom}function FH(e,t,n,r){let i=null,a=()=>{e.removeEventListener(`load`,o,!0),s()};function o(){let r=NH(e,t.frame);i=r?MH(r,t,n):null,i&&a()}let s=r.subscribe(({element:e})=>{(e?.frame!==t.frame||e.index!==t.index)&&a()});return e.addEventListener(`load`,o,!0),o(),()=>{a(),i?.()}}function IH({name:e,label:t,onCommit:n,onCancel:r,hug:i=!1,clearable:a=!1}){let o=(0,_.useRef)(null),s=(0,_.useRef)(!1),[c,l]=(0,_.useState)(e);(0,_.useEffect)(()=>{o.current?.focus(),o.current?.select()},[]);let u=t=>{if(s.current)return;s.current=!0;let i=o.current?.value.trim()??``;t&&(a||i!==``)&&i!==e?n(i):r()},d=(0,Z.jsx)(`input`,{ref:o,"aria-label":t,value:c,onChange:e=>l(e.target.value),size:i?1:void 0,spellCheck:!1,onClick:e=>e.preventDefault(),onKeyDown:e=>{if(e.key===`Enter`)u(!0);else if(e.key===`Escape`)u(!1);else return;e.preventDefault(),e.stopPropagation()},onBlur:()=>u(!0),className:Q(`h-[22px] min-w-0 rounded-[5px] bg-background px-1.5 text-foreground ring-[1.5px] ring-primary outline-none selection:bg-primary/45`,i?`col-start-1 row-start-1 w-full`:`-ml-1.5 flex-1`)});return i?(0,Z.jsxs)(`span`,{className:`-ml-1.5 inline-grid max-w-[calc(100%+0.375rem)] min-w-0 grid-cols-[minmax(0,auto)]`,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1 h-0 px-1.5 whitespace-pre`,children:`${c} `}),d]}):d}var LH=_.createContext(void 0);function RH(e){let t=_.useContext(LH);if(t===void 0&&!e)throw Error(ao(47));return t}var zH={...wp,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!wp.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&wp.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>wp.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},BH=class extends Mo{constructor(e,t,n){let r=new hp;super(VH(e,r,t,n),HH(r),zH)}setOpen=(e,t)=>{let n=t.reason===wd,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=cp(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=sp(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),wu.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function VH(e,t,n,r=!1){let i={...vp(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function HH(e){return{popupRef:_.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:_.createRef(),beforeTriggerFocusGuardRef:_.createRef(),beforeContentFocusGuardRef:_.createRef(),stickIfOpenTimeout:new fs,stickIfOpen:!0,triggerElements:e}}var UH=_o(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=GH(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),mp(u,d),dp(u);let{forceUnmount:m}=fp(d,u,()=>{u.context.stickIfOpen=!0,u.set(`openChangeReason`,null)});u.useSyncedValues({modal:o}),_.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),_.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,bd(qd))}),[m,u]);let h=d||f||s!=null;return(0,Z.jsxs)(LH.Provider,{value:u,children:[s&&(0,Z.jsx)(ip,{handle:s,store:u}),h&&(0,Z.jsx)(KH,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function WH(e){return RH(!0)?(0,Z.jsx)(UH,{props:e}):(0,Z.jsx)(Ff,{children:(0,Z.jsx)(UH,{props:e})})}function GH(e,t){let n=rp((e,n)=>new BH(t,e,n));return _.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function KH({store:e,modal:t}){let n=Zf(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return pp(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}function qH(e){return id(e,`base-ui`)}function JH(e,t){function n(n,r,i){let a=n.currentTarget;wu.flushSync(()=>{e.setOpen(!1,bd(Pd,n.nativeEvent,a))}),Tl(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&El(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function YH(e){let t=_.useRef(``),n=_.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:_.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function XH(e,t){let n=_.useRef(e),r=J(t);q(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function ZH(e,t){let{onClick:n,onPointerDown:r}=YH(J((n,r)=>{(typeof e==`function`?e():e)||t(r||(Ts?`touch`:``))}));return _.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function QH(e){let[t,n]=_.useState(null),r=ZH(e,n);return XH(e,t=>{t&&!e&&n(null)}),_.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var $H=vo(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=RH(!0),h=Tp(s)??m;if(!h)throw Error(ao(74));let g=qH(f),v=h.useState(`isTriggerActive`,g),y=h.useState(`floatingRootContext`),b=h.useState(`isOpenedByTrigger`,g),x=h.useState(`triggerPopupId`,g),S=_.useRef(null),{registerTrigger:C,isMountedByThisTrigger:w}=up(g,S,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),T=h.useState(`isPressOpenedByTrigger`,g),E=h.useState(`isTouchPressOpen`,l),D=h.useState(`hasTriggerFocusGuards`,g),O=Fp(y,{enabled:!a&&l&&!E,mouseOnly:!0,move:!1,handleClose:Zp(),restMs:u,delay:{close:d},triggerElementRef:S,isActiveTrigger:v,isClosing:()=>h.select(`transitionStatus`)===`ending`}),k=Gf(y,{stickIfOpen:J(()=>h.context.stickIfOpen)}),A=ZH(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),j=h.useState(`triggerProps`,w),{getButtonProps:M,buttonRef:N}=hd({disabled:a,native:o}),P={open(e){return T?ac.open(e):ic.open(e)}},{handlePreFocusGuardFocus:F,handleFocusTargetFocus:I}=JH(h,S),L=uu(`button`,e,{state:{disabled:a,open:b},ref:[N,t,C,S],props:[k.reference,O,j,A,{[Au]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":b,"aria-controls":x},p,M],stateAttributesMapping:P}),R=(0,Z.jsx)(_.Fragment,{children:L},g);return D?(0,Z.jsxs)(_.Fragment,{children:[(0,Z.jsx)(Rl,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:F}),R,(0,Z.jsx)(Rl,{ref:h.context.triggerFocusTargetRef,onFocus:I})]}):R}),eU=_.createContext(void 0);function tU(){let e=_.useContext(eU);if(e===void 0)throw Error(ao(45));return e}var nU=_.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return RH().useState(`mounted`)||n?(0,Z.jsx)(eU.Provider,{value:n,children:(0,Z.jsx)($d,{ref:t,...r})}):null}),rU=_.createContext(void 0);function iU(){let e=_.useContext(rU);if(!e)throw Error(ao(46));return e}var aU=_.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,Z.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function oU(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=_.useRef(null),o=_.useRef(null),s=Du(r);q(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),q(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}var sU={},cU={},lU=``;function uU(e,t){return Bo(e)?e:t}function dU(e,t,n){return/hidden|clip/.test(e.getComputedStyle(uU(t,n)).overflowY)}function fU(e){if(typeof document>`u`)return!1;let t=is(e);return Y(t).innerWidth-t.documentElement.clientWidth>0}function pU(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=is(e),n=t.documentElement,r=t.body,i=uU(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function mU(e){let t=is(e),n=t.documentElement,r=t.body,i=uU(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function hU(e){let t=is(e),n=t.documentElement,r=t.body,i=Y(n),a=0,o=0,s=!1,c=ls.create();if(As&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,sU={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},lU=n.style.scrollBehavior,cU={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=uU(n,r);s=pU(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,sU),Object.assign(r.style,cU),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=lU)}function d(){u(),c.request(l)}l();let f=as(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var gU=new class{lockCount=0;restore=null;timeoutLock=fs.create();timeoutUnlock=fs.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=is(e),n=t.documentElement,r=t.body,i=Y(n);if(dU(i,n,r)){let t=new i.MutationObserver(()=>{dU(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=Ts||!fU(e);this.restore=a?mU(e):hU(e)}};function _U(e=!0,t=null){q(()=>{if(e)return gU.acquire(t)},[e,t])}var vU=20;function yU(e,t,n,r){let[i,a]=_.useState(!1);q(()=>{if(!e||!t||n==null){a(!1);return}let r=is(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-vU)},[e,t,n]),_U(e&&(!t||i),r)}var bU=_.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=Iu,..._}=e,v=RH(),y=tU(),b=Nf(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=_h({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:v.useState(`adaptiveOrigin`)});oU({store:v,domReference:x.useState(`domReferenceElement`),positionerElement:O,open:C});let M=E===!0&&w!==`trigger-hover`;yU(C&&M,D===`touch`,O,T);let N=v.useStateSetter(`positionerElement`),P=xh(e,{open:C,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:k},{styles:j.positionerStyles,transitionStatus:A,props:_,refs:[t,N],hidden:!S,inert:!C});return(0,Z.jsxs)(rU.Provider,{value:j,children:[S&&M&&(0,Z.jsx)(aU,{inert:yu(!C),cutout:T}),(0,Z.jsx)(Pf,{id:b,children:P})]})}),xU=`ArrowUp`,SU=`ArrowDown`,CU=`ArrowLeft`,wU=`ArrowRight`,TU=`Home`,EU=`PageUp`,DU=`PageDown`,OU=new Set([xU,SU,CU,wU,TU,`End`]),kU=[`Shift`,`Control`,`Alt`,`Meta`];function AU(e){return Ro(e)&&e.tagName===`INPUT`}function jU(e){return!!(AU(e)&&e.selectionStart!=null||Ro(e)&&e.tagName===`TEXTAREA`)}function MU(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=NU(e,t,`left`),a=PU(e),o=PU(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=NU(e,t,`top`),r=PU(e),i=PU(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function NU(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function PU(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var FU=_.createContext(void 0);function IU(e){let t=_.useContext(FU);if(t===void 0&&!e)throw Error(ao(69));return t}var LU=_.createContext(void 0);function RU(){let[e,t]=_.useState(0),n=J(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:_.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var zU=_.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=RH(),l=iU(),u=IU(!0)!=null,{context:d,hasClosePart:f}=RU(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);Ou({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),Np(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?np(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=uu(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...tp,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&OU.has(e.key)&&e.stopPropagation()}},bh(g),s],stateAttributesMapping:sc});return(0,Z.jsx)(Wf,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:Ro(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,Z.jsx)(LU.Provider,{value:d,children:M})})}),BU=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=RH(),s=qH(a.id);return o.useSyncedValueWithCleanup(`titleElementId`,s),uu(`h2`,e,{ref:t,props:[{id:s},a]})});function VU({...e}){return(0,Z.jsx)(WH,{"data-slot":`popover`,...e})}function HU({...e}){return(0,Z.jsx)($H,{"data-slot":`popover-trigger`,...e})}function UU({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,anchor:a,...o}){return(0,Z.jsx)(nU,{children:(0,Z.jsx)(bU,{align:t,alignOffset:n,side:r,sideOffset:i,anchor:a,className:`isolate z-50`,children:(0,Z.jsx)(zU,{"data-slot":`popover-content`,className:Q(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o})})})}function WU({className:e,...t}){return(0,Z.jsx)(BU,{"data-slot":`popover-title`,className:Q(`font-medium`,e),...t})}function GU(){return N()(()=>({ref:null,mode:`flip`,hash:null,split:.5}))}var KU=GU();function qU(e){return F(KU,e)}var JU={compare:KU,unseen:Dv,held:async(e,t)=>{try{return(await fetch(aM(e,`light`,void 0,t),{cache:`no-store`})).ok}catch{return!1}}};async function YU(e,t,{compare:n,unseen:r,held:i}=JU){let a=r.getState().base[e];if(!a)return;let o=n.getState();o.ref===e&&o.hash===a?n.setState({mode:t}):await i(e,a)?r.getState().base[e]===a&&n.setState({ref:e,mode:t,hash:a,split:.5}):(hv(r,e),n_.add({title:`The version before is gone`,description:`The server keeps it until it restarts or 200 later changes land.`,type:`warning`}))}function XU(e=KU){e.getState().ref!==null&&e.setState({ref:null,hash:null})}function ZU(e,t=KU){let{ref:n}=t.getState(),r=n&&document.querySelector(`[data-frame="${CSS.escape(n)}"]`);if(!r)return;let{left:i,width:a}=r.getBoundingClientRect();a<=0||t.setState({split:Math.min(1,Math.max(0,(e-i)/a))})}var QU={...JU,selection:sP,mode:W_};function $U(e=QU){(0,_.useEffect)(()=>{let{compare:t,unseen:n,selection:r,mode:i}=e,a=()=>i.getState().mode===`edit`,o=()=>{let{frames:e}=r.getState(),[t]=e;return e.length===1&&t&&n.getState().base[t]?t:null},s=e=>()=>{let n=t.getState();return n.ref!==null&&n.mode===e},c=t=>()=>{let n=o();n&&YU(n,t,e)},l=ye([{id:`frame.compare`,label:`Compare with before`,group:`frame`,command:{label:`Compare with before`,icon:In},enabled:()=>a()&&o()!==null,checked:s(`flip`),run:c(`flip`)},{id:`frame.compare.split`,label:`Split with before`,group:`frame`,command:{label:`Split with before`,icon:tn},enabled:()=>a()&&o()!==null,checked:s(`split`),run:c(`split`)},{id:`frame.compare.end`,label:`End compare`,group:`frame`,keys:[`Escape`],command:{label:`End compare`,icon:ia},enabled:()=>t.getState().ref!==null,run:()=>XU(t)}]),u=[t.subscribe(G),n.subscribe(e=>{let{ref:n,hash:r}=t.getState();n&&e.base[n]!==r&&XU(t),G()}),r.subscribe(()=>XU(t)),i.subscribe(e=>{(e.mode===`play`||e.tool===`note`)&&XU(t)})];return()=>{for(let e of u)e();l(),XU(t)}},[e])}var eW=.05;function tW({frameRef:e,name:t,hash:n}){let r=qU(e=>e.mode),i=qU(e=>e.split),a=_M(e),o=(0,_.useRef)(null),s=(0,_.useMemo)(()=>aM(e,hM(e),void 0,n),[e,n]);(0,_.useEffect)(()=>{let e=o.current;if(!e)return;let t=()=>{let t=e.contentDocument?.documentElement;t&&rM(t,a)};return t(),e.addEventListener(`load`,t),()=>e.removeEventListener(`load`,t)},[a]);let c=r===`split`,l=`${Math.round(i*1e3)/10}%`;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{"data-compare-before":e,className:`absolute inset-0 overflow-hidden`,style:c?{clipPath:`inset(0 calc(100% - ${l}) 0 0)`}:void 0,children:(0,Z.jsx)(`iframe`,{ref:o,title:`${t} before`,src:s,tabIndex:-1,style:{colorScheme:a},className:`block size-full border-0 bg-[color:Canvas]`})}),(0,Z.jsx)(nW,{side:`left`,children:`Before`}),c?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(nW,{side:`right`,children:`Now`}),(0,Z.jsx)(rW,{frameRef:e,name:t,at:i,percent:l})]}):null]})}function nW({side:e,children:t}){return(0,Z.jsx)(`span`,{"aria-hidden":!0,className:Q(`pointer-events-none absolute bottom-[calc(6px/var(--zoom,1))] flex h-[18px] items-center rounded-[9px] bg-[color-mix(in_srgb,var(--claim)_22%,var(--card))] px-1.5 text-label font-medium text-claim [transform:scale(calc(1/var(--zoom,1)))]`,e===`left`?`left-[calc(6px/var(--zoom,1))] origin-bottom-left`:`right-[calc(6px/var(--zoom,1))] origin-bottom-right`),children:t})}function rW({frameRef:e,name:t,at:n,percent:r}){let i=e=>KU.setState({split:Math.min(1,Math.max(0,e))});return(0,Z.jsx)(`div`,{"data-compare-divider":e,role:`slider`,tabIndex:0,"aria-label":`Split between ${t} before and now`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n*100),"aria-valuetext":`${Math.round(n*100)}% before`,onKeyDown:e=>{let t={ArrowLeft:-.05,ArrowDown:-.05,ArrowRight:eW,ArrowUp:eW}[e.key];if(t!==void 0)i(n+t);else if(e.key===`Home`)i(0);else if(e.key===`End`)i(1);else return;e.preventDefault(),e.stopPropagation()},className:`absolute top-0 bottom-0 w-[calc(2px/var(--zoom,1))] -translate-x-1/2 bg-claim outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,style:{left:r},children:(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`absolute top-1/2 left-1/2 h-7 w-3.5 rounded-[7px] bg-card shadow-[0_0_0_2px_var(--claim)] [transform:translate(-50%,-50%)_scale(calc(1/var(--zoom,1)))]`})})}var iW=[{value:`now`,label:`Now`},{value:`flip`,label:`Before`},{value:`split`,label:`Split`}];function aW({frameRef:e,name:t}){let n=qU(t=>t.ref===e),r=qU(e=>e.mode),i=t=>{t===`now`?XU():YU(e,t)};if(!n)return(0,Z.jsx)(`button`,{type:`button`,"data-label-control":!0,"aria-label":`Compare ${t} with before`,title:`Compare with before`,onClick:()=>i(`flip`),className:`grid size-[18px] shrink-0 place-items-center rounded-[5px] bg-secondary text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50`,children:(0,Z.jsx)(In,{"aria-hidden":!0,className:`size-3`})});let a=r;return(0,Z.jsx)(`div`,{role:`radiogroup`,"aria-label":`Compare ${t}`,onKeyDown:t=>{let n={ArrowLeft:-1,ArrowUp:-1,ArrowRight:1,ArrowDown:1}[t.key];if(n===void 0)return;t.preventDefault(),t.stopPropagation();let r=iW[(iW.findIndex(e=>e.value===a)+n+iW.length)%iW.length];r&&(i(r.value),r.value!==`now`&&requestAnimationFrame(()=>document.querySelector(`[data-compare-option="${CSS.escape(`${e}:${r.value}`)}"]`)?.focus()))},className:`flex shrink-0 gap-px rounded-md bg-secondary p-0.5`,children:iW.map(({value:t,label:n})=>{let r=t===a;return(0,Z.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":r,tabIndex:r?0:-1,"data-label-control":!0,"data-compare-option":`${e}:${t}`,onClick:()=>i(t),className:Q(`flex h-4 items-center rounded px-1.5 font-medium outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,r?`bg-card text-foreground shadow-[0_0_0_1px_var(--border)]`:`text-muted-foreground hover:text-foreground`),children:n},t)})})}function oW(){return(0,Z.jsx)(`span`,{role:`img`,"aria-label":`Unseen change`,"data-unseen":!0,className:`inline-block size-[7px] shrink-0 rounded-full bg-claim`})}function sW({claim:e}){let t=Wz(),n=`${Bz(e.tag)}${e.tag.slice(1)}`;return(0,Z.jsxs)(`span`,{"data-claim-tag":!0,className:`inline-flex min-w-0 items-center gap-1.5 rounded-full bg-[color-mix(in_srgb,var(--claim)_18%,transparent)] py-0.5 pr-2 pl-[3px] font-medium text-[color-mix(in_srgb,var(--claim)_70%,var(--foreground))] motion-safe:animate-claim-tag`,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`grid size-4 shrink-0 place-items-center rounded-full bg-claim text-[9px] font-bold text-card motion-safe:animate-claim-dot`,children:Bz(e.agent)}),(0,Z.jsxs)(`span`,{className:`truncate`,children:[n,(0,Z.jsxs)(`span`,{"data-claim-elapsed":!0,className:`ml-1.5 font-normal text-[color-mix(in_srgb,var(--muted-foreground)_60%,var(--foreground))]`,children:[`editing · `,Uz(e.claimedAt,t)]})]})]})}function cW({findings:e}){return(0,Z.jsx)(`ul`,{className:`flex flex-col`,children:e.map((e,t)=>(0,Z.jsxs)(`li`,{"data-severity":e.severity,className:`grid grid-cols-[14px_1fr] gap-1.5 rounded-md p-1.5 hover:bg-accent data-[severity=error]:[--h:var(--destructive)] data-[severity=warning]:[--h:var(--note)]`,children:[(0,Z.jsx)(Wi,{role:`img`,"aria-label":e.severity===`error`?`Error`:`Warning`,className:`mt-px size-[11px] text-[var(--h)]`,strokeWidth:2}),(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsxs)(`p`,{className:`text-xs break-words`,children:[(0,Z.jsx)(`span`,{className:`font-semibold`,children:e.rule}),(0,Z.jsx)(lW,{finding:e})]}),(0,Z.jsx)(`p`,{className:`mt-0.5 text-[11px] break-words text-muted-foreground`,children:e.message})]})]},`${e.rule}:${e.location?.startOffset??``}:${t}`))})}function lW({finding:e}){let t=[uW(e),e.location?`line ${e.location.line}`:null].filter(Boolean).join(`, `);return t?(0,Z.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,t]}):null}function uW(e){if(e.frame===null||e.path===`${e.frame}.html`)return null;let t=`${e.frame.split(`/`)[0]}/`;return e.path.startsWith(t)?e.path.slice(t.length):e.path}var dW=N()(()=>({ref:null}));function fW(e){dW.setState({ref:e})}function pW(e){return F(dW,t=>t.ref===e)}function mW(e,t){let n=e.contentDocument;if(!n?.body)return null;let r=e.style.height;try{e.style.height=`1px`;let r=hW(n);return e.style.height=`${t}px`,r===hW(n)?r:null}finally{e.style.height=r}}function hW(e){let t=e.defaultView;if(!t)return 1;let n=e=>{let n=t.getComputedStyle(e);return n.overflowX!==`visible`||n.overflowY!==`visible`},r=t=>{for(let r=t.parentElement;r&&r!==e.body;r=r.parentElement)if(n(r))return!0;return!1},i=(e,t)=>e<t?(t-e)/2:0,a=r=>{let a=-1/0;if(n(r))return a;let o=parseFloat(t.getComputedStyle(r).lineHeight);for(let n of r.childNodes){if(n.nodeType!==t.Node.TEXT_NODE)continue;let r=e.createRange();r.selectNodeContents(n);for(let e of r.getClientRects())(e.width!==0||e.height!==0)&&(a=Math.max(a,e.bottom-i(o,e.height)))}return a},o=[`img`,`video`,`canvas`,`iframe`,`object`,`embed`,`audio`],s=e=>{let n=e.getBoundingClientRect();if(e.namespaceURI!==`http://www.w3.org/1999/xhtml`||o.includes(e.localName))return n.bottom;let r=t.getComputedStyle(e);if(r.display!==`inline`||parseFloat(r.paddingBottom)+parseFloat(r.borderBottomWidth)>0)return n.bottom;let a=parseFloat(r.paddingTop)+parseFloat(r.borderTopWidth);return n.bottom-i(parseFloat(r.lineHeight),n.height-a)},c=e.documentElement.getBoundingClientRect().bottom;for(let t of e.querySelectorAll(`body *`))r(t)||(c=Math.max(c,s(t),a(t)));return Math.max(1,Math.ceil(c+t.scrollY))}function gW(){return N()(()=>({held:0}))}var _W=gW(),vW=N()(()=>({ref:null,surface:`layers`}));function yW(e){return F(vW,t=>t.surface===e?t.ref:null)}function bW(e,t){vW.setState({ref:e,surface:t})}function xW(){vW.setState({ref:null})}async function SW(e,t,n=$O){try{await n.renameFrame(e.ref,t)}catch(t){ok(`Couldn't rename ${e.name}`)(t)}}function CW(e){let{selection:t,mode:n,live:r,clipboard:i,calls:a}=e,o=()=>n.getState().mode===`edit`&&r.getState().canWrite&&!t.getState().element,s=()=>{let{page:n,frames:r}=t.getState();return n===e.page()?e.frames().filter(e=>r.includes(e.ref)):[]},c=()=>s().map(e=>e.ref),l=()=>o()&&s().length>0,u=()=>l()&&s().every(e=>!e.locked),d=n=>KN(t,e.page(),n.map(e=>e.ref)),f=e=>e.length===1?e[0]?.name??``:`${e.length} frames`,p=(e,t)=>n=>{i.setState(n),n_.add({title:`${e} ${f(t)}`,description:`Paste with ${U(`$mod+KeyV`)} on any page.`,type:`success`})};return[{id:`frame.rename`,label:`Rename frame`,group:`frame`,keys:[`F2`],command:{label:`Rename frame`,icon:Ir},enabled:()=>o()&&s().length===1&&!n.getState().hideUi,run:()=>{let[e]=s();e&&(n.setState({tool:`move`}),bW(e.ref,`inspector`))}},{id:`frame.duplicate`,label:`Duplicate`,group:`frame`,command:{label:`Duplicate frame`,icon:on},keys:[`$mod+KeyD`],enabled:l,run:()=>{let e=s();a.duplicateFrames(c()).then(d,ok(`Couldn't duplicate ${f(e)}`))}},{id:`frame.delete`,label:`Delete`,group:`frame`,command:{label:`Delete frame`,icon:Hi},keys:[`Backspace`,`Delete`],enabled:u,run:()=>{let e=s();a.deleteFrames(c()).catch(ok(`Couldn't delete ${f(e)}`))}},{id:`frame.hide`,label:`Hide`,group:`frame`,command:{label:`Hide frame`,icon:gn},keys:[`$mod+Shift+KeyH`],enabled:l,run:()=>{let e=s();a.flagFrames(c(),`hidden`,!0).catch(ok(`Couldn't hide ${f(e)}`))}},{id:`frame.lock`,label:`Lock`,group:`frame`,command:{label:`Lock or unlock frame`,icon:mr},keys:[`$mod+Shift+KeyL`],enabled:l,checked:()=>{let e=s();return e.length>0&&e.every(e=>e.locked)},run:()=>{let e=s(),t=!e.every(e=>e.locked);a.flagFrames(c(),`locked`,t).catch(ok(`Couldn't ${t?`lock`:`unlock`} ${f(e)}`))}},{id:`frame.copy`,label:`Copy`,group:`frame`,command:{label:`Copy frame`,icon:cn},keys:[`$mod+KeyC`],enabled:l,run:()=>{let e=s();a.copyFrames(c()).then(p(`Copied`,e),ok(`Couldn't copy ${f(e)}`))}},{id:`frame.cut`,label:`Cut`,group:`frame`,command:{label:`Cut frame`,icon:ui},keys:[`$mod+KeyX`],enabled:u,run:()=>{let e=s();a.cutFrames(c()).then(p(`Cut`,e),ok(`Couldn't cut ${f(e)}`))}},{id:`frame.paste`,label:`Paste`,group:`frame`,command:{label:`Paste frames`,icon:Zt},keys:[`$mod+KeyV`],enabled:()=>o()&&i.getState().held>0,run:()=>{a.pasteFrames(e.page()).then(d,ok(`Couldn't paste`))}}]}function wW(e,t){let n=(0,_.useRef)(e),r=(0,_.useRef)(t);(0,_.useEffect)(()=>{n.current=e,r.current=t},[e,t]),(0,_.useEffect)(()=>{let e=ye(CW({page:()=>n.current,frames:()=>r.current,selection:sP,mode:W_,live:R_,clipboard:_W,calls:$O})),t=[sP.subscribe(G),W_.subscribe(G),_W.subscribe(G),R_.subscribe((e,t)=>{!e.connected&&t.connected&&_W.setState({held:0}),G()})];return()=>{for(let e of t)e();e()}},[])}var TW=[`Escape`],EW=(0,_.memo)(function({frame:e,live:t,version:n,findings:r,claim:i,unseen:a=!1}){let{x:o,y:s,width:c,height:l}=nN(e),u=($M(e.ref)??e.box).width,d=FM(e.ref),f=yW(`canvas`)===e.ref,p=cP(t=>t.frames.includes(e.ref)),m=(0,_.useRef)(null),h=G_(e=>e.mode===`play`),g=_M(e.ref),v=pW(e.ref),y=Ov(t=>e.ref in t.base),b=qU(t=>t.ref===e.ref?t.hash:null),x=(0,_.useRef)(e.modifiedAt);(0,_.useEffect)(()=>{x.current=e.modifiedAt},[e.modifiedAt]);let[S,C]=(0,_.useState)({ref:e.ref,version:n,live:t});(S.version!==n||S.live!==t)&&C({ref:e.ref,version:n,live:t});let w=(0,_.useMemo)(()=>S.live?aM(S.ref,hM(S.ref),S.version):null,[S]);(0,_.useEffect)(()=>{let e=m.current;if(!t||!e)return;let n=()=>{let t=e.contentDocument?.documentElement;t&&rM(t,g)};return n(),e.addEventListener(`load`,n),()=>e.removeEventListener(`load`,n)},[g,t]),(0,_.useEffect)(()=>{let e=m.current;if(!t||!e)return;let n=()=>{e.dataset.renderedAt=x.current};return e.addEventListener(`load`,n),()=>e.removeEventListener(`load`,n)},[t]),(0,_.useEffect)(()=>{let n=m.current;if(!t||!n)return;let r=()=>{let{page:t,element:r}=sP.getState(),i=n.contentDocument;if(r?.frame!==e.ref||!t||!i)return;let a=gz(i);a===r.hash||iP(e.ref,a)||KN(sP,t,[e.ref])};return n.addEventListener(`load`,r),()=>n.removeEventListener(`load`,r)},[t,e.ref]);let T=d?.width,{hugHeight:E,box:D}=e;(0,_.useEffect)(()=>{let n=m.current;if(!t||!n||T===void 0||!E)return;let r=()=>HM(e.ref,T,mW(n,D.height));return r(),n.addEventListener(`load`,r),()=>n.removeEventListener(`load`,r)},[t,T,E,e.ref,D.height]),(0,_.useEffect)(()=>{let e=m.current;if(!h||!e)return;let t=()=>{},n=()=>{t();let n=e.contentWindow;t=n?Te(n,TW):()=>{}};return n(),e.addEventListener(`load`,n),()=>{e.removeEventListener(`load`,n),t()}},[h,t]);let O=i&&!h?i:void 0;return(0,Z.jsxs)(`div`,{"data-frame":e.ref,"data-selected":p||void 0,"data-claimed":O?!0:void 0,"data-findings-open":v||void 0,className:`absolute`,style:{left:o,top:s,width:c,height:l,zIndex:e.order},children:[(0,Z.jsxs)(`div`,{className:Q(`absolute bottom-full left-0 flex origin-bottom-left items-center gap-1.5 pb-1 text-label font-normal [transform:scale(calc(1/var(--zoom,1)))]`,`[[data-label-crowded]:not([data-label-hover]):not([data-selected]):not([data-findings-open])>&]:hidden`,O?`text-claim`:`text-muted-foreground`,f&&`invisible`),style:{maxWidth:`calc(${Math.max(c,u)}px * var(--zoom, 1))`},title:e.name,children:[e.locked?(0,Z.jsx)(mr,{role:`img`,"aria-label":`Locked`,className:`size-[11px] shrink-0`,strokeWidth:1.6}):null,a&&!i?(0,Z.jsx)(oW,{}):null,(0,Z.jsx)(`span`,{className:Q(`truncate`,(d||O)&&`shrink-[1000]`),children:e.name}),d?(0,Z.jsx)(AW,{width:d.width}):null,h?null:(0,Z.jsx)(kW,{frameRef:e.ref,name:e.name,theme:g}),y&&!h?(0,Z.jsx)(aW,{frameRef:e.ref,name:e.name}):null,O?(0,Z.jsx)(sW,{claim:O}):null,r&&r.length>0?(0,Z.jsx)(NW,{frame:e,findings:r}):null]}),t?(0,Z.jsx)(`iframe`,{ref:m,title:e.name,src:w??void 0,style:{colorScheme:g},className:`block size-full border-0 bg-[color:Canvas]`}):(0,Z.jsx)(`div`,{"data-placeholder":!0,className:`size-full border border-border bg-card`}),t&&b&&!h?(0,Z.jsx)(tW,{frameRef:e.ref,name:e.name,hash:b}):null,O?(0,Z.jsx)(MW,{}):null,r&&r.length>0?(0,Z.jsx)(`span`,{"aria-hidden":!0,"data-findings-dot":!0,"data-findings-badge":e.ref,"data-severity":jW(r),className:Q(`absolute top-0 left-0 hidden size-2.5 rounded-full shadow-[0_0_0_2px_var(--background)] [transform:translate(-50%,-50%)_scale(calc(1/var(--zoom,1)))] data-[severity=error]:bg-destructive data-[severity=warning]:bg-note`,`[[data-label-crowded]:not([data-label-hover]):not([data-selected]):not([data-findings-open])>&]:block`)}):null]})});function DW({frames:e,calls:t=$O}){let n=yW(`canvas`),r=e.find(e=>e.ref===n);return r?(0,Z.jsx)(OW,{frame:r,calls:t}):null}function OW({frame:e,calls:t}){let{x:n,y:r,width:i}=nN(e);return(0,Z.jsx)(`div`,{className:`absolute`,style:{left:n,top:r},children:(0,Z.jsx)(`div`,{className:`pointer-events-auto absolute bottom-0 left-0 flex w-max origin-bottom-left pr-1.5 pb-0.5 text-label [transform:scale(calc(1/var(--zoom,1)))]`,style:{maxWidth:`clamp(160px, calc(${i}px * var(--zoom, 1)), 240px)`},children:(0,Z.jsx)(IH,{hug:!0,name:e.name,label:`Rename frame ${e.name}`,onCommit:n=>{xW(),SW(e,n,t)},onCancel:xW})})})}function kW({frameRef:e,name:t,theme:n}){let r=gM(),i=`Flip ${t} to ${n===`dark`?`light`:`dark`}`;return n===r?(0,Z.jsx)(`button`,{type:`button`,"data-label-control":!0,"aria-label":i,title:i,onClick:()=>pM(e),className:`invisible grid h-[18px] w-[18px] min-w-0 shrink place-items-center overflow-hidden rounded-[5px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 [[data-label-hover]_&]:visible`,children:(0,Z.jsx)(Oi,{"aria-hidden":!0,className:`size-3`})}):(0,Z.jsxs)(`button`,{type:`button`,"data-label-control":!0,"aria-label":i,title:i,onClick:()=>pM(e),className:`flex h-[18px] min-w-0 shrink items-center gap-1 overflow-hidden rounded-[5px] bg-[color-mix(in_srgb,var(--foreground)_14%,transparent)] px-[5px] text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:[(0,Z.jsx)(n===`dark`?wr:Oi,{"aria-hidden":!0,className:`size-3`}),n===`dark`?`Dark`:`Light`]})}function AW({width:e}){return(0,Z.jsxs)(`span`,{"data-preview-chip":!0,title:`Previewed at ${e} px wide. The frame's size is unchanged.`,className:`flex h-[18px] min-w-0 shrink items-center gap-1 overflow-hidden rounded-[5px] bg-[color-mix(in_srgb,var(--foreground)_14%,transparent)] px-[5px] text-foreground`,children:[(0,Z.jsx)(Or,{"aria-hidden":!0,className:`size-3 shrink-0`}),(0,Z.jsxs)(`span`,{className:`truncate`,children:[`Preview `,e]})]})}function jW(e){return e.some(e=>e.severity===`error`)?`error`:`warning`}function MW(){return(0,Z.jsx)(`svg`,{"aria-hidden":!0,"data-claim-outline":!0,className:`pointer-events-none absolute -inset-[calc(3px/var(--zoom,1))] size-[calc(100%+6px/var(--zoom,1))] overflow-visible`,children:(0,Z.jsx)(`rect`,{width:`100%`,height:`100%`,fill:`none`,className:`stroke-claim [stroke-width:calc(1.5px/var(--zoom,1))] [stroke-dasharray:calc(4.5px/var(--zoom,1))_calc(3px/var(--zoom,1))] motion-safe:animate-claim-outline`})})}function NW({frame:e,findings:t}){let n=pW(e.ref),r=t.length,i=jW(t),a=`${r} finding${r===1?``:`s`}`;return(0,Z.jsxs)(VU,{open:n,onOpenChange:t=>fW(t?e.ref:null),children:[(0,Z.jsxs)(HU,{"data-findings-badge":e.ref,"aria-label":`${r} check finding${r===1?``:`s`}`,"data-severity":i,className:`flex h-[18px] shrink-0 items-center gap-[3px] rounded-[9px] bg-[color-mix(in_srgb,var(--h)_34%,transparent)] pr-1.5 pl-[5px] font-medium text-[color-mix(in_srgb,var(--h)_55%,var(--foreground))] shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--h)_75%,transparent)] outline-none focus-visible:ring-2 focus-visible:ring-ring/50 data-[severity=error]:[--h:var(--destructive)] data-[severity=warning]:[--h:var(--note)]`,children:[(0,Z.jsx)(Wi,{"aria-hidden":!0,className:`size-3 text-[var(--h)]`}),r]}),(0,Z.jsxs)(UU,{side:`bottom`,align:`start`,sideOffset:6,initialFocus:!0,className:`w-[330px] gap-1.5 p-2.5 text-body`,children:[(0,Z.jsxs)(WU,{className:`text-[11px] font-semibold text-muted-foreground`,children:[a,` on `,e.name]}),(0,Z.jsx)(cW,{findings:t})]})]})}function PW(e,t){let n=Object.entries(e),r=XM(n.map(([,e])=>e));if(!r||n.length<2)return{...e};let i=e=>{switch(t){case`left`:return{...e,x:r.x};case`center`:return{...e,x:Math.round(r.x+(r.width-e.width)/2)};case`right`:return{...e,x:r.x+r.width-e.width};case`top`:return{...e,y:r.y};case`middle`:return{...e,y:Math.round(r.y+(r.height-e.height)/2)};case`bottom`:return{...e,y:r.y+r.height-e.height}}};return Object.fromEntries(n.map(([e,t])=>[e,i(t)]))}function FW(e,t){let n=Object.entries(e);if(n.length<3)return{...e};let r=e=>t===`horizontal`?e.x:e.y,i=e=>t===`horizontal`?e.width:e.height,a=n.toSorted(([,e],[,t])=>r(e)-r(t)||i(e)-i(t)),[,o]=a[0]??[],[,s]=a.at(-1)??[];if(!o||!s)return{...e};let c=(r(s)+i(s)-r(o)-a.reduce((e,[,t])=>e+i(t),0))/(a.length-1),l={},u=r(o);for(let[e,n]of a){let r=Math.round(u);l[e]=t===`horizontal`?{...n,x:r}:{...n,y:r},u+=i(n)+c}return l}var IW=[{name:`Left`,key:`ArrowLeft`,dx:-1,dy:0},{name:`Right`,key:`ArrowRight`,dx:1,dy:0},{name:`Up`,key:`ArrowUp`,dx:0,dy:-1},{name:`Down`,key:`ArrowDown`,dx:0,dy:1}],LW=[{id:`arrange.alignLeft`,label:`Align left`,alignment:`left`,key:`Alt+KeyA`},{id:`arrange.alignCenter`,label:`Align horizontal centers`,alignment:`center`,key:`Alt+KeyH`},{id:`arrange.alignRight`,label:`Align right`,alignment:`right`,key:`Alt+KeyD`},{id:`arrange.alignTop`,label:`Align top`,alignment:`top`,key:`Alt+KeyW`},{id:`arrange.alignMiddle`,label:`Align vertical centers`,alignment:`middle`,key:`Alt+KeyV`},{id:`arrange.alignBottom`,label:`Align bottom`,alignment:`bottom`,key:`Alt+KeyS`}],RW=[{id:`arrange.distributeHorizontal`,label:`Distribute horizontal spacing`,axis:`horizontal`,key:`Control+Alt+KeyH`},{id:`arrange.distributeVertical`,label:`Distribute vertical spacing`,axis:`vertical`,key:`Control+Alt+KeyV`}];function zW(e){let{selection:t,mode:n,live:r}=e,i=()=>n.getState().mode===`edit`,a=()=>{let{page:n,frames:r}=t.getState();return n===e.page()?e.frames().filter(e=>r.includes(e.ref)):[]},o=e=>()=>{let t=a();return i()&&r.getState().canWrite&&t.length>=e&&t.every(e=>!e.locked)},s=null,c,l=()=>{clearTimeout(c);let t=s;s=null,t&&e.write(t.page,t.boxes,t.started)},u=t=>{let n=a(),r=e.page(),i=n.map(e=>e.ref);s&&(s.page!==r||!VW(s.refs,i))&&l(),s||={page:r,refs:i,started:HW(n),boxes:HW(n)};let{boxes:o}=s;for(let e of n){let n=o[e.ref]??e.box;o[e.ref]=t(n)}e.hold(o),clearTimeout(c),c=setTimeout(l,300)},d=t=>{let n=HW(a()),r=t(n),i=Object.keys(r).filter(e=>{let t=r[e],i=n[e];return t&&i&&(t.x!==i.x||t.y!==i.y)});e.write(e.page(),UW(r,i),UW(n,i))};return[{id:`selection.clear`,label:`Clear selection`,group:`selection`,palette:!1,keys:[`Escape`],enabled:()=>i()&&n.getState().tool===`move`&&(t.getState().frames.length>0||t.getState().section!==void 0),run:()=>XN(t)},{id:`selection.all`,label:`Select all`,group:`selection`,command:{label:`Select all`},keys:[`$mod+KeyA`],enabled:()=>i()&&e.frames().length>0,run:()=>KN(t,e.page(),e.frames().map(e=>e.ref))},...IW.flatMap(({name:e,key:t,dx:n,dy:r})=>[{id:`frame.nudge${e}`,label:`Nudge ${e.toLowerCase()}`,group:`frame`,palette:!1,keys:[t],enabled:o(1),run:()=>u(e=>({...e,x:e.x+n,y:e.y+r}))},{id:`frame.nudge${e}Far`,label:`Nudge ${e.toLowerCase()} 10 px`,group:`frame`,palette:!1,keys:[`Shift+${t}`],enabled:o(1),run:()=>u(e=>({...e,x:e.x+n*10,y:e.y+r*10}))},{id:`frame.resize${e}`,label:n===0?r>0?`Make taller`:`Make shorter`:n>0?`Make wider`:`Make narrower`,group:`frame`,palette:!1,keys:[`$mod+${t}`],enabled:o(1),run:()=>u(e=>({...e,width:Math.max(1,e.width+n),height:Math.max(1,e.height+r)}))}]),{id:`frame.fitHeight`,label:`Fit height`,group:`frame`,command:{label:`Fit height to content`},enabled:()=>o(1)()&&a().length===1,run:()=>{let[t]=a();t&&e.fit(t.ref).catch(ok(`Couldn't fit ${t.name} to its content`))}},...LW.map(({id:e,label:t,alignment:n,key:r})=>({id:e,label:t,group:`arrange`,command:{label:t},keys:[r],enabled:o(2),run:()=>d(e=>PW(e,n))})),...RW.map(({id:e,label:t,axis:n,key:r})=>({id:e,label:t,group:`arrange`,command:{label:t},keys:[r],enabled:o(3),run:()=>d(e=>FW(e,n))}))]}function BW(e,t){let n=(0,_.useRef)(e),r=(0,_.useRef)(t);(0,_.useEffect)(()=>{n.current=e,r.current=t},[e,t]),(0,_.useEffect)(()=>{let e=ye(zW({page:()=>n.current,frames:()=>tN(r.current),selection:sP,mode:W_,live:R_,hold:oN,write:cN,fit:$O.fitFrame})),t=[sP.subscribe(G),R_.subscribe(G)];return()=>{for(let e of t)e();e()}},[])}function VW(e,t){return e.length===t.length&&e.every(e=>t.includes(e))}function HW(e){return Object.fromEntries(e.map(e=>[e.ref,e.box]))}function UW(e,t){return Object.fromEntries(t.flatMap(t=>{let n=e[t];return n?[[t,n]]:[]}))}function WW(e,t,n){let{x:r,y:i,width:a}=e.box,o=t===null?null:n?.querySelector(`[data-frame="${CSS.escape(e.ref)}"] iframe`)?.contentDocument,s=o&&t!==null?hz(o,t):null;if(!s)return{x:r+a,y:i};let c=s.getBoundingClientRect();return{x:r+Math.min(c.right,a),y:i+Math.max(c.top,0)}}function GW(e,t,n){let r=6/n,i=(e,t)=>Math.abs(e-t)<=r,a=i(t.x,e.x),o=i(t.x,e.x+e.width),s=i(t.y,e.y),c=i(t.y,e.y+e.height);return s&&a?`nw`:s&&o?`ne`:c&&a?`sw`:c&&o?`se`:null}function KW(e,t,n){let r=6/n,i=(e,t,n)=>e>=t-r&&e<=n+r,a=(e,t)=>Math.abs(e-t)<=r,o=e.x+e.width,s=e.y+e.height;return i(t.x,e.x,o)&&(a(t.y,e.y)||a(t.y,s))||i(t.y,e.y,s)&&(a(t.x,e.x)||a(t.x,o))}function qW(e,t,n){for(let r of e.querySelectorAll(t)){let{left:e,right:t,top:i,bottom:a}=r.getBoundingClientRect();if(n.clientX>=e&&n.clientX<=t&&n.clientY>=i&&n.clientY<=a)return r}return null}function JW(e,t){return qW(e,`[data-findings-badge]`,t)?.dataset.findingsBadge??null}function YW(e){let t=e.querySelector(`[data-element-selection]`);if(!t)return null;let{left:n,top:r,width:i,height:a}=t.style;return{x:parseFloat(n),y:parseFloat(r),width:parseFloat(i),height:parseFloat(a)}}function XW(e,t,n){let r=[...e.querySelectorAll(`[data-element-ghost]`)].reverse();for(let e of r){let{ghostFrame:r,ghostIndex:i,ghostHash:a}=e.dataset,o=t.find(({ref:e})=>e===r);if(!o||i===void 0||a===void 0)continue;let{left:s,top:c,width:l,height:u}=e.style;if(ZW({x:parseFloat(s),y:parseFloat(c),width:parseFloat(l),height:parseFloat(u)},n)&&!ZW(o.box,n))return{frame:o.ref,index:Number(i),hash:a}}return null}function ZW(e,t){return t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height}function QW(e,t,n){let r=20/n;for(let n=e.length-1;n>=0;--n){let i=e[n];if(!i||i.hidden)continue;let{x:a,y:o,width:s,height:c}=i.box;if(t.x>=a&&t.x<=a+s&&t.y>=o-r&&t.y<=o+c)return i}return null}function $W(e,t){return e.filter(({hidden:e,box:n})=>!e&&n.x<=t.x+t.width&&n.x+n.width>=t.x&&n.y<=t.y+t.height&&n.y+n.height>=t.y)}var eG=[`start`,`center`,`end`];function tG(e,t,n){let r=rG(e,t,`x`,eG,n),i=rG(e,t,`y`,eG,n);return aG({...e,x:Math.round(e.x+(r?.delta??0)),y:Math.round(e.y+(i?.delta??0))},r,i)}function nG(e,t,n,r){let i=rG(e,n,`x`,[t.x],r),a=rG(e,n,`y`,[t.y],r),o={...e},s=Math.round(i?.delta??0),c=Math.round(a?.delta??0);return t.x===`start`?(o.x+=s,o.width-=s):o.width+=s,t.y===`start`?(o.y+=c,o.height-=c):o.height+=c,o.width<1||o.height<1?{box:e,guides:[],gaps:[]}:aG(o,i,a)}function rG(e,t,n,r,i){let a=null;for(let o of r.map(t=>iG(e,n,t)))for(let e of t)for(let t of eG.map(t=>iG(e,n,t))){let n=t-o;Math.abs(n)>i||a&&Math.abs(n)>Math.abs(a.delta)||(a&&n===a.delta&&t===a.at?a.targets.includes(e)||a.targets.push(e):a={delta:n,at:t,targets:[e]})}return a}function iG(e,t,n){let r=t===`x`?e.x:e.y,i=t===`x`?e.width:e.height;return n===`start`?r:n===`end`?r+i:r+i/2}function aG(e,t,n){let r=[];if(t){let n=[e,...t.targets];r.push({axis:`x`,at:t.at,from:Math.min(...n.map(e=>e.y)),to:Math.max(...n.map(e=>e.y+e.height))})}if(n){let t=[e,...n.targets];r.push({axis:`y`,at:n.at,from:Math.min(...t.map(e=>e.x)),to:Math.max(...t.map(e=>e.x+e.width))})}let i=[],a=n?oG(e,n.targets,`x`):null;a&&i.push(a);let o=t?oG(e,t.targets,`y`):null;return o&&i.push(o),{box:e,guides:r,gaps:i}}function oG(e,t,n){let r=null,i=e=>n===`x`?e.x:e.y,a=e=>i(e)+(n===`x`?e.width:e.height),o=n===`x`?e.y+e.height/2:e.x+e.width/2;for(let s of t){let t=a(s)<=i(e)?{from:a(s),to:i(e)}:a(e)<=i(s)?{from:a(e),to:i(s)}:null;!t||t.to-t.from<=0||r&&r.to-r.from<=t.to-t.from||(r={axis:n,at:o,...t})}return r}var sG={selection:sP,mode:W_,canWrite:()=>R_.getState().canWrite,write:cN,duplicate:$O.duplicateFrames,openFindings:fW,splitAt:ZU,moveElement:fV,resizeOf:oH,resizeElement:uH,placedOffsets:dH,movePlaced:fH};function cG(e,t,n=sG){let{selection:r,mode:i}=n,a={kind:`none`},o={x:0,y:0},s={x:0,y:0},c=!1,l=!1,u=null,d=new Map,f=()=>t.layer.querySelector(`[data-overlay]`),p=(e,n)=>{let r=t.layer.querySelector(`[data-element-selection]`);r&&(r.style.transform=e===0&&n===0?``:`translate(${e}px, ${n}px)`)},m=(e,n,r)=>{let i=t.viewport.querySelectorAll(`[data-note-frame]`);for(let t of i){let i=e.includes(t.dataset.noteFrame??``)&&(n!==0||r!==0);t.style.translate=i?`${n}px ${r}px`:``}},h=(e,n,r)=>{let i=t.viewport.querySelectorAll(`[data-note-frame="${CSS.escape(e.frame)}"][data-note-element="${e.index}"]`);for(let e of i)e.style.translate=n!==0||r!==0?`${n}px ${r}px`:``},g=e=>{let n=t.viewport.querySelectorAll(`[data-note-frame]`);for(let r of n){let n=r.dataset.noteFrame??``,i=e[n];if(!i){r.style.translate=``;continue}let a=r.dataset.noteElement,o=WW({ref:n,box:i},a===void 0?null:Number(a),t.layer),s=o.x-parseFloat(r.style.left),c=o.y-parseFloat(r.style.top);r.style.translate=s!==0||c!==0?`${s}px ${c}px`:``}},_=()=>XR(t.viewport).k,v=e=>{let[n,r]=vI(e,t.viewport),{x:i,y:a,k:o}=XR(t.viewport);return{x:(n-i)/o,y:(r-a)/o}},y=e=>{let{page:n,frames:i}=r.getState();return n===t.page?e.filter(e=>i.includes(e.ref)):[]},b=e=>Object.fromEntries(e.map(e=>[e.ref,e.box])),x=e=>t.sections?.().find(t=>t.name===e),S=e=>t.layer.querySelector(`[data-section="${CSS.escape(e)}"]`),C=(e,t)=>{let n=S(e);n&&Object.assign(n.style,{left:`${t.x}px`,top:`${t.y}px`,width:`${t.width}px`,height:`${t.height}px`})},w=e=>{let i=iN(t.frames()),d=v(e);o=d,s={x:e.clientX,y:e.clientY},c=!1,u=e;let f=lG();l=f!==null,f?.blur();let p=qW(t.layer,`[data-label-control]`,e);if(p){a={kind:`control`,element:p};return}if(qW(t.layer,`[data-compare-divider]`,e)){a={kind:`divider`},n.splitAt(e.clientX);return}let m=JW(t.layer,e);if(m){a={kind:`badge`,ref:m};return}let h=r.getState().element,g=h?YW(t.layer):null,S=g?GW(g,d,_()):null,C=h&&g&&S?n.resizeOf(t.layer,h):null;if(h&&g&&S&&C){a={kind:`corner`,key:h,corner:S,box:g,read:C};return}if(h&&g){let r=KW(g,d,_());if(r||uG(g,d)){a={kind:`element`,key:h,frame:r?null:QW(i,d,_()),shift:e.shiftKey,placed:n.placedOffsets(t.layer,h)};return}}let w=x(r.getState().page===t.page?r.getState().section:void 0),T=w?qW(t.layer,`[data-section-corner]`,e):null;if(w&&T){a={kind:`section-resize`,section:w,corner:T.dataset.sectionCorner,moved:!1};return}let E=XM(y(i).map(e=>e.box)),D=E&&!h?GW(E,d,_()):null,O=y(tN(t.frames())),k=XM(O.map(e=>e.box));if(k&&D){a={kind:`resize`,corner:D,boxes:b(O),bounds:k};return}let A=XW(t.layer,i,d);if(A){JN(r,t.page,A),a={kind:`element`,key:A,frame:null,shift:e.shiftKey,placed:n.placedOffsets(t.layer,A)};return}let j=i.some(e=>uG(e.box,d))?null:dG(t.layer,`[data-section-label]`,e),M=x(j?.dataset.sectionLabel);if(M){l||qN(r,t.page,M.name),a={kind:`section`,section:M};return}let N=QW(i,d,_());if(N){let n=!O.some(({ref:e})=>e===N.ref);!l&&!e.shiftKey&&n&&KN(r,t.page,[N.ref]),a={kind:`press`,frame:N,shift:e.shiftKey}}else a={kind:`marquee`,shift:e.shiftKey,base:e.shiftKey?r.getState().frames:[]}},T=()=>{if(a.kind===`corner`){let e=n.canWrite()?n.resizeElement(t.page,a.key,a.read):null;a=e?{...a,kind:`element-resize`,resize:e,size:null}:{kind:`none`}}else if(a.kind===`element`&&a.placed){let e=n.canWrite()?n.movePlaced(t.page,a.key):null;a=e?{kind:`placed`,key:a.key,from:a.placed,move:e,to:null}:{kind:`none`}}else if(a.kind===`element`)a=n.canWrite()?{kind:`carry`,key:a.key}:{kind:`none`},a.kind===`carry`&&ZB.setState({carried:a.key});else if(a.kind===`section`){let{section:e}=a,i=tN(t.pageFrames?.()??t.frames()).filter(t=>e.frames.includes(t.name));a=n.canWrite()&&i.every(({locked:e})=>!e)?{kind:`section-move`,section:e,boxes:b(i)}:{kind:`none`},a.kind===`section-move`&&(qN(r,t.page,e.name),VM(Object.keys(a.boxes)),d=E(Object.keys(a.boxes)))}else if(a.kind===`section-resize`)n.canWrite()||(a={kind:`none`});else if(a.kind===`press`||a.kind===`resize`){if(a.kind===`press`){let{frame:e,shift:i}=a,o=!r.getState().frames.includes(e.ref);i&&o?YN(r,t.page,e.ref):l&&o&&KN(r,t.page,[e.ref]);let s=y(tN(t.frames())),c=XM(s.map(({box:e})=>e));a=c&&s.every(({locked:e})=>!e)&&n.canWrite()?{kind:`move`,boxes:b(s),bounds:c}:{kind:`none`}}else{let e=Object.keys(a.boxes);(t.frames().some(t=>e.includes(t.ref)&&t.locked)||!n.canWrite())&&(a={kind:`none`})}(a.kind===`move`||a.kind===`resize`)&&(VM(Object.keys(a.boxes)),d=E(Object.keys(a.boxes)))}},E=e=>new Map(e.flatMap(e=>{let n=t.layer.querySelector(`[data-frame="${CSS.escape(e)}"]`);return n?[[e,n]]:[]})),D=e=>{let n=f();if(!n)return;let r=v(e),i=r.x-o.x,s=r.y-o.y,c=e.ctrlKey?-1:6/_(),l=()=>iN(t.frames()).filter(e=>!(`boxes`in a&&e.ref in a.boxes)).map(e=>e.box);switch(a.kind){case`move`:{let{bounds:e,boxes:t}=a,r=tG({...e,x:Math.round(e.x+i),y:Math.round(e.y+s)},l(),c),o=r.box.x-e.x,u=r.box.y-e.y;for(let[e,n]of Object.entries(t)){let t=d.get(e);t&&(t.style.left=`${n.x+o}px`,t.style.top=`${n.y+u}px`)}xz(n,o,u,r.box),p(o,u),m(Object.keys(t),o,u),wz(n,r.guides,r.gaps);return}case`resize`:{let{bounds:e,boxes:t,corner:r}=a,o=nG(MV(e,r,i,s),{x:r.endsWith(`w`)?`start`:`end`,y:r.startsWith(`n`)?`start`:`end`},l(),c),u=jV(t,e,o.box);for(let[e,t]of Object.entries(u)){let n=d.get(e);n&&Object.assign(n.style,{left:`${t.x}px`,top:`${t.y}px`,width:`${t.width}px`,height:`${t.height}px`})}g(u),Sz(n,u),wz(n,o.guides,o.gaps);return}case`section-move`:{let{section:e,boxes:t}=a,r=tG({...e.box,x:Math.round(e.box.x+i),y:Math.round(e.box.y+s)},l(),c),o=r.box.x-e.box.x,u=r.box.y-e.box.y;C(e.name,r.box);for(let[e,n]of Object.entries(t)){let t=d.get(e);t&&(t.style.left=`${n.x+o}px`,t.style.top=`${n.y+u}px`)}m(Object.keys(t),o,u),wz(n,r.guides,r.gaps);return}case`section-resize`:a.moved=!0,C(a.section.name,fG(MV(a.section.box,a.corner,i,s)));return;case`placed`:{let e=Math.round(i),t=Math.round(s);a.to={left:a.from.left+e,top:a.from.top+t},a.move.preview(a.to),p(e,t),h(a.key,e,t);return}case`element-resize`:a.size=cH(a.read,a.box,a.corner,i,s,e.shiftKey),a.resize.preview(a.size);return;case`marquee`:{let e=pG(o,r);Cz(n,e,$W(iN(t.frames()),e).map(e=>e.box));return}default:return}},O=e=>{let[i]=Object.entries(e),a=i?d.get(i[0]):void 0;if(!i||!a)return;let o={x:parseFloat(a.style.left)-i[1].x,y:parseFloat(a.style.top)-i[1].y};for(let[t,n]of Object.entries(e)){let e=d.get(t);e&&(e.style.left=`${n.x}px`,e.style.top=`${n.y}px`)}if(o.x===0&&o.y===0)return;let s=Object.keys(e);n.duplicate(s,o).then(e=>KN(r,t.page,e.map(e=>e.ref)),ok(s.length===1?`Couldn't duplicate ${s[0]?.split(`/`).at(-1)??`the frame`}`:`Couldn't duplicate ${s.length} frames`))},k=e=>{let i=f();if(!c){if(l){a={kind:`none`};return}a.kind===`badge`?n.openFindings(a.ref):a.kind===`control`?a.element.click():a.kind===`press`||a.kind===`element`&&a.frame?a.shift?YN(r,t.page,a.frame.ref):KN(r,t.page,[a.frame.ref]):a.kind===`section`?qN(r,t.page,a.section.name):a.kind===`marquee`&&!a.shift&&XN(r),a={kind:`none`};return}i&&Tz(i),p(0,0),m([],0,0);let s=v(e);if(a.kind===`marquee`){let e=$W(iN(t.frames()),pG(o,s)).map(e=>e.ref);KN(r,t.page,[...a.base,...e])}else if(a.kind===`element-resize`){let{box:e,corner:t,resize:n,size:r}=a,i=sH(e,t,0,0,!1);r&&(r.width!==i.width||r.height!==i.height)?n.commit(r):n.cancel()}else if(a.kind===`placed`){let{from:e,to:r,move:i,key:o}=a;if(r&&(r.left!==e.left||r.top!==e.top)){let a=YW(t.layer);a&&EV({key:o,box:{...a,x:a.x+r.left-e.left,y:a.y+r.top-e.top},read:n.resizeOf(t.layer,o)}),i.commit(r).then(e=>{!e&&DV()?.key===o&&EV(null)})}else i.cancel()}else if(a.kind===`carry`)ZB.setState({carried:null}),n.moveElement(t.layer,t.page,iN(t.frames()),s,a.key);else if(a.kind===`section-move`)A(a.section,a.boxes);else if(a.kind===`section-resize`&&a.moved)A(a.section,{});else if(a.kind===`move`&&e.altKey)O(a.boxes);else if(a.kind===`move`||a.kind===`resize`){let e={},r={};for(let[t,n]of Object.entries(a.boxes)){let i=d.get(t);if(!i)continue;let o=a.kind===`move`?{...n,x:parseFloat(i.style.left),y:parseFloat(i.style.top)}:{x:parseFloat(i.style.left),y:parseFloat(i.style.top),width:parseFloat(i.style.width),height:parseFloat(i.style.height)};YM(o,n)||(e[t]=o,r[t]=n)}n.write(t.page,e,r)}a={kind:`none`},d=new Map},A=(e,r)=>{let i=S(e.name);if(!i)return;let a={x:parseFloat(i.style.left),y:parseFloat(i.style.top),width:parseFloat(i.style.width),height:parseFloat(i.style.height)};if(YM(a,e.box))return;let o={},s={},c=a.x-e.box.x,l=a.y-e.box.y;for(let[e,t]of Object.entries(r))o[e]={...t,x:t.x+c,y:t.y+l},s[e]=t;n.write(t.page,o,s,void 0,{boxes:{[e.name]:a},expected:{[e.name]:e.box}}).then(t=>{t||C(e.name,e.box)})},j=e=>{e.key===`Escape`&&(a.kind===`placed`||a.kind===`element-resize`)&&(e.preventDefault(),e.stopImmediatePropagation(),a.kind===`placed`?(a.move.cancel(),p(0,0),h(a.key,0,0)):a.resize.cancel(),a={kind:`none`})},M=e=>{e.key===`Control`&&c&&u&&D(new MouseEvent(`mousemove`,{clientX:u.clientX,clientY:u.clientY,ctrlKey:e.type===`keydown`}))},N=Cne().container(()=>t.viewport).filter(e=>{let{mode:t,tool:n,spacePan:r}=i.getState();return e.button===0&&t===`edit`&&n===`move`&&!r}).touchable(!1).on(`start`,e=>{w(e.sourceEvent),addEventListener(`keydown`,j,!0),addEventListener(`keydown`,M),addEventListener(`keyup`,M)}).on(`drag`,e=>{let t=e.sourceEvent;if(u=t,a.kind===`divider`)n.splitAt(t.clientX);else{if(!c){if(Math.hypot(t.clientX-s.x,t.clientY-s.y)<=3)return;c=!0,T()}D(t)}}).on(`end`,e=>{removeEventListener(`keydown`,j,!0),removeEventListener(`keydown`,M),removeEventListener(`keyup`,M),k(e.sourceEvent),u=null}),P=e=>{e.ctrlKey&&e.button===0&&e.preventDefault()},F=gI(e);return F.call(N),e.addEventListener(`contextmenu`,P),()=>{F.on(`.drag`,null),e.removeEventListener(`contextmenu`,P),removeEventListener(`keydown`,j,!0),removeEventListener(`keydown`,M),removeEventListener(`keyup`,M)}}function lG(){let e=document.activeElement;return e instanceof HTMLElement&&e.matches(`input, textarea`)&&e.closest(`[data-inspector]`)?e:null}function uG(e,t){return t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height}function dG(e,t,n){return[...e.querySelectorAll(t)].reverse().find(e=>{let{left:t,right:r,top:i,bottom:a}=e.getBoundingClientRect();return n.clientX>=t&&n.clientX<=r&&n.clientY>=i&&n.clientY<=a})??null}function fG(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.max(1,Math.round(e.width)),height:Math.max(1,Math.round(e.height))}}function pG(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),width:Math.abs(e.x-t.x),height:Math.abs(e.y-t.y)}}var mG=/^#[0-9a-f]{6}$/i,hG=`flex h-[26px] items-center gap-2 rounded-md bg-input px-2 text-xs`,gG=`-ml-1 max-w-max truncate rounded-[4px] bg-[color-mix(in_srgb,var(--foreground)_9%,transparent)] px-1.5 py-px`,_G=`shadow-[inset_0_0_0_1px_var(--faint)]`;function vG(e,t){let n=`token`in e?`var(${e.token})`:e.raw;if(t>=100)return n;if(`raw`in e&&mG.test(e.raw)){let n=Math.round(t/100*255).toString(16).padStart(2,`0`);return`${e.raw}${n}`}return`color-mix(in srgb, ${n} ${t}%, transparent)`}function yG(e,t,n){return e.find(e=>e.name===t)?.[n]??null}function bG(e,t,n){let r=e.token?yG(t,e.token,n):e.value;return r===null?null:e.percent>=100?r:`color-mix(in srgb, ${r} ${e.percent}%, transparent)`}function xG(e){return e.replace(/^--/,``)}var SG=200,CG={width:800,height:600},wG=N()(()=>({tool:`frame`}));function TG(){return F(wG,e=>e.tool)}var EG=N()(()=>({name:null}));function DG(){return F(EG,e=>e.name)}function OG(e){EG.setState({name:e})}function kG(){EG.setState({name:null})}function AG(e){let t=XM(e.map(e=>e.box));return t?{x:Math.round(t.x-40),y:Math.round(t.y-SG),width:Math.round(t.width+80),height:Math.round(t.height+40+SG)}:null}var jG=[{name:`Left`,key:`ArrowLeft`,dx:-1,dy:0},{name:`Right`,key:`ArrowRight`,dx:1,dy:0},{name:`Up`,key:`ArrowUp`,dx:0,dy:-1},{name:`Down`,key:`ArrowDown`,dx:0,dy:1}];function MG(e){let{selection:t,mode:n,live:r,calls:i}=e,a=()=>n.getState().mode===`edit`&&r.getState().canWrite&&!t.getState().element,o=()=>{let{page:n,frames:r}=t.getState();return n===e.page()?e.frames().filter(e=>r.includes(e.ref)):[]},s=()=>{let{page:n,section:r}=t.getState();if(n===e.page()&&r!==void 0)return e.sections().find(e=>e.name===r)},c=()=>a()&&s()!==void 0,l=t=>tN(e.frames()).filter(e=>t.frames.includes(e.name)),u=()=>{let e=s();return a()&&e!==void 0&&l(e).every(e=>!e.locked)},d=!1,f=(t,n)=>{let r=s();if(!r||d)return;let i=l(r),a=e=>({...e,x:e.x+t,y:e.y+n});d=!0,(e.write??cN)(e.page(),Object.fromEntries(i.map(e=>[e.ref,a(e.box)])),Object.fromEntries(i.map(e=>[e.ref,e.box])),void 0,{boxes:{[r.name]:a(r.box)},expected:{[r.name]:r.box}}).finally(()=>{d=!1})};return[{id:`section.wrap`,label:`Wrap in section`,group:`frame`,command:{label:`Wrap frames in a section`,icon:Pr,keywords:[`group`]},keys:[`$mod+Alt+KeyG`],enabled:()=>a()&&o().length>0,run:()=>{let n=AG(o());if(!n)return;let r=e.page();i.addSection(r,n).then(e=>qN(t,r,e.name)).catch(ok(`Couldn't wrap in a section`))}},{id:`section.rename`,label:`Rename section`,group:`section`,command:{label:`Rename section`,icon:Ir},keys:[`F2`],enabled:c,run:()=>{let e=s();e&&OG(e.name)}},{id:`section.delete`,label:`Delete section`,group:`section`,command:{label:`Delete section, keeping its frames`,icon:Hi},keys:[`Backspace`,`Delete`],enabled:c,run:()=>{let n=s();n&&i.deleteSection(e.page(),n.name).then(()=>XN(t)).catch(ok(`Couldn't delete ${n.name}`))}},...jG.flatMap(({name:e,key:t,dx:n,dy:r})=>[{id:`section.nudge${e}`,label:`Nudge section ${e.toLowerCase()}`,group:`section`,palette:!1,keys:[t],enabled:u,run:()=>f(n,r)},{id:`section.nudge${e}Far`,label:`Nudge section ${e.toLowerCase()} 10 px`,group:`section`,palette:!1,keys:[`Shift+${t}`],enabled:u,run:()=>f(n*10,r*10)}]),{id:`tool.section`,label:`Section`,group:`tool`,command:{label:`Draw a section`,icon:Pr},keys:[`Shift+KeyS`],enabled:()=>r.getState().canWrite,run:()=>{wG.setState({tool:`section`}),n.setState({tool:`section`,mode:`edit`})},checked:()=>n.getState().mode===`edit`&&n.getState().tool===`section`}]}async function NG(e,t,{calls:n=$O,selection:r=sP,mode:i=W_}={}){try{let a=await n.addSection(e,{x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width??CG.width),height:Math.round(t.height??CG.height)});return qN(r,e,a.name),i.setState({tool:`move`}),a}catch(e){return ok(`Couldn't add a section`)(e),null}}function PG(e,t,n){let r=(0,_.useRef)({page:e,frames:t,sections:n});(0,_.useEffect)(()=>{r.current={page:e,frames:t,sections:n}},[e,t,n]),(0,_.useEffect)(()=>{let e=ye(MG({page:()=>r.current.page,frames:()=>r.current.frames,sections:()=>r.current.sections,selection:sP,mode:W_,live:R_,calls:$O})),t=[sP.subscribe(G),W_.subscribe(G),R_.subscribe((e,t)=>{G(),e.canWrite!==t.canWrite&&!e.canWrite&&W_.getState().tool===`section`&&W_.setState({tool:`move`})})];return()=>{for(let e of t)e();e()}},[])}var FG=N()(()=>({preset:DN}));function IG(){return F(FG,e=>e.preset)}function LG(e){FG.setState({preset:e})}var RG=`frame`;async function zG(e,{page:t,frames:n,preset:r=FG,selection:i=sP,mode:a=W_,calls:o=$O,visible:s,view:c=ev}){let{width:l,height:u}=e,d=l===void 0||u===void 0?null:{width:l,height:u},f=r.getState().preset,p=tk(d?RG:f,n.map(e=>e.name));try{let n=await o.addFrame(`${t}/${p}`,d??kN(f),Math.round(e.x),Math.round(e.y));return KN(i,t,[n.ref]),a.setState({tool:`move`}),s&&!BG(n.box,s)&&c.centerOn(n.box),n}catch(e){return ok(`Couldn't add a frame`)(e),null}}function BG(e,t){return e.x>=t.x&&e.y>=t.y&&e.x+e.width<=t.x+t.width&&e.y+e.height<=t.y+t.height}var VG=()=>R_.getState().canWrite;function HG(){(0,_.useEffect)(()=>{let e=ye([{id:`tool.frame`,label:`Frame`,group:`tool`,command:{label:`Add a frame`,icon:Pn},keys:[`f`],enabled:VG,run:()=>{wG.setState({tool:`frame`}),W_.setState({tool:`frame`,mode:`edit`})},checked:()=>W_.getState().mode===`edit`&&W_.getState().tool===`frame`}]),t=R_.subscribe((e,t)=>{e.canWrite!==t.canWrite&&(G(),!e.canWrite&&W_.getState().tool===`frame`&&W_.setState({tool:`move`}))});return()=>{t(),e()}},[])}function UG(e,t=WG){let n=z_(e=>e.board),[r,i]=(0,_.useState)();return(0,_.useEffect)(()=>{let n=!0;return t(e).catch(()=>null).then(e=>{n&&i(e)}),()=>{n=!1}},[e,n,t]),r}async function WG(e){let t=await(await fetch(`/api/projects/${encodeURIComponent(e)}/tokens`)).json();return t.ok?t.data:null}var GG=[{family:`Geist`,package:`@fontsource-variable/geist`,packageFamily:`Geist Variable`,folder:`geist`,weights:{min:100,max:900},fallback:`sans-serif`,startsLook:!0},{family:`Geist Mono`,package:`@fontsource-variable/geist-mono`,packageFamily:`Geist Mono Variable`,folder:`geist-mono`,weights:{min:100,max:900},fallback:`monospace`,startsLook:!0},{family:`Inter`,package:`@fontsource-variable/inter`,packageFamily:`Inter Variable`,folder:`inter`,weights:{min:100,max:900},fallback:`sans-serif`,startsLook:!0},{family:`Source Serif 4`,package:`@fontsource-variable/source-serif-4`,packageFamily:`Source Serif 4 Variable`,folder:`source-serif-4`,weights:{min:200,max:900},fallback:`serif`,startsLook:!0},{family:`Caveat`,package:`@fontsource-variable/caveat`,packageFamily:`Caveat Variable`,folder:`caveat`,weights:{min:400,max:700},fallback:`cursive`,startsLook:!1}],KG=`/frameboard/faces`;function qG(e){return`${KG}/${e.folder}/index.css`}function JG(e){return`${/\s/.test(e.family)?`'${e.family}'`:e.family}, ${e.fallback}`}var YG={blue:{light:`#2f7bf0`,dark:`#4e92f6`},red:{light:`#e5484d`,dark:`#ff6369`},green:{light:`#30a46c`,dark:`#3dd68c`},orange:{light:`#f76b15`,dark:`#ff801f`},purple:{light:`#8e4ec6`,dark:`#9a5cd0`}},XG=Object.fromEntries(GG.filter(e=>e.startsLook).map(e=>[e.folder,{family:e.family,stack:JG(e)}])),ZG={accent:`blue`,font:`geist`},QG=`untitled`,$G=`page-1`;function eK(e,t){if(!e||!t)return!1;let[n,...r]=e.projects;if(!n||r.length>0||n.name!==`untitled`)return!1;let[i,...a]=n.pages;return i!==void 0&&a.length===0&&i.name===`page-1`&&i.frames.length===0}var tK={phase:`idle`,project:null,at:0,withLook:null,name:null,size:`phone`,accent:ZG.accent,font:ZG.font,drawer:`agent`,refusal:null,busy:!1,moved:!1,landing:!1},nK=N()(()=>tK);function rK(e){let t=z_(e=>e.board),n=z_(e=>e.canWrite),r=F(nK,e=>e.phase),i=F(nK,e=>e.project);return!n||e.frames.length>0?!1:r===`open`?e.project===i:r===`idle`&&eK(t,n)}function iK(e){nK.setState({landing:e===`/`})}function aK(){let e=z_(e=>e.board),t=z_(e=>e.canWrite),n=z_(e=>e.accessKnown),r=F(nK,e=>e.landing),i=F(nK,e=>e.phase),[,a]=Va(),o=i===`idle`&&eK(e,t),s=e!==null&&n;return(0,_.useEffect)(()=>{r&&s&&(nK.setState({landing:!1}),o&&a(q_(QG,$G),{replace:!0}))},[r,s,o,a]),r&&(!s||o)}function oK(e){return e.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,`-`).replace(/^-+|-+$/g,``)}function sK(e){let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);return t.slice(n+1)===`.frameboard`?n>0?t.slice(0,n):`/`:e}function cK(e,t){return`Draw a ${e} screen for ${t} on frameboard`}var lK={phone:`Phone`,tablet:`Tablet`,desktop:`Desktop`},uK={phone:`h-9 w-5`,tablet:`h-[38px] w-[30px]`,desktop:`h-[30px] w-[46px]`},dK={blue:`Blue`,red:`Red`,green:`Green`,orange:`Orange`,purple:`Purple`};function fK({page:e,calls:t=$O,loadTokens:n}){let r=F(nK),i=UG(e.project,n),a=z_(e=>e.board?.root??``),[,o]=Va(),s=(0,_.useRef)(null),c=r.project??e.project,l=r.withLook??(i==null||i.sheets.length===0),u=l?[`name`,`size`,`look`,`agent`]:[`name`,`size`,`agent`],d=Math.min(r.at,u.length-1),f=u[d]??`name`,p=r.name??c,m=oK(p);(0,_.useEffect)(()=>{r.moved&&(s.current?.focus(),nK.setState({moved:!1}))},[r.moved]);let h=e=>nK.setState(e),g=()=>h({phase:`open`,project:c,withLook:l,refusal:null}),v=()=>h({at:d+1,refusal:null,busy:!1,moved:!0}),y=(e,t)=>{e instanceof Zx?h({refusal:e.message,busy:!1}):(h({busy:!1}),ok(t)(e))},b=async()=>{if(l)try{await t.projectTokens(c,{accent:r.accent,font:r.font})}catch(e){if(!(e instanceof Zx&&e.code===`tokens-exist`))return h({busy:!1}),ok(`Couldn't write ${c}/tokens.css`)(e)}if(r.drawer===`self`){LG(r.size);let n=await zG({x:0,y:0},{page:e.ref,frames:e.frames,calls:t});n&&ev.fitTo([n.box])}h({phase:`done`,busy:!1}),n_.add({title:`Board set up`,description:r.drawer===`self`?`Added a ${r.size} frame to ${e.name}.`:`Paste the prompt into Claude Code to draw the first frame of ${c}.`,type:`success`})},x=async()=>{if(!r.busy){if(g(),h({busy:!0}),f===`name`){if(m===``)return h({refusal:`Enter a name for the project.`,busy:!1});if(m===c)return v();try{await t.renameProject(c,m)}catch(e){return y(e,`Couldn't rename ${c}`)}return bk(c,m),h({project:m,name:null}),o(q_(m,e.name),{replace:!0}),v()}if(f===`agent`)return b();v()}};return(0,Z.jsxs)(`section`,{"aria-labelledby":`guide-title`,className:`pointer-events-auto absolute top-1/2 left-1/2 w-110 max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-[52%] overflow-hidden rounded-[14px] border border-border bg-card text-body text-card-foreground shadow-[0_16px_48px_rgba(0,0,0,.16),0_1px_3px_rgba(0,0,0,.08)]`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 px-4 pt-3.5`,children:[(0,Z.jsx)(`h2`,{id:`guide-title`,className:`text-sm font-semibold`,children:`Set up your board`}),(0,Z.jsxs)(`span`,{className:`ml-auto text-muted-foreground tabular-nums`,children:[d+1,` of `,u.length]})]}),(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`flex gap-1 px-4 pt-2.5`,children:u.map((e,t)=>(0,Z.jsx)(`i`,{className:Q(`h-[3px] flex-1 rounded-sm`,t<=d?`bg-primary`:`bg-muted`)},e))}),(0,Z.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),x()},children:[(0,Z.jsxs)(`div`,{className:`p-4`,children:[(0,Z.jsx)(`h3`,{ref:s,id:`guide-step`,tabIndex:-1,className:`mb-1 text-base font-semibold outline-none`,children:pK[f]}),f===`name`?(0,Z.jsx)(vK,{name:p,project:c,folder:m,refusal:r.refusal,onChange:e=>h({name:e,refusal:null})}):f===`size`?(0,Z.jsx)(bK,{size:r.size,page:e.name,onChange:e=>h({size:e})}):f===`look`?(0,Z.jsx)(xK,{accent:r.accent,font:r.font,project:c,refusal:r.refusal,onChange:e=>h(e)}):(0,Z.jsx)(SK,{drawer:r.drawer,folder:sK(a),sheet:l?`${c}/tokens.css`:null,prompt:cK(r.size,c),size:r.size,page:e.name,onChange:e=>h({drawer:e})})]}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border px-4 py-3`,children:[(0,Z.jsx)(`button`,{type:`button`,onClick:()=>h({phase:`done`}),className:`h-[30px] rounded-lg px-1 text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:`Skip setup`}),d>0?(0,Z.jsx)(`button`,{type:`button`,onClick:()=>h({at:d-1,refusal:null,moved:!0}),className:`ml-auto h-[30px] rounded-lg bg-muted px-3 font-medium outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50`,children:`Back`}):null,(0,Z.jsx)(`button`,{type:`submit`,"aria-disabled":r.busy,className:Q(`h-[30px] rounded-lg bg-primary px-3 font-medium text-primary-foreground outline-none hover:bg-primary/85 focus-visible:ring-3 focus-visible:ring-ring/50 aria-disabled:opacity-60`,d===0&&`ml-auto`),children:f===`agent`?`Finish`:`Next`})]})]})]})}var pK={name:`What are you designing?`,size:`Which screen first?`,look:`Pick a starting look`,agent:`Who draws the first frame?`};function mK({children:e}){return(0,Z.jsx)(`p`,{className:`leading-[1.55] text-muted-foreground`,children:e})}function hK({children:e}){return(0,Z.jsx)(`p`,{className:`mt-2.5 flex flex-wrap items-center gap-1.5 text-label font-normal text-muted-foreground`,children:e})}function gK({children:e,className:t}){return(0,Z.jsx)(`code`,{className:Q(`rounded bg-muted px-[5px] py-px font-mono text-[10.5px]`,t),children:e})}function _K({id:e,children:t}){return(0,Z.jsx)(`p`,{id:e,role:`alert`,className:`mt-1.5 text-label leading-[1.45] font-normal text-destructive`,children:t})}function vK({name:e,project:t,folder:n,refusal:r,onChange:i}){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(mK,{children:`Give the project a name. You can rename it any time from the header.`}),(0,Z.jsx)(`input`,{autoFocus:!0,"aria-labelledby":`guide-step`,"aria-invalid":r!==null,"aria-describedby":r?`guide-refusal`:void 0,value:e,spellCheck:!1,onChange:e=>i(e.target.value),className:`mt-3 h-[34px] w-full rounded-lg bg-background px-2.5 text-[13px] text-foreground ring-[1.5px] ring-primary outline-none selection:bg-primary/45 aria-invalid:ring-destructive`}),r?(0,Z.jsx)(_K,{id:`guide-refusal`,children:r}):null,(0,Z.jsx)(hK,{children:n===t||n===``?(0,Z.jsxs)(Z.Fragment,{children:[`Keeps `,(0,Z.jsxs)(gK,{children:[t,`/`]})]}):(0,Z.jsxs)(Z.Fragment,{children:[`Renames `,(0,Z.jsxs)(gK,{children:[t,`/`]}),` to `,(0,Z.jsxs)(gK,{children:[n,`/`]})]})})]})}function yK({group:e,checked:t,onSelect:n,className:r,children:i,label:a,labelledBy:o,disabled:s=!1}){return(0,Z.jsxs)(`label`,{className:Q(`relative has-checked:border-primary has-checked:shadow-[0_0_0_1px_var(--primary)] has-[input:focus-visible]:ring-3 has-[input:focus-visible]:ring-ring/50 has-disabled:opacity-60`,r),children:[(0,Z.jsx)(`input`,{type:`radio`,name:e,checked:t,onChange:n,disabled:s,"aria-label":a,"aria-labelledby":o,className:`peer sr-only`}),i]})}function bK({size:e,page:t,onChange:n}){let r=Object.keys(wN);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(mK,{children:`Sets the size of your first frame. Add other sizes later from the Frame tool.`}),(0,Z.jsx)(`div`,{role:`radiogroup`,"aria-labelledby":`guide-step`,className:`mt-3 grid grid-cols-3 gap-2`,children:r.map(t=>(0,Z.jsxs)(yK,{group:`guide-size`,checked:e===t,onSelect:()=>n(t),className:`flex flex-col items-center gap-2 rounded-[10px] border border-border px-2 pt-3.5 pb-2.5 text-muted-foreground has-checked:text-primary`,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:Q(`rounded border-[1.5px] border-current`,uK[t])}),(0,Z.jsx)(`b`,{className:`font-semibold text-foreground`,children:lK[t]}),wN[t].width,` × `,wN[t].height]},t))}),(0,Z.jsxs)(hK,{children:[`Sizes the first frame on `,(0,Z.jsx)(gK,{children:t})]})]})}function xK({accent:e,font:t,project:n,refusal:r,onChange:i}){let a=Object.keys(YG),o=Object.keys(XG);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(mK,{children:`Every frame in this project reads these tokens, in light and dark. The Theme tab shows them.`}),(0,Z.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-2`,children:[(0,Z.jsxs)(`div`,{className:`rounded-lg bg-muted px-2.5 py-2`,children:[(0,Z.jsx)(`span`,{id:`guide-accent`,className:`mb-1.5 block text-label font-normal text-muted-foreground`,children:`Accent`}),(0,Z.jsx)(`div`,{role:`radiogroup`,"aria-labelledby":`guide-accent`,className:`flex gap-1.5`,children:a.map(n=>(0,Z.jsx)(yK,{group:`guide-accent`,label:dK[n],checked:e===n,onSelect:()=>i({accent:n,font:t}),className:`size-5 overflow-hidden rounded-[5px] has-checked:shadow-[0_0_0_2px_var(--muted),0_0_0_3.5px_var(--foreground)]`,children:(0,Z.jsx)(`span`,{"aria-hidden":!0,className:Q(`absolute inset-0 rounded-[5px] bg-(--swatch) dark:bg-(--swatch-dark)`,_G),style:{"--swatch":YG[n].light,"--swatch-dark":YG[n].dark}})},n))})]}),(0,Z.jsxs)(`label`,{className:`rounded-lg bg-muted px-2.5 py-2`,children:[GG.filter(e=>e.startsLook).map(e=>(0,Z.jsx)(`link`,{rel:`stylesheet`,href:qG(e)},e.folder)),(0,Z.jsx)(`span`,{className:`mb-1.5 block text-label font-normal text-muted-foreground`,children:`Font`}),(0,Z.jsxs)(`span`,{className:`relative block`,children:[(0,Z.jsx)(`select`,{value:t,onChange:t=>i({accent:e,font:t.target.value}),className:`h-[26px] w-full appearance-none rounded-md bg-card px-2 text-foreground shadow-[0_0_0_1px_var(--border)] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-60`,children:o.map(e=>(0,Z.jsx)(`option`,{value:e,style:{fontFamily:XG[e].stack},children:XG[e].family},e))}),(0,Z.jsx)(Lt,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 right-2 size-2.5 -translate-y-1/2`})]})]})]}),r?(0,Z.jsx)(_K,{id:`guide-refusal`,children:r}):null,(0,Z.jsxs)(hK,{children:[`Finish writes `,(0,Z.jsxs)(gK,{children:[n,`/tokens.css`]})]})]})}function SK({drawer:e,folder:t,sheet:n,prompt:r,size:i,page:a,onChange:o}){let[s,c]=(0,_.useState)(null),l=`flex gap-2.5 rounded-[10px] border border-border px-3 py-2.5 text-left`,u=`mt-px size-3.5 flex-none rounded-full border-[1.5px] border-muted-foreground peer-checked:border-4 peer-checked:border-primary`;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(mK,{children:`Frameboard is drawn on by a coding agent. You can also start from a blank frame.`}),(0,Z.jsxs)(`div`,{role:`radiogroup`,"aria-labelledby":`guide-step`,className:`mt-3 flex flex-col gap-2`,children:[(0,Z.jsxs)(yK,{group:`guide-drawer`,checked:e===`agent`,onSelect:()=>o(`agent`),labelledBy:`guide-agent-name guide-agent-hint`,className:l,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:u}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`b`,{id:`guide-agent-name`,className:`mb-0.5 block font-semibold`,children:`My agent`}),(0,Z.jsxs)(`span`,{id:`guide-agent-hint`,className:`leading-[1.45] text-muted-foreground`,children:[`Paste this into Claude Code opened in`,` `,(0,Z.jsx)(gK,{className:`inline-block max-w-full wrap-anywhere`,children:t})]}),e===`agent`?(0,Z.jsxs)(`span`,{className:`mt-2.5 flex items-center gap-2 rounded-lg bg-muted py-2 pr-2 pl-2.5`,children:[(0,Z.jsx)(`code`,{className:`min-w-0 flex-1 font-mono text-[11.5px] text-foreground`,children:r}),(0,Z.jsx)(`button`,{type:`button`,onClick:()=>void navigator.clipboard.writeText(r).then(()=>c(r),ok(`Couldn't copy the prompt`)),className:`h-6 rounded-md px-1.5 text-label font-normal text-muted-foreground outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:s===r?`Copied`:`Copy`})]}):null]})]}),(0,Z.jsxs)(yK,{group:`guide-drawer`,checked:e===`self`,onSelect:()=>o(`self`),className:l,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:u}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`b`,{className:`mb-0.5 block font-semibold`,children:`I’ll start myself`}),(0,Z.jsxs)(`span`,{className:`leading-[1.45] text-muted-foreground`,children:[`Adds an empty `,i,` frame to `,a,`.`]})]})]})]}),(0,Z.jsx)(hK,{children:n===null?e===`agent`?`Writes nothing until your agent draws`:`Writes one frame file`:e===`agent`?(0,Z.jsxs)(Z.Fragment,{children:[`Finish writes only `,(0,Z.jsx)(gK,{children:n})]}):(0,Z.jsxs)(Z.Fragment,{children:[`Finish writes `,(0,Z.jsx)(gK,{children:n}),` and one frame file`]})})]})}function CK(e){let t=new Map;for(let{ref:n,box:r}of e){let i=1/0;for(let t of e)t.ref!==n&&(!(t.box.x<r.x+r.width&&t.box.x+t.box.width>r.x)||t.box.y>=r.y||(i=Math.min(i,Math.max(0,r.y-(t.box.y+t.box.height)))));t.set(n,i)}return t}function wK(e,t,n){for(let r of e.querySelectorAll(`[data-frame]`)){let e=t.get(r.dataset.frame??``)??1/0;r.toggleAttribute(`data-label-crowded`,e*n<20)}}function TK(e,t){for(let n of e.querySelectorAll(`[data-frame]`))n.toggleAttribute(`data-label-hover`,n.dataset.frame===t)}function EK(){return N()(()=>({at:null,frame:null}))}var DK=EK();function OK(e){let{place:t,selection:n,mode:r,live:i,clipboard:a,theme:o,notes:s,calls:c}=e,l=()=>r.getState().mode===`edit`,u=()=>l()&&i.getState().canWrite,d=()=>{let{page:t,frames:r}=n.getState();return t===e.page()?r:[]},f=()=>{let e=d(),n=t.getState().frame;return n&&e.includes(n)?n:e[0]},p=()=>{let e=f();return e?iM(hM(e,o)):null};return[{id:`frame.flipTheme`,get label(){let e=p();return e?`Flip to ${e}`:`Flip frame theme`},group:`frame`,command:{label:`Flip frame theme`,icon:Ei},enabled:()=>l()&&d().length>0,run:()=>{let e=p();if(e)for(let t of d())hM(t,o)!==e&&pM(t,o)}},{id:`frame.pasteAt`,label:`Paste here`,group:`frame`,palette:!1,enabled:()=>u()&&a.getState().held>0&&t.getState().at!==null,run:()=>{let{at:r}=t.getState();if(!r)return;let i=e.page();c.pasteFrames(i,{x:Math.round(r.x),y:Math.round(r.y)}).then(e=>KN(n,i,e.map(e=>e.ref)),ok(`Couldn't paste`))}},{id:`frame.newAt`,label:`New frame here`,group:`frame`,palette:!1,enabled:()=>u()&&t.getState().at!==null,run:()=>{let{at:i}=t.getState();i&&zG(i,{page:e.page(),frames:e.frames(),preset:e.preset,selection:n,mode:r,calls:c})}},{id:`note.addHere`,label:`Add a note here`,group:`note`,palette:!1,enabled:()=>u()&&!!n.getState().element&&d().length>0&&t.getState().at!==null,run:()=>{let{at:i}=t.getState(),{element:a}=n.getState(),o=e.frames().find(e=>e.ref===a?.frame);if(!i||!a||!o)return;let c=e.renderedAt(o.ref);r.setState({tool:`note`}),s.setState({open:{kind:`new`,pick:{frame:{ref:o.ref,name:o.name},element:c?a.index:null,renderedAt:c,at:i}}})}},{id:`note.addOnFrame`,label:`Add a note`,group:`note`,palette:!1,enabled:()=>u()&&t.getState().at!==null&&t.getState().frame!==null,run:()=>{let{at:n,frame:i}=t.getState(),a=e.frames().find(e=>e.ref===i);n&&a&&(r.setState({tool:`note`}),s.setState({open:{kind:`new`,pick:{frame:{ref:a.ref,name:a.name},element:null,renderedAt:null,at:n}}}))}}]}function kK(e,t,n){let r=(0,_.useRef)(e),i=(0,_.useRef)(t),a=(0,_.useRef)(n);(0,_.useEffect)(()=>{r.current=e,i.current=t,a.current=n},[e,t,n]),(0,_.useEffect)(()=>{let e=ye(OK({page:()=>r.current,frames:()=>i.current,renderedAt:e=>a.current(e),place:DK,selection:sP,mode:W_,live:R_,clipboard:_W,theme:xM,preset:FG,notes:zN,calls:$O})),t=[DK.subscribe(G),xM.subscribe(G),sP.subscribe(G),W_.subscribe(G),_W.subscribe(G),R_.subscribe(G)];return()=>{for(let e of t)e();e()}},[])}var AK=_.createContext(void 0);function jK(e=!0){let t=_.useContext(AK);if(t===void 0&&!e)throw Error(ao(25));return t}var MK=_.createContext(void 0);function NK(e){let t=_.useContext(MK);if(t===void 0&&!e)throw Error(ao(33));return t}var PK=_.createContext(void 0);function FK(e){let t=_.useContext(PK);if(t===void 0&&!e)throw Error(ao(36));return t}function IK({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=_.useRef(e!==void 0),[a,o]=_.useState(()=>t);return[i&&e!==void 0?e:a,_.useCallback(e=>{i||o(e)},[])]}var LK=_.createContext(null);function RK(e=`root`){let t=_.useContext(LK),n=_.useContext(PK);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var zK={visible:!0,ref:null};function BK(){return zK}function VK(e,t,n=`root`){let r=RK(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??BK)({label:e.label,children:e.children,render:e.render}),a=zl(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function HK(e){e.preventDefault()}function UK(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=FK(),u=jK(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,v=!f&&h&&n?0:-1;return _.useMemo(()=>({id:r,role:`menuitem`,tabIndex:v,"aria-selected":p,onMouseDown:f?HK:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:Dd})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!Os&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&md(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,v,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var WK={type:`regular-item`};function GK(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=_.useRef(null),{getButtonProps:d,buttonRef:f}=hd({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=UK({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=_.useCallback(e=>Zl(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=zl(u,f);return _.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var KK=_.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function qK(){return _.useContext(KK)}function JK(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=qK(),u=_.useRef(-1),[d,f]=_.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=_.useRef(null),h=_.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return q(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var YK=`data-checked`,XK=`data-unchecked`,ZK={checked(e){return e?{[YK]:``}:{[XK]:``}},...qs},QK=_.createContext(void 0);function $K(){let e=_.useContext(QK);if(e===void 0)throw Error(ao(31));return e}var eq=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=_.useState(void 0),c=uu(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,Z.jsx)(QK.Provider,{value:s,children:c})}),tq=_.forwardRef(function(e,t){let n=RK()?.Group??eq;return(0,Z.jsx)(n,{...e,ref:t})}),nq=_.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=qH(a),c=$K();return q(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),uu(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})}),rq=_.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=FK(),f=JK({guess:!0,label:a}),p=qH(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=GK({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:WK});return uu(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),iq=_.forwardRef(function(e,t){let n=VK(e,t);return n.visible?(0,Z.jsx)(rq,{...e,ref:n.ref}):null}),aq=_.createContext(void 0);function oq(){return _.useContext(aq)}function sq(e,t){let n=mu(e.render);if(_.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function cq(e,t,n){let r=sq(e,t),i=r===t?void 0:r;return[r,_.useCallback(e=>n?.(e?i:void 0),[i,n])]}function lq(e,t,n){let r=mu(e.render),i=_.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var uq=_.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=FK(),m=oq(),{side:h,align:g}=NK(),v=IU(!0)!=null,y=l.useState(`open`),b=l.useState(`transitionStatus`),x=l.useState(`popupProps`),S=l.useState(`mounted`),C=l.useState(`instantType`),w=l.useState(`activeTriggerElement`),T=l.useState(`parent`),E=l.useState(`lastOpenChangeReason`),D=l.useState(`rootId`),O=l.useState(`floatingRootContext`),k=l.useState(`floatingTreeRoot`),A=l.useState(`closeDelay`),j=l.useState(`hoverEnabled`),M=l.useState(`disabled`),N=l.useState(`openMethod`),P=l.useState(`activeTriggerId`),F=l.useState(`listElement`),[I,L]=cq(e,u,d),R=lq(e,w,P),z=T.type===`menu`?m:void 0,B=T.type===`context-menu`,V=s??T.type!==`menu`;s===void 0&&F&&T.type!==`menu`&&(V=()=>l.state.activeIndex===null&&F),Ou({open:y,ref:l.context.popupRef,onComplete(){y&&l.context.onOpenChangeComplete?.(!0)}}),_.useEffect(()=>{function e(e){l.setOpen(!1,bd(e.reason,e.domEvent))}return k.events.on(`close`,e),()=>{k.events.off(`close`,e)}},[k.events,l]),Np(O,{enabled:j&&!M&&!B&&T.type!==`menubar`,closeDelay:A});let ee=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:te,handleFocus:ne}=(_.useContext(LK)?.useParentHandoff??fq)(l,T,y,f),re=uu(`div`,e,{state:{transitionStatus:b,side:h,align:g,open:y,nested:T.type===`menu`,instant:C},ref:[t,l.context.popupRef,ee,L],stateAttributesMapping:sc,props:[x,{id:I,...F?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":R},onKeyDown(e){z?.onPopupKeyDown?.(e),v&&OU.has(e.key)&&e.stopPropagation()},onFocus:ne},bh(b),c,{"data-rootownerid":D}]}),H=T.type===void 0||B;(w||T.type===`menubar`&&E!==`outside-press`)&&(H=!0);let U=z?.getReturnElement??te;return(0,Z.jsx)(Wf,{context:O,openInteractionType:N,modal:B,disabled:!S,returnFocus:a??U??H,explicitReturnFocus:a===void 0&&U?!1:void 0,initialFocus:V,restoreFocus:!0,getInsideElements:T.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:T.type===`menubar`?void 0:k,previousFocusableElement:w,nextFocusableElement:T.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:re})}),dq={parentVirtualFocusRef:void 0,handleFocus:void 0};function fq(){return dq}var pq=_.forwardRef(function(e,t){let n=RK()?.Popup??uq;return(0,Z.jsx)(n,{...e,ref:t})}),mq=_.createContext(void 0);function hq(){let e=_.useContext(mq);if(e===void 0)throw Error(ao(32));return e}var gq=_.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=FK();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,Z.jsx)(mq.Provider,{value:n,children:(0,Z.jsx)($d,{ref:t,...r,portalOwnerRole:o})})});function _q(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=J(i),[,o]=_.useState(0),s=ro(yq).current,c=ro(vq).current,l=_.useRef(0),u=_.useRef(!0),d=_.useRef(null),f=_.useRef(null),p=J(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=J((e,t)=>{c.set(e,t),p()}),h=J(e=>{c.delete(e),p()}),g=J(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function v(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!Sq(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&Cq(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=xq(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let y=J(()=>{let[e,t]=bq(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});v(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});q(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),q(()=>{u.current&&y()}),q(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let b=J(e=>(s.add(e),()=>{s.delete(e)})),x=_.useMemo(()=>({register:m,unregister:h,subscribeMapChange:b,nextIndexRef:l}),[m,h,b,l]);return(0,Z.jsx)(KK.Provider,{value:x,children:t})}function vq(){return new Map}function yq(){return new Set}function bq(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>Cq(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function xq(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Sq(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function Cq(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var wq=_.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Fu,style:g,...v}=e,{store:y,virtualFocus:b,syncHighlightedItem:x}=FK(),S=hq(),C=jK(!0),w=y.useState(`parent`),T=y.useState(`floatingRootContext`),E=y.useState(`floatingTreeRoot`),D=y.useState(`mounted`),O=y.useState(`open`),k=y.useState(`modal`),A=y.useState(`openMethod`),j=y.useState(`activeTriggerElement`),M=y.useState(`transitionStatus`),N=y.useState(`positionerElement`),P=y.useState(`instantType`),F=y.useState(`adaptiveOrigin`),I=y.useState(`lastOpenChangeReason`),L=y.useState(`floatingNodeId`),R=y.useState(`floatingParentNodeId`),z=T.useState(`domReferenceElement`),B=n,V=c,ee=l,te=s,ne=h;w.type===`context-menu`&&(B=n??w.context?.anchor,te??=`start`,!o&&te!==`center`&&(ee=e.alignOffset??2,V=e.sideOffset??-5));let re=o,H=te;w.type===`menu`?(re??=`inline-end`,H??=`start`,ne=e.collisionAvoidance??Iu):w.type===`menubar`&&(re??=w.context.orientation===`vertical`?`inline-end`:`bottom`,H??=`start`);let U=w.type===`context-menu`,ie=_h({anchor:B,floatingRootContext:T,positionMethod:C?`fixed`:r,mounted:D,side:re,sideOffset:V,align:H,alignOffset:ee,arrowPadding:U?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:L,keepMounted:S,disableAnchorTracking:m,collisionAvoidance:ne,shift:U?{crossAxis:!(`side`in ne&&ne.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:E,adaptiveOrigin:F,lazyFlip:b?`placement`:!1});_.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===L&&y.set(`hoverEnabled`,!1),e.nodeId!==L&&e.parentNodeId===y.select(`floatingParentNodeId`)&&y.setOpen(!1,bd(Ud)))}return E.events.on(`menuopenchange`,e),()=>{E.events.off(`menuopenchange`,e)}},[y,E.events,L]),_.useEffect(()=>{if(y.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==y.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;y.setOpen(!1,bd(t))}return E.events.on(`menuopenchange`,e),()=>{E.events.off(`menuopenchange`,e)}},[E.events,y]);let ae=ps();_.useEffect(()=>{O||ae.clear()},[O,ae]),_.useEffect(()=>{function e(e){if(O&&e.nodeId===y.select(`floatingParentNodeId`)){if(e.target&&j&&j!==e.target){let e=y.select(`closeDelay`);e>0?ae.isStarted()||ae.start(e,()=>{y.setOpen(!1,bd(Ud))}):y.setOpen(!1,bd(Ud))}else ae.clear()}}return E.events.on(`itemhover`,e),()=>{E.events.off(`itemhover`,e)}},[E.events,O,j,y,ae]),_.useEffect(()=>{let e={open:O,nodeId:L,parentNodeId:R,reason:y.select(`lastOpenChangeReason`)};E.events.emit(`menuopenchange`,e)},[E.events,O,y,L,R]),oU({store:y,domReference:z,positionerElement:N,open:O});let oe={open:O,side:ie.side,align:ie.align,anchorHidden:ie.anchorHidden,nested:w.type===`menu`,instant:P},W=w.type===`menubar`&&w.context.modal;yU(O&&(W||k&&I!==`trigger-hover`),A===`touch`,N,j);let se=xh(e,oe,{styles:ie.positionerStyles,transitionStatus:M,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!D,inert:!O}),ce=D&&w.type!==`menu`&&(w.type!==`menubar`&&k&&I!==`trigger-hover`||w.type===`menubar`&&w.context.modal),le=null;return w.type===`menubar`?le=w.context.contentElement:w.type===void 0&&(le=j),(0,Z.jsxs)(MK.Provider,{value:ie,children:[ce&&(0,Z.jsx)(aU,{ref:w.type===`context-menu`||w.type===`nested-context-menu`?w.context.internalBackdropRef:null,inert:yu(!O),cutout:le}),(0,Z.jsx)(Pf,{id:L,children:(0,Z.jsx)(_q,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,onMapChange:x,children:se})})]})}),Tq=_.createContext(void 0);function Eq(){let e=_.useContext(Tq);if(e===void 0)throw Error(ao(34));return e}var Dq=_.forwardRef(function(e,t){let{render:n,className:r,value:i,defaultValue:a,onValueChange:o,disabled:s=!1,style:c,"aria-labelledby":l,...u}=e,[d,f]=_.useState(void 0),[p,m]=IK({controlled:i,default:a,name:`MenuRadioGroup`}),h=J((e,t)=>{o?.(e,t),!t.isCanceled&&m(e)}),g=uu(`div`,e,{state:{disabled:s},ref:t,props:{role:`group`,"aria-labelledby":l??d,"aria-disabled":s||void 0,...u}}),v=_.useMemo(()=>({value:p,setValue:h,disabled:s}),[p,h,s]);return(0,Z.jsx)(QK.Provider,{value:f,children:(0,Z.jsx)(Tq.Provider,{value:v,children:g})})}),Oq=_.memo(_.forwardRef(function(e,t){let n=RK()?.RadioGroup??Dq;return(0,Z.jsx)(n,{...e,ref:t})})),kq=_.createContext(void 0);function Aq(){let e=_.useContext(kq);if(e===void 0)throw Error(ao(35));return e}var jq=_.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,value:l,style:u,...d}=e,{store:f}=FK(),{value:p,setValue:m,disabled:h}=Eq(),g=JK({guess:!0,label:a}),v=qH(i),y=f.useState(`isActive`,g.index),b=f.useState(`floatingNodeId`),x=f.useState(`itemProps`),S=f.useState(`disabled`),C=s||h||S,w=p===l,{getItemProps:T,itemRef:E}=GK({closeOnClick:c,disabled:C,highlighted:y,id:v,store:f,nativeButton:o,nodeId:b,itemMetadata:WK}),D=_.useMemo(()=>({disabled:C,highlighted:y,checked:w}),[C,y,w]);function O(e){let t=bd(Dd,e.nativeEvent,void 0,{preventUnmountOnClose:Qa});m(l,t)}let k=uu(`div`,e,{state:D,stateAttributesMapping:ZK,props:[x,{role:`menuitemradio`,"aria-checked":w,onClick:O},d,T],ref:[E,t,g.ref]});return(0,Z.jsx)(kq.Provider,{value:D,children:k})}),Mq=_.forwardRef(function(e,t){let n=VK(e,t);return n.visible?(0,Z.jsx)(jq,{...e,ref:n.ref}):null}),Nq=_.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=Aq(),c=_.useRef(null),{transitionStatus:l,mounted:u,setMounted:d}=$f(s.checked);return Ou({batch:!0,enabled:!s.checked,open:s.checked,ref:c,onComplete(){s.checked||d(!1)}}),uu(`span`,e,{state:{checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l},stateAttributesMapping:ZK,ref:[t,c],props:{"aria-hidden":!0,...o},enabled:a||u})}),Pq=_.createContext(null);function Fq(e){let t=_.useContext(Pq);if(t===null&&!e)throw Error(ao(5));return t}function Iq(e){return e==null?Sd:e.type.startsWith(`key`)?Ld:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?Rd:Sd}var Lq={...wp,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=wp.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>As&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!wp.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},Rq=class extends Mo{constructor(e,t,n=!1){let r=new hp,i=Bq(r,t,n,e);super(i,zq(r),Lq),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function zq(e){return{positionerRef:_.createRef(),popupRef:_.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:_.createRef(),beforeTriggerFocusGuardRef:_.createRef(),beforeContentFocusGuardRef:_.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function Bq(e,t,n=!1,r){return{...vp(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:eo,inputProps:eo,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Of,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:eo,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var Vq=_.createContext(null);function Hq(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function Uq(e,t){return e===`list-navigation`||Hq(e,t)}var Wq=_o(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:p,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:g=!0,isSubmenu:v=!1,virtualFocus:y=!1,virtualFocusRef:b,allowEscape:x=!0,resetOnPointerLeave:S=!0}=e,C=jK(!0),w=FK(!0),T=Fq(!0),E=w?.store,D=w?.virtualFocus??!1,O=_.useMemo(()=>v&&E?{type:`menu`,store:E}:T?{type:`menubar`,context:T}:C&&!E?{type:`context-menu`,context:C}:{type:void 0},[C,E,T,v]),k=qH(),A=qH(),[j,M]=_.useState(void 0),N=(j??A)||void 0,P=jf(),F=O.type===`menu`?O.store:void 0,I=(n??o)&&F?.state.transitionStatus===`starting`,L=ro(()=>I?F?.state.instantType:void 0).current,R=ro(()=>{let e=new Rq({open:o,openProp:n,activeTriggerId:h,triggerIdProp:m,parent:O,disabled:s,highlightItemOnHover:g,modal:O.type===void 0?c:void 0,rootId:k,instantType:L},N,P!=null);return e.context.virtualFocusRef=b,e}).current;R.useControlledProp(`openProp`,n),R.useControlledProp(`triggerIdProp`,m),R.useContextCallback(`onOpenChangeComplete`,i);let z=R.useState(`floatingTreeRoot`),B=Nf(z),V=R.useState(`open`),ee=R.useState(`activeTriggerElement`),te=R.useState(`positionerElement`),ne=R.useState(`hoverEnabled`),re=R.useState(`disabled`),H=R.useState(`lastOpenChangeReason`),U=R.useState(`parent`),ie=R.useState(`activeIndex`),ae=R.useState(`keyboardOpen`),oe=R.useState(`payload`),W=R.useState(`floatingParentNodeId`),se=_.useRef(null),ce=_.useRef(U.type!==`context-menu`),le=ps(),ue=_.useRef(!0),de=ps(),fe=W!=null,{openMethod:pe,triggerProps:me}=QH(V);R.useSyncedValues({disabled:s,highlightItemOnHover:g,modal:U.type===void 0?c:void 0,openMethod:pe,rootId:k}),dp(R);let{forceUnmount:he,transitionStatus:ge}=fp(V,R,()=>{R.set(`allowMouseEnter`,!1)},I),_e=Du(R.context.popupRef);_.useEffect(()=>{if(L===void 0)return;let e=()=>{R.state.instantType===L&&R.set(`instantType`,void 0)};if(!V){e();return}if(ge!==void 0)return;if(R.context.popupRef.current==null){e();return}let t=new AbortController;return _e(e,t.signal),()=>{t.abort()}},[L,V,ge,_e,R]),q(()=>{C&&!w?R.update({parent:{type:`context-menu`,context:C},floatingNodeId:B,floatingParentNodeId:P}):(w||!R.select(`activeTriggerElement`))&&R.update({floatingNodeId:B,floatingParentNodeId:P})},[C,w,B,P,ee,R]),_.useEffect(()=>{V||(se.current=null),U.type===`context-menu`&&(V?le.start(500,()=>{ce.current=!0}):(le.clear(),ce.current=!1))},[le,V,U.type]),q(()=>{!V&&!ne&&R.set(`hoverEnabled`,!0)},[V,ne,R]);let ve=J((e,t)=>{let n=t.reason;if(!e&&!R.select(`open`)||V===e&&t.trigger===ee&&H===n)return;let i=cp(t);if(!e&&t.trigger==null&&(t.trigger=ee??void 0),r?.(e,t),t.isCanceled)return;R.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!ue.current)return;e&&n===`trigger-focus`?(ue.current=!1,de.start(300,()=>{ue.current=!0})):(ue.current=!0,de.clear());let o=!e&&(n===`escape-key`||n==null);se.current=t.event;let s=sp(R.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&Uq(n,a),s.instantType=U.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:Hq(n,a)?`click`:o?`dismiss`:void 0,R.update(s)}),ye=Qf({popupStore:R,floatingRootContext:R.state.floatingRootContext,floatingId:N,nested:P!=null,onOpenChange:ve}),G=ye.context.events;q(()=>{let e=({open:e,eventDetails:t})=>ve(e,t);return G.on(`setOpen`,e),()=>{G?.off(`setOpen`,e)}},[G,ve]),q(()=>R.subscribeToParentMenu(),[R]);let be=_.useCallback(()=>{R.setOpen(!1,bd(qd))},[R]);_.useImperativeHandle(d,()=>({unmount:he,close:be}),[he,be]);let xe;U.type===`context-menu`&&(xe=U.context),_.useImperativeHandle(xe?.positionerRef,()=>te,[te]),_.useImperativeHandle(xe?.actionsRef,()=>({setOpen:ve}),[ve]);let Se=Zf(ye,{enabled:!re,bubbles:{escapeKey:f&&U.type===`menu`},outsidePress(){return U.type!==`context-menu`||se.current?.type===`contextmenu`||ce.current},externalTree:fe?z:void 0}),Ce=rh(),we=Hp(ye,{enabled:!re,listRef:R.context.itemDomElements,activeIndex:ie,virtual:y,nested:U.type===`menubar`||!y&&U.type!==void 0,parentOrientation:U.type===`menubar`?U.context.orientation:void 0,loopFocus:l,focusItemOnOpen:y?ae:void 0,allowEscape:y&&l&&x,orientation:u,triggerOrientation:y?`vertical`:u,rtl:Ce===`rtl`,disabledIndices:$a,onNavigate(e,t){R.setActiveIndex(e,Iq(t),t?.nativeEvent)},openOnArrowKeyDown:U.type!==`context-menu`&&!(y&&v),externalTree:!y&&fe?z:void 0,nestedReturnFocusRef:F?.context.virtualFocusRef,focusItemOnHover:g,resetOnPointerLeave:S}),Te=_.useCallback(e=>{R.context.typingRef.current=e},[R]),Ee=Up(ye,{enabled:!re&&!y,listRef:R.context.itemLabels,elementsRef:R.context.itemDomElements,activeIndex:ie,resetMs:500,onMatch:(e,t)=>{V&&e!==ie&&R.setActiveIndex(e,Ld,t.nativeEvent)},onTyping:Te}),De=J(a),Oe=_.useRef(-1),ke=J(()=>{let e=R.state.activeIndex,t=e===null?void 0:R.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Oe.current===n&&R.context.reportedItem===t)return;Oe.current=n,R.context.reportedItem=t,y&&R.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=R.context;R.context.highlightReason=Sd,R.context.highlightEvent=void 0,a&&De(t,xd(r,i,{label:t===void 0?void 0:R.context.itemLabels.current[n]??void 0}))});q(()=>{ke()},[ie,ke]);let Ae=_.useMemo(()=>{if(!y)return we.reference;if(!we.trigger)return eo;let{onFocus:e,...t}=we.trigger;return t},[y,we.reference,we.trigger]);R.useSyncedValue(`inputProps`,y?we.reference??eo:eo);let je=_.useMemo(()=>{let e=Zl(Ee.reference,Ae,Se.reference,{onMouseMove(){R.set(`allowMouseEnter`,!0)}},me);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=V,e},[R,Ee.reference,Ae,Se.reference,me,V]),Me=_.useMemo(()=>{let e=Zl(we.trigger,Se.trigger,me);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[we.trigger,Se.trigger,me]);ro(()=>(R.update({inactiveTriggerProps:Me}),null)),pp(R,{floatingRootContext:ye,activeTriggerProps:je,inactiveTriggerProps:Me,popupProps:_.useMemo(()=>Zl(tp,{onMouseMove(){R.set(`allowMouseEnter`,!0),U.type===`menu`&&R.set(`hoverEnabled`,!1)},onClick(){R.select(`hoverEnabled`)&&R.set(`hoverEnabled`,!1)},onKeyDown(e){let t=R.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Ee.floating,we.floating,Se.floating),[U.type,R,Ee.floating,we.floating,Se.floating]),itemProps:we.item??eo});let Ne=_.useMemo(()=>({store:R,parent:O,orientation:u,loopFocus:l,allowEscape:x,defaultFloatingId:A,setRenderedFloatingId:M,virtualFocus:y,parentVirtualFocus:D,syncHighlightedItem:ke}),[R,O,u,l,x,A,y,D,ke]),Pe=typeof t==`function`?t({payload:oe}):t,Fe=(0,Z.jsxs)(PK.Provider,{value:Ne,children:[p&&(0,Z.jsx)(ip,{handle:p,store:R}),Pe]});return(U.type===void 0||U.type===`context-menu`)&&(Fe=(0,Z.jsx)(Ff,{externalTree:z,children:Fe})),Fe});function Gq(e){let t=_.useContext(Vq);if(t===null)return(0,Z.jsx)(Wq,{...e});let n=t.Root;return(0,Z.jsx)(Vq.Provider,{value:null,children:(0,Z.jsx)(n,{...t.options,...e})})}var Kq={};function qq(e){FK();let t=_.useContext(Vq);if(t!==null){let n=t.SubmenuRoot;return(0,Z.jsx)(Vq.Provider,{value:null,children:(0,Z.jsx)(n,{...t.options,...e})})}return(0,Z.jsx)(aq.Provider,{value:Kq,children:(0,Z.jsx)(Wq,{...e,isSubmenu:!0})})}var Jq=5;function Yq(e,t){let n=Xq(t);return e.clientX>=n.left-Jq&&e.clientX<=n.right+Jq&&e.clientY>=n.top-Jq&&e.clientY<=n.bottom+Jq}function Xq(e){let t=e.getBoundingClientRect(),n=Y(e);if(Ns)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function Zq(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=fd(),{ref:i,index:a}=JK(e),o=n===a,s=_.useRef(null),c=zl(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function Qq(e){let{render:t,className:n,style:r,state:i=eo,props:a=$a,refs:o=$a,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=Zq({metadata:s});return uu(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function $q(e){if(Ro(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!Xo(e))return $q($o(e))}function eJ(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=_.useRef(!1);return _.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,is(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:eo,[t,n,r])}var tJ=vo(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=FK(!0),h=Tp(d)??m?.store;if(!h)throw Error(ao(85));let g=qH(s),v=h.useState(`isTriggerActive`,g),y=h.useState(`floatingRootContext`),b=h.useState(`isOpenedByTrigger`,g),x=h.useState(`triggerControlsId`,g),S=_.useRef(null),C=rJ(),w=fd(!0),T=Mf(),E=_.useMemo(()=>T??new Of,[T]),{registerTrigger:D,isMountedByThisTrigger:O}=up(g,S,h,{payload:f,closeDelay:u,parent:C,floatingTreeRoot:E,floatingNodeId:Nf(E),floatingParentNodeId:jf(),keyboardEventRelay:w?.relayKeyboardEvent}),k=C.type===`menubar`,A=h.useState(`disabled`),j=a||A||k&&C.context.disabled,{getButtonProps:M,buttonRef:N}=hd({disabled:j,native:o});_.useEffect(()=>{!b&&C.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,b,C.type]);let P=_.useRef(null),F=ps(),I=J(e=>{if(!P.current)return;F.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;X(P.current,t)||X(h.select(`positionerElement`),t)||t===P.current||t!=null&&$q(t)===h.select(`rootId`)||Yq(e,P.current)||E.events.emit(`close`,{domEvent:e,reason:Hd})});_.useEffect(()=>{let e=is(P.current);if(b&&h.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,I,{once:!0}),()=>{e.removeEventListener(`mouseup`,I)}},[b,I,h]);let L=k&&C.context.hasSubmenuOpen,R=Fp(y,{enabled:(c??L)&&!j&&(!k||L&&!O),handleClose:Zp({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:C.type===void 0?l:void 0,delay:{close:u},triggerElementRef:S,externalTree:E,isActiveTrigger:v,isClosing:()=>h.select(`transitionStatus`)===`ending`}),z=nJ(b,h.select(`lastOpenChangeReason`)),B=Gf(y,{enabled:!j,event:b&&k?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0&&z}),V=Dp(y,{enabled:!j&&L}),ee=eJ({open:b,enabled:k,mouseDownAction:`open`}),te=_.useMemo(()=>Zl(V.reference,B.reference),[V.reference,B.reference]),ne=h.useState(`triggerProps`,O),re=h.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:H,handleFocusTargetFocus:U}=JH(h,S),ie={disabled:j,open:b},ae=[P,t,N,D,S],oe=[te,R??eo,ne,{"aria-haspopup":`menu`,"aria-controls":x,id:g,onMouseDown:e=>{h.select(`open`)||(F.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),is(e.currentTarget).addEventListener(`mouseup`,I,{once:!0}))}},re,k?{role:`menuitem`}:{},ee,p,M],W=uu(`button`,e,{enabled:!k,stateAttributesMapping:ac,state:ie,ref:ae,props:oe});return k?(0,Z.jsx)(Qq,{tag:`button`,render:n,className:r,style:i,state:ie,refs:ae,props:oe,stateAttributesMapping:ac}):b?(0,Z.jsxs)(_.Fragment,{children:[(0,Z.jsx)(Rl,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:H},`${g}-pre-focus-guard`),(0,Z.jsx)(_.Fragment,{children:W},g),(0,Z.jsx)(Rl,{ref:h.context.triggerFocusTargetRef,onFocus:U},`${g}-post-focus-guard`)]}):(0,Z.jsx)(_.Fragment,{children:W},g)});function nJ(e,t){let n=ps(),[r,i]=_.useState(!1);return q(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function rJ(){let e=Fq(!0);return _.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var iJ=_.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return uu(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function aJ(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var oJ={"aria-expanded":void 0},sJ=_.forwardRef(function(e,t){let{render:n,className:r,style:i,label:a,id:o,nativeButton:s=!1,openOnHover:c=!0,delay:l=100,closeDelay:u=0,disabled:d=!1,...f}=e,p=FK(!0);if(p?.parent.type!==`menu`)throw Error(ao(37));let m=NK(),h=oq(),{store:g,parentVirtualFocus:v}=p,y=p.parent.store,b=JK({guess:!0,label:a}),x=qH(o),S=g.useState(`open`),C=_.useRef(!1),w=g.useState(`positionerElement`),T=g.useState(`floatingRootContext`),E=g.useState(`floatingTreeRoot`),D=g.useState(`triggerPopupId`,x),O=op(x,g),k=J(e=>{O(e);let t=g.select(`activeTriggerElement`);e!==null&&g.select(`open`)&&(t===e||g.select(`activeTriggerId`)==null)&&g.update({activeTriggerId:x??null,activeTriggerElement:e,closeDelay:u})}),A=_.useRef(null),j=_.useCallback(e=>{A.current=e,g.set(`activeTriggerElement`,e)},[g]);q(()=>(k(A.current),()=>k(null)),[k,x,g]),q(()=>{if(!S||!w)return;function e(e){Is(e)===g.context.beforeContentFocusGuardRef.current&&(C.current=e.relatedTarget===A.current)}return w.addEventListener(`focusout`,e,!0),()=>{C.current=!1,w.removeEventListener(`focusout`,e,!0)}},[S,w,g]),g.useSyncedValue(`closeDelay`,u);let M=g.useState(`disabled`),N=y.useState(`disabled`),P=d||M||N,F=y.useState(`itemProps`),I=y.useState(`isActive`,b.index),L=_.useMemo(()=>({type:`submenu-trigger`,setActive(e){y.select(`highlightItemOnHover`)&&y.setActiveIndex(b.index,Rd,e)}}),[y,b.index]),{getItemProps:R,itemRef:z}=GK({closeOnClick:!1,disabled:P,highlighted:I,id:x,store:g,typingRef:y.context.typingRef,nativeButton:s,itemMetadata:L,nodeId:m?.context.nodeId}),B=Fp(T,{enabled:g.useState(`hoverEnabled`)&&c&&!P,handleClose:Zp({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:l,delay:{open:l,close:u},shouldOpen:l>0?()=>y.select(`allowMouseEnter`):void 0,triggerElementRef:A,externalTree:E,isClosing:()=>g.select(`transitionStatus`)===`ending`,guardStaleOpen:!0}),V=Gf(T,{enabled:!P,event:`mousedown`,toggle:!0,ignoreMouse:c,stickIfOpen:c}).reference??eo,ee=g.useState(`triggerProps`,!0);delete ee.id;let te={disabled:P,highlighted:I,open:S},ne=g.useState(`openMethod`),re=g.useState(`lastOpenChangeReason`)===`list-navigation`||ne===`keyboard`,H=S&&re&&Ms;return uu(`div`,e,{state:te,stateAttributesMapping:ic,props:[V,B,ee,h?.onTriggerKeyDown?{onKeyDown:h.onTriggerKeyDown}:void 0,F,H?oJ:void 0,{"aria-controls":D,tabIndex:v||!(S||I)?-1:0,onFocus(e){g.select(`open`)&&C.current&&(C.current=!1,g.setOpen(!1,bd(Pd,e.nativeEvent)))},onBlur(){I&&y.setActiveIndex(null,Sd)}},f,R],ref:[t,b.ref,z,k,j]})}),cJ=_.forwardRef(function(e,t){let n=VK(e,t,`submenu-trigger`);if(!n.visible)return null;let r=n.props?Zl(n.props,e):e;return(0,Z.jsx)(sJ,{...r,ref:n.ref})});function lJ(e){return Array.isArray(e)?e.map(e=>lJ(e)).join(`,`):e==null?``:String(e)}function uJ(e){let[t,n]=_.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=_.useRef(null),i=_.useRef(null),a=_.useRef(null),o=_.useRef(null),s=_.useRef(!0),c=_.useRef(null),l=id(),u=_.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:a,backdropRef:r,internalBackdropRef:i,positionerRef:o,allowMouseUpTriggerRef:s,initialCursorPointRef:c,rootId:l}),[t,l]);return(0,Z.jsx)(AK.Provider,{value:u,children:(0,Z.jsx)(PK.Provider,{value:void 0,children:(0,Z.jsx)(Gq,{...e})})})}var dJ=500,fJ=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{setAnchor:o,actionsRef:s,internalBackdropRef:c,backdropRef:l,positionerRef:u,allowMouseUpTriggerRef:d,initialCursorPointRef:f,rootId:p}=jK(!1),{store:m}=FK(!1),h=m.useState(`open`),g=m.useState(`disabled`),v=_.useRef(null),y=_.useRef(null),b=ps(),x=ps(),S=_.useRef(!1),C=_.useRef(null);function w(e,t,n){let r=n.type.startsWith(`touch`);f.current={x:e,y:t},o({getBoundingClientRect(){return DOMRect.fromRect({width:r?10:0,height:r?10:0,x:e,y:t})}}),S.current=!1,s.current?.setOpen(!0,bd(Cd,n)),x.start(dJ,()=>{S.current=!0})}function T(e){if(g)return;d.current=!0,yc(e),w(e.clientX,e.clientY,e.nativeEvent);let t=is(v.current);C.current?.abort();let n=new AbortController;C.current=n,t.addEventListener(`mouseup`,e=>{if(d.current=!1,!S.current)return;x.clear(),S.current=!1;let t=Is(e);X(u.current,t)||p&&t&&$q(t)===p||s.current?.setOpen(!1,bd(Hd,e))},{once:!0,signal:n.signal})}function E(){b.clear(),y.current=null}function D(e){if(g||(d.current=!1,e.touches.length!==1)){E();return}e.stopPropagation();let t=e.touches[0],n={x:t.clientX,y:t.clientY};y.current=n,b.start(dJ,()=>{w(n.x,n.y,e.nativeEvent)})}function O(e){if(e.touches.length!==1)E();else if(b.isStarted()&&y.current){let t=e.touches[0],n=Math.abs(t.clientX-y.current.x),r=Math.abs(t.clientY-y.current.y);(n>10||r>10)&&E()}}return _.useEffect(()=>()=>{C.current?.abort()},[]),_.useEffect(()=>{function e(e){if(g)return;let t=Is(e);(X(v.current,t)||X(c.current,t)||X(l.current,t))&&e.preventDefault()}return as(is(v.current),`contextmenu`,e)},[l,g,c]),uu(`div`,e,{state:{open:h},ref:[v,t],props:[{onContextMenu:T,onTouchStart:D,onTouchMove:O,onTouchEnd:E,onTouchCancel:E,style:{WebkitTouchCallout:`none`}},a],stateAttributesMapping:ac})}),pJ=wq;function mJ({...e}){return(0,Z.jsx)(uJ,{"data-slot":`context-menu`,...e})}function hJ({className:e,...t}){return(0,Z.jsx)(fJ,{"data-slot":`context-menu-trigger`,className:Q(`select-none`,e),...t})}function gJ({className:e,align:t=`start`,alignOffset:n=4,side:r=`right`,sideOffset:i=0,...a}){return(0,Z.jsx)(gq,{children:(0,Z.jsx)(pJ,{className:`isolate z-50 outline-none`,align:t,alignOffset:n,side:r,sideOffset:i,children:(0,Z.jsx)(pq,{"data-slot":`context-menu-content`,className:Q(`z-50 max-h-(--available-height) w-50 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-[10px] bg-popover p-1 text-xs text-popover-foreground shadow-[0_12px_40px_rgba(0,0,0,.3)] ring-1 ring-border duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...a})})})}function _J({...e}){return(0,Z.jsx)(tq,{"data-slot":`context-menu-group`,...e})}function vJ({className:e,inset:t,...n}){return(0,Z.jsx)(nq,{"data-slot":`context-menu-label`,"data-inset":t,className:Q(`px-2 pt-1.5 pb-1 text-[11px] font-semibold text-muted-foreground data-inset:pl-7`,e),...n})}function yJ({className:e,inset:t,variant:n=`default`,...r}){return(0,Z.jsx)(iq,{"data-slot":`context-menu-item`,"data-inset":t,"data-variant":n,className:Q(`group/context-menu-item relative flex h-7 cursor-default items-center gap-1.5 rounded-md px-2 py-0 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function bJ({...e}){return(0,Z.jsx)(qq,{"data-slot":`context-menu-sub`,...e})}function xJ({className:e,inset:t,children:n,...r}){return(0,Z.jsxs)(cJ,{"data-slot":`context-menu-sub-trigger`,"data-inset":t,className:Q(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,Z.jsx)(zt,{className:`ml-auto`})]})}function SJ({...e}){return(0,Z.jsx)(gJ,{"data-slot":`context-menu-sub-content`,className:`shadow-lg`,side:`right`,...e})}function CJ({className:e,...t}){return(0,Z.jsx)(iJ,{"data-slot":`context-menu-separator`,className:Q(`my-1 h-px bg-border`,e),...t})}function wJ({className:e,...t}){return(0,Z.jsx)(`kbd`,{"data-slot":`context-menu-shortcut`,className:Q(`ml-auto grid h-5 min-w-5 place-items-center rounded-[5px] bg-muted px-[5px] font-sans text-[11px] font-normal text-muted-foreground`,e),...t})}function TJ({action:e,children:t,binding:n,chips:r,keyName:i,variant:a}){let o=pe(n===void 0?e?.keys:[n],fe()),s=r??(o?ie(o):[]);return(0,Z.jsxs)(yJ,{variant:a,disabled:!e||!be(e),"aria-keyshortcuts":i,onClick:()=>e?.run(),children:[t??e?.label,s.length>0?(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`ml-auto flex gap-[3px]`,children:s.map((e,t)=>(0,Z.jsx)(`kbd`,{className:`grid h-5 min-w-5 place-items-center rounded-[5px] bg-muted px-[5px] font-sans text-[11px] font-normal text-muted-foreground`,children:e},t))}):null]})}function EJ({action:e}){return(0,Z.jsx)(TJ,{action:e,chips:[`⌫`],keyName:`Delete`,variant:`destructive`,children:`Delete`})}function DJ({children:e}){return(0,Z.jsx)(vJ,{children:e})}function OJ(e,t,n,r){let i=r?e.find(e=>e.ref===r.frame&&!e.hidden):void 0;if(r&&i&&kJ(r.box,t))return{kind:`element`,frame:i,at:t};let a=QW(e,t,n);return a?{kind:`frame`,frame:a,at:t}:{kind:`canvas`,at:t}}function kJ(e,{x:t,y:n}){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}var AJ={frame:`w-55`,element:`w-[230px]`,canvas:`w-[210px]`};function jJ({page:e,frames:t,viewport:n,layer:r,trigger:i}){let[a,o]=(0,_.useState)(null),s=e=>{let i=n.current,a=r.current;if(!i||!a)return null;let o=XR(i),[s,c]=o.invert(vI(e,i)),{element:l}=sP.getState(),u=l?YW(a):null;return OJ(t(),{x:s,y:c},o.k,l&&u?{frame:l.frame,box:u}:null)};return(0,Z.jsxs)(mJ,{onOpenChangeComplete:e=>{e||DK.setState({at:null,frame:null})},children:[(0,Z.jsx)(hJ,{render:i,onContextMenu:t=>{let n=t.nativeEvent.defaultPrevented?null:s(t.nativeEvent);if(!n)t.preventBaseUIHandler();else{if(n.kind===`frame`){let{frames:t,element:r}=sP.getState();(r||!t.includes(n.frame.ref))&&KN(sP,e,[n.frame.ref])}DK.setState({at:n.at,frame:n.kind===`canvas`?null:n.frame.ref}),o(n)}}}),(0,Z.jsxs)(gJ,{className:a?AJ[a.kind]:void 0,children:[a?.kind===`frame`?(0,Z.jsx)(NJ,{}):null,a?.kind===`element`?(0,Z.jsx)(FJ,{noteable:!0}):null,a?.kind===`canvas`?(0,Z.jsx)(LJ,{}):null]})]})}var MJ=[`frame.copy`,`frame.cut`,`frame.copyPng`,`frame.duplicate`,`section.wrap`,`frame.rename`,`frame.fitHeight`,`frame.compare`,`note.addOnFrame`,`tool.note`,`frame.hide`,`frame.lock`,`frame.flipTheme`,`frame.delete`];function NJ(){let[e,t,n,r,i,a,o,s,c,l,u,d,f,p]=xe(MJ),m=cP(e=>e.frames.length);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(_J,{children:[(0,Z.jsx)(DJ,{children:m>1?`${m} frames`:`Frame`}),(0,Z.jsx)(TJ,{action:e,children:`Copy`}),(0,Z.jsx)(TJ,{action:t,children:`Cut`}),(0,Z.jsx)(TJ,{action:n,children:`Copy as PNG`}),(0,Z.jsx)(TJ,{action:r,children:`Duplicate`}),(0,Z.jsx)(TJ,{action:i,children:`Wrap in section`}),(0,Z.jsx)(TJ,{action:a,children:`Rename`}),(0,Z.jsx)(TJ,{action:o,children:`Fit height`}),(0,Z.jsx)(TJ,{action:s,children:`Compare with before`}),(0,Z.jsx)(TJ,{action:c,binding:l?.keys?.[0],children:`Add a note`})]}),(0,Z.jsx)(CJ,{}),(0,Z.jsxs)(_J,{children:[(0,Z.jsx)(TJ,{action:u,children:`Hide`}),(0,Z.jsx)(TJ,{action:d,children:d?.checked?.()?`Unlock`:`Lock`}),(0,Z.jsx)(TJ,{action:f})]}),(0,Z.jsx)(CJ,{}),(0,Z.jsx)(EJ,{action:p})]})}var PJ=[`note.addHere`,`tool.note`,`element.up`,`view.zoomToSelection`,`element.toFront`,`element.forward`,`element.moveDown`,`element.backward`,`element.moveUp`,`element.toBack`,`frame.copyPng`,`element.delete`];function FJ({noteable:e}){let[t,n,r,i,a,o,s,c,l,u,d,f]=xe(PJ),p=cP(e=>e.element??null),m=p?eB(p.frame):null,h=p&&m?oB(m.elements,p.index)===null:!0;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(_J,{children:[(0,Z.jsx)(DJ,{children:`Element`}),e?(0,Z.jsx)(TJ,{action:t,binding:n?.keys?.[0],children:`Add a note here`}):null,(0,Z.jsx)(TJ,{action:r,children:h?`Select frame`:`Select parent`}),(0,Z.jsx)(TJ,{action:i,children:`Zoom to selection`}),(0,Z.jsx)(CJ,{}),(0,Z.jsx)(TJ,{action:a,children:`Bring to front`}),(0,Z.jsx)(TJ,{action:o,binding:s?.keys?.[0],children:`Bring forward`}),(0,Z.jsx)(TJ,{action:c,binding:l?.keys?.[0],children:`Send backward`}),(0,Z.jsx)(TJ,{action:u,children:`Send to back`}),(0,Z.jsx)(CJ,{}),(0,Z.jsx)(TJ,{action:d,children:`Copy frame as PNG`})]}),(0,Z.jsx)(CJ,{}),(0,Z.jsx)(EJ,{action:f})]})}var IJ=[`frame.pasteAt`,`frame.paste`,`frame.newAt`,`tool.frame`,`selection.all`,`view.zoomToFit`,`view.hideUi`];function LJ(){let[e,t,n,r,i,a,o]=xe(IJ);return(0,Z.jsxs)(_J,{children:[(0,Z.jsx)(DJ,{children:`Empty canvas`}),(0,Z.jsx)(TJ,{action:e,binding:t?.keys?.[0],children:`Paste here`}),(0,Z.jsx)(TJ,{action:n,binding:r?.keys?.[0],children:`New frame here`}),(0,Z.jsx)(CJ,{}),(0,Z.jsx)(TJ,{action:i,children:`Select all`}),(0,Z.jsx)(TJ,{action:a,children:`Zoom to fit`}),(0,Z.jsx)(TJ,{action:o,children:`Hide UI`})]})}var RJ=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]),zJ=`Only PNG, JPEG, GIF, and WebP images go in a note.`;function BJ(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(null),i=(0,_.useRef)(e);return(0,_.useEffect)(()=>{i.current=e},[e]),(0,_.useEffect)(()=>()=>{for(let e of i.current)URL.revokeObjectURL(e.url)},[]),{images:e,refusal:n,add:e=>{let n=e.filter(e=>RJ.has(e.type));r(n.length<e.length?zJ:null),n.length!==0&&t(e=>[...e,...n.map(e=>({id:crypto.randomUUID(),file:e,url:URL.createObjectURL(e)}))])},remove:n=>{let i=e.find(e=>e.id===n);i&&URL.revokeObjectURL(i.url),r(null),t(e=>e.filter(e=>e.id!==n))},upload:async t=>{if(e.length===0)return[];let n=new FormData;n.append(`page`,t);for(let t of e)n.append(`files`,t.file);return(await Qx(`/api/notes/images`,n)).images},clear:()=>{for(let t of e)URL.revokeObjectURL(t.url);r(null),t([])}}}function VJ(e){return[...e?.files??[]].filter(e=>e.type.startsWith(`image/`))}function HJ(e){return[...e?.types??[]].includes(`Files`)}var UJ=`frameboard:new-session`;function WJ(e,t,n=!1){return t&&e.some(e=>e.session===t)?t:e.length===1?e[0]?.session??``:e.length===0&&n?UJ:``}function GJ(e,t,n,r,i=r){return e===`frameboard:new-session`&&r||t.some(t=>t.session===e)?e:WJ(t,n,r&&i)}function KJ(e){return e===``?{}:e===`frameboard:new-session`?{dispatch:!0}:{to:e}}function qJ(e){if(e instanceof Zx){if(e.code===`stale-address`)return`The frame changed since it was clicked. Click the element again.`;if(e.code===`unauthorized`)return`This tab cannot write. Run frameboard open for a tab that can.`;if(e.code===`notes-invalid`)return`This page's notes.json does not read. Fix it by hand and try again.`;if(e.code===`dispatch-unavailable`)return`Restart serve with FRAMEBOARD_DISPATCH set to start a session.`;if(e.code===`image-type-refused`)return`Only PNG, JPEG, GIF, and WebP images go in a note.`;if(e.code===`asset-too-large`)return`The images are too large to send. Remove one and try again.`;if(e.code===`dispatch-failed`)return`The session did not start. Check .run/dispatch.log and try again.`}return`The note did not save. Try again.`}var JJ=`.notes/`,YJ=`block size-12 overflow-hidden rounded-md border border-border bg-muted object-cover`;function XJ({images:e,onRemove:t}){return e.length===0?null:(0,Z.jsx)(`ul`,{"aria-label":`Images`,className:`mb-1.5 flex flex-wrap gap-1.5`,children:e.map((e,n)=>(0,Z.jsxs)(`li`,{className:`relative`,children:[(0,Z.jsx)(`img`,{src:e.url,alt:`Image ${n+1}: ${e.file.name}`,className:YJ}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Remove image ${n+1}`,onClick:()=>t(e.id),className:`absolute -top-1.5 -right-1.5 grid size-6 place-items-center rounded-full outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,Z.jsx)(`span`,{className:`grid size-4 place-items-center rounded-full bg-foreground text-card hover:bg-foreground/80`,children:(0,Z.jsx)(ia,{"aria-hidden":!0,className:`size-3`})})})]},e.id))})}function ZJ({page:e,images:t}){let[n,r]=e.split(`/`),i=t.filter(e=>e.startsWith(JJ));return!n||!r||i.length===0?null:(0,Z.jsx)(`ul`,{"aria-label":`Images`,className:`mt-1.5 flex flex-wrap gap-1.5`,children:i.map((e,t)=>{let i=`/api/note-images/${encodeURIComponent(n)}/${encodeURIComponent(r)}/${encodeURIComponent(e.slice(7))}`;return(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`a`,{href:i,target:`_blank`,rel:`noreferrer`,"aria-label":`Open image ${t+1} full size`,className:`block rounded-md outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,Z.jsx)(`img`,{src:i,alt:``,className:YJ})})},e)})})}function QJ({listeners:e}){return(0,Z.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5 font-normal text-muted-foreground`,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full bg-claim`}),e.length===0?`No session listening`:`${e.length} listening`]})}function $J({listeners:e,value:t,onChange:n,disabled:r,dispatch:i=!1,optional:a=!1}){let o=e.length===0&&!i,s=e.length===0&&(o||a);return(0,Z.jsxs)(`label`,{className:`relative flex h-[26px] min-w-0 items-center gap-1.5 rounded-md bg-muted pr-6 pl-2 text-foreground has-[select:disabled]:opacity-60 has-[select:focus-visible]:ring-3 has-[select:focus-visible]:ring-ring/50`,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`size-[7px] shrink-0 rounded-full bg-claim`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Send to`}),(0,Z.jsxs)(`select`,{value:t,disabled:r||o,onChange:e=>n(e.target.value),className:`min-w-0 appearance-none truncate bg-transparent outline-none disabled:cursor-not-allowed`,children:[s?(0,Z.jsx)(`option`,{value:``,children:`No session`}):null,e.length>1?(0,Z.jsx)(`option`,{value:``,disabled:!0,children:`Pick a session`}):null,e.map(e=>(0,Z.jsx)(`option`,{value:e.session,children:e.tag},e.session)),i?(0,Z.jsx)(`option`,{value:UJ,children:`New session`}):null]}),(0,Z.jsx)(Lt,{"aria-hidden":!0,className:`pointer-events-none absolute right-2 size-2.5 text-muted-foreground`})]})}function eY({pick:e,onClose:t}){let n=z_(e=>e.listeners),r=z_(t=>t.claims[e.frame.ref]?.session),i=z_(e=>e.canWrite),a=z_(e=>e.dispatch),o=RN(e.frame.ref),s=BN(e=>e.drafts[o]??``),c=e=>VN(o,e),[l,u]=(0,_.useState)(()=>WJ(n,r,a)),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(!1),h=BJ(),g=GJ(l,n,r,a),v=async n=>{if(s.trim()===``)f(`Write the note first`);else if(n===``)f(`Pick a session to send it to`);else{m(!0);try{let r=e.frame.ref.split(`/`).slice(0,-1).join(`/`),i=await h.upload(r);await Qx(`/api/notes`,{frame:e.frame.ref,text:s.trim(),...i.length===0?{}:{images:i},...e.element===null?{}:{element:e.element,renderedAt:e.renderedAt},...n===null?{}:KJ(n)}),c(``),h.clear(),W_.getState().tool===`note`&&W_.setState({tool:`move`}),t()}catch(e){f(qJ(e))}finally{m(!1)}}};return(0,Z.jsx)(tY,{title:`New note on ${e.frame.name}`,listeners:n,onClose:t,children:(0,Z.jsxs)(`form`,{className:`m-3 rounded-lg border border-border p-2`,onSubmit:e=>{e.preventDefault(),v(g)},onDragOver:e=>{i&&HJ(e.dataTransfer)&&e.preventDefault()},onDrop:e=>{i&&HJ(e.dataTransfer)&&(e.preventDefault(),e.stopPropagation(),h.add([...e.dataTransfer.files]))},children:[(0,Z.jsx)(`textarea`,{"aria-label":`Note on ${e.frame.name}`,autoFocus:!0,value:s,disabled:!i,onChange:e=>{c(e.target.value),f(null)},onPaste:e=>{let t=VJ(e.clipboardData);t.length!==0&&(e.preventDefault(),h.add(t))},onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&e.currentTarget.form?.requestSubmit()},rows:2,className:`block min-h-7 w-full resize-none bg-transparent text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed`}),(0,Z.jsx)(XJ,{images:h.images,onRemove:h.remove}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)($J,{listeners:n,value:g,onChange:e=>{u(e),f(null)},disabled:!i,dispatch:a}),(0,Z.jsx)(nY,{variant:`ghost`,className:`ml-auto`,disabled:!i||p,onClick:()=>void v(null),children:`Save`}),(0,Z.jsx)(nY,{type:`submit`,variant:`primary`,disabled:!i||p||n.length===0&&!a,children:`Send`})]}),d??h.refusal?(0,Z.jsx)(`p`,{role:`alert`,className:`mt-2 text-destructive`,children:d??h.refusal}):null]})})}function tY({title:e,listeners:t,onClose:n,children:r}){return(0,Z.jsxs)(`section`,{"aria-label":e,"data-note-card":!0,onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),n())},onPointerDown:e=>e.stopPropagation(),onWheel:e=>e.stopPropagation(),className:`pointer-events-auto flex w-[300px] flex-col overflow-hidden rounded-xl border border-border bg-card text-body text-card-foreground shadow-[0_12px_40px_rgba(0,0,0,.3)]`,children:[(0,Z.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border px-3 py-2.5 font-semibold`,children:[(0,Z.jsx)(`h2`,{className:`truncate`,children:e}),(0,Z.jsx)(QJ,{listeners:t})]}),r]})}function nY({variant:e,className:t,type:n=`button`,...r}){return(0,Z.jsx)(`button`,{type:n,className:Q(`flex h-[26px] shrink-0 items-center rounded-lg px-3 font-medium outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50`,e===`primary`?`bg-primary text-primary-foreground hover:bg-primary/90`:`bg-muted text-foreground hover:bg-accent`,t),...r})}function rY({title:e,notes:t,onPick:n,onClose:r}){let i=(0,_.useRef)([]),[a,o]=(0,_.useState)(0);(0,_.useEffect)(()=>{i.current[0]?.focus()},[]);let s=e=>{let n=(e+t.length)%t.length;o(n),i.current[n]?.focus()},c={ArrowDown:()=>s(a+1),ArrowUp:()=>s(a-1),Home:()=>s(0),End:()=>s(t.length-1)};return(0,Z.jsxs)(`section`,{"aria-label":e,"data-note-card":!0,onKeyDown:e=>{if(e.key===`Escape`){e.stopPropagation(),r();return}let t=c[e.key];t&&(e.preventDefault(),e.stopPropagation(),t())},onPointerDown:e=>e.stopPropagation(),onWheel:e=>e.stopPropagation(),className:`pointer-events-auto flex min-h-0 w-[240px] flex-col overflow-hidden rounded-xl border border-border bg-card text-body text-card-foreground shadow-[0_12px_40px_rgba(0,0,0,.3)]`,children:[(0,Z.jsx)(`h2`,{className:`px-3 pt-2.5 pb-1 font-normal text-muted-foreground`,children:e}),(0,Z.jsx)(`div`,{role:`menu`,"aria-label":e,className:`flex min-h-0 flex-col overflow-y-auto p-1`,children:t.map((e,t)=>(0,Z.jsxs)(`button`,{ref:e=>{i.current[t]=e},type:`button`,role:`menuitem`,"aria-label":`Note ${e.number}: ${iY(e.text)}`,tabIndex:t===a?0:-1,onFocus:()=>o(t),onClick:()=>n(e.id),className:`flex h-7 shrink-0 items-center gap-2 rounded-md px-1.5 text-left outline-none hover:bg-accent focus-visible:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50`,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`grid size-[18px] shrink-0 place-items-center rounded-[9px_9px_9px_2px] bg-note text-caption font-semibold text-[#1a1a1a]`,children:e.number}),(0,Z.jsx)(`span`,{className:`truncate`,children:iY(e.text)})]},e.id))})]})}function iY(e){return e.split(`
|
|
71
|
+
`,1)[0]??``}function aY(e){return e.split(/\s+/).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()).join(``)}var oY,sY=!1,cY=new Set;function lY(){return(0,_.useSyncExternalStore)(pY,()=>oY?.name)}function uY(){return(0,_.useSyncExternalStore)(pY,()=>oY?.source??null)}async function dY(e){fY(await Qx(`/api/author`,{name:e}))}function fY(e){oY=e;for(let e of cY)e()}function pY(e){return cY.add(e),sY||(sY=!0,fetch(`/api/author`).then(e=>e.json()).then(e=>e.ok?e.data:{name:null,source:null}).catch(()=>({name:null,source:null})).then(e=>{oY===void 0&&fY(e)})),()=>{cY.delete(e)}}function mY({notes:e,page:t,onClose:n}){let r=z_(e=>e.listeners),i=z_(n=>t?n.claims[`${t}/${e[0]?.frame}`]?.session:void 0),a=z_(e=>e.canWrite),o=z_(e=>e.dispatch),s=e[0]?.id??``,c=BN(e=>e.drafts[s]??``),l=e=>VN(s,e),[u,d]=(0,_.useState)(()=>WJ(r,i)),[f,p]=(0,_.useState)(null),[m,h]=(0,_.useState)(!1),g=BJ(),v=(0,_.useRef)(null),y=_Y(v,e.length),b=e[0];if(!b)return null;let x=GJ(u,r,i,o,!1),S=async(e,t)=>{h(!0);try{await e(),t?.()}catch(e){p(qJ(e))}finally{h(!1)}},C=()=>{let e=c.trim();e===``&&g.images.length>0?p(`Write a reply to go with the images`):e===``&&x===``?p(r.length>1?`Pick a session to send it to`:`Write a reply first`):e===``?S(()=>Qx(`/api/notes/${b.id}/send`,KJ(x))):S(async()=>{let n=t?await g.upload(t):[];await Qx(`/api/notes/${b.id}/replies`,{text:e,...n.length===0?{}:{images:n},...KJ(x)})},()=>{l(``),g.clear()})};return(0,Z.jsxs)(tY,{title:`Note ${b.number??``}`.trim(),listeners:r,onClose:n,children:[(0,Z.jsx)(`ol`,{ref:v,"aria-label":`Messages`,tabIndex:0,onScroll:y,onKeyDown:e=>{gY.has(e.key)&&e.stopPropagation()},className:`min-h-0 overflow-y-auto outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset`,children:e.map(e=>(0,Z.jsx)(hY,{note:e,page:t},e.id))}),(0,Z.jsxs)(`form`,{className:`mx-3 mt-1.5 mb-3 rounded-lg border border-border p-2`,onSubmit:e=>{e.preventDefault(),C()},onDragOver:e=>{a&&t&&HJ(e.dataTransfer)&&e.preventDefault()},onDrop:e=>{a&&t&&HJ(e.dataTransfer)&&(e.preventDefault(),e.stopPropagation(),g.add([...e.dataTransfer.files]))},children:[(0,Z.jsx)(`textarea`,{"aria-label":`Reply`,placeholder:`Reply, or hand it on…`,value:c,disabled:!a,onChange:e=>{l(e.target.value),p(null)},onPaste:e=>{let n=VJ(e.clipboardData);t&&n.length!==0&&(e.preventDefault(),g.add(n))},onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&e.currentTarget.form?.requestSubmit()},rows:1,className:`block min-h-7 w-full resize-none bg-transparent text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed`}),(0,Z.jsx)(XJ,{images:g.images,onRemove:g.remove}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)($J,{listeners:r,value:x,onChange:e=>{d(e),p(null)},disabled:!a,dispatch:o,optional:!0}),(0,Z.jsx)(nY,{variant:`ghost`,className:`ml-auto`,disabled:!a||m,onClick:()=>void S(()=>Qx(`/api/notes/${b.id}/done`,{}),n),children:`Done`}),(0,Z.jsx)(nY,{type:`submit`,variant:`primary`,disabled:!a||m,children:`Send`})]}),f??g.refusal?(0,Z.jsx)(`p`,{role:`alert`,className:`mt-2 text-destructive`,children:f??g.refusal}):null]})]})}function hY({note:e,page:t}){let n=lY(),r=e.from===`agent`;return(0,Z.jsxs)(`li`,{className:`flex gap-2.5 px-3 py-2.5`,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:Q(`grid size-[22px] flex-none place-items-center rounded-full text-[10px] font-bold`,r?`bg-claim/25 text-claim`:`bg-foreground text-card`),children:r?`C`:aY(e.author??n??``)||`Y`}),(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsx)(`b`,{className:`font-semibold`,children:r?`claude`:`You`}),(0,Z.jsx)(`time`,{dateTime:e.createdAt,className:`ml-1.5 text-muted-foreground`,children:vY(e.createdAt)}),(0,Z.jsx)(`p`,{className:`mt-0.5 leading-[1.45] break-words whitespace-pre-wrap`,children:e.text}),t&&e.images?(0,Z.jsx)(ZJ,{page:t,images:e.images}):null]})]})}var gY=new Set([`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `]);function _Y(e,t){let n=(0,_.useRef)(!0);return(0,_.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let r=new ResizeObserver(()=>{n.current&&t.scrollTo({top:t.scrollHeight})});return r.observe(t),()=>r.disconnect()},[e]),(0,_.useLayoutEffect)(()=>{let t=e.current;n.current&&t?.scrollTo({top:t.scrollHeight})},[e,t]),()=>{let t=e.current;t&&(n.current=t.scrollHeight-t.scrollTop-t.clientHeight<1)}}function vY(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:`${t.getHours()%12||12}:${String(t.getMinutes()).padStart(2,`0`)}`}function yY({page:e,frames:t,container:n}){let r=z_(t=>t.notes[e]),i=G_(e=>e.mode===`play`),a=BN(e=>e.open),[o,s]=(0,_.useState)(null);PY(n),NY(a!==null);let c=rN(t),l=new Map(c.map(e=>[e.name,e])),u=e=>{let t=l.get(e.frame);return t?WW(t,e.element,n):null},d=xY(i?[]:bY((r??[]).filter(e=>e.thread===null&&e.state!==`done`),u)),f=d.find(e=>e.key===o&&e.notes.length>1),p=CY(f,d);if(i)return null;let m=Math.max(0,...(r??[]).map(e=>e.number??0))+1,h=t=>{s(null),zN.setState({open:{kind:`thread`,page:e,id:t}})},g=a?.kind===`thread`&&a.page===e?(r??[]).filter(e=>e.id===a.id||e.thread===a.id):null,v=g?.[0],y=v?d.find(e=>e.notes.some(e=>e.id===v.id))?.at??u(v):null;o!==null&&!f&&s(null);let b=e=>{s(null),document.querySelector(`[data-note-spot="${CSS.escape(e)}"]`)?.focus()};return(0,Z.jsxs)(Z.Fragment,{children:[d.map(e=>{let[t]=e.notes;if(!t||t.number===null)return null;let n=l.get(t.frame)?.ref;if(e.notes.length===1)return(0,Z.jsx)(OY,{content:t.number,at:e.at,frame:n,element:t.element,pin:e.key,active:a?.kind===`thread`&&a.id===t.id,label:`Note ${t.number} on ${t.frame}`,onOpen:()=>h(t.id)},t.id);let r=e.notes.some(e=>a?.kind===`thread`&&a.id===e.id);return(0,Z.jsx)(OY,{content:e.notes.length,at:e.at,frame:n,element:t.element,pin:e.key,spot:e.key,active:r||o===e.key,expanded:o===e.key,label:`${e.notes.length} notes on ${t.frame}`,onOpen:()=>{HN(),s(t=>t===e.key?null:e.key)}},e.key)}),a?.kind===`new`&&t.some(e=>e.ref===a.pick.frame.ref)?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(OY,{content:m,at:a.pick.at,active:!0}),(0,Z.jsx)(MY,{at:a.pick.at,onDismiss:HN,children:(0,Z.jsx)(eY,{pick:a.pick,onClose:HN},a.pick.frame.ref)})]}):null,f?(0,Z.jsx)(MY,{at:f.at,onDismiss:()=>s(null),children:(0,Z.jsx)(`div`,{className:`contents`,onFocus:p.onFocus,onBlur:p.onBlur,children:(0,Z.jsx)(rY,{title:`${f.notes.length} notes on ${f.notes[0]?.frame}`,notes:f.notes,onPick:e=>{b(f.key),h(e)},onClose:()=>b(f.key)})})}):null,g&&y?(0,Z.jsx)(MY,{at:y,onDismiss:HN,children:(0,Z.jsx)(mY,{notes:g,page:e,onClose:HN})}):null]})}function bY(e,t){let n=[];for(let r of e){let e=t(r);e&&r.number!==null&&n.push({note:r,at:e})}return n}function xY(e){let t=()=>SY(e,ev.zoom()),n=(0,_.useSyncExternalStore)(ev.onZoom,t,t),r=new Map(e.map(e=>[e.note.id,e]));return n===``?[]:n.split(`|`).map(e=>{let[t=``,n=``]=e.split(`:`);return{key:t,at:r.get(t)?.at??{x:0,y:0},notes:n.split(`,`).flatMap(e=>r.get(e)?.note??[])}})}function SY(e,t){return wY(e,t).map(e=>`${e.key}:${e.notes.map(e=>e.id).join(`,`)}`).join(`|`)}function CY(e,t){let n=(0,_.useRef)(!1),r=(0,_.useRef)(null);return(0,_.useLayoutEffect)(()=>{let i=r.current;if(r.current=e?.notes[0]?.id??null,e||i===null||!n.current)return;n.current=!1;let a=t.find(e=>e.notes.some(e=>e.id===i));a&&document.querySelector(`[data-note-pin="${CSS.escape(a.key)}"]`)?.focus()}),{onFocus:()=>{n.current=!0},onBlur:e=>{let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||(n.current=!1)}}}function wY(e,t){let n=TY/t,r=[];for(let{note:t,at:i}of e){let e=r.find(e=>Math.abs(e.at.x-i.x)<n&&Math.abs(e.at.y-i.y)<n);e?e.notes.push(t):r.push({key:t.id,at:i,notes:[t]})}for(let e of r)e.notes.sort((e,t)=>(e.number??0)-(t.number??0));return r}var TY=24,EY=7,DY={x:EY+TY/2,y:-(EY+TY/2)};function OY({content:e,at:t,frame:n,element:r,pin:i,spot:a,active:o,expanded:s=o,label:c,onOpen:l}){let u=Q(`pointer-events-auto absolute grid size-[24px] origin-top-left place-items-center rounded-[12px_12px_12px_2px] bg-note text-label font-semibold text-[#1a1a1a] shadow-[0_2px_6px_rgba(0,0,0,.25)] outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,o&&`shadow-[0_0_0_3px_color-mix(in_srgb,var(--note)_35%,transparent),0_2px_6px_rgba(0,0,0,.25)]`),d={left:t.x,top:t.y,transform:`scale(calc(1 / var(--zoom, 1))) translate(${EY}px, ${-(EY+TY)}px)`};return l?(0,Z.jsx)(`button`,{type:`button`,"data-note-marker":!0,"data-note-frame":n,"data-note-element":r??void 0,"data-note-pin":i,"data-note-spot":a,"aria-label":c,"aria-haspopup":a===void 0?void 0:`menu`,"aria-expanded":s,onPointerDown:e=>e.stopPropagation(),onClick:l,className:u,style:d,children:e}):(0,Z.jsx)(`span`,{"aria-hidden":!0,className:u,style:d,children:e})}var kY={x:21,y:-25},AY={left:DY.x+kY.x,right:kY.x-DY.x,top:DY.y+kY.y},jY=12;function MY({at:e,onDismiss:t,children:n}){let r=(0,_.useRef)(null),[i,a]=(0,_.useState)({flip:!1,y:0,cap:null});(0,_.useEffect)(()=>{let e=e=>{let n=e.target;n instanceof Node&&r.current?.contains(n)||n instanceof Element&&n.closest(`[data-note-marker]`)||t()};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[t]);let[o,s]=(0,_.useState)(0);return(0,_.useEffect)(()=>{let e=()=>s(e=>e+1),t=ev.onZoom(e),n=ev.onHandMove(e);return()=>{t(),n()}},[]),(0,_.useLayoutEffect)(()=>{let e=r.current,t=e?.closest(`[data-canvas]`);if(!e||!t)return;let n=t.getBoundingClientRect(),o=document.querySelector(`[role="toolbar"][aria-label="Tools"]`),s=Math.min(n.bottom,o?.getBoundingClientRect().top??n.bottom),c=document.querySelector(`[data-view-only-notice]`),l=Math.max(n.top,c?.getBoundingClientRect().bottom??n.top),u=e.getBoundingClientRect(),d=i.flip?u.right+u.width+2*kY.x:u.right,f=u.top-i.y,p={flip:d>n.right-jY,y:f<l+jY?l+jY-f:Math.min(0,s-jY-(f+u.height)),cap:s-l-24};(p.flip!==i.flip||Math.abs(p.y-i.y)>.5||p.cap!==i.cap)&&a(p)},[e.x,e.y,i,o]),(0,Z.jsx)(`div`,{className:`absolute origin-top-left [transform:scale(calc(1/var(--zoom,1)))]`,style:{left:e.x,top:e.y},children:(0,Z.jsx)(`div`,{ref:r,className:`absolute flex flex-col`,onBlur:e=>{let n=e.relatedTarget;n instanceof Node&&!e.currentTarget.contains(n)&&t()},style:{top:AY.top+i.y,maxHeight:i.cap??void 0,...i.flip?{right:AY.right}:{left:AY.left}},children:n})})}function NY(e){(0,_.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&HN()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}function PY(e){let[,t]=(0,_.useState)(0);(0,_.useEffect)(()=>{if(!e)return;let n=()=>t(e=>e+1);return e.addEventListener(`load`,n,!0),()=>e.removeEventListener(`load`,n,!0)},[e])}var FY=N()(()=>({at:null}));function IY(e,{enabled:t,container:n,page:r,frames:i,toBoard:a,place:o=dV}){(0,_.useEffect)(()=>{let s=e.current;if(!t||!s||!n)return;let c=e=>{e.dataTransfer?.types.includes(`Files`)&&e.preventDefault()};s.addEventListener(`dragover`,c),s.addEventListener(`drop`,c);let l=e=>FY.setState({at:e&&a(e)}),u=xj({element:s,canDrop:({source:e})=>R_.getState().canWrite&&Lj(e.data)!==null,onDragEnter:({location:e})=>l(e.current.input),onDrag:({location:e})=>l(e.current.input),onDragLeave:()=>l(null),onDrop:({source:e,location:t})=>{l(null);let s=Lj(e.data);s&&o(n,r,i(),a(t.current.input),s)}});return()=>{u(),s.removeEventListener(`dragover`,c),s.removeEventListener(`drop`,c),l(null)}},[e,t,n,r,i,a,o])}function LY({viewport:e,container:t,frames:n,toBoard:r}){let i=G_(e=>e.mode===`edit`&&iV(e.tool)),a=F(ZB,e=>e.carried),o=F(FY,e=>e.at),s=i||a!==null,[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(null);(0,_.useEffect)(()=>{if(t)return FY.subscribe(({at:e})=>{let r=e&&BB(t,n(),e),i=r?RY(r):null;d(e=>BY(e,i)?e:i)})},[t,n]),(0,_.useEffect)(()=>{let i=e.current;if(!s||!i||!t)return;let o=e=>{if(!a&&e.buttons&1&&zY())return;let i=r(e),o=a?VB(t,n(),i,a):BB(t,n(),i),s=o&&RY(o);l(e=>BY(e,s)?e:s)},c=()=>l(null);return i.addEventListener(`pointermove`,o),i.addEventListener(`pointerleave`,c),()=>{i.removeEventListener(`pointermove`,o),i.removeEventListener(`pointerleave`,c),l(null)}},[s,a,e,t,n,r]);let f=o?u:s?c:null;if(!f)return null;let p=f.height===0;return(0,Z.jsx)(`div`,{"data-drop-line":!0,"aria-hidden":!0,className:`pointer-events-none absolute rounded-full bg-primary`,style:{left:f.x,top:f.y,width:p?f.width:_z(2),height:p?_z(2):f.height,translate:p?`0 -50%`:`-50% 0`,zIndex:Nz}})}function RY({frame:e,gap:t}){return{...t.line,x:e.box.x+t.line.x,y:e.box.y+t.line.y}}function zY(){let e=rV();return e===`rectangle`||e===`ellipse`||e===`asset`}function BY(e,t){return e===t||e!==null&&t!==null&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function VY({viewport:e,toBoard:t}){let n=F(GB,e=>e.shape),r=G_(e=>e.mode===`edit`&&(e.tool===`frame`||e.tool===`section`||e.tool===`image`||e.tool===`shape`&&n!==`divider`)),[i,a]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let n=e.current;if(!r||!n)return;let i=null,o=null,s=e=>{$B(null),o=null,i=e.button===0&&!W_.getState().spacePan?{from:t(e),x:e.clientX,y:e.clientY}:null},c=e=>{if(!i)return;let n=Math.hypot(e.clientX-i.x,e.clientY-i.y);!o&&n<=3||(o=HY(i.from,t(e)),a(o))},l=()=>{i&&o&&$B({from:i.from,at:{x:Math.round(o.x),y:Math.round(o.y)},size:{width:Math.max(1,Math.round(o.width)),height:Math.max(1,Math.round(o.height))}}),i=null,o=null,a(null)};return n.addEventListener(`pointerdown`,s),addEventListener(`pointermove`,c),addEventListener(`pointerup`,l),()=>{n.removeEventListener(`pointerdown`,s),removeEventListener(`pointermove`,c),removeEventListener(`pointerup`,l),$B(null),a(null)}},[r,e,t]),!r||!i?null:(0,Z.jsx)(`div`,{"data-shape-draft":!0,"aria-hidden":!0,className:`pointer-events-none absolute bg-primary/10`,style:{left:i.x,top:i.y,width:i.width,height:i.height,border:`${_z(1)} solid var(--primary)`,zIndex:Nz}})}function HY(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),width:Math.abs(e.x-t.x),height:Math.abs(e.y-t.y)}}var UY=[`nw`,`ne`,`sw`,`se`],WY={nw:`top-0 left-0`,ne:`top-0 right-0`,sw:`bottom-0 left-0`,se:`right-0 bottom-0`};function GY({page:e,sections:t}){let n=cP(t=>t.page===e?t.section:void 0);return t.map(e=>(0,Z.jsx)(KY,{section:e,selected:e.name===n},e.name))}function KY({section:e,selected:t}){let{x:n,y:r,width:i,height:a}=e.box;return(0,Z.jsxs)(`div`,{"data-section":e.name,"data-selected":t||void 0,className:Q(`pointer-events-none absolute rounded-[calc(10px/var(--zoom,1))] bg-foreground/5`,t&&`outline-solid outline-primary [outline-width:calc(1.5px/var(--zoom,1))]`),style:{left:n,top:r,width:i,height:a},children:[(0,Z.jsx)(`div`,{"data-section-label":e.name,className:Q(`absolute top-0 left-0 origin-top-left truncate px-3 pt-2 text-body font-medium [transform:scale(calc(1/var(--zoom,1)))]`,t?`text-foreground`:`text-muted-foreground`),style:{maxWidth:`calc(${i}px * var(--zoom, 1))`},title:e.name,children:e.name}),t?UY.map(e=>(0,Z.jsx)(`div`,{"data-section-corner":e,className:Q(`absolute size-[7px] border-[1.5px] border-primary bg-background [transform:translate(var(--hx),var(--hy))_scale(calc(1/var(--zoom,1)))]`,WY[e],e.startsWith(`n`)?`[--hy:-50%]`:`[--hy:50%]`,e.endsWith(`w`)?`[--hx:-50%]`:`[--hx:50%]`)},e)):null]})}var qY=1.2;function JY(e,t){return e===0?!1:t===WheelEvent.DOM_DELTA_LINE||Math.abs(e)>=50}function YY(e,t){return t===WheelEvent.DOM_DELTA_LINE?e*16:e}function XY(e,t){return e===0?1:JY(e,t)?e<0?qY:1/qY:2**(-e*.01)}function ZY(e){return 1-(1-e)**3}var QY=[.02,4],$Y=64,eX=150,tX=400,nX=new Map,rX=new Set;function iX({page:e,reloads:t,findings:n,claims:r,focus:i,onFocused:a,calls:o=$O}){let s=(0,_.useRef)(null),c=(0,_.useRef)(null),l=(0,_.useRef)(null),u=(0,_.useRef)(null),[d,f]=(0,_.useState)(null),p=(0,_.useRef)(null),m=(0,_.useRef)(null),h=z_(e=>e.aliases),g=__(h,e.ref),v=(0,_.useRef)(0),y=(0,_.useRef)(null),b=(0,_.useRef)(null);(0,_.useEffect)(()=>()=>{b.current?.(),b.current=null},[e.ref]);let x=G_(e=>e.mode===`play`),S=G_(e=>e.tool===`hand`),C=G_(e=>e.tool===`note`),w=G_(e=>e.tool===`frame`),T=G_(e=>e.tool===`section`),E=G_(e=>iV(e.tool)),D=G_(e=>e.spacePan);(0,_.useEffect)(()=>see(window),[]),WN(),sV();let O=Ov(e=>e.unseen),[k,A]=(0,_.useState)(null),j=(0,_.useMemo)(()=>e.frames.filter(e=>!e.hidden),[e.frames]),M=(0,_.useRef)(j),N=(0,_.useRef)(e.sections),P=(0,_.useRef)(e.frames);(0,_.useLayoutEffect)(()=>{M.current=j,N.current=e.sections,P.current=e.frames},[j,e.sections,e.frames]);let F=(0,_.useMemo)(()=>CK(j),[j]),I=(0,_.useRef)(F);(0,_.useLayoutEffect)(()=>{I.current=F;let e=s.current,t=c.current;e&&t&&wK(t,F,XR(e).k)},[F]),wV(e.ref),BW(e.ref,j),kK(e.ref,e.frames,e=>c.current?.querySelector(`[data-frame="${CSS.escape(e)}"] iframe`)?.dataset.renderedAt??null),(0,_.useLayoutEffect)(()=>{let e=s.current,t=c.current;if(!e||!t)return;let n=gI(e),r,i=!1,a=t=>A({view:t,size:lX(e)}),o=az().scaleExtent(QY).filter(e=>{if(e.type===`wheel`||e.type.startsWith(`touch`))return!0;let{button:t,ctrlKey:n}=e;if(n)return!1;let{mode:r,tool:i,spacePan:a}=W_.getState();return t===1||t===0&&(i===`hand`||r===`play`||a)}).on(`zoom`,({transform:{x:e,y:n,k:a}})=>{clearTimeout(r);for(let r of[t,u.current])r&&(r.style.transform=`translate(${e}px, ${n}px) scale(${a})`,r.style.setProperty(`--zoom`,String(a)));wK(t,I.current,a),nX.set(g,{x:e,y:n,k:a}),rv(a),i||(rX.delete(g),nv())}).on(`end`,({transform:{x:e,y:t,k:n}})=>{clearTimeout(r),r=setTimeout(()=>a({x:e,y:t,k:n}),eX)});n.call(o).on(`dblclick.zoom`,null).on(`wheel.zoom`,t=>{if(t.preventDefault(),t.ctrlKey||t.metaKey){o.scaleBy(n,XY(t.deltaY,t.deltaMode),vI(t,e));return}let r=t.shiftKey&&t.deltaX===0,i=r?t.deltaY:t.deltaX,a=r?0:t.deltaY,{deltaMode:s}=t,c=-YY(i,s),l=-YY(a,s),u=JY(i,s),f=JY(a,s);d(u?0:c,f?0:l),(u||f)&&v(u?c:0,f?l:0)},{passive:!1});let l=0,d=(t,r)=>{if(t===0&&r===0)return;let i=XR(e).k;o.translateBy(n,t/i,r/i)},f=0,h={x:0,y:0},_=()=>{cancelAnimationFrame(f),h={x:0,y:0}},v=(e,t)=>{if(cancelAnimationFrame(l),matchMedia(`(prefers-reduced-motion: reduce)`).matches){d(e,t);return}cancelAnimationFrame(f);let n={x:h.x+e,y:h.y+t};h=n;let r=performance.now(),i=0,a=e=>{let t=ZY(Math.min(1,Math.max(0,e-r)/120));d(n.x*(t-i),n.y*(t-i)),i=t,h={x:n.x*(1-t),y:n.y*(1-t)},t<1&&(f=requestAnimationFrame(a))};f=requestAnimationFrame(a)},y=({x:e,y:t,k:r})=>{i=!0;try{o.transform(n,YR.translate(e,t).scale(r))}finally{i=!1}},b=nX.get(g),x=!b||rX.has(g),S=M.current.length===0;S&&x?rX.add(g):rX.delete(g);let C=b&&(S||!x)?b:uX(M.current,lX(e));y(C),clearTimeout(r),a(C);let w=new ResizeObserver(()=>a(nX.get(g)??C));w.observe(e),p.current=t=>{if(cancelAnimationFrame(l),_(),matchMedia(`(prefers-reduced-motion: reduce)`).matches){y(t);return}let n=XR(e),r=performance.now(),i=e=>{let a=Math.min(1,(e-r)/tX);if(a===1){y(t);return}let o=a<.5?4*a**3:1-(-2*a+2)**3/2;y({x:n.x+(t.x-n.x)*o,y:n.y+(t.y-n.y)*o,k:n.k*(t.k/n.k)**o}),l=requestAnimationFrame(i)};l=requestAnimationFrame(i)};let T=()=>{_(),nv()};e.addEventListener(`pointerdown`,T,{capture:!0});let E=null,D=e=>{e!==E&&(E=e,TK(t,e))},O=t=>{let n=XR(e),[r,i]=n.invert(vI(t,e));D(QW(iN(M.current),{x:r,y:i},n.k)?.ref??null)},k=()=>D(null);return e.addEventListener(`pointermove`,O),e.addEventListener(`pointerleave`,k),m.current={zoomBy:e=>o.scaleBy(n,e),zoomTo:e=>o.scaleTo(n,e),fit:()=>{nv(),p.current?.(uX(M.current,lX(e)))},fitTo:t=>{nv(),p.current?.(uX(t.map(e=>({box:e})),lX(e)))},panBy:(t,r)=>{let i=XR(e).k;o.translateBy(n,-t/i,-r/i)},centerOn:(t,n)=>p.current?.(cX(t,n??XR(e).k,lX(e))),visible:()=>{let t=XR(e),{width:n,height:r}=lX(e),[i,a]=t.invert([0,0]);return{x:i,y:a,width:n/t.k,height:r/t.k}}},()=>{e.removeEventListener(`pointerdown`,T,{capture:!0}),e.removeEventListener(`pointermove`,O),e.removeEventListener(`pointerleave`,k),m.current=null,clearTimeout(r),cancelAnimationFrame(l),cancelAnimationFrame(f),p.current=null,w.disconnect(),n.on(`.zoom`,null)}},[g]),(0,_.useLayoutEffect)(()=>{let t=m.current;return t?tv(t,e.ref):void 0},[g,e.ref]),(0,_.useEffect)(()=>{let t=$N(sP,e.ref,R_,W_),n=dN(R_),r=CH(sP,R_,sz,e=>Qx(`/api/selection`,e));return()=>{r(),n(),t()}},[e.ref]),(0,_.useEffect)(()=>{let t=s.current,n=c.current,r=l.current;if(t&&n&&r)return cG(r,{viewport:t,layer:n,page:e.ref,frames:()=>M.current,sections:()=>N.current,pageFrames:()=>P.current})},[e.ref,x]),(0,_.useEffect)(()=>{let e=s.current;if(j.length===0||!e||!p.current||!rX.delete(g))return;let t=XR(e),n=lX(e),[r,i]=t.invert([0,0]),[a,o]=t.invert([n.width,n.height]);j.every(({box:e})=>e.x>=r&&e.y>=i&&e.x+e.width<=a&&e.y+e.height<=o)||p.current(uX(j,n))},[j,g]),(0,_.useEffect)(()=>{let e=j.find(e=>e.ref===i),t=s.current;e&&t&&p.current&&(p.current(uX([e],lX(t))),a?.())},[i,j,a]);let L=(0,_.useCallback)(e=>{let t=s.current;if(!t)return{x:0,y:0};let[n,r]=XR(t).invert(vI(e,t));return{x:n,y:r}},[]),R=(0,_.useCallback)(()=>iN(M.current),[]);IY(l,{enabled:!x,container:d,page:e.ref,frames:R,toBoard:L});let z=(t,n)=>{if(!d)return!1;let r=n=>hB(e.ref,t,n);if(b.current?.(),b.current=null,n)return b.current=FH(d,t,r,sP),!0;let i=d.querySelector(`[data-frame="${CSS.escape(t.frame)}"] iframe`)?.contentDocument;return JN(sP,e.ref,t),b.current=i?MH(i,t,r):null,b.current!==null},B=e=>{let t=s.current,n=y.current;if(t&&d&&n&&!(C||S||w||T||E)){let[r,i]=XR(t).invert(vI(e,t)),a=iN(j);if(PH(d,a,n,{x:r,y:i})&&z(n,!1))return}V(e)},V=t=>{let n=s.current;if(C||S||w||T||E||!n||!d)return;let[r,i]=XR(n).invert(vI(t,n)),a=++v.current;SH(d,iN(j),{x:r,y:i},iB).then(t=>{t&&a===v.current&&JN(sP,e.ref,t)})},ee=t=>{let n=s.current;if(C||S||w||T||E||!n||!d||qW(d,`[data-label-control]`,t))return!1;let r=XR(n),[i,a]=r.invert(vI(t,n)),o=QW(iN(j),{x:i,y:a},r.k),c=sP.getState();return o!==null&&a<o.box.y&&c.page===e.ref&&c.frames.length===1&&c.frames[0]===o.ref},te=(0,_.useMemo)(()=>k?Xz(j,k.view,k.size):null,[j,k]);return dz((0,_.useMemo)(()=>k?{frames:j,...k}:null,[j,k])),(0,Z.jsxs)(`div`,{ref:s,"data-canvas":!0,className:Q(`relative size-full touch-none overflow-hidden bg-background`,(C||w||T||E)&&!x&&`cursor-crosshair`,(D||S&&!x)&&`cursor-grab active:cursor-grabbing`),children:[(0,Z.jsx)(`div`,{ref:e=>{c.current=e,f(e)},"data-layer":!0,className:`absolute top-0 left-0 origin-top-left`,children:e.layoutError?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(GY,{page:e.ref,sections:e.sections}),j.map(e=>(0,Z.jsx)(EW,{frame:e,live:te?.has(e.ref)??!1,version:t[e.ref]??0,findings:n?.[e.ref],claim:r?.[e.ref],unseen:e.ref in O},__(h,e.ref))),(0,Z.jsx)(Fz,{frames:j}),(0,Z.jsx)(mH,{frames:j,container:d}),(0,Z.jsx)(LY,{viewport:s,container:d,frames:R,toBoard:L}),(0,Z.jsx)(VY,{viewport:s,toBoard:L}),(0,Z.jsx)(zz,{frames:j,container:d}),(0,Z.jsx)(Kz,{page:e.ref,frames:j})]})}),x?null:(0,Z.jsx)(jJ,{page:e.ref,frames:()=>iN(M.current),viewport:s,layer:c,trigger:(0,Z.jsx)(`div`,{ref:l,"data-hit-layer":!0,className:`absolute inset-0`,onClickCapture:t=>{let n=s.current;if(!(C||w||T||E)||!n||!d)return;t.stopPropagation();let r=XR(n),[i,a]=r.invert(vI(t.nativeEvent,n)),c=rV(),l=JB.getState().file;if(c===`asset`&&l){let t=eV();dV(d,e.ref,iN(j),t?.from??{x:i,y:a},l,{size:t?.size,corner:t?.at});return}if(c){let t=eV();lV(d,e.ref,iN(j),t?.from??{x:i,y:a},c,{size:t?.size,corner:t?.at}).then(e=>{e&&c===`text`&&z(e,!0)});return}if(T){let t=eV(),n=t&&t.size.width*r.k>=40&&t.size.height*r.k>=40?{...t.at,...t.size}:null;NG(e.ref,n??{x:i,y:a},{calls:o});return}if(w){let t=eV(),o=t&&t.size.width*r.k>=40&&t.size.height*r.k>=40?{...t.at,...t.size}:null,s=lX(n),[c,l]=r.invert([0,0]);zG(o??{x:i,y:a},{page:e.ref,frames:e.frames,visible:{x:c,y:l,width:s.width/r.k,height:s.height/r.k}});return}let u=AB(d,iN(j),{x:i,y:a});u?zN.setState({open:{kind:`new`,pick:u}}):HN()},onClick:e=>{e.metaKey&&V(e.nativeEvent)},onMouseDownCapture:e=>{e.detail<=1&&(y.current=sP.getState().element??null)},onDoubleClick:e=>{if(ee(e.nativeEvent)){let e=Se(`frame.rename`),[t]=sP.getState().frames;e&&be(e)&&t&&bW(t,`canvas`)}else B(e.nativeEvent)}})}),(0,Z.jsxs)(`div`,{ref:u,"data-notes-layer":!0,className:`pointer-events-none absolute top-0 left-0 origin-top-left`,children:[(0,Z.jsx)(yY,{page:e.ref,frames:j,container:d}),(0,Z.jsx)(DW,{frames:j})]}),(0,Z.jsx)(qz,{frames:j}),e.layoutError?(0,Z.jsx)(aX,{error:e.layoutError}):j.length===0?(0,Z.jsx)(oX,{page:e,calls:o}):null]})}function aX({error:e}){return(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center p-6`,children:(0,Z.jsxs)(`div`,{role:`alert`,className:`max-w-md rounded-lg border border-border bg-card p-4 text-body text-card-foreground`,children:[(0,Z.jsx)(`p`,{className:`text-panel`,children:`This page's layout does not read`}),(0,Z.jsx)(`p`,{className:`mt-1 break-all text-muted-foreground`,children:e.path}),(0,Z.jsx)(`p`,{className:`mt-2`,children:e.message})]})})}function oX({page:e,calls:t}){return rK(e)?(0,Z.jsx)(fK,{page:e,calls:t}):(0,Z.jsx)(sX,{hidden:e.frames,calls:t})}function sX({hidden:e,calls:t}){let n=fe(),r=z_(e=>e.canWrite);if(e.length>0){let n=e.length===1?`1 hidden frame stays`:`${e.length} hidden frames stay`,i=`Show ${e.length} frame${e.length===1?``:`s`}`;return(0,Z.jsxs)(`div`,{role:`status`,className:`pointer-events-none absolute top-1/2 left-1/2 w-105 max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-[55%] text-center text-body leading-[1.6] text-[color-mix(in_srgb,var(--muted-foreground)_85%,var(--foreground))]`,children:[(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3.5 h-12 w-16 rounded-lg border-[1.5px] border-dashed border-faint`}),(0,Z.jsx)(`p`,{className:`mb-1 text-sm font-semibold text-foreground`,children:`Every frame on this page is hidden`}),(0,Z.jsxs)(`p`,{children:[n,` listed under Layers.`]}),r?(0,Z.jsx)(`button`,{type:`button`,onClick:()=>void t.flagFrames(e.map(e=>e.ref),`hidden`,!1).catch(ok(`Couldn't show the hidden frames`)),className:`pointer-events-auto mt-3.5 h-[30px] rounded-lg bg-muted px-3 font-medium text-foreground outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50`,children:i}):null]})}return(0,Z.jsxs)(`div`,{role:`status`,className:`pointer-events-none absolute top-1/2 left-1/2 w-105 max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-[55%] text-center text-body leading-[1.6] text-[color-mix(in_srgb,var(--muted-foreground)_85%,var(--foreground))]`,children:[(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3.5 h-12 w-16 rounded-lg border-[1.5px] border-dashed border-faint`}),(0,Z.jsx)(`p`,{className:`mb-1 text-sm font-semibold text-foreground`,children:`This page has no frames`}),(0,Z.jsxs)(`p`,{children:[`Pick the Frame tool`,` `,n?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`kbd`,{className:`rounded-[5px] bg-muted px-1.5 py-0.5 font-mono text-label font-normal text-foreground`,children:`F`}),` `]}):null,`and click on the canvas,`,(0,Z.jsx)(`br`,{}),`or ask your agent to draw one.`]})]})}function cX(e,t,n){return e.width*t>n.width-128||e.height*t>n.height-128?uX([{box:e}],n):{x:n.width/2-(e.x+e.width/2)*t,y:n.height/2-(e.y+e.height/2)*t,k:t}}function lX(e){return{width:e.clientWidth,height:e.clientHeight}}function uX(e,t){if(e.length===0||t.width===0||t.height===0)return{x:$Y,y:$Y,k:1};let n=Math.min(...e.map(({box:e})=>e.x)),r=Math.min(...e.map(({box:e})=>e.y)),i=Math.max(...e.map(({box:e})=>e.x+e.width)),a=Math.max(...e.map(({box:e})=>e.y+e.height)),o=Math.min((t.width-128)/(i-n),(t.height-128)/(a-r),1),s=Math.max(QY[0],o);return{x:(t.width-(i-n)*s)/2-n*s,y:(t.height-(a-r)*s)/2-r*s,k:s}}function dX({...e}){return(0,Z.jsx)(Gq,{"data-slot":`dropdown-menu`,...e})}function fX({...e}){return(0,Z.jsx)(tJ,{"data-slot":`dropdown-menu-trigger`,...e})}function pX({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,Z.jsx)(gq,{children:(0,Z.jsx)(wq,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,Z.jsx)(pq,{"data-slot":`dropdown-menu-content`,className:Q(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function mX({...e}){return(0,Z.jsx)(tq,{"data-slot":`dropdown-menu-group`,...e})}function hX({className:e,inset:t,...n}){return(0,Z.jsx)(nq,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:Q(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,e),...n})}function gX({className:e,inset:t,variant:n=`default`,...r}){return(0,Z.jsx)(iq,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:Q(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function _X({...e}){return(0,Z.jsx)(qq,{"data-slot":`dropdown-menu-sub`,...e})}function vX({className:e,inset:t,children:n,...r}){return(0,Z.jsxs)(cJ,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:Q(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,Z.jsx)(zt,{className:`ml-auto`})]})}function yX({align:e=`start`,alignOffset:t=-3,side:n=`right`,sideOffset:r=0,className:i,...a}){return(0,Z.jsx)(pX,{"data-slot":`dropdown-menu-sub-content`,className:Q(`w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,i),align:e,alignOffset:t,side:n,sideOffset:r,...a})}function bX({...e}){return(0,Z.jsx)(Oq,{"data-slot":`dropdown-menu-radio-group`,...e})}function xX({className:e,children:t,inset:n,...r}){return(0,Z.jsxs)(Mq,{"data-slot":`dropdown-menu-radio-item`,"data-inset":n,className:Q(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[(0,Z.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-radio-item-indicator`,children:(0,Z.jsx)(Nq,{children:(0,Z.jsx)(Ft,{})})}),t]})}function SX({className:e,...t}){return(0,Z.jsx)(iJ,{"data-slot":`dropdown-menu-separator`,className:Q(`-mx-1 my-1 h-px bg-border`,e),...t})}var CX=_.createContext(void 0);function wX(e){let t=_.useContext(CX);if(t===void 0&&!e)throw Error(ao(72));return t}var TX={...wp,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},EX=class extends Mo{constructor(e,t,n){let r=new hp;super(DX(e,r,t,n),OX(r),TX)}setOpen=(e,t)=>{lp(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,bd(Cd,e))}};function DX(e,t,n,r=!1){return{...vp(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function OX(e){return{popupRef:_.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var kX=_o(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=rp((e,t)=>new EX({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),v=p.useState(`mounted`),y=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),dp(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:b,transitionStatus:x}=fp(h,p),S=p.useState(`isInstantPhase`),C=p.useState(`instantType`),w=p.useState(`lastOpenChangeReason`),T=_.useRef(null);q(()=>{m&&t&&p.setOpen(!1,bd(Wd))},[m,t,p]),q(()=>{x===`ending`&&w===`none`||x!==`ending`&&S?(C!==`delay`&&(T.current=C),p.set(`instantType`,`delay`)):T.current!==null&&(p.set(`instantType`,T.current),T.current=null)},[x,S,w,C,p]),q(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),_.useImperativeHandle(o,()=>({unmount:b,close:()=>p.setOpen(!1,bd(qd))}),[b,p]);let E=h||v||!t&&a!==`none`;return(0,Z.jsxs)(CX.Provider,{value:p,children:[l&&(0,Z.jsx)(ip,{handle:l,store:p}),E&&(0,Z.jsx)(AX,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:y}):f]})});function AX({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=Zf(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=Jf(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=_.useMemo(()=>Zl(a.reference,i.reference),[a.reference,i.reference]);return pp(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??eo}),null}var jX=_.createContext(void 0);function MX(){return _.useContext(jX)}var NX=`data-base-ui-tooltip-trigger`;function PX(e){let t=Is(e);return Lo(t)?t:null}var FX=vo(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=wX(!0),m=Tp(a)??p;if(!m)throw Error(ao(82));let h=qH(d),g=m.useState(`isTriggerActive`,h),v=m.useState(`isOpenedByTrigger`,h),y=m.useState(`floatingRootContext`),b=_.useRef(null),x=u??0,{registerTrigger:S,isMountedByThisTrigger:C}=up(h,b,m,{payload:o,closeOnClick:l,closeDelay:x}),w=MX(),{activeIdRef:T,delayRef:E,isInstantPhase:D,hasProvider:O}=pf(y,{open:v}),k=Mp(y);m.useSyncedValue(`isInstantPhase`,D);let A=m.useState(`disabled`),j=s??A,M=nf(j),N=m.useState(`trackCursorAxis`),P=m.useState(`disableHoverablePopup`),F=_.useRef(!1),I=ps(),L=_.useRef(void 0);function R(){return O&&T.current!=null?0:c??w??600}function z(e){let t=b.current;if(!t||!e)return!1;let n=Fs(e,`[${NX}]`);return n!==null&&n!==t&&X(t,n)}function B(e){let t=z(e);return F.current=t,t&&(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,I.clear()),t}let V=Fp(y,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?Zp():null,restMs:R,delay(){return u==null&&O?{close:of(E.current,`close`)}:{close:x}},triggerElementRef:b,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),ee=Dp(y,{enabled:!j}).reference,te=e=>{let t=F.current,n=PX(e),r=B(n),i=b.current,a=i&&n&&X(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`)m.setOpen(!1,bd(wd,e));else if(t&&!r&&a&&!M.current&&!m.select(`open`)&&i&&Cc(L.current)){let t=()=>{F.current||M.current||m.select(`open`)||m.setOpen(!0,bd(wd,e,i))},n=R();n===0?(I.clear(),t()):I.start(n,t)}},ne=m.useState(`appliedTriggerProps`,C||N!==`none`);return uu(`button`,e,{state:{open:v},ref:[t,S,b],props:[V,ee,ne,{onMouseOver(e){te(e.nativeEvent)},onFocus(e){z(PX(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),L.current=void 0},onPointerEnter(e){L.current=e.pointerType},onPointerDown(e){L.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[cc]:j?``:void 0,[NX]:j?void 0:``},f],stateAttributesMapping:ic})}),IX=_.createContext(void 0);function LX(){let e=_.useContext(IX);if(e===void 0)throw Error(ao(70));return e}var RX=_.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return wX().useState(`mounted`)||n?(0,Z.jsx)(IX.Provider,{value:n,children:(0,Z.jsx)(ef,{ref:t,...r})}):null}),zX=_.createContext(void 0);function BX(){let e=_.useContext(zX);if(e===void 0)throw Error(ao(71));return e}var VX=_.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Iu,style:g,...v}=e,y=wX(),b=LX(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`trackCursorAxis`),w=y.useState(`disableHoverablePopup`),T=y.useState(`floatingRootContext`),E=y.useState(`instantType`),D=y.useState(`transitionStatus`),O=_h({anchor:i,positionMethod:a,floatingRootContext:T,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,adaptiveOrigin:y.useState(`adaptiveOrigin`)}),k=xh(e,_.useMemo(()=>({open:x,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:C===`none`?E:`tracking-cursor`}),[x,O.side,O.align,O.anchorHidden,C,E]),{styles:O.positionerStyles,transitionStatus:D,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x||C===`both`||w});return(0,Z.jsx)(zX.Provider,{value:O,children:k})}),HX=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=wX(),{side:s,align:c}=BX(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);Ou({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),Np(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return uu(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[tp,f,bh(d),a],stateAttributesMapping:sc})}),UX=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=wX(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=BX();return uu(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:oc})}),WX=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=_.useMemo(()=>({open:t,close:n}),[t,n]);return(0,Z.jsx)(jX.Provider,{value:t,children:(0,Z.jsx)(ff,{delay:i,timeoutMs:r,children:e.children})})};function GX({delay:e=0,...t}){return(0,Z.jsx)(WX,{"data-slot":`tooltip-provider`,delay:e,...t})}function KX({...e}){return(0,Z.jsx)(kX,{"data-slot":`tooltip`,...e})}function qX({...e}){return(0,Z.jsx)(FX,{"data-slot":`tooltip-trigger`,...e})}function JX({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,Z.jsx)(RX,{children:(0,Z.jsx)(VX,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,Z.jsxs)(HX,{"data-slot":`tooltip-content`,className:Q(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background motion-reduce:animate-none! has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:[a,(0,Z.jsx)(UX,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}function YX({label:e,keys:t,children:n,side:r=`top`}){let i=pe(t,fe());return(0,Z.jsxs)(KX,{children:[(0,Z.jsx)(qX,{render:n}),(0,Z.jsx)(JX,{side:r,sideOffset:6,className:`rounded-md px-2 py-[5px] text-[11px]`,children:i?`${e} ${U(i)}`:e})]})}function XX({className:e,...t}){return(0,Z.jsx)(pX,{className:Q(`w-60 rounded-[10px] p-1 text-xs shadow-[0_12px_40px_rgba(0,0,0,.3)] ring-border`,e),...t})}function ZX({action:e,label:t,keys:n,children:r}){let i=pe(e?.keys??n,fe());return(0,Z.jsxs)(gX,{disabled:!e||!be(e),onClick:()=>e?.run(),className:QX,children:[r??e?.label??t,i?(0,Z.jsx)($X,{children:U(i)}):null]})}var QX=`h-7 rounded-md px-2 py-0 text-xs`;function $X({children:e}){return(0,Z.jsx)(`kbd`,{className:`ml-auto grid h-5 min-w-5 place-items-center rounded-[5px] bg-muted px-[5px] font-sans text-label font-normal text-muted-foreground`,children:e})}var eZ=[`view.hideUi`],tZ=[`project.rename`,`project.duplicate`,`nav.home`],nZ=[];function rZ({project:e,page:t,calls:n}){let[r]=xe(eZ);return(0,Z.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center gap-1.5 border-b border-sidebar-border px-2`,children:[(0,Z.jsx)(YX,{label:`Home`,side:`bottom`,children:(0,Z.jsx)(Ja,{href:`/`,"aria-label":`Home`,className:aZ,children:(0,Z.jsx)(Bn,{"aria-hidden":!0,className:`size-[15px]`})})}),(0,Z.jsx)(iZ,{project:e,page:t,calls:n}),(0,Z.jsx)(YX,{label:`Hide UI`,keys:r?.keys,side:`bottom`,children:(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Hide UI`,onClick:()=>r?.run(),className:aZ,children:(0,Z.jsx)(Mr,{"aria-hidden":!0,className:`size-[15px]`})})})]})}function iZ({project:e,page:t,calls:n}){let[r,i,a]=xe(tZ),o=Ak(e.name),s=z_(e=>e.board?.projects??nZ),[,c]=Va(),l=s.filter(t=>t.name!==e.name),u=r!==void 0&&be(r);return o?(0,Z.jsx)(`span`,{className:`flex min-w-0 flex-1 text-panel`,children:(0,Z.jsx)(IH,{name:o.draft,label:`Rename project ${e.name}`,onCommit:r=>{Gk(e.name,r,n).then(e=>{e&&c(q_(e,t),{replace:!0})})},onCancel:Uk},o.attempt)}):(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center`,children:[(0,Z.jsx)(`button`,{type:`button`,disabled:!u,title:u?`Rename ${e.name}`:e.name,onClick:()=>r?.run(),className:`min-w-0 truncate rounded-[5px] px-1 -ml-1 text-left text-panel outline-none hover:bg-sidebar-accent focus-visible:ring-2 focus-visible:ring-ring/50 disabled:hover:bg-transparent`,children:e.name}),(0,Z.jsxs)(dX,{children:[(0,Z.jsx)(fX,{"aria-label":`Project menu`,className:`grid size-6 shrink-0 place-items-center rounded-[5px] text-muted-foreground outline-none hover:bg-sidebar-accent hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-ring/50 aria-expanded:bg-sidebar-accent`,children:(0,Z.jsx)(Lt,{"aria-hidden":!0,className:`size-3`})}),(0,Z.jsxs)(XX,{align:`start`,sideOffset:6,className:`w-56`,children:[(0,Z.jsx)(ZX,{action:r,label:`Rename`}),(0,Z.jsx)(ZX,{action:i,label:`Duplicate`}),(0,Z.jsxs)(_X,{children:[(0,Z.jsx)(vX,{disabled:l.length===0,className:QX,children:`Switch project`}),(0,Z.jsx)(yX,{className:`w-56 rounded-[10px] p-1 text-xs shadow-[0_12px_40px_rgba(0,0,0,.3)] ring-border`,children:l.map(e=>(0,Z.jsx)(gX,{onClick:()=>c(Wk(e)),className:QX,children:(0,Z.jsx)(`span`,{className:`truncate`,children:e.name})},e.name))})]}),(0,Z.jsx)(SX,{}),(0,Z.jsx)(ZX,{action:a,label:`All projects`})]})]})]})}var aZ=`grid size-[26px] shrink-0 place-items-center rounded-md text-muted-foreground outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,oZ={name:`frameboard`,version:`0.26.0`,description:`A local design board that coding agents draw on as plain HTML files`,keywords:[`design`,`board`,`canvas`,`html`,`coding-agent`,`claude-code`,`cli`],homepage:`https://github.com/erclx/frameboard#readme`,bugs:{url:`https://github.com/erclx/frameboard/issues`},repository:{type:`git`,url:`git+https://github.com/erclx/frameboard.git`},license:`MIT`,type:`module`,bin:{frameboard:`dist/cli.js`},files:[`dist`],engines:{node:`>=22`},scripts:{typecheck:`tsc --noEmit`,build:`vite build && rolldown -c rolldown.config.ts && bun scripts/copy-faces.ts`,dev:`WORKTREE_PORT_OFFSET=$(bash scripts/worktree-port.sh) && export WORKTREE_PORT_OFFSET && bun scripts/dev.ts`,preview:`bun scripts/preview.ts`,test:`vitest`,"test:run":`bun scripts/test-locked.ts vitest run --reporter=verbose --maxWorkers=50%`,"test:ui":`vitest --ui`,"test:coverage":`vitest run --coverage --project node`,"test:e2e":`WORKTREE_PORT_OFFSET=$(bash scripts/worktree-port.sh) && export WORKTREE_PORT_OFFSET && bun scripts/test-locked.ts playwright test`,"test:e2e:changed":`WORKTREE_PORT_OFFSET=$(bash scripts/worktree-port.sh) && export WORKTREE_PORT_OFFSET && bun scripts/test-locked.ts playwright test --only-changed`,"test:e2e:ui":`WORKTREE_PORT_OFFSET=$(bash scripts/worktree-port.sh) && export WORKTREE_PORT_OFFSET && playwright test --ui`,"test:e2e:report":`playwright show-report`,"check:full":`bun scripts/verify.ts && bun run test:e2e`,"measure:canvas":`bun run build && playwright test -c e2e/perf/playwright.config.ts`,"smoke:prod":`bun e2e/screenshot.ts --check-console-clean --require-base-url`,prepare:`husky`,"design:sync":`bun run build && node dist/cli.js references sync canon/design --root "$(git rev-parse --path-format=absolute --git-common-dir)/../.canon/board"`,check:`bun scripts/verify.ts`,"check:format":`oxfmt --check .`,format:`oxfmt .`,lint:`oxlint --max-warnings 0 --disable-nested-config`,"lint:fix":`oxlint --fix --max-warnings 0 --disable-nested-config`,screenshot:`PREVIEW_PORT=$(bash scripts/worktree-port.sh 4173) && export PREVIEW_PORT && bash scripts/screenshot.sh`,"screenshot:compare":`bun run build && bun scripts/screenshot-compare.ts`,"readme-screenshot":`PREVIEW_PORT=$(bash scripts/worktree-port.sh 4173) && export PREVIEW_PORT && bash scripts/readme-screenshot.sh`},devDependencies:{"@atlaskit/pragmatic-drag-and-drop":`4.0.0`,"@atlaskit/pragmatic-drag-and-drop-hitbox":`3.0.0`,"@base-ui/react":`^1.9.0`,"@bramus/specificity":`^2.4.3`,"@commitlint/cli":`^21.2.3`,"@commitlint/config-conventional":`^21.2.3`,"@fontsource-variable/caveat":`^5.3.0`,"@fontsource-variable/geist":`^5.3.0`,"@fontsource-variable/geist-mono":`^5.3.0`,"@fontsource-variable/inter":`^5.3.0`,"@fontsource-variable/source-serif-4":`^5.3.1`,"@hono/node-server":`^2.1.5`,"@playwright/test":`^1.64.1`,"@tailwindcss/vite":`^4.3.3`,"@testing-library/jest-dom":`^7.0.1`,"@testing-library/react":`^16.3.3`,"@testing-library/user-event":`^14.6.8`,"@types/d3-drag":`^3.0.7`,"@types/d3-selection":`^3.0.12`,"@types/d3-zoom":`^3.0.9`,"@types/jsdom":`^30.0.0`,"@types/node":`^26.6.5`,"@types/react":`^19.3.0`,"@types/react-dom":`^19.3.0`,"@types/ws":`^8.18.2`,"@vitejs/plugin-react":`^6.1.2`,"@vitest/browser-playwright":`^5.0.4`,"@vitest/coverage-v8":`^5`,"@vitest/ui":`^5`,chokidar:`^6.0.0`,"class-variance-authority":`^0.7.1`,cmdk:`^1.1.1`,cn:`^0.5.0`,commander:`^15.0.0`,"css-select":`^7.0.0`,"d3-drag":`3.0.0`,"d3-selection":`^3.0.0`,"d3-zoom":`^3.0.0`,"eslint-plugin-check-file":`^3.3.2`,"eslint-plugin-simple-import-sort":`^14.0.0`,"fast-check":`^4.10.2`,hono:`^4.13.13`,husky:`^9.1.7`,jsdom:`^30.1.2`,"lucide-react":`^1.57.0`,oxfmt:`0.75.0`,oxlint:`1.90.0`,parse5:`^8.0.1`,"parse5-htmlparser2-tree-adapter":`^8.0.1`,playwright:`^1.64.1`,postcss:`^8.5.6`,react:`^19.3.1`,"react-dom":`^19.3.1`,"react-resizable-panels":`^4.14.5`,rolldown:`^1.2.14`,shadcn:`^4.21.5`,tailwindcss:`^4.3.3`,tinykeys:`^4.0.1`,"tw-animate-css":`^1.4.0`,typescript:`^7`,vite:`^8.3.4`,vitest:`^5`,wouter:`^3.13.0`,ws:`^8.22.0`,zod:`^4.6.7`,zustand:`^5.0.15`},dependencies:{"playwright-core":`1.64.1`},peerDependencies:{oxfmt:`0.75.0`},peerDependenciesMeta:{oxfmt:{optional:!0}}},sZ={config:`Saved on this machine`,git:`From git user.name`};function cZ({name:e,source:t=null,align:n=`start`}){let[r]=xe([`help.shortcuts`]),i=we(`theme`),a=i.find(e=>e.checked?.()),o=t?sZ[t]:null;return(0,Z.jsxs)(dX,{children:[(0,Z.jsx)(fX,{"aria-label":e&&o?`${e}, ${o.toLowerCase()}`:`Account`,className:`rounded-full outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,Z.jsx)(dZ,{name:e??null})}),(0,Z.jsxs)(XX,{align:n,alignOffset:n===`start`?-25:-10,sideOffset:7,children:[e===void 0?null:(0,Z.jsx)(lZ,{name:e,caption:o}),(0,Z.jsx)(ZX,{action:r,label:`Keyboard shortcuts`}),(0,Z.jsxs)(_X,{children:[(0,Z.jsxs)(vX,{disabled:i.length===0,className:`${QX} data-disabled:opacity-50`,children:[`Theme`,a?(0,Z.jsx)(`span`,{className:`ml-auto text-muted-foreground`,children:a.label}):null]}),(0,Z.jsx)(yX,{className:`rounded-[10px] ring-border`,children:(0,Z.jsx)(bX,{value:a?.id??``,children:i.map(e=>(0,Z.jsx)(xX,{value:e.id,onClick:()=>e.run(),className:`h-7 py-0 text-xs`,children:e.label},e.id))})})]}),(0,Z.jsx)(gX,{className:QX,render:(0,Z.jsx)(`a`,{href:oZ.homepage}),children:`Docs`})]})]})}function lZ({name:e,caption:t}){let n=z_(e=>e.canWrite),[r,i]=(0,_.useState)(!1),a=(0,_.useRef)(null),o=(0,_.useRef)(!1);if((0,_.useEffect)(()=>{!r&&o.current&&(o.current=!1,a.current?.focus())},[r]),!e&&!n)return null;let s=()=>{o.current=!0,i(!1)};return r?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2.5 p-2`,onKeyDown:e=>{e.key!==`Tab`&&e.stopPropagation()},children:[(0,Z.jsx)(dZ,{name:e}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 pl-1.5`,children:[(0,Z.jsx)(IH,{hug:!0,clearable:!0,name:e??``,label:`Your name`,onCommit:e=>{s(),dY(e).catch(e=>n_.add({title:`Couldn't save your name`,description:e instanceof Error?e.message:String(e),type:`error`}))},onCancel:s}),(0,Z.jsx)(`p`,{className:`mt-0.5 text-label font-normal text-muted-foreground`,children:e?t??``:`Signs your notes`})]})]}),(0,Z.jsx)(SX,{})]}):(0,Z.jsxs)(Z.Fragment,{children:[n?(0,Z.jsx)(gX,{ref:a,closeOnClick:!1,onClick:()=>i(!0),"aria-label":e?`Edit your name, ${e}`:`Set your name`,className:`gap-2.5 p-2`,children:(0,Z.jsx)(uZ,{name:e,caption:t})}):(0,Z.jsx)(`div`,{className:`flex items-center gap-2.5 p-2`,children:(0,Z.jsx)(uZ,{name:e,caption:t})}),(0,Z.jsx)(SX,{})]})}function uZ({name:e,caption:t}){return e?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(dZ,{name:e}),(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsx)(`p`,{className:`truncate font-semibold`,title:e,children:e}),t?(0,Z.jsx)(`p`,{className:`text-label font-normal text-muted-foreground`,children:t}):null]})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`grid size-[22px] shrink-0 place-items-center rounded-full bg-muted text-[10px] font-bold text-muted-foreground`,children:`?`}),(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsx)(`p`,{className:`font-semibold text-primary`,children:`Set your name`}),(0,Z.jsx)(`p`,{className:`text-label font-normal text-muted-foreground`,children:`Signs your notes`})]})]})}function dZ({name:e}){return(0,Z.jsx)(`span`,{"aria-hidden":!0,"data-avatar":!0,className:`grid size-[22px] shrink-0 place-items-center rounded-full bg-foreground text-[10px] font-bold text-card`,children:e?aY(e):(0,Z.jsx)(na,{className:`size-3`})})}var fZ=[{id:`view.zoomIn`,label:`Zoom in`},{id:`view.zoomOut`,label:`Zoom out`},{id:`view.zoomToFit`,label:`Zoom to fit`}],pZ=[{id:`view.zoom50`,label:`50%`},{id:`view.zoom100`,label:`100%`},{id:`view.zoom200`,label:`200%`}],mZ=[...fZ,...pZ].map(e=>e.id);function hZ({align:e=`end`,className:t}){let n=(0,_.useRef)(null),r=xe(mZ);return(0,_.useEffect)(()=>{let e=()=>{n.current&&(n.current.textContent=gZ(ev.zoom()))};return e(),ev.onZoom(e)},[]),(0,Z.jsxs)(dX,{children:[(0,Z.jsxs)(fX,{"aria-label":`Zoom`,className:Q(`flex h-6 items-center gap-1 rounded-md px-1 text-muted-foreground tabular-nums outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 aria-expanded:text-foreground`,t),children:[(0,Z.jsx)(`span`,{ref:n,"data-zoom-level":!0}),(0,Z.jsx)(Lt,{"aria-hidden":!0,className:`size-2.5`})]}),(0,Z.jsxs)(XX,{align:e,sideOffset:8,className:`w-48`,children:[fZ.map((e,t)=>(0,Z.jsx)(ZX,{action:r[t],label:e.label},e.id)),(0,Z.jsx)(SX,{}),pZ.map((e,t)=>(0,Z.jsx)(ZX,{action:r[fZ.length+t],label:e.label,children:e.label},e.id))]})]})}function gZ(e){return`${Math.round(e*100)}%`}function _Z({project:e,page:t,calls:n}){let[r]=xe([`view.hideUi`]),i=lY(),a=uY();return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`absolute top-3 left-3 z-10 flex max-w-[calc(100%-10rem)] items-center gap-2 rounded-[10px] border border-border bg-card py-1.5 pr-2 pl-1.5 shadow-[0_2px_8px_rgba(0,0,0,.12)]`,children:[(0,Z.jsx)(YX,{label:`Home`,side:`bottom`,children:(0,Z.jsx)(Ja,{href:`/`,"aria-label":`Home`,className:vZ,children:(0,Z.jsx)(Bn,{"aria-hidden":!0,className:`size-[15px]`})})}),(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`h-4 w-px shrink-0 bg-border`}),(0,Z.jsx)(iZ,{project:e,page:t,calls:n}),(0,Z.jsx)(YX,{label:`Show UI`,keys:r?.keys,side:`bottom`,children:(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Show UI`,onClick:()=>r?.run(),className:vZ,children:(0,Z.jsx)(Mr,{"aria-hidden":!0,className:`size-[15px]`})})})]}),(0,Z.jsxs)(`div`,{className:`absolute top-3 right-3 z-10 flex h-[34px] items-center gap-1.5 rounded-lg border border-border bg-card pr-2.5 pl-1.5`,children:[(0,Z.jsx)(cZ,{name:i,source:a,align:`end`}),(0,Z.jsx)(hZ,{className:`text-foreground`})]})]})}var vZ=`grid size-7 shrink-0 place-items-center rounded-md text-muted-foreground outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,yZ=`a[href], button, input, select, textarea, summary, [onclick], [tabindex], [contenteditable], video[controls], audio[controls], script`;function bZ(e){return pz(e).some(e=>e.matches(yZ))}function xZ(e,t=document){let n=e.filter(e=>!e.hidden);if(n.length===0)return`unread`;let r=!1;for(let e of n){let n=t.querySelector(`[data-frame="${CSS.escape(e.ref)}"] > iframe`)?.contentDocument;if(!n||!SZ(n))r=!0;else if(bZ(n))return`clickable`}return r?`unread`:`static`}function SZ(e){return e.readyState===`complete`&&e.URL!==`about:blank`}function CZ(e){return document.addEventListener(`load`,e,!0),()=>document.removeEventListener(`load`,e,!0)}function wZ({frames:e}){let t=(0,_.useSyncExternalStore)(CZ,(0,_.useCallback)(()=>xZ(e),[e]),()=>`unread`);return(0,Z.jsxs)(`p`,{role:`status`,className:`pointer-events-none absolute top-3.5 left-1/2 z-10 flex -translate-x-1/2 flex-col items-center rounded-[14px] bg-primary px-3 py-1.5 font-medium whitespace-nowrap text-primary-foreground`,children:[(0,Z.jsx)(`span`,{children:`Playing. Clicks go to the frames. Esc to edit`}),t===`static`?(0,Z.jsx)(`span`,{className:`font-normal`,children:`Nothing on this page takes a click`}):null]})}var TZ=`font-mono text-label font-normal text-foreground`;function EZ({project:e,anchor:t,load:n=Yk,upload:r=Wj}){let i=z_(e=>e.canWrite),a=F(YB,e=>e.open)&&i;return(0,Z.jsx)(VU,{open:a,onOpenChange:e=>YB.setState({open:e}),children:(0,Z.jsx)(UU,{anchor:t,side:`top`,sideOffset:8,"aria-label":`Image or video`,className:`w-[260px] gap-0 p-0 text-xs`,children:a?(0,Z.jsx)(DZ,{project:e,load:n,upload:r}):null})})}function DZ({project:e,load:t,upload:n}){let[r,i]=(0,_.useState)(0),[a,o]=(0,_.useState)(),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(null),d=(0,_.useRef)(null);(0,_.useEffect)(()=>{let n=!0;return t(e).catch(()=>null).then(e=>{n&&o(e)}),()=>{n=!1}},[e,t,r]);async function f(t){if(t.length!==0){c(!0);try{let r=await n(e,t);u(r.refused.length>0?r.refused.map(e=>`${e.name}: ${e.message}`).join(` `):null)}catch(e){u(e instanceof Error?e.message:String(e))}finally{c(!1),i(e=>e+1)}}}if(a===void 0)return null;if(a===null)return(0,Z.jsx)(`p`,{className:`m-3 text-muted-foreground`,children:`The assets did not load. Reload the board to try again.`});let p=a.files.filter(Pj);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`h3`,{className:`px-3 pt-2.5 pb-1 text-label text-muted-foreground`,children:[`Image or video · `,p.length,` `,p.length===1?`file`:`files`]}),p.length===0?(0,Z.jsxs)(`div`,{className:`flex flex-col items-start gap-2 px-3 pt-1 pb-3`,children:[(0,Z.jsxs)(`p`,{className:`leading-normal text-muted-foreground`,children:[`No images or videos in `,(0,Z.jsx)(`code`,{className:TZ,children:`assets/`}),` yet.`]}),(0,Z.jsx)(`button`,{type:`button`,disabled:s,onClick:()=>d.current?.click(),className:`h-7 rounded-md bg-primary px-2.5 font-medium text-primary-foreground outline-none hover:bg-primary/90 focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50`,children:s?`Adding files…`:`Add files`}),(0,Z.jsx)(`input`,{ref:d,type:`file`,multiple:!0,hidden:!0,accept:`image/*,video/*,.svg`,"aria-label":`Choose files to add`,onChange:e=>{let t=[...e.target.files??[]];e.target.value=``,f(t)}})]}):(0,Z.jsx)(`ul`,{className:`grid max-h-[320px] grid-cols-2 gap-2 overflow-y-auto px-2 pt-1 pb-2`,children:p.map(t=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>XB({project:e,path:t.path,kind:t.kind}),"aria-label":`Place ${t.path}`,className:`block w-full overflow-hidden rounded-lg bg-muted text-left outline-none hover:ring-[1.5px] hover:ring-primary focus-visible:ring-[1.5px] focus-visible:ring-primary`,children:[(0,Z.jsx)(Uj,{project:e,file:t}),(0,Z.jsxs)(`span`,{className:`block truncate px-[7px] py-[5px] text-label font-normal`,children:[(0,Z.jsx)(`span`,{title:t.path,children:t.path}),(0,Z.jsx)(`span`,{className:`block text-[10px] text-muted-foreground`,children:kj(t)})]})]})},t.path))}),l?(0,Z.jsx)(`p`,{role:`alert`,className:`mx-3 mb-2 text-destructive`,children:l}):null]})}var OZ=`tool.shape`,kZ=`tool.frame`,AZ=`tool.section`,jZ=`tool.move`,MZ=`tool.hand`,NZ=`place`,PZ=[{id:jZ,label:`Move`,key:`v`,icon:Er},{id:MZ,label:`Hand`,key:`h`,icon:Rn}],FZ=[{value:`auto`,label:`Auto`,tip:`Place where drawn, or in the flow of a flex or grid`},{value:`flow`,label:`Flow`,tip:`Place in the flow`},{value:`free`,label:`Free`,tip:`Place where drawn`}],IZ=[{tool:`frame`,id:kZ,label:`Frame`,key:`f`,icon:Pn},{tool:`section`,id:AZ,label:`Section`,key:`Shift+KeyS`,icon:Pr}],LZ=[[{id:jZ,label:`Move`,keys:[`v`],icon:Er},{id:kZ,label:`Frame`,keys:[`f`],icon:Pn},{id:`tool.text`,label:`Text`,keys:[`t`],icon:Xi},{id:OZ,label:`Shape`,icon:WB[0].icon},{id:`tool.note`,label:`Note`,keys:[`n`],icon:vr}],[{id:NZ,label:`Place`,icon:Er}],[{id:`edit.undo`,label:`Undo`,icon:ea},{id:`edit.redo`,label:`Redo`,icon:Xr}],[{id:`view.zoomToFit`,label:`Zoom to fit`,keys:[`Shift+Digit1`],icon:gr},{id:`theme.toggle`,label:`Theme`,icon:Oi,darkIcon:wr}]],RZ=[{id:`mode.edit`,label:`Edit`,icon:Rr},{id:`mode.play`,label:`Play`,icon:Wr}],zZ=`mode.toggle`,BZ=[zZ,MZ,...[...LZ.flat(),...RZ].map(e=>e.id).filter(e=>e!==OZ&&e!==NZ),...WB.map(e=>e.id),UB,AZ];function VZ(e){(0,_.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let n=document.documentElement,r=()=>{n.style.setProperty(`--toast-lift`,`calc(${t.offsetHeight}px + 1.5rem)`)};r();let i=new ResizeObserver(r);return i.observe(t),()=>{i.disconnect(),n.style.removeProperty(`--toast-lift`)}},[e])}function HZ({project:e}){let t=xe(BZ),n=new Map(BZ.map((e,n)=>[e,t[n]])),r=(0,_.useRef)(null);return VZ(r),(0,Z.jsxs)(`div`,{ref:r,role:`toolbar`,"aria-label":`Tools`,className:`absolute bottom-4 left-1/2 z-10 flex max-w-[calc(100%-1.5rem)] -translate-x-1/2 items-center gap-0.5 overflow-x-auto rounded-xl border border-border bg-card p-[5px] shadow-[0_6px_24px_rgba(0,0,0,.18),0_1px_3px_rgba(0,0,0,.12)]`,children:[LZ.map((e,t)=>(0,Z.jsxs)(_.Fragment,{children:[t>0?(0,Z.jsx)(XZ,{}):null,e.map(e=>e.id===OZ?(0,Z.jsx)(WZ,{actions:n},e.id):e.id===jZ?(0,Z.jsx)(KZ,{actions:n},e.id):e.id===NZ?(0,Z.jsx)(JZ,{},e.id):e.id===kZ?(0,Z.jsx)(GZ,{actions:n},e.id):(0,Z.jsx)(UZ,{slot:e,action:n.get(e.id)},e.id))]},e[0]?.id)),(0,Z.jsx)(XZ,{}),(0,Z.jsx)(`div`,{className:`flex shrink-0 rounded-lg bg-muted p-0.5`,children:RZ.map(e=>(0,Z.jsx)(YZ,{slot:e,action:n.get(e.id),toggleKeys:n.get(zZ)?.keys},e.id))}),e===void 0?null:(0,Z.jsx)(EZ,{project:e,anchor:r})]})}function UZ({slot:e,action:t,pressed:n}){let r=ZZ(e,t),{label:i,keys:a,enabled:o,run:s}=r,c=n??r.on,l=e.icon,u=e.darkIcon;return(0,Z.jsx)(YX,{label:i,keys:a,children:(0,Z.jsxs)(`button`,{type:`button`,"aria-label":i,"aria-pressed":t?.checked||n!==void 0?c:void 0,"aria-disabled":!o||void 0,onClick:s,className:Q(`grid size-8 shrink-0 place-items-center rounded-[7px] text-foreground outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:hover:bg-transparent`,c&&`bg-primary text-primary-foreground hover:bg-primary aria-disabled:hover:bg-primary`),children:[(0,Z.jsx)(l,{"aria-hidden":!0,className:Q(`size-4`,u&&`dark:hidden`)}),u?(0,Z.jsx)(u,{"aria-hidden":!0,className:`hidden size-4 dark:block`}):null]})})}function WZ({actions:e}){let t=nV(),n=fe(),r=e.get(t.id),i={id:t.id,label:t.label,keys:[t.key],icon:t.icon},a=WB.some(t=>e.get(t.id)?.checked?.()??!1);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(UZ,{slot:i,action:r,pressed:a}),(0,Z.jsxs)(dX,{children:[(0,Z.jsx)(fX,{"aria-label":`Shapes`,className:`-ml-0.5 grid h-8 w-6 shrink-0 place-items-center rounded-[5px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 aria-expanded:text-foreground`,children:(0,Z.jsx)(Lt,{"aria-hidden":!0,className:`size-[9px]`})}),(0,Z.jsxs)(XX,{side:`top`,align:`start`,sideOffset:8,className:`w-[220px]`,children:[(0,Z.jsx)(bX,{value:t.kind,onValueChange:t=>{let n=e.get(tV(t).id);n&&be(n)&&n.run()},children:WB.map(t=>{let r=e.get(t.id),i=pe(r?.keys??[t.key],n),a=t.icon;return(0,Z.jsxs)(xX,{value:t.kind,closeOnClick:!0,disabled:!r||!be(r),className:Q(QX,`gap-2 pr-2 data-checked:bg-primary data-checked:text-primary-foreground [&_[data-slot=dropdown-menu-radio-item-indicator]]:hidden`),children:[(0,Z.jsx)(a,{"aria-hidden":!0,className:`size-[13px]`}),t.label,i?(0,Z.jsx)($X,{children:U(i)}):null]},t.id)})}),(0,Z.jsx)(SX,{}),(0,Z.jsx)(ZX,{action:e.get(UB),label:`Image or video`,keys:[`$mod+Shift+KeyK`],children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2 whitespace-nowrap`,children:[(0,Z.jsx)(Hn,{"aria-hidden":!0,className:`size-[13px]`}),`Image or video…`]})})]})]})]})}function GZ({actions:e}){let t=TG(),n=fe(),r=IZ.find(e=>e.tool===t)??IZ[0],i={id:r.id,label:r.label,keys:[r.key],icon:r.icon},a=IZ.some(t=>e.get(t.id)?.checked?.()??!1);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(UZ,{slot:i,action:e.get(r.id),pressed:a}),(0,Z.jsxs)(dX,{children:[(0,Z.jsx)(fX,{"aria-label":`Frame tools`,className:`-ml-0.5 grid h-8 w-6 shrink-0 place-items-center rounded-[5px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 aria-expanded:text-foreground`,children:(0,Z.jsx)(Lt,{"aria-hidden":!0,className:`size-[9px]`})}),(0,Z.jsx)(XX,{side:`top`,align:`start`,sideOffset:8,className:`w-[196px]`,children:(0,Z.jsx)(bX,{value:t,onValueChange:t=>{let n=IZ.find(e=>e.tool===t),r=n&&e.get(n.id);r&&be(r)&&r.run()},children:IZ.map(t=>{let r=e.get(t.id),i=pe(r?.keys??[t.key],n),a=t.icon;return(0,Z.jsxs)(xX,{value:t.tool,closeOnClick:!0,disabled:!r||!be(r),className:Q(QX,`gap-2 pr-2 data-checked:bg-primary data-checked:text-primary-foreground [&_[data-slot=dropdown-menu-radio-item-indicator]]:hidden`),children:[(0,Z.jsx)(a,{"aria-hidden":!0,className:`size-[13px]`}),t.label,i?(0,Z.jsx)($X,{children:U(i)}):null]},t.id)})})})]})]})}function KZ({actions:e}){let t=fe(),n=PZ[+!!(e.get(MZ)?.checked?.()??!1)],r={id:n.id,label:n.label,keys:[n.key],icon:n.icon},i=PZ.some(t=>e.get(t.id)?.checked?.()??!1);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(UZ,{slot:r,action:e.get(n.id),pressed:i}),(0,Z.jsxs)(dX,{children:[(0,Z.jsx)(fX,{"aria-label":`Pointer tools`,className:`-ml-0.5 grid h-8 w-6 shrink-0 place-items-center rounded-[5px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 aria-expanded:text-foreground`,children:(0,Z.jsx)(Lt,{"aria-hidden":!0,className:`size-[9px]`})}),(0,Z.jsx)(XX,{side:`top`,align:`start`,sideOffset:8,className:`w-[196px]`,children:(0,Z.jsx)(bX,{value:i?n.id:``,onValueChange:t=>{let n=e.get(t);n&&be(n)&&n.run()},children:PZ.map(n=>{let r=e.get(n.id),i=pe(r?.keys??[n.key],t),a=n.icon;return(0,Z.jsxs)(xX,{value:n.id,closeOnClick:!0,disabled:!r||!be(r),className:Q(QX,`gap-2 pr-2 data-checked:bg-primary data-checked:text-primary-foreground [&_[data-slot=dropdown-menu-radio-item-indicator]]:hidden`),children:[(0,Z.jsx)(a,{"aria-hidden":!0,className:`size-[13px]`}),n.label,i?(0,Z.jsx)($X,{children:U(i)}):null]},n.id)})})})]})]})}var qZ={ArrowRight:(e,t)=>(e+1)%t,ArrowLeft:(e,t)=>(e-1+t)%t,Home:()=>0,End:(e,t)=>t-1};function JZ(){let e=F(KB,e=>e.placing),t=(0,_.useRef)([]),[n,r]=(0,_.useState)(null),i=FZ.findIndex(({value:t})=>t===e),a=n??i,o=(e,n)=>{let r=qZ[e.key];r&&(e.preventDefault(),t.current[r(n,FZ.length)]?.focus())};return(0,Z.jsx)(`div`,{role:`group`,"aria-label":`Place new elements`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||r(null)},className:`flex shrink-0 rounded-lg bg-muted p-0.5`,children:FZ.map(({value:n,label:i,tip:s},c)=>(0,Z.jsx)(YX,{label:s,children:(0,Z.jsx)(`button`,{ref:e=>{t.current[c]=e},type:`button`,"aria-pressed":n===e,tabIndex:c===a?0:-1,onFocus:()=>r(c),onKeyDown:e=>o(e,c),onClick:()=>KB.setState({placing:n}),className:Q(`flex h-[26px] items-center rounded-md px-[9px] font-medium text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,n===e&&`bg-card text-foreground ring-1 ring-border`),children:i})},n))})}function YZ({slot:e,action:t,toggleKeys:n}){let{label:r,keys:i,on:a,enabled:o,run:s}=ZZ(e,t),c=e.icon;return(0,Z.jsx)(YX,{label:r,keys:i??n,children:(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":a,"aria-disabled":!o||void 0,onClick:s,className:Q(`flex h-[26px] items-center gap-[5px] rounded-md px-[9px] font-medium text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50`,a&&e.id===`mode.play`?`bg-primary text-primary-foreground hover:text-primary-foreground`:a&&`bg-card text-foreground ring-1 ring-border`),children:[(0,Z.jsx)(c,{"aria-hidden":!0,className:`size-3.5`}),r]})})}function XZ(){return(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`mx-[5px] h-5 w-px shrink-0 bg-border`})}function ZZ(e,t){let n=t?be(t):!1;return{label:t?.label??e.label,keys:t?.keys??e.keys,on:t?.checked?.()??!1,enabled:n,run:()=>{t&&n&&t.run()}}}function QZ(){return N()(()=>({open:!1,focusRequest:0}))}var $Z=QZ();function eQ(e){return F($Z,e)}function tQ(e=$Z,t=W_){t.setState({hideUi:!1}),e.setState(e=>({open:!0,focusRequest:e.focusRequest+1}))}function nQ(e=$Z){e.setState({open:!1})}function rQ(e=$Z,t=W_){(0,_.useEffect)(()=>{let n=ye([{id:`find.open`,label:`Find`,group:`tool`,keys:[`$mod+KeyF`],run:()=>tQ(e,t),command:{label:`Find frames, elements, and text`,icon:fi}}]);return()=>{n(),nQ(e)}},[e,t])}function iQ({listeners:e,claims:t}){let n=F(kv,e=>e.session);if(e.length===0)return null;let r=new Map(Object.values(t).map(e=>[e.session,e.agent]));return(0,Z.jsx)(`span`,{className:`ml-1 flex items-center`,children:e.map((e,t)=>{let i=r.has(e.session),a=n===e.session,o=(0,Z.jsx)(`span`,{"aria-hidden":!0,className:Q(`grid size-[22px] place-items-center rounded-full text-[9px] font-bold text-card shadow-[0_0_0_2px_var(--sidebar)]`,i?`bg-claim`:`bg-[color-mix(in_srgb,var(--claim)_55%,var(--sidebar))]`),children:Bz(r.get(e.session)??Hz(e.tag))});return(0,Z.jsxs)(`button`,{type:`button`,"aria-label":`${e.tag}, ${i?`editing`:`listening`}`,"aria-pressed":a,title:a?`Stop following ${e.tag}`:`Follow ${e.tag}`,"data-editing":i||void 0,onClick:()=>a?Mv():jv(e.session),className:Q(`rounded-full outline-none hover:brightness-110 focus-visible:ring-2 focus-visible:ring-ring/50`,a?`flex items-center gap-1.5 py-0.5 pr-2 pl-0.5 text-[11px] font-semibold text-claim shadow-[0_0_0_1.5px_var(--claim)]`:t>0&&`-ml-1.5`,a&&t>0&&`ml-1.5`),children:[o,a?`Following`:null]},e.session)})})}var aQ=[[{id:`arrange.alignLeft`,icon:rt},{id:`arrange.alignCenter`,icon:Ge},{id:`arrange.alignRight`,icon:Ye}],[{id:`arrange.alignTop`,icon:tt},{id:`arrange.alignMiddle`,icon:Ue},{id:`arrange.alignBottom`,icon:qe}],[{id:`arrange.distributeHorizontal`,icon:Ze},{id:`arrange.distributeVertical`,icon:at}]],oQ=aQ.flat().map(({id:e})=>e);function sQ(){let e=xe(oQ),t=new Map(e.flatMap(e=>e?[[e.id,e]]:[]));return(0,Z.jsxs)(`section`,{"aria-labelledby":`inspector-arrange`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,Z.jsx)(`h2`,{id:`inspector-arrange`,className:`mb-2 text-xs font-semibold`,children:`Arrange`}),(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:aQ.map(e=>(0,Z.jsx)(`div`,{role:`group`,className:`flex gap-0.5 rounded-md bg-input p-0.5`,children:e.map(({id:e,icon:n})=>(0,Z.jsx)(cQ,{action:t.get(e),icon:n},e))},e[0]?.id))})]})}function cQ({action:e,icon:t}){return e?(0,Z.jsx)(YX,{label:e.label,keys:e.keys,side:`bottom`,children:(0,Z.jsx)(`button`,{type:`button`,"aria-label":e.label,disabled:!be(e),onClick:e.run,className:`grid h-[22px] w-7 place-items-center rounded-[5px] text-muted-foreground outline-none hover:bg-sidebar hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 active:bg-sidebar disabled:pointer-events-none disabled:opacity-40`,children:(0,Z.jsx)(t,{"aria-hidden":!0,className:`size-[13px]`,strokeWidth:1.6})})}):null}var lQ=new Map;function uQ(e,t){let n=JSON.stringify({locale:lJ(e),options:t}),r=lQ.get(n);if(r)return r;let i=new Intl.NumberFormat(e,t);return lQ.set(n,i),i}function dQ(e,t,n){return e==null?``:uQ(t,n).format(e)}var fQ=_.createContext(void 0);function pQ(){let e=_.useContext(fQ);if(e===void 0)throw Error(ao(43));return e}var mQ=`data-valid`,hQ=`data-invalid`,gQ={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},_Q={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},vQ={valid(e){return e===null?null:e?{[mQ]:``}:{[hQ]:``}}},yQ={invalid:void 0,name:void 0,validityData:{state:gQ,errors:[],error:``,value:``,initialValue:null},setValidityData:Qa,disabled:void 0,setTouched:Qa,setDirty:Qa,setFilled:Qa,setFocused:Qa,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:_Q,registerFieldControl:Qa,validation:{getValidationProps:(e,t=eo)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:Qa,getInputControl:()=>null,commit:async()=>{},change:Qa}},bQ=_.createContext(yQ);function xQ(e=!0){let t=_.useContext(bQ);if(t.setValidityData===Qa&&!e)throw Error(ao(28));return t}var SQ=_.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Qa,validationMode:`onSubmit`,submitCountRef:{current:0}});function CQ(){return _.useContext(SQ)}var wQ=_.createContext({controlId:void 0,registerControlId:Qa,resetControlId:Qa,labelId:void 0,setLabelId:Qa,messageIds:[],setMessageIds:Qa,getDescriptionProps:e=>e});function TQ(){return _.useContext(wQ)}function EQ(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=TQ(),o=qH(),s=ro(()=>Symbol()),c=_.useRef(!1),l=_.useRef(!1),u=J(()=>{c.current&&i!==Qa&&(c.current=!1,i(s.current,void 0))});return q(()=>{if(!n||i===Qa){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),q(()=>u,[u]),(n?r:void 0)??t??o}var DQ={inputValue:()=>null,value:()=>null,...vQ},OQ=`零〇一二三四五六七八九`,kQ=/[٠-٩۰-۹0-9]/g,AQ=/[零〇一二三四五六七八九]/g,jQ=[`%`,`٪`,`%`,`﹪`],MQ=[`‰`,`؉`],NQ=/[%٪%﹪]/,PQ=/[‰؉]/,FQ=/[%٪%﹪]/g,IQ=/[‰؉]/g,LQ=/[٠-٩۰-۹]/,RQ=/[零〇一二三四五六七八九]/,zQ=/[0-9٠-٩۰-۹0-9零〇一二三四五六七八九]/;function BQ(e){return zQ.test(e)}var VQ=[`.`,`,`,`.`,`,`,`٫`,`٬`],HQ=/\p{Zs}/u,UQ=/\p{Cf}/u,WQ=/\p{Cf}/gu,GQ=[`+`,`+`,`﹢`],KQ=[`-`,`−`,`-`,`‒`,`–`,`—`,`﹣`],qQ=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function JQ(e,t){let[n,r=`0`]=String(e).split(`e`);return Number(`${n}e${Number(r)+t}`)}var YQ=/[-−-‒–—﹣]/gu,XQ=/[++﹢]/gu,ZQ=/[-−-‒–—﹣]/,QQ=/[++﹢]/,$Q=11111.1;function e$(e,t){return uQ(e,t).formatToParts($Q)}function t$(e,t){let n=e$(e,t),r={};n.forEach(e=>{r[e.type]=e.value});let i=`.`;return uQ(e).formatToParts(.1).forEach(e=>{e.type===`decimal`&&(i=e.value)}),{...r,decimal:i}}function n$(e,t,n){let r=e.replace(WQ,``).trim();r=r.replace(YQ,`-`).replace(XQ,`+`);let i=!1,a=(e,t)=>(t===`-`&&(i=!0),``);r=r.replace(/([+-])\s*$/,a).replace(/^\s*([+-])/,a);let o=t;o===void 0&&(LQ.test(r)?o=`ar`:RQ.test(r)&&(o=`zh`));let{group:s,decimal:c,currency:l,exponentSeparator:u}=t$(o,n),d=uQ(o,n).formatToParts(1).filter(e=>e.type===`unit`).map(e=>qQ(e.value)),f=d.length?new RegExp(d.join(`|`),`g`):null,p=null;s&&(p=/\p{Zs}/u.test(s)?/\p{Zs}/gu:s===`'`||s===`’`?/['’]/g:new RegExp(qQ(s),`g`));let m=[[p,``],[new RegExp(qQ(c),`g`),`.`],[/[.٫]/g,`.`],[/[,٬]/g,``],[l?new RegExp(qQ(l),`g`):null,``],[f,``],[FQ,``],[IQ,``],[u?new RegExp(qQ(u),`g`):null,`e`],[kQ,e=>String(e.charCodeAt(0)%16)],[AQ,e=>String(Math.max(OQ.indexOf(e)-1,0))]].reduce((e,[t,n])=>t?e.replace(t,n):e,r),h=m.lastIndexOf(`.`);if(h!==-1&&(m=`${m.slice(0,h).replace(/\./g,``)}.${m.slice(h+1).replace(/\./g,``)}`),/^[-+]?Infinity$/i.test(r)||r.includes(`∞`))return null;let g=(i?`-`:``)+m,_=parseFloat(g),v=n?.style,y=v===`unit`&&n?.unit===`percent`,b=NQ.test(e)||v===`percent`;return PQ.test(e)?_=JQ(_,-3):!y&&b&&(_=JQ(_,-2)),Number.isFinite(_)?_:null}var r$=1e-10,i$=1e-10;function a$(e){return e?.maximumFractionDigits!=null||e?.minimumFractionDigits!=null||e?.maximumSignificantDigits!=null||e?.minimumSignificantDigits!=null||e?.roundingIncrement!=null||e?.roundingMode!=null||e?.roundingPriority!=null}function o$(e,t){if(!Number.isFinite(e))return e;if(!a$(t)){let t=parseFloat(e.toPrecision(15));return Math.abs(t-e)<=Math.min(2**-52*Math.max(1,Math.abs(e)),i$)?t:e}let n=uQ(`en-US`,{...t,signDisplay:`auto`,currencySign:`standard`,notation:t.notation===`compact`?`standard`:t.notation,useGrouping:!1}),r=n.format(e),i=n$(r,`en-US`,t);return i===null?e:n.format(i)===r?i:e}function s$(e,t,n,r){let i=Math.abs(n),a=Math.sign(n),o=i*r$*a,s=e-t+o;return r?t+Math.round(s/n)*n:t+(a>0?Math.floor(s/i):Math.ceil(s/i))*i}function c$(e,t,n,r,i,a,o,s,c){if(e===null)return e;let l=e;if(t!=null&&o&&t!==0&&(l=s$(l,s||n===-(2**53-1)?i:n,t,s)),c&&(l=Ru(l,n,r)),t==null&&!a$(a))return l;let u=o$(l,a);return c?Ru(u,n,r):u}var l$=_.forwardRef(function(e,t){let{id:n,min:r,max:i,smallStep:a=.1,step:o=1,largeStep:s=10,required:c=!1,disabled:l=!1,readOnly:u=!1,form:d,name:f,defaultValue:p=null,value:m,onValueChange:h,onValueCommitted:g,allowWheelScrub:v=!1,snapOnStep:y=!1,allowOutOfRange:b=!1,format:x,locale:S,render:C,className:w,inputRef:T,style:E,...D}=e,{setDirty:O,validityData:k,disabled:A,setFilled:j,name:M,state:N,validation:P}=xQ(),{clearErrors:F}=CQ(),I=A||l,L=M??f,R=o===`any`?1:o,[z,B]=_.useState(!1),V=r??-(2**53-1),ee=i??2**53-1,te=r??0,ne=x?.style,re=_.useRef(null),H=zl(T,P.inputRef),U=EQ({id:n}),[ie,ae]=IK({controlled:m,default:p,name:`NumberField`,state:`value`}),oe=nf(ie);q(()=>{j(ie!==null)},[j,ie]);let W=os(),se=nf(x),ce=_.useRef(!1),le=J((e,t)=>{ce.current=!1,g?.(e,t)}),ue=_.useRef(!0),de=_.useRef(null),[fe,pe]=_.useState(()=>dQ(ie,S,x)),[me,he]=_.useState(`numeric`),ge=J(()=>{let e=e$(S,x),t=new Set(VQ),n=e=>e.forEach(e=>t.add(e)),r=e.find(e=>e.type===`decimal`)?.value??t$(S,x).decimal;t.add(r),e.forEach(e=>{e.type!==`integer`&&e.type!==`fraction`&&e.type!==`exponentInteger`&&e.type!==`compact`&&(n(Array.from(e.value)),HQ.test(e.value)&&t.add(` `))});let i=ne===`percent`||ne===`unit`&&x?.unit===`percent`,a=ne===`percent`||ne===`unit`&&x?.unit===`permille`;return i&&n(jQ),a&&n(MQ),n(GQ),(V<0||b)&&n(KQ),t}),_e=J(e=>e?.altKey?a:e?.shiftKey?s:R),ve=J((e,t)=>{let n=t.event,r=t.direction,i=t.reason.startsWith(`input-`)||t.reason===`none`,a=!b||!i,o=c$(e,r?_e(n)*r:void 0,V,ee,te,se.current,y,n?.altKey??!1,a),s=o!==ie||i&&(e!==ie||ue.current===!1);if(s){if(h?.(o,t),t.isCanceled)return!1;ae(o),O(o!==k.initialValue),ce.current=!0}return de.current=o,ue.current&&pe(dQ(o,S,x)),W(),s}),ye=J((e,{direction:t,currentValue:n,event:r,reason:i})=>{let a=n??oe.current,o=r;return typeof a==`number`?ve(a+e*t,bd(i,o,void 0,{direction:t})):ve(0,bd(i,o))});q(function(){if(!ue.current)return;let e=dQ(ie,S,x);e!==fe&&pe(e)}),q(function(){if(!Ts)return;let e=`text`;V>=0&&(e=`decimal`),he(e)},[V]);let G=J(()=>{let e=re.current;if(!e)return;let t=e.value.length;e.setSelectionRange(t,t),e.focus()});_.useEffect(function(){let e=re.current;if(I||u||!v||!e)return;function t(e){if(e.ctrlKey||Ps(is(re.current))!==re.current)return;let t=Math.abs(e.deltaX)>Math.abs(e.deltaY),n=e.shiftKey&&t?e.deltaX:e.deltaY;if(n===0||!e.shiftKey&&t)return;e.preventDefault(),ue.current=!0;let r=_e(e);ye(r,{direction:n>0?-1:1,event:e,reason:`wheel`})&&le(de.current,xd(Bd,e))}return as(e,`wheel`,t)},[v,ye,I,u,_e,le,de,oe]);let be=_.useMemo(()=>({...N,disabled:I,readOnly:u,required:c,value:ie,inputValue:fe,scrubbing:z}),[N,I,u,c,ie,fe,z]),xe=_.useMemo(()=>({inputRef:re,focusInput:G,minWithDefault:V,maxWithDefault:ee,id:U,setValue:ve,incrementValue:ye,getStepAmount:_e,allowInputSyncRef:ue,formatOptionsRef:se,valueRef:oe,lastChangedValueRef:de,hasPendingCommitRef:ce,name:L,nameProp:f,inputMode:me,getAllowedNonNumericKeys:ge,min:r,max:i,setInputValue:pe,locale:S,setIsScrubbing:B,state:be,onValueCommitted:le}),[re,G,V,ee,U,ve,ye,_e,se,oe,L,f,me,ge,r,i,pe,S,be,le]),Se=uu(`div`,e,{ref:t,state:be,props:D,stateAttributesMapping:DQ});return(0,Z.jsxs)(fQ.Provider,{value:xe,children:[Se,(0,Z.jsx)(`input`,{...P.getValidationProps(I,{onFocus(){G()},onChange(e){if(e.nativeEvent.defaultPrevented||I||u)return;let t=e.currentTarget.valueAsNumber,n=Number.isNaN(t)?null:t,r=bd(Sd,e.nativeEvent);ve(n,r),F(L),P.change(de.current??n)}}),ref:H,type:`number`,form:d,name:L,value:ie??``,min:r,max:i,step:o,disabled:I,readOnly:u,required:c,"aria-hidden":!0,tabIndex:-1,style:L?Ll:Il,suppressHydrationWarning:!0})]})});function u$(e){return e===`touch`||e===`pen`}function d$(e,t,n){let{setFocused:r,focusOwnerRef:i}=xQ(),a=J(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return q(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function f$(e,t,n,r,i=!0,a){let{registerFieldControl:o}=xQ(),s=ro(()=>Symbol());q(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),q(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var p$=new Set([`Backspace`,`Delete`,`ArrowLeft`,`ArrowRight`,`Tab`,`Enter`,`Escape`]),m$=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{allowInputSyncRef:o,formatOptionsRef:s,getAllowedNonNumericKeys:c,getStepAmount:l,id:u,incrementValue:d,inputMode:f,max:p,min:m,name:h,nameProp:g,setValue:v,state:y,setInputValue:b,locale:x,inputRef:S,onValueCommitted:C,lastChangedValueRef:w,hasPendingCommitRef:T,valueRef:E}=pQ(),{disabled:D,readOnly:O,required:k,value:A,inputValue:j}=y,{clearErrors:M}=CQ(),{validationMode:N,setTouched:P,invalid:F,shouldValidateOnChange:I,validation:L}=xQ(),{labelId:R}=TQ(),z=d$(D,S),B=_.useRef(!1),V=_.useRef(null);return f$(S,u,A,void 0,!D,g),q(()=>{if(V.current!=null){let e=V.current;V.current=null,S.current?.setSelectionRange(e,e)}}),XH(A,()=>{M(h),B.current&&!I()?B.current=!1:L.change(A)}),uu(`input`,e,{ref:[t,S],state:y,props:[{id:u,required:k,disabled:D,readOnly:O,inputMode:f,value:j,type:`text`,autoComplete:`off`,autoCorrect:`off`,spellCheck:`false`,"aria-roledescription":`Number field`,"aria-invalid":!D&&F?!0:void 0,"aria-labelledby":R,suppressHydrationWarning:!0,onFocus(e){e.defaultPrevented||D||z(!0)},onBlur(e){if(e.defaultPrevented||D||(P(!0),z(!1),O))return;let t=!o.current,n=T.current;if(o.current=!0,j.trim()===``){let r=bd(jd,e.nativeEvent);if(v(null,r),r.isCanceled)return;N===`onBlur`&&L.commit(null),(t||n||A!==null)&&C(null,xd(jd,e.nativeEvent));return}let r=s.current,i=n$(j,x,r);if(i===null)return;let a=a$(r),c;c=!t&&!a?A:a?o$(i,r):i;let l=xd(Md,e.nativeEvent),u=A!==c,d=t||u||n,f=c;if(u){let t=bd(Md,e.nativeEvent);if(B.current=!0,v(c,t),t.isCanceled){B.current=!1;return}f=w.current,f===A&&(B.current=!1)}N===`onBlur`&&L.commit(f),d&&C(f,l);let p=dQ(f,x,r);j!==p&&b(p)},onChange(e){if(e.nativeEvent.defaultPrevented)return;o.current=!1;let t=e.currentTarget.value;if(t.trim()===``){b(t),v(null,bd(jd,e.nativeEvent));return}let n=c();if(!Array.from(t).every(e=>BQ(e)||ZQ.test(e)||n.has(e)||UQ.test(e)))return;let r=n$(t,x,s.current);b(t),r!==null&&v(r,bd(Ad,e.nativeEvent))},onKeyDown(e){if(e.defaultPrevented||O||D)return;let t=e.nativeEvent,n=!o.current,r=c(),i=r.has(e.key),{decimal:a,currency:u,percentSign:f}=t$(x,s.current),h=e.currentTarget.selectionStart,g=e.currentTarget.selectionEnd,_=h===0&&g===j.length,y=e=>h!=null&&g!=null&&e>=h&&e<g;[[ZQ,YQ],[QQ,XQ]].forEach(([t,n])=>{if(t.test(e.key)&&Array.from(r).some(e=>t.test(e))){let e=j.search(n),t=e!==-1&&y(e);i=!(ZQ.test(j)||QQ.test(j))||_||t}}),[a,u,f].forEach(t=>{if(e.key===t){let e=j.indexOf(t),n=y(e);i=e===-1||_||n}});let b=p$.has(e.key),S=e.key===`ArrowUp`||e.key===`ArrowDown`;if(e.which===229||e.altKey&&!S||e.ctrlKey||e.metaKey||i||BQ(e.key)||b)return;let T=null;if(e.key===`Home`&&m!=null?T=m:e.key===`End`&&p!=null&&(T=p),e.key.length>1&&!S&&T===null)return;let k=n?n$(j,x,s.current):null,A=l(e);e.preventDefault(),e.stopPropagation();let M=xd(Ld,t),N=!1;(S||T!==null)&&(o.current=!0),S?(n||(w.current=E.current),N=d(A,{direction:e.key===`ArrowUp`?1:-1,currentValue:k,event:t,reason:Ld})):T!==null&&(N=v(T,bd(Ld,t))),N&&C(w.current,M)},onPaste(e){if(e.defaultPrevented||O||D)return;let t=``;try{t=e.clipboardData?.getData(`text/plain`)??``}catch{return}e.preventDefault();let n=e.currentTarget,r=n.selectionStart,i=n.selectionEnd,a=j.slice(0,r)+t+j.slice(i),c=n$(a,x,s.current);c!==null&&(o.current=!1,V.current=r+t.length,v(c,bd(Nd,e.nativeEvent)),b(a))}},a,e=>L.getValidationProps(D,e)],stateAttributesMapping:DQ})}),h$=_.createContext(void 0);function g$(){let e=_.useContext(h$);if(e===void 0)throw Error(ao(44));return e}function _$(e,t){let n=Y(t);if(e!=null){let n=t.getBoundingClientRect();return{left:n.left-e/2,top:n.top-e/2,right:n.right+e/2,bottom:n.bottom+e/2}}let r=n.visualViewport;return r?{left:r.offsetLeft,top:r.offsetTop,right:r.offsetLeft+r.width,bottom:r.offsetTop+r.height}:{left:0,top:0,right:n.document.documentElement.clientWidth,bottom:n.document.documentElement.clientHeight}}var v$={touchAction:`none`,WebkitUserSelect:`none`,userSelect:`none`},y$=_.forwardRef(function(e,t){let{render:n,className:r,direction:i=`horizontal`,pixelSensitivity:a=2,teleportDistance:o,style:s,...c}=e,{state:l,setIsScrubbing:u,inputRef:d,focusInput:f,incrementValue:p,allowInputSyncRef:m,getStepAmount:h,onValueCommitted:g,lastChangedValueRef:v,valueRef:y}=pQ(),{disabled:b,readOnly:x}=l,S=_.useRef(null),C=_.useRef(!1),w=_.useRef(!1),T=_.useRef(null),E=_.useRef(!1),D=_.useRef(null),O=_.useRef({x:0,y:0}),k=ps(),A=ps(),[j,M]=_.useState(!1),[N,P]=_.useState(!1),[F,I]=_.useState(!1);function L(e,t,n){let r=Y(e).visualViewport?.scale??1;e.style.transform=`translate3d(${t}px,${n}px,0) scale(${1/r})`}let R=J(({movementX:e,movementY:t})=>{let n=D.current,r=S.current;if(!n||!r)return;let i=_$(o,r),a=O.current,s=(e,t,n,r)=>e+t<n?r-t:e+t>r?n-t:e,c={x:s(Math.round(a.x+e),n.offsetWidth/2,i.left,i.right),y:s(Math.round(a.y+t),n.offsetHeight/2,i.top,i.bottom)};O.current=c,L(n,c.x,c.y)}),z=J((e,{clientX:t,clientY:n})=>{wu.flushSync(()=>{I(e),u(e)});let r=D.current;if(!r||!e)return;let i={x:t-r.offsetWidth/2,y:n-r.offsetHeight/2};O.current=i,L(r,i.x,i.y)});_.useEffect(function(){if(!d.current||b||x||!F)return;let e=0;function t(e){function t(){try{is(S.current).exitPointerLock()}catch{}finally{C.current=!1,z(!1,e),g(v.current??y.current,xd(Vd,e));let t=T.current,n=d.current;if(!w.current&&t!=null&&n){let e=Y(n).MouseEvent;A.start(0,()=>{E.current||t.dispatchEvent(new e(`click`,{bubbles:!0,cancelable:!0}))})}w.current=!1,T.current=null}}js?k.start(20,t):t()}function n(t){if(!C.current)return;t.preventDefault(),R(t);let{movementX:n,movementY:r}=t;if(e+=i===`vertical`?r:n,Math.abs(e)>=a){e=0,w.current=!0;let a=(i===`vertical`?-r:n)*h(t);a!==0&&(m.current=!0,p(Math.abs(a),{direction:a>=0?1:-1,event:t,reason:Vd}))}}let r=Y(d.current),o=rs(as(r,`pointerup`,t,!0),as(r,`pointermove`,n,!0));return()=>{k.clear(),o()}},[b,x,m,p,F,h,d,z,R,i,a,v,g,y,k,A]),_.useEffect(()=>()=>{if(C.current){C.current=!1,u(!1);try{is(S.current).exitPointerLock()}catch{}}},[u]),_.useEffect(function(){let e=S.current;if(!e||b||x)return;function t(e){e.touches.length===1&&e.preventDefault()}return as(e,`touchstart`,t)},[b,x]);let B=uu(`span`,e,{ref:[t,S],state:l,props:[{role:`presentation`,style:v$,onClickCapture(){E.current=!0},async onPointerDown(e){if(e.defaultPrevented||x||e.button||b)return;let t=e.pointerType===`touch`;if(M(t),e.pointerType===`mouse`&&(e.preventDefault(),f()),C.current=!0,w.current=!1,E.current=!1,A.clear(),T.current=Is(e.nativeEvent),z(!0,e.nativeEvent),!t&&!As)try{await is(S.current).body.requestPointerLock(),P(!1)}catch{P(!0)}finally{C.current&&z(!0,e.nativeEvent)}}},c],stateAttributesMapping:DQ}),V=_.useMemo(()=>({isScrubbing:F,isTouchInput:j,isPointerLockDenied:N,scrubAreaCursorRef:D}),[F,j,N]);return(0,Z.jsx)(h$.Provider,{value:V,children:B})}),b$={position:`fixed`,top:0,left:0,pointerEvents:`none`},x$=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=pQ(),{isScrubbing:s,isTouchInput:c,isPointerLockDenied:l,scrubAreaCursorRef:u}=g$(),[d,f]=_.useState(null),p=uu(`span`,e,{enabled:s&&!As&&!c&&!l,ref:[t,u,f],state:o,props:[{role:`presentation`,style:b$},a],stateAttributesMapping:DQ});return p&&wu.createPortal(p,is(d).body)}),S$=new Set([`ArrowUp`,`ArrowDown`]),C$=`group-has-[[data-scrub]:hover]/number:bg-foreground/10 group-has-[[data-scrub]:hover]/number:text-foreground group-data-[scrubbing]/number:bg-foreground/10 group-data-[scrubbing]/number:text-foreground`,w$=`group-has-[[data-scrub]:hover]/number:text-foreground group-data-[scrubbing]/number:text-foreground`;function T$({label:e,caption:t,prefix:n,inset:r=`pl-[26px]`,scrubValue:i=!1,className:a,inputClassName:o,value:s,empty:c=`Mixed`,step:l=1,min:u,max:d,format:f,disabled:p,onPreview:m,onCommit:h}){let[g,v]=(0,_.useState)(null),y=(0,_.useRef)(null),[b,x]=(0,_.useState)(null);b&&b.over!==s&&x(null);let S=b?.over===s?b.value:null,C=(0,_.useRef)(null),w=e=>{!y.current&&e&&(C.current=S??s),y.current=e,v(e)},T=(0,_.useRef)(!1),E=(0,_.useRef)(!1),D=(0,_.useRef)(!1),O=e=>Math.min(d??1/0,Math.max(u??-1/0,e)),k=({value:e,offset:t})=>t?t=>O(t+e):()=>O(e),A=e=>{e.value!==null&&m?.(k({value:e.value,offset:e.offset}))},j=()=>{y.current&&m?.(null),w(null),T.current&&(E.current=!0)},M=()=>{let e=y.current;if(!e)return;w(null);let t=e.offset?e.value===0:e.value===C.current;if(e.value===null||t){m?.(null);return}let n=k({value:e.value,offset:e.offset});s!==null&&!e.offset&&x({value:O(e.value),over:s}),Promise.resolve(h(n)).then(e=>{e===!1&&(x(null),m?.(null))})},N=e=>{let t=(e.shiftKey?l*10:l)*(e.key===`ArrowUp`?1:-1),n=y.current,r=S??s,i=n?.value==null?r===null?{offset:!0,value:t}:{offset:!1,value:O(r+t)}:{offset:n.offset,value:n.offset?n.value+t:O(n.value+t)};w(i),A(i)},P=e=>{if(S$.has(e.key)&&(e.preventDefault(),e.stopPropagation(),N(e)),e.key===`Enter`){M();let t=e.currentTarget;t.blur(),t.focus()}e.key===`Escape`&&(j(),D.current=!0,e.currentTarget.blur())},F=e=>{p||e.button!==0||(T.current=!0,E.current=!1,s===null&&!y.current&&w({value:0,offset:!0}))},I=(0,_.useMemo)(()=>({useGrouping:!1,...f,...g?.offset?{signDisplay:`exceptZero`}:{}}),[g?.offset,f]),L=(0,Z.jsx)(m$,{"aria-label":e,placeholder:s===null?c:void 0,className:Q(`h-[26px] w-full min-w-0 rounded-md border-0 bg-input px-2 text-xs text-foreground tabular-nums outline-none placeholder:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,n?r:void 0,i&&`cursor-ew-resize`,i&&!p&&C$,o),onFocus:e=>e.currentTarget.select(),onChange:e=>{OH(e)&&e.preventBaseUIHandler()},onKeyDown:P,onKeyUp:e=>{S$.has(e.key)&&M()},onBlur:()=>{D.current?D.current=!1:M()}});return(0,Z.jsxs)(l$,{className:Q(`group/number block`,a),value:g?g.value:S??s,step:l,largeStep:l*10,min:u,max:d,format:I,disabled:p,onValueChange:(e,t)=>{if(t.reason===`scrub`){if(E.current)return;let t={value:e,offset:s===null};w(t),A(t)}else(t.reason===`input-change`||t.reason===`input-clear`||t.reason===`input-paste`)&&w({value:e,offset:!1})},onValueCommitted:(e,t)=>{t.reason===`scrub`&&(T.current=!1,E.current?E.current=!1:M())},children:[t?(0,Z.jsxs)(y$,{"aria-hidden":!0,"data-scrub":!0,className:Q(`mb-[3px] ml-0.5 block w-max cursor-ew-resize text-(length:--text-caption) font-normal text-muted-foreground select-none`,!p&&w$),onPointerDown:F,children:[t,(0,Z.jsx)(E$,{})]}):null,(t=>n&&typeof n!=`string`?(0,Z.jsx)(YX,{label:e,children:t}):t)((0,Z.jsxs)(`div`,{className:`relative`,children:[n?(0,Z.jsxs)(y$,{"aria-hidden":!0,"data-scrub":!0,className:Q(`absolute inset-y-0 left-0 flex min-w-6 cursor-ew-resize items-center justify-center rounded-l-md px-1.5 text-xs text-muted-foreground select-none`,!p&&C$),onPointerDown:F,children:[n,(0,Z.jsx)(E$,{})]}):null,i?(0,Z.jsxs)(y$,{"data-scrub":!0,className:`block`,onPointerDown:F,children:[L,(0,Z.jsx)(E$,{})]}):L]}))]})}function E$(){return(0,Z.jsx)(x$,{className:`z-50`,children:(0,Z.jsx)(Or,{"aria-hidden":!0,className:`-mt-2 -ml-2 size-4 text-foreground drop-shadow-[0_0_1px_var(--background)]`})})}var D$={style:`unit`,unit:`degree`,unitDisplay:`narrow`,maximumFractionDigits:2};function O$(e){let t=(e%360+360)%360;return Math.round((t>180?t-360:t)*100)/100}function k$(e,{rotate:t}){return t===e?``:`${e}deg`}function A$(e,t,{scale:n}){let r=t===`x`?-e.x:e.x,i=t===`y`?-e.y:e.y;return n?.x===r&&n.y===i?``:`${r} ${i}`}function j$(){return(0,Z.jsxs)(`svg`,{"aria-hidden":!0,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,className:`size-3`,children:[(0,Z.jsx)(`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`}),(0,Z.jsx)(`path`,{d:`M3 11a10 10 0 0 1 10 10`})]})}function M$({degrees:e,scale:t,translated:n}){return n?`Its transform moves it, so a rotation would swing it away`:e===null||t===null?`A 3D rotate or scale has no rotation here`:null}function N$({rotation:e,disabled:t,write:n,preview:r}){let{degrees:i,scale:a,own:o}=e,s=M$(e),c=t||s!==null,l=i??0,u=e=>n({kind:`style`,property:`rotate`,value:k$(e,o)}),d=[{label:`Rotate 90°`,icon:ei,press:()=>void u(O$(l+90))},...[`x`,`y`].map(e=>({label:e===`x`?`Flip horizontal`:`Flip vertical`,icon:e===`x`?Ji:Ki,press:()=>void n({kind:`style`,property:`scale`,value:A$(a??{x:1,y:1},e,o)})}))];return(0,Z.jsxs)(Z.Fragment,{children:[s?(0,Z.jsx)(`span`,{id:`inspector-rotation-lock`,className:`sr-only`,children:s}):null,(0,Z.jsxs)(`div`,{className:`mt-1.5 grid grid-cols-2 items-end gap-1.5`,children:[(0,Z.jsx)(T$,{label:`Rotation`,caption:`Rotation`,prefix:(0,Z.jsx)(j$,{}),inset:`pl-[28px]`,value:i,empty:`3D`,format:D$,disabled:c,onPreview:e=>r?.(`rotate`,e?`${e(l)}deg`:null),onCommit:e=>{let t=O$(e(l));return t===l?Promise.resolve(!1):u(t)}}),(0,Z.jsx)(`div`,{role:`group`,"aria-label":`Rotate and flip`,className:`grid grid-cols-3 gap-0.5 rounded-md bg-input p-0.5`,children:d.map(({label:e,icon:n,press:r})=>(0,Z.jsx)(YX,{label:s??e,children:(0,Z.jsx)(`button`,{type:`button`,"aria-label":e,"aria-describedby":s?`inspector-rotation-lock`:void 0,"aria-disabled":s!==null||void 0,disabled:t,onClick:()=>{c||r()},className:Q(`grid h-[22px] place-items-center rounded-[5px] text-muted-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50`,c?`opacity-50`:`hover:text-foreground`),children:(0,Z.jsx)(n,{"aria-hidden":!0,className:`size-[13px]`})})},e))})]})]})}var P$={style:`unit`,unit:`percent`,maximumFractionDigits:0},F$={maximumFractionDigits:0};function I$(){return(0,Z.jsxs)(`svg`,{"aria-hidden":!0,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,className:`size-3`,children:[(0,Z.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8`}),(0,Z.jsx)(`path`,{d:`M12 4a8 8 0 0 1 0 16z`,fill:`currentColor`})]})}function L$(){return(0,Z.jsx)(`svg`,{"aria-hidden":!0,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,className:`size-3`,children:(0,Z.jsx)(`path`,{d:`M4 20V10a6 6 0 0 1 6-6h10`})})}function R$({opacity:e,radius:t,rotation:n,disabled:r,write:i,preview:a}){let o=Math.round(e*100);return(0,Z.jsxs)(`section`,{"aria-labelledby":`inspector-appearance`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,Z.jsx)(`h2`,{id:`inspector-appearance`,className:`mb-2 text-xs font-semibold`,children:`Appearance`}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:[(0,Z.jsx)(T$,{label:`Opacity`,caption:`Opacity`,prefix:(0,Z.jsx)(I$,{}),inset:`pl-[28px]`,value:o,min:0,max:100,format:P$,disabled:r,...bB(`opacity`,o,e=>String(e/100),i,a)}),(0,Z.jsx)(T$,{label:`Corner radius`,caption:`Corner radius`,prefix:(0,Z.jsx)(L$,{}),inset:`pl-[28px]`,value:t,min:0,format:F$,disabled:r,...bB(`border-radius`,t,e=>`${e}px`,i,a)})]}),(0,Z.jsx)(N$,{rotation:n,disabled:r,write:i,preview:a})]})}function z$(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}function B$(e){return e==null?void 0:`${e}-label`}function V$(e,t){return e??t}function H$(e,t){return e-t}function U$(e,t,n,r,i,a){let o=Ru(e,n,r);if(!i)return o;let s=a.slice();return s[t]=Ru(o,a[t-1]??-1/0,a[t+1]??1/0),s.sort(H$)}function W$(e,t,n){if(!Array.isArray(e))return!0;let r=t*n;for(let t=0;t<e.length-1;t+=1)if(!(Math.abs(e[t]-e[t+1])>=r))return!1;return!0}var G$=()=>null,K$={activeThumbIndex:G$,max:G$,min:G$,minStepsBetweenValues:G$,step:G$,values:G$,...vQ},q$=_.createContext(void 0);function J$(){let e=_.useContext(q$);if(e===void 0)throw Error(ao(62));return e}function Y$(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&z$(e,t)}var X$=_.forwardRef(function(e,t){let{"aria-labelledby":n,className:r,defaultValue:i,disabled:a=!1,id:o,format:s,largeStep:c=10,locale:l,render:u,max:d=100,min:f=0,minStepsBetweenValues:p=0,form:m,name:h,onValueChange:g,onValueCommitted:v,orientation:y=`horizontal`,step:b=1,thumbCollisionBehavior:x=`push`,thumbAlignment:S=`center`,value:C,style:w,...T}=e,E=qH(o),D=B$(E),O=J(g),k=J(v),{clearErrors:A}=CQ(),{state:j,disabled:M,name:N,setTouched:P,setDirty:F,validityData:I,validation:L}=xQ(),{labelId:R}=TQ(),[z,B]=_.useState(),V=n??V$(R,z),ee=M||a,te=N??h,[ne,re]=IK({controlled:C,default:i??f,name:`Slider`}),H=_.useRef(null),U=_.useRef(null),ie=_.useRef([]),ae=_.useRef(null),oe=_.useRef(-1),W=_.useRef(null),se=_.useRef(Sd),[ce,le]=_.useState(-1),[ue,de]=_.useState(-1),[fe,pe]=_.useState(!1),[me,he]=_.useState(()=>new Map),[ge,_e]=_.useState([void 0,void 0]),ve=J(e=>{le(e),e!==-1&&de(e)}),ye=J(e=>{e&&(U.current=e)}),G=Array.isArray(ne),be=_.useMemo(()=>G?ne.map(e=>Ru(e,f,d)).sort(H$):[Ru(ne,f,d)],[d,f,G,ne]),xe=G?be:be[0];f$(L.inputRef,E,xe,void 0,!ee,h),XH(xe,()=>{A(te),L.change(xe);let e=I.initialValue,t;t=Array.isArray(xe)&&Array.isArray(e)?!z$(xe,e):xe!==e,F(t)});let Se=J((e,t)=>{if(Number.isNaN(e)||Y$(e,ne))return!1;let n=t.event,r=n.constructor,i=new r(n.type,n);return Object.defineProperty(i,"target",{writable:!0,value:{value:e,name:te}}),t.event=i,O(e,t),!t.isCanceled&&(se.current=t.reason,re(e),!0)}),Ce=J((e,t,n)=>{let r=U$(e,t,f,d,G,be);if(W$(r,b,p)){let e=`key`in n?Ld:Ad,i=Se(r,bd(e,n.nativeEvent,void 0,{activeThumbIndex:t}));P(!0),i&&k(r,xd(e,n.nativeEvent))}});q(()=>{if(!ee)return;let e=Ps(is(H.current));X(H.current,e)&&e.blur(),ce!==-1&&ve(-1)},[ce,ee,ve]);let we=_.useMemo(()=>({...j,activeThumbIndex:ce,disabled:ee,dragging:fe,orientation:y,max:d,min:f,minStepsBetweenValues:p,step:b,values:be}),[j,ce,ee,fe,d,f,p,y,b,be]),Te=_.useMemo(()=>({active:ce,controlRef:U,disabled:ee,dragging:fe,validation:L,format:s,handleInputChange:Ce,indicatorPosition:ge,inset:S!==`center`,isArrayValue:G,labelId:V,rootLabelId:D,largeStep:c,lastUsedThumbIndex:ue,lastChangeReasonRef:se,form:m,locale:l,max:d,min:f,minStepsBetweenValues:p,name:te,onValueCommitted:k,orientation:y,pressedThumbCenterOffsetRef:ae,pressedThumbIndexRef:oe,pressedValuesRef:W,registerFieldControlRef:ye,renderBeforeHydration:S===`edge`,setActive:ve,setDragging:pe,setIndicatorPosition:_e,setLabelId:B,setValue:Se,state:we,step:b,thumbCollisionBehavior:x,thumbMap:me,thumbRefs:ie,values:be}),[ce,V,D,ee,fe,L,s,Ce,ge,c,ue,m,l,d,f,p,te,k,y,G,ye,ve,Se,we,b,x,S,me,be]),Ee=uu(`div`,e,{state:we,ref:[t,H],props:[{"aria-labelledby":V,id:E,role:`group`},T,e=>L.getValidationProps(ee,e)],stateAttributesMapping:K$});return(0,Z.jsx)(q$.Provider,{value:Te,children:(0,Z.jsx)(_q,{elementsRef:ie,onMapChange:he,children:Ee})})});function Z$(e,t){let n=e.getBoundingClientRect();return t?(n.top+n.bottom)/2:(n.left+n.right)/2}function Q$(e){if(e===0)return 0;if(Math.abs(e)<1){let t=e.toExponential().split(`e-`),n=t[0].split(`.`)[1];return(n?n.length:0)+parseInt(t[1],10)}let t=e.toString().split(`.`)[1];return t?t.length:0}function $$(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(Q$(t),Q$(n))))}function e1(e,t,n,r,i,a,o,s){let c=e.slice(),l=a*o,u=c.length-1,d=s??e;c[t]=Ru(n,r+t*l,i-(u-t)*l);for(let e=t+1;e<=u;e+=1){let t=c[e-1]+l,n=i-(u-e)*l,r=d[e],a=Math.max(c[e],t);r<a&&(a=Math.max(r,t)),c[e]=Ru(a,t,n)}for(let e=t-1;e>=0;--e){let t=c[e+1]-l,n=r+e*l,i=d[e],a=Math.min(c[e],t);i>a&&(a=Math.min(i,t)),c[e]=Ru(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function t1(e,t,n,r,i,a,o,s,c,l){let u=n??t,d=r??t;if(!(u.length>1))return{value:a,thumbIndex:0,didSwap:!1};let f=c*l;if(e===`push`)return{value:e1(u,i,a,o,s,c,l),thumbIndex:i,didSwap:!1};let p=u.slice(),m=p[i-1],h=p[i+1],g=m==null?o:m+f,_=h==null?s:h-f,v=Number(Ru(a,g,_).toFixed(12));switch(p[i]=v,e){case`swap`:{let e=u[i],t=1e-7,n=a>e,r=a<e,g=n&&h!=null&&a>=h-t,_=r&&m!=null&&a<=m+t;if(!g&&!_)return{value:p,thumbIndex:i,didSwap:!1};let y=g?i+1:i-1,b=p.map((e,t)=>t===i?v:d[t]??u[t]),x=a;x=g?Math.max(a,p[y]):Math.min(a,p[y]);let S=e1(p,y,x,o,s,c,l,b),C=g?y-1:y+1,w=S[C-1],T=S[C+1],E=w==null?o:w+f;E=Math.max(E,o+C*f);let D=T==null?s:T-f;D=Math.min(D,s-(S.length-1-C)*f);let O=Ru(v,E,D);return S[C]=Number(O.toFixed(12)),{value:S,thumbIndex:y,didSwap:!0}}default:return{value:p,thumbIndex:i,didSwap:!1}}}var n1=2;function r1(e,t){if(!e)return{start:0,end:0};function n(e){let t=e==null?0:parseFloat(e);return Number.isNaN(t)?0:t}let r=t?`Top`:`InlineStart`,i=t?`Bottom`:`InlineEnd`;return{start:n(e[`border${r}Width`])+n(e[`padding${r}`]),end:n(e[`border${i}Width`])+n(e[`padding${i}`])}}function i1(e,t){if(t.current!=null&&e.changedTouches){let n=e;for(let e=0;e<n.changedTouches.length;e+=1){let r=n.changedTouches[e];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return null}return{x:e.clientX,y:e.clientY}}var a1=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{disabled:o,dragging:s,inset:c,isArrayValue:l,lastChangeReasonRef:u,max:d,min:f,minStepsBetweenValues:p,onValueCommitted:m,orientation:h,pressedThumbCenterOffsetRef:g,pressedThumbIndexRef:v,pressedValuesRef:y,registerFieldControlRef:b,renderBeforeHydration:x,setActive:S,setDragging:C,setValue:w,state:T,step:E,thumbCollisionBehavior:D,thumbRefs:O,values:k}=J$(),A=rh(),j=k.length>1,M=h===`vertical`,N=_.useRef(null),P=_.useRef(null),F=J(e=>{e&&P.current==null&&(P.current=Y(e).getComputedStyle(e))}),I=_.useRef(null),L=_.useRef(0),R=_.useRef(0),z=_.useRef(null),B=_.useRef(!1),V=nf(k);function ee(e){return e?.querySelector(`input[type="range"]`)}function te(e){v.current=e,O.current[e]||(g.current=null)}function ne(){v.current=-1,g.current=null}function re(e){return Lo(e)?O.current.some(t=>!Lo(t)||!X(t,e)?!1:ee(t)?.disabled===!0):!1}function H(e){let t=N.current,n=v.current;if(!t||n<0||n>=k.length)return n>=k.length&&(z.current=null),null;let{width:r,height:i,bottom:a,left:o,right:s}=t.getBoundingClientRect(),c=r1(P.current,M),u=R.current,m=(M?i:r)-c.start-c.end-u*2,h=g.current??0,_=e.x-h,b=e.y-h,x=Ru(((M?a-b-c.end:(A===`rtl`?s-_:_-o)-c.start)-u)/m,0,1),S=(d-f)*x+f;return S=$$(S,E,f),S=Ru(S,f,d),j?t1(D,k,V.current,y.current,n,S,f,d,E,p):{value:l?[S]:S,thumbIndex:n,didSwap:!1}}function U(e){y.current=j?k.slice():null,z.current=null,V.current=k;let t=v.current,n=t;if(t>-1&&t<k.length){if(k[t]===d){let e=t;for(;e>0&&k[e-1]===d;)--e;n=e}}else{let t=M?`y`:`x`,r;n=-1;for(let i=0;i<O.current.length;i+=1){let a=O.current[i];if(Lo(a)&&!ee(a)?.disabled){let o=Z$(a,M),s=Math.abs(e[t]-o);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&te(n),c){let e=O.current[n];if(Lo(e)){let t=e.getBoundingClientRect();R.current=t[M?`height`:`width`]/2}}}function ie(e){let t=ee(O.current?.[e]);t&&t.focus({preventScroll:!0,focusVisible:!1})}function ae(e,t,n){let r=w(e.value,bd(t,n,void 0,{activeThumbIndex:e.thumbIndex}));return r&&(z.current=e.value,V.current=Array.isArray(e.value)?e.value:[e.value],e.didSwap&&(te(e.thumbIndex),ie(e.thumbIndex))),r}let oe=J(e=>{let t=i1(e,I);if(t==null)return;if(L.current+=1,e.type===`pointermove`&&e.buttons===0){W(e);return}let n=H(t);n!=null&&W$(n.value,E,p)&&(!s&&L.current>n1&&C(!0),ae(n,zd,e))}),W=J(e=>{if(i1(e,I)==null)return;S(-1),C(!1),g.current=null;let t=z.current;if(Array.isArray(t)&&t.length!==k.length&&(z.current=null),z.current!=null){let t=u.current;m(z.current,xd(t,e))}`pointerType`in e&&N.current?.hasPointerCapture(e.pointerId)&&N.current?.releasePointerCapture(e.pointerId),v.current=-1,le()}),se=J(e=>{I.current??W(e)}),ce=J(e=>{let t=B.current;if(B.current=!1,o)return;if(re(Is(e))){ne();return}let n=e.changedTouches[0];if(n==null)return;if(I.current=n.identifier,!t){let t={x:n.clientX,y:n.clientY};U(t);let r=H(t);if(r==null)return;ie(r.thumbIndex),ae(r,kd,e),L.current=0}let r=is(N.current);r.addEventListener(`touchmove`,oe,{passive:!0}),r.addEventListener(`touchend`,W,{passive:!0}),r.addEventListener(`touchcancel`,W,{passive:!0})}),le=J(()=>{let e=is(N.current);e.removeEventListener(`pointermove`,oe),e.removeEventListener(`pointerup`,W),e.removeEventListener(`pointercancel`,se),e.removeEventListener(`touchmove`,oe),e.removeEventListener(`touchend`,W),e.removeEventListener(`touchcancel`,W),I.current=null,y.current=null,z.current=null,B.current=!1}),ue=us();return _.useEffect(()=>{let e=N.current;if(!e)return()=>le();let t=as(e,`touchstart`,ce,{passive:!0});return()=>{t(),ue.cancel(),le()}},[le,ce,N,ue]),_.useEffect(()=>{o&&le()},[o,le]),uu(`div`,e,{state:T,ref:[t,b,N,F],props:[{"data-base-ui-slider-control":x?``:void 0,onPointerDown(e){B.current=!1;let t=N.current,n=Is(e.nativeEvent);if(!t||o||e.defaultPrevented||!Lo(n)||e.button!==0)return;if(re(n)){ne();return}let r={x:e.clientX,y:e.clientY};U(r);let i=H(r);if(i==null)return;X(O.current[i.thumbIndex],Ps(is(t)))?e.preventDefault():ue.request(()=>{ie(i.thumbIndex)}),C(!0),g.current??ae(i,kd,e.nativeEvent),e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),L.current=0,B.current=u$(e.pointerType);let a=is(t);a.addEventListener(`pointermove`,oe,{passive:!0}),a.addEventListener(`pointerup`,W,{once:!0}),a.addEventListener(`pointercancel`,se,{once:!0})}},a],stateAttributesMapping:K$})}),o1=_.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=J$();return uu(`div`,e,{state:o,ref:t,props:[{style:{position:`relative`}},a],stateAttributesMapping:K$})}),s1=()=>()=>{},c1=()=>!0,l1=()=>!1;function u1(){return(0,fa.useSyncExternalStore)(s1,c1,l1)}function d1(){let[e,t]=_.useState(!1);return _.useEffect(()=>{t(!0)},[]),e}var f1=fo(18)?u1:d1;function p1(){return!f1()}function m1(e,t,n){return(e-t)*100/(n-t)}var h1=_.createContext(void 0),g1={disableStyleElements:!1};function _1(){return _.useContext(h1)??g1}function v1(e){let{script:t}=e,{nonce:n}=_1();return p1()?(0,Z.jsx)(`script`,{nonce:n,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0}):null}var y1=`data-index`,b1,x1=new Set([...OU,EU,DU]);function S1(e,t,n,r){if(!(t<0))return e.length===2?`${dQ(e[t],r,n)} ${t===0?`start`:`end`} range`:n?dQ(e[t],r,n):void 0}function sre(e,t,n,r,i){let a=e+t*n;return Ru(Number(a.toFixed(Math.max(Q$(e),Q$(t),Q$(r)))),r,i)}var C1=_.forwardRef(function(e,t){let{render:n,children:r,className:i,"aria-describedby":a,"aria-label":o,"aria-labelledby":s,"aria-valuetext":c,disabled:l=!1,getAriaLabel:u,getAriaValueText:d,id:f,index:p,inputRef:m,onBlur:h,onFocus:g,onKeyDown:v,tabIndex:y,style:b,...x}=e,S=qH(f),{active:C,lastUsedThumbIndex:w,controlRef:T,disabled:E,validation:D,format:O,handleInputChange:k,inset:A,isArrayValue:j,labelId:M,largeStep:N,locale:P,max:F,min:I,minStepsBetweenValues:L,form:R,name:z,orientation:B,pressedThumbCenterOffsetRef:V,pressedThumbIndexRef:ee,renderBeforeHydration:te,setActive:ne,setIndicatorPosition:re,state:H,step:U,thumbRefs:ie,values:ae}=J$(),oe=rh(),W=l||E,se=ae.length>1,ce=B===`vertical`,le=oe===`rtl`,{setTouched:ue,validationMode:de}=xQ(),fe=_.useRef(null),pe=_.useRef(null),me=d$(W,pe),he=_.useRef(!1),ge=J(e=>{he.current||g?.(e)}),_e=J(e=>{he.current||h?.(e)}),ve=qH(),ye=EQ(),G=se?ve:ye,{ref:be,index:xe}=JK({metadata:_.useMemo(()=>({inputId:G}),[G])}),Se=se?p??xe:0,Ce=Se===ae.length-1,we=ae[Se],Te=m1(we,I,F),[Ee,De]=_.useState(),Oe=p1(),ke=w>=0&&w<ae.length?w:-1,Ae=J(()=>{let e=T.current,t=fe.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=ce?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*Te/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;De(s),Se===0?re(e=>[s,e[1]]):Ce&&re(e=>[e[0],s])});q(()=>{A&&queueMicrotask(Ae)},[Ae,A]),q(()=>{A&&Ae()},[Ae,A,Te]),q(()=>{if(!A)return;let e=T.current,t=fe.current;if(!e||!t)return;let n=Y(e).ResizeObserver;if(typeof n!=`function`)return;let r=new n(Ae);return r.observe(e),r.observe(t),()=>{r.disconnect()}},[T,Ae,A]);let je=ce?`bottom`:`insetInlineStart`,Me=ce?`left`:`top`,Ne;se?C===Se?Ne=2:ke===Se&&(Ne=1):C===Se&&(Ne=1);let Pe;Pe=!A&&!Number.isFinite(Te)?Il:{position:`absolute`,[je]:A?`var(--position)`:`${Te}%`,[Me]:`50%`,translate:`${(ce||!le?-1:1)*50}% ${(ce?1:-1)*50}%`,zIndex:Ne,...A&&{"--position":`${Ee??0}%`,visibility:te&&Oe||Ee===void 0?`hidden`:void 0}};let Fe;ce&&(Fe=le?`vertical-rl`:`vertical-lr`);let Ie=typeof u==`function`?u(Se):o,Le=Zl({"aria-label":Ie,"aria-labelledby":s??(Ie==null?M:void 0),"aria-describedby":a,"aria-orientation":B,"aria-valuenow":we,"aria-valuetext":typeof d==`function`?d(dQ(we,P,O),we,Se):c??S1(ae,Se,O,P),disabled:W,form:R,id:G,max:F,min:I,name:z,onChange(e){k(e.currentTarget.valueAsNumber,Se,e)},onFocus(e){let t=he.current;he.current=!1,ne(Se),me(!0),t&&e.stopPropagation()},onBlur(e){he.current?e.stopPropagation():(ne(-1),!ie.current.some(t=>X(t,e.relatedTarget))&&(ue(!0),me(!1),de===`onBlur`&&D.commit(U$(we,Se,I,F,j,ae))))},onKeyDown(e){if(e.defaultPrevented||!x1.has(e.key))return;OU.has(e.key)&&e.stopPropagation();let t=null,n=0,r=e.shiftKey?N:U,i=$$(we,U,I);switch(e.key){case xU:n=1;break;case wU:n=le?-1:1;break;case SU:n=-1;break;case CU:n=le?1:-1;break;case EU:r=N,n=1;break;case DU:r=N,n=-1;break;case`End`:t=se&&Number.isFinite(ae[Se+1])?ae[Se+1]-U*L:F;break;case TU:t=se&&Number.isFinite(ae[Se-1])?ae[Se-1]+U*L:I}if(n!==0&&(t=sre(i,r,n,I,F)),t!==null){let n=e.currentTarget;hc(n)||(he.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),k(t,Se,e),e.preventDefault()}},step:U,style:{...Il,width:`100%`,height:`100%`,writingMode:Fe},tabIndex:y,type:`range`,value:we??``},e=>D.getValidationProps(W,e),{onFocus:ge,onBlur:_e,onKeyDown:v}),Re=zl(pe,D.inputRef,m);return uu(`div`,e,{state:H,ref:[t,be,fe],props:[{[y1]:Se,children:(0,Z.jsxs)(_.Fragment,{children:[r,(0,Z.jsx)(`input`,{ref:Re,...Le,suppressHydrationWarning:!0}),A&&Ce&&te&&(b1||=(0,Z.jsx)(v1,{script:``}))]}),id:S,onPointerDown(e){if(W)return;ee.current=Se;let t=Z$(e.currentTarget,ce);V.current=(ce?e.clientY:e.clientX)-t},style:Pe,suppressHydrationWarning:te||void 0},x],stateAttributesMapping:K$})}),w1=_.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:v,validityData:y,setFilled:b,validationMode:x,validation:S}=xQ(),{clearErrors:C,elementRef:w,submitCountRef:T}=CQ(),E=h||s,D=m??a,O={...p,disabled:E},{labelId:k}=TQ(),A=EQ({id:i}),j=o!==void 0,M=o==null?void 0:String(o),N=J(()=>S.inputRef.current?.value);f$(S.inputRef,A,M,N,!E,a),q(()=>{let e=M??S.inputRef.current?.value;e!==void 0&&b(e!==``)},[M,l,S.inputRef,b]),XH(M,()=>{M!==void 0&&(C(D),v(M!==(y.initialValue??``)),S.change(M))});let P=_.useRef(null),F=d$(E,P),I=ps();return uu(`input`,e,{ref:[t,P],state:O,props:[{id:A,disabled:E,name:D,ref:S.inputRef,"aria-labelledby":k,autoFocus:u,...j?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=bd(Sd,e.nativeEvent);c?.(t,n),!j&&(v(t!==(y.initialValue??``)),b(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(C(D),S.change(t)))},onFocus(){F(!0)},onBlur(e){if(g(!0),F(!1),x===`onBlur`){let t=e.currentTarget.value;S.commit(t),j&&queueMicrotask(()=>{let e=S.inputRef.current?.value;e!==void 0&&e!==t&&e!==(y.initialValue??``)&&S.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){g(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===w.current&&!e.defaultPrevented){let t=e.currentTarget,n=T.current;I.start(0,()=>{T.current===n&&S.commit(t.value)})}else S.commit(t)}}},f,e=>S.getValidationProps(E,e)],stateAttributesMapping:vQ})}),T1=_.forwardRef(function(e,t){return(0,Z.jsx)(w1,{ref:t,...e})});function E1({className:e,type:t,...n}){return(0,Z.jsx)(T1,{type:t,"data-slot":`input`,className:Q(`h-[26px] w-full min-w-0 rounded-md border-0 bg-input px-2 text-xs text-foreground tabular-nums outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-2 aria-invalid:ring-destructive/40`,e),...n})}var D1=_.createContext(void 0);function O1(){let e=_.useContext(D1);if(e===void 0)throw Error(ao(64));return e}var k1=`data-activation-direction`,A1={tabActivationDirection:e=>({[k1]:e})},j1=_.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,style:c,...l}=e,u=e.defaultValue!==void 0,d=_.useRef([]),[f,p]=_.useState(()=>new Map),[m,h]=IK({controlled:s,default:r,name:`Tabs`,state:`value`}),g=s!==void 0,[v,y]=_.useState(()=>new Map),b=_.useRef(void 0),x=_.useCallback(e=>M1(v,e),[v]),[S,C]=_.useState(()=>({previousValue:m,tabActivationDirection:`none`})),{previousValue:w,tabActivationDirection:T}=S,E=T,D=!1;w!==m&&(E=N1(w,m,a,v),D=w!=null&&m!=null&&x(m)==null);let O=D?w:m,k=w!==O||T!==E;q(()=>{k&&C({previousValue:O,tabActivationDirection:E})},[O,k,E]);let A=J((e,t)=>{t.activationDirection=N1(m,e,a,v),i?.(e,t),!t.isCanceled&&h(()=>e)}),j=J((e,t)=>{i?.(e,bd(t,void 0,void 0,{activationDirection:`none`}))}),M=J((e,t)=>(p(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{p(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),N=_.useCallback(e=>f.get(e),[f]),P=_.useCallback(e=>{for(let t of v.values())if(e===t.value)return t.id},[v]),F=_.useMemo(()=>({getTabElementBySelectedValue:x,getTabIdByPanelValue:P,getTabPanelIdByValue:N,onValueChange:A,orientation:a,registerMountedTabPanel:M,setTabMap:y,tabActivationDirection:E,value:m}),[x,P,N,A,a,M,y,E,m]),I=_.useMemo(()=>{for(let e of v.values())if(e.value===m)return e},[v,m]),L=_.useMemo(()=>{for(let e of v.values())if(!e.disabled)return e.value},[v]),R=_.useRef(!u),z=_.useRef(r),B=_.useRef(u),V=_.useRef(!1);q(()=>{if(g)return;function e(e,t){h(()=>e),C({previousValue:e,tabActivationDirection:`none`}),j(e,t),R.current=!1}if(v.size===0){V.current&&m!==null&&!b.current?.isConnected&&e(null,Gd);return}V.current=!0,b.current=v.keys().next().value;let t=I?.disabled,n=I==null&&m!==null;if(!t&&m===z.current&&(B.current=!1),B.current&&t&&m===z.current)return;let r=R.current;if(t||n){let n=L??null;if(m===n){R.current=!1;return}let i=Gd;r?i=Kd:t&&(i=Wd),e(n,i)}else r&&I!=null&&(j(m,Kd),R.current=!1)},[L,g,j,I,h,v,m]);let ee=uu(`div`,e,{state:{orientation:a,tabActivationDirection:E},ref:t,props:l,stateAttributesMapping:A1});return(0,Z.jsx)(D1.Provider,{value:F,children:(0,Z.jsx)(_q,{elementsRef:d,children:ee})})});function M1(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function N1(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=M1(r,e),c=M1(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var P1=`data-composite-item-active`,F1=_.createContext(void 0);function I1(){let e=_.useContext(F1);if(e===void 0)throw Error(ao(65));return e}var L1=_.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...l}=e,{value:u,getTabPanelIdByValue:d,onValueChange:f,orientation:p,tabActivationDirection:m}=O1(),{activateOnFocus:h,registerTabResizeObserverElement:g,tabsListElement:v}=I1(),{highlightedIndex:y,onHighlightedIndexChange:b}=fd(),x=qH(o),{compositeProps:S,compositeRef:C,index:w}=Zq({metadata:_.useMemo(()=>({disabled:r,id:x,value:a}),[r,x,a])}),T=a===u,E=_.useRef(!1),D=_.useRef(null),O=J(e=>{D.current?.(),D.current=e?g(e):null});q(()=>{if(E.current){E.current=!1;return}if(!(T&&w>-1&&y!==w))return;let e=v;if(e!=null){let t=Ps(is(e));if(t&&X(e,t))return}r||b(w)},[T,w,y,b,r,v]);let{getButtonProps:k,buttonRef:A}=hd({disabled:r,native:s,focusableWhenDisabled:!0}),j=d(a),M=_.useRef(!1),N=_.useRef(!1);function P(e){f(a,bd(Sd,e.nativeEvent,void 0,{activationDirection:`none`}))}function F(e){T||r||P(e)}function I(e){T||r||h&&(!M.current||N.current)&&P(e)}function L(e){if(T||r)return;M.current=!0,N.current=e.button===0;let t=is(e.currentTarget);function n(){M.current=!1,N.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return uu(`button`,e,{state:{disabled:r,active:T,orientation:p,tabActivationDirection:m},ref:[t,A,C,O],props:[S,{role:`tab`,"aria-controls":j,"aria-selected":T,id:x,onClick:F,onFocus:I,onPointerDown:L,[P1]:T?``:void 0,onKeyDownCapture(){E.current=!0}},l,k],stateAttributesMapping:A1})}),R1=`data-index`,z1={...A1,...qs},B1=_.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:u,tabActivationDirection:d,registerMountedTabPanel:f}=O1(),p=qH(),{ref:m,index:h}=JK(),g=r===c,{mounted:v,transitionStatus:y,setMounted:b}=$f(g),x=!v,S=l(r),C={hidden:x,orientation:u,tabActivationDirection:d,transitionStatus:y},w=_.useRef(null),T=uu(`div`,e,{state:C,ref:[t,m,w],props:[{"aria-labelledby":S,hidden:x,id:p,role:`tabpanel`,tabIndex:g?0:-1,inert:yu(!g),[R1]:h},s],stateAttributesMapping:z1});return Ou({open:g,ref:w,onComplete(){g||b(!1)}}),q(()=>{if(!(p==null||x&&!a))return f(r,p)},[x,a,r,p,f]),a||v?T:null});function V1(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=$a}=e,[p,m]=_.useState(0),h=r!=null,g=_.useRef(null),v=zl(g,c),y=_.useRef([]),b=_.useRef(!1),x=_.useRef(null),S=o??p,C=J((e,t=!1)=>{if(x.current=y.current[e]??null,(s??m)(e),t){let t=y.current[e];MU(g.current,t,a,n)}}),w=J(e=>{if(e.size===0)return;if(b.current){let e=y.current,t=e.indexOf(x.current);if(t===-1){let t=e[S];!t||rl(e,S,d)?C(H1(e,d)):x.current=t}else t!==S&&C(t);return}b.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)C(i);else if(rl(t,S,d)){let e=nl(t,{disabledIndices:d});Qc(t,e)||C(e)}MU(g.current,r,a,n)});q(()=>{if(d==null||o!=null||!b.current)return;let e=y.current;if(rl(e,S,d)){let t=nl(e,{disabledIndices:d});Qc(e,t)||C(t)}},[d,o,S,y,C]);let T=J((e,t,n)=>i?i(e,t,n,y):n),E=J(e=>{let o=e.key===`Home`||e.key===`End`;if(!OU.has(e.key)||!l&&o||U1(e,f)||!g.current)return;let s=a===`rtl`,c=s?CU:wU,p=s?wU:CU,m=n===`vertical`?SU:c,_=n===`vertical`?xU:p,v=Is(e.nativeEvent);if(v!=null&&jU(v)&&!aJ(v)){let t=v.selectionStart,n=v.selectionEnd,r=v.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let b=S,x=$c(y,d),w=el(y,d);r!=null&&(b=r({disabledIndices:d,elementsRef:y,event:e,highlightedIndex:S,loopFocus:t,maxIndex:w,minIndex:x,onLoop:T,orientation:n,rtl:s}));let E=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,D=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?b=x:e.key===`End`&&(b=w)),b===S&&(E||D)&&(t&&b===w&&E?(b=x,i&&(b=i(e,S,b,y))):t&&b===x&&D?(b=w,i&&(b=i(e,S,b,y))):b=nl(y.current,{startingIndex:b,decrement:D,disabledIndices:d})),b!==S&&!Qc(y.current,b)&&(u&&e.stopPropagation(),(h||o||E||D)&&e.preventDefault(),C(b,!0),queueMicrotask(()=>{y.current[b]?.focus()}))});return{props:{ref:v,onFocus(e){let t=g.current,n=Is(e.nativeEvent);t&&n!=null&&jU(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:E},highlightedIndex:S,onHighlightedIndexChange:C,elementsRef:y,onMapChange:w,relayKeyboardEvent:E}}function H1(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!rl(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function U1(e,t){for(let n of kU)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function W1(e){let{render:t,className:n,style:r,refs:i=$a,props:a=$a,state:o=eo,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:v,disabledIndices:y,modifierKeys:b,highlightItemOnHover:x=!1,tag:S=`div`,...C}=e,{props:w,highlightedIndex:T,onHighlightedIndexChange:E,elementsRef:D,onMapChange:O,relayKeyboardEvent:k}=V1({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:v,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:rh(),disabledIndices:y,modifierKeys:b}),A=uu(S,e,{state:o,ref:i,props:[w,...a,C],stateAttributesMapping:s}),j=_.useMemo(()=>({highlightedIndex:T,onHighlightedIndexChange:E,highlightItemOnHover:x,relayKeyboardEvent:k}),[T,E,x,k]);return(0,Z.jsx)(dd.Provider,{value:j,children:(0,Z.jsx)(_q,{elementsRef:D,onMapChange:e=>{h?.(e),O(e)},children:A})})}var G1=_.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=O1(),[d,f]=_.useState(0),[p,m]=_.useState(null),h=_.useRef(new Set),g=_.useRef(new Set),v=_.useRef(null);q(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{h.current.forEach(e=>{e()})});return v.current=e,p&&e.observe(p),g.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),v.current=null}},[p]);let y=J(e=>(h.current.add(e),()=>{h.current.delete(e)})),b=J(e=>(g.current.add(e),v.current?.observe(e),()=>{g.current.delete(e),v.current?.unobserve(e)})),x={orientation:c,tabActivationDirection:u},S={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},C=_.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:y,registerTabResizeObserverElement:b,tabsListElement:p}),[n,y,b,p]);return(0,Z.jsx)(F1.Provider,{value:C,children:(0,Z.jsx)(W1,{render:a,className:r,style:o,state:x,refs:[t,m],props:[S,s],stateAttributesMapping:A1,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:$a})})});function K1({className:e,orientation:t=`horizontal`,...n}){return(0,Z.jsx)(j1,{"data-slot":`tabs`,"data-orientation":t,className:Q(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var q1=kh(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function J1({className:e,variant:t=`default`,...n}){return(0,Z.jsx)(G1,{"data-slot":`tabs-list`,"data-variant":t,className:Q(q1({variant:t}),e),...n})}function Y1({className:e,...t}){return(0,Z.jsx)(L1,{"data-slot":`tabs-trigger`,className:Q(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function X1({className:e,...t}){return(0,Z.jsx)(B1,{"data-slot":`tabs-content`,className:Q(`flex-1 text-sm outline-none`,e),...t})}var Z1={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,1],ArrowDown:[0,-1]};function Q1({hsv:e,onChange:t}){let n=n=>{let r=n.currentTarget.getBoundingClientRect();t({h:e.h,s:$1((n.clientX-r.left)/r.width),v:$1(1-(n.clientY-r.top)/r.height)})};return(0,Z.jsx)(`div`,{role:`slider`,tabIndex:0,"aria-label":`Saturation and brightness`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(e.s*100),"aria-valuetext":`Saturation ${Math.round(e.s*100)}%, brightness ${Math.round(e.v*100)}%`,className:`relative h-[150px] touch-none rounded-[7px] outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,style:{background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${e.h} 100% 50%))`},onPointerDown:e=>{e.currentTarget.setPointerCapture(e.pointerId),e.currentTarget.focus(),n(e)},onPointerMove:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&n(e)},onKeyDown:n=>{let r=Z1[n.key];if(!r)return;n.preventDefault();let i=n.shiftKey?.1:.01;t({h:e.h,s:$1(e.s+r[0]*i),v:$1(e.v+r[1]*i)})},children:(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute size-3 -translate-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgba(0,0,0,.4)]`,style:{left:`${e.s*100}%`,top:`${(1-e.v)*100}%`}})})}function $1(e){return Math.min(1,Math.max(0,e))}var e0=/^#?([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;function t0(e){let t=e0.exec(e.trim())?.[1];if(!t)return null;let n=t.length<=4?[...t].map(e=>e+e).join(``):t,r=e=>parseInt(n.slice(e,e+2),16);return{r:r(0),g:r(2),b:r(4),a:n.length===8?d0(r(6)/255,3):1}}function n0({r:e,g:t,b:n}){return[e,t,n].map(e=>Math.round(u0(e,0,255)).toString(16).padStart(2,`0`)).join(``).toUpperCase()}function r0(e){let t=e.trim().toLowerCase(),n=/^rgba?\(([^)]*)\)$/.exec(t);if(n?.[1]){let e=n[1].split(/[\s,/]+/).filter(Boolean).map(Number),[t,r,i,a=1]=e;return t===void 0||r===void 0||i===void 0||e.some(e=>!Number.isFinite(e))?null:{r:t,g:r,b:i,a}}let r=/^color\(srgb ([^)]*)\)$/.exec(t);if(r?.[1]){let e=r[1].split(/[\s/]+/).filter(Boolean).map(Number),[t,n,i,a=1]=e;return t===void 0||n===void 0||i===void 0||e.some(e=>!Number.isFinite(e))?null:{r:t*255,g:n*255,b:i*255,a}}return t0(t)}function i0(e,t){let n=t.ownerDocument.createElement(`span`);if(n.style.color=e,n.style.color===``)return null;n.style.display=`none`,t.append(n);let r=getComputedStyle(n).color;n.remove();let i=r0(r);return i?a0(i):null}function a0({r:e,g:t,b:n}){let[r,i,a]=[e/255,t/255,n/255],o=Math.max(r,i,a),s=o-Math.min(r,i,a);return{h:l0(r,i,a,o,s),s:o===0?0:s/o,v:o}}function o0({h:e,s:t,v:n},r=1){let i=r=>{let i=(r+e/60)%6;return(n-n*t*Math.max(0,Math.min(i,4-i,1)))*255};return{r:i(5),g:i(3),b:i(1),a:r}}function s0({r:e,g:t,b:n}){let[r,i,a]=[e/255,t/255,n/255],o=Math.max(r,i,a),s=Math.min(r,i,a),c=o-s,l=(o+s)/2,u=c===0?0:c/(1-Math.abs(2*l-1));return{h:l0(r,i,a,o,c),s:u*100,l:l*100}}function c0({h:e,s:t,l:n},r=1){let i=t/100,a=n/100,o=i*Math.min(a,1-a),s=t=>{let n=(t+e/30)%12;return(a-o*Math.max(-1,Math.min(n-3,9-n,1)))*255};return{r:s(0),g:s(8),b:s(4),a:r}}function l0(e,t,n,r,i){return i===0?0:((r===e?(t-n)/i%6:r===t?(n-e)/i+2:(e-t)/i+4)*60+360)%360}function u0(e,t,n){return Math.min(n,Math.max(t,e))}function d0(e,t){let n=10**t;return Math.round(e*n)/n}var f0=[{mode:`hex`,label:`Hex`},{mode:`rgb`,label:`RGB`},{mode:`hsl`,label:`HSL`}],p0=`h-6 rounded-[5px] border-0 text-xs font-medium text-muted-foreground data-active:bg-card data-active:text-foreground data-active:shadow-none data-active:ring-1 data-active:ring-border dark:data-active:bg-card`,m0={style:`unit`,unit:`percent`,maximumFractionDigits:0};function h0(){let e=window.EyeDropper;return e?new e:null}function g0({label:e,color:t,onColor:n,onSubmit:r,tab:i,onTab:a,tokens:o,theme:s,token:c,onToken:l,tokensTab:u=!0}){let[d,f]=(0,_.useState)(`hex`),p=o0(t.hsv),m=n0(p),h=typeof window<`u`&&`EyeDropper`in window,g=e=>n({...t,hsv:e}),v=e=>{let n=a0({...e,a:1});g(n.s===0?{...n,h:t.hsv.h}:n)};return(0,Z.jsxs)(K1,{value:i,onValueChange:e=>a(e),className:`gap-0`,children:[u?(0,Z.jsxs)(J1,{className:`mb-2.5 h-7 w-full shrink-0 rounded-[7px] p-0.5`,children:[(0,Z.jsx)(Y1,{value:`custom`,className:p0,children:`Custom`}),(0,Z.jsx)(Y1,{value:`tokens`,className:p0,children:`Tokens`})]}):null,(0,Z.jsxs)(X1,{value:`custom`,className:`text-xs`,children:[(0,Z.jsx)(Q1,{hsv:t.hsv,onChange:g}),(0,Z.jsxs)(`div`,{className:`mt-2.5 flex items-center gap-2`,children:[h?(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Pick a color from the screen`,onClick:()=>{h0()?.open().then(({sRGBHex:e})=>{let t=r0(e);t&&v(t)}).catch(()=>{})},className:`grid size-5 shrink-0 place-items-center rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50`,children:(0,Z.jsx)(Br,{"aria-hidden":!0,className:`size-3.5`})}):null,(0,Z.jsxs)(`div`,{className:`flex flex-1 flex-col gap-1.5`,children:[(0,Z.jsx)(_0,{label:`Hue`,value:t.hsv.h,max:360,onChange:e=>g({...t.hsv,h:e}),background:`linear-gradient(to right, red, #ff0, lime, cyan, blue, #f0f, red)`}),(0,Z.jsx)(_0,{label:`Opacity`,value:t.percent,max:100,onChange:e=>n({...t,percent:e}),background:`linear-gradient(to right, transparent, #${m}), repeating-conic-gradient(#ccc 0 25%, #fff 0 50%) 0 0 / 8px 8px`})]})]}),(0,Z.jsxs)(`div`,{className:`mt-2.5 flex gap-1.5`,children:[(0,Z.jsxs)(dX,{children:[(0,Z.jsxs)(fX,{"aria-label":`Color format`,className:`flex h-[26px] shrink-0 items-center gap-1 rounded-md bg-input px-2 text-muted-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:[f0.find(e=>e.mode===d)?.label,(0,Z.jsx)(Lt,{"aria-hidden":!0,className:`size-2.5`})]}),(0,Z.jsx)(XX,{align:`start`,sideOffset:6,className:`w-28`,children:f0.map(e=>(0,Z.jsx)(gX,{className:QX,onClick:()=>f(e.mode),children:e.label},e.mode))})]}),d===`hex`?(0,Z.jsx)(v0,{hex:m,onHex:v,onSubmit:r}):null,(0,Z.jsx)(T$,{label:`${e} opacity`,className:`ml-auto w-14 shrink-0`,inputClassName:`text-right`,value:t.percent,min:0,max:100,format:m0,disabled:!1,onCommit:e=>n({...t,percent:e(t.percent)})})]}),d===`rgb`?(0,Z.jsx)(y0,{values:[p.r,p.g,p.b].map(Math.round),names:[`Red`,`Green`,`Blue`],maxes:[255,255,255],onChange:([e=0,t=0,n=0])=>v({r:e,g:t,b:n})}):d===`hsl`?(0,Z.jsx)(b0,{hsv:t.hsv,onChange:v}):null,o.length>0?(0,Z.jsxs)(`div`,{className:`mt-2.5 border-t border-border pt-2`,children:[(0,Z.jsx)(`p`,{className:`mb-1.5 text-label font-semibold text-muted-foreground`,children:`Tokens`}),(0,Z.jsx)(`div`,{className:`grid grid-cols-7 gap-1.5`,children:o.map(e=>(0,Z.jsx)(`button`,{type:`button`,"aria-label":xG(e.name),"aria-pressed":e.name===c,title:xG(e.name),onClick:()=>l(e.name),className:Q(`aspect-square rounded-[5px] outline-none focus-visible:ring-2 focus-visible:ring-ring/50 aria-pressed:shadow-[0_0_0_2px_var(--primary)]`,_G),style:{background:e[s]??void 0}},e.name))})]}):null]}),(0,Z.jsx)(X1,{value:`tokens`,className:`text-xs`,children:o.length===0?(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`This project names no color tokens.`}):(0,Z.jsx)(`ul`,{"aria-label":`${e} tokens`,className:`-mx-1 flex max-h-56 flex-col overflow-y-auto`,children:o.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":e.name===c,onClick:()=>l(e.name),className:`flex h-7 w-full items-center gap-2 rounded-md px-1.5 text-left outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/50 aria-pressed:bg-accent`,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:Q(`size-3.5 shrink-0 rounded-[3px]`,_G),style:{background:e[s]??void 0}}),xG(e.name)]})},e.name))})})]})}function _0({label:e,value:t,max:n,onChange:r,background:i}){return(0,Z.jsx)(X$,{value:t,max:n,onValueChange:e=>r(Array.isArray(e)?e[0]??0:e),children:(0,Z.jsx)(a1,{className:`flex h-3.5 touch-none items-center select-none`,children:(0,Z.jsx)(o1,{className:`h-2.5 w-full rounded-full select-none`,style:{background:i},children:(0,Z.jsx)(C1,{"aria-label":e,className:`size-3.5 rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,.35)] select-none has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring/50`})})})})}function v0({hex:e,onHex:t,onSubmit:n}){let[r,i]=(0,_.useState)(e),[a,o]=(0,_.useState)(e);if(a!==e){o(e);let t=t0(r);t&&n0(t)===e||i(e)}return(0,Z.jsx)(E1,{"aria-label":`Hex`,className:`flex-1`,value:r,spellCheck:!1,onFocus:e=>e.currentTarget.select(),onChange:e=>{let n=e.currentTarget.value;i(n);let r=/^#?[0-9a-f]{6}$/i.test(n.trim())?t0(n):null;r&&t(r)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),n())}})}function y0({values:e,names:t,maxes:n,onChange:r}){return(0,Z.jsx)(`div`,{className:`mt-1.5 grid grid-cols-3 gap-1`,children:t.map((t,i)=>(0,Z.jsx)(T$,{label:t,prefix:t[0],inset:`pl-[26px]`,inputClassName:`pr-1`,value:e[i]??0,min:0,max:n[i],format:{maximumFractionDigits:0},disabled:!1,onCommit:t=>r(e.map((e,n)=>n===i?t(e):e))},t))})}function b0({hsv:e,onChange:t}){let n=s0(o0(e));return(0,Z.jsx)(y0,{values:[e.h,n.s,n.l].map(Math.round),names:[`Hue`,`Saturation`,`Lightness`],maxes:[360,100,100],onChange:([e=0,n=0,r=0])=>t(c0({h:e,s:n,l:r}))})}function x0({color:e,className:t}){return(0,Z.jsx)(`span`,{"aria-hidden":!0,className:Q(`size-3.5 shrink-0 rounded-[3px]`,_G,e===null&&`border border-dashed border-faint`,t),style:e===null?void 0:{background:e}})}function S0(){return(0,Z.jsx)(`span`,{role:`img`,"aria-label":`Raw value, not a token`,title:`Raw value`,children:(0,Z.jsx)(Ut,{"aria-hidden":!0,className:`size-[13px] text-note`})})}var C0={hsv:{h:0,s:0,v:0},percent:100};function w0({hsv:e,percent:t}){return vG({raw:`#${n0(o0(e)).toLowerCase()}`},t)}var T0={style:`unit`,unit:`percent`,maximumFractionDigits:0};function E0({label:e,value:t,tokens:n,theme:r,disabled:i,onWrite:a,onRemove:o,onPreview:s,currentColor:c}){let l=(0,_.useRef)(null),[u,d]=(0,_.useState)(null),f=t.token?{token:t.token}:{raw:t.value},p=t.token?yG(n,t.token,r):null,m=bG(t,n,r),h=t.token!==null||mG.test(t.value),g=e=>{let n=t.token?p:t.value,r=n?.trim().toLowerCase()===`currentcolor`?c??n:n,i=r&&l.current?i0(r,l.current):null,a=i?{hsv:i,percent:t.percent}:C0;d({tab:e,from:a,color:a})},v=e=>{if(!u)return;d(null);let t=w0(u.color);t!==w0(u.from)&&(e?a(t).then(e=>{e||s?.(null)}):s?.(null))};return(0,Z.jsxs)(`div`,{ref:l,className:hG,children:[(0,Z.jsx)(`button`,{type:`button`,"aria-label":`${e} color`,disabled:i,onClick:()=>g(`custom`),className:`grid shrink-0 place-items-center rounded-[3px] outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:(0,Z.jsx)(x0,{color:m})}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`${e} token`,disabled:i,onClick:()=>g(`tokens`),className:Q(`min-w-0 truncate text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-default`,t.token?gG:`flex-1 tabular-nums`),children:t.token?xG(t.token):t.value.replace(/^#/,``)}),(0,Z.jsx)(VU,{open:u!==null,onOpenChange:(e,t)=>{e||v(t.reason!==`escape-key`)},children:(0,Z.jsx)(UU,{anchor:l,side:`left`,align:`start`,sideOffset:12,"aria-label":`${e} color picker`,className:`w-[248px] gap-0 rounded-xl p-2.5 text-xs shadow-[0_14px_40px_rgba(0,0,0,.28)]`,children:u?(0,Z.jsx)(g0,{label:e,color:u.color,onColor:e=>{d({...u,color:e}),s?.(w0(e))},onSubmit:()=>v(!0),tab:u.tab,onTab:e=>d({...u,tab:e}),tokens:n,theme:r,token:t.token,onToken:e=>{let n=u?.color.percent??t.percent;d(null),s?.(null),a(vG({token:e},n))}}):null})}),(0,Z.jsx)(T$,{label:`${e} opacity`,className:`ml-auto w-12 shrink-0`,inputClassName:`h-5 rounded-sm px-1 text-right text-muted-foreground focus-visible:text-foreground`,value:t.percent,min:0,max:100,format:T0,disabled:i||!h,scrubValue:!0,onPreview:e=>s?.(e?vG(f,e(t.percent)):null),onCommit:e=>a(vG(f,e(t.percent)))}),t.token?(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Detach ${xG(t.token)}`,title:`Detach the token to its value`,disabled:i||p===null,onClick:()=>{p!==null&&a(vG({raw:p},t.percent))},className:`grid shrink-0 place-items-center rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,children:(0,Z.jsx)(er,{"aria-hidden":!0,className:`size-[13px]`})}):(0,Z.jsx)(S0,{}),o?(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.toLowerCase()}`,title:`Remove the ${e.toLowerCase()}`,disabled:i,onClick:o,className:`grid shrink-0 place-items-center rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,children:(0,Z.jsx)(br,{"aria-hidden":!0,className:`size-[13px]`})}):null]})}function D0({title:e,add:t,children:n}){let r=`inspector-${e.toLowerCase()}`;return(0,Z.jsxs)(`section`,{"aria-labelledby":r,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(`h2`,{id:r,className:`text-xs font-semibold`,children:e}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":t.label,disabled:t.disabled,onClick:t.onAdd,className:`grid size-5 place-items-center rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50`,children:(0,Z.jsx)(Kr,{"aria-hidden":!0,className:`size-[13px]`})})]}),n?(0,Z.jsx)(`div`,{className:`mt-2`,children:n}):null]})}function O0({textOnly:e,color:t,backgroundColor:n,tokens:r,theme:i,inline:a,shorthand:o=!1,disabled:s,write:c,preview:l,currentColor:u}){let d=e?`color`:`background-color`,f=e?t:n,p=f&&f.value.trim().toLowerCase()!==`transparent`?f:null,m=r[0],h=e=>c({kind:`style`,property:d,value:e});return(0,Z.jsx)(D0,{title:`Fill`,add:{label:`Add fill`,disabled:s||p!==null||!m,onAdd:()=>{m&&h(`var(${m.name})`)}},children:p?(0,Z.jsx)(E0,{label:`Fill`,value:p,tokens:r,theme:i,disabled:s,onWrite:h,onRemove:a?()=>void c({kind:`style`,property:e?`color`:o?`background`:`background-color`,value:``}):e?void 0:()=>void h(`transparent`),onPreview:e=>l?.(d,e),currentColor:u}):null})}var k0={maximumFractionDigits:0},A0={fixed:`Fixed`,hug:`Hug`,fill:`Fill`},j0=new Set([`normal`,`stretch`]);function M0(e,t,n,r,i){let a=e.parent===`vertical`||e.parent===`horizontal`||e.parent===`wrap`,o=a&&e.parent===`vertical`==(t===`height`),s=[];return r===`fixed`?(s.push({property:t,value:`${i??(t===`width`?e.width:e.height)}px`}),o&&n===`fill`&&s.push({property:`flex`,value:`0 1 auto`}),s):r===`fill`?((n===`fixed`||!o&&n===`hug`)&&s.push({property:t,value:`auto`}),s.push(o?{property:`flex`,value:`1 1 0`}:{property:`align-self`,value:`stretch`}),s):a?((n===`fixed`||n===null)&&s.push({property:t,value:`auto`}),o&&(n===`fill`||n===null)&&s.push({property:`flex`,value:`0 1 auto`}),o||s.push({property:`align-self`,value:j0.has(e.parentAlignItems)?`flex-start`:`auto`}),s):(s.push({property:t,value:t===`width`?`fit-content`:`auto`}),s)}function N0({layout:e,size:t,disabled:n,write:r,preview:i}){let a=e.parent===`vertical`||e.parent===`horizontal`||e.parent===`wrap`?[`fixed`,`hug`,`fill`]:[`fixed`,`hug`],o=o=>{let s=o===`width`?e.width:e.height,c=t?.[o]??null,l=o===`width`?`Width`:`Height`,u=(t,n)=>{let i=M0(e,o,c,t,n);return i.length===0?Promise.resolve(!1):r({kind:`styles`,declarations:i})};return(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(T$,{label:l,prefix:o===`width`?`W`:`H`,inputClassName:`pr-[44px]`,value:s,min:0,format:k0,disabled:n,onPreview:e=>i?.(o,e?`${Math.max(0,e(s))}px`:null),onCommit:e=>u(`fixed`,Math.max(0,e(s)))}),(0,Z.jsxs)(dX,{children:[(0,Z.jsxs)(fX,{"aria-label":`${l} mode`,disabled:n||t===null,className:`absolute inset-y-0 right-0 flex items-center gap-px rounded-r-md px-1 text-caption text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,children:[c?A0[c]:`Auto`,(0,Z.jsx)(Lt,{"aria-hidden":!0,className:`size-2.5`})]}),(0,Z.jsx)(XX,{align:`end`,sideOffset:6,className:`w-auto`,children:(0,Z.jsx)(bX,{value:c,onValueChange:e=>{e!==c&&u(e)},children:a.map(e=>(0,Z.jsx)(xX,{value:e,closeOnClick:!0,className:`${QX} pr-8`,children:A0[e]},e))})})]})]},o)};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`p`,{className:`mt-1.5 mb-[3px] ml-0.5 text-caption text-muted-foreground`,children:`Size`}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:[o(`width`),o(`height`)]})]})}var P0=[{value:`none`,label:`No decoration`,icon:br},{value:`underline`,label:`Underline`,icon:Qi},{value:`line-through`,label:`Strikethrough`,icon:wi}],F0=[{value:`none`,label:`No case`,icon:br},{value:`uppercase`,label:`Uppercase`,icon:jt},{value:`lowercase`,label:`Lowercase`,icon:Dt},{value:`capitalize`,label:`Title case`,icon:kt}],I0=[{value:`off`,label:`No truncation`,icon:br},{value:`on`,label:`Truncate text`,icon:mn}],L0={on:[{property:`overflow`,value:`hidden`},{property:`text-wrap-mode`,value:`nowrap`},{property:`text-overflow`,value:`ellipsis`}],off:[{property:`overflow`,value:`visible`},{property:`text-wrap-mode`,value:`wrap`},{property:`text-overflow`,value:`clip`}]},R0=[{value:`auto`,name:`Auto`},{value:`balance`,name:`Balance`},{value:`pretty`,name:`Pretty`}];function z0({details:e,disabled:t,write:n}){let[r,i]=(0,_.useState)(!1),a=(0,_.useRef)(null),o=e=>{e.key===`Escape`&&e.target instanceof Node&&a.current?.contains(e.target)&&(e.stopPropagation(),i(!1))},s=R0.find(({value:t})=>t===e.textWrapStyle)??R0[0];return(0,Z.jsxs)(VU,{open:r,onOpenChange:i,children:[(0,Z.jsx)(YX,{label:`Type details`,children:(0,Z.jsx)(HU,{"aria-label":`Type details`,disabled:t,className:`grid size-[26px] place-items-center rounded-md bg-input text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-expanded:text-foreground`,children:(0,Z.jsx)(gi,{"aria-hidden":!0,className:`size-[13px]`})})}),(0,Z.jsxs)(UU,{side:`bottom`,align:`end`,sideOffset:6,ref:a,initialFocus:a,onKeyDownCapture:o,"aria-label":`Type details`,className:`w-60 gap-2 rounded-[10px] p-2.5 text-xs shadow-[0_12px_40px_rgba(0,0,0,.3)] ring-border`,children:[(0,Z.jsx)(B0,{id:`type-details-decoration`,label:`Decoration`,children:(0,Z.jsx)(H0,{labelledBy:`type-details-decoration`,options:P0,current:e.textDecorationLine,disabled:t,onPick:e=>void n({kind:`style`,property:`text-decoration-line`,value:e})})}),(0,Z.jsx)(B0,{id:`type-details-case`,label:`Case`,children:(0,Z.jsx)(H0,{labelledBy:`type-details-case`,options:F0,current:e.textTransform,disabled:t,onPick:e=>void n({kind:`style`,property:`text-transform`,value:e})})}),(0,Z.jsx)(B0,{id:`type-details-truncate`,label:`Truncate`,children:(0,Z.jsx)(H0,{labelledBy:`type-details-truncate`,options:I0,current:e.truncated?`on`:`off`,disabled:t||e.display===`inline`,onPick:e=>void n({kind:`styles`,declarations:e===`on`?L0.on:L0.off})})}),(0,Z.jsx)(B0,{id:`type-details-wrap`,label:`Wrap`,children:(0,Z.jsxs)(dX,{children:[(0,Z.jsxs)(fX,{"aria-label":`Wrap`,disabled:t,className:`flex h-[26px] w-24 items-center gap-1 rounded-md bg-input px-2 text-left text-xs text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,children:[(0,Z.jsx)(`span`,{className:`flex-1 truncate`,children:s.name}),(0,Z.jsx)(Lt,{"aria-hidden":!0,className:`size-2.5 shrink-0 text-muted-foreground`})]}),(0,Z.jsx)(XX,{align:`end`,sideOffset:6,className:`w-auto min-w-(--anchor-width)`,children:(0,Z.jsx)(bX,{value:s.value,onValueChange:e=>{e!==s.value&&n({kind:`style`,property:`text-wrap-style`,value:e})},children:R0.map(({value:e,name:t})=>(0,Z.jsx)(xX,{value:e,closeOnClick:!0,className:Q(QX,`pr-8`),children:t},e))})})]})})]})]})}function B0({id:e,label:t,children:n}){return(0,Z.jsxs)(`div`,{className:`flex h-[26px] items-center justify-between gap-2`,children:[(0,Z.jsx)(`span`,{id:e,className:`text-muted-foreground`,children:t}),n]})}var V0={ArrowRight:(e,t)=>(e+1)%t,ArrowDown:(e,t)=>(e+1)%t,ArrowLeft:(e,t)=>(e-1+t)%t,ArrowUp:(e,t)=>(e-1+t)%t,Home:()=>0,End:(e,t)=>t-1};function H0({labelledBy:e,options:t,current:n,disabled:r,onPick:i}){let a=(0,_.useRef)([]),[o,s]=(0,_.useState)(null),c=t.findIndex(({value:e})=>e===n),l=o??(c===-1?0:c),u=(e,n)=>{let r=V0[e.key];r&&(e.preventDefault(),a.current[r(n,t.length)]?.focus())};return(0,Z.jsx)(`div`,{role:`group`,"aria-labelledby":e,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||s(null)},className:`flex w-max gap-0.5 rounded-md bg-input p-0.5`,children:t.map(({value:e,label:t,icon:o},c)=>(0,Z.jsx)(YX,{label:t,children:(0,Z.jsx)(`button`,{ref:e=>{a.current[c]=e},type:`button`,"aria-label":t,"aria-pressed":e===n,tabIndex:c===l?0:-1,disabled:r,onFocus:()=>s(c),onKeyDown:e=>u(e,c),onClick:()=>{e!==n&&i(e)},className:Q(`grid h-[22px] w-7 place-items-center rounded-[5px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50`,e===n&&`bg-sidebar text-foreground`),children:(0,Z.jsx)(o,{"aria-hidden":!0,className:`size-[13px]`})})},e))})}var U0={maximumFractionDigits:0},W0=[{value:`block`,label:`Block`,icon:Si},{value:`vertical`,label:`Vertical`,icon:pt},{value:`horizontal`,label:`Horizontal`,icon:_t},{value:`wrap`,label:`Wrap`,icon:Bi},{value:`grid`,label:`Grid`,icon:Jn}],G0=[{value:`fixed`,label:`Gap between: space items by the Gap value`,icon:Ze},{value:`auto`,label:`Auto gap: spread items with space between`,icon:$e}],K0=[`start`,`center`,`end`],q0={start:`flex-start`,center:`center`,end:`flex-end`};function J0(e){return e===`center`?`center`:[`flex-end`,`end`,`right`,`last baseline`].includes(e)?`end`:`start`}function Y0(e,t){let n=[],r=(e,t,r)=>{t!==r&&n.push({property:e,value:t})};return r(`display`,t===`block`?e.inline?`inline-block`:`block`:t===`grid`?e.inline?`inline-grid`:`grid`:e.inline?`inline-flex`:`flex`,X0(e)),(t===`vertical`||t===`horizontal`||t===`wrap`)&&(r(`flex-direction`,t===`vertical`?`column`:`row`,e.direction),r(`flex-wrap`,t===`wrap`?`wrap`:`nowrap`,e.wrap)),n}function X0({flow:e,inline:t}){return e===`grid`?t?`inline-grid`:`grid`:e===`block`?t?`inline-block`:`block`:t?`inline-flex`:`flex`}function Z0({layout:e,flow:t,textOnly:n,disabled:r,write:i,preview:a}){let o=t?.rule??null,s=e.flow===`vertical`||e.flow===`horizontal`||e.flow===`wrap`,c=t=>{let n=Y0(e,t);n.length>0&&i({kind:`styles`,declarations:n})};return(0,Z.jsxs)(`section`,{"aria-labelledby":`inspector-layout`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,Z.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,Z.jsx)(`h2`,{id:`inspector-layout`,className:`text-xs font-semibold`,children:`Layout`}),o&&o.count>1?(0,Z.jsx)(YX,{label:`The flow comes from a rule these elements share. An edit writes this element alone.`,children:(0,Z.jsxs)(`span`,{tabIndex:0,className:`min-w-0 truncate text-caption text-muted-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:[(0,Z.jsx)(`code`,{className:`font-mono text-foreground`,children:o.selector}),` · `,`shared by `,o.count,` elements`]})}):null,!n&&e.flow===`block`?(0,Z.jsx)(YX,{label:`Add flow`,children:(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Add flow`,disabled:r,onClick:()=>c(`vertical`),className:`grid size-5 place-items-center rounded-[5px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,children:(0,Z.jsx)(Kr,{"aria-hidden":!0,className:`size-[13px]`})})}):null]}),n?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`p`,{id:`inspector-flow`,className:`sr-only`,children:`Flow`}),(0,Z.jsx)(H0,{labelledBy:`inspector-flow`,options:W0,current:e.flow,disabled:r,onPick:e=>c(e)})]}),(0,Z.jsx)(N0,{layout:e,size:t?.size??null,disabled:r,write:i,preview:a}),s||e.flow===`grid`?(0,Z.jsx)(Q0,{layout:e,flex:s,disabled:r,write:i,preview:a}):null,(0,Z.jsx)(n2,{padding:e.padding,disabled:r,write:i,preview:a})]})}function Q0({layout:e,flex:t,disabled:n,write:r,preview:i}){let a=e.flow===`vertical`,o=e.justify===`space-between`,s=a?e.rowGap:e.columnGap,c=(0,Z.jsx)(T$,{label:`Gap`,prefix:(0,Z.jsx)(i2,{}),inset:`pl-[28px]`,value:s,min:0,format:U0,disabled:n,onPreview:e=>i?.(`gap`,e?`${e(s)}px`:null),onCommit:e=>r({kind:`style`,property:`gap`,value:`${e(s)}px`})});if(!t)return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`p`,{className:`mt-1.5 mb-[3px] ml-0.5 text-caption text-muted-foreground`,children:`Gap`}),c]});let l=J0(e.justify),u=J0(e.alignItems);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`p`,{id:`inspector-alignment-gap`,className:`mt-1.5 mb-[3px] ml-0.5 text-caption text-muted-foreground`,children:`Alignment and gap`}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-[62px_1fr] gap-1.5`,children:[(0,Z.jsx)(t2,{vertical:a,main:o?null:l,cross:u,disabled:n,onPick:(e,t)=>void r({kind:`styles`,declarations:[{property:`justify-content`,value:q0[e]},{property:`align-items`,value:q0[t]}]})}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[c,(0,Z.jsx)(H0,{labelledBy:`inspector-alignment-gap`,options:G0,current:o?`auto`:`fixed`,disabled:n,onPick:t=>void r({kind:`style`,property:`justify-content`,value:t===`auto`?`space-between`:e.ownJustify?``:`flex-start`})})]})]})]})}var $0={ArrowRight:e=>e%3==2?e:e+1,ArrowLeft:e=>e%3==0?e:e-1,ArrowDown:e=>e>=6?e:e+3,ArrowUp:e=>e<3?e:e-3},e2={start:[`top`,`left`],center:[`center`,`center`],end:[`bottom`,`right`]};function t2({vertical:e,main:t,cross:n,disabled:r,onPick:i}){let a=(0,_.useRef)([]),o=(r,i)=>{let a=K0[e?r:i];return K0[e?i:r]===n&&(t===null||a===t)},[s,c]=(0,_.useState)(null),l=Array.from({length:9},(e,t)=>o(Math.floor(t/3),t%3)).indexOf(!0),u=s??(l===-1?0:l),d=(e,t)=>{let n=$0[e.key];n&&(e.preventDefault(),a.current[n(t)]?.focus())};return(0,Z.jsx)(`div`,{role:`group`,"aria-label":`Alignment`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||c(null)},className:`grid h-[58px] grid-cols-3 grid-rows-3 rounded-md bg-input p-1`,children:K0.flatMap((t,n)=>K0.map((s,l)=>{let f=e?t:s,p=e?s:t,m=n*3+l,h=o(n,l),g=`Align ${e2[t][0]} ${e2[s][1]}`;return(0,Z.jsx)(`button`,{ref:e=>{a.current[m]=e},type:`button`,"aria-label":g,"aria-pressed":h,tabIndex:m===u?0:-1,disabled:r,onFocus:()=>c(m),onKeyDown:e=>d(e,m),onClick:()=>i(f,p),className:`group/cell grid place-items-center rounded-[3px] outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,children:(0,Z.jsx)(`span`,{"aria-hidden":!0,className:Q(`rounded-full`,h?`h-0.5 w-2.5 bg-primary`:`size-[3px] bg-muted-foreground/50 group-hover/cell:bg-foreground`)})},`${t}-${s}`)}))})}function n2({padding:e,disabled:t,write:n,preview:r}){let[i,a]=(0,_.useState)(e.left!==e.right||e.top!==e.bottom),o=(i,a,o)=>{let s=o.map(t=>e[t]),[c=0]=s,l=s.every(e=>e===c);return(0,Z.jsx)(T$,{label:i,prefix:a,inset:`pl-[28px]`,value:l?c:null,min:0,format:U0,disabled:t,onPreview:t=>{for(let n of o)r?.(`padding-${n}`,t?`${Math.max(0,t(e[n]))}px`:null)},onCommit:t=>n({kind:`styles`,declarations:o.map(n=>({property:`padding-${n}`,value:`${Math.max(0,t(e[n]))}px`}))})},i)};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`p`,{className:`mt-1.5 mb-[3px] ml-0.5 text-caption text-muted-foreground`,children:`Padding`}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-[1fr_1fr_26px] gap-1.5`,children:[i?(0,Z.jsxs)(Z.Fragment,{children:[o(`Left padding`,(0,Z.jsx)(s2,{side:`left`}),[`left`]),o(`Top padding`,(0,Z.jsx)(s2,{side:`top`}),[`top`])]}):(0,Z.jsxs)(Z.Fragment,{children:[o(`Horizontal padding`,(0,Z.jsx)(a2,{vertical:!1}),[`left`,`right`]),o(`Vertical padding`,(0,Z.jsx)(a2,{vertical:!0}),[`top`,`bottom`])]}),(0,Z.jsx)(YX,{label:`Padding per side`,children:(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Padding per side`,"aria-pressed":i,disabled:t,onClick:()=>a(!i),className:Q(`grid h-[26px] place-items-center rounded-md text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,i&&`bg-input text-foreground`),children:(0,Z.jsx)(ci,{"aria-hidden":!0,className:`size-[13px]`})})}),i?(0,Z.jsxs)(Z.Fragment,{children:[o(`Right padding`,(0,Z.jsx)(s2,{side:`right`}),[`right`]),o(`Bottom padding`,(0,Z.jsx)(s2,{side:`bottom`}),[`bottom`])]}):null]})]})}function r2({children:e}){return(0,Z.jsx)(`svg`,{"aria-hidden":!0,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,className:`size-3`,children:e})}function i2(){return(0,Z.jsx)(r2,{children:(0,Z.jsx)(`path`,{d:`M4 5v14M20 5v14M10 9v6M14 9v6`})})}function a2({vertical:e}){return e?(0,Z.jsxs)(r2,{children:[(0,Z.jsx)(`path`,{d:`M5 4h14M5 20h14`}),(0,Z.jsx)(`rect`,{x:`9`,y:`8`,width:`6`,height:`8`,rx:`1`})]}):(0,Z.jsxs)(r2,{children:[(0,Z.jsx)(`path`,{d:`M4 5v14M20 5v14`}),(0,Z.jsx)(`rect`,{x:`8`,y:`9`,width:`8`,height:`6`,rx:`1`})]})}var o2={top:`M5 4h14`,right:`M20 5v14`,bottom:`M5 20h14`,left:`M4 5v14`};function s2({side:e}){return(0,Z.jsxs)(r2,{children:[(0,Z.jsx)(`path`,{d:o2[e]}),(0,Z.jsx)(`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,opacity:.5})]})}var c2={maximumFractionDigits:0},l2=`Free positions it inside its parent`;function u2({placement:e,disabled:t,write:n,preview:r,place:i,hugs:a=!1}){let{free:o,left:s,top:c,width:l,height:u,wordsLeft:d}=e,f=a&&d!==null?d:s,p=e=>{e!==o&&i(e?{left:f,top:c,...l===null?{}:{width:l},...u===null?{}:{height:u}}:null)},m=[{label:`In flow`,on:!o,value:!1},{label:`Free`,on:o,value:!0}];return(0,Z.jsxs)(`section`,{"aria-labelledby":`inspector-position`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,Z.jsxs)(`div`,{className:Q(`flex items-center justify-between`,o?`mb-2`:void 0),children:[(0,Z.jsx)(`h2`,{id:`inspector-position`,className:`text-xs font-semibold`,children:`Position`}),(0,Z.jsx)(`div`,{role:`group`,"aria-label":`Placement`,className:`flex gap-0.5 rounded-md bg-input p-0.5`,children:m.map(({label:e,on:n,value:r})=>{let i=(0,Z.jsx)(`button`,{type:`button`,"aria-pressed":n,disabled:t,onClick:()=>p(r),className:Q(`flex h-5 items-center rounded-[5px] px-2 text-[11px] font-medium text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50`,n&&`bg-sidebar text-foreground shadow-xs`),children:e},e);return r?(0,Z.jsx)(YX,{label:l2,side:`bottom`,children:i},e):i})})]}),o?(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:[(0,Z.jsx)(T$,{prefix:`X`,label:`X position in its parent`,value:s,format:c2,disabled:t,...bB(`left`,s,e=>`${e}px`,n,r)}),(0,Z.jsx)(T$,{prefix:`Y`,label:`Y position in its parent`,value:c,format:c2,disabled:t,...bB(`top`,c,e=>`${e}px`,n,r)})]}):null]})}function d2({boxShadow:e,shadows:t,theme:n,disabled:r,write:i}){let a=!e||e.value.trim().toLowerCase()===`none`,o=a?null:e.token?yG(t,e.token,n):e.value,s=e=>void i({kind:`style`,property:`box-shadow`,value:e});return(0,Z.jsxs)(`section`,{"aria-labelledby":`inspector-shadow`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,Z.jsx)(`h2`,{id:`inspector-shadow`,className:`mb-2 text-xs font-semibold`,children:`Shadow`}),(0,Z.jsxs)(dX,{children:[(0,Z.jsxs)(fX,{"aria-label":`Shadow`,disabled:r,className:`${hG} w-full text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,children:[(0,Z.jsx)(f2,{shadow:o}),a?(0,Z.jsx)(`span`,{className:`flex-1 text-muted-foreground`,children:`None`}):e.token?(0,Z.jsx)(`span`,{className:gG,children:xG(e.token)}):(0,Z.jsx)(`span`,{className:`flex-1 truncate`,children:e.value}),!a&&!e.token?(0,Z.jsx)(S0,{}):null,(0,Z.jsx)(Lt,{"aria-hidden":!0,className:`ml-auto size-2.5 shrink-0 text-muted-foreground`})]}),(0,Z.jsxs)(XX,{align:`start`,sideOffset:6,className:`w-(--anchor-width)`,children:[t.map(e=>(0,Z.jsxs)(gX,{className:QX,onClick:()=>s(`var(${e.name})`),children:[(0,Z.jsx)(f2,{shadow:e[n]}),xG(e.name)]},e.name)),t.length>0?(0,Z.jsx)(SX,{}):null,(0,Z.jsx)(gX,{className:QX,onClick:()=>{a||s(`none`)},children:`None`})]})]})]})}function f2({shadow:e}){return(0,Z.jsx)(`span`,{"aria-hidden":!0,className:Q(`size-3.5 shrink-0 rounded-[3px] bg-sidebar`,_G),style:e?{boxShadow:e}:void 0})}var p2=`--border`;function m2({bordered:e,borderColor:t,tokens:n,theme:r,inline:i,disabled:a,write:o,preview:s,currentColor:c}){let l=n.find(e=>e.name===p2)?.name??n[0]?.name,u=e?t??{value:`currentcolor`,token:null,percent:100}:null;return(0,Z.jsx)(D0,{title:`Stroke`,add:{label:`Add stroke`,disabled:a||e||l===void 0,onAdd:()=>{l!==void 0&&o({kind:`style`,property:`border`,value:`1px solid var(${l})`})}},children:u?(0,Z.jsx)(E0,{label:`Stroke`,value:u,tokens:n,theme:r,disabled:a,onWrite:e=>o({kind:`style`,property:`border-color`,value:e}),onPreview:e=>s?.(`border-color`,e),currentColor:c,onRemove:()=>void o(i?{kind:`style`,property:`border`,value:``}:{kind:`style`,property:`border-style`,value:`none`})}):null})}function h2(e){return(e.split(`,`)[0]??``).trim().replace(/^["']|["']$/g,``)}function g2(e){let t=h2(e).toLowerCase();return GG.find(e=>e.family.toLowerCase()===t)??null}function _2(e){let t=e.flatMap(e=>{let t=e.light??e.dark;return!t||/^-?[\d.]/.test(t.trim())?[]:[{value:`var(${e.name})`,name:e.name.replace(/^--/,``),token:e.name,stack:t}]}),n=GG.map(e=>{let t=/\s/.test(e.family)?`'${e.family}'`:e.family;return{value:t,name:e.family,token:null,stack:t}});return[...t,...n]}function v2(e,t,n){if(t)return n.find(e=>e.token===t)??{value:`var(${t})`,name:t.replace(/^--/,``),token:t,stack:e};let r=g2(e);return n.find(e=>!e.token&&e.name===r?.family)??null}var y2=[{value:100,name:`Thin`},{value:200,name:`Extra Light`},{value:300,name:`Light`},{value:400,name:`Regular`},{value:500,name:`Medium`},{value:600,name:`Semi Bold`},{value:700,name:`Bold`},{value:800,name:`Extra Bold`},{value:900,name:`Black`}];function b2(e){if(!e)return y2;let{min:t,max:n}=e.weights;return y2.filter(({value:e})=>e>=t&&e<=n)}function x2(e,t){return t.find(({value:t})=>t===e)?.name??String(e)}var S2=[{value:`left`,label:`Align text left`,icon:Ri},{value:`center`,label:`Align text center`,icon:Mi},{value:`right`,label:`Align text right`,icon:Pi},{value:`justify`,label:`Justify text`,icon:Ii}],C2={maximumFractionDigits:2},w2=1.2;function T2({fonts:e,fontFamily:t,fontToken:n,fontSize:r,fontWeight:i,lineHeight:a,letterSpacing:o,textAlign:s,details:c,disabled:l,write:u,preview:d}){let f=b2(g2(t)),p=_2(e),m=v2(t,n,p);return(0,Z.jsxs)(`section`,{"aria-labelledby":`inspector-typography`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,Z.jsx)(`h2`,{id:`inspector-typography`,className:`mb-2 text-xs font-semibold`,children:`Typography`}),GG.map(e=>(0,Z.jsx)(`link`,{rel:`stylesheet`,href:qG(e)},e.folder)),(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:[(0,Z.jsx)(D2,{label:`Font family`,shown:m?.token?(0,Z.jsx)(`span`,{className:gG,children:m.name}):m?.name??h2(t),current:m?.value??null,options:p.map(({value:e,name:t,stack:n})=>({value:e,name:t,font:n})),disabled:l,onPick:e=>void u({kind:`style`,property:`font-family`,value:e}),className:`col-span-2`}),(0,Z.jsx)(D2,{label:`Font weight`,shown:(0,Z.jsxs)(Z.Fragment,{children:[x2(i,f),f.some(({value:e})=>e===i)?(0,Z.jsx)(E2,{value:i}):null]}),current:String(i),options:f.map(({value:e,name:t})=>({value:String(e),name:t,hint:(0,Z.jsx)(E2,{value:e})})),disabled:l,onPick:e=>void u({kind:`style`,property:`font-weight`,value:e})}),(0,Z.jsx)(T$,{label:`Font size`,prefix:`Size`,inset:`pl-[40px]`,value:r,min:1,format:C2,disabled:l,...bB(`font-size`,r,e=>`${e}px`,u,d)}),(0,Z.jsx)(T$,{label:`Line height`,caption:`Line height`,prefix:(0,Z.jsx)(Qn,{"aria-hidden":!0,className:`size-3`,strokeWidth:1.6}),inset:`pl-[28px]`,value:a,empty:`Auto`,min:0,format:C2,disabled:l,...bB(`line-height`,a??Math.round(r*w2),e=>`${e}px`,u,d)}),(0,Z.jsx)(T$,{label:`Letter spacing`,caption:`Letter spacing`,prefix:(0,Z.jsx)(Xn,{"aria-hidden":!0,className:`size-3`,strokeWidth:1.6}),inset:`pl-[28px]`,value:o,format:C2,disabled:l,...bB(`letter-spacing`,o,e=>`${e}px`,u,d)})]}),(0,Z.jsx)(`p`,{id:`inspector-alignment`,className:`mt-1.5 mb-[3px] ml-0.5 text-caption text-muted-foreground`,children:`Alignment`}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(H0,{labelledBy:`inspector-alignment`,options:S2,current:s,disabled:l,onPick:e=>void u({kind:`style`,property:`text-align`,value:e})}),(0,Z.jsx)(z0,{details:c,disabled:l,write:u})]})]})}function E2({value:e}){return(0,Z.jsx)(`span`,{className:`ml-auto pl-2 text-muted-foreground tabular-nums`,children:e})}function D2({label:e,shown:t,current:n,options:r,disabled:i,onPick:a,className:o}){return(0,Z.jsxs)(dX,{children:[(0,Z.jsxs)(fX,{"aria-label":e,disabled:i,className:Q(`flex h-[26px] min-w-0 items-center gap-1 rounded-md bg-input px-2 text-left text-xs text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50 disabled:opacity-50`,o),children:[(0,Z.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center truncate`,children:t}),(0,Z.jsx)(Lt,{"aria-hidden":!0,className:`size-2.5 shrink-0 text-muted-foreground`})]}),(0,Z.jsx)(XX,{align:`start`,sideOffset:6,className:`w-auto min-w-(--anchor-width)`,children:(0,Z.jsx)(bX,{value:n,onValueChange:e=>{e!==n&&a(e)},children:r.map(e=>(0,Z.jsxs)(xX,{value:e.value,closeOnClick:!0,className:Q(QX,`pr-8`),style:e.font?{fontFamily:e.font}:void 0,children:[e.name,e.hint]},e.value))})})]})}function O2({frame:e}){let t=F(_N,e=>e.scale),n=F(_N,e=>e.theme),[r,i]=(0,_.useState)(!1),a=vN(e.name,{scale:t,theme:n});return(0,Z.jsxs)(`section`,{"aria-labelledby":`inspector-export`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,Z.jsx)(`h2`,{id:`inspector-export`,className:`mb-2 text-xs font-semibold`,children:`Export`}),(0,Z.jsxs)(`div`,{className:`mb-2 grid grid-cols-[70px_1fr] gap-1.5`,children:[(0,Z.jsx)(k2,{label:`Export scale`,shown:`${t}x`,value:String(t),options:hN.map(e=>({value:String(e),label:`${e}x`})),onPick:e=>{let t=hN.find(t=>String(t)===e);t&&_N.setState({scale:t})}}),(0,Z.jsx)(k2,{label:`Export theme`,shown:gN.find(e=>e.value===n)?.label??``,value:n,options:gN,onPick:e=>{let t=gN.find(t=>t.value===e);t&&_N.setState({theme:t.value})}})]}),(0,Z.jsx)(t_,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>{i(!0),yN(e,{scale:t,theme:n}).catch(ok(`Couldn't export ${e.name}`)).finally(()=>i(!1))},className:`w-full bg-transparent text-xs dark:bg-transparent`,children:r?`Exporting`:`Export ${e.name}`}),(0,Z.jsxs)(`p`,{className:`mt-1.5 text-caption text-muted-foreground`,children:[`PNG, `,a.join(` and `)]})]})}function k2({label:e,shown:t,value:n,options:r,onPick:i}){return(0,Z.jsxs)(dX,{children:[(0,Z.jsxs)(fX,{"aria-label":e,className:Q(hG,`min-w-0 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/50`),children:[(0,Z.jsx)(`span`,{className:`flex-1 truncate`,children:t}),(0,Z.jsx)(Lt,{"aria-hidden":!0,className:`size-2.5 shrink-0 text-muted-foreground`})]}),(0,Z.jsx)(XX,{align:`start`,sideOffset:6,className:`w-auto min-w-(--anchor-width)`,children:(0,Z.jsx)(bX,{value:n,onValueChange:i,children:r.map(e=>(0,Z.jsx)(xX,{value:e.value,closeOnClick:!0,className:Q(QX,`pr-8`),children:e.label},e.value))})})]})}function A2({frames:e}){let t=IM(),n=e.map(e=>e.ref),r=e.map(e=>t[e.ref]?.width??e.box.width),i=n.some(e=>t[e]!==void 0),a=M2(r),o=(0,_.useRef)(null),s=e=>{o.current??={widths:r,previews:Object.fromEntries(n.map(e=>[e,t[e]]))};let i=o.current.widths;for(let[t,r]of n.entries()){let n=i[t];n!==void 0&&BM([r],e(n))}};return(0,Z.jsxs)(`div`,{role:`group`,"aria-labelledby":`inspector-preview`,className:`mt-2.5`,children:[(0,Z.jsxs)(`div`,{className:`mb-1.5 flex h-4 items-center justify-between`,children:[(0,Z.jsx)(`span`,{id:`inspector-preview`,className:`text-caption text-muted-foreground`,children:`Preview`}),i?(0,Z.jsx)(`span`,{className:`text-caption text-muted-foreground`,children:`Size unchanged`}):null]}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:[(0,Z.jsx)(`div`,{className:`flex h-[26px] gap-0.5 rounded-md bg-input p-0.5`,children:MN.map(({preset:e,label:t,icon:i})=>{let a=`${NN(e)}, default ${wN[e].width}`,o=r.length>0&&r.every(t=>AN(t)===e);return(0,Z.jsx)(YX,{label:`${t}, ${a}`,side:`bottom`,children:(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Preview at ${t.toLowerCase()} width, ${a}`,"aria-pressed":o,onClick:()=>{for(let[t,i]of n.entries()){let n=r[t];n!==void 0&&BM([i],jN(e,n))}},className:Q(`grid flex-1 place-items-center rounded-[5px] text-muted-foreground outline-none hover:bg-sidebar hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 active:bg-sidebar`,o&&`bg-sidebar text-foreground shadow-xs`),children:(0,Z.jsx)(i,{"aria-hidden":!0,className:`size-[13px]`,strokeWidth:1.6})})},e)})}),(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(T$,{prefix:(0,Z.jsx)(Or,{"aria-hidden":!0,className:`size-[13px]`,strokeWidth:1.6}),label:`Preview width`,value:a,min:1,format:j2,disabled:!1,inputClassName:i?`pr-7`:void 0,onPreview:e=>{if(e){s(e);return}let t=o.current;if(o.current=null,t)for(let[e,n]of Object.entries(t.previews))n?BM([e],n.width):VM([e])},onCommit:e=>{s(e),o.current=null}}),i?(0,Z.jsx)(`span`,{className:`absolute inset-y-0 right-0.5 flex items-center`,children:(0,Z.jsx)(YX,{label:`End preview`,side:`bottom`,children:(0,Z.jsx)(`button`,{type:`button`,"aria-label":`End preview`,onClick:()=>VM(n),className:`grid size-6 place-items-center rounded-[5px] text-muted-foreground outline-none hover:bg-sidebar hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 active:bg-sidebar`,children:(0,Z.jsx)(ia,{"aria-hidden":!0,className:`size-[13px]`,strokeWidth:1.6})})})}):null]})]})]})}var j2={maximumFractionDigits:0};function M2(e){let[t]=e;return t!==void 0&&e.every(e=>e===t)?t:null}var N2=[{key:`x`,letter:`X`,label:`X position`},{key:`y`,letter:`Y`,label:`Y position`},{key:`width`,letter:`W`,label:`Width`},{key:`height`,letter:`H`,label:`Height`}],P2=[`frame.fitHeight`];function F2({frames:e,page:t,named:n=!0,write:r=cN,calls:i}){let a=z_(e=>e.canWrite),o=yW(`inspector`),[s]=xe(P2),c=(0,_.useRef)(null),[l]=e;if(!l)return null;let u=e.length>1,d=e.some(e=>e.locked),f=(t,n)=>{let r=c.current??Object.fromEntries(e.map(({ref:e,box:t})=>[e,t])),i={},a={};for(let[e,o]of Object.entries(r)){let r={...o,[t]:n(o[t])};r[t]!==o[t]&&(i[e]=r,a[e]=o)}return{boxes:i,expected:a}},p=(t,n)=>{n?(c.current??=Object.fromEntries(e.map(({ref:e,box:t})=>[e,t])),oN({...c.current,...f(t,n).boxes})):(c.current&&uN(Object.keys(c.current)),c.current=null)},m=(e,n)=>{let{boxes:i,expected:a}=f(e,n),o=c.current;return c.current=null,o&&uN(Object.keys(o).filter(e=>!(e in i))),r(t,i,a)};return(0,Z.jsxs)(`section`,{"aria-labelledby":`inspector-frame`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,Z.jsx)(I2,{frames:e,disabled:!a||d,onPick:n=>{let{boxes:i,expected:a}=IN(e,n);r(t,i,a)}}),u||!n?null:o===l.ref?(0,Z.jsx)(`div`,{className:`mb-1.5 flex h-[26px] items-center pl-1.5`,children:(0,Z.jsx)(IH,{name:l.name,label:`Rename frame ${l.name}`,onCommit:e=>{xW(),SW(l,e,i)},onCancel:xW})}):(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Rename frame ${l.name}`,disabled:!a,onClick:()=>bW(l.ref,`inspector`),className:`mb-1.5 block h-[26px] w-full truncate rounded-md bg-input px-2 text-left text-xs outline-none hover:ring-1 hover:ring-border focus-visible:ring-2 focus-visible:ring-ring/50 disabled:hover:ring-0`,children:l.name}),(0,Z.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:N2.map(({key:t,letter:n,label:r})=>{let i=t===`height`&&!u&&s?s:null;return(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(T$,{prefix:n,label:r,value:z2(e.map(({box:e})=>e[t])),min:t===`width`||t===`height`?1:void 0,format:L2,disabled:!a||d,inputClassName:i?`pr-7`:void 0,onPreview:e=>p(t,e),onCommit:e=>m(t,e)}),i?(0,Z.jsx)(`span`,{className:`absolute inset-y-0 right-0.5 flex items-center`,children:(0,Z.jsx)(R2,{action:i})}):null]},t)})}),(0,Z.jsx)(A2,{frames:e})]})}function I2({frames:e,disabled:t,onPick:n}){let r=e.map(({box:e})=>LN(e)),[i]=r,a=r.every(e=>e?.name===i?.name),o=a?i?.name:void 0,s=a?i?.label??`Custom`:`Mixed`;return(0,Z.jsxs)(`div`,{className:`mb-2 flex h-5 items-center justify-between gap-2`,children:[(0,Z.jsx)(`h2`,{id:`inspector-frame`,className:`-ml-1 text-xs font-semibold`,children:(0,Z.jsxs)(dX,{children:[(0,Z.jsxs)(fX,{disabled:t,"aria-describedby":`inspector-frame-size`,className:`flex h-5 items-center gap-1 rounded-[5px] px-1 outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/50 disabled:hover:bg-transparent aria-expanded:bg-accent`,children:[e.length>1?`${e.length} frames`:`Frame`,(0,Z.jsx)(Lt,{"aria-hidden":!0,className:Q(`size-2.5 text-muted-foreground`,t&&`opacity-0`)})]}),(0,Z.jsx)(XX,{align:`start`,sideOffset:4,className:`w-auto min-w-[220px]`,children:PN.map(({group:e,label:t,rows:r},i)=>(0,Z.jsxs)(_.Fragment,{children:[i>0?(0,Z.jsx)(SX,{}):null,(0,Z.jsxs)(bX,{value:r.some(e=>e.name===o)?o:null,onValueChange:e=>{e!==o&&n(e)},children:[(0,Z.jsx)(hX,{className:`px-2 text-label font-normal`,children:t}),r.map(e=>(0,Z.jsxs)(xX,{value:e.name,closeOnClick:!0,className:Q(QX,`pr-8 whitespace-nowrap`),children:[e.label,(0,Z.jsxs)(`span`,{className:`ml-auto pl-2 text-muted-foreground tabular-nums`,children:[e.width,` × `,e.height]})]},e.name))]})]},e))})]})}),(0,Z.jsx)(`span`,{id:`inspector-frame-size`,className:`truncate text-muted-foreground`,children:s})]})}var L2={maximumFractionDigits:0};function R2({action:e}){return(0,Z.jsx)(YX,{label:e.label,keys:e.keys,side:`bottom`,children:(0,Z.jsx)(`button`,{type:`button`,"aria-label":e.label,disabled:!be(e),onClick:e.run,className:`grid size-6 place-items-center rounded-[5px] text-muted-foreground outline-none hover:bg-sidebar hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50 active:bg-sidebar disabled:pointer-events-none disabled:opacity-40`,children:(0,Z.jsx)(wn,{"aria-hidden":!0,className:`size-[13px]`,strokeWidth:1.6})})})}function z2(e){let[t]=e;return t!==void 0&&e.every(e=>e===t)?t:null}async function B2(e,t,n,r,{selection:i=sP,send:a=fetch,notify:o=e=>n_.add({...e,timeout:4e3})}={}){let s=t.frame,c=n.value.replace(/^#/,``);return await gB(s,async l=>{let u=l?await l:void 0;if(u===null)return null;let d=u!==void 0&&u.from.includes(t.hash)&&!u.shifted,f=d?u.to:t.hash,p=()=>{};try{let l=await qO([s],`edit`,async()=>{p=tP(s),rP(s,f);try{return await Qx(`/api/frames/recolor`,{ref:s,hash:f,...t.index===void 0?{}:{index:t.index},from:{value:n.value,percent:n.percent},to:r},`POST`,a)}catch(e){throw p(),e}});rP(s,l.hash);let m=i.getState().element;return m?.frame===s&&m.index===t.index&&JN(i,e,{...m,hash:l.hash}),p(),oP(i,vB),o(l.count===0?{title:`Nothing replaced`,description:`No element here sets ${c} inline. A style rule sets it, and a replace leaves rules alone.`,type:`warning`}:{title:`Replaced ${c} with ${xG(r)}`,description:`In ${l.count} ${l.count===1?`element`:`elements`}.`,type:`success`}),{from:[...d?u.from:[],f],to:l.hash,at:new Map(d?u.at:[]),shifted:!1}}catch(e){return e instanceof zO||o({title:`Nothing replaced`,description:e instanceof Zx?yB(e.message):`The board could not be reached, so nothing was written.`,type:`warning`}),p(),aP(i,vB),null}})!==null}var V2=5;function H2({colors:e,tokens:t,theme:n,onReplace:r}){let[i,a]=(0,_.useState)(!1);if(e.length===0)return null;let o=[...e.filter(e=>!e.token),...e.filter(e=>e.token)],s=i?o:o.slice(0,V2);return(0,Z.jsxs)(`section`,{"aria-labelledby":`inspector-selection-colors`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,Z.jsxs)(`h2`,{id:`inspector-selection-colors`,className:`mb-2 text-xs font-semibold`,children:[`Selection colors · `,e.length]}),(0,Z.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:s.map(e=>(0,Z.jsx)(`li`,{children:e.token||!r?(0,Z.jsx)(G2,{color:e,swatch:bG(e,t,n)}):(0,Z.jsx)(K2,{color:e,tokens:t,theme:n,onReplace:t=>r(e,t)})},`${e.token??e.value}:${e.percent}`))}),s.length<o.length?(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>a(!0),className:`mt-1.5 h-[22px] rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50`,children:[`Show all `,o.length]}):null]})}function U2(e){return e.token?`var(${e.token})`:e.value}function W2(e){navigator.clipboard.writeText(e).then(()=>n_.add({title:`Copied ${e}`,type:`success`,timeout:2e3}),e=>n_.add({title:`Nothing was copied`,description:e instanceof Error?e.message:String(e),type:`error`}))}function G2({color:e,swatch:t}){let n=U2(e);return(0,Z.jsxs)(`button`,{type:`button`,"aria-label":`Copy ${n}`,onClick:()=>W2(n),className:Q(hG,`w-full text-left outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/50`),children:[(0,Z.jsx)(x0,{color:t}),e.token?(0,Z.jsx)(`span`,{className:gG,children:xG(e.token)}):(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate tabular-nums`,children:e.value.replace(/^#/,``)}),(0,Z.jsxs)(`span`,{className:`ml-auto text-muted-foreground tabular-nums`,children:[e.percent,`%`]}),e.token?(0,Z.jsx)(er,{role:`img`,"aria-label":`Token`,className:`size-[13px] shrink-0 text-muted-foreground`}):(0,Z.jsx)(S0,{})]})}function K2({color:e,tokens:t,theme:n,onReplace:r}){let i=(0,_.useRef)(null),a=(0,_.useRef)(null),[o,s]=(0,_.useState)(!1),c=(0,_.useRef)(null),l=e.value.replace(/^#/,``);return(0,Z.jsxs)(`div`,{ref:i,className:Q(hG,`hover:bg-accent`),children:[(0,Z.jsx)(`button`,{ref:a,type:`button`,"aria-label":`Replace ${l} with a token`,"aria-haspopup":`dialog`,"aria-expanded":o,onClick:()=>s(!0),className:`grid shrink-0 place-items-center rounded-[3px] outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:(0,Z.jsx)(x0,{color:bG(e,t,n)})}),(0,Z.jsxs)(`button`,{type:`button`,"aria-label":`Copy ${e.value}`,onClick:()=>W2(e.value),className:`flex h-full min-w-0 flex-1 items-center gap-2 rounded-sm text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate tabular-nums`,children:l}),(0,Z.jsxs)(`span`,{className:`ml-auto text-muted-foreground tabular-nums`,children:[e.percent,`%`]}),(0,Z.jsx)(S0,{})]}),(0,Z.jsx)(VU,{open:o,onOpenChange:s,onOpenChangeComplete:e=>{let t=c.current;c.current=null,!e&&t!==null&&r(t)},children:(0,Z.jsxs)(UU,{anchor:i,side:`left`,align:`start`,sideOffset:12,"aria-label":`Replace ${l}`,finalFocus:a,className:`w-[230px] gap-0 rounded-xl p-2 text-xs shadow-[0_14px_40px_rgba(0,0,0,.28)]`,children:[(0,Z.jsxs)(`p`,{className:`mb-1.5 px-1 text-muted-foreground`,children:[`Replace `,l,` with`]}),t.length===0?(0,Z.jsx)(`p`,{className:`px-1 pb-1`,children:`This project names no color tokens. Add one in the Theme tab.`}):(0,Z.jsx)(`ul`,{"aria-label":`Tokens to replace ${l} with`,className:`flex max-h-56 flex-col gap-1 overflow-y-auto`,children:J2(e.value,t,n).map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{c.current=e.name,s(!1)},className:`flex h-7 w-full items-center gap-2 rounded-md px-1.5 text-left outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/50`,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:Q(`size-3.5 shrink-0 rounded-[3px]`,_G),style:{background:e[n]??void 0}}),(0,Z.jsx)(`span`,{className:gG,children:xG(e.name)}),(0,Z.jsx)(`span`,{className:`ml-auto truncate text-muted-foreground tabular-nums`,children:e[n]?.replace(/^#/,``)??``})]})},e.name))})]})})]})}function q2(e){return e===null?null:t0(e)??r0(e)}function J2(e,t,n){let r=q2(e),i=e=>{let i=q2(yG(t,e.name,n));return!r||!i?1/0:(r.r-i.r)**2+(r.g-i.g)**2+(r.b-i.b)**2};return t.map(e=>({token:e,at:i(e)})).toSorted((e,t)=>e.at===t.at?0:e.at-t.at).map(({token:e})=>e)}function Y2(){let e=lY(),t=uY(),n=G_(e=>e.mode===`play`),r=G_(e=>e.mode===`edit`&&e.tool===`frame`),i=K_(),a=z_(e=>e.listeners),o=z_(e=>e.claims),s=cP(e=>e.page),c=cP(e=>e.frames),l=cP(e=>e.element??null),u=eN(z_(e=>e.board?.projects.flatMap(e=>e.pages).find(e=>e.ref===s))?.frames.filter(e=>c.includes(e.ref))??[]),d=l&&u.length===1?l:null;return(0,Z.jsxs)(`aside`,{"aria-label":`Inspector`,"data-inspector":!0,className:`flex h-full min-w-0 flex-col overflow-y-auto bg-sidebar text-body text-sidebar-foreground`,children:[(0,Z.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center justify-between border-b border-sidebar-border px-3`,children:[(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(cZ,{name:e,source:t}),(0,Z.jsx)(iQ,{listeners:a,claims:o})]}),(0,Z.jsx)(hZ,{})]}),i?(0,Z.jsx)(`p`,{className:`border-b border-sidebar-border px-3 py-2.5 text-muted-foreground`,children:`View only. Run frameboard open to edit`}):null,r?(0,Z.jsx)(t4,{}):s&&u.length>0?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(F2,{page:s,frames:u,named:!d}),u.length>1?(0,Z.jsx)(sQ,{}):null,u.length===1&&!d&&u[0]?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($2,{page:s,frame:u[0].ref}),(0,Z.jsx)(O2,{frame:u[0]},u[0].ref)]}):null,d?(0,Z.jsx)(Q2,{page:s,element:d}):(0,Z.jsx)(e4,{page:s,frames:u})]}):(0,Z.jsx)(`div`,{className:`px-3 pt-2.5 pb-3 text-muted-foreground`,children:n?(0,Z.jsx)(`p`,{children:`Playing. Nothing selects while frames take the clicks.`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`p`,{children:`Select a frame to see its details.`}),(0,Z.jsx)(`p`,{className:`mt-4`,children:`Click a frame, or drag on the canvas to select several.`})]})})]})}var X2=`--shadow`;function Z2(e){let t=UG(e.split(`/`)[0]??``)?.tokens??[];return{colors:t.filter(e=>e.group===`color`&&!e.name.startsWith(X2)),shadows:t.filter(e=>e.name.startsWith(X2)),fonts:t.filter(e=>e.group===`font`)}}function Q2({page:e,element:t}){let n=z_(e=>e.canWrite),r=_M(t.frame),i=PV(t),a=YV(t.frame,t.index,t.hash),{colors:o,shadows:s,fonts:c}=Z2(t.frame);if(!i)return(0,Z.jsx)(`p`,{className:`px-3 pt-2.5 pb-3 text-muted-foreground`,children:`The element’s details show once its frame is on screen.`});let l=!n,u=n=>hB(e,t,n),d=(e,n)=>QV(t,e,n),f=a?.element;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(u2,{placement:i.placement,disabled:l,write:u,preview:d,place:n=>bV(e,t,n,{inline:i.placement.inline}),hugs:f?.flow!==void 0&&f.flow.size.width!==`fixed`}),(0,Z.jsx)(Z0,{layout:i.layout,flow:f?.flow,textOnly:i.textOnly,disabled:l,write:u,preview:d}),(0,Z.jsx)(R$,{opacity:i.opacity,radius:i.radius,rotation:i.rotation,disabled:l,write:u,preview:d}),i.holdsText?(0,Z.jsx)(T2,{fonts:c,fontFamily:i.fontFamily,fontToken:f?.fontFamily?.token??null,fontSize:i.fontSize,fontWeight:i.fontWeight,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,textAlign:i.textAlign,details:i,disabled:l,write:u,preview:d}):null,(0,Z.jsx)(O0,{textOnly:i.textOnly,color:f?.color??null,backgroundColor:f?.backgroundColor??null,tokens:o,theme:r,inline:i.textOnly?i.inline.color:i.inline.backgroundColor,shorthand:!i.textOnly&&i.inline.background,disabled:l,write:u,preview:d,currentColor:i.color}),i.textOnly?(0,Z.jsx)(AH,{text:i.text,disabled:l,write:u,element:t},`${t.frame}\n${t.index}`):null,(0,Z.jsx)(m2,{bordered:i.bordered,borderColor:f?.borderColor??null,tokens:o,theme:r,inline:i.inline.border,disabled:l,write:u,preview:d,currentColor:i.color}),(0,Z.jsx)(d2,{boxShadow:f?.boxShadow??null,shadows:s,theme:r,disabled:l,write:u}),(0,Z.jsx)(H2,{colors:a?.colors??[],tokens:o,theme:r,onReplace:l?void 0:(n,r)=>void B2(e,t,n,r)},`colors:${t.frame}\n${t.index}`)]})}function $2({page:e,frame:t}){let n=z_(e=>e.canWrite),r=_M(t),i=FV(t),a=PV(i),o=YV(t,i?.index,i?.hash??``),{colors:s}=Z2(t);return!i||!a?null:(0,Z.jsx)(O0,{textOnly:!1,color:null,backgroundColor:o?.element?.backgroundColor??null,tokens:s,theme:r,inline:a.inline.backgroundColor,shorthand:a.inline.background,disabled:!n,write:t=>hB(e,i,t),preview:(e,t)=>QV(i,e,t),currentColor:a.color})}function e4({page:e,frames:t}){let n=z_(e=>e.canWrite),[r]=t,i=_M(r?.ref??``),{colors:a}=Z2(r?.ref??``),o=t.map(e=>e.ref).join(`
|
|
72
|
+
`),s=z_(e=>o.split(`
|
|
73
|
+
`).map(t=>e.reloads[t]??0).join(`:`)),[c,l]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let e=!0;return Promise.all(o.split(`
|
|
74
|
+
`).map(e=>XV(e).catch(()=>null))).then(t=>{if(!e)return;let n=new Map;for(let e of t.flatMap(e=>e?.colors??[])){let t=`${e.token??e.value.toLowerCase()}:${e.percent}`;n.has(t)||n.set(t,e)}l({refs:o,colors:[...n.values()]})}),()=>{e=!1}},[o,s]),(0,Z.jsx)(H2,{colors:c?.refs===o?c.colors:[],tokens:a,theme:i,onReplace:n&&t.length===1&&r?(t,n)=>{let i=vB(r.ref);i===null?n_.add({title:`Nothing replaced`,description:`The frame is not on screen, so the bytes it shows could not be read. Scroll to it and try again.`,type:`warning`}):B2(e,{frame:r.ref,hash:i},t,n)}:void 0},o)}function t4(){let e=IG();return(0,Z.jsxs)(`section`,{"aria-labelledby":`inspector-presets`,className:`border-b border-sidebar-border px-3 pt-2.5 pb-3`,children:[(0,Z.jsx)(`h2`,{id:`inspector-presets`,className:`mb-2 text-xs font-semibold`,children:`Frame`}),(0,Z.jsx)(`div`,{className:`-mx-1.5 flex flex-col`,children:PN.map(({group:t,label:n,icon:r,rows:i})=>(0,Z.jsxs)(`div`,{role:`radiogroup`,"aria-labelledby":`inspector-presets-${t}`,className:`flex flex-col`,children:[(0,Z.jsx)(`h3`,{id:`inspector-presets-${t}`,className:`px-1.5 pt-1.5 pb-0.5 text-label text-muted-foreground`,children:n}),i.map(t=>(0,Z.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t.name===e,onClick:()=>LG(t.name),className:Q(`flex h-[26px] items-center gap-1.5 rounded-md px-1.5 text-left outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/50`,t.name===e&&`bg-accent`),children:[(0,Z.jsx)(r,{"aria-hidden":!0,className:`size-[13px] text-muted-foreground`,strokeWidth:1.6}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t.label}),(0,Z.jsxs)(`span`,{className:Q(`tabular-nums`,t.name===e?`text-accent-foreground`:`text-muted-foreground`),children:[t.width,` × `,t.height]})]},t.name))]},t))}),(0,Z.jsx)(`p`,{className:`mt-2 text-muted-foreground`,children:`Click on the canvas to place it.`})]})}var n4=K(`layout-row-glyph`,[[`rect`,{x:`4`,y:`5`,width:`4`,height:`14`,rx:`1`,key:`a`}],[`rect`,{x:`10`,y:`5`,width:`4`,height:`14`,rx:`1`,key:`b`}],[`rect`,{x:`16`,y:`5`,width:`4`,height:`9`,rx:`1`,key:`c`}]]),r4=K(`layout-column-glyph`,[[`rect`,{x:`5`,y:`4`,width:`14`,height:`4`,rx:`1`,key:`a`}],[`rect`,{x:`5`,y:`10`,width:`14`,height:`4`,rx:`1`,key:`b`}],[`rect`,{x:`5`,y:`16`,width:`9`,height:`4`,rx:`1`,key:`c`}]]),i4=K(`grid-glyph`,[[`rect`,{x:`4`,y:`4`,width:`7`,height:`7`,rx:`1`,key:`a`}],[`rect`,{x:`13`,y:`4`,width:`7`,height:`7`,rx:`1`,key:`b`}],[`rect`,{x:`4`,y:`13`,width:`7`,height:`7`,rx:`1`,key:`c`}],[`rect`,{x:`13`,y:`13`,width:`7`,height:`7`,rx:`1`,key:`d`}]]),a4=K(`block-glyph`,[[`rect`,{x:`5`,y:`7`,width:`14`,height:`10`,rx:`1`,key:`a`}]]),o4=K(`placed-glyph`,[[`path`,{d:`M4 8V4h4`,key:`a`}],[`rect`,{x:`8`,y:`8`,width:`12`,height:`10`,rx:`1`,key:`b`}]]),s4={row:n4,column:r4,grid:i4,block:a4};function c4(e){return e.textOnly?Xi:e.tag===`img`||e.tag===`video`?Hn:e.placed?o4:e.tag===`hr`?br:e.round?Yt:s4[e.layout]}var l4=null;function u4(e,t){let[n=``,r=``]=e.split(`/`),i=q_(n,r);if(l4?.(),l4=null,t(),d4(i)&&ev.attached()){f4();return}let a=ev.onAttach(()=>{ev.attached()&&(a(),l4=null,f4())});l4=a,Ea(i)}function d4(e){return decodeURIComponent(location.pathname)===decodeURIComponent(e)}function f4(){Se(`view.zoomToSelection`)?.run()}function p4(e,t,n=sP,r=vB){let i=`${e}/${t.page}`,{index:a,hash:o}=t;u4(i,()=>{let e=r(t.ref),s=e!==null&&e!==o&&!iP(t.ref,e);a===null||o===null||s?KN(n,i,[t.ref]):JN(n,i,{frame:t.ref,index:a,hash:o})})}function m4(e,t,n,r=g4){let[i,a]=(0,_.useState)(null),o=(0,_.useRef)(0),s=(0,_.useRef)(n);(0,_.useEffect)(()=>{s.current=n},[n]);let c=z_(t=>h4(t.reloads,e)),l=t.trim()===``,u=`${c}\n${e}\n${t}`;if((0,_.useEffect)(()=>{let n=++o.current;if(l)return;let i=setTimeout(()=>{r(e,t).then(e=>{n===o.current&&a({key:u,status:`ready`,result:e,lead:s.current})},e=>{if(n!==o.current)return;let t=e instanceof Error?e.message:String(e);a({key:u,status:`refused`,message:t})})},120);return()=>clearTimeout(i)},[e,t,l,u,r]),l)return{status:`idle`};if(i?.status===`ready`){let{result:e,lead:t}=i;return{status:`ready`,result:e,lead:t,updating:i.key!==u}}return i?.status===`refused`&&i.key===u?i:{status:`loading`}}function h4(e,t){let n=0;for(let[r,i]of Object.entries(e))r.startsWith(`${t}/`)&&(n+=i);return n}async function g4(e,t,n=fetch){let r=await n(`/api/find?${new URLSearchParams({project:e,q:t})}`),i=await r.json().catch(()=>null);if(!i)throw Error(`The board answered ${r.status}.`);if(!i.ok)throw Error(i.error.message);return i.data}var _4=[{value:`all`,label:`All`},{value:`frame`,label:`Frames`},{value:`element`,label:`Elements`},{value:`text`,label:`Text`}],v4={frame:Pn,element:a4,text:Xi},y4={frame:`frame`,element:`element`,text:`text`};function b4({project:e,page:t,load:n,pick:r=p4,trees:i=$z}){let[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(`all`),[l,u]=(0,_.useState)(null),d=(0,_.useRef)(null),f=eQ(e=>e.focusRequest),p=m4(e,a,t,n),m=(0,_.useId)();(0,_.useEffect)(()=>{d.current?.focus(),d.current?.select()},[f]);let h=E4(p.status===`ready`?p.result.hits.filter(e=>s===`all`||e.kind===s):[],p.status===`ready`?p.lead:``),g=h.flatMap(e=>e.hits),v=g.find(e=>D4(e)===l)??g[0]??null,y=e=>`${m}-${D4(e)}`,b=t=>{u(D4(t)),r(e,t)};return(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col text-xs`,onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),nQ())},children:[(0,Z.jsxs)(`div`,{className:`m-2 flex shrink-0 items-center gap-1.5`,children:[(0,Z.jsxs)(`label`,{className:`flex h-7 min-w-0 flex-1 items-center gap-1.5 rounded-[7px] bg-muted px-2 focus-within:ring-[1.5px] focus-within:ring-primary`,children:[(0,Z.jsx)(fi,{"aria-hidden":!0,className:`size-3.5 shrink-0`}),(0,Z.jsx)(`input`,{ref:d,role:`combobox`,"aria-label":`Find in ${e}`,"aria-expanded":g.length>0,"aria-controls":m,"aria-autocomplete":`list`,"aria-activedescendant":v?y(v):void 0,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),g.length===0)return;let t=v?g.indexOf(v):-1,n=e.key===`ArrowDown`?1:-1,r=g[(t+n+g.length)%g.length];r&&u(D4(r))}else e.key===`Enter`&&v&&(e.preventDefault(),b(v))},spellCheck:!1,autoComplete:`off`,className:`min-w-0 flex-1 bg-transparent text-xs text-foreground outline-none`})]}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":a===``?`Close find`:`Clear the search`,onClick:()=>{a===``?nQ():(o(``),d.current?.focus())},className:`grid size-[26px] shrink-0 place-items-center rounded-md text-muted-foreground outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 active:bg-accent`,children:(0,Z.jsx)(ia,{"aria-hidden":!0,className:`size-3.5`})})]}),(0,Z.jsx)(`div`,{role:`group`,"aria-label":`Show`,className:`flex shrink-0 gap-1 px-2 pb-1.5`,children:_4.map(e=>(0,Z.jsx)(`button`,{type:`button`,"aria-pressed":s===e.value,onClick:()=>c(e.value),className:Q(`flex h-[22px] items-center rounded-full px-2 text-[11px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,s===e.value?`bg-foreground text-sidebar`:`bg-muted text-muted-foreground hover:bg-accent hover:text-foreground`),children:e.label},e.value))}),(0,Z.jsx)(`div`,{id:m,role:`listbox`,"aria-label":`Matches`,"aria-busy":p.status===`ready`&&p.updating,className:Q(`min-h-0 overflow-y-auto pb-1`,p.status===`ready`&&p.updating&&`opacity-60`),children:h.map(e=>(0,Z.jsxs)(`div`,{role:`group`,"aria-labelledby":`${m}-${e.page}`,children:[(0,Z.jsxs)(`div`,{className:`flex justify-between px-3 pt-2 pb-0.5 text-[11px] font-semibold text-muted-foreground`,children:[(0,Z.jsx)(`span`,{id:`${m}-${e.page}`,children:e.page}),(0,Z.jsx)(`span`,{children:e.hits.length})]}),e.hits.map(e=>(0,Z.jsx)(x4,{id:y(e),hit:e,query:a,active:e===v,onPick:()=>b(e),trees:i},D4(e)))]},e.page))}),(0,Z.jsx)(w4,{answer:p,project:e,shown:g.length,filter:s,onShowAll:()=>c(`all`)}),(0,Z.jsx)(`p`,{className:`shrink-0 px-3 pt-2 pb-3 text-[11px] text-muted-foreground`,children:`Esc goes back to the layers`})]})}function x4({id:e,hit:t,query:n,active:r,onPick:i,trees:a}){let o=C4(t,a),s=t.kind===`text`?`Text in ${t.frame}`:(0,Z.jsx)(T4,{text:t.name,query:n}),c=t.kind===`text`?(0,Z.jsxs)(Z.Fragment,{children:[`“`,(0,Z.jsx)(T4,{text:t.snippet??``,query:n}),`”`]}):t.kind===`element`?`in ${t.frame}`:y4.frame;return(0,Z.jsxs)(`div`,{id:e,role:`option`,"aria-selected":r,onMouseDown:e=>e.preventDefault(),onClick:i,className:Q(`mx-1.5 flex items-start gap-2 rounded-md px-2 py-[5px] text-foreground hover:bg-sidebar-accent`,r&&`bg-accent`),children:[(0,Z.jsx)(S4,{icon:o?c4(o):v4[t.kind]}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`div`,{className:`truncate`,children:s}),(0,Z.jsx)(`div`,{className:`truncate text-[11px] text-muted-foreground`,children:c})]})]})}function S4({icon:e}){return(0,Z.jsx)(e,{"aria-hidden":!0,className:`mt-px size-[13px] shrink-0 text-muted-foreground`})}function C4(e,t){let n=e.kind===`frame`?null:e.ref,r=z_(e=>n?e.reloads[n]??0:0);(0,_.useEffect)(()=>{n&&t.request(n,r)},[n,r,t]);let i=F(t.store,e=>n?e.byRef[n]:void 0);return i?.status!==`ready`||i.tree.hash!==e.hash?null:i.tree.elements.find(({index:t})=>t===e.index)??null}function w4({answer:e,project:t,shown:n,filter:r,onShowAll:i}){let a=`shrink-0 px-3 pt-2 text-[11px]`;if(e.status===`idle`)return(0,Z.jsxs)(`p`,{className:Q(a,`text-muted-foreground`),children:[`Type to find frames, elements, and text across every page of `,t,`.`]});if(e.status===`loading`)return null;if(e.status===`refused`)return(0,Z.jsx)(`p`,{role:`alert`,className:Q(a,`text-destructive`),children:e.message});let{hits:o,truncated:s,query:c}=e.result;return o.length===0?(0,Z.jsxs)(`p`,{className:Q(a,`text-muted-foreground`),children:[`Nothing in `,t,` matches “`,c.trim(),`”.`]}):n===0&&r!==`all`?(0,Z.jsxs)(`p`,{className:Q(a,`text-muted-foreground`),children:[s?`The first ${o.length} matches hold no ${y4[r]}. Type more to narrow them.`:`No ${y4[r]} matches.`,` `,(0,Z.jsx)(`button`,{type:`button`,onClick:i,className:`text-foreground underline underline-offset-2 outline-none hover:text-primary focus-visible:ring-3 focus-visible:ring-ring/50`,children:`Show all`})]}):s?(0,Z.jsxs)(`p`,{className:Q(a,`text-muted-foreground`),children:[`Showing the first `,o.length,` matches. Type more to narrow them.`]}):null}function T4({text:e,query:t}){let n=t.trim().toLowerCase(),r=n===``?-1:e.toLowerCase().indexOf(n);return r===-1?(0,Z.jsx)(Z.Fragment,{children:e}):(0,Z.jsxs)(Z.Fragment,{children:[e.slice(0,r),(0,Z.jsx)(`mark`,{className:`rounded-[2px] bg-primary/35 text-foreground`,children:e.slice(r,r+n.length)}),e.slice(r+n.length)]})}function E4(e,t){let n=[];for(let t of e){let e=n.find(e=>e.page===t.page);e?e.hits.push(t):n.push({page:t.page,hits:[t]})}let r=n.findIndex(e=>e.page===t);return r>0&&n.unshift(...n.splice(r,1)),n}function D4(e){return`${e.kind}:${e.ref}:${e.index??``}`}function O4(e){let t=(0,_.useRef)(!1);return{onKeyDown:e=>{if(!(e.key===`ContextMenu`||e.key===`F10`&&e.shiftKey))return;e.preventDefault(),e.stopPropagation(),t.current=!0;let n=e.currentTarget.getBoundingClientRect();e.currentTarget.dispatchEvent(new MouseEvent(`contextmenu`,{bubbles:!0,cancelable:!0,clientX:n.left+n.width/2,clientY:n.top+n.height/2}))},onOpenChangeComplete:n=>{n&&t.current&&(t.current=!1,e.current?.querySelector(`[role="menuitem"]:not([aria-disabled="true"])`)?.focus())}}}var k4=[`view.zoomToSelection`,`frame.duplicate`,`frame.hide`,`frame.lock`,`frame.delete`];function A4({frame:e,page:t,trigger:n}){let r=xe(k4),[i,a,o,s,c]=cP(n=>n.page===t&&!n.element&&n.frames.includes(e.ref))?r:r.map(()=>void 0),l=z_(e=>e.canWrite),u=(0,_.useRef)(null),d=O4(u);return(0,Z.jsxs)(mJ,{onOpenChange:n=>{if(!n||e.hidden||W_.getState().mode!==`edit`)return;let{page:r,frames:i,element:a}=sP.getState();(a||r!==t||!i.includes(e.ref))&&KN(sP,t,[e.ref])},onOpenChangeComplete:d.onOpenChangeComplete,children:[(0,Z.jsx)(hJ,{render:n,onKeyDown:d.onKeyDown}),(0,Z.jsxs)(gJ,{ref:u,className:`w-55`,children:[(0,Z.jsxs)(_J,{children:[(0,Z.jsx)(DJ,{children:`Frame in layers`}),(0,Z.jsx)(TJ,{action:i,children:`Zoom to frame`}),(0,Z.jsx)(TJ,{action:{id:`layers.rename`,label:`Rename`,group:`frame`,palette:!1,enabled:()=>l&&W_.getState().mode===`edit`,run:()=>bW(e.ref,`layers`)}}),(0,Z.jsx)(TJ,{action:a,children:`Duplicate`}),(0,Z.jsx)(TJ,{action:o,children:`Hide`}),(0,Z.jsx)(TJ,{action:s,children:s?.checked?.()?`Unlock`:`Lock`})]}),(0,Z.jsx)(CJ,{}),(0,Z.jsx)(EJ,{action:c})]})]})}var j4=[`section.delete`];function M4({section:e,page:t,trigger:n}){let[r]=xe(j4),i=z_(e=>e.canWrite),a=(0,_.useRef)(null),o=O4(a);return(0,Z.jsxs)(mJ,{onOpenChange:n=>{n&&W_.getState().mode===`edit`&&qN(sP,t,e.name)},onOpenChangeComplete:o.onOpenChangeComplete,children:[(0,Z.jsx)(hJ,{render:n,onKeyDown:o.onKeyDown}),(0,Z.jsxs)(gJ,{ref:a,className:`w-55`,children:[(0,Z.jsxs)(_J,{children:[(0,Z.jsx)(DJ,{children:`Section`}),(0,Z.jsx)(TJ,{action:{id:`layers.renameSection`,label:`Rename`,group:`section`,palette:!1,enabled:()=>i&&W_.getState().mode===`edit`,run:()=>OG(e.name)}})]}),(0,Z.jsx)(CJ,{}),(0,Z.jsx)(EJ,{action:r})]})]})}function N4({page:e,element:t,trigger:n}){let r=(0,_.useRef)(null),i=O4(r);return(0,Z.jsxs)(mJ,{onOpenChange:n=>{n&&JN(sP,e,t)},onOpenChangeComplete:i.onOpenChangeComplete,children:[(0,Z.jsx)(hJ,{render:n,onKeyDown:i.onKeyDown}),(0,Z.jsx)(gJ,{ref:r,className:`w-[230px]`,children:(0,Z.jsx)(FJ,{noteable:!1})})]})}function P4({edge:e}){return e===null?null:(0,Z.jsx)(`span`,{"aria-hidden":!0,className:Q(`pointer-events-none absolute right-1.5 left-5 z-10 h-0.5 rounded-[1px] bg-primary`,`before:absolute before:-top-[3px] before:-left-[5px] before:size-2 before:rounded-full before:border-2 before:border-primary before:bg-sidebar before:content-['']`,e===`top`?`-top-px`:`-bottom-px`)})}function F4(e){return e[I4]??null}var I4=Symbol(`closestEdge`);function L4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function R4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?L4(Object(n),!0).forEach(function(t){oA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L4(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var z4={top:function(e,t){return Math.abs(t.y-e.top)},right:function(e,t){return Math.abs(e.right-t.x)},bottom:function(e,t){return Math.abs(e.bottom-t.y)},left:function(e,t){return Math.abs(t.x-e.left)}};function B4(e,t){var n=t.element,r=t.input,i=t.allowedEdges,a={x:r.clientX,y:r.clientY},o=n.getBoundingClientRect(),s=i.map(function(e){return{edge:e,value:z4[e](o,a)}}).sort(function(e,t){return e.value-t.value})[0]?.edge??null;return R4(R4({},e),{},oA({},I4,s))}function V4(e){var t=e.startIndex,n=e.closestEdgeOfTarget,r=e.indexOfTarget,i=e.axis;if(t===-1||r===-1||t===r)return t;if(n==null)return r;var a=i===`vertical`&&n===`bottom`||i===`horizontal`&&n===`right`;return t<r?a?r:r-1:a?r+1:r}function H4(e,t){return e.list===t&&typeof e.index==`number`}function U4(e,{list:t,index:n,enabled:r}){let[i,a]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let i=e.current;if(!i||!r)return;let o={list:t,index:n};return ZA(Cj({element:i,getInitialData:()=>o}),xj({element:i,canDrop:({source:e})=>H4(e.data,t),getData:({input:e})=>B4(o,{element:i,input:e,allowedEdges:[`top`,`bottom`]}),onDrag:({self:e,source:t})=>{let r=F4(e.data),i=t.data.index,o=i===n||r===`top`&&i===n-1||r===`bottom`&&i===n+1;a(o?null:r)},onDragLeave:()=>a(null),onDrop:()=>a(null)}))},[e,t,n,r]),i}function W4(e,t){(0,_.useEffect)(()=>Sj({canMonitor:({source:t})=>typeof e==`string`?H4(t.data,e):typeof t.data.list==`string`&&e(t.data.list)&&H4(t.data,t.data.list),onDrop:({source:e,location:n})=>{let r=n.current.dropTargets[0],i=e.data.list;if(!r||!H4(r.data,i))return;let a=e.data.index,o=V4({startIndex:a,indexOfTarget:r.data.index,closestEdgeOfTarget:F4(r.data),axis:`vertical`});o!==a&&t(a,o,i)}}),[e,t])}var G4=14,K4=8;function q4(e,t){return`elements\n${e}\n${t??``}`}function J4({frame:e,page:t,selected:n,frameSelected:r,isOpen:i,toggle:a}){let o=tB(e.ref),s=z_(e=>e.canWrite),[c,l]=(0,_.useState)(null),u=o?.status===`ready`?o.tree:null,d=q4(e.ref,null).slice(0,-1);if(W4((0,_.useCallback)(e=>e.startsWith(d),[d]),(0,_.useCallback)((n,r,i)=>{let a=u?.elements.filter(t=>q4(e.ref,t.parent)===i)[n];u&&a&&pV(t,{frame:e.ref,index:a.index,hash:u.hash},()=>r)},[u,e.ref,t])),!o||o.status===`loading`)return(0,Z.jsx)(Z4,{depth:1,children:`Reading elements`});if(o.status===`refused`)return(0,Z.jsx)(Z4,{depth:1,title:o.message,children:`This frame cannot be addressed`});let f=$4(o.tree.elements,i);if(f.length===0)return(0,Z.jsx)(Z4,{depth:1,children:`No elements`});let p=new Set(o.tree.elements.map(e=>e.parent)),m=Q4(o.tree.elements);return(0,Z.jsx)(`ul`,{"aria-label":`Elements of ${e.name}`,children:f.map(({element:u,depth:d})=>(0,Z.jsx)(Y4,{page:t,element:u,elementKey:{frame:e.ref,index:u.index,hash:o.tree.hash},depth:d,place:m.get(u.index)??0,list:q4(e.ref,u.parent),open:i(u.index),holds:p.has(u.index),toggle:()=>a(u.index),tint:u.index===n?`bg-primary/26`:r?`bg-primary/13`:n===null?`hover:bg-accent`:`bg-primary/7`,isSelected:u.index===n,canWrite:s,renaming:c===u.index,setRenaming:e=>l(e?u.index:null)},u.index))})}function Y4({page:e,element:t,elementKey:n,depth:r,place:i,list:a,open:o,holds:s,toggle:c,tint:l,isSelected:u,canWrite:d,renaming:f,setRenaming:p}){let m=(0,_.useRef)(null),h=U4(m,{list:a,index:i,enabled:d&&!f}),g=(0,Z.jsx)(X4,{icon:c4(t),selected:u});return(0,Z.jsx)(N4,{page:e,element:n,trigger:(0,Z.jsxs)(`li`,{ref:m,className:Q(`relative flex h-[26px] items-center gap-1.5 pr-2 text-foreground`,l),style:{paddingLeft:K4+r*G4},children:[(0,Z.jsx)(P4,{edge:h}),s?(0,Z.jsx)(`button`,{type:`button`,"aria-label":`${o?`Hide`:`Show`} what ${t.name} holds`,"aria-expanded":o,onClick:c,className:`-mr-1.5 -ml-[7px] grid size-6 shrink-0 place-items-center text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:o?(0,Z.jsx)(Lt,{"aria-hidden":!0,className:`size-2.5`}):(0,Z.jsx)(zt,{"aria-hidden":!0,className:`size-2.5`})}):(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`w-2.5 shrink-0`}),f?(0,Z.jsxs)(Z.Fragment,{children:[g,(0,Z.jsx)(IH,{hug:!0,name:t.name,label:`Rename ${t.name}`,onCommit:t=>{p(!1),hB(e,n,{kind:`attribute`,name:`data-name`,value:t})},onCancel:()=>p(!1)})]}):(0,Z.jsxs)(`button`,{type:`button`,"aria-current":u?`true`:void 0,onClick:()=>JN(sP,e,n),onDoubleClick:()=>{d&&p(!0)},onKeyDown:e=>{e.key===`F2`&&d&&(e.preventDefault(),e.stopPropagation(),p(!0))},className:`flex min-w-0 flex-1 items-center gap-1.5 self-stretch text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset`,children:[g,(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:t.name,children:t.name})]})]})})}function X4({icon:e,selected:t}){return(0,Z.jsx)(e,{"aria-hidden":!0,className:Q(`size-[13px] shrink-0`,t?`text-primary`:`text-muted-foreground`)})}function Z4({depth:e,title:t,children:n}){return(0,Z.jsx)(`p`,{title:t,className:`flex h-[26px] items-center truncate pr-2 text-muted-foreground`,style:{paddingLeft:K4+e*G4+16},children:n})}function Q4(e){let t=new Map,n=new Map;for(let r of e){let e=t.get(r.parent)??0;n.set(r.index,e),t.set(r.parent,e+1)}return n}function $4(e,t){let n=new Map,r=[];for(let i of e){if(i.parent===null){n.set(i.index,1),r.push({element:i,depth:1});continue}let e=n.get(i.parent);e!==void 0&&t(i.parent)&&(n.set(i.index,e+1),r.push({element:i,depth:e+1}))}return r}function e3({id:e,title:t,children:n}){return(0,Z.jsxs)(`div`,{className:`flex h-[29px] items-center justify-between px-3 pt-1 text-label text-muted-foreground`,children:[(0,Z.jsx)(`h2`,{id:e,children:t}),n]})}function t3({section:e,page:t,open:n,onToggle:r,selected:i,canWrite:a,calls:o,children:s}){let c=DG()===e.name,l=e.frames.length,u=(0,Z.jsx)(Pr,{"aria-hidden":!0,className:`size-[13px] shrink-0 text-muted-foreground`});return(0,Z.jsxs)(`li`,{"aria-label":`Section ${e.name}`,className:`flex flex-col`,children:[(0,Z.jsx)(`div`,{className:`mx-1.5 overflow-hidden rounded-md`,children:(0,Z.jsx)(M4,{section:e,page:t,trigger:(0,Z.jsxs)(`div`,{className:Q(`group flex h-[26px] items-center gap-1.5 pr-1 pl-2 text-foreground`,i?`bg-primary/26`:`hover:bg-accent`),children:[(0,Z.jsx)(`button`,{type:`button`,"aria-label":`${n?`Hide`:`Show`} the frames of ${e.name}`,"aria-expanded":n,onClick:r,className:`-mr-1.5 -ml-[7px] grid size-6 shrink-0 place-items-center text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:n?(0,Z.jsx)(Lt,{"aria-hidden":!0,className:`size-2.5`}):(0,Z.jsx)(zt,{"aria-hidden":!0,className:`size-2.5`})}),c?(0,Z.jsxs)(Z.Fragment,{children:[u,(0,Z.jsx)(`span`,{className:`flex min-w-0 flex-1`,children:(0,Z.jsx)(IH,{hug:!0,name:e.name,label:`Rename section ${e.name}`,onCommit:n=>{kG(),n!==e.name&&o.renameSection(t,e.name,n).then(e=>qN(sP,t,e.name)).catch(ok(`Couldn't rename ${e.name}`))},onCancel:kG})})]}):(0,Z.jsxs)(`button`,{type:`button`,"aria-label":`Select section ${e.name}`,onClick:()=>{W_.getState().mode===`edit`&&(qN(sP,t,e.name),ev.reveal(e.box))},onDoubleClick:()=>{a&&OG(e.name)},onKeyDown:t=>{t.key===`F2`&&a&&(t.preventDefault(),t.stopPropagation(),OG(e.name))},className:`flex h-full min-w-0 flex-1 items-center gap-1.5 rounded-[5px] text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-inset`,children:[u,(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:e.name}),(0,Z.jsx)(`span`,{"aria-label":`${l} frame${l===1?``:`s`}`,className:`shrink-0 pr-1.5 text-[color-mix(in_srgb,var(--muted-foreground)_70%,var(--foreground))] tabular-nums`,children:l})]})]})})}),n&&l>0?(0,Z.jsx)(`ul`,{"aria-label":`Frames of ${e.name}`,className:`flex flex-col pl-3.5`,children:s}):null]})}var n3=`layers`,r3=`layers:section:`,i3=e=>e===n3||e.startsWith(r3),a3=[];function o3({frames:e,sections:t=a3,calls:n=$O}){let[r,i]=(0,_.useState)(new Set),[a,o]=(0,_.useState)(new Set),s=cP(e=>e.page),c=cP(e=>e.section),l=cP(e=>e.frames),u=cP(e=>e.element??null),d=z_(e=>e.canWrite);_3(i);let f=g3(e,t);W4(i3,(0,_.useCallback)((r,i,a)=>{let o=g3(e,t).find(e=>e.list===a),s=o?.rows[r];if(!o||!s)return;let c=o.rows.filter(e=>e.ref!==s.ref),l=e.filter(e=>e.ref!==s.ref),u=c[i],d=c[i-1],f=u?l.findIndex(e=>e.ref===u.ref)+1:d?l.findIndex(e=>e.ref===d.ref):0;n.orderFrame(s.ref,f).catch(ok(`Couldn't move ${s.name}`))},[e,t,n]));let p=e=>r.has(e),m=e=>i(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),h=(e,t,r)=>{let i=p(e.ref),a=u?.frame===e.ref,o=!a&&s===m3(e)&&l.includes(e.ref);return(0,Z.jsx)(f3,{frame:e,index:t,list:r,canWrite:d,calls:n,tint:o?`bg-primary/26`:a?`bg-primary/7`:void 0,chevron:(0,Z.jsx)(`button`,{type:`button`,"aria-label":`${i?`Hide`:`Show`} the elements of ${e.name}`,"aria-expanded":i,onClick:()=>m(e.ref),className:`-mr-1.5 -ml-[7px] grid size-6 shrink-0 place-items-center text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:i?(0,Z.jsx)(Lt,{"aria-hidden":!0,className:`size-2.5`}):(0,Z.jsx)(zt,{"aria-hidden":!0,className:`size-2.5`})}),children:i?(0,Z.jsx)(J4,{frame:e,page:m3(e),selected:a?u?.index??null:null,frameSelected:o,isOpen:t=>p(p3(e.ref,t)),toggle:t=>m(p3(e.ref,t))}):null},e.ref)};return(0,Z.jsxs)(`section`,{"aria-labelledby":`layers-heading`,className:`flex min-h-0 flex-col`,children:[(0,Z.jsx)(e3,{id:`layers-heading`,title:`Layers`,children:(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Collapse all layers`,title:`Collapse all layers`,onClick:()=>{i(new Set),o(new Set(t.map(e=>e.name)))},className:`group/target grid size-6 place-items-center text-muted-foreground outline-none hover:text-foreground`,children:(0,Z.jsx)(`span`,{className:`grid size-5 place-items-center rounded-md group-hover/target:bg-accent group-focus-visible/target:ring-3 group-focus-visible/target:ring-ring/50`,children:(0,Z.jsx)(ir,{"aria-hidden":!0,className:`size-[15px]`})})})}),e.length===0?(0,Z.jsx)(`p`,{className:`px-3.5 py-1 text-muted-foreground`,children:`No frames on this page`}):(0,Z.jsx)(`ul`,{className:`flex min-h-0 flex-col overflow-y-auto pb-1`,children:f.map(t=>{let r=t.rows.map((e,n)=>h(e,n,t.list));if(!t.section)return r;let{section:i}=t,s=t.rows.some(e=>l.includes(e.ref)||u?.frame===e.ref);return(0,Z.jsx)(t3,{section:i,page:h3(e),open:!a.has(i.name)||s,onToggle:()=>o(e=>{let t=new Set(e);return t.delete(i.name)||t.add(i.name),t}),selected:c===i.name,canWrite:d,calls:n,children:r},`${r3}${i.name}`)})})]})}var s3=`group/target grid size-6 shrink-0 place-items-center outline-none hover:text-foreground disabled:pointer-events-none`,c3=`text-[color-mix(in_srgb,var(--muted-foreground)_70%,var(--foreground))]`,l3=`grid size-5 place-items-center rounded-[5px] group-hover/target:bg-accent group-focus-visible/target:ring-2 group-focus-visible/target:ring-ring/50`,u3=`opacity-0 group-hover:opacity-100 group-focus-within:opacity-100`,d3={hidden:[`show`,`hide`],locked:[`unlock`,`lock`]};function f3({frame:e,index:t,list:n,canWrite:r,calls:i,tint:a,chevron:o,children:s}){let c=(0,_.useRef)(null),l=yW(`layers`)===e.ref,u=z_(t=>t.claims[e.ref]),d=Ov(t=>e.ref in t.unseen),f=U4(c,{list:n,index:t,enabled:r&&!l}),p=t=>{if(e.hidden||W_.getState().mode!==`edit`)return;t.shiftKey?YN(sP,m3(e),e.ref):KN(sP,m3(e),[e.ref]);let[n]=iN([e]);n&&sP.getState().frames.includes(e.ref)&&ev.reveal(n.box)},m=(t,n)=>i.flagFrames([e.ref],t,n).catch(ok(`Couldn't ${d3[t][+!!n]} ${e.name}`)),h=(0,Z.jsx)(Pn,{"aria-hidden":!0,className:Q(`size-[13px] shrink-0`,e.hidden?c3:`text-muted-foreground`)});return(0,Z.jsxs)(`li`,{ref:c,"aria-label":e.hidden?`${e.name}, hidden`:e.name,className:`relative mx-1.5`,children:[(0,Z.jsx)(P4,{edge:f}),(0,Z.jsxs)(`div`,{className:`flex flex-col overflow-hidden rounded-md`,children:[(0,Z.jsx)(A4,{frame:e,page:m3(e),trigger:(0,Z.jsxs)(`div`,{className:Q(`group flex h-[26px] items-center gap-1.5 pr-1 pl-2 text-foreground`,e.hidden&&c3,a??`hover:bg-accent`),children:[o,l?(0,Z.jsxs)(Z.Fragment,{children:[h,(0,Z.jsx)(`span`,{className:`flex min-w-0 flex-1`,children:(0,Z.jsx)(IH,{hug:!0,name:e.name,label:`Rename frame ${e.name}`,onCommit:t=>{xW(),SW(e,t,i)},onCancel:xW})})]}):(0,Z.jsxs)(`button`,{type:`button`,"aria-label":`Select ${e.name}`,onClick:p,onDoubleClick:()=>{r&&bW(e.ref,`layers`)},onKeyDown:t=>{t.key===`F2`&&r&&(t.preventDefault(),t.stopPropagation(),bW(e.ref,`layers`))},className:`flex h-full min-w-0 flex-1 items-center gap-1.5 rounded-[5px] text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-inset`,children:[h,(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name})]}),u?(0,Z.jsx)(`span`,{role:`img`,"aria-label":`${u.tag} is editing`,className:`ml-auto size-[7px] shrink-0 rounded-full bg-claim shadow-[0_0_0_3px_color-mix(in_srgb,var(--claim)_25%,transparent)]`}):d?(0,Z.jsx)(oW,{}):null,(0,Z.jsx)(`button`,{type:`button`,"aria-label":`${e.hidden?`Show`:`Hide`} ${e.name}`,"aria-pressed":e.hidden,disabled:!r,onClick:()=>void m(`hidden`,!e.hidden),className:Q(s3,e.hidden?c3:Q(`text-muted-foreground`,u3)),children:(0,Z.jsx)(`span`,{className:l3,children:e.hidden?(0,Z.jsx)(gn,{"aria-hidden":!0,className:`size-[13px]`}):(0,Z.jsx)(vn,{"aria-hidden":!0,className:`size-[13px]`})})}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`${e.locked?`Unlock`:`Lock`} ${e.name}`,"aria-pressed":e.locked,disabled:!r,onClick:()=>void m(`locked`,!e.locked),className:Q(s3,`text-muted-foreground`,!e.locked&&u3),children:(0,Z.jsx)(`span`,{className:l3,children:e.locked?(0,Z.jsx)(mr,{"aria-hidden":!0,className:`size-[13px]`}):(0,Z.jsx)(fr,{"aria-hidden":!0,className:`size-[13px]`})})})]})}),s]})]})}function p3(e,t){return`${e}#${t}`}function m3(e){return`${e.project}/${e.page}`}function h3(e){let[t]=e;return t?m3(t):``}function g3(e,t){let n=[...e].reverse(),r=new Set(t.flatMap(e=>e.frames));return[...[...t].reverse().map(e=>({list:`${r3}${e.name}`,section:e,rows:n.filter(t=>e.frames.includes(t.name))})),{list:n3,rows:n.filter(e=>!r.has(e.name))}]}function _3(e){(0,_.useEffect)(()=>{let t=null,n=()=>{let n=t;if(!n)return;let r=eB(n.frame),i=[n.frame];if(r){t=null;for(let e=oB(r.elements,n.index);typeof e==`number`;e=oB(r.elements,e))i.push(p3(n.frame,e))}e(e=>i.every(t=>e.has(t))?e:new Set([...e,...i]))},r=sP.subscribe((e,r)=>{e.element&&e.element!==r.element&&(t=e.element,n())}),i=$z.store.subscribe(n);return()=>{i(),r()}},[e])}function v3({count:e,className:t}){return e===0?null:(0,Z.jsx)(`span`,{role:`img`,"aria-label":`${e} unseen ${e===1?`change`:`changes`}`,"data-unseen-count":!0,className:Q(`shrink-0 text-[11px] font-semibold text-claim`,t),children:e})}var y3=[`page.rename`,`page.duplicate`,`page.new`,`page.moveUp`,`page.moveDown`,`page.delete`];function b3({onOpen:e,trigger:t}){let[n,r,i,a,o,s]=xe(y3),c=(0,_.useRef)(null),l=O4(c);return(0,Z.jsxs)(mJ,{onOpenChange:t=>{t&&e()},onOpenChangeComplete:l.onOpenChangeComplete,children:[(0,Z.jsx)(hJ,{render:t,onKeyDown:l.onKeyDown}),(0,Z.jsxs)(gJ,{ref:c,children:[(0,Z.jsxs)(_J,{children:[(0,Z.jsx)(DJ,{children:`Page`}),(0,Z.jsx)(TJ,{action:n,children:`Rename`}),(0,Z.jsx)(TJ,{action:r,children:`Duplicate`}),(0,Z.jsx)(TJ,{action:i,children:`New page below`})]}),(0,Z.jsx)(CJ,{}),(0,Z.jsxs)(_J,{children:[(0,Z.jsx)(TJ,{action:a,children:`Move up`}),(0,Z.jsx)(TJ,{action:o,children:`Move down`})]}),(0,Z.jsx)(CJ,{}),(0,Z.jsx)(EJ,{action:s})]})]})}var x3=`pages`,S3=`group/target grid size-6 place-items-center text-muted-foreground outline-none hover:text-foreground aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-pressed:text-foreground`,C3=`grid size-5 place-items-center rounded-md group-hover/target:bg-accent group-focus-visible/target:ring-3 group-focus-visible/target:ring-ring/50 group-aria-disabled/target:bg-transparent group-aria-pressed/target:bg-accent`;function w3({pages:e,current:t,calls:n=$O}){let[,r]=Va(),i={current:t,navigate:r,calls:n},[a]=xe([`page.new`]),o=a?be(a):!1,s=z_(e=>e.canWrite),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(``),f=u.trim().toLowerCase(),p=f?e.filter(e=>e.name.toLowerCase().includes(f)):e;W4(x3,(0,_.useCallback)((t,r)=>{let i=e[t];i&&n.movePage(i.ref,r).catch(ok(`Couldn't move ${i.name}`))},[e,n]));let m=()=>{l(!1),d(``)};return(0,Z.jsxs)(`nav`,{"aria-labelledby":`pages-heading`,className:`flex h-full min-h-0 flex-col`,children:[(0,Z.jsx)(e3,{id:`pages-heading`,title:`Pages`,children:(0,Z.jsxs)(`span`,{className:`flex gap-0.5`,children:[(0,Z.jsx)(YX,{label:`Search pages`,children:(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Search pages`,"aria-pressed":c,onClick:()=>c?m():l(!0),className:S3,children:(0,Z.jsx)(`span`,{className:C3,children:(0,Z.jsx)(fi,{"aria-hidden":!0,className:`size-[13px]`})})})}),(0,Z.jsx)(YX,{label:a?.label??`Add page`,keys:a?.keys,children:(0,Z.jsx)(`button`,{type:`button`,"aria-label":a?.label??`Add page`,"aria-disabled":!o||void 0,onClick:()=>{a&&o&&a.run()},className:S3,children:(0,Z.jsx)(`span`,{className:C3,children:(0,Z.jsx)(Kr,{"aria-hidden":!0,className:`size-[13px]`})})})})]})}),c?(0,Z.jsxs)(`div`,{className:`mx-2 mb-1.5 flex h-[26px] shrink-0 items-center gap-1.5 rounded-md bg-muted px-2 ring-[1.5px] ring-primary`,children:[(0,Z.jsx)(fi,{"aria-hidden":!0,className:`size-[13px] shrink-0 text-muted-foreground`}),(0,Z.jsx)(`input`,{autoFocus:!0,"aria-label":`Search pages`,value:u,spellCheck:!1,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),m())},className:`min-w-0 flex-1 bg-transparent text-foreground outline-none`}),(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground`,children:`Esc`})]}):null,p.length===0&&f?(0,Z.jsxs)(`p`,{className:`px-3.5 py-1 text-muted-foreground`,children:[`No page names match `,u.trim()]}):(0,Z.jsx)(`ul`,{className:`flex min-h-0 flex-col mt-[3px] overflow-y-auto pt-1 pb-0.5`,children:p.map(t=>(0,Z.jsx)(E3,{page:t,pages:e,context:i,needle:f,canWrite:s},t.ref))})]})}var T3=`mx-1.5 flex h-[26px] items-center gap-1.5 rounded-md pr-2 pl-2 text-foreground`;function E3({page:e,pages:t,context:n,needle:r,canWrite:i}){let{current:a}=n,o=(0,_.useRef)(null),s=e.name===a;(0,_.useEffect)(()=>{s&&o.current?.scrollIntoView({block:`nearest`})},[s]);let c=rk()===e.ref,l=Ov(t=>vv(t.unseen,e.ref)),u=U4(o,{list:x3,index:e.index,enabled:i&&!r&&!c});return(0,Z.jsxs)(`li`,{ref:o,className:`relative`,children:[(0,Z.jsx)(P4,{edge:u}),c?(0,Z.jsx)(`div`,{className:Q(T3,e.name===a&&`bg-accent`),children:(0,Z.jsx)(IH,{hug:!0,name:e.name,label:`Rename page ${e.name}`,onCommit:t=>{ak(),ck(e,t,n)},onCancel:ak})}):(0,Z.jsx)(b3,{onOpen:()=>{e.name!==a&&n.navigate(q_(e.project,e.name))},trigger:(0,Z.jsxs)(Ja,{href:q_(e.project,e.name),"aria-current":e.name===a?`page`:void 0,draggable:!1,onDoubleClick:()=>{i&&ik(e.ref)},onKeyDown:r=>{if(i){if(r.key===`F2`)ik(e.ref);else if(r.key===`Delete`||r.key===`Backspace`)lk(e,t,n);else return;r.preventDefault(),r.stopPropagation()}},className:Q(T3,`outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset aria-[current=page]:bg-accent`),children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.name,children:(0,Z.jsx)(D3,{name:e.name,needle:r})}),(0,Z.jsx)(v3,{count:l}),e.layoutError?(0,Z.jsx)(Wi,{role:`img`,"aria-label":`Layout does not read`,className:`size-3.5 shrink-0 text-note`,children:(0,Z.jsx)(`title`,{children:`Layout does not read`})}):null]})})]})}function D3({name:e,needle:t}){let n=t?e.toLowerCase().indexOf(t):-1;return n<0?e:(0,Z.jsxs)(Z.Fragment,{children:[e.slice(0,n),(0,Z.jsx)(`mark`,{className:`rounded-[2px] bg-primary/30 text-inherit`,children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function O3(e){return`frameboard.board.pages.${e}`}var k3=26,A3=12,j3=64;function M3(e){return 36+e*k3+A3}var N3=`h-6 rounded-[5px] border-0 text-xs font-medium text-muted-foreground data-active:bg-card data-active:text-foreground data-active:shadow-none data-active:ring-1 data-active:ring-border dark:data-active:bg-card`;function P3({project:e,page:t,theme:n,assets:r,storage:i,calls:a}){let o=eQ(e=>e.open),s=O3(e.name),c=Rx({id:s,onlySaveAfterUserInteractions:!0,storage:i}),l=Wx(),u=(0,_.useRef)(!1),d=M3(Math.min(Math.max(e.pages.length,4),8)),[f,p]=(0,_.useState)(`design`),m=!o&&f===`design`,h=(0,_.useRef)({project:e.name,pages:e.pages.length});(0,_.useEffect)(()=>{if(!m)return;let t=requestAnimationFrame(()=>{let t=l.current;if(!t)return;let n=h.current;h.current={project:e.name,pages:e.pages.length},n.project!==e.name||e.pages.length<=n.pages||t.getSize().inPixels>d-1||(u.current=!0,t.resize(d))});return()=>cancelAnimationFrame(t)},[m,e.name,e.pages.length,d,l]);let g=e.pages.find(e=>e.name===t),v=g?.frames??[];return(0,Z.jsxs)(`aside`,{"aria-label":`Pages and layers`,className:`flex h-full min-w-0 flex-col bg-sidebar text-sidebar-foreground`,children:[(0,Z.jsx)(rZ,{project:e,page:t,calls:a}),o?(0,Z.jsx)(b4,{project:e.name,page:t}):(0,Z.jsxs)(K1,{value:f,onValueChange:e=>p(String(e)),className:`min-h-0 flex-1 gap-0`,children:[(0,Z.jsxs)(J1,{className:`m-2 h-7 w-auto shrink-0 rounded-[7px] p-0.5`,children:[(0,Z.jsx)(Y1,{value:`design`,className:N3,children:`Design`}),(0,Z.jsx)(Y1,{value:`theme`,disabled:!n,className:N3,children:`Theme`}),(0,Z.jsx)(Y1,{value:`assets`,disabled:!r,className:N3,children:`Assets`})]}),(0,Z.jsx)(X1,{value:`design`,className:`flex min-h-0 flex-col text-xs`,children:(0,Z.jsxs)(Jx,{id:s,orientation:`vertical`,defaultLayout:c.defaultLayout,onLayoutChanged:(e,t)=>{c.onLayoutChanged(e,u.current?{...t,isUserInteraction:!0}:t),u.current=!1},children:[(0,Z.jsx)(Yx,{id:`pages`,panelRef:l,defaultSize:d,minSize:j3,children:(0,Z.jsx)(w3,{pages:e.pages,current:t,calls:a})}),(0,Z.jsx)(Xx,{"aria-label":`Resize the pages list`,disableDoubleClick:!0,onDoubleClick:()=>{let e=l.current;!e||Math.abs(e.getSize().inPixels-d)<1||(u.current=!0,e.resize(d))},className:`group cursor-row-resize aria-[orientation=horizontal]:h-[9px] border-t border-sidebar-border bg-transparent after:hidden focus-visible:ring-0 data-[separator=active]:border-t-2 data-[separator=active]:border-faint focus-visible:border-t-2 focus-visible:border-primary`,children:(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`h-[3px] w-7 rounded-[2px] bg-faint group-data-[separator=active]:bg-muted-foreground group-focus-visible:bg-primary`})}),(0,Z.jsx)(Yx,{id:`layers`,minSize:j3,children:(0,Z.jsx)(o3,{frames:v,sections:g?.sections,calls:a})})]},s)}),(0,Z.jsx)(X1,{value:`theme`,className:`min-h-0 text-xs`,children:n}),(0,Z.jsx)(X1,{value:`assets`,className:`min-h-0 text-xs`,children:r})]})]})}var F3=[`color`,`radius`,`font`,`other`],I3=iO({name:AD(),group:dO(F3),light:AD().nullable(),dark:AD().nullable(),sheet:AD(),overrides:XD()});iO({sheets:nO(iO({path:AD(),kind:dO([`board`,`project`]),error:AD().nullable(),hash:AD()})),tokens:nO(I3)});var L3=`mx-1.5 grid h-7 items-center gap-1.5 rounded-md px-1.5`;function R3({row:e,fromProject:t,editable:n,onWrite:r}){let i=(0,_.useRef)(null);return(0,Z.jsxs)(`li`,{ref:i,className:Q(L3,`grid-cols-[1fr_18px_18px]`),children:[(0,Z.jsx)(V3,{row:e,fromProject:t,editable:n,onWrite:r}),[`light`,`dark`].map(t=>n?(0,Z.jsx)(K3,{name:e.name,side:t,value:e[t],row:i,onWrite:r},t):(0,Z.jsx)(U3,{side:t,value:e[t]},t))]})}function z3({row:e,fromProject:t,editable:n,onWrite:r}){let i=e.light??e.dark??``,a=B3.exec(i.trim());return(0,Z.jsxs)(`li`,{className:Q(L3,`grid-cols-[1fr_auto]`),children:[(0,Z.jsx)(V3,{row:e,fromProject:t,editable:n,onWrite:r}),n?a?(0,Z.jsx)(q3,{name:e.name,value:Number(a[1]),unit:a[2]??``,onWrite:r}):(0,Z.jsx)(J3,{name:e.name,value:i,shown:Y3(e),onWrite:r}):(0,Z.jsx)(`span`,{className:`max-w-32 truncate text-muted-foreground`,title:Y3(e),children:Y3(e)})]})}var B3=/^(-?\d*\.?\d+)([a-z%]*)$/i;function V3({row:e,fromProject:t,editable:n,onWrite:r}){return(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,title:e.name,children:[(0,Z.jsx)(`span`,{className:`text-faint`,children:`--`}),e.name.replace(/^--/,``)]}),(0,Z.jsx)(`span`,{className:Q(`shrink-0 rounded-[3px] border px-1 text-[9px] leading-[14px]`,t?`border-primary text-foreground`:`border-border text-muted-foreground`),children:t?`Project`:`Board`}),n&&e.overrides?(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Reset ${e.name.replace(/^--/,``)} to the board value`,title:`Reset to the board value`,onClick:()=>void r({name:e.name,reset:!0}),className:`-ml-1 grid size-6 shrink-0 place-items-center rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50`,children:(0,Z.jsx)(Qr,{"aria-hidden":!0,className:`size-3`})}):null]})}var H3={light:`Light`,dark:`Dark`};function U3({side:e,value:t}){return t===null?(0,Z.jsx)(`span`,{role:`img`,"aria-label":`${H3[e]}: not set`,title:`Not set in ${e}`,className:`size-4 rounded-[4px] border border-dashed border-faint`}):(0,Z.jsx)(`span`,{role:`img`,"aria-label":`${H3[e]}: ${t}`,title:t,className:Q(`size-4 rounded-[4px]`,_G),style:{background:t}})}var W3={hsv:{h:0,s:0,v:0},percent:100};function G3({hsv:e,percent:t}){return vG({raw:`#${n0(o0(e)).toLowerCase()}`},t)}function K3({name:e,side:t,value:n,row:r,onWrite:i}){let a=(0,_.useRef)(null),[o,s]=(0,_.useState)(null),c=H3[t],l=o?G3(o.color):n,u=()=>{let e=n&&a.current?i0(n,a.current):null,t=e?{hsv:e,percent:100}:W3;s({from:t,color:t})},d=n=>{if(!o)return;s(null);let r=G3(o.color);n&&r!==G3(o.from)&&i({name:e,side:t,value:r})};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`button`,{ref:a,type:`button`,"aria-label":`${c}: ${n??`not set`}`,title:n??`Not set in ${t}`,onClick:u,className:`-m-[3px] grid size-6 place-items-center rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:(0,Z.jsx)(`span`,{"aria-hidden":!0,className:Q(`size-4 rounded-[4px]`,l===null?`border border-dashed border-faint`:_G),style:l===null?void 0:{background:l}})}),(0,Z.jsx)(VU,{open:o!==null,onOpenChange:(e,t)=>{e||d(t.reason!==`escape-key`)},children:(0,Z.jsx)(UU,{anchor:r,side:`right`,align:`start`,sideOffset:16,"aria-label":`${e.replace(/^--/,``)} ${t} color`,className:`w-[248px] gap-0 rounded-xl p-2.5 text-xs shadow-[0_14px_40px_rgba(0,0,0,.28)]`,children:o?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`p`,{className:`mb-2 text-xs font-semibold`,children:c}),(0,Z.jsx)(g0,{label:c,color:o.color,onColor:e=>s({...o,color:e}),onSubmit:()=>d(!0),tab:`custom`,onTab:()=>{},tokens:[],theme:t,token:null,onToken:()=>{},tokensTab:!1})]}):null})})]})}function q3({name:e,value:t,unit:n,onWrite:r}){return(0,Z.jsxs)(`span`,{className:`flex items-center text-muted-foreground`,children:[(0,Z.jsx)(T$,{label:`${e.replace(/^--/,``)} value`,className:`w-12`,inputClassName:`h-5 rounded-sm px-1 text-right text-muted-foreground focus-visible:text-foreground`,value:t,min:t>=0?0:void 0,format:{maximumFractionDigits:3},disabled:!1,scrubValue:!0,onCommit:i=>r({name:e,side:`both`,value:`${i(t)}${n}`})}),n]})}function J3({name:e,value:t,shown:n,onWrite:r}){let[i,a]=(0,_.useState)(null),o=(0,_.useRef)(!1),s=(0,_.useRef)(!1),c=`${e.replace(/^--/,``)} value`,l=(n,c)=>{if(i===null||s.current)return;s.current=!0,o.current=c,a(null);let l=i.trim();n&&l!==``&&l!==t.trim()&&r({name:e,side:`both`,value:l})};return i===null?(0,Z.jsx)(`button`,{ref:e=>{e&&o.current&&(o.current=!1,e.focus())},type:`button`,"aria-label":`${c}: ${t}`,title:t,onClick:()=>{s.current=!1,a(t)},className:`max-w-32 truncate rounded-sm px-1 text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50`,children:n}):(0,Z.jsx)(`input`,{"aria-label":c,autoFocus:!0,value:i,spellCheck:!1,onFocus:e=>e.currentTarget.select(),onChange:e=>a(e.currentTarget.value),onBlur:()=>l(!0,!1),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),l(!0,!0)):e.key===`Escape`&&(e.preventDefault(),l(!1,!0))},className:`h-5 w-32 rounded-sm bg-input px-1 text-right outline-none focus-visible:ring-2 focus-visible:ring-ring/50`})}function Y3(e){let t=e.light??e.dark??``;return e.group===`font`?t.split(`,`)[0]?.trim().replace(/^["']|["']$/g,``)??t:t}async function X3(e,t,n,{send:r=fetch,notify:i=e=>n_.add({...e,type:`error`})}={}){try{return await Qx(`/api/tokens/edit`,{project:e,hash:t,...n},`POST`,r)}catch(e){return i({title:`Couldn't change ${n.name.replace(/^--/,``)}`,description:e instanceof Zx&&e.code===`stale-tokens`?`The token sheet changed since the tab read it. Try again on the value it shows now.`:e instanceof Error?e.message:String(e)}),null}}var Z3={color:`Color`,radius:`Radius`,font:`Font`,other:`Other`},Q3=`font-mono text-label font-normal text-foreground`;function $3({project:e,load:t=WG,write:n=X3}){let r=UG(e,t),i=z_(e=>e.canWrite),a=(0,_.useRef)(Promise.resolve()),o=(0,_.useRef)({});if(r===void 0)return null;if(r===null)return(0,Z.jsx)(`p`,{className:`m-3 text-muted-foreground`,children:`The tokens did not load. Reload the board to try again.`});if(r.sheets.length===0)return(0,Z.jsx)(e6,{});let s=r.sheets.find(e=>e.kind===`board`),c=r.sheets.find(e=>e.kind===`project`),l=s?.path.startsWith(`/`)??!1,u={project:i&&(c?.error??null)===null,board:i&&s!==void 0&&s.error===null&&!l},d={project:c?.hash??null,board:s?.hash??null},f=t=>r=>{let i=a.current.then(async()=>{let i=d[t],a=o.current[t],s=await n(e,a&&a.over===i?a.hash:i,{...r,sheet:t});return s&&(o.current={...o.current,[t]:{over:i,hash:s.hash}}),s!==null});return a.current=i,i},p={project:f(`project`),board:f(`board`)};return(0,Z.jsxs)(`div`,{className:`flex flex-col pb-2`,children:[(0,Z.jsxs)(`p`,{className:`mx-3 mt-1 mb-2 rounded-lg bg-muted px-2.5 py-2 leading-[1.45] text-muted-foreground`,children:[`From`,` `,s?(0,Z.jsxs)(Z.Fragment,{children:[`board `,(0,Z.jsx)(`code`,{className:Q3,children:s.path}),c?`, overridden by `:null]}):null,c?(0,Z.jsxs)(Z.Fragment,{children:[`project `,(0,Z.jsx)(`code`,{className:Q3,children:c.path})]}):null,`.`,u.project||u.board?` Click a value to edit it.`:null,i&&l?` Board values stay read-only here, since that sheet sits outside the board folder.`:null]}),r.sheets.filter(e=>e.error!==null).map(e=>(0,Z.jsxs)(`p`,{role:`alert`,className:`mx-3 mb-2 leading-[1.45] text-destructive`,children:[(0,Z.jsx)(`code`,{className:Q3,children:e.path}),` does not parse, so its tokens are missing here: `,e.error,`. Fix the file or ask the agent.`]},e.path)),r.tokens.length===0?(0,Z.jsx)(`p`,{className:`mx-3 text-muted-foreground`,children:`These sheets set no tokens under :root, [data-theme], or .dark.`}):null,F3.map(e=>{let t=r.tokens.filter(t=>t.group===e);if(t.length===0)return null;let n=e===`color`?R3:z3;return(0,Z.jsxs)(`section`,{"aria-labelledby":`tokens-${e}`,children:[(0,Z.jsx)(`h3`,{id:`tokens-${e}`,className:`px-3 pt-2.5 pb-1 text-label text-muted-foreground`,children:Z3[e]}),e===`color`?(0,Z.jsx)(t6,{}):null,(0,Z.jsx)(`ul`,{children:t.map(e=>{let t=e.sheet===c?.path?`project`:`board`;return(0,Z.jsx)(n,{row:e,fromProject:t===`project`,editable:u[t],onWrite:p[t]},e.name)})})]},e)})]})}function e6(){return(0,Z.jsxs)(`div`,{className:`m-3 rounded-[10px] border border-dashed border-border p-4 leading-normal text-muted-foreground`,children:[(0,Z.jsx)(`p`,{className:`mb-1 font-semibold text-foreground`,children:`No tokens yet`}),`Frames render unstyled until a token sheet exists. Add one at`,` `,(0,Z.jsx)(`code`,{className:Q3,children:`tokens.css`}),` in this project, or in the board folder for every project.`]})}function t6(){return(0,Z.jsxs)(`div`,{"aria-hidden":!0,className:`grid grid-cols-[1fr_18px_18px] gap-1.5 px-3 py-1 text-center text-[10px] text-muted-foreground`,children:[(0,Z.jsx)(`span`,{}),(0,Z.jsx)(`span`,{children:`L`}),(0,Z.jsx)(`span`,{children:`D`})]})}function n6(e=sP,t=R_){let n=()=>e.getState().frames,r=e=>LM(e)?.width??Fv(t.getState().board,e)?.width;return[...MN.map(({preset:e,label:t,icon:i})=>{let a=`Preview at ${t.toLowerCase()} width`;return{id:`preview.${e}`,label:a,group:`preview`,command:{label:a,icon:i,hint:()=>NN(e)},enabled:()=>n().length>0,checked:()=>n().length>0&&n().every(t=>{let n=r(t);return n!==void 0&&AN(n)===e}),run:()=>{for(let t of n())BM([t],jN(e,r(t)??0))}}}),{id:`preview.end`,label:`End preview`,group:`preview`,command:{label:`End preview`,icon:Or},enabled:()=>n().some(e=>LM(e)!==void 0),run:()=>VM(n())}]}function r6(){(0,_.useEffect)(()=>{let e=ye(n6()),t=[sP.subscribe(G),zM(G),KM(R_)];return()=>{for(let e of t)e();e()}},[])}var i6={defaultSize:240,minSize:200,maxSize:400},a6=[],o6=[],s6=`frameboard.board.panels`;function c6({project:e,page:t}){let n=z_(t=>t.board?.projects.find(t=>t.name===e)),r=z_(e=>e.reloads),i=z_(e=>e.findings),a=z_(e=>e.claims),o=z_(e=>e.focus),s=(0,_.useCallback)(()=>R_.setState({focus:null}),[]),c=G_(e=>e.hideUi),l=G_(e=>e.mode===`play`),u=Rx({id:s6,panelIds:c?[`canvas`]:[`left`,`canvas`,`right`],onlySaveAfterUserInteractions:!0,storage:u6}),d=n?.pages.find(e=>e.name===t),f=z_(e=>d?__(e.aliases,d.ref):``),[,p]=Va();(0,_.useEffect)(()=>{if(t!==void 0)return R_.subscribe((n,r)=>{let i=w_(r,n,`${e}/${t}`);if(i===null)return;let[a=``,o=``]=i.split(`/`);p(q_(a,o),{replace:!0})})},[e,t,p]);let m=(0,_.useCallback)(()=>e,[e]),h=(0,_.useCallback)(()=>p(`/`),[p]);if(qk(m,{onDeleted:h}),one(h),Kk($O,h),pP(),uk(e,t),wW(d?.ref??``,d?.frames??a6),HG(),PG(d?.ref??``,d?.frames??a6,d?.sections??o6),$v(),$U(),Nv(),rQ(),r6(),!n)return(0,Z.jsx)(l6,{message:`No project ${e} on this board.`});let g=n.pages[0];return t===void 0&&g?(0,Z.jsx)(Za,{to:q_(e,g.name),replace:!0}):(0,Z.jsxs)(Jx,{id:`board`,className:`text-body`,defaultLayout:u.defaultLayout,onLayoutChanged:u.onLayoutChanged,children:[c?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Yx,{id:`left`,...i6,groupResizeBehavior:`preserve-pixel-size`,children:(0,Z.jsx)(P3,{project:n,page:t??``,theme:(0,Z.jsx)($3,{project:n.name}),assets:(0,Z.jsx)(Kj,{project:n.name},n.name),storage:u6})}),(0,Z.jsx)(Xx,{"aria-label":`Resize the left panel`})]}),(0,Z.jsx)(Yx,{id:`canvas`,children:(0,Z.jsxs)(`main`,{className:`relative size-full min-w-0`,children:[d?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(iX,{page:d,reloads:r,findings:i,claims:a,focus:o,onFocused:s},f),(0,Z.jsx)(HZ,{project:n.name}),(0,Z.jsx)(oy,{})]}):(0,Z.jsx)(l6,{message:g?`No page ${t} in ${e}.`:`${e} has no pages yet. An agent adds one with frameboard page add <name>.`}),l?(0,Z.jsx)(wZ,{frames:d?.frames??a6}):null,c?(0,Z.jsx)(_Z,{project:n,page:t??``}):null]})}),c?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Xx,{"aria-label":`Resize the inspector`}),(0,Z.jsx)(Yx,{id:`right`,...i6,groupResizeBehavior:`preserve-pixel-size`,children:(0,Z.jsx)(Y2,{})})]})]})}function l6({message:e}){return(0,Z.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 p-6 text-center`,children:[(0,Z.jsx)(`p`,{className:`text-body text-muted-foreground`,children:e}),(0,Z.jsx)(Ja,{href:`/`,className:e_({variant:`outline`}),children:`Go home`})]})}var u6={getItem:e=>{try{return localStorage.getItem(e)}catch{return null}},setItem:(e,t)=>{try{localStorage.setItem(e,t)}catch{}}},d6=[`home.layoutGrid`,`home.layoutList`,`project.new`,`theme.toggle`];function f6({hasProjects:e}){let[t,n,r,i]=xe(d6);return(0,Z.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center gap-3 border-b border-border bg-card px-4 sm:px-6`,children:[(0,Z.jsxs)(`span`,{className:`flex flex-1 items-center gap-2 text-base font-semibold`,children:[(0,Z.jsx)(g6,{}),`Frameboard`]}),e?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{role:`group`,"aria-label":`Layout`,className:`flex rounded-lg bg-muted p-0.5`,children:[(0,Z.jsx)(m6,{action:t,label:`Grid`,children:(0,Z.jsx)(Jn,{"aria-hidden":!0,className:`size-3.5`})}),(0,Z.jsx)(m6,{action:n,label:`List`,children:(0,Z.jsx)(or,{"aria-hidden":!0,className:`size-3.5`})})]}),(0,Z.jsx)(p6,{action:r,compact:!0})]}):null,(0,Z.jsxs)(`button`,{type:`button`,"aria-label":i?.label??`Theme`,title:i?.label??`Theme`,...h6(i),className:`grid size-[26px] place-items-center rounded-md text-muted-foreground outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:hover:bg-transparent`,children:[(0,Z.jsx)(Oi,{"aria-hidden":!0,className:`size-[15px] dark:hidden`}),(0,Z.jsx)(wr,{"aria-hidden":!0,className:`hidden size-[15px] dark:block`})]})]})}function p6({action:e,className:t,compact:n=!1}){return(0,Z.jsxs)(`button`,{type:`button`,"aria-label":`New project`,...h6(e),className:Q(`flex h-[30px] items-center gap-1.5 rounded-lg bg-primary-fill px-3 font-medium text-primary-foreground outline-none hover:bg-primary-fill-hover focus-visible:ring-3 focus-visible:ring-ring/50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:hover:bg-primary-fill`,t),children:[(0,Z.jsx)(Kr,{"aria-hidden":!0,className:`size-3.5`}),(0,Z.jsx)(`span`,{className:Q(`whitespace-nowrap`,n&&`hidden sm:inline`),children:`New project`})]})}function m6({action:e,label:t,children:n}){let r=e?.checked?.()??!1;return(0,Z.jsx)(`button`,{type:`button`,"aria-label":t,title:t,"aria-pressed":r,...h6(e),className:Q(`grid h-[26px] w-7 place-items-center rounded-md text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,r&&`bg-card text-foreground ring-1 ring-border`),children:n})}function h6(e){let t=e?be(e):!1;return{"aria-disabled":!t||void 0,onClick:()=>{e&&t&&e.run()}}}function g6(){return(0,Z.jsxs)(`svg`,{"aria-hidden":!0,viewBox:`0 0 64 64`,className:`size-6 -translate-y-[1.5px]`,children:[(0,Z.jsx)(`rect`,{x:`4`,y:`12`,width:`48`,height:`48`,rx:`12`,className:`fill-primary`}),(0,Z.jsx)(`rect`,{x:`34`,y:`4`,width:`26`,height:`26`,rx:`7`,strokeWidth:`4`,className:`fill-foreground stroke-card`})]})}function _6(){let[e]=xe([`project.new`]);return(0,Z.jsx)(`div`,{className:`relative flex-1`,children:(0,Z.jsxs)(`div`,{className:`absolute top-1/2 left-1/2 w-105 max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-[55%] text-center leading-[1.6] text-muted-foreground`,children:[(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3.5 h-12 w-16 rounded-lg border-[1.5px] border-dashed border-faint`}),(0,Z.jsx)(`h1`,{className:`mb-1 text-sm font-semibold text-foreground`,children:`No projects yet`}),(0,Z.jsx)(`p`,{children:`A project holds the pages and frames for one thing you are designing.`}),(0,Z.jsx)(p6,{action:e,className:`mx-auto mt-3.5 mb-2.5`}),(0,Z.jsxs)(`p`,{children:[`or from a terminal`,` `,(0,Z.jsx)(`code`,{className:`rounded-[5px] bg-muted px-1.5 py-0.5 font-mono text-label font-normal text-foreground`,children:`frameboard project add <name>`})]})]})})}var v6=`frameboard.home.filter`,y6=`home-filter`,b6=N()(()=>({text:T6()}));function x6(){return F(b6,e=>e.text)}function S6(e){b6.setState({text:e});try{e===``?localStorage.removeItem(v6):localStorage.setItem(v6,e)}catch{}}function C6(e,t){let n=t.trim().toLowerCase();return n===``?[...e]:e.filter(e=>e.name.toLowerCase().includes(n)||(e.group?.toLowerCase().includes(n)??!1))}function w6(){(0,_.useEffect)(()=>ye([{id:`home.filter`,label:`Filter`,group:`home`,keys:[`$mod+KeyF`],command:{label:`Filter projects by name`,icon:fi},run:()=>{let e=document.getElementById(y6);e instanceof HTMLInputElement&&(e.focus(),e.select())}}]),[])}function T6(){try{return localStorage.getItem(v6)??``}catch{return``}}var E6=`frameboard.home.layout`;function D6(){let[e,t]=(0,_.useState)(O6),n=(0,_.useRef)(e);return(0,_.useEffect)(()=>{let e=e=>{n.current=e,t(e),k6(e),G()};return ye([{id:`home.layoutGrid`,label:`Grid`,group:`home`,command:{label:`Show projects as a grid`,icon:Jn},run:()=>e(`grid`),checked:()=>n.current===`grid`},{id:`home.layoutList`,label:`List`,group:`home`,command:{label:`Show projects as a list`,icon:or},run:()=>e(`list`),checked:()=>n.current===`list`}])},[]),e}function O6(){try{return localStorage.getItem(E6)===`list`?`list`:`grid`}catch{return`grid`}}function k6(e){try{localStorage.setItem(E6,e)}catch{}}var A6=[`project.open`,`project.rename`,`project.duplicate`,`project.pin`,`project.group`,`project.ungroup`,`project.archive`,`project.restore`,`project.delete`];function j6({project:e,trigger:t,calls:n}){let[r,i,a,o,s,c,l,u,d]=xe(A6),f=z_(e=>e.board?.projects),p=f?.find(t=>t.name===e),m=p?.group??null,h=pk(f??[]).filter(e=>m===null||dk(e)!==dk(m)),g=z_(e=>e.canWrite),v=(0,_.useRef)(null),y=O4(v);return(0,Z.jsxs)(mJ,{onOpenChange:t=>{t&&jk(e)},onOpenChangeComplete:y.onOpenChangeComplete,children:[(0,Z.jsx)(hJ,{render:t,onKeyDown:y.onKeyDown}),(0,Z.jsxs)(gJ,{ref:v,children:[(0,Z.jsxs)(_J,{children:[(0,Z.jsx)(vJ,{children:`Project`}),(0,Z.jsx)(M6,{action:r,keyHint:`↵`,keyName:`Enter`,children:`Open`}),(0,Z.jsx)(M6,{action:i,children:`Rename`}),(0,Z.jsx)(M6,{action:a,children:`Duplicate`}),(0,Z.jsx)(M6,{action:o,children:o?.checked?.()?`Unpin`:`Pin`})]}),(0,Z.jsx)(CJ,{}),(0,Z.jsxs)(_J,{children:[(0,Z.jsxs)(bJ,{children:[(0,Z.jsx)(xJ,{disabled:!g||!p,className:`h-7 px-2 py-0 text-xs`,children:`Move to folder`}),(0,Z.jsxs)(SJ,{children:[h.map(t=>(0,Z.jsx)(yJ,{onClick:()=>void Rk([e],t,n),children:t},t)),h.length>0?(0,Z.jsx)(CJ,{}):null,(0,Z.jsx)(M6,{action:s,children:`New folder`})]})]}),m===null?null:(0,Z.jsx)(M6,{action:c,children:`Remove from folder`}),p?.archived?(0,Z.jsx)(M6,{action:u,children:`Restore`}):(0,Z.jsx)(M6,{action:l,children:`Archive`})]}),(0,Z.jsx)(CJ,{}),(0,Z.jsx)(M6,{action:d,keyHint:`⌫`,keyName:`Delete`,variant:`destructive`,children:`Delete`})]})]})}function M6({action:e,children:t,keyHint:n,keyName:r,variant:i}){return(0,Z.jsxs)(yJ,{variant:i,disabled:!e||!be(e),"aria-keyshortcuts":r,onClick:()=>e?.run(),children:[t,n?(0,Z.jsx)(wJ,{"aria-hidden":!0,children:n}):null]})}function N6(e){for(let t of e.pages){let e=t.frames.filter(e=>!e.hidden);if(e.length>0)return e}return[]}function P6({project:e,captures:t,className:n}){let r=N6(e);if(r.length===0)return null;let i=r.map(e=>e.box),a=Math.min(...i.map(e=>e.x)),o=Math.min(...i.map(e=>e.y)),s=Math.max(...i.map(e=>e.x+e.width)),c=Math.max(...i.map(e=>e.y+e.height));return(0,Z.jsx)(`svg`,{"aria-hidden":!0,"data-skeleton":!0,viewBox:`${a} ${o} ${s-a} ${c-o}`,preserveAspectRatio:`xMidYMin meet`,className:n,children:r.map(({ref:e,box:n})=>{let r=t?.stamps[e];return(0,Z.jsxs)(`g`,{children:[(0,Z.jsx)(`rect`,{x:n.x,y:n.y,width:n.width,height:n.height,className:`fill-white stroke-black/6`,strokeWidth:1,vectorEffect:`non-scaling-stroke`}),t&&r?(0,Z.jsx)(`image`,{href:F6(e,t.theme,r),x:n.x,y:n.y,width:n.width,height:n.height,preserveAspectRatio:`none`}):null]},e)})})}function F6(e,t,n){return`/api/thumbnails/png?${new URLSearchParams({ref:e,theme:t,v:n})}`}var I6=`block overflow-hidden rounded-xl border border-border bg-card text-card-foreground outline-none hover:ring-2 hover:ring-primary focus-visible:ring-2 focus-visible:ring-primary data-popup-open:ring-2 data-popup-open:ring-primary`,L6=`grid-cols-[48px_1fr] sm:grid-cols-[48px_1fr_160px_160px]`,R6=`grid h-12 items-center px-4 outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset data-popup-open:ring-2 data-popup-open:ring-primary data-popup-open:ring-inset`;function z6({project:e,tabbable:t,calls:n,unseen:r,pinned:i,now:a,captures:o}){return(0,Z.jsxs)(V6,{project:e,tabbable:t,calls:n,className:I6,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`m-1.5 block h-[150px] overflow-hidden rounded-lg bg-background p-3.5`,children:(0,Z.jsx)(P6,{project:e,captures:o,className:`size-full`})}),(0,Z.jsxs)(`span`,{className:`flex flex-col px-3 pt-1.5 pb-3`,children:[(0,Z.jsx)(U6,{project:e,calls:n,type:`text-panel`,unseen:r,pinned:i}),(0,Z.jsx)(G6,{project:e,now:a,prefix:`Edited `})]})]})}function B6({project:e,tabbable:t,calls:n,unseen:r,pinned:i,now:a,className:o}){return(0,Z.jsxs)(V6,{project:e,tabbable:t,calls:n,className:Q(R6,L6,o),children:[(0,Z.jsx)(W6,{project:e}),(0,Z.jsx)(U6,{project:e,calls:n,type:`font-medium`,unseen:r,pinned:i,className:`pr-4`}),(0,Z.jsx)(`span`,{className:`hidden truncate sm:block`,children:(0,Z.jsx)(G6,{project:e,now:a,prefix:``})}),(0,Z.jsx)(`span`,{className:`hidden sm:block`,children:(0,Z.jsx)(K6,{project:e})})]})}function V6({project:e,tabbable:t,calls:n,className:r,children:i}){return Ak(e.name)===null?(0,Z.jsx)(j6,{project:e.name,calls:n,trigger:(0,Z.jsx)(Ja,{href:Wk(e),"data-project-link":!0,tabIndex:t?0:-1,onFocus:()=>jk(e.name),onKeyDown:t=>{let n=H6[t.key];if(!n)return;jk(e.name);let r=Se(n);r&&be(r)&&r.run(),t.preventDefault()},className:r,children:i})}):(0,Z.jsx)(`div`,{className:r,children:i})}var H6={F2:`project.rename`,Delete:`project.delete`,Backspace:`project.delete`};function U6({project:e,calls:t,type:n,unseen:r,pinned:i,className:a}){let o=Ak(e.name);return o?(0,Z.jsxs)(`span`,{className:Q(`flex min-w-0 flex-col`,n),children:[(0,Z.jsx)(`span`,{className:`flex h-lh items-center pl-1.5`,children:(0,Z.jsx)(IH,{name:o.draft,label:`Rename project ${e.name}`,onCommit:n=>void Gk(e.name,n,t),onCancel:Uk},o.attempt)}),o.refusal?(0,Z.jsx)(`span`,{role:`alert`,className:`mt-1 text-label font-normal text-destructive`,children:o.refusal}):null]}):(0,Z.jsxs)(`span`,{className:Q(`flex min-w-0 items-center gap-1.5`,a),children:[(0,Z.jsx)(`span`,{className:Q(`truncate`,n),title:e.name,children:e.name}),(0,Z.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5`,children:[i?(0,Z.jsx)(Hr,{role:`img`,"aria-label":`Pinned`,className:`size-[13px] shrink-0 fill-current text-foreground`}):null,(0,Z.jsx)(v3,{count:r})]})]})}function W6({project:e}){return(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`block h-[22px] w-8 overflow-hidden rounded bg-background p-[5px]`,children:(0,Z.jsx)(P6,{project:e,className:`size-full`})})}function G6({project:e,now:t,prefix:n}){return(0,Z.jsxs)(`span`,{"data-edited":!0,className:`truncate text-body text-muted-foreground`,title:new Date(e.modifiedAt).toLocaleString(),children:[n,J6(Date.parse(e.modifiedAt),t)]})}function K6({project:e}){if(!e.createdAt)return(0,Z.jsx)(`span`,{});let t=new Date(e.createdAt);return(0,Z.jsx)(`time`,{dateTime:e.createdAt,className:`text-body text-muted-foreground`,title:t.toLocaleString(),children:Y6(t)})}var q6=[[`year`,31536e3],[`month`,2592e3],[`week`,604800],[`day`,86400],[`hour`,3600],[`minute`,60]];function J6(e,t){let n=Math.max(0,(t-e)/1e3),r=new Intl.RelativeTimeFormat(`en`,{numeric:`auto`});for(let[e,t]of q6)if(n>=t)return r.format(-Math.floor(n/t),e);return`just now`}function Y6(e){let t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function X6(e,t){if(e.key!==`F2`)return;Mk(t);let n=Se(`folder.rename`);n&&be(n)&&n.run(),e.preventDefault()}function Z6(e,t){let n=e.target;if(!(n instanceof HTMLElement)||!n.matches(`[data-project-link]`))return;let r=[...e.currentTarget.querySelectorAll(t8)],i=r.indexOf(n),a=t===`grid`,o=Q6(e),s={ArrowLeft:a?i-1:i,ArrowRight:a?i+1:i,ArrowUp:a?e8(r,i,-1):i-1,ArrowDown:a?e8(r,i,1):i+1,Home:0,End:r.length-1}[o];s!==void 0&&(e.preventDefault(),r[Math.min(Math.max(s,0),r.length-1)]?.focus())}function Q6(e){let t=e.ctrlKey||e.metaKey||e.altKey,n=$6[e.key];return n&&!t&&de()?n:e.key}var $6={h:`ArrowLeft`,j:`ArrowDown`,k:`ArrowUp`,l:`ArrowRight`};function e8(e,t,n){let r=e.map(e=>e.getBoundingClientRect()),i=r[t];if(!i)return t;let a=r.map(e=>e.top).filter(e=>(e-i.top)*n>0);if(a.length===0)return t;let o=n>0?Math.min(...a):Math.max(...a),s=t;return r.forEach((e,n)=>{if(e.top!==o)return;let a=r[s];(s===t||a&&Math.abs(e.left-i.left)<Math.abs(a.left-i.left))&&(s=n)}),s}var t8=`[data-project-link]`,n8=`frameboard.home.archivedOpen`;function r8({projects:e,layout:t,now:n,calls:r,captures:i}){let[a,o]=(0,_.useState)(i8),s=Ov(e=>e.unseen),c=F(kk,e=>e.focused),l=_k();if(e.length===0)return null;let u=e.some(e=>e.name===c)?c:e[0]?.name,d=e=>({project:e,tabbable:e.name===u,calls:r,unseen:vv(s,e.name),pinned:l.has(e.name),now:n});return(0,Z.jsxs)(`section`,{"aria-labelledby":`home-archived`,className:`mt-8`,children:[(0,Z.jsx)(`h2`,{className:`mb-4`,children:(0,Z.jsxs)(`button`,{id:`home-archived`,type:`button`,"aria-expanded":a,onClick:()=>{o(!a),a8(!a)},className:`flex h-7 items-center gap-1.5 rounded-lg pr-2.5 pl-1 font-medium text-muted-foreground outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:[(0,Z.jsx)(zt,{"aria-hidden":!0,className:Q(`size-4 transition-transform motion-reduce:transition-none`,a&&`rotate-90`)}),(0,Z.jsx)(lt,{"aria-hidden":!0,className:`size-3.5`}),`Archived`,(0,Z.jsx)(`span`,{className:`rounded-full bg-muted px-[7px] text-label`,children:e.length})]})}),a?t===`grid`?(0,Z.jsx)(`ul`,{"aria-label":`Archived projects`,onKeyDown:e=>Z6(e,`grid`),className:`grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-5`,children:e.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(z6,{...d(e),captures:i})},e.name))}):(0,Z.jsx)(`ul`,{"aria-label":`Archived projects`,onKeyDown:e=>Z6(e,`list`),className:`overflow-hidden rounded-xl border border-border bg-card text-card-foreground`,children:e.map(e=>(0,Z.jsx)(`li`,{className:`not-last:border-b`,children:(0,Z.jsx)(B6,{...d(e)})},e.name))}):null]})}function i8(){try{return localStorage.getItem(n8)===`true`}catch{return!1}}function a8(e){try{localStorage.setItem(n8,String(e))}catch{}}function o8(){let e=x6();return(0,Z.jsxs)(`div`,{className:`flex h-7 w-44 items-center gap-1.5 rounded-lg border border-input bg-card pr-1 pl-2 focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 sm:w-56`,children:[(0,Z.jsx)(fi,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`input`,{id:y6,type:`search`,"aria-label":`Filter projects`,placeholder:`Filter`,value:e,spellCheck:!1,autoComplete:`off`,onChange:e=>S6(e.target.value),onKeyDown:t=>{t.key===`Escape`&&(t.preventDefault(),e===``?t.currentTarget.blur():S6(``))},className:`min-w-0 flex-1 bg-transparent text-body outline-none placeholder:text-muted-foreground [&::-webkit-search-cancel-button]:hidden`}),e===``?null:(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Clear`,title:`Clear`,onClick:()=>{S6(``),document.getElementById(y6)?.focus()},className:`grid size-6 shrink-0 place-items-center rounded-md text-muted-foreground outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,Z.jsx)(ia,{"aria-hidden":!0,className:`size-3.5`})})]})}var s8=_.createContext(void 0);function c8(e){let t=_.useContext(s8);if(!e&&t===void 0)throw Error(ao(27));return t}var l8=_.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=c8(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return uu(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:sc,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),u8=_.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=c8(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=hd({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,bd(Od,e.nativeEvent))}return uu(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),d8=_.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=c8(),c=qH(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),uu(`p`,e,{ref:t,props:[{id:c},o]})}),f8=_.createContext(void 0);function p8(){let e=_.useContext(f8);if(e===void 0)throw Error(ao(26));return e}var m8=`--nested-dialogs`,h8=`data-nested-dialog-open`,g8={...oc,...qs,nestedDialogOpen(e){return e?{[h8]:``}:null}},_8=_.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=c8(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);p8(),Ou({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?np(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=uu(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...tp,hidden:!m,onKeyDown(e){OU.has(e.key)&&e.stopPropagation()},style:{[m8]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:g8});return(0,Z.jsx)(Wf,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),v8=_.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=c8(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,Z.jsx)(f8.Provider,{value:n,children:(0,Z.jsxs)($d,{ref:t,...r,children:[a&&o===!0&&(0,Z.jsx)(aU,{ref:i.context.internalBackdropRef,inert:yu(!s)}),e.children]})}):null});function y8({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=_.useState(0),[d,f]=_.useState(0),p=l===0,m=Zf(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=Is(t);if(p&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||X(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return _U(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),q(()=>{!r&&!i&&(u(0),f(0))},[r,i]),q(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),pp(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var b8={...wp,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},x8=class extends Mo{constructor(e,t,n){let r=new hp,i=S8(e,r,t,n);super(i,C8(r),b8)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(sp(this.state,e,t.trigger)))}};function S8(e,t,n,r=!1){return{...vp(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function C8(e){return{popupRef:_.createRef(),backdropRef:_.createRef(),internalBackdropRef:_.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function w8(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,v=m?`alertdialog`:`dialog`,y=c8(!0),b={modal:h,disablePointerDismissal:g,nested:y!=null,role:v},x=rp((e,t)=>new x8({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...b},e,t),!0);x.useControlledProp(`openProp`,r),x.useControlledProp(`triggerIdProp`,d),x.useSyncedValues(b),x.useContextCallback(`onOpenChange`,a),x.useContextCallback(`onOpenChangeComplete`,o);let S=x.useState(`open`),C=x.useState(`mounted`),w=x.useState(`payload`);mp(x,S),dp(x);let{forceUnmount:T}=fp(S,x);_.useImperativeHandle(l,()=>({unmount:T,close:()=>x.setOpen(!1,bd(qd))}),[T,x]);let E=S||C||u!=null;return(0,Z.jsxs)(s8.Provider,{value:x,children:[u&&(0,Z.jsx)(ip,{handle:u,store:x}),E&&(0,Z.jsx)(y8,{store:x,parentContext:y?.context,isDrawer:p}),typeof n==`function`?n({payload:w}):n]})}var T8=_o(function(e){return w8(`dialog`,e)}),E8=_.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=c8(),c=qH(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),uu(`h2`,e,{ref:t,props:[{id:c},o]})}),D8=vo(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l,...u}=e,d=c8(!0),f=Tp(l)??d;if(!f)throw Error(ao(79));let p=qH(s),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`triggerPopupId`,p),v=_.useRef(null),{registerTrigger:y,isMountedByThisTrigger:b}=up(p,v,f,{payload:c}),{getButtonProps:x,buttonRef:S}=hd({disabled:a,native:o}),C=Gf(m),w=ZH(()=>f.select(`open`),e=>{f.set(`openMethod`,e)}),T={disabled:a,open:h},E=f.useState(`triggerProps`,b);return uu(`button`,e,{state:T,ref:[S,t,y,v],props:[C.reference,E,w,{[Au]:``,id:p,"aria-haspopup":`dialog`,"aria-expanded":h,"aria-controls":g},u,x],stateAttributesMapping:ic})});function O8({...e}){return(0,Z.jsx)(T8,{"data-slot":`dialog`,...e})}function k8({...e}){return(0,Z.jsx)(D8,{"data-slot":`dialog-trigger`,...e})}function A8({...e}){return(0,Z.jsx)(v8,{"data-slot":`dialog-portal`,...e})}function j8({className:e,...t}){return(0,Z.jsx)(l8,{"data-slot":`dialog-overlay`,className:Q(`fixed inset-0 isolate z-50 bg-black/20 duration-100 motion-reduce:animate-none! dark:bg-black/45 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function M8({className:e,children:t,showCloseButton:n=!0,...r}){return(0,Z.jsxs)(A8,{children:[(0,Z.jsx)(j8,{}),(0,Z.jsxs)(_8,{"data-slot":`dialog-content`,className:Q(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl border border-border bg-popover p-4 text-[12px] text-popover-foreground shadow-[0_24px_64px_rgba(0,0,0,0.35)] duration-100 outline-none motion-reduce:animate-none! sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,Z.jsxs)(u8,{"data-slot":`dialog-close`,render:(0,Z.jsx)(t_,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,Z.jsx)(ia,{}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function N8({className:e,...t}){return(0,Z.jsx)(`div`,{"data-slot":`dialog-header`,className:Q(`flex flex-col gap-2`,e),...t})}function P8({className:e,...t}){return(0,Z.jsx)(E8,{"data-slot":`dialog-title`,className:Q(`font-heading text-base leading-none font-medium`,e),...t})}function F8({className:e,...t}){return(0,Z.jsx)(d8,{"data-slot":`dialog-description`,className:Q(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function I8({folder:e,calls:t,type:n,unseen:r,editing:i=!0,className:a}){let o=Nk(e.key);return!o||!i?(0,Z.jsxs)(`span`,{className:Q(`flex min-w-0 items-center gap-1.5`,a),children:[(0,Z.jsx)(`span`,{className:Q(`truncate`,n),title:e.name,children:e.name}),(0,Z.jsx)(`span`,{className:`ml-auto flex items-center gap-1.5`,children:(0,Z.jsx)(v3,{count:r})})]}):(0,Z.jsxs)(`span`,{className:Q(`flex min-w-0 flex-col`,n,a),children:[(0,Z.jsx)(`span`,{className:`flex h-lh items-center pl-1.5`,children:(0,Z.jsx)(IH,{name:o.draft,label:`Rename folder ${e.name}`,onCommit:n=>void nne(e.key,n,t),onCancel:Fk},o.attempt)}),o.refusal?(0,Z.jsx)(`span`,{role:`alert`,className:`mt-1 text-label font-normal text-destructive`,children:o.refusal}):null]})}function L8({folder:e,now:t,calls:n,captures:r}){let i=z_(e=>e.canWrite),a=Ov(e=>e.unseen),o=F(kk,e=>e.focused),s=_k(),c=e.projects.some(e=>e.name===o)?o:e.projects[0]?.name;return(0,Z.jsxs)(M8,{showCloseButton:!1,className:`gap-3 p-4 sm:max-w-[560px]`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Z.jsx)(P8,{render:(0,Z.jsx)(`div`,{}),className:`min-w-0 flex-1 text-title font-semibold`,children:(0,Z.jsx)(I8,{folder:e,calls:n,type:`text-title`,unseen:0})}),(0,Z.jsx)(F8,{className:`sr-only`,children:mk(e)}),(0,Z.jsxs)(`span`,{className:`flex shrink-0 items-center text-muted-foreground`,children:[(0,Z.jsx)(t_,{variant:`ghost`,size:`sm`,disabled:!i,onClick:()=>{Mk(e.key),Pk(e.key,e.name)},children:`Rename`}),(0,Z.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,Z.jsx)(t_,{variant:`ghost`,size:`sm`,disabled:!i,onClick:()=>void Vk(e.key,n),children:`Ungroup`})]})]}),(0,Z.jsx)(`ul`,{onKeyDown:e=>Z6(e,`grid`),className:`grid max-h-[70vh] grid-cols-[repeat(auto-fill,minmax(150px,1fr))] gap-3 overflow-y-auto p-0.5`,children:e.projects.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(z6,{project:e,tabbable:e.name===c,calls:n,unseen:vv(a,e.name),pinned:s.has(e.name),now:t,captures:r})},e.name))})]})}function R8({folder:e,tabbable:t,unseen:n,...r}){let i=F(kk,t=>t.openFolder===e.key||t.pendingRename?.from===e.key&&t.openFolder===t.pendingRename.to),a=t=>kk.setState({openFolder:t?e.key:null}),o=Nk(e.key),s=(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`m-1.5 grid h-[150px] grid-cols-2 grid-rows-2 gap-1.5 overflow-hidden rounded-lg bg-muted p-1.5`,children:e.projects.slice(0,4).map(e=>(0,Z.jsx)(`span`,{className:`block overflow-hidden rounded-md bg-background p-2`,children:(0,Z.jsx)(P6,{project:e,captures:r.captures,className:`size-full`})},e.name))}),(0,Z.jsxs)(`span`,{className:`flex flex-col px-3 pt-1.5 pb-3`,children:[(0,Z.jsx)(I8,{folder:e,calls:r.calls,type:`text-panel`,unseen:n,editing:!i}),(0,Z.jsx)(`span`,{className:`truncate text-body text-muted-foreground`,children:mk(e)})]})]});return o&&!i?(0,Z.jsx)(`div`,{className:I6,children:s}):(0,Z.jsxs)(O8,{open:i,onOpenChange:a,children:[(0,Z.jsx)(k8,{"data-project-link":!0,tabIndex:t?0:-1,onFocus:()=>Mk(e.key),onKeyDown:t=>X6(t,e.key),className:Q(I6,`w-full text-left`),children:s}),(0,Z.jsx)(L8,{folder:e,...r})]})}var z8=`frameboard-home-project`;function B8(e){return e.type!==z8||typeof e.name!=`string`?null:{name:e.name,group:typeof e.group==`string`?e.group:null}}function V8(e,t){let n=t.kind===`folder`?t.key:t.group,r=e.group===null?null:dk(e.group);return t.kind===`project`&&t.name===e.name?!1:n===null||dk(n)!==r}function H8(e,{source:t,target:n,enabled:r,onDrop:i}){let[a,o]=(0,_.useState)(!1),s=(0,_.useRef)(i);(0,_.useEffect)(()=>{s.current=i});let c=t?.name,l=t?.group??null,u=n.kind,d=n.name,f=n.kind===`folder`?n.key:n.group;return(0,_.useEffect)(()=>{let t=e.current;if(!t||!r)return;let n=u===`folder`?{kind:`folder`,key:f??``,name:d}:{kind:`project`,name:d,group:f},i=e=>{let t=B8(e);return t!==null&&V8(t,n)},a=e=>e.current.dropTargets[0]?.element===t,p=[xj({element:t,canDrop:({source:e})=>i(e.data),onDragEnter:({location:e})=>o(a(e)),onDropTargetChange:({location:e})=>o(a(e)),onDragLeave:()=>o(!1),onDrop:({source:e,location:t})=>{o(!1);let n=B8(e.data);n&&a(t)&&s.current(n.name)}})];return c!==void 0&&p.push(Cj({element:t.querySelector(`[data-project-link]`)??t,getInitialData:()=>({type:z8,name:c,group:l})})),ZA(...p)},[e,r,c,l,u,d,f]),a}function U8({folder:e,open:t,onToggle:n,tabbable:r,unseen:i,now:a,calls:o,children:s}){let c=Nk(e.key)!==null,l=(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{className:`flex items-center gap-1 text-muted-foreground`,children:[(0,Z.jsx)(zt,{"aria-hidden":!0,className:Q(`size-4 shrink-0 transition-transform motion-reduce:transition-none`,t&&`rotate-90`)}),(0,Z.jsx)(Mn,{"aria-hidden":!0,className:`size-[22px] shrink-0`,strokeWidth:1.6})]}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 pr-4`,children:[(0,Z.jsx)(I8,{folder:e,calls:o,type:`font-medium`,unseen:i,className:`min-w-0 flex-1`}),c?null:(0,Z.jsxs)(`span`,{className:`shrink-0 rounded-full bg-muted px-[7px] text-label text-muted-foreground`,children:[e.projects.length,(0,Z.jsx)(`span`,{className:`sr-only`,children:` projects`})]})]}),(0,Z.jsx)(`span`,{className:`hidden truncate sm:block`,children:(0,Z.jsx)(G6,{project:e,now:a,prefix:``})}),(0,Z.jsx)(`span`,{className:`hidden sm:block`})]}),u=Q(R6,L6,`w-full text-left`);return(0,Z.jsxs)(Z.Fragment,{children:[c?(0,Z.jsx)(`div`,{className:u,children:l}):(0,Z.jsx)(`button`,{type:`button`,"data-project-link":!0,"aria-expanded":t,tabIndex:r?0:-1,onFocus:()=>Mk(e.key),onClick:n,onKeyDown:r=>{r.key===`ArrowRight`&&!t||r.key===`ArrowLeft`&&t?(r.preventDefault(),r.stopPropagation(),n()):X6(r,e.key)},className:u,children:l}),t?(0,Z.jsx)(`ul`,{"aria-label":e.name,className:`relative border-t border-border before:absolute before:inset-y-0 before:left-[26px] before:w-px before:bg-border`,children:s}):null]})}var W8=[`home.sortEdited`,`home.sortCreated`,`home.sortName`],G8=[`home.sortReverse`],K8={dates:[`Newest first`,`Oldest first`],name:[`A to Z`,`Z to A`]},q8=`h-7 px-2 py-0 text-xs`;function cre(){let e=xe(W8).filter(e=>e!==void 0),[t]=xe(G8),n=e.find(e=>e.checked?.()),r=t?.checked?.()??!1,[i,a]=n?.id===`home.sortName`?K8.name:K8.dates;return(0,Z.jsxs)(dX,{children:[(0,Z.jsxs)(fX,{className:`flex h-7 items-center gap-1.5 rounded-lg pr-2 pl-2.5 font-medium text-foreground outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50 data-popup-open:bg-muted`,children:[(0,Z.jsx)(yt,{"aria-hidden":!0,className:`size-3.5 text-muted-foreground`}),`Sort: `,n?.label??`Last edited`,(0,Z.jsx)(Lt,{"aria-hidden":!0,className:`size-3 text-muted-foreground`})]}),(0,Z.jsxs)(XX,{align:`end`,className:`w-45`,children:[(0,Z.jsxs)(mX,{children:[(0,Z.jsx)(hX,{className:`px-2 pt-1.5 pb-1 text-[11px] font-semibold text-muted-foreground`,children:`Sort by`}),(0,Z.jsx)(bX,{value:n?.id??``,children:e.map(e=>(0,Z.jsx)(xX,{value:e.id,closeOnClick:!0,onClick:()=>e.run(),className:q8,children:e.label},e.id))})]}),t?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(SX,{}),(0,Z.jsx)(bX,{value:r?a:i,children:[i,a].map(e=>(0,Z.jsx)(xX,{value:e,closeOnClick:!0,onClick:()=>{e===a!==r&&t.run()},className:q8,children:e},e))})]}):null]})]})}function lre({projects:e,layout:t,now:n,calls:r,filter:i=``,archived:a=[]}){let o=Ov(e=>e.unseen),s=gM(),c={theme:s,stamps:z_(e=>e.thumbnails[s])},l=F(kk,e=>e.focused),u=F(kk,e=>e.folder),d=F(kk,e=>e.focusTarget);(0,_.useEffect)(()=>{if(d===null)return;let t=e.find(e=>e.name===d),n=t&&document.querySelector(`main [data-project-link][href="${CSS.escape(Wk(t))}"]`);n&&(n.focus(),kk.setState({focusTarget:null}))},[d,e]);let f=_k(),[p,m]=(0,_.useState)(new Set),h=i.trim()!==``,g=h?C6([...e,...a],i):e,v=h?g.map(e=>({kind:`project`,project:e})):fk(g),y=JSON.stringify(v.flatMap(e=>e.kind===`folder`?[e.folder.key]:[]));(0,_.useEffect)(()=>{rne(new Set(JSON.parse(y)))},[y]);let b=e=>t===`list`&&p.has(e),x=e=>m(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),S=fre(v,l,u,b),C=e=>e.kind===`project`?f.has(e.project.name):e.folder.projects.some(e=>f.has(e.name)),w=v.findIndex(e=>!C(e)),T=w>0?w:-1,E=e=>({project:e,tabbable:e.name===S,calls:r,unseen:vv(o,e.name),pinned:f.has(e.name),now:n}),D=e=>e.reduce((e,t)=>e+vv(o,t.name),0);return(0,Z.jsxs)(`main`,{className:`px-4 py-8 sm:px-12`,children:[(0,Z.jsxs)(`div`,{className:`mb-5 flex flex-wrap items-center gap-3`,children:[(0,Z.jsx)(`h1`,{className:`mr-auto text-title`,children:`Projects`}),(0,Z.jsx)(o8,{}),(0,Z.jsx)(cre,{})]}),v.length===0?h?(0,Z.jsx)(ure,{filter:i}):null:t===`grid`?(0,Z.jsx)(`ul`,{onKeyDown:e=>Z6(e,`grid`),className:`grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-5`,children:v.map((e,t)=>(0,Z.jsxs)(_.Fragment,{children:[t===T?(0,Z.jsx)(`li`,{"aria-hidden":!0,"data-pin-divider":!0,className:`col-span-full h-px bg-border`}):null,(0,Z.jsx)(J8,{entry:e,calls:r,hint:`well`,children:e.kind===`project`?(0,Z.jsx)(z6,{...E(e.project),captures:c}):(0,Z.jsx)(R8,{folder:e.folder,tabbable:Y8(e)===S,unseen:D(e.folder.projects),now:n,calls:r,captures:c})})]},Y8(e)))}):(0,Z.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-card text-card-foreground`,children:[(0,Z.jsxs)(`div`,{"aria-hidden":!0,className:Q(`grid h-9 items-center border-b border-border px-4 text-label text-muted-foreground`,L6),children:[(0,Z.jsx)(`span`,{}),(0,Z.jsx)(`span`,{children:`Name`}),(0,Z.jsx)(`span`,{className:`hidden sm:block`,children:`Edited`}),(0,Z.jsx)(`span`,{className:`hidden sm:block`,children:`Created`})]}),(0,Z.jsx)(`ul`,{onKeyDown:e=>Z6(e,`list`),children:v.map((e,t)=>(0,Z.jsxs)(_.Fragment,{children:[t===T?(0,Z.jsx)(`li`,{"aria-hidden":!0,"data-pin-divider":!0,className:`h-1.5 border-b border-border bg-muted`}):null,(0,Z.jsx)(J8,{entry:e,calls:r,hint:`row`,className:`not-last:border-b`,children:e.kind===`project`?(0,Z.jsx)(B6,{...E(e.project)}):(0,Z.jsx)(U8,{folder:e.folder,open:b(e.folder.key),onToggle:()=>x(e.folder.key),tabbable:Y8(e)===S,unseen:D(e.folder.projects),now:n,calls:r,children:e.folder.projects.map(e=>(0,Z.jsx)(J8,{entry:{kind:`project`,project:e},calls:r,hint:`row`,className:`not-last:border-b`,children:(0,Z.jsx)(B6,{...E(e),className:`pl-11`})},e.name))})})]},Y8(e)))})]}),h?null:(0,Z.jsx)(r8,{projects:a,layout:t,now:n,calls:r,captures:c})]})}function ure({filter:e}){return(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-3 rounded-xl border border-dashed border-border px-6 py-12 text-center`,children:[(0,Z.jsxs)(`p`,{className:`text-body text-muted-foreground`,children:[`No projects match “`,e.trim(),`”.`]}),(0,Z.jsx)(`button`,{type:`button`,onClick:()=>S6(``),className:`h-7 rounded-lg border border-border bg-card px-3 font-medium outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50`,children:`Clear filter`})]})}var dre={well:`inset-x-3 top-[82px] mx-auto w-fit max-w-[calc(100%-1.5rem)] -translate-y-1/2`,row:`top-3 right-4 max-w-80 max-sm:sr-only`};function J8({entry:e,calls:t,hint:n,className:r,children:i}){let a=(0,_.useRef)(null),o=z_(e=>e.canWrite),s=e.kind===`project`?e.project:null,c=Ak(s?.name??``)!==null,l=Nk(e.kind===`folder`?e.folder.key:``)!==null,u=e.kind===`folder`?{kind:`folder`,key:e.folder.key,name:e.folder.name}:{kind:`project`,name:e.project.name,group:e.project.group},d=e.kind===`folder`?e.folder.name:e.project.group,f=H8(a,{source:s?{name:s.name,group:s.group}:void 0,target:u,enabled:o&&!c&&!l,onDrop:e=>{d===null?s&&Bk([s.name,e],t):Rk([e],d,t)}});return(0,Z.jsxs)(`li`,{ref:a,"data-drop-over":f||void 0,className:Q(`relative data-drop-over:[&>:first-child]:ring-2 data-drop-over:[&>:first-child]:ring-primary`,n===`row`&&`data-drop-over:[&>:first-child]:ring-inset`,r),children:[i,f?(0,Z.jsx)(`span`,{role:`status`,className:`pointer-events-none absolute truncate rounded-md bg-foreground px-2 py-1 text-label text-background shadow-md ${dre[n]}`,children:d===null?`Drop on ${u.name} to make a folder`:`Drop to move into ${d}`}):null]})}function Y8(e){return e.kind===`project`?e.project.name:`folder/${e.folder.key}`}function fre(e,t,n,r){for(let i of e){if(i.kind===`project`){if(i.project.name===t)return t;continue}let e=i.folder.projects.some(e=>e.name===t);if(e&&r(i.folder.key))return t??void 0;if(e||i.folder.key===n)return Y8(i)}return e[0]&&Y8(e[0])}var X8=`frameboard.home.sort`,Z8=`frameboard.home.sortDirection`,pre=[`edited`,`created`,`name`],Q8={edited:`desc`,created:`desc`,name:`asc`};function mre(){let[e,t]=(0,_.useState)(yre),n=(0,_.useRef)(e);return(0,_.useEffect)(()=>{let e=e=>{n.current=e,t(e),bre(e),G()},r=(t,r,i,a)=>({id:t,label:i,group:`home`,command:{label:`Sort projects by ${i.toLowerCase()}`,icon:a},run:()=>e({by:r,direction:Q8[r]}),checked:()=>n.current.by===r});return ye([r(`home.sortEdited`,`edited`,`Last edited`,$t),r(`home.sortCreated`,`created`,`Created`,Tt),r(`home.sortName`,`name`,`Name`,kt),{id:`home.sortReverse`,label:`Reverse`,group:`home`,command:{label:`Reverse project order`,icon:dt},run:()=>{let{by:t,direction:r}=n.current;e({by:t,direction:r===`asc`?`desc`:`asc`})},checked:()=>n.current.direction!==Q8[n.current.by]}])},[]),e}function hre(e,t,n,r=Q8[t]){let i=_re[t],a=r===`asc`?1:-1;return[...e].sort((e,r)=>Number(n.has(r.name))-Number(n.has(e.name))||(t===`created`?vre(e,r):0)||a*i(e,r)||$8(e,r))}function gre(e){return{shown:e.filter(e=>!e.archived),archived:e.filter(e=>e.archived)}}var $8=(e,t)=>e.name.localeCompare(t.name,`en`,{sensitivity:`base`})||(e.name<t.name?-1:+(e.name>t.name)),_re={edited:(e,t)=>Date.parse(e.modifiedAt)-Date.parse(t.modifiedAt),created:(e,t)=>e5(e)-e5(t),name:$8},vre=(e,t)=>Number(e.createdAt===null)-Number(t.createdAt===null);function e5(e){return e.createdAt?Date.parse(e.createdAt):0}function yre(){try{let e=localStorage.getItem(X8),t=pre.find(t=>t===e)??`edited`,n=localStorage.getItem(Z8);return{by:t,direction:n===`asc`||n===`desc`?n:Q8[t]}}catch{return{by:`edited`,direction:Q8.edited}}}function bre({by:e,direction:t}){try{localStorage.setItem(X8,e),localStorage.setItem(Z8,t)}catch{}}var xre=100;function Sre(e=fetch){let t=gM(),n=z_(e=>e.connected),r=z_(e=>e.board),i=z_(e=>e.reloads),a=(0,_.useRef)(new Map);(0,_.useEffect)(()=>{a.current=new Map},[t,n]),(0,_.useEffect)(()=>{if(!n||!r)return;let o=new Map(r.projects.flatMap(e=>N6(e)).map(({ref:e,box:t})=>[e,`${t.width}x${t.height}#${i[e]??0}`]));if(![...o].some(([e,t])=>a.current.get(e)!==t))return;let s=setTimeout(()=>{for(let[e,t]of o)a.current.set(e,t);Cre(e,t)},xre);return()=>clearTimeout(s)},[e,t,n,r,i])}async function Cre(e,t){try{let n=await(await e(`/api/thumbnails?theme=${t}`)).json();n.ok&&n.data&&N_(R_,t,n.data.stamps)}catch{}}function wre({projects:e,calls:t}){let[n]=(0,_.useState)(Date.now),r=aK(),i=D6(),a=mre(),o=_k(),s=x6();return w6(),Kk(t),qk(ine,{calls:t}),ane(t),Ere(),Sre(),r?null:(0,Z.jsxs)(`div`,{className:`flex min-h-full flex-col text-body`,children:[(0,Z.jsx)(f6,{hasProjects:e.length>0}),e.length===0?(0,Z.jsx)(_6,{}):(0,Z.jsx)(lre,{...Tre(hre(e,a.by,o,a.direction)),layout:i,now:n,calls:t,filter:s})]})}function Tre(e){let{shown:t,archived:n}=gre(e);return{projects:t,archived:n}}function Ere(){let e=()=>[...document.querySelectorAll(`[data-project-link]`)];(0,_.useEffect)(()=>{let t=()=>(document.activeElement??document.body)===document.body&&e().length>0,n=t=>()=>t(e())?.focus();return ye([{id:`home.focusCards`,label:`Focus the projects`,group:`project`,palette:!1,keys:[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`h`,`j`,`k`,`l`],enabled:t,run:n(e=>e.find(e=>e.tabIndex===0))},{id:`home.focusFirst`,label:`Focus the first project`,group:`project`,palette:!1,keys:[`Home`],enabled:t,run:n(e=>e[0])},{id:`home.focusLast`,label:`Focus the last project`,group:`project`,palette:!1,keys:[`End`],enabled:t,run:n(e=>e.at(-1))}])},[])}var t5=1,Dre=.9,Ore=.8,kre=.17,n5=.1,r5=.999,Are=.9999,jre=.99,Mre=/[\\\/_+.#"@\[\(\{&]/,Nre=/[\\\/_+.#"@\[\(\{&]/g,Pre=/[\s-]/,i5=/[\s-]/g;function a5(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?t5:jre;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=a5(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=t5:Mre.test(e.charAt(l-1))?(d*=Ore,p=e.slice(i,l-1).match(Nre),p&&i>0&&(d*=r5**+p.length)):Pre.test(e.charAt(l-1))?(d*=Dre,m=e.slice(i,l-1).match(i5),m&&i>0&&(d*=r5**+m.length)):(d*=kre,i>0&&(d*=r5**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Are)),(d<n5&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=a5(e,t,n,r,l+1,a+2,o),f*n5>d&&(d=f*n5)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function o5(e){return e.toLowerCase().replace(i5,` `)}function Fre(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,a5(e,t,o5(e),o5(t),0,0,{})}var Ire=Object.defineProperty,s5=(e,t)=>Ire(e,`name`,{value:t,configurable:!0}),c5=!!(typeof window<`u`&&window.document&&window.document.createElement);function l5(e,t,{checkForDefaultPrevented:n=!0}={}){return s5(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}s5(l5,`composeEventHandlers`);function Lre(e){if(!c5)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}s5(Lre,`getOwnerWindow`);function u5(e){if(!c5)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}s5(u5,`getOwnerDocument`);function d5(e,t=!1){let{activeElement:n}=u5(e);if(!n?.nodeName)return null;if(f5(n)&&n.contentDocument)return d5(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=u5(n).getElementById(e);if(t)return t}}return n}s5(d5,`getActiveElement`);function f5(e){return e.tagName===`IFRAME`}s5(f5,`isFrame`);var Rre=Object.defineProperty,p5=(e,t)=>Rre(e,`name`,{value:t,configurable:!0});function m5(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}p5(m5,`setRef`);function h5(...e){return t=>{let n=!1,r=e.map(e=>{let r=m5(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():m5(e[t],null)}}}}p5(h5,`composeRefs`);function g5(...e){return _.useCallback(h5(...e),e)}p5(g5,`useComposedRefs`);var zre=Object.defineProperty,_5=(e,t)=>zre(e,`name`,{value:t,configurable:!0});function Bre(e,t){let n=_.createContext(t);n.displayName=e+`Context`;let r=_5(e=>{let{children:t,...r}=e,i=_.useMemo(()=>r,Object.values(r));return(0,Z.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=_.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return _5(i,`useContext`),[r,i]}_5(Bre,`createContext`);function v5(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=_5(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,Z.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=_.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return _5(s,`useContext`),[o,s]}_5(r,`createContext`);let i=_5(()=>{let t=n.map(e=>_.createContext(e));return _5(function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,y5(i,...t)]}_5(v5,`createContextScope`);function y5(...e){let t=e[0];if(e.length===1)return t;let n=_5(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return _5(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}_5(y5,`composeContextScopes`);var b5=globalThis?.document?_.useLayoutEffect:()=>{},Vre=Object.defineProperty,Hre=(e,t)=>Vre(e,`name`,{value:t,configurable:!0}),Ure=_.useId||(()=>void 0),Wre=0;function x5(e){let[t,n]=_.useState(Ure());return b5(()=>{e||n(e=>e??String(Wre++))},[e]),e||(t?`radix-${t}`:``)}Hre(x5,`useId`);var Gre=Object.defineProperty,Kre=(e,t)=>Gre(e,`name`,{value:t,configurable:!0}),S5=_.useEffectEvent,C5=_.useInsertionEffect;function w5(e){if(typeof S5==`function`)return S5(e);let t=_.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof C5==`function`?C5(()=>{t.current=e}):b5(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}Kre(w5,`useEffectEvent`);var qre=Object.defineProperty,T5=(e,t)=>qre(e,`name`,{value:t,configurable:!0}),Jre=_.useInsertionEffect||b5;function E5({prop:e,defaultProp:t,onChange:n=T5(()=>{},`onChange`),caller:r}){let[i,a,o]=D5({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,_.useCallback(t=>{if(s){let n=O5(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}T5(E5,`useControllableState`);function D5({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return Jre(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}T5(D5,`useUncontrolledState`);function O5(e){return typeof e==`function`}T5(O5,`isFunction`);var k5=Symbol(`RADIX:SYNC_STATE`);function Yre(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=w5(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=_.useReducer((t,n)=>{if(n.type===k5)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=_.useRef(p);_.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=_.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return _.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:k5,state:i})},[i,d.state,c]),[h,f]}T5(Yre,`useControllableStateReducer`);var Xre=Object.defineProperty,A5=(e,t)=>Xre(e,`name`,{value:t,configurable:!0});function j5(e){let t=_.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=R5(r),_.Children.forEach(r,e=>{if(F5(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;I5(n)&&typeof B5==`function`;)n=B5(n._payload);a=Qre(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=_.cloneElement(a,void 0,s):!o&&_.Children.count(r)===1&&_.isValidElement(r)&&(a=r);let c=a?P5(a):void 0,l=g5(n,c);if(!a){if(r||r===0)throw Error(o?tie(e):eie(e));return r}let u=N5(i,a.props??{});return a.type!==_.Fragment&&(u.ref=n?l:c),_.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}A5(j5,`createSlot`);var M5=Symbol.for(`radix.slottable`);function Zre(e){let t=A5(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=M5,t}A5(Zre,`createSlottable`);var Qre=A5((e,t)=>`child`in e.props?_.isValidElement(t)?_.cloneElement(t,void 0,e.props.children(t.props.children)):null:_.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function N5(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=z5(a,i))}return{...e,...n}}A5(N5,`mergeProps`);function P5(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)}A5(P5,`getElementRef`);function F5(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===M5}A5(F5,`isSlottable`);var $re=Symbol.for(`react.lazy`);function I5(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===$re&&`_payload`in e&&L5(e._payload)}A5(I5,`isLazyComponent`);function L5(e){return typeof e==`object`&&!!e&&`then`in e}A5(L5,`isPromiseLike`);function R5(e){let t=e;for(;I5(t)&&typeof B5==`function`;)t=B5(t._payload);return t}A5(R5,`useUnwrappedLazy`);function z5(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}A5(z5,`concatAriaDescribedby`);var eie=A5(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),tie=A5(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),B5=_.use,nie=Object.defineProperty,rie=(e,t)=>nie(e,`name`,{value:t,configurable:!0}),V5=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=j5(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,Z.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function H5(e,t){e&&wu.flushSync(()=>e.dispatchEvent(t))}rie(H5,`dispatchDiscreteCustomEvent`);var iie=Object.defineProperty,aie=(e,t)=>iie(e,`name`,{value:t,configurable:!0}),U5=_.useInsertionEffect;function W5(e){let t=_.useRef(e);return typeof U5==`function`?U5(()=>{t.current=e}):b5(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}aie(W5,`useCallbackRef`);var oie=Object.defineProperty,G5=(e,t)=>oie(e,`name`,{value:t,configurable:!0}),K5=`dismissableLayer.update`,sie=`dismissableLayer.pointerDownOutside`,cie=`dismissableLayer.focusOutside`,q5,J5=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),lie=_.forwardRef(G5(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=_.useContext(J5),[d,f]=_.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=_.useState({}),h=g5(t,f),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?g.indexOf(v):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=_.useRef(!1),w=X5(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:_.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=Z5(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=W5(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return _.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),_.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(q5=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Q5(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=q5))}},[d,p,n,u]),_.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Q5())},[d,u]),_.useEffect(()=>{let e=G5(()=>m({}),`handleUpdate`);return document.addEventListener(K5,e),()=>document.removeEventListener(K5,e)},[]),(0,Z.jsx)(V5.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:l5(e.onFocusCapture,T.onFocusCapture),onBlurCapture:l5(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:l5(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Y5(){let e=_.useContext(J5),[t,n]=_.useState(null);return _.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}G5(Y5,`useDismissableLayerSurface`);var uie=G5(()=>!0,`IS_TRUE`);function X5(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=uie}=t,s=W5(e),c=_.useRef(!1),l=_.useRef(!1),u=_.useRef(new Map),d=_.useRef(()=>{});return _.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}G5(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}G5(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}G5(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}G5(p,`handleInteractionBubble`);let m=G5(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||$5(sie,s,p,{discrete:!0})};if(G5(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:G5(()=>c.current=!0,`onPointerDownCapture`)}}G5(X5,`usePointerDownOutside`);function Z5(e,t=globalThis?.document){let n=W5(e),r=_.useRef(!1);return _.useEffect(()=>{let e=G5(e=>{e.target&&!r.current&&$5(cie,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:G5(()=>r.current=!0,`onFocusCapture`),onBlurCapture:G5(()=>r.current=!1,`onBlurCapture`)}}G5(Z5,`useFocusOutside`);function Q5(){let e=new CustomEvent(K5);document.dispatchEvent(e)}G5(Q5,`dispatchUpdate`);function $5(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?H5(i,a):i.dispatchEvent(a)}G5($5,`handleAndDispatchCustomEvent`);var die=Object.defineProperty,e7=(e,t)=>die(e,`name`,{value:t,configurable:!0}),t7=`focusScope.autoFocusOnMount`,n7=`focusScope.autoFocusOnUnmount`,r7={bubbles:!1,cancelable:!0},fie=_.forwardRef(e7(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=_.useState(null),u=W5(a),d=W5(o),f=_.useRef(null),p=g5(t,l),m=_.useRef(i);_.useEffect(()=>{m.current=i});let h=_.useCallback(e=>e?c?.contains(e)?!0:!!m.current?.some(t=>t.contains(e)):!1,[c]),g=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;h(t)?f.current=t:p7(f.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(h(t)||p7(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&p7(c)};e7(e,`handleFocusIn`),e7(t,`handleFocusOut`),e7(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused,h]),_.useEffect(()=>{if(c){m7.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(t7,r7);c.addEventListener(t7,u),c.dispatchEvent(t),t.defaultPrevented||(s7(_7(l7(c)),{select:!0}),document.activeElement===e&&p7(c))}return()=>{c.removeEventListener(t7,u);let t=c.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(n7,r7);c.addEventListener(n7,d),c.dispatchEvent(r),r.defaultPrevented||p7(e??t.body,{select:!0}),c.removeEventListener(n7,d),m7.remove(g)},0)}}},[c,u,d,g]);let v=_.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=c7(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&p7(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&p7(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,Z.jsx)(V5.div,{tabIndex:-1,...s,ref:p,onKeyDown:v})},`FocusScope`)),i7=_.createContext(null);function a7({registry:e,children:t}){return e?(0,Z.jsx)(i7.Provider,{value:e,children:t}):t}e7(a7,`FocusScopeBranchProvider`);function o7(){let[e,t]=_.useState([]);return{nodes:e,registry:_.useMemo(()=>({add:e7(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:e7(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}e7(o7,`useFocusScopeBranchRegistry`);function pie(e){let t=_.useContext(i7);_.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}e7(pie,`useFocusScopeBranch`);function s7(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(p7(r,{select:t}),document.activeElement!==n)return}e7(s7,`focusFirst`);function c7(e){let t=l7(e);return[u7(t,e),u7(t.reverse(),e)]}e7(c7,`getTabbableEdges`);function l7(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e7(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}e7(l7,`getTabbableCandidates`);function u7(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):d7(r,{upTo:t})))return r}e7(u7,`findVisible`);function d7(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}e7(d7,`isHidden`);function f7(e){return e.tagName===`INPUT`&&typeof e.select==`function`}e7(f7,`isSelectableInput`);function p7(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&f7(e)&&t&&e.select()}}e7(p7,`focus`);var m7=h7();function h7(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=g7(e,t),e.unshift(t)},remove(t){e=g7(e,t),e[0]?.resume()}}}e7(h7,`createFocusScopesStack`);function g7(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}e7(g7,`arrayRemove`);function _7(e){return e.filter(e=>e.tagName!==`A`)}e7(_7,`removeLinks`);var mie=Object.defineProperty,hie=_.forwardRef(((e,t)=>mie(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=_.useState(!1);b5(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?wu.createPortal((0,Z.jsx)(V5.div,{...r,ref:t}),o):null},`Portal`)),gie=Object.defineProperty,v7=(e,t)=>gie(e,`name`,{value:t,configurable:!0});function y7(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}v7(y7,`useStateMachine`);var b7=v7(e=>{let{present:t,children:n}=e,r=x7(t),i=typeof n==`function`?n({present:r.isPresent}):_.Children.only(n),a=C7(r.ref,T7(i));return typeof n==`function`||r.isPresent?_.cloneElement(i,{ref:a}):null},`Presence`);function x7(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(`none`),o=_.useRef(void 0),[s,c]=y7(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return _.useEffect(()=>{s===`mounted`?(a.current=o.current??w7(r.current),o.current=void 0):a.current=`none`},[s]),b5(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=w7(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),b5(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=v7(a=>{let o=w7(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=v7(e=>{e.target===t&&(a.current=w7(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:_.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=w7(t)}else r.current=null;n(e)},[])}}v7(x7,`usePresence`);function S7(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}v7(S7,`setRef`);function C7(...e){let t=_.useRef(e);return t.current=e,_.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=S7(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():S7(n[e],null)}}},[])}v7(C7,`useStableComposedRefs`);function w7(e){return e?.animationName||`none`}v7(w7,`getAnimationName`);function T7(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)}v7(T7,`getElementRef`);var _ie=Object.defineProperty,E7=(e,t)=>_ie(e,`name`,{value:t,configurable:!0}),D7=0,O7=null;function vie(e){return k7(),e.children}E7(vie,`FocusGuards`);function k7(){_.useEffect(()=>{O7||={start:A7(),end:A7()};let{start:e,end:t}=O7;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),D7++,()=>{D7===1&&(O7?.start.remove(),O7?.end.remove(),O7=null),D7=Math.max(0,D7-1)}},[])}E7(k7,`useFocusGuards`);function A7(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}E7(A7,`createFocusGuard`);var j7=function(){return j7=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},j7.apply(this,arguments)};function M7(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function yie(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var N7=`right-scroll-bar-position`,P7=`width-before-scroll-bar`,bie=`with-scroll-bars-hidden`,xie=`--removed-body-scroll-bar-size`;function F7(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Sie(e,t){var n=(0,_.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Cie=typeof window<`u`?_.useLayoutEffect:_.useEffect,I7=new WeakMap;function wie(e,t){var n=Sie(t||null,function(t){return e.forEach(function(e){return F7(e,t)})});return Cie(function(){var t=I7.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||F7(e,null)}),i.forEach(function(e){r.has(e)||F7(e,a)})}I7.set(n,e)},[e]),n}function Tie(e){return e}function Eie(e,t){t===void 0&&(t=Tie);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Die(e){e===void 0&&(e={});var t=Eie(null);return t.options=j7({async:!0,ssr:!1},e),t}var L7=function(e){var t=e.sideCar,n=M7(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return _.createElement(r,j7({},n))};L7.isSideCarExport=!0;function Oie(e,t){return e.useMedium(t),L7}var R7=Die(),z7=function(){},B7=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:z7,onWheelCapture:z7,onTouchMoveCapture:z7}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=M7(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=wie([n,t]),w=j7(j7({},x),i);return _.createElement(_.Fragment,null,u&&_.createElement(S,{sideCar:R7,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?_.cloneElement(_.Children.only(s),j7(j7({},w),{ref:C})):_.createElement(y,j7({},w,{className:c,ref:C}),s))});B7.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},B7.classNames={fullWidth:P7,zeroRight:N7};var kie=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Aie(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=kie();return t&&e.setAttribute(`nonce`,t),e}function jie(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Mie(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Nie=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Aie())&&(jie(t,n),Mie(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Pie=function(){var e=Nie();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},V7=function(){var e=Pie();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Fie={left:0,top:0,right:0,gap:0},H7=function(e){return parseInt(e||``,10)||0},Iie=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[H7(n),H7(r),H7(i)]},Lie=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Fie;var t=Iie(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Rie=V7(),U7=`data-scroll-locked`,zie=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
75
|
+
.${bie} {
|
|
76
|
+
overflow: hidden ${r};
|
|
77
|
+
padding-right: ${s}px ${r};
|
|
78
|
+
}
|
|
79
|
+
body[${U7}] {
|
|
80
|
+
overflow: hidden ${r};
|
|
81
|
+
overscroll-behavior: contain;
|
|
82
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
83
|
+
padding-left: ${i}px;
|
|
84
|
+
padding-top: ${a}px;
|
|
85
|
+
padding-right: ${o}px;
|
|
86
|
+
margin-left:0;
|
|
87
|
+
margin-top:0;
|
|
88
|
+
margin-right: ${s}px ${r};
|
|
89
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.${N7} {
|
|
93
|
+
right: ${s}px ${r};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.${P7} {
|
|
97
|
+
margin-right: ${s}px ${r};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.${N7} .${N7} {
|
|
101
|
+
right: 0 ${r};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.${P7} .${P7} {
|
|
105
|
+
margin-right: 0 ${r};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
body[${U7}] {
|
|
109
|
+
${xie}: ${s}px;
|
|
110
|
+
}
|
|
111
|
+
`},W7=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Bie=function(){_.useEffect(function(){return document.body.setAttribute(U7,(W7()+1).toString()),function(){var e=W7()-1;e<=0?document.body.removeAttribute(U7):document.body.setAttribute(U7,e.toString())}},[])},Vie=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Bie();var a=_.useMemo(function(){return Lie(i)},[i]);return _.createElement(Rie,{styles:zie(a,!t,i,n?``:`!important`)})},G7=!1;if(typeof window<`u`)try{var K7=Object.defineProperty({},"passive",{get:function(){return G7=!0,!0}});window.addEventListener(`test`,K7,K7),window.removeEventListener(`test`,K7,K7)}catch{G7=!1}var q7=G7?{passive:!1}:!1,Hie=function(e){return e.tagName===`TEXTAREA`},J7=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Hie(e)&&n[t]===`visible`)},Uie=function(e){return J7(e,`overflowY`)},Wie=function(e){return J7(e,`overflowX`)},Y7=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),X7(e,r)){var i=Z7(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Gie=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Kie=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},X7=function(e,t){return e===`v`?Uie(t):Wie(t)},Z7=function(e,t){return e===`v`?Gie(t):Kie(t)},qie=function(e,t){return e===`h`&&t===`rtl`?-1:1},Jie=function(e,t,n,r,i){var a=qie(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Z7(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&X7(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Q7=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$7=function(e){return[e.deltaX,e.deltaY]},e9=function(e){return e&&`current`in e?e.current:e},Yie=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Xie=function(e){return`
|
|
112
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
113
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
114
|
+
`},Zie=0,t9=[];function Qie(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(Zie++)[0],a=_.useState(V7)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=yie([e.lockRef.current],(e.shards||[]).map(e9),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=_.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Q7(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Y7(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Y7(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Jie(h,t,e,h===`h`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(t9.length&&t9[t9.length-1]===a){var r=`deltaY`in n?$7(n):Q7(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Yie(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(e9).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=_.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:$ie(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=Q7(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,$7(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,Q7(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return t9.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,q7),document.addEventListener(`touchmove`,c,q7),document.addEventListener(`touchstart`,u,q7),function(){t9=t9.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,q7),document.removeEventListener(`touchmove`,c,q7),document.removeEventListener(`touchstart`,u,q7)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:Xie(i)}):null,p?_.createElement(Vie,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function $ie(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var eae=Oie(R7,Qie),n9=_.forwardRef(function(e,t){return _.createElement(B7,j7({},e,{ref:t,sideCar:eae}))});n9.classNames=B7.classNames;var tae=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},r9=new WeakMap,i9=new WeakMap,a9={},o9=0,s9=function(e){return e&&(e.host||s9(e.parentNode))},nae=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=s9(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},rae=function(e,t,n,r){var i=nae(t,Array.isArray(e)?e:[e]);a9[n]||(a9[n]=new WeakMap);var a=a9[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(r9.get(e)||0)+1,l=(a.get(e)||0)+1;r9.set(e,c),a.set(e,l),o.push(e),c===1&&i&&i9.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),o9++,function(){o.forEach(function(e){var t=r9.get(e)-1,i=a.get(e)-1;r9.set(e,t),a.set(e,i),t||(i9.has(e)||e.removeAttribute(r),i9.delete(e)),i||e.removeAttribute(n)}),o9--,o9||(r9=new WeakMap,r9=new WeakMap,i9=new WeakMap,a9={})}},iae=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||tae(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),rae(r,i,n,`aria-hidden`)):function(){return null}},aae=Object.defineProperty,c9=(e,t)=>aae(e,`name`,{value:t,configurable:!0}),l9=`Dialog`,[u9,oae]=v5(l9),[sae,d9]=u9(l9),cae=c9(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),{nodes:l,registry:u}=o7(),[d,f]=E5({prop:r,defaultProp:i??!1,onChange:a,caller:l9}),[p,m]=_.useState(0),[h,g]=_.useState(0);return(0,Z.jsx)(sae,{scope:t,triggerRef:s,contentRef:c,contentId:x5(),titleId:x5(),descriptionId:x5(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),f9=`DialogPortal`,[lae,p9]=u9(f9,{forceMount:void 0}),uae=c9(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=d9(f9,t);return(0,Z.jsx)(lae,{scope:t,forceMount:n,children:_.Children.map(r,e=>(0,Z.jsx)(b7,{present:n||a.open,children:(0,Z.jsx)(hie,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),m9=`DialogOverlay`,dae=_.forwardRef(c9(function(e,t){let n=p9(m9,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=d9(m9,e.__scopeDialog);return a.modal?(0,Z.jsx)(b7,{present:r||a.open,children:(0,Z.jsx)(pae,{...i,ref:t})}):null},`DialogOverlay`)),fae=j5(`DialogOverlay.RemoveScroll`),pae=_.forwardRef(c9(function(e,t){let{__scopeDialog:n,...r}=e,i=d9(m9,n),a=g5(t,Y5());return(0,Z.jsx)(n9,{as:fae,allowPinchZoom:!0,shards:_.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,Z.jsx)(V5.div,{"data-state":v9(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),h9=`DialogContent`,mae=_.forwardRef(c9(function(e,t){let n=p9(h9,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=d9(h9,e.__scopeDialog);return(0,Z.jsx)(b7,{present:r||a.open,children:a.modal?(0,Z.jsx)(hae,{...i,ref:t}):(0,Z.jsx)(gae,{...i,ref:t})})},`DialogContent`)),hae=_.forwardRef(c9(function(e,t){let n=d9(h9,e.__scopeDialog),r=_.useRef(null),i=g5(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return iae(e)},[]),(0,Z.jsx)(g9,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:l5(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:l5(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:l5(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),gae=_.forwardRef(c9(function(e,t){let n=d9(h9,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,Z.jsx)(g9,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),g9=_.forwardRef(c9(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=d9(h9,n);return k7(),(0,Z.jsx)(a7,{registry:l.branchRegistry,children:(0,Z.jsx)(fie,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,Z.jsx)(lie,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?_9(o,l.descriptionId):o,"data-state":v9(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`));function _9(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}c9(_9,`concatAriaDescribedby`);function v9(e){return e?`open`:`closed`}c9(v9,`getState`);var y9=`[cmdk-group=""]`,b9=`[cmdk-group-items=""]`,_ae=`[cmdk-group-heading=""]`,x9=`[cmdk-item=""]`,S9=`${x9}:not([aria-disabled="true"])`,C9=`cmdk-item-select`,w9=`data-value`,vae=(e,t,n)=>Fre(e,t,n),T9=_.createContext(void 0),E9=()=>_.useContext(T9),D9=_.createContext(void 0),O9=()=>_.useContext(D9),k9=_.createContext(void 0),A9=_.forwardRef((e,t)=>{let n=P9(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=P9(()=>new Set),i=P9(()=>new Map),a=P9(()=>new Map),o=P9(()=>new Set),s=M9(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,...v}=e,y=x5(),b=x5(),x=x5(),S=_.useRef(null),C=kae();N9(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),N9(()=>{C(6,A)},[]);let w=_.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=_.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??vae;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(b9);t?t.appendChild(e.parentElement===t?e:e.closest(`${b9} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${b9} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${y9}[${w9}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(w9);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(y9)?.querySelector(_ae))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${x9}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(S9)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(w9))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(w9))}function F(e){let t=j()?.closest(y9),n;for(;t&&!n;)t=e>0?Dae(t,y9):Oae(t,y9),n=t?.querySelector(S9);n?w.setState(`value`,n.getAttribute(w9)):P(e)}let I=()=>N(M().length-1),L=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):P(1)},R=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return _.createElement(V5.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&L(e);break;case`ArrowDown`:L(e);break;case`p`:case`k`:g&&e.ctrlKey&&R(e);break;case`ArrowUp`:R(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),I();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(C9);t.dispatchEvent(e)}}}}},_.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:jae},c),L9(e,e=>_.createElement(D9.Provider,{value:w},_.createElement(T9.Provider,{value:T},e))))}),yae=_.forwardRef((e,t)=>{let n=x5(),r=_.useRef(null),i=_.useContext(k9),a=E9(),o=M9(e),s=o.current?.forceMount??i?.forceMount;N9(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=I9(n,r,[e.value,e.children,r],e.keywords),l=O9(),u=F9(e=>e.value&&e.value===c.current),d=F9(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);_.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(C9,f),()=>t.removeEventListener(C9,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:v,keywords:y,...b}=e;return _.createElement(V5.div,{ref:h5(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),bae=_.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=x5(),s=_.useRef(null),c=_.useRef(null),l=x5(),u=E9(),d=F9(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));N9(()=>u.group(o),[]),I9(o,s,[e.value,e.heading,c]);let f=_.useMemo(()=>({id:o,forceMount:i}),[i]);return _.createElement(V5.div,{ref:h5(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&_.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),L9(e,e=>_.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},_.createElement(k9.Provider,{value:f},e))))}),xae=_.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=_.useRef(null),a=F9(e=>!e.search);return!n&&!a?null:_.createElement(V5.div,{ref:h5(i,t),...r,"cmdk-separator":``,role:`separator`})}),Sae=_.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=O9(),o=F9(e=>e.search),s=F9(e=>e.selectedItemId),c=E9();return _.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),_.createElement(V5.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Cae=_.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=_.useRef(null),o=_.useRef(null),s=F9(e=>e.selectedItemId),c=E9();return _.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),_.createElement(V5.div,{ref:h5(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},L9(e,e=>_.createElement(`div`,{ref:h5(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),wae=_.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return _.createElement(cae,{open:n,onOpenChange:r},_.createElement(uae,{container:o},_.createElement(dae,{"cmdk-overlay":``,className:i}),_.createElement(mae,{"aria-label":e.label,"cmdk-dialog":``,className:a},_.createElement(A9,{ref:t,...s}))))}),Tae=_.forwardRef((e,t)=>F9(e=>e.filtered.count===0)?_.createElement(V5.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Eae=_.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return _.createElement(V5.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},L9(e,e=>_.createElement(`div`,{"aria-hidden":!0},e)))}),j9=Object.assign(A9,{List:Cae,Item:yae,Input:Sae,Group:bae,Separator:xae,Dialog:wae,Empty:Tae,Loading:Eae});function Dae(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Oae(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function M9(e){let t=_.useRef(e);return N9(()=>{t.current=e}),t}var N9=typeof window>`u`?_.useEffect:_.useLayoutEffect;function P9(e){let t=_.useRef();return t.current===void 0&&(t.current=e()),t}function F9(e){let t=O9(),n=()=>e(t.snapshot());return _.useSyncExternalStore(t.subscribe,n,n)}function I9(e,t,n,r=[]){let i=_.useRef(),a=E9();return N9(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(w9,s),i.current=s}),i}var kae=()=>{let[e,t]=_.useState(),n=P9(()=>new Map);return N9(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Aae(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function L9({asChild:e,children:t},n){return e&&_.isValidElement(t)?_.cloneElement(Aae(t),{ref:t.ref},n(t.props.children)):n(t)}var jae={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Mae({className:e,...t}){return(0,Z.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:Q(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var Nae=kh(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function Pae({className:e,align:t=`inline-start`,...n}){return(0,Z.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:Q(Nae({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}function Fae({className:e,...t}){return(0,Z.jsx)(j9,{"data-slot":`command`,className:Q(`flex size-full flex-col overflow-hidden rounded-xl! bg-popover text-popover-foreground`,e),...t})}function Iae({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:r,showCloseButton:i=!1,...a}){return(0,Z.jsxs)(O8,{...a,children:[(0,Z.jsxs)(N8,{className:`sr-only`,children:[(0,Z.jsx)(P8,{children:e}),(0,Z.jsx)(F8,{children:t})]}),(0,Z.jsx)(M8,{className:Q(`top-[120px] translate-y-0 gap-0 overflow-hidden rounded-xl! p-0 sm:max-w-[560px]`,r),showCloseButton:i,children:n})]})}function Lae({className:e,...t}){return(0,Z.jsx)(`div`,{"data-slot":`command-input-wrapper`,children:(0,Z.jsxs)(Mae,{className:`h-12 rounded-none! border-0 border-b border-border bg-transparent px-2 shadow-none! dark:bg-transparent *:data-[slot=input-group-addon]:pl-2!`,children:[(0,Z.jsx)(j9.Input,{"data-slot":`command-input`,className:Q(`w-full text-[14px] outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,Z.jsx)(Pae,{children:(0,Z.jsx)(fi,{className:`size-4 shrink-0 opacity-50`})})]})})}function Rae({className:e,...t}){return(0,Z.jsx)(j9.List,{"data-slot":`command-list`,className:Q(`no-scrollbar max-h-[420px] scroll-py-2 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function zae({className:e,...t}){return(0,Z.jsx)(j9.Empty,{"data-slot":`command-empty`,className:Q(`py-6 text-center text-body text-muted-foreground`,e),...t})}function R9({className:e,...t}){return(0,Z.jsx)(j9.Group,{"data-slot":`command-group`,className:Q(`overflow-hidden px-2 py-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-[11px] **:[[cmdk-group-heading]]:font-semibold **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function z9({className:e,children:t,...n}){return(0,Z.jsx)(j9.Item,{"data-slot":`command-item`,className:Q(`group/command-item relative flex h-[34px] cursor-default items-center gap-2.5 rounded-[7px] px-2 text-body outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-accent data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:text-muted-foreground [&_svg:not([class*='size-'])]:size-[15px]`,e),...n,children:t})}var B9=N()(()=>({open:null}));function V9(e){B9.setState({open:e})}function H9(){return F(B9,e=>e.open)}var Bae=`frameboard.palette.recent`,U9=5;function Vae(e){return N()((t,n)=>({ids:Wae(e),record:r=>{let i=[r,...n().ids.filter(e=>e!==r)].slice(0,U9);Gae(e,i)&&t({ids:i})}}))}function Hae(e=W9){return F(e,e=>e.ids)}function Uae(e,t=W9){t.getState().record(e)}function Wae(e){try{let t=JSON.parse(e?.getItem(`frameboard.palette.recent`)??`[]`);return Array.isArray(t)?t.filter(e=>typeof e==`string`).slice(0,U9):[]}catch{return[]}}function Gae(e,t){if(!e)return!1;try{return e.setItem(Bae,JSON.stringify(t)),!0}catch{return!1}}function Kae(){try{return window.localStorage}catch{return null}}var W9=Vae(Kae());function qae(e,t){let n=e.projects.map(({name:e})=>({ref:e,label:e}));if(t===null)return{projects:n,pages:[],frames:[]};let r=[...e.projects.filter(e=>e.name===t),...e.projects.filter(e=>e.name!==t)];return{projects:n,pages:r.flatMap(e=>e.pages.map(t=>({ref:t.ref,label:t.name,hint:e.name}))),frames:r.flatMap(e=>e.pages.flatMap(t=>t.frames.map(n=>({ref:n.ref,label:n.name,hint:`${e.name} / ${t.name}`,...n.hidden?{hidden:!0}:{}}))))}}function Jae(e){Ea(`/p/${encodeURIComponent(e)}`)}function G9(e){let[t=``,n=``]=e.split(`/`);Ea(q_(t,n))}function K9(e){let[t=``,n=``]=e.split(`/`),r=`${t}/${n}`;u4(r,()=>KN(sP,r,[e]))}async function Yae(e,t=R_,n=$O){await n.flagFrames([e],`hidden`,!1),await new Promise(n=>{let r=()=>{let r=Xae(t.getState().board,e);return r!==`hidden`&&(n(r===`shown`),!0)};if(r())return;let i=t.subscribe(()=>{r()&&i()})})&&K9(e)}function Xae(e,t){for(let n of e?.projects??[])for(let e of n.pages){let n=e.frames.find(e=>e.ref===t);if(n)return n.hidden?`hidden`:`shown`}return`gone`}function Zae(e){let t=e.split(`/`).at(-1)??e;Yae(e).catch(ok(`Couldn't show ${t}`))}var Qae=new Set([`frame`,`arrange`,`selection`,`section`,`preview`]);function $ae(){let e=H9()===`commands`;return(0,Z.jsx)(Iae,{open:e,onOpenChange:e=>V9(e?`commands`:null),title:`Command palette`,description:`Search for a frame, page, project, or action to run.`,children:(0,Z.jsx)(eoe,{})})}function eoe(){let e=z_(e=>e.board),[,t]=Ua(`/p/:project/:page?`),n=Ce().filter(e=>e.group!==`mode`&&e.group!==`theme`||!e.checked?.()),r=z_(e=>e.canWrite),{frames:i,pages:a,projects:o}=e?qae(e,t?.project??null):{frames:[],pages:[],projects:[]},[s,c]=(0,_.useState)(``),l=Hae(),u=cP(e=>t?noe(e):null),d=l.flatMap(e=>n.find(t=>t.id===e)??[]),f=n.filter(e=>!e.command?.searchOnly&&!l.includes(e.id)&&(u===null||Qae.has(e.group))),p=e=>()=>{V9(null),e()},m=e=>e.map(e=>(0,Z.jsx)(toe,{action:e,choose:p},e.id)),h=(e,t,n,i)=>e.map(e=>(0,Z.jsxs)(z9,{value:`${i}:${e.ref}`,keywords:[e.label,e.hint??``],disabled:e.hidden&&!r,onSelect:p(()=>e.hidden?Zae(e.ref):n(e.ref)),children:[e.hidden?(0,Z.jsx)(gn,{}):t,(0,Z.jsx)(`span`,{className:`flex-1 truncate`,children:e.label}),e.hidden?(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`Hidden`}):null,e.hint?(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e.hint}):null]},e.ref));return(0,Z.jsxs)(Fae,{filter:roe,children:[(0,Z.jsx)(Lae,{value:s,onValueChange:c,placeholder:`Search frames, pages, and actions`}),(0,Z.jsxs)(Rae,{children:[(0,Z.jsx)(zae,{children:`Nothing matches.`}),s.trim()===``?(0,Z.jsxs)(Z.Fragment,{children:[d.length>0?(0,Z.jsx)(R9,{heading:`Recent`,children:m(d)}):null,f.length>0?(0,Z.jsx)(R9,{heading:u??`Actions`,children:m(f)}):null,a.length>0?(0,Z.jsx)(R9,{heading:`Pages`,children:h(a,(0,Z.jsx)(Sn,{}),G9,`page`)}):null]}):(0,Z.jsxs)(Z.Fragment,{children:[i.length>0?(0,Z.jsx)(R9,{heading:`Frames`,children:h(i,(0,Z.jsx)(Si,{}),K9,`frame`)}):null,a.length>0?(0,Z.jsx)(R9,{heading:`Pages`,children:h(a,(0,Z.jsx)(Sn,{}),G9,`page`)}):null,n.length>0?(0,Z.jsx)(R9,{heading:`Actions`,children:m(n)}):null,o.length>0?(0,Z.jsx)(R9,{heading:`Projects`,children:h(o,(0,Z.jsx)(Mn,{}),Jae,`project`)}):null]})]})]})}function toe({action:e,choose:t}){let n=e.command?.label??e.label,r=e.command?.icon??rn,i=pe(e.keys,fe()),a=e.command?.hint?.();return(0,Z.jsxs)(z9,{value:`action:${e.id}`,keywords:[n,...e.command?.keywords??[]],onSelect:t(()=>{Uae(e.id),e.run()}),children:[(0,Z.jsx)(r,{}),(0,Z.jsx)(`span`,{className:`flex-1 truncate`,children:n}),a?(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground`,children:a}):null,i?(0,Z.jsx)(EH,{children:ie(i).map(e=>(0,Z.jsx)(TH,{children:e},e))}):null]})}function noe(e){if(e.element)return`For the selected element`;let t=e.frames.length;return t===1?`For 1 frame`:t>1?`For ${t} frames`:e.section===void 0?null:`For the section`}function roe(e,t,n=[]){let r=t.trim().toLowerCase();return r===``?1:Math.max(...n.map(e=>{let t=e.toLowerCase();return t.startsWith(r)?1:t.includes(r)?.8:q9(t.split(/[^\p{L}\p{N}]+/u).filter(Boolean),r.replace(/\s+/g,``))?.3:0}))}function q9(e,t){return t===``||e.some((n,r)=>{for(let i=ioe(n,t);i>0;--i)if(q9(e.slice(r+1),t.slice(i)))return!0;return!1})}function ioe(e,t){let n=0;for(;n<e.length&&e[n]===t[n];)n+=1;return n}var J9=H?`⌘`:`Ctrl`,Y9=H?`⇧`:`Shift`,aoe=H?`⌃`:`Ctrl`,X9=[{title:`Tools`,rows:[{label:`Move`,actions:[`tool.move`]},{label:`Hand`,actions:[`tool.hand`]},{label:`Frame`,actions:[`tool.frame`]},{label:`Text`,actions:[`tool.text`]},{label:`Rectangle, ellipse, divider`,actions:[`tool.rectangle`,`tool.ellipse`,`tool.divider`]},{label:`Note`,actions:[`tool.note`]},{label:`Play or Edit`,actions:[`mode.toggle`]},{label:`Find`,actions:[`find.open`]},{label:`Command palette`,actions:[`palette.open`]},{label:`This list`,actions:[`help.shortcuts`]},{label:`All projects`,actions:[`nav.home`]}]},{title:`Selection`,rows:[{label:`Into an element`,gestures:[`${J9} click`]},{label:`One level down`,actions:[`element.down`]},{label:`One level up`,actions:[`element.up`]},{label:`Next sibling`,actions:[`element.next`]},{label:`Add to selection`,gestures:[`${Y9} click`]}]},{title:`View`,rows:[{label:`Zoom to fit`,actions:[`view.zoomToFit`]},{label:`Zoom to selection`,actions:[`view.zoomToSelection`]},{label:`Zoom to 100%`,actions:[`view.zoom100`]},{label:`Hide UI`,actions:[`view.hideUi`]},{label:`Undo`,actions:[`edit.undo`]},{label:`Redo`,actions:[`edit.redo`]}]},{title:`Frames`,rows:[{label:`Nudge`,gestures:[`Arrows`]},{label:`Bigger nudge`,gestures:[`${Y9} Arrows`]},{label:`Resize`,gestures:[`${J9} Arrows`]},{label:`Duplicate`,actions:[`frame.duplicate`]},{label:`Copy as PNG`,actions:[`frame.copyPng`]},{label:`Hide`,actions:[`frame.hide`]},{label:`Lock`,actions:[`frame.lock`]},{label:`Delete`,actions:[`frame.delete`]}]},{title:`Arrange`,rows:[{label:`Align left, right`,actions:[`arrange.alignLeft`,`arrange.alignRight`]},{label:`Align top, bottom`,actions:[`arrange.alignTop`,`arrange.alignBottom`]},{label:`Center`,actions:[`arrange.alignCenter`,`arrange.alignMiddle`]},{label:`Distribute`,actions:[`arrange.distributeHorizontal`,`arrange.distributeVertical`]},{label:`Snap off while dragging`,gestures:[`${aoe} drag`]}]},{title:`Agents`,rows:[{label:`Show the agent change`,actions:[`changes.show`]},{label:`Next change`,actions:[`changes.next`]},{label:`Previous change`,actions:[`changes.previous`]},{label:`Mark all agent changes seen`,actions:[`changes.markAllSeen`]}]}],Z9=[{title:`Projects`,rows:[{label:`Move between projects`,gestures:[`Arrows`],characterGestures:[`H J K L`]},{label:`First, last`,gestures:[`Home`,`End`]},{label:`Open`,gestures:[`↵`]},{label:`Rename`,gestures:[`F2`]},{label:`Delete`,gestures:[`Delete`]},{label:`Menu`,gestures:[`${Y9} F10`]}]},{title:`General`,rows:[{label:`Command palette`,actions:[`palette.open`]},{label:`This list`,actions:[`help.shortcuts`]},{label:`Undo`,actions:[`edit.undo`]},{label:`Redo`,actions:[`edit.redo`]}]}],Q9=[...X9,...Z9].flatMap(e=>e.rows.flatMap(e=>e.actions??[]));function ooe(){let e=H9()===`shortcuts`,[t]=Ua(`/`),n=t?Z9:X9,r=xe(Q9),i=new Map(Q9.map((e,t)=>[e,r[t]]));return(0,Z.jsx)(O8,{open:e,onOpenChange:e=>V9(e?`shortcuts`:null),children:(0,Z.jsxs)(M8,{showCloseButton:!1,className:`top-[90px] translate-y-0 gap-0 p-0 sm:max-w-[760px]`,children:[(0,Z.jsxs)(`div`,{className:`flex h-12 items-center gap-4 border-b border-border px-4 text-[14px]`,children:[(0,Z.jsx)(P8,{className:`text-[14px] leading-none font-semibold`,children:`Keyboard shortcuts`}),(0,Z.jsx)(soe,{}),(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`Esc`})]}),(0,Z.jsx)(`div`,{className:Q(`grid gap-x-7 gap-y-[18px] px-5 pt-4 pb-5`,t?`grid-cols-[1.3fr_1fr_1fr]`:`grid-cols-3`),children:n.map(e=>(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h3`,{className:`pb-1.5 text-label text-muted-foreground`,children:e.title}),(0,Z.jsx)(`ul`,{children:e.rows.map(e=>(0,Z.jsx)(coe,{row:e,byId:i,spaced:t},e.label))})]},e.title))})]})})}function soe(){let e=fe();return(0,Z.jsxs)(`label`,{className:`ml-auto flex items-center gap-2 text-body text-muted-foreground`,children:[`Single-key shortcuts`,(0,Z.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,onClick:()=>ue(!e),className:`relative h-4 w-7 shrink-0 rounded-full bg-muted outline-none focus-visible:ring-2 focus-visible:ring-ring/50 aria-checked:bg-primary`,children:(0,Z.jsx)(`span`,{"aria-hidden":!0,className:Q(`absolute top-0.5 left-0.5 size-3 rounded-full bg-background shadow-sm transition-transform motion-reduce:transition-none`,e&&`translate-x-3`)})})]})}function coe({row:e,byId:t,spaced:n}){let r=fe(),i=[...(e.actions??[]).flatMap(e=>{let n=t.get(e)?.keys?.[0];return n?[{text:ie(n).join(H?` `:`+`),off:!r&&se(n)}]:[]}),...(e.gestures??[]).map(e=>({text:e,off:!1})),...(e.characterGestures??[]).map(e=>({text:e,off:!r}))],a=e.actions!==void 0&&e.actions.every(e=>!t.get(e));return(0,Z.jsxs)(`li`,{"aria-disabled":a||void 0,className:Q(`flex h-[26px] items-center justify-between aria-disabled:text-faint`,n&&`gap-3.5`),children:[(0,Z.jsx)(`span`,{className:`whitespace-nowrap`,children:e.label}),(0,Z.jsx)(EH,{children:i.map(e=>(0,Z.jsx)(TH,{"data-off":e.off||void 0,className:`px-1.5 text-label font-normal whitespace-nowrap data-off:text-faint`,children:e.text},e.text))})]})}var loe={[ay]:cy,[Iv]:hy},uoe=1.6;function doe(){return(0,Z.jsx)(ze,{strokeWidth:uoe,children:(0,Z.jsx)(GX,{delay:500,children:(0,Z.jsxs)(h_,{bodies:loe,children:[(0,Z.jsx)(foe,{}),(0,Z.jsx)($ae,{}),(0,Z.jsx)(ooe,{})]})})})}function foe(){let e=z_(e=>e.board?.projects),t=z_(e=>e.connected);return(0,_.useEffect)(()=>H_(),[]),(0,Z.jsxs)(`div`,{className:`relative h-svh overflow-auto bg-background text-foreground`,children:[e?(0,Z.jsxs)(Xa,{children:[(0,Z.jsx)(qa,{path:`/`,children:(0,Z.jsx)(wre,{projects:e})}),(0,Z.jsx)(qa,{path:`/p/:project/:page`,children:({project:e,page:t})=>(0,Z.jsx)(c6,{project:e,page:t})}),(0,Z.jsx)(qa,{path:`/p/:project`,children:({project:e})=>(0,Z.jsx)(c6,{project:e})}),(0,Z.jsx)(qa,{children:(0,Z.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 p-6`,children:[(0,Z.jsx)(`p`,{className:`text-body text-muted-foreground`,children:`Nothing on the board at this address.`}),(0,Z.jsx)(Ja,{href:`/`,className:e_({variant:`outline`}),children:`Go home`})]})})]}):(0,Z.jsx)(`p`,{role:`status`,className:`flex h-full items-center justify-center text-body text-muted-foreground`,children:`Connecting to the board`}),e&&!t?(0,Z.jsx)(`p`,{role:`status`,className:`absolute top-3 left-1/2 -translate-x-1/2 rounded-xl border border-border bg-card px-3 py-1 text-body text-muted-foreground`,children:`Reconnecting to frameboard serve`}):null,e?(0,Z.jsx)(lee,{}):null]})}function poe(e,t,n){return e.elements.length===t.elements.length&&e.elements.every((e,r)=>{let i=t.elements[r];return i!==void 0&&i.index===e.index&&i.parent===e.parent&&i.tag===e.tag&&(e.index===n||i.name===e.name)})&&t.elements.some(e=>e.index===n)}function moe({store:e=R_,calls:t=$O,navigate:n=Ea,selection:r=sP,notify:i=e=>n_.add({...e,type:`warning`}),mac:a=H,treeAt:o=async(e,t)=>{await rB(e,t);let n=await iB(e);return n?.hash===t?n:null}}={}){let s=(e,t)=>{uN(e.frames);for(let[t,n]of Object.entries(e.hashes??{}))rP(t,n);let{page:i,element:a}=r.getState(),s=a?e.hashes?.[a.frame]:void 0;if(i&&a&&s&&o(a.frame,s).then(e=>{r.getState().element===a&&(t?.hash===a.hash&&e&&poe(t,e,a.index)?JN(r,i,{...a,hash:s}):KN(r,i,[a.frame]))}),e.page===null)return;let[c=``,l=``]=e.page.split(`/`);n(q_(c,l))},c=(t,n,a)=>()=>{let c=()=>{},l=null,u=e.getState().history;qO([],a,async()=>{c=tP(null);let e=r.getState().element;return l=e?await o(e.frame,e.hash):null,t().catch(e=>{throw c(),e})},{live:e,dropWhen:({history:e})=>e.undo!==u.undo||e.redo!==u.redo}).then(e=>{c(),s(e,l),oP(r,vB)},e=>{c(),aP(r,vB),e instanceof Zx&&e.code!==`nothing-to-undo`&&i({title:n,description:e.message})})},l=t=>()=>{let{canWrite:n,history:r}=e.getState();return n&&r[t]>0},u=ye([{id:`edit.undo`,label:`Undo`,group:`edit`,keys:[`$mod+KeyZ`],run:c(t.undo,`Undo skipped`,`undo`),enabled:l(`undo`),command:{label:`Undo`,icon:ea}},{id:`edit.redo`,label:`Redo`,group:`edit`,keys:a?[`$mod+Shift+KeyZ`]:[`$mod+Shift+KeyZ`,`Control+KeyY`],run:c(t.redo,`Redo skipped`,`redo`),enabled:l(`redo`),command:{label:`Redo`,icon:Xr}}]),d=e.subscribe((e,t)=>{(e.history!==t.history||e.canWrite!==t.canWrite)&&G()});return()=>{d(),u()}}function hoe(){let e=ye([{id:`palette.open`,label:`Command palette`,group:`help`,palette:!1,keys:[`$mod+KeyK`],run:()=>V9(`commands`)},{id:`help.shortcuts`,label:`Keyboard shortcuts`,group:`help`,keys:[`Shift+?`],run:()=>V9(`shortcuts`),command:{label:`Keyboard shortcuts`,icon:qt}},{id:`help.characterKeys`,label:`Single-key shortcuts`,group:`help`,run:()=>ue(!de()),checked:de,command:{get label(){return de()?`Turn single-key shortcuts off`:`Turn single-key shortcuts on`},icon:Kn}}]),t=_e.subscribe(G);return()=>{t(),e()}}var goe=[{choice:`system`,label:`System`,icon:Sr},{choice:`light`,label:`Light`,icon:Oi},{choice:`dark`,label:`Dark`,icon:wr}];function _oe(e=xM){let t=ye([{id:`theme.toggle`,label:`Theme`,group:`view`,command:{label:`Toggle theme`,icon:Ei,keywords:[`dark`,`light`,`mode`]},run:()=>fM(e)},...goe.map(({choice:t,label:n,icon:r})=>({id:`theme.${t}`,label:n,group:`theme`,command:{label:`Use the ${n.toLowerCase()} theme`,icon:r,keywords:[`appearance`,`mode`]},run:()=>dM(t,e),checked:()=>e.getState().choice===t}))]),n=e.subscribe(G);return()=>{n(),t()}}var $9=document.getElementById(`root`);if(!$9)throw Error(`Missing #root element`);iK(window.location.pathname),Gv(),lz(R_,{onShow:hee,onDisconnect:Kv}),lM(xM,uM(window)),_oe(),moe(),hoe(),Te(window),(0,v.createRoot)($9).render((0,Z.jsx)(_.StrictMode,{children:(0,Z.jsx)(doe,{})}));
|