@nest-my-admin/ui 0.6.0 → 0.7.1
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/assets/index-B5xpr4Bc.js +57 -0
- package/dist/assets/index-_3E-3PUK.css +1 -0
- package/dist/assets/{rich-text-input-D_ViXscs.js → rich-text-input-CGlopQGm.js} +1 -1
- package/dist/index.html +2 -2
- package/dist/messages.json +1 -0
- package/package.json +1 -1
- package/dist/assets/index-DUJCE16r.js +0 -57
- package/dist/assets/index-ac2FG95B.css +0 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./rich-text-input-CGlopQGm.js","./rich-text-input-CmZdYwUT.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ee(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,ee(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,`$&/`)+`/`),ee(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+=ee(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+=ee(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ee(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 te(e,t,n){if(e==null)return e;var r=[],i=0;return ee(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function P(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 ne=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 re(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,ne)}catch(e){ne(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ie(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 re(ie.bind(null,e))}var ae={map:te,forEach:function(e,t,n){te(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return te(e,function(){t++}),t},toArray:function(e){return te(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=ae,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=ie,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:P}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=re,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),m=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),ee=Symbol.for(`react.consumer`),te=Symbol.for(`react.context`),P=Symbol.for(`react.forward_ref`),ne=Symbol.for(`react.suspense`),re=Symbol.for(`react.suspense_list`),ie=Symbol.for(`react.memo`),ae=Symbol.for(`react.lazy`),oe=Symbol.for(`react.activity`),se=Symbol.for(`react.legacy_hidden`),ce=Symbol.for(`react.memo_cache_sentinel`),le=Symbol.for(`react.view_transition`),F=Symbol.for(`react.recoverable`),ue=Symbol.iterator;function de(e){return typeof e!=`object`||!e?null:(e=ue&&e[ue]||e[`@@iterator`],typeof e==`function`?e:null)}var fe=Symbol.for(`react.client.reference`);function pe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===fe?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 ne:return`Suspense`;case re:return`SuspenseList`;case oe:return`Activity`;case le:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case te:return e.displayName||`Context`;case ee:return(e._context.displayName||`Context`)+`.Consumer`;case P:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ie:return t=e.displayName||null,t===null?pe(e.type)||`Memo`:t;case ae:t=e._payload,e=e._init;try{return pe(e(t))}catch{}}return null}var me=Array.isArray,I=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ge={pending:!1,data:null,method:null,action:null},_e=[],ve=-1;function ye(e){return{current:e}}function be(e){0>ve||(e.current=_e[ve],_e[ve]=null,ve--)}function xe(e,t){ve++,_e[ve]=e.current,e.current=t}var L=ye(null),Se=ye(null),Ce=ye(null),we=ye(null);function Te(e,t){switch(xe(Ce,t),xe(Se,e),xe(L,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?_p(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=_p(t),e=vp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}be(L),xe(L,e)}function Ee(){be(L),be(Se),be(Ce)}function De(e){var t=e.memoizedState;t!==null&&(mh._currentValue=t.memoizedState,xe(we,e)),t=L.current;var n=vp(t,e.type);t!==n&&(xe(Se,e),xe(L,n))}function Oe(e){Se.current===e&&(be(L),be(Se)),we.current===e&&(be(we),mh._currentValue=ge)}var ke,Ae;function je(e){if(ke===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ke=t&&t[1]||``,Ae=-1<e.stack.indexOf(`
|
|
3
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
+
`+ke+e+Ae}var Me=!1;function Ne(e,t){if(!e||Me)return``;Me=!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(`
|
|
5
|
+
`),l=s.split(`
|
|
6
|
+
`);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=`
|
|
7
|
+
`+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{Me=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?je(n):``}function Pe(e,t){switch(e.tag){case 26:case 27:case 5:return je(e.type);case 16:return je(`Lazy`);case 13:return e.child!==t&&t!==null?je(`Suspense Fallback`):je(`Suspense`);case 19:return je(`SuspenseList`);case 0:case 15:return Ne(e.type,!1);case 11:return Ne(e.type.render,!1);case 1:return Ne(e.type,!0);case 31:return je(`Activity`);case 30:return je(`ViewTransition`);default:return``}}function Fe(e){try{var t=``,n=null;do t+=Pe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
+
Error generating stack: `+e.message+`
|
|
9
|
+
`+e.stack}}var Ie=Object.prototype.hasOwnProperty,Le=t.unstable_scheduleCallback,Re=t.unstable_cancelCallback,ze=t.unstable_shouldYield,Be=t.unstable_requestPaint,Ve=t.unstable_now,He=t.unstable_getCurrentPriorityLevel,Ue=t.unstable_ImmediatePriority,We=t.unstable_UserBlockingPriority,Ge=t.unstable_NormalPriority,Ke=t.unstable_LowPriority,qe=t.unstable_IdlePriority,Je=t.log,Ye=t.unstable_setDisableYieldValue,Xe=null,Ze=null;function Qe(e){if(typeof Je==`function`&&Ye(e),Ze&&typeof Ze.setStrictMode==`function`)try{Ze.setStrictMode(Xe,e)}catch{}}var $e=Math.clz32?Math.clz32:nt,et=Math.log,tt=Math.LN2;function nt(e){return e>>>=0,e===0?32:31-(et(e)/tt|0)|0}var rt=256,it=262144,at=4194304;function ot(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 st(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=ot(n))):i=ot(o):i=ot(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ot(n))):i=ot(o)):i=ot(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 ct(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function lt(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-$e(n),i=1<<r;t|=e[r],n&=~i}return t}function ut(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 dt(){var e=at;return at<<=1,!(at&62914560)&&(at=4194304),e}function ft(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function mt(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-$e(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&&ht(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ht(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-$e(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function gt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-$e(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function _t(e,t){var n=t&-t;return n=n&42?1:vt(n),(n&(e.suspendedLanes|t))===0?n:0}function vt(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 yt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function bt(){var e=he.p;return e===0?(e=window.event,e===void 0?32:kh(e.type)):e}function R(e,t){var n=he.p;try{return he.p=e,t()}finally{he.p=n}}var xt=Math.random().toString(36).slice(2),St=`__reactFiber$`+xt,Ct=`__reactProps$`+xt,wt=`__reactContainer$`+xt,Tt=`__reactEvents$`+xt,Et=`__reactListeners$`+xt,Dt=`__reactHandles$`+xt,Ot=`__reactResources$`+xt,kt=`__reactMarker$`+xt,At=`__reactLoad$`+xt;function jt(e){delete e[St],delete e[Ct],delete e[Et],delete e[Dt]}function Mt(e){var t;if(t=e[St])return t;for(var n=e.parentNode;n;){if(t=n[wt]||n[St]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ym(e);e!==null;){if(n=e[St])return n;e=ym(e)}return t}e=n,n=e.parentNode}return null}function Nt(e){if(e=e[St]||e[wt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Ft(e){var t=e[Ot];return t||=e[Ot]={hoistableStyles:new Map,hoistableScripts:new Map},t}function It(e){e[kt]=!0}function Lt(e){e[At]=void 0}var Rt=new Set,zt={};function Bt(e,t){Vt(e,t),Vt(e+`Capture`,t)}function Vt(e,t){for(zt[e]=t,e=0;e<t.length;e++)Rt.add(t[e])}var Ht=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]*$`),Ut={},Wt={};function Gt(e){return Ie.call(Wt,e)?!0:Ie.call(Ut,e)?!1:Ht.test(e)?Wt[e]=!0:(Ut[e]=!0,!1)}var Kt=!1;function qt(){var e=Kt;return Kt=!1,e}function Jt(e,t,n){if(Gt(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 Yt(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 Xt(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 Zt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Qt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function $t(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 en(e){if(!e._valueTracker){var t=Qt(e)?`checked`:`value`;e._valueTracker=$t(e,t,``+e[t])}}function tn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Qt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var nn=/[\n"\\]/g;function rn(e){return e.replace(nn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function an(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=``+Zt(t)):e.value!==``+Zt(t)&&(e.value=``+Zt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):sn(e,Zt(n)):o===`number`&&e.value==t?sn(e,Zt(e.value)):sn(e,Zt(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=``+Zt(s):e.removeAttribute(`name`)}function on(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)){en(e);return}n=n==null?``:``+Zt(n),t=t==null?n:``+Zt(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),en(e)}function sn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function cn(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=``+Zt(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 ln(e,t,n){if(t!=null&&(t=``+Zt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Zt(n)}function un(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(me(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Zt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),en(e)}function dn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var fn=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 pn(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||fn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function mn(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]=``,Kt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(pn(e,a,r),Kt=!0)}else for(var o in t)t.hasOwnProperty(o)&&pn(e,o,t[o])}function hn(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 gn=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`]]),_n=/^[\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 vn(e){return _n.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function yn(){}var bn=null;function xn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sn=null,Cn=null;function wn(e){var t=Nt(e);if(t&&(e=t.stateNode)){var n=e[Ct]||null;a:switch(e=t.stateNode,t.type){case`input`:if(an(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="`+rn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Ct]||null;if(!a)throw Error(i(90));an(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&&tn(r)}break a;case`textarea`:ln(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&cn(e,!!n.multiple,t,!1)}}}var Tn=!1;function En(e,t,n){if(Tn)return e(t,n);Tn=!0;try{return e(t)}finally{if(Tn=!1,(Sn!==null||Cn!==null)&&(Wd(),Sn&&(t=Sn,e=Cn,Cn=Sn=null,wn(t),e)))for(t=0;t<e.length;t++)wn(e[t])}}function Dn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Ct]||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 On=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,kn=!1;if(On)try{var An={};Object.defineProperty(An,"passive",{get:function(){kn=!0}}),window.addEventListener(`test`,An,An),window.removeEventListener(`test`,An,An)}catch{kn=!1}var jn=null,Mn=null,Nn=null;function Pn(){if(Nn)return Nn;var e,t=Mn,n=t.length,r,i=`value`in jn?jn.value:jn.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 Nn=i.slice(e,1<r?1-r:void 0)}function Fn(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 In(){return!0}function Ln(){return!1}function Rn(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)?In:Ln,this.isPropagationStopped=Ln,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=In)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=In)},persist:function(){},isPersistent:In}),t}var zn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bn=Rn(zn),Vn=D({},zn,{view:0,detail:0}),Hn=Rn(Vn),Un,Wn,Gn,Kn=D({},Vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rr,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!==Gn&&(Gn&&e.type===`mousemove`?(Un=e.screenX-Gn.screenX,Wn=e.screenY-Gn.screenY):Wn=Un=0,Gn=e),Un)},movementY:function(e){return`movementY`in e?e.movementY:Wn}}),qn=Rn(Kn),Jn=Rn(D({},Kn,{dataTransfer:0})),Yn=Rn(D({},Vn,{relatedTarget:0})),Xn=Rn(D({},zn,{animationName:0,elapsedTime:0,pseudoElement:0})),Zn=Rn(D({},zn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Qn=Rn(D({},zn,{data:0})),$n={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},er={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`},tr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function nr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tr[e])?!!t[e]:!1}function rr(){return nr}var ir=Rn(D({},Vn,{key:function(e){if(e.key){var t=$n[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?er[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rr,charCode:function(e){return e.type===`keypress`?Fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ar=Rn(D({},Kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),or=Rn(D({},zn,{submitter:0})),sr=Rn(D({},Vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rr})),cr=Rn(D({},zn,{propertyName:0,elapsedTime:0,pseudoElement:0})),lr=Rn(D({},Kn,{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})),ur=Rn(D({},zn,{newState:0,oldState:0,source:0})),dr=[9,13,27,32],fr=On&&`CompositionEvent`in window,pr=null;On&&`documentMode`in document&&(pr=document.documentMode);var mr=On&&`TextEvent`in window&&!pr,hr=On&&(!fr||pr&&8<pr&&11>=pr),gr=` `,_r=!1;function vr(e,t){switch(e){case`keyup`:return dr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function yr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var br=!1;function xr(e,t){switch(e){case`compositionend`:return yr(t);case`keypress`:return t.which===32?(_r=!0,gr):null;case`textInput`:return e=t.data,e===gr&&_r?null:e;default:return null}}function Sr(e,t){if(br)return e===`compositionend`||!fr&&vr(e,t)?(e=Pn(),Nn=Mn=jn=null,br=!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 hr&&t.locale!==`ko`?null:t.data;default:return null}}var Cr={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 wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Cr[e.type]:t===`textarea`}function Tr(e,t,n,r){Sn?Cn?Cn.push(r):Cn=[r]:Sn=r,t=ep(t,`onChange`),0<t.length&&(n=new Bn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Er=null,Dr=null;function Or(e){qf(e,0)}function kr(e){if(tn(Pt(e)))return e}function Ar(e,t){if(e===`change`)return t}var jr=!1;if(On){var Mr;if(On){var Nr=`oninput`in document;if(!Nr){var Pr=document.createElement(`div`);Pr.setAttribute(`oninput`,`return;`),Nr=typeof Pr.oninput==`function`}Mr=Nr}else Mr=!1;jr=Mr&&(!document.documentMode||9<document.documentMode)}function Fr(){Er&&(Er.detachEvent(`onpropertychange`,Ir),Dr=Er=null)}function Ir(e){if(e.propertyName===`value`&&kr(Dr)){var t=[];Tr(t,Dr,e,xn(e)),En(Or,t)}}function Lr(e,t,n){e===`focusin`?(Fr(),Er=t,Dr=n,Er.attachEvent(`onpropertychange`,Ir)):e===`focusout`&&Fr()}function Rr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return kr(Dr)}function zr(e,t){if(e===`click`)return kr(t)}function Br(e,t){if(e===`input`||e===`change`)return kr(t)}function Vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Hr=typeof Object.is==`function`?Object.is:Vr;function Ur(e,t){if(Hr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ie.call(t,i)||!Hr(e[i],t[i]))return!1}return!0}function Wr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Gr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kr(e,t){var n=Gr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Gr(n)}}function qr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Wr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Wr(e.document)}return t}function Yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Xr=On&&`documentMode`in document&&11>=document.documentMode,Zr=null,Qr=null,$r=null,ei=!1;function ti(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ei||Zr==null||Zr!==Wr(r)||(r=Zr,`selectionStart`in r&&Yr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),$r&&Ur($r,r)||($r=r,r=ep(Qr,`onSelect`),0<r.length&&(t=new Bn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Zr)))}function ni(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ri={animationend:ni(`Animation`,`AnimationEnd`),animationiteration:ni(`Animation`,`AnimationIteration`),animationstart:ni(`Animation`,`AnimationStart`),transitionrun:ni(`Transition`,`TransitionRun`),transitionstart:ni(`Transition`,`TransitionStart`),transitioncancel:ni(`Transition`,`TransitionCancel`),transitionend:ni(`Transition`,`TransitionEnd`)},ii={},ai={};On&&(ai=document.createElement(`div`).style,`AnimationEvent`in window||(delete ri.animationend.animation,delete ri.animationiteration.animation,delete ri.animationstart.animation),`TransitionEvent`in window||delete ri.transitionend.transition);function oi(e){if(ii[e])return ii[e];if(!ri[e])return e;var t=ri[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ai)return ii[e]=t[n];return e}var si=oi(`animationend`),ci=oi(`animationiteration`),li=oi(`animationstart`),ui=oi(`transitionrun`),di=oi(`transitionstart`),fi=oi(`transitioncancel`),pi=oi(`transitionend`),mi=new Map,hi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);hi.push(`scrollEnd`);function gi(e,t){mi.set(e,t),Bt(t,[e])}var _i=0;function vi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Td.identifierPrefix;var n=_i++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function yi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Nd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function bi(e,t){return e=yi(e),t=yi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var xi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Si=[],Ci=0,wi=0;function Ti(){for(var e=Ci,t=wi=Ci=0;t<e;){var n=Si[t];Si[t++]=null;var r=Si[t];Si[t++]=null;var i=Si[t];Si[t++]=null;var a=Si[t];if(Si[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ki(n,i,a)}}function Ei(e,t,n,r){Si[Ci++]=e,Si[Ci++]=t,Si[Ci++]=n,Si[Ci++]=r,wi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Di(e,t,n,r){return Ei(e,t,n,r),Ai(e)}function Oi(e,t){return Ei(e,null,null,t),Ai(e)}function ki(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-$e(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ai(e){if(50<Pd)throw Pd=0,Fd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ji={};function Mi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ni(e,t,n,r){return new Mi(e,t,n,r)}function Pi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fi(e,t){var n=e.alternate;return n===null?(n=Ni(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ii(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Li(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Pi(r)&&(s=1);else if(typeof r==`string`)s=eh(e,n,L.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case oe:return e=Ni(31,n,t,a),e.elementType=oe,e.lanes=o,e;case j:return Ri(n.children,a,o,t);case M:s=8,a|=24;break;case N:return e=Ni(12,n,t,a|2),e.elementType=N,e.lanes=o,e;case ne:return e=Ni(13,n,t,a),e.elementType=ne,e.lanes=o,e;case re:return e=Ni(19,n,t,a),e.elementType=re,e.lanes=o,e;case se:case le:return e=a|32,e=Ni(30,n,t,e),e.elementType=le,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case te:s=10;break a;case ee:s=9;break a;case P:s=11;break a;case ie:s=14;break a;case ae:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ni(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ri(e,t,n,r){return e=Ni(7,e,r,t),e.lanes=n,e}function zi(e,t,n){return e=Ni(6,e,null,t),e.lanes=n,e}function Bi(e){var t=Ni(18,null,null,0);return t.stateNode=e,t}function Vi(e,t,n){return t=Ni(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Hi=new WeakMap;function Ui(e,t){if(typeof e==`object`&&e){var n=Hi.get(e);return n===void 0?(t={value:e,source:t,stack:Fe(t)},Hi.set(e,t),t):n}return{value:e,source:t,stack:Fe(t)}}var Wi=[],Gi=0,Ki=null,qi=0,Ji=[],Yi=0,Xi=null,Zi=1,Qi=``;function $i(e,t){Wi[Gi++]=qi,Wi[Gi++]=Ki,Ki=e,qi=t}function ea(e,t,n){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Xi=e;var r=Zi;e=Qi;var i=32-$e(r)-1;r&=~(1<<i),n+=1;var a=32-$e(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Zi=1<<32-$e(t)+i|n<<i|r,Qi=a+e}else Zi=1<<a|n<<i|r,Qi=e}function ta(e){e.return!==null&&($i(e,1),ea(e,1,0))}function na(e){for(;e===Ki;)Ki=Wi[--Gi],Wi[Gi]=null,qi=Wi[--Gi],Wi[Gi]=null;for(;e===Xi;)Xi=Ji[--Yi],Ji[Yi]=null,Qi=Ji[--Yi],Ji[Yi]=null,Zi=Ji[--Yi],Ji[Yi]=null}function ra(e,t){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Zi=t.id,Qi=t.overflow,Xi=e}var ia=null,aa=null,z=!1,oa=null,sa=!1,ca=Error(i(519));function la(e){throw ha(Ui(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ca}function ua(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[St]=e,t[Ct]=r,n){case`dialog`:K(`cancel`,t),K(`close`,t);break;case`iframe`:case`object`:case`embed`:K(`load`,t);break;case`video`:case`audio`:for(n=0;n<Gf.length;n++)K(Gf[n],t);break;case`source`:K(`error`,t);break;case`img`:case`image`:case`link`:K(`error`,t),K(`load`,t);break;case`details`:K(`toggle`,t);break;case`input`:K(`invalid`,t),on(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:K(`invalid`,t);break;case`textarea`:K(`invalid`,t),un(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||op(t.textContent,n)?(r.popover!=null&&(K(`beforetoggle`,t),K(`toggle`,t)),r.onScroll!=null&&K(`scroll`,t),r.onScrollEnd!=null&&K(`scrollend`,t),r.onClick!=null&&(t.onclick=yn),t=!0):t=!1,t||la(e,!0)}function da(e){for(ia=e.return;ia;)switch(ia.tag){case 5:case 31:case 13:sa=!1;return;case 27:case 3:sa=!0;return;default:ia=ia.return}}function fa(e){if(e!==ia)return!1;if(!z)return da(e),z=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||bp(e.type,e.memoizedProps)),n=!n),n&&aa&&la(e),da(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));aa=vm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));aa=vm(e)}else t===27?(t=aa,kp(e.type)?(e=_m,_m=null,aa=e):aa=t):aa=ia?gm(e.stateNode.nextSibling):null;return!0}function pa(){aa=ia=null,z=!1}function ma(){var e=oa;return e!==null&&(_d===null?_d=e:_d.push.apply(_d,e),oa=null),e}function ha(e){oa===null?oa=[e]:oa.push(e)}var ga=ye(null),_a=null,va=null;function ya(e,t,n){xe(ga,t._currentValue),t._currentValue=n}function ba(e){e._currentValue=ga.current,be(ga)}function xa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Sa(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),xa(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),xa(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),xa(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ca(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Hr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===we.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[mh]:e.push(mh))}a=a.return}return e!==null&&Sa(t,e,n,r),t.flags|=262144,e!==null}function wa(e){for(e=e.firstContext;e!==null;){if(!Hr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ta(e){_a=e,va=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ea(e){return Oa(_a,e)}function Da(e,t){return _a===null&&Ta(e),Oa(e,t)}function Oa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},va===null){if(e===null)throw Error(i(308));va=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else va=va.next=t;return n}var ka=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Aa=t.unstable_scheduleCallback,ja=t.unstable_NormalPriority,Ma={$$typeof:te,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Na(){return{controller:new ka,data:new Map,refCount:0}}function Pa(e){e.refCount--,e.refCount===0&&Aa(ja,function(){e.controller.abort()})}function Fa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ia=null;function La(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ra=null,za=0,Ba=0,Va=null;function Ha(e,t){if(Ra===null){var n=Ra=[];za=0,Ba=Bf(),Va={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return za++,t.then(Ua,Ua),t}function Ua(){if(--za===0&&(Ia=null,Ra!==null)){Va!==null&&(Va.status=`fulfilled`);var e=Ra;Ra=null,Ba=0,Va=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ga=I.S;I.S=function(e,t){if(bd=Ve(),typeof t==`object`&&t&&typeof t.then==`function`&&Ha(e,t),Ia!==null)for(var n=Ef;n!==null;)Fa(n,Ia),n=n.next;if(n=e.types,n!==null){for(var r=Ef;r!==null;)Fa(r,n),r=r.next;if(Ba!==0){r=Ia,r===null&&(r=Ia=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ga!==null&&Ga(e,t)};var Ka=ye(null);function qa(){var e=Ka.current;return e===null?td.pooledCache:e}function Ja(e,t){t===null?xe(Ka,Ka.current):xe(Ka,t.pool)}function Ya(){var e=qa();return e===null?null:{parent:Ma._currentValue,pool:e}}var Xa=Error(i(460)),Za=Error(i(474)),Qa=Error(i(542)),$a={then:function(){}};function eo(e){return e=e.status,e===`fulfilled`||e===`rejected`}function to(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(yn,yn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ao(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(yn,yn);else{if(e=td,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ao(e),e}throw ro=t,Xa}}function no(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ro=e,Xa):e}}var ro=null;function io(){if(ro===null)throw Error(i(459));var e=ro;return ro=null,e}function ao(e){if(e===Xa||e===Qa)throw Error(i(483))}var oo=null,so=0;function co(e){var t=so;return so+=1,oo===null&&(oo=[]),to(oo,e,t)}function lo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function uo(e,t){throw t.$$typeof===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 fo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Fi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=zi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===j?(e=d(e,t,n.props.children,r,n.key),lo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ae&&no(i)===t.type)?(t=a(t,n.props),lo(t,n),t.return=e,t):(t=Li(n.type,n.key,n.props,null,e.mode,r),lo(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Vi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Ri(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=zi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Li(t.type,t.key,t.props,null,e.mode,n),lo(n,t),n.return=e,n;case A:return t=Vi(t,e.mode,n),t.return=e,t;case ae:return t=no(t),f(e,t,n)}if(me(t)||de(t))return t=Ri(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,co(t),n);if(t.$$typeof===te)return f(e,Da(e,t),n);uo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case ae:return n=no(n),p(e,t,n,r)}if(me(n)||de(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,co(n),r);if(n.$$typeof===te)return p(e,t,Da(e,n),r);uo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case 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 ae:return r=no(r),m(e,t,n,r,i)}if(me(r)||de(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,co(r),i);if(r.$$typeof===te)return m(e,t,n,Da(t,r),i);uo(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),z&&$i(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return z&&$i(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),z&&$i(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),z&&$i(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return z&&$i(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),z&&$i(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),lo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ae&&no(l)===r.type){n(e,r.sibling),c=a(r,o.props),lo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Ri(o.props.children,e.mode,c,o.key),lo(c,o),c.return=e,e=c):(c=Li(o.type,o.key,o.props,null,e.mode,c),lo(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=Vi(o,e.mode,c),c.return=e,e=c}return s(e);case ae:return o=no(o),_(e,r,o,c)}if(me(o))return h(e,r,o,c);if(de(o)){if(l=de(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,co(o),c);if(o.$$typeof===te)return _(e,r,Da(e,o),c);uo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=zi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{so=0;var i=_(e,t,n,r);return oo=null,i}catch(t){if(t===Xa||t===Qa)throw t;var a=Ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var po=fo(!0),mo=fo(!1),ho=!1;function go(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _o(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function vo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function yo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ed&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ai(e),ki(e,null,n),t}return Ei(e,r,t,n),Ai(e)}function bo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gt(e,n)}}function xo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var So=!1;function Co(){if(So){var e=Va;if(e!==null)throw e}}function wo(e,t,n,r){So=!1;var i=e.updateQueue;ho=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(rd&f)===f:(r&f)===f){f!==0&&f===Ba&&(So=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:ho=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),dd|=o,e.lanes=o,e.memoizedState=d}}function To(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Eo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)To(n[e],t)}var Do=ye(null),Oo=ye(0);function ko(e,t){e=ld,xe(Oo,e),xe(Do,t),ld=e|t.baseLanes}function Ao(){xe(Oo,ld),xe(Do,Do.current)}function jo(){ld=Oo.current,be(Do),be(Oo)}var Mo=ye(null),No=null;function Po(e){var t=e.alternate;xe(zo,zo.current&1),xe(Mo,e),No===null&&(t===null||Do.current!==null||t.memoizedState!==null)&&(No=e)}function Fo(e){xe(zo,zo.current),xe(Mo,e),No===null&&(No=e)}function Io(e){e.tag===22?(xe(zo,zo.current),xe(Mo,e),No===null&&(No=e)):Lo()}function Lo(){xe(zo,zo.current),xe(Mo,Mo.current)}function Ro(e){be(Mo),No===e&&(No=null),be(zo)}var zo=ye(0);function Bo(e,t){xe(Mo,Mo.current),xe(zo,t)}function Vo(e){be(zo),be(Mo),No===e&&(No=null)}function Ho(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||pm(n)||mm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Uo=0,B=null,Wo=null,Go=null,Ko=!1,qo=!1,Jo=!1,Yo=0,Xo=0,Zo=null,Qo=0;function $o(){throw Error(i(321))}function es(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Hr(e[n],t[n]))return!1;return!0}function ts(e,t,n,r,i,a){return Uo=a,B=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?pc:mc,Jo=!1,a=n(r,i),Jo=!1,qo&&(a=rs(t,n,r,i)),ns(e),a}function ns(e){I.H=fc;var t=Wo!==null&&Wo.next!==null;if(Uo=0,Go=Wo=B=null,Ko=!1,Xo=0,Zo=null,t)throw Error(i(300));e===null||jc||(e=e.dependencies,e!==null&&wa(e)&&(jc=!0))}function rs(e,t,n,r){B=e;var a=0;do{if(qo&&(Zo=null),Xo=0,qo=!1,25<=a)throw Error(i(301));if(a+=1,Go=Wo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}I.H=hc,o=t(n,r)}while(qo);return o}function is(){var e=I.H,t=e.useState()[0];return t=typeof t.then==`function`?ds(t):t,e=e.useState()[0],(Wo===null?null:Wo.memoizedState)!==e&&(B.flags|=1024),t}function as(){var e=Yo!==0;return Yo=0,e}function os(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ss(e){if(Ko){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ko=!1}Uo=0,Go=Wo=B=null,qo=!1,Xo=Yo=0,Zo=null}function cs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Go===null?B.memoizedState=Go=e:Go=Go.next=e,Go}function ls(){if(Wo===null){var e=B.alternate;e=e===null?null:e.memoizedState}else e=Wo.next;var t=Go===null?B.memoizedState:Go.next;if(t!==null)Go=t,Wo=e;else{if(e===null)throw B.alternate===null?Error(i(467)):Error(i(310));Wo=e,e={memoizedState:Wo.memoizedState,baseState:Wo.baseState,baseQueue:Wo.baseQueue,queue:Wo.queue,next:null},Go===null?B.memoizedState=Go=e:Go=Go.next=e}return Go}function us(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ds(e){var t=Xo;return Xo+=1,Zo===null&&(Zo=[]),e=to(Zo,e,t),t=B,(Go===null?t.memoizedState:Go.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?pc:mc),e}function fs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ds(e);if(e.$$typeof===F)return;if(e.$$typeof===te)return Ea(e)}throw Error(i(438,String(e)))}function ps(e){var t=null,n=B.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=B.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=us(),B.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]=ce;return t.index++,n}function ms(e,t){return typeof t==`function`?t(e):t}function hs(e){return gs(ls(),Wo,e)}function gs(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Uo&f)===f:(rd&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ba&&(d=!0);else if((Uo&p)===p){u=u.next,p===Ba&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,B.lanes|=p,dd|=p;f=u.action,Jo&&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,B.lanes|=f,dd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Hr(o,e.memoizedState)&&(jc=!0,d&&(n=Va,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function _s(e){var t=ls(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Hr(o,t.memoizedState)||(jc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function vs(e,t,n){var r=B,a=ls(),o=z;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Hr((Wo||a).memoizedState,n);if(s&&(a.memoizedState=n,jc=!0),a=a.queue,Bs(bs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Go!==null&&!!(Go.memoizedState.tag&1),Is(e?9:8,{destroy:void 0},V.bind(null,r,a,n,t),null),e){if(r.flags|=2048,td===null)throw Error(i(349));o||Uo&127||ys(r,t,n)}return n}function ys(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=B.updateQueue,t===null?(t=us(),B.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function V(e,t,n,r){t.value=n,t.getSnapshot=r,xs(t)&&Ss(e)}function bs(e,t,n){return n(function(){xs(t)&&Ss(e)})}function xs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Hr(e,n)}catch{return!0}}function Ss(e){var t=Oi(e,2);t!==null&&zd(t,e,2)}function Cs(e){var t=cs();if(typeof e==`function`){var n=e;if(e=n(),Jo){Qe(!0);try{n()}finally{Qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:e},t}function ws(e,t,n,r){return e.baseState=n,gs(e,Wo,typeof r==`function`?r:ms)}function Ts(e,t,n,r,a){if(lc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};I.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Es(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Es(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=I.T,o={};o.types=a===null?null:a.types,I.T=o;try{var s=n(i,r),c=I.S;c!==null&&c(o,s),Ds(e,t,s)}catch(n){ks(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),I.T=a}}else try{a=n(i,r),Ds(e,t,a)}catch(n){ks(e,t,n)}}function Ds(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Os(e,t,n)},function(n){return ks(e,t,n)}):Os(e,t,n)}function Os(e,t,n){t.status=`fulfilled`,t.value=n,As(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Es(e,n)))}function ks(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,As(t),t=t.next;while(t!==r)}e.action=null}function As(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function H(e,t){return t}function js(e,t){if(z){var n=td.formState;if(n!==null){a:{var r=B;if(z){if(aa){b:{for(var i=aa,a=sa;i.nodeType!==8;){if(!a){i=null;break b}if(i=gm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){aa=gm(i.nextSibling),r=i.data===`F!`;break a}}la(r)}r=!1}r&&(t=n[0])}}return n=cs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:H,lastRenderedState:t},n.queue=r,n=oc.bind(null,B,r),r.dispatch=n,r=Cs(!1),a=cc.bind(null,B,!1,r.queue),r=cs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ts.bind(null,B,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ms(e){return Ns(ls(),Wo,e)}function Ns(e,t,n){if(t=gs(e,t,H)[0],e=hs(ms)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ds(t)}catch(e){throw e===Xa?Qa:e}else r=t;t=ls();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(B.flags|=2048,Is(9,{destroy:void 0},Ps.bind(null,i,n),null)),[r,a,e]}function Ps(e,t){e.action=t}function Fs(e){var t=ls(),n=Wo;if(n!==null)return Ns(t,n,e);ls(),t=t.memoizedState,n=ls();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Is(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=B.updateQueue,t===null&&(t=us(),B.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 Ls(){return ls().memoizedState}function U(e,t,n,r){var i=cs();B.flags|=e,i.memoizedState=Is(1|t,{destroy:void 0},n,r===void 0?null:r)}function Rs(e,t,n,r){var i=ls();r=r===void 0?null:r;var a=i.memoizedState.inst;Wo!==null&&r!==null&&es(r,Wo.memoizedState.deps)?i.memoizedState=Is(t,a,n,r):(B.flags|=e,i.memoizedState=Is(1|t,a,n,r))}function zs(e,t){U(8390656,8,e,t)}function Bs(e,t){Rs(2048,8,e,t)}function Vs(e){B.flags|=4;var t=B.updateQueue;if(t===null)t=us(),B.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Hs(e){var t=ls().memoizedState;return Vs({ref:t,nextImpl:e}),function(){if(ed&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Us(e,t){return Rs(4,2,e,t)}function Ws(e,t){return Rs(4,4,e,t)}function Gs(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 Ks(e,t,n){n=n==null?null:n.concat([e]),Rs(4,4,Gs.bind(null,t,e),n)}function qs(){}function Js(e,t){var n=ls();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&es(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ys(e,t){var n=ls();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&es(t,r[1]))return r[0];if(r=e(),Jo){Qe(!0);try{e()}finally{Qe(!1)}}return n.memoizedState=[r,t],r}function Xs(e,t,n){return n===void 0||Uo&1073741824&&!(rd&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ld(),B.lanes|=e,dd|=e,n)}function Zs(e,t,n,r){return Hr(n,t)?n:Do.current===null?!(Uo&106)||Uo&1073741824&&!(rd&261930)?(jc=!0,e.memoizedState=n):(e=Ld(),B.lanes|=e,dd|=e,t):(e=Xs(e,n,r),Hr(e,t)||(jc=!0),e)}function Qs(e,t,n,r,i){var a=he.p;he.p=a!==0&&8>a?a:8;var o=I.T,s={};s.types=o===null?null:o.types,I.T=s,cc(e,!1,t,n);try{var c=i(),l=I.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?sc(e,t,Wa(c,r),Id(e)):sc(e,t,r,Id(e))}catch(n){sc(e,t,{then:function(){},status:`rejected`,reason:n},Id())}finally{he.p=a,o!==null&&s.types!==null&&(o.types=s.types),I.T=o}}function $s(){}function ec(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=tc(e).queue;Qs(e,a,t,ge,n===null?$s:function(){return W(e),n(r)})}function tc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ge,baseState:ge,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:ge},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function W(e){var t=tc(e);t.next===null&&(t=e.alternate.memoizedState),sc(e,t.next.queue,{},Id())}function G(){return Ea(mh)}function nc(){return ls().memoizedState}function rc(){return ls().memoizedState}function ic(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Id();e=vo(n);var r=yo(t,e,n);r!==null&&(zd(r,t,n),bo(r,t,n)),t={cache:Na()},e.payload=t;return}t=t.return}}function ac(e,t,n){var r=Id();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},lc(e)?uc(t,n):(n=Di(e,t,n,r),n!==null&&(zd(n,e,r),dc(n,t,r)))}function oc(e,t,n){sc(e,t,n,Id())}function sc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(lc(e))uc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Hr(s,o))return Ei(e,t,i,0),td===null&&Ti(),!1}catch{}if(n=Di(e,t,i,r),n!==null)return zd(n,e,r),dc(n,t,r),!0}return!1}function cc(e,t,n,r){if(r={lane:2,revertLane:Bf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},lc(e)){if(t)throw Error(i(479))}else t=Di(e,n,r,2),t!==null&&zd(t,e,2)}function lc(e){var t=e.alternate;return e===B||t!==null&&t===B}function uc(e,t){qo=Ko=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function dc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gt(e,n)}}var fc={readContext:Ea,use:fs,useCallback:$o,useContext:$o,useEffect:$o,useImperativeHandle:$o,useLayoutEffect:$o,useInsertionEffect:$o,useMemo:$o,useReducer:$o,useRef:$o,useState:$o,useDebugValue:$o,useDeferredValue:$o,useTransition:$o,useSyncExternalStore:$o,useId:$o,useHostTransitionStatus:$o,useFormState:$o,useActionState:$o,useOptimistic:$o,useMemoCache:$o,useCacheRefresh:$o,useEffectEvent:$o},pc={readContext:Ea,use:fs,useCallback:function(e,t){return cs().memoizedState=[e,t===void 0?null:t],e},useContext:Ea,useEffect:zs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),U(4194308,4,Gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return U(4194308,4,e,t)},useInsertionEffect:function(e,t){U(4,2,e,t)},useMemo:function(e,t){var n=cs();t=t===void 0?null:t;var r=e();if(Jo){Qe(!0);try{e()}finally{Qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=cs();if(n!==void 0){var i=n(t);if(Jo){Qe(!0);try{n(t)}finally{Qe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ac.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=cs();return e={current:e},t.memoizedState=e},useState:function(e){e=Cs(e);var t=e.queue,n=oc.bind(null,B,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:qs,useDeferredValue:function(e,t){return Xs(cs(),e,t)},useTransition:function(){var e=Cs(!1);return e=Qs.bind(null,B,e.queue,!0,!1),cs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=B,a=cs();if(z){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),td===null)throw Error(i(349));rd&127||ys(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,zs(bs.bind(null,r,o,e),[e]),r.flags|=2048,Is(9,{destroy:void 0},V.bind(null,r,o,n,t),null),n},useId:function(){var e=cs(),t=td.identifierPrefix;if(z){var n=Qi,r=Zi;n=(r&~(1<<32-$e(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Yo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Qo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:G,useFormState:js,useActionState:js,useOptimistic:function(e){var t=cs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=cc.bind(null,B,!0,n),n.dispatch=t,[e,t]},useMemoCache:ps,useCacheRefresh:function(){return cs().memoizedState=ic.bind(null,B)},useEffectEvent:function(e){var t=cs(),n={impl:e};return t.memoizedState=n,function(){if(ed&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},mc={readContext:Ea,use:fs,useCallback:Js,useContext:Ea,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:hs,useRef:Ls,useState:function(){return hs(ms)},useDebugValue:qs,useDeferredValue:function(e,t){return Zs(ls(),Wo.memoizedState,e,t)},useTransition:function(){var e=hs(ms)[0],t=ls().memoizedState;return[typeof e==`boolean`?e:ds(e),t]},useSyncExternalStore:vs,useId:nc,useHostTransitionStatus:G,useFormState:Ms,useActionState:Ms,useOptimistic:function(e,t){return ws(ls(),Wo,e,t)},useMemoCache:ps,useCacheRefresh:rc,useEffectEvent:Hs},hc={readContext:Ea,use:fs,useCallback:Js,useContext:Ea,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:_s,useRef:Ls,useState:function(){return _s(ms)},useDebugValue:qs,useDeferredValue:function(e,t){var n=ls();return Wo===null?Xs(n,e,t):Zs(n,Wo.memoizedState,e,t)},useTransition:function(){var e=_s(ms)[0],t=ls().memoizedState;return[typeof e==`boolean`?e:ds(e),t]},useSyncExternalStore:vs,useId:nc,useHostTransitionStatus:G,useFormState:Fs,useActionState:Fs,useOptimistic:function(e,t){var n=ls();return Wo===null?(n.baseState=e,[e,n.queue.dispatch]):ws(n,Wo,e,t)},useMemoCache:ps,useCacheRefresh:rc,useEffectEvent:Hs};function gc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var _c={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Id(),i=vo(r);i.payload=t,n!=null&&(i.callback=n),t=yo(e,i,r),t!==null&&(zd(t,e,r),bo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Id(),i=vo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=yo(e,i,r),t!==null&&(zd(t,e,r),bo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Id(),r=vo(n);r.tag=2,t!=null&&(r.callback=t),t=yo(e,r,n),t!==null&&(zd(t,e,n),bo(t,e,n))}};function vc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Ur(n,r)||!Ur(i,a):!0}function yc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&_c.enqueueReplaceState(t,t.state,null)}function bc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function xc(e){xi(e)}function Sc(e){console.error(e)}function Cc(e){xi(e)}function wc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Tc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ec(e,t,n){return n=vo(n),n.tag=3,n.payload={element:null},n.callback=function(){wc(e,t)},n}function Dc(e){return e=vo(e),e.tag=3,e}function Oc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Tc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Tc(t,n,r),typeof i!=`function`&&(Cd===null?Cd=new Set([this]):Cd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function kc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ca(t,n,a,!0),n=Mo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return No===null?Zd():n.alternate===null&&ud===0&&(ud=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===$a?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),bf(e,r,a)),!1;case 22:return n.flags|=65536,r===$a?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),bf(e,r,a)),!1}throw Error(i(435,n.tag))}return bf(e,r,a),Zd(),!1}if(z)return t=Mo.current,t===null?(r!==ca&&(t=Error(i(423),{cause:r}),ha(Ui(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ui(r,n),a=Ec(e.stateNode,r,a),xo(e,a),ud!==4&&(ud=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ca&&(e=Error(i(422),{cause:r}),ha(Ui(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ui(o,n),gd===null?gd=[o]:gd.push(o),ud!==4&&(ud=2),t===null)return!0;r=Ui(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ec(n.stateNode,r,e),xo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Cd===null||!Cd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Dc(a),Oc(a,e,n,r),xo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Ac=Error(i(461)),jc=!1;function Mc(e,t,n,r){t.child=e===null?mo(t,null,n,r):po(t,e.child,n,r)}function Nc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ta(t),r=ts(e,t,n,o,a,i),s=as(),e!==null&&!jc?(os(e,t,i),sl(e,t,i)):(z&&s&&ta(t),t.flags|=1,Mc(e,t,r,i),t.child)}function Pc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Pi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Fc(e,t,a,r,i)):(e=Li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!cl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ur:n,n(o,r)&&e.ref===t.ref)return sl(e,t,i)}return t.flags|=1,e=Fi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Fc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ur(a,r)&&e.ref===t.ref){if(jc=!1,t.pendingProps=r=a,cl(e,i))e.flags&131072&&(jc=!0);else return t.lanes=e.lanes,sl(e,t,i)}}return Uc(e,t,n,r,i)}function Ic(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Rc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ja(t,a===null?null:a.cachePool),a===null?Ao():ko(t,a),Io(t);else return r=t.lanes=536870912,Rc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ja(t,null),Ao(),Lo()):(Ja(t,a.cachePool),ko(t,a),Lo(),t.memoizedState=null);return Mc(e,t,i,n),t.child}function Lc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Rc(e,t,n,r,i){var a=qa();return a=a===null?null:{parent:Ma._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ja(t,null),Ao(),Io(t),e!==null&&Ca(e,t,r,!0),t.childLanes=i,null}function zc(e,t){return t=Qc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Bc(e,t,n){return po(t,e.child,null,n),e=zc(t,t.pendingProps),e.flags|=2,Ro(t),t.memoizedState=null,e}function Vc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(z){if(r.mode===`hidden`)return e=zc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Lc(null,e);if(Fo(t),(e=aa)?(e=fm(e,sa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,aa=null)):e=null,e===null)throw la(t);return t.lanes=536870912,null}return zc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Fo(t),a){if(t.flags&256)t.flags&=-257,t=Bc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(jc||Ca(e,t,n,!1),a=(n&e.childLanes)!==0,jc||a){if(Do.current===null){if(r=td,r!==null&&(s=_t(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Oi(e,s),zd(r,e,s),Ac;Zd()}t=Bc(e,t,n)}else e=o.treeContext,aa=gm(s.nextSibling),ia=t,z=!0,oa=null,sa=!1,e!==null&&ra(t,e),t=zc(t,r),t.flags|=134221824;return t}return e=Fi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Hc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Uc(e,t,n,r,i){return Ta(t),n=ts(e,t,n,r,void 0,i),r=as(),e!==null&&!jc?(os(e,t,i),sl(e,t,i)):(z&&r&&ta(t),t.flags|=1,Mc(e,t,n,i),t.child)}function Wc(e,t,n,r,i,a){return Ta(t),t.updateQueue=null,n=rs(t,r,n,i),ns(e),r=as(),e!==null&&!jc?(os(e,t,a),sl(e,t,a)):(z&&r&&ta(t),t.flags|=1,Mc(e,t,n,a),t.child)}function Gc(e,t,n,r,i){if(Ta(t),t.stateNode===null){var a=ji,o=n.contextType;typeof o==`object`&&o&&(a=Ea(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=_c,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},go(t),o=n.contextType,a.context=typeof o==`object`&&o?Ea(o):ji,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(gc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&_c.enqueueReplaceState(a,a.state,null),wo(t,r,a,i),Co(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=bc(n,s);a.props=c;var l=a.context,u=n.contextType;o=ji,typeof u==`object`&&u&&(o=Ea(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&yc(t,a,r,o),ho=!1;var f=t.memoizedState;a.state=f,wo(t,r,a,i),Co(),l=t.memoizedState,s||f!==l||ho?(typeof d==`function`&&(gc(t,n,d,r),l=t.memoizedState),(c=ho||vc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,_o(e,t),o=t.memoizedProps,u=bc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ji,typeof l==`object`&&l&&(c=Ea(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&yc(t,a,r,c),ho=!1,f=t.memoizedState,a.state=f,wo(t,r,a,i),Co();var p=t.memoizedState;o!==d||f!==p||ho||e!==null&&e.dependencies!==null&&wa(e.dependencies)?(typeof s==`function`&&(gc(t,n,s,r),p=t.memoizedState),(u=ho||vc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&wa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Hc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=po(t,e.child,null,i),t.child=po(t,null,n,i)):Mc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=sl(e,t,i),e}function Kc(e,t,n,r){return pa(),t.flags|=256,Mc(e,t,n,r),t.child}var qc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jc(e){return{baseLanes:e,cachePool:Ya()}}function Yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=md),e}function Xc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(zo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(z){if(i?Po(t):Lo(),(e=aa)?(e=fm(e,sa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,aa=null)):e=null,e===null)throw la(t);return t.lanes=mm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Lo(),i=t.mode,a=Qc({mode:`hidden`,children:a},i),r=Ri(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Jc(n),r.childLanes=Yc(e,o,n),t.memoizedState=qc,Lc(null,r)):(Po(t),Zc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return el(e,t,a,o,r,c,s,n)}return i?(Lo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Fi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ri(i,a,n,null),i.flags|=2):i=Fi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Lc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Jc(n):(a=i.cachePool,a===null?a=Ya():(s=Ma._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Yc(e,o,n),t.memoizedState=qc,Lc(e.child,r)):(Po(t),n=e.child,e=n.sibling,n=Fi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Zc(e,t){return t=Qc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Qc(e,t){return e=Ni(22,e,null,t),e.lanes=0,e}function $c(e,t,n){return po(t,e.child,null,n),e=Zc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function el(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Po(t),t.flags&=-257,$c(e,t,c)):t.memoizedState===null?(Lo(),o=a.fallback,s=t.mode,a=Qc({mode:`visible`,children:a.children},s),o=Ri(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,po(t,e.child,null,c),a=t.child,a.memoizedState=Jc(c),a.childLanes=Yc(e,r,c),t.memoizedState=qc,Lc(null,a)):(Lo(),t.child=e.child,t.flags|=128,null);if(Po(t),mm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ha({value:a,source:null,stack:null})),$c(e,t,c)}if(jc||Ca(e,t,c,!1),r=(c&e.childLanes)!==0,jc||r){if(Do.current!==null)return $c(e,t,c);if(r=td,r!==null&&(a=_t(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Oi(e,a),zd(r,e,a),Ac;return pm(o)||Zd(),$c(e,t,c)}return pm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,aa=gm(o.nextSibling),ia=t,z=!0,oa=null,sa=!1,e!==null&&ra(t,e),t=Zc(t,a.children),t.flags|=134221824,t)}function tl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),xa(e.return,t,n)}function nl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Ho(n)===null&&(t=e),e=e.sibling}return t}function rl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function il(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function al(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=zo.current;if(t.flags&128)return Bo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Bo(t,o),i===`backwards`&&e!==null?(il(e),Mc(e,t,r,n),il(e)):Mc(e,t,r,n),r=z?qi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&tl(e,n,t);else if(e.tag===19)tl(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=nl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,il(t)),rl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ho(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}rl(t,!0,n,null,a,r);break;case`together`:rl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=nl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),rl(t,!1,i,n,a,r)}return t.child}function ol(e,t,n){var r=t.pendingProps;return ya(t,t.type,r.value),Mc(e,t,r.children,n),t.child}function sl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),dd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ca(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Fi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function cl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&wa(e)))}function ll(e,t,n){switch(t.tag){case 3:Te(t,t.stateNode.containerInfo),ya(t,Ma,e.memoizedState.cache),pa();break;case 27:case 5:De(t);break;case 4:Te(t,t.stateNode.containerInfo);break;case 10:ya(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Fo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Po(t),t.flags|=128,null;r=Ca(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Xc(e,t,n):(Po(t),e=sl(e,t,n),e===null?null:e.sibling)}Po(t);break;case 19:if(t.flags&128)return al(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Ca(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return al(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Bo(t,zo.current),r)break;return null;case 22:return t.lanes=0,Ic(e,t,n,t.pendingProps);case 24:ya(t,Ma,e.memoizedState.cache)}return sl(e,t,n)}function ul(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)jc=!0;else{if(!cl(e,n)&&!(t.flags&128))return jc=!1,ll(e,t,n);jc=!!(e.flags&131072)}}else jc=!1,z&&t.flags&1048576&&ea(t,qi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=no(t.elementType),t.type=e,typeof e==`function`)Pi(e)?(r=bc(e,r),t.tag=1,t=Gc(null,t,e,r,n)):(t.tag=0,t=Uc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===P){t.tag=11,t=Nc(null,t,e,r,n);break a}if(a===ie){t.tag=14,t=Pc(null,t,e,r,n);break a}if(a===te){t.tag=10,t.type=e,t=ol(null,t,n);break a}}throw t=pe(e)||e,Error(i(306,t,``))}}return t;case 0:return Uc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=bc(r,t.pendingProps),Gc(e,t,r,a,n);case 3:a:{if(Te(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,_o(e,t),wo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ya(t,Ma,r),r!==o.cache&&Sa(t,[Ma],n,!0),Co(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Kc(e,t,r,n);break a}if(r!==a){a=Ui(Error(i(424)),t),ha(a),t=Kc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(aa=gm(e.firstChild),ia=t,z=!0,oa=null,sa=!0,n=mo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(pa(),r===a){t=sl(e,t,n);break a}Mc(e,t,r,n)}t=t.child}return t;case 26:return Hc(e,t),e===null?(n=Bm(t.type,null,t.pendingProps,null))?t.memoizedState=n:z||(t.stateNode=yp(t.type,t.pendingProps,Ce.current,t)):t.memoizedState=Bm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return De(t),e===null&&z&&(r=t.stateNode=Sm(t.type,t.pendingProps,Ce.current),ia=t,sa=!0,a=aa,kp(t.type)?(_m=a,aa=gm(r.firstChild)):aa=a),Mc(e,t,t.pendingProps.children,n),Hc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&z&&((a=r=aa)&&(r=um(r,t.type,t.pendingProps,sa),r===null?a=!1:(t.stateNode=r,ia=t,aa=gm(r.firstChild),sa=!1,a=!0)),a||la(t)),De(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,bp(a,o)?r=null:s!==null&&bp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=ts(e,t,is,null,null,n),mh._currentValue=a),Hc(e,t),Mc(e,t,r,n),t.child;case 6:return e===null&&z&&((e=n=aa)&&(n=dm(n,t.pendingProps,sa),n===null?e=!1:(t.stateNode=n,ia=t,aa=null,e=!0)),e||la(t)),null;case 13:return Xc(e,t,n);case 4:return Te(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=po(t,null,r,n):Mc(e,t,r,n),t.child;case 11:return Nc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Hc(e,t),Mc(e,t,r,n),t.child;case 8:return Mc(e,t,t.pendingProps.children,n),t.child;case 12:return Mc(e,t,t.pendingProps.children,n),t.child;case 10:return ol(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Ta(t),a=Ea(a),r=r(a),t.flags|=1,Mc(e,t,r,n),t.child;case 14:return Pc(e,t,t.type,t.pendingProps,n);case 15:return Fc(e,t,t.type,t.pendingProps,n);case 19:return al(e,t,n);case 31:return Vc(e,t,n);case 22:return Ic(e,t,n,t.pendingProps);case 24:return Ta(t),r=Ea(Ma),e===null?(a=qa(),a===null&&(a=td,o=Na(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},go(t),ya(t,Ma,a)):((e.lanes&n)!==0&&(_o(e,t),wo(t,null,null,n),Co()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ya(t,Ma,r),r!==a.cache&&Sa(t,[Ma],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ya(t,Ma,r))),Mc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:z&&ta(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Hc(e,t),Mc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function dl(e){e.flags|=4}function fl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?th(t,r):th(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Jd())e.flags|=8192;else throw ro=$a,Za}}else e.flags&=-16777217}function pl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!nh(t)){if(Jd())e.flags|=8192;else throw ro=$a,Za}}function ml(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:dt(),e.lanes|=t,hd|=t)}function hl(e,t){if(!z)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function gl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function _l(e,t,n){var r=t.pendingProps;switch(na(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gl(t),null;case 1:return gl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ba(Ma),Ee(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(fa(t)?dl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ma())),gl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(dl(t),o===null?(gl(t),fl(t,a,null,r,n)):(gl(t),pl(t,o))):o?o===e.memoizedState?(gl(t),t.flags&=-16777217):(dl(t),gl(t),pl(t,o)):(e=e.memoizedProps,e!==r&&dl(t),gl(t),fl(t,a,e,r,n)),null;case 27:if(Oe(t),n=Ce.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&dl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return gl(t),t.subtreeFlags&=-33554433,null}e=L.current,fa(t)?ua(t,e):(e=Sm(a,r,n),t.stateNode=e,dl(t))}return gl(t),t.subtreeFlags&=-33554433,null;case 5:if(Oe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&dl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return gl(t),t.subtreeFlags&=-33554433,null}if(o=L.current,fa(t))ua(t,o);else{var s=gp(Ce.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[St]=t,o[Ct]=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(lp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&dl(t)}}return gl(t),t.subtreeFlags&=-33554433,fl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&dl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Ce.current,fa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ia,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[St]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||op(e.nodeValue,n)),e||la(t,!0)}else e=gp(e).createTextNode(r),e[St]=t,t.stateNode=e}return gl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=fa(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[St]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;gl(t),e=!1}else n=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ro(t),t):(Ro(t),null);if(t.flags&128)throw Error(i(558))}return gl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=fa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[St]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;gl(t),a=!1}else a=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Ro(t),t):(Ro(t),null)}return Ro(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ml(t,t.updateQueue),gl(t),null);case 4:return Ee(),e===null&&Xf(t.stateNode.containerInfo),t.flags|=67108864,gl(t),null;case 10:return ba(t.type),gl(t),null;case 19:if(Vo(t),r=t.memoizedState,r===null)return gl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)hl(r,!1);else{if(ud!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ho(e),o!==null){for(t.flags|=128,hl(r,!1),e=o.updateQueue,t.updateQueue=e,ml(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ii(n,e),n=n.sibling;return Bo(t,zo.current&1|2),z&&$i(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ve()>xd&&(t.flags|=128,a=!0,hl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Ho(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,ml(t,e),hl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!z)return gl(t),null}else 2*Ve()-r.renderingStartTime>xd&&n!==536870912&&(t.flags|=128,a=!0,hl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ve(),e.sibling=null,o=zo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||z?Bo(t,o):(n=o,xe(Mo,t),xe(zo,n),No===null&&(No=t)),z&&$i(t,r.treeForkCount),e}return gl(t),null;case 22:case 23:return Ro(t),jo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(gl(t),t.subtreeFlags&6&&(t.flags|=8192)):gl(t),n=t.updateQueue,n!==null&&ml(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&be(Ka),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ba(Ma),gl(t),null;case 25:return null;case 30:return t.flags|=33554432,gl(t),null}throw Error(i(156,t.tag))}function vl(e,t){switch(na(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ba(Ma),Ee(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Oe(t),null;case 31:if(t.memoizedState!==null){if(Ro(t),t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Vo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ee(),null;case 10:return ba(t.type),null;case 22:case 23:return Ro(t),jo(),e!==null&&be(Ka),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ba(Ma),null;case 25:return null;default:return null}}function yl(e,t){switch(na(t),t.tag){case 3:ba(Ma),Ee();break;case 26:case 27:case 5:Oe(t);break;case 4:Ee();break;case 31:t.memoizedState!==null&&Ro(t);break;case 13:Ro(t);break;case 19:Vo(t);break;case 10:ba(t.type);break;case 22:case 23:Ro(t),jo(),e!==null&&be(Ka);break;case 24:ba(Ma)}}function bl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){yf(t,t.return,e)}}function xl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){yf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){yf(t,t.return,e)}}function Sl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Eo(t,n)}catch(t){yf(e,e.return,t)}}}function Cl(e,t,n){n.props=bc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){yf(e,t,n)}}function wl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=vi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Vp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Hp(e);h(e.child,!1,am,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){yf(e,t,n)}}function Tl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){yf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){yf(e,t,n)}else n.current=null}}function El(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)sm(e.stateNode,t[n])}function Dl(e){for(var t=e.return;t!==null&&(Al(t)&&sm(e.stateNode,t.stateNode),!kl(t));)t=t.return}function Ol(e){for(var t=e.return;t!==null&&(Al(t)&&cm(e.stateNode,t.stateNode),!kl(t));)t=t.return}function kl(e){return e.tag===5||e.tag===3||e.tag===27}function Al(e){return e&&e.tag===7&&e.stateNode!==null}function jl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){yf(e,e.return,t)}}function Ml(e,t,n){try{var r=e.stateNode;dp(r,e.type,n,t),r[Ct]=t}catch(t){yf(e,e.return,t)}}function Nl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&kp(e.type)||e.tag===4}function Pl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Nl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&kp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Fl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=yn)),El(e,r),Kt=!0;else if(i!==4&&(i===27&&(El(e,r),r=null,kp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Fl(e,t,n,r),e=e.sibling;e!==null;)Fl(e,t,n,r),e=e.sibling}function Il(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),El(e,r),Kt=!0;else if(i!==4&&(i===27&&(El(e,r),r=null,kp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Il(e,t,n,r),e=e.sibling;e!==null;)Il(e,t,n,r),e=e.sibling}function Ll(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);lp(t,r,n),t[St]=e,t[Ct]=n}catch(t){yf(e,e.return,t)}}var Rl=!1,zl=null;function Bl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Rl=!0)}var Vl=null;function Hl(){var e=Vl;return Vl=null,e}var Ul=0;function Wl(e,t,n,r,i){return Ul=0,Gl(e.child,t,n,r,i)}function Gl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Fp(o);r.push(s),s.view&&(a=!0)}else a||Fp(o).view&&(a=!0);Rl=!0,Mp(o,Ul===0?t:t+`_`+Ul,n),Ul++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Gl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Kl(e,t){for(;e!==null;)e.tag===5?Np(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Kl(e.child,t)),e=e.sibling}function ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(ql(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=bi(t.default,t.share),t!==`none`&&(Wl(e,n,t,null,!1)||Kl(e.child,!1))}e=e.sibling}}function Jl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=vi(r,n),a=bi(r.default,n.paired?r.share:r.enter);a===`none`?ql(e):Wl(e,i,a,null,!1)?(ql(e),n.paired||t||Rd(e,r.onEnter)):Kl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e,t),e=e.sibling;else ql(e)}function Yl(e){if(zl!==null&&zl.size!==0){var t=zl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=bi(n.default,n.share);if(a!==`none`&&(Wl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Rd(e,n.onShare)):Kl(e.child,!1)),t.delete(r),t.size===0)break}}}Yl(e)}e=e.sibling}}}function Xl(e){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode),r=zl===null?void 0:zl.get(n),i=bi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Wl(e,n,i,null,!1)?r===void 0?Rd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,zl.delete(n),Rd(e,t.onShare)):Kl(e.child,!1)),zl!==null&&Yl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e),e=e.sibling;else zl!==null&&Yl(e)}function Zl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode);t=bi(t.default,t.update),e.flags&=-5,t!==`none`&&Wl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Zl(e);e=e.sibling}}function Ql(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Kl(e.child,!1))}Ql(e)}e=e.sibling}}function $l(e){if(e.tag===30)e.stateNode.paired=null,Kl(e.child,!1),Ql(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)$l(e),e=e.sibling;else Ql(e)}function eu(e){for(e=e.child;e!==null;)e.tag===30?Kl(e.child,!1):e.subtreeFlags&33554432&&eu(e),e=e.sibling}function tu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Ul<a.length){var l=a[Ul],u=Fp(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&&Mp(c,Ul===0?n:n+`_`+Ul,i),s&&e.flags&4||(Vl===null&&(Vl=[]),Vl.push(c,Ul===0?r:r+`_`+Ul,t.memoizedProps)),Ul++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:tu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function nu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=vi(n,r),a=bi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Ip)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Ul=0,i=tu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Rd(e,n.onUpdate))}else e.subtreeFlags&33554432&&nu(e,t);e=e.sibling}}var ru=!1,iu=!1,au=!1,ou=!1,su=typeof WeakSet==`function`?WeakSet:Set,cu=null,lu=!1,uu=!1,du=!1,fu=!1;function pu(e,t,n){if(e=e.containerInfo,mp=Ch,e=Jr(e),Yr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(hp={focusedElem:e,selectionRange:r},Ch=!1,n=(n&335544064)===n,cu=t,t=n?9270:1024;cu!==null;){if(e=cu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Xl(r[a]);if(e.alternate===null&&e.flags&2)n&&Bl(e),mu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Xl(r),mu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Bl(e),mu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,cu=r):(n&&Zl(e),mu(n))}}zl=null}function mu(e){for(;cu!==null;){var t=cu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=bc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){yf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)lm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:lm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=vi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=bi(a.default,a.update),a!==`none`&&Wl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,cu=r;break}cu=t.return}}function hu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Fu(e,n),r&4&&bl(5,n);break;case 1:if(Fu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){yf(n,n.return,e)}else{var i=bc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){yf(n,n.return,e)}}}r&64&&Sl(n),r&512&&wl(n,n.return);break;case 3:if(Fu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Eo(e,t)}catch(e){yf(n,n.return,e)}}break;case 27:t===null&&r&4&&Ll(n);case 26:case 5:Fu(e,n),t===null&&r&4&&jl(n),r&512&&wl(n,n.return);break;case 12:Fu(e,n);break;case 31:Fu(e,n),r&4&&wu(e,n);break;case 13:Fu(e,n),r&4&&Tu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Cf.bind(null,n),hm(e,n))));break;case 22:if(r=n.memoizedState!==null||ru,!r){var a=t!==null&&t.memoizedState!==null||iu;t=ru,i=iu,ru=r,(iu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Lu(e,n,r)):Fu(e,n),ru=t,iu=i}break;case 30:Fu(e,n),r&512&&wl(n,n.return);break;case 7:r&512&&wl(n,n.return);default:Fu(e,n)}}function gu(e,t){for(e=e.child;e!==null;)_u(e,t),e=e.sibling}function _u(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){yf(e,e.return,t)}vu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Kt=!0}catch(t){yf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?jp(s,!0):jp(e.stateNode,!1)}catch(t){yf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&gu(e,t);break;default:gu(e,t)}}function vu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:_u(n,r);break a;case 22:n.memoizedState===null&&vu(n,r);break a;default:vu(n,r)}}e=e.sibling}}function yu(e){var t=e.alternate;t!==null&&(e.alternate=null,yu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&jt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var bu=null,xu=!1;function Su(e,t,n){for(n=n.child;n!==null;)Cu(e,t,n),n=n.sibling}function Cu(e,t,n){if(Ze&&typeof Ze.onCommitFiberUnmount==`function`)try{Ze.onCommitFiberUnmount(Xe,n)}catch{}switch(n.tag){case 26:iu||Tl(n,t),Su(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!iu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:iu||Tl(n,t),Ol(n);var r=bu,i=xu;kp(n.type)&&(bu=n.stateNode,xu=!1),Su(e,t,n),Cm(n.stateNode,n.type,n.memoizedProps),bu=r,xu=i;break;case 5:iu||Tl(n,t),Ol(n);case 6:if(n.tag===6&&Ol(n),r=bu,i=xu,bu=null,Su(e,t,n),bu=r,xu=i,bu!==null){if(xu)try{(bu.nodeType===9?bu.body:bu.nodeName===`HTML`?bu.ownerDocument.body:bu).removeChild(n.stateNode),Kt=!0}catch(e){yf(n,t,e)}else try{bu.removeChild(n.stateNode),Kt=!0}catch(e){yf(n,t,e)}}break;case 18:bu!==null&&(xu?(e=bu,Ap(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Jh(e)):Ap(bu,n.stateNode));break;case 4:r=bu,i=xu,bu=n.stateNode.containerInfo,xu=!0,Su(e,t,n),bu=r,xu=i;break;case 0:case 11:case 14:case 15:xl(2,n,t),iu||xl(4,n,t),Su(e,t,n);break;case 1:iu||(Tl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Cl(n,t,r)),Su(e,t,n);break;case 21:Su(e,t,n);break;case 22:iu=(r=iu)||n.memoizedState!==null,Su(e,t,n),iu=r;break;case 30:Tl(n,t),Su(e,t,n);break;case 7:iu||Tl(n,t),Su(e,t,n);break;default:Su(e,t,n)}}function wu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Jh(e)}catch(e){yf(t,t.return,e)}}}function Tu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Jh(e)}catch(e){yf(t,t.return,e)}}function Eu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new su),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new su),t;default:throw Error(i(435,e.tag))}}function Du(e,t){var n=Eu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=wf.bind(null,e,t);t.then(r,r)}})}function Ou(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(kp(l.type)){bu=l.stateNode,xu=!1;break a}break;case 5:bu=l.stateNode,xu=!1;break a;case 3:case 4:bu=l.stateNode.containerInfo,xu=!0;break a}l=l.return}if(bu===null)throw Error(i(160));Cu(s,c,o),bu=null,xu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Au(t,e,n),t=t.sibling}var ku=null;function Au(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Ou(t,e,n),ju(e),a&4&&(xl(3,e,e.return),bl(3,e),xl(5,e,e.return));break;case 1:Ou(t,e,n),ju(e),a&512&&(iu||r===null||Tl(r,r.return)),a&64&&ru&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=ku,Ou(t,e,n),ju(e),a&512&&(iu||r===null||Tl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(ru)e.stateNode=yp(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[kt]||r[St]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),lp(r,t,n),r[St]=e,It(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),lp(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),lp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[St]=e,It(r),t=r}e.stateNode=t}}else ru||$m(o,e.type,e.stateNode)}else e.stateNode=qm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Ml(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||iu||t.parentNode.removeChild(t)):a.count--,n===null?ru||$m(o,e.type,e.stateNode):qm(o,n,e.memoizedProps))}break;case 27:Ou(t,e,n),ju(e),a&512&&(iu||r===null||Tl(r,r.return)),r!==null&&a&4&&Ml(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=au,au=!1,Ou(t,e,n),au=o,ju(e),a&512&&(iu||r===null||Tl(r,r.return)),e.flags&32){t=e.stateNode;try{dn(t,``),Kt=!0}catch(t){yf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Ml(e,t,r===null?t:r.memoizedProps)),a&1024&&(ou=!0);break;case 6:if(Ou(t,e,n),ju(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Kt=!0}catch(t){yf(e,e.return,t)}}break;case 3:if(Kt=!1,Zm=null,o=ku,ku=Dm(t.containerInfo),Ou(t,e,n),ku=o,ju(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Jh(t.containerInfo)}catch(t){yf(e,e.return,t)}ou&&(ou=!1,Mu(e)),Kt=!1;break;case 4:a=au,au=ru,r=qt(),o=ku,ku=Dm(e.stateNode.containerInfo),Ou(t,e,n),ju(e),ku=o,Kt&&uu&&(du=!0),Kt=r,au=a;break;case 12:Ou(t,e,n),ju(e);break;case 31:Ou(t,e,n),ju(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 13:Ou(t,e,n),ju(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(yd=Ve()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=ru,l=iu,u=au;ru=c||o,au=u||o,iu=l||s,Ou(t,e,n),iu=l,au=u,ru=c,ju(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||ru||iu||(t=s||iu,n=ru,r=iu,ru=o||ru,iu=t,Iu(e,2),ru=n,iu=r),!o&&au||gu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Du(e,n))));break;case 19:Ou(t,e,n),ju(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 30:a&512&&(iu||r===null||Tl(r,r.return)),a=qt(),o=uu,s=(n&335544064)===n,c=e.memoizedProps,uu=s&&bi(c.default,c.update)!==`none`,Ou(t,e,n),ju(e),s&&r!==null&&Kt&&(e.flags|=4),uu=o,Kt=a;break;case 21:break;case 7:a&512&&(iu||r===null||Tl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Ou(t,e,n),ju(e)}}function ju(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Nl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Al(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(kl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Il(e,Pl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(dn(l,``),n.flags&=-33),Il(e,Pl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Fl(e,Pl(e),u,s);break;default:throw Error(i(161))}}catch(t){yf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Mu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Ch=!0,t.reset(),Ch=!1),e=e.sibling}}function Nu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Pu(t,e),t=t.sibling;else nu(t,!1)}function Pu(e,t){var n=e.alternate;if(n===null)Jl(e,!1);else switch(e.tag){case 3:if(fu=lu=!1,Hl(),Nu(t,e),!lu&&!du){if(e=Vl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Np(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),fu=!0}Vl=null;break;case 5:Nu(t,e);break;case 4:r=lu,lu=!1,Nu(t,e),lu&&(du=!0),lu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Nu(t,e):Jl(e,!1));break;case 30:r=lu,i=Hl(),lu=!1,Nu(t,e),lu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=vi(a,o),o=vi(n.memoizedProps,o);var s=bi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Ul=0,t=tu(e,n,t,o,s,a,!0),Ul!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Rd(e,e.memoizedProps.onUpdate),Vl=i):i!==null&&(i.push.apply(i,Vl),Vl=i),lu=e.flags&32?!0:r;break;default:Nu(t,e)}}function Fu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)hu(e,t.alternate,t),t=t.sibling}function Iu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:xl(4,n,n.return),Iu(n,r);break;case 1:Tl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Cl(n,n.return,i),Iu(n,r);break;case 27:r&2&&Cm(n.stateNode,n.type,n.memoizedProps);case 5:Tl(n,n.return),n.tag!==5&&n.tag!==27||Ol(n),Iu(n,r);break;case 6:Ol(n);break;case 26:Tl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||iu||i.parentNode.removeChild(i),Iu(n,r);break;case 22:n.memoizedState===null&&Iu(n,r);break;case 30:Tl(n,n.return),Iu(n,r);break;case 7:Tl(n,n.return);default:Iu(n,r)}e=e.sibling}}function Lu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Lu(i,a,n),bl(4,a);break;case 1:if(Lu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){yf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)To(l[i],c)}catch(e){yf(r,r.return,e)}}s&&o&64&&Sl(a),wl(a,a.return);break;case 27:n&2&&Ll(a);case 5:a.tag!==5&&a.tag!==27||Dl(a),Lu(i,a,n),s&&r===null&&o&4&&jl(a),wl(a,a.return);break;case 6:Dl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||ru||$m(Dm(c.ownerDocument),a.type,c),Lu(i,a,n),s&&r===null&&o&4&&jl(a),wl(a,a.return);break;case 12:Lu(i,a,n);break;case 31:Lu(i,a,n),s&&o&4&&wu(i,a);break;case 13:Lu(i,a,n),s&&o&4&&Tu(i,a);break;case 22:a.memoizedState===null&&Lu(i,a,n),wl(a,a.return);break;case 30:Lu(i,a,n),wl(a,a.return);break;case 7:wl(a,a.return);default:Lu(i,a,n)}t=t.sibling}}function Ru(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Pa(n))}function zu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Pa(e))}function Bu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Vu(e,t,n,r),t=t.sibling;else i&&eu(t)}function Vu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&$l(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Bu(e,t,n,r),a&2048&&bl(9,t);break;case 1:Bu(e,t,n,r);break;case 3:Bu(e,t,n,r),i&&fu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Pa(a)));break;case 12:if(a&2048){Bu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){yf(t,t.return,e)}}else Bu(e,t,n,r);break;case 31:Bu(e,t,n,r);break;case 13:Bu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&$l(t),o._visibility&2?Bu(e,t,n,r):(o._visibility|=2,Hu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&$l(s),o._visibility&2?Bu(e,t,n,r):Uu(e,t)),a&2048&&Ru(s,t);break;case 24:Bu(e,t,n,r),a&2048&&zu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Kl(a.child,!0),Kl(t.child,!0))),Bu(e,t,n,r);break;default:Bu(e,t,n,r)}}function Hu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Hu(a,o,s,c,i),bl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Hu(a,o,s,c,i)):u._visibility&2?Hu(a,o,s,c,i):Uu(a,o),i&&l&2048&&Ru(o.alternate,o);break;case 24:Hu(a,o,s,c,i),i&&l&2048&&zu(o.alternate,o);break;default:Hu(a,o,s,c,i)}t=t.sibling}}function Uu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Uu(n,r),i&2048&&Ru(r.alternate,r);break;case 24:Uu(n,r),i&2048&&zu(r.alternate,r);break;default:Uu(n,r)}t=t.sibling}}var Wu=8192;function Gu(e,t,n){if(e.subtreeFlags&Wu)for(e=e.child;e!==null;)Ku(e,t,n),e=e.sibling}function Ku(e,t,n){switch(e.tag){case 26:Gu(e,t,n),e.flags&Wu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&ih(n,e)):ah(n,ku,e.memoizedState,e.memoizedProps));break;case 5:Gu(e,t,n),e.flags&Wu&&(e=e.stateNode,(t&335544128)===t&&ih(n,e));break;case 3:case 4:var r=ku;ku=Dm(e.stateNode.containerInfo),Gu(e,t,n),ku=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Wu,Wu=16777216,Gu(e,t,n),Wu=r):Gu(e,t,n));break;case 30:if((e.flags&Wu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,zl===null&&(zl=new Map),zl.set(r,i)}Gu(e,t,n);break;default:Gu(e,t,n)}}function qu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ju(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cu=r,Zu(r,e)}qu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Yu(e),e=e.sibling}function Yu(e){switch(e.tag){case 0:case 11:case 15:Ju(e),e.flags&2048&&xl(9,e,e.return);break;case 3:Ju(e);break;case 12:Ju(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Xu(e)):Ju(e);break;default:Ju(e)}}function Xu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cu=r,Zu(r,e)}qu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:xl(8,t,t.return),Xu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Xu(t));break;default:Xu(t)}e=e.sibling}}function Zu(e,t){for(;cu!==null;){var n=cu;switch(n.tag){case 0:case 11:case 15:xl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Pa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,cu=r;else a:for(n=e;cu!==null;){r=cu;var i=r.sibling,a=r.return;if(yu(r),r===n){cu=null;break a}if(i!==null){i.return=a,cu=i;break a}cu=a}}}var Qu={getCacheForType:function(e){var t=Ea(Ma),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ea(Ma).controller.signal}},$u=typeof WeakMap==`function`?WeakMap:Map,ed=0,td=null,nd=null,rd=0,id=0,ad=null,od=!1,sd=!1,cd=!1,ld=0,ud=0,dd=0,fd=0,pd=0,md=0,hd=0,gd=null,_d=null,vd=!1,yd=0,bd=0,xd=1/0,Sd=null,Cd=null,wd=0,Td=null,Ed=null,Dd=0,Od=0,kd=null,Ad=null,jd=null,Md=null,Nd=null,Pd=0,Fd=null;function Id(){return ed&2&&rd!==0?rd&-rd:I.T===null?bt():Bf()}function Ld(){if(md===0){if(!(rd&536870912)||z){var e=it;it<<=1,!(it&3932160)&&(it=262144),md=e}else md=536870912}return e=Mo.current,e!==null&&(e.flags|=32),md}function Rd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Vp(vi(e.memoizedProps,n))),Md===null&&(Md=[]),Md.push(t.bind(null,r))}}function zd(e,t,n){(e===td&&(id===2||id===9)||e.cancelPendingCommit!==null)&&(Kd(e,0),Ud(e,rd,md,!1)),pt(e,n),(!(ed&2)||e!==td)&&(e===td&&(!(ed&2)&&(fd|=n),ud===4&&Ud(e,rd,md,!1)),Mf(e))}function Bd(e,t,n){if(ed&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ct(e,t),a=r?ef(e,t):Qd(e,t,!0),o=r;do{if(a===0){sd&&!r&&Ud(e,t,0,!1);break}if(n=e.current.alternate,o&&!Hd(n)){a=Qd(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=gd;var l=c.current.memoizedState.isDehydrated;if(l&&(Kd(c,s).flags|=256),s=Qd(c,s,!1),s!==2&&s!==6){if(cd&&!l){c.errorRecoveryDisabledLanes|=o,fd|=o,a=4;break a}o=_d,_d=a,o!==null&&(_d===null?_d=o:_d.push.apply(_d,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Kd(e,0),Ud(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Ud(r,t,md,!od);break a;case 2:_d=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=yd+300-Ve(),10<a)){if(Ud(r,t,md,!od),st(r,0,!0)!==0)break a;Dd=t,r.timeoutHandle=Cp(Vd.bind(null,r,n,_d,Sd,vd,t,md,fd,hd,od,o,`Throttled`,-0,0),a);break a}Vd(r,n,_d,Sd,vd,t,md,fd,hd,od,o,null,-0,0)}break}while(1);Mf(e)}function Vd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yn},zl=null,Ku(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=lh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?yd-Ve():(a&4194048)===a?bd-Ve():0,m=sh(d,m),m!==null)){Dd=a,e.cancelPendingCommit=m(cf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ud(e,a,o,!l);return}cf(e,t,a,n,r,i,o,s,c,l,u,d)}function Hd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Hr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ud(e,t,n,r){t=lt(e,t),t&=~pd,t&=~fd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-$e(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ht(e,n,t)}function Wd(){return ed&6?!0:(Nf(0,!1),!1)}function Gd(){if(nd!==null){if(id===0)var e=nd.return;else e=nd,va=_a=null,ss(e),oo=null,so=0,e=nd;for(;e!==null;)yl(e.alternate,e),e=e.return;nd=null}}function Kd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,wp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Dd=0,Gd(),td=e,nd=n=Fi(e.current,null),rd=t,id=0,ad=null,od=!1,sd=ct(e,t),cd=!1,hd=md=pd=fd=dd=ud=0,_d=gd=null,vd=!1,ld=lt(e,t),Ti(),n}function qd(e,t){B=null,I.H=fc,t===Xa||t===Qa?(t=io(),id=3):t===Za?(t=io(),id=4):id=t===Ac?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ad=t,nd===null&&(ud=1,wc(e,Ui(t,e.current)))}function Jd(){var e=Mo.current;return e===null?!0:(rd&4194048)===rd?No===null:(rd&62914560)===rd||rd&536870912?e===No:!1}function Yd(){var e=I.H;return I.H=fc,e===null?fc:e}function Xd(){var e=I.A;return I.A=Qu,e}function Zd(){ud=4,od||(rd&4194048)!==rd&&Mo.current!==null||(sd=!0),!(dd&134217727)&&!(fd&134217727)||td===null||Ud(td,rd,md,!1)}function Qd(e,t,n){var r=ed;ed|=2;var i=Yd(),a=Xd();(td!==e||rd!==t)&&(Sd=null,Kd(e,t)),t=!1;var o=ud;a:do try{if(id!==0&&nd!==null){var s=nd,c=ad;switch(id){case 8:Gd(),o=6;break a;case 3:case 2:case 9:case 6:Mo.current===null&&(t=!0);var l=id;if(id=0,ad=null,af(e,s,c,l),n&&sd){o=0;break a}break;default:l=id,id=0,ad=null,af(e,s,c,l)}}$d(),o=ud;break}catch(t){qd(e,t)}while(1);return t&&e.shellSuspendCounter++,va=_a=null,ed=r,I.H=i,I.A=a,nd===null&&(td=null,rd=0,Ti()),o}function $d(){for(;nd!==null;)nf(nd)}function ef(e,t){var n=ed;ed|=2;var r=Yd(),a=Xd();td!==e||rd!==t?(Sd=null,xd=Ve()+500,Kd(e,t)):sd=ct(e,t);a:do try{if(id!==0&&nd!==null){t=nd;var o=ad;b:switch(id){case 1:id=0,ad=null,af(e,t,o,1);break;case 2:case 9:if(eo(o)){id=0,ad=null,rf(t);break}t=function(){id!==2&&id!==9||td!==e||(id=7),Mf(e)},o.then(t,t);break a;case 3:id=7;break a;case 4:id=5;break a;case 7:eo(o)?(id=0,ad=null,rf(t)):(id=0,ad=null,af(e,t,o,7));break;case 5:var s=null;switch(nd.tag){case 26:s=nd.memoizedState;case 5:case 27:var c=nd;if(s?nh(s):c.stateNode.complete){id=0,ad=null;var l=c.sibling;if(l!==null)nd=l;else{var u=c.return;u===null?nd=null:(nd=u,of(u))}break b}}id=0,ad=null,af(e,t,o,5);break;case 6:id=0,ad=null,af(e,t,o,6);break;case 8:Gd(),ud=6;break a;default:throw Error(i(462))}}tf();break}catch(t){qd(e,t)}while(1);return va=_a=null,I.H=r,I.A=a,ed=n,nd===null?(td=null,rd=0,Ti(),ud):0}function tf(){for(;nd!==null&&!ze();)nf(nd)}function nf(e){var t=ul(e.alternate,e,ld);e.memoizedProps=e.pendingProps,t===null?of(e):nd=t}function rf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Wc(n,t,t.pendingProps,t.type,void 0,rd);break;case 11:t=Wc(n,t,t.pendingProps,t.type.render,t.ref,rd);break;case 5:ss(t);var r=t;r===ia&&(z?(da(r),r.tag===5&&r.stateNode!=null&&(aa=r.stateNode)):(da(r),z=!0));default:yl(n,t),t=nd=Ii(t,ld),t=ul(n,t,ld)}e.memoizedProps=e.pendingProps,t===null?of(e):nd=t}function af(e,t,n,r){va=_a=null,ss(t),oo=null,so=0;var i=t.return;try{if(kc(e,i,t,n,rd)){ud=1,wc(e,Ui(n,e.current)),nd=null;return}}catch(t){if(i!==null)throw nd=i,t;ud=1,wc(e,Ui(n,e.current)),nd=null;return}t.flags&32768?(z||r===1?e=!0:sd||rd&536870912?e=!1:(od=e=!0,(r===2||r===9||r===3||r===6)&&(r=Mo.current,r!==null&&r.tag===13&&(r.flags|=16384))),sf(t,e)):of(t)}function of(e){var t=e;do{if(t.flags&32768){sf(t,od);return}e=t.return;var n=_l(t.alternate,t,ld);if(n!==null){nd=n;return}if(t=t.sibling,t!==null){nd=t;return}nd=t=e}while(t!==null);ud===0&&(ud=5)}function sf(e,t){do{var n=vl(e.alternate,e);if(n!==null){n.flags&=32767,nd=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){nd=e;return}nd=e=n}while(e!==null);ud=6,nd=null}function cf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do gf();while(wd!==0);if(ed&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===td&&(nd=td=null,rd=0),Ed=t,Td=e,Dd=n,kd=a,Ad=r,lf(e,t,n,s,c,l,f)}}function lf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Od=s,s|=wi,mt(e,n,s,r,i,a),Md=null,(n&335544064)===n?(Nd=La(e),r=10262):(Nd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Tf(Ge,function(){return _f(),null})):(e.callbackNode=null,e.callbackPriority=0),Rl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=I.T,I.T=null,i=he.p,he.p=2,a=ed,ed|=4;try{pu(e,t,n)}finally{ed=a,he.p=i,I.T=r}}wd=1,Rl?jd=zp(o,e.containerInfo,Nd,ff,pf,df,mf,_f,uf,null,null):(ff(),pf(),mf())}function uf(e){if(wd!==0){var t=Td.onRecoverableError;t(e,{componentStack:null})}}function df(){wd===3&&(wd=0,Pu(Ed,Td),wd=4)}function ff(){if(wd===1){wd=0;var e=Td,t=Ed,n=Dd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=I.T,I.T=null;var i=he.p;he.p=2;var a=ed;ed|=4;try{uu=du=!1,Au(t,e,n),n=hp;var o=Jr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&qr(s.ownerDocument.documentElement,s)){if(c!==null&&Yr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Kr(s,h),v=Kr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Ch=!!mp,hp=mp=null}finally{ed=a,he.p=i,I.T=r}}e.current=t,wd=2}}function pf(){if(wd===2){wd=0;var e=Td,t=Ed,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=I.T,I.T=null;var r=he.p;he.p=2;var i=ed;ed|=4;try{hu(e,t.alternate,t)}finally{ed=i,he.p=r,I.T=n}}wd=3}}function mf(){if(wd===4||wd===3){wd=0;var e=jd;jd=null,Be();var t=Td,n=Ed,r=Dd,i=Ad,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?wd=5:(wd=0,Ed=Td=null,hf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Cd=null),yt(r),n=n.stateNode,Ze&&typeof Ze.onCommitFiberRoot==`function`)try{Ze.onCommitFiberRoot(Xe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=I.T,a=he.p,he.p=2,I.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{I.T=n,he.p=a}}if(i=Md,o=Nd,Nd=null,i!==null&&(Md=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Dd&3&&gf(),Mf(t),a=t.pendingLanes,r&261930&&a&42?t===Fd?Pd++:(Pd=0,Fd=t):(Pd=0,Fd=null),Nf(0,!1)}}function hf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Pa(t)))}function gf(){return jd!==null&&(jd.skipTransition(),jd=null),ff(),pf(),mf(),_f()}function _f(){if(wd!==5)return!1;var e=Td,t=Od;Od=0;var n=yt(Dd),r=I.T,a=he.p;try{he.p=32>n?32:n,I.T=null,n=kd,kd=null;var o=Td,s=Dd;if(wd=0,Ed=Td=null,Dd=0,ed&6)throw Error(i(331));var c=ed;if(ed|=4,Yu(o.current),Vu(o,o.current,s,n),ed=c,Nf(0,!1),Ze&&typeof Ze.onPostCommitFiberRoot==`function`)try{Ze.onPostCommitFiberRoot(Xe,o)}catch{}return!0}finally{he.p=a,I.T=r,hf(e,t)}}function vf(e,t,n){t=Ui(n,t),t=Ec(e.stateNode,t,2),e=yo(e,t,2),e!==null&&(pt(e,2),Mf(e))}function yf(e,t,n){if(e.tag===3)vf(e,e,n);else for(;t!==null;){if(t.tag===3){vf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Cd===null||!Cd.has(r))){e=Ui(n,e),n=Dc(2),r=yo(t,n,2),r!==null&&(Oc(n,r,t,e),pt(r,2),Mf(r));break}}t=t.return}}function bf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $u;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(cd=!0,i.add(n),e=xf.bind(null,e,t,n),t.then(e,e))}function xf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,td===e&&(rd&n)===n&&(ud===4||ud===3&&(rd&62914560)===rd&&300>Ve()-yd?ed&2?pd|=n:Kd(e,0):pd|=n,hd===rd&&(hd=0)),Mf(e)}function Sf(e,t){t===0&&(t=dt()),e=Oi(e,t),e!==null&&(pt(e,t),Mf(e))}function Cf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sf(e,n)}function wf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Sf(e,n)}function Tf(e,t){return Le(e,t)}var Ef=null,Df=null,Of=!1,kf=!1,Af=!1,jf=0;function Mf(e){e!==Df&&e.next===null&&(Df===null?Ef=Df=e:Df=Df.next=e),kf=!0,Of||(Of=!0,zf())}function Nf(e,t){if(!Af&&kf){Af=!0;do for(var n=!1,r=Ef;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-$e(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Rf(r,a))}else a=rd,a=st(r,r===td?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ct(r,a)||(n=!0,Rf(r,a))}r=r.next}while(n);Af=!1}}function Pf(){Ff()}function Ff(){kf=Of=!1;var e=0;jf!==0&&Sp()&&(e=jf);for(var t=Ve(),n=null,r=Ef;r!==null;){var i=r.next,a=If(r,t);a===0?(r.next=null,n===null?Ef=i:n.next=i,i===null&&(Df=n)):(n=r,(e!==0||a&3)&&(kf=!0)),r=i}wd!==0&&wd!==5||Nf(e,!1),jf!==0&&(jf=0)}function If(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-$e(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ut(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=td,n=rd,n=st(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(id===2||id===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Re(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ct(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Re(r),yt(n)){case 2:case 8:n=We;break;case 32:n=Ge;break;case 268435456:n=qe;break;default:n=Ge}return r=Lf.bind(null,e),n=Le(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Re(r),e.callbackPriority=2,e.callbackNode=null,2}function Lf(e,t){if(wd!==0&&wd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(gf()&&e.callbackNode!==n)return null;var r=rd;return r=st(e,e===td?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Bd(e,r,t),If(e,Ve()),e.callbackNode!=null&&e.callbackNode===n?Lf.bind(null,e):null)}function Rf(e,t){if(gf())return null;Bd(e,t,!0)}function zf(){Dp(function(){ed&6?Le(Ue,Pf):Ff()})}function Bf(){if(jf===0){var e=Ba;e===0&&(e=rt,rt<<=1,!(rt&261888)&&(rt=256)),jf=e}return jf}function Vf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:vn(e)}function Hf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Vf((i[Ct]||null).action),o=r.submitter;o&&(t=(t=o[Ct]||null)?Vf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Bn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(jf!==0){var e=new FormData(i,o);ec(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),ec(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Uf=0;Uf<hi.length;Uf++){var Wf=hi[Uf];gi(Wf.toLowerCase(),`on`+(Wf[0].toUpperCase()+Wf.slice(1)))}gi(si,`onAnimationEnd`),gi(ci,`onAnimationIteration`),gi(li,`onAnimationStart`),gi(`dblclick`,`onDoubleClick`),gi(`focusin`,`onFocus`),gi(`focusout`,`onBlur`),gi(ui,`onTransitionRun`),gi(di,`onTransitionStart`),gi(fi,`onTransitionCancel`),gi(pi,`onTransitionEnd`),Vt(`onMouseEnter`,[`mouseout`,`mouseover`]),Vt(`onMouseLeave`,[`mouseout`,`mouseover`]),Vt(`onPointerEnter`,[`pointerout`,`pointerover`]),Vt(`onPointerLeave`,[`pointerout`,`pointerover`]),Bt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Bt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Bt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Bt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Bt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Bt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Gf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Kf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Gf));function qf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){xi(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){xi(e)}i.currentTarget=null,a=c}}}}function K(e,t){var n=t[Tt];n===void 0&&(n=t[Tt]=new Set);var r=e+`__bubble`;n.has(r)||(Zf(t,e,2,!1),n.add(r))}function Jf(e,t,n){var r=0;t&&(r|=4),Zf(n,e,r,t)}var Yf=`_reactListening`+Math.random().toString(36).slice(2);function Xf(e){if(!e[Yf]){e[Yf]=!0,Rt.forEach(function(t){t!==`selectionchange`&&(Kf.has(t)||Jf(t,!1,e),Jf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Yf]||(t[Yf]=!0,Jf(`selectionchange`,!1,t))}}function Zf(e,t,n,r){switch(kh(t)){case 2:var i=wh;break;case 8:i=Th;break;default:i=Eh}n=i.bind(null,t,n,e),i=void 0,!kn||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=Mt(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}En(function(){var r=a,i=xn(n),s=[];a:{var c=mi.get(e);if(c!==void 0){var l=Bn,u=e;switch(e){case`keypress`:if(Fn(n)===0)break a;case`keydown`:case`keyup`:l=ir;break;case`focusin`:u=`focus`,l=Yn;break;case`focusout`:u=`blur`,l=Yn;break;case`beforeblur`:case`afterblur`:l=Yn;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=qn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=sr;break;case si:case ci:case li:l=Xn;break;case pi:l=cr;break;case`scroll`:case`scrollend`:l=Hn;break;case`wheel`:l=lr;break;case`copy`:case`cut`:case`paste`:l=Zn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=ar;break;case`submit`:l=or;break;case`toggle`:case`beforetoggle`:l=ur}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=Dn(m,p),g!=null&&d.push($f(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!==bn&&(u=n.relatedTarget||n.fromElement)&&(Mt(u)||u[wt]))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?Mt(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=qn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=ar,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Pt(c),h=l==null?u:Pt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Mt(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,tp):null,c!==null&&np(s,u,c,d,!1),l!==null&&f!==null&&np(s,f,l,d,!0)))}a:{if(c=r?Pt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Ar;else if(wr(c)){if(jr)_=Br;else{_=Rr;var v=Lr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&hn(r.elementType)&&(_=Ar):_=zr;if(_&&=_(e,r)){Tr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Pt(r):window,e){case`focusin`:(wr(v)||v.contentEditable===`true`)&&(Zr=v,Qr=r,$r=null);break;case`focusout`:$r=Qr=Zr=null;break;case`mousedown`:ei=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ei=!1,ti(s,n,i);break;case`selectionchange`:if(Xr)break;case`keydown`:case`keyup`:ti(s,n,i)}var y;if(fr)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 br?vr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(hr&&n.locale!==`ko`&&(br||b!==`onCompositionStart`?b===`onCompositionEnd`&&br&&(y=Pn()):(jn=i,Mn=`value`in jn?jn.value:jn.textContent,br=!0)),v=ep(r,b),0<v.length&&(b=new Qn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=yr(n),y!==null&&(b.data=y)))),(y=mr?xr(e,n):Sr(e,n))&&(b=ep(r,`onBeforeInput`),0<b.length&&(v=new Qn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Hf(s,e,r,n,i)}qf(s,t)})}function $f(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ep(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=Dn(e,n),i!=null&&r.unshift($f(e,i,a)),i=Dn(e,t),i!=null&&r.push($f(e,i,a))),e.tag===3)return r;e=e.return}return[]}function tp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function np(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=Dn(n,a),l!=null&&o.unshift($f(n,l,c))):i||(l=Dn(n,a),l!=null&&o.push($f(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var rp=/\r\n?/g,ip=/\u0000|\uFFFD/g;function ap(e){return(typeof e==`string`?e:``+e).replace(rp,`
|
|
10
|
+
`).replace(ip,``)}function op(e,t){return t=ap(t),ap(e)===t}function sp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&dn(e,``+r);else return;break;case`className`:Yt(e,`class`,r);break;case`tabIndex`:Yt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Yt(e,n,r);break;case`style`:mn(e,r,o);return;case`data`:if(t!==`object`){Yt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(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`&&sp(e,t,`name`,a.name,a,null),sp(e,t,`formEncType`,a.formEncType,a,null),sp(e,t,`formMethod`,a.formMethod,a,null),sp(e,t,`formTarget`,a.formTarget,a,null)):(sp(e,t,`encType`,a.encType,a,null),sp(e,t,`method`,a.method,a,null),sp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=yn);return;case`onScroll`:r!=null&&K(`scroll`,e);return;case`onScrollEnd`:r!=null&&K(`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=vn(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`:K(`beforetoggle`,e),K(`toggle`,e),Jt(e,`popover`,r);break;case`xlinkActuate`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Jt(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=gn.get(n)||n,Jt(e,n,r);else return}Kt=!0}function cp(e,t,n,r,a,o){switch(n){case`style`:mn(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`)dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)dn(e,``+r);else return;break;case`onScroll`:r!=null&&K(`scroll`,e);return;case`onScrollEnd`:r!=null&&K(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=yn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!zt.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[Ct]||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}Kt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Jt(e,n,r)}return}Kt=!0}function lp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:K(`error`,e),K(`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:sp(e,t,o,s,n,null)}}a&&sp(e,t,`srcSet`,n.srcSet,n,null),r&&sp(e,t,`src`,n.src,n,null);return;case`input`:K(`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:sp(e,t,r,d,n,null)}}on(e,o,c,l,u,s,a,!1);return;case`select`:for(a in K(`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:sp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&cn(e,!!r,n,!0):cn(e,!!r,t,!1);return;case`textarea`:for(s in K(`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:sp(e,t,s,c,n,null)}un(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:sp(e,t,l,r,n,null)}return;case`dialog`:K(`beforetoggle`,e),K(`toggle`,e),K(`cancel`,e),K(`close`,e);break;case`iframe`:case`object`:K(`load`,e);break;case`video`:case`audio`:for(r=0;r<Gf.length;r++)K(Gf[r],e);break;case`image`:K(`error`,e),K(`load`,e);break;case`details`:K(`toggle`,e);break;case`embed`:case`source`:case`link`:K(`error`,e),K(`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:sp(e,t,u,r,n,null)}return;default:if(hn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&cp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&sp(e,t,c,r,n,null))}var up={};function dp(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)||sp(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&&(Kt=!0),o=m;break;case`name`:m!==f&&(Kt=!0),a=m;break;case`checked`:m!==f&&(Kt=!0),u=m;break;case`defaultChecked`:m!==f&&(Kt=!0),d=m;break;case`value`:m!==f&&(Kt=!0),s=m;break;case`defaultValue`:m!==f&&(Kt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&sp(e,t,p,m,r,f)}}an(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)||sp(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&&(Kt=!0),p=o;break;case`defaultValue`:o!==l&&(Kt=!0),c=o;break;case`multiple`:o!==l&&(Kt=!0),s=o;default:o!==l&&sp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?cn(e,!!n,n?[]:``,!1):cn(e,!!n,t,!0)):cn(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:sp(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&&(Kt=!0),p=a;break;case`defaultValue`:a!==o&&(Kt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&sp(e,t,s,a,r,o)}ln(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:sp(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&&(Kt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:sp(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)&&sp(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:sp(e,t,u,p,r,m)}return;default:if(hn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&cp(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||cp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&sp(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||sp(e,t,f,p,r,m)}function fp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function pp(){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&&fp(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&&fp(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 mp=null,hp=null;function gp(e){return e.nodeType===9?e:e.ownerDocument}function _p(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 vp(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 yp(e,t,n,r){return n=gp(n).createElement(e),n[St]=r,n[Ct]=t,lp(n,e,t),It(n),n}function bp(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 xp=null;function Sp(){var e=window.event;return e&&e.type===`popstate`?e!==xp&&(xp=e,!0):(xp=null,!1)}var Cp=typeof setTimeout==`function`?setTimeout:void 0,wp=typeof clearTimeout==`function`?clearTimeout:void 0,Tp=typeof Promise==`function`?Promise:void 0,Ep=typeof requestAnimationFrame==`function`?requestAnimationFrame:Cp,Dp=typeof queueMicrotask==`function`?queueMicrotask:Tp===void 0?Cp:function(e){return Tp.resolve(null).then(e).catch(Op)};function Op(e){setTimeout(function(){throw e})}function kp(e){return e===`head`}function Ap(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),Jh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)wm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,wm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[kt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&wm(e.ownerDocument.body)}n=i}while(n);Jh(t)}function jp(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 Mp(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 Np(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 Pp(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 Fp(e){return Pp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Ip(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Pp(t,n,e)}function Lp(e){return e.documentElement.clientHeight}function Rp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function zp(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`&&(Lp(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+=rh(f),u>oh){s.length=o;break}f=new Promise(Rp.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 Bp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Bp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Bp.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},Bp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Vp(e){return{name:e,group:new Bp(`group`,e),imagePair:new Bp(`image-pair`,e),old:new Bp(`old`,e),new:new Bp(`new`,e)}}function Hp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Hp.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(qp(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=Gp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Up,e,s,r)}this._eventListeners=a}};function Up(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Hp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=qp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Gp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Wp,e,n,i),r.splice(t,1),a!==null&&a()}};function Wp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Gp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Kp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function qp(e,t,n,r){if(e.length===0)return-1;r=Kp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Kp(a.optionsOrUseCapture)===r)return i}return-1}Hp.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,Gp(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,Gp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Hp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Jp,e,void 0,void 0)};function Jp(e,t){return e.tag!==6&&(e=b(e),bm(e,t))}Hp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Yp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Jp(t[n],e);n--);};function Yp(e,t){return t.push(e),!1}Hp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=gp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Xp,e,void 0,void 0))};function Xp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Hp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Zp,e,void 0,void 0)};function Zp(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}Hp.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<$p.length;n++){var r=$p[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):$p[t++]=r}$p.length=t}};function Qp(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var $p=[],em=!1;function tm(e,t,n){$p.push({fragmentInstance:e,observer:t,instance:n}),em||(em=!0,xm(function(){em=!1;var e=$p;$p=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Hp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,nm,e,void 0,void 0),e};function nm(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}Hp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Hp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Yp,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||rm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function rm(e,t,n,r,i){var a=Mt(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 im(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)}Hp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,Yp,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),im(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),im(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function am(e,t){return e=b(e),om(e,t),!1}function om(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function sm(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,Gp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<$p.length;i++){var a=$p[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&($p[r++]=a)}$p.length=r,n.observe(e)}),om(e,t))}function cm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Gp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?tm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function lm(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`:lm(n),jt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function um(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[kt])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=gm(e.nextSibling),e===null)break}return null}function dm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=gm(e.nextSibling),e===null))return null;return e}function fm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=gm(e.nextSibling),e===null))return null;return e}function pm(e){return e.data===`$?`||e.data===`$~`}function mm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function hm(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 gm(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 _m=null;function vm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return gm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function ym(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 bm(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 xm(e){Ep(function(){Ep(function(t){return e(t)})})}function Sm(e,t,n){switch(t=gp(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 Cm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&sp(e,t,r,null,up,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===yn&&(e.onclick=null),jt(e)}function wm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);jt(e)}var Tm=new Map,Em=new Set;function Dm(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 Om=he.d;he.d={f:km,r:Am,D:Nm,C:Pm,L:Fm,m:Im,X:Rm,S:Lm,M:zm};function km(){var e=Om.f(),t=Wd();return e||t}function Am(e){var t=Nt(e);t!==null&&t.tag===5&&t.type===`form`?W(t):Om.r(e)}var jm=typeof document>`u`?null:document;function Mm(e,t,n){var r=jm;if(r&&typeof t==`string`&&t){var i=rn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Em.has(i)||(Em.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),lp(t,`link`,e),It(t),r.head.appendChild(t)))}}function Nm(e){Om.D(e),Mm(`dns-prefetch`,e,null)}function Pm(e,t){Om.C(e,t),Mm(`preconnect`,e,t)}function Fm(e,t,n){Om.L(e,t,n);var r=jm;if(r&&e&&t){var i=`link[rel="preload"][as="`+rn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+rn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+rn(n.imageSizes)+`"]`)):i+=`[href="`+rn(e)+`"]`;var a=i;switch(t){case`style`:a=Vm(e);break;case`script`:a=Gm(e)}if(!(Tm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Tm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Hm(a))||t===`script`&&r.querySelector(Km(a))))){var o=r.createElement(`link`);lp(o,`link`,e),t===`style`&&(o[At]=!0,o.onload=o.onerror=function(){Lt(o)}),It(o),r.head.appendChild(o)}}}function Im(e,t){Om.m(e,t);var n=jm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+rn(r)+`"][href="`+rn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Gm(e)}if(!Tm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Tm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Km(a)))return}r=n.createElement(`link`),lp(r,`link`,e),It(r),n.head.appendChild(r)}}}function Lm(e,t,n){Om.S(e,t,n);var r=jm;if(r&&e){var i=Ft(r).hoistableStyles,a=Vm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Hm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Tm.get(a))&&Ym(e,n);var c=o=r.createElement(`link`);It(c),lp(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,Jm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Rm(e,t){Om.X(e,t);var n=jm;if(n&&e){var r=Ft(n).hoistableScripts,i=Gm(e),a=r.get(i);a||(a=n.querySelector(Km(i)),a||(e=D({src:e,async:!0},t),(t=Tm.get(i))&&Xm(e,t),a=n.createElement(`script`),It(a),lp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zm(e,t){Om.M(e,t);var n=jm;if(n&&e){var r=Ft(n).hoistableScripts,i=Gm(e),a=r.get(i);a||(a=n.querySelector(Km(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Tm.get(i))&&Xm(e,t),a=n.createElement(`script`),It(a),lp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bm(e,t,n,r){var a=(a=Ce.current)?Dm(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=Vm(n.href),t=Ft(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=Vm(n.href);var o=Ft(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(Hm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Tm.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},Tm.set(e,o)),Wm(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=Gm(n),t=Ft(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 Vm(e){return`href="`+rn(e)+`"`}function Hm(e){return`link[rel="stylesheet"][`+e+`]`}function Um(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Wm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[At]){r.loading=1;return}}else t=e.createElement(`link`),t[At]=!0,t.onload=t.onerror=Lt.bind(null,t),lp(t,`link`,n),It(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 Gm(e){return`[src="`+rn(e)+`"]`}function Km(e){return`script[async]`+e}function qm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+rn(n.href)+`"]`);if(r)return t.instance=r,It(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`),It(r),lp(r,`style`,a),Jm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Vm(n.href);var o=e.querySelector(Hm(a));if(o)return t.state.loading|=4,t.instance=o,It(o),o;r=Um(n),(a=Tm.get(a))&&Ym(r,a),o=(e.ownerDocument||e).createElement(`link`),It(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),lp(o,`link`,r),t.state.loading|=4,Jm(o,n.precedence,e),t.instance=o;case`script`:return o=Gm(n.src),(a=e.querySelector(Km(o)))?(t.instance=a,It(a),a):(r=n,(a=Tm.get(o))&&(r=D({},n),Xm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),It(a),lp(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,Jm(r,n.precedence,e));return t.instance}function Jm(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 Ym(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Xm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Zm=null;function Qm(e,t,n){if(Zm===null){var r=new Map,i=Zm=new Map;i.set(n,r)}else i=Zm,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[kt]||a[St]||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 $m(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function eh(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 th(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function nh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function rh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ih(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=rh(t),e.suspenseyImages.push(t)),e=uh.bind(e),t.decode().then(e,e))}function ah(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=Vm(r.href),a=t.querySelector(Hm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=lh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,It(a);return}a=t.ownerDocument||t,r=Um(r),(i=Tm.get(i))&&Ym(r,i),a=a.createElement(`link`),It(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),lp(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=lh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var oh=0;function sh(e,t){return e.stylesheets&&e.count===0&&fh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&oh===0&&(oh=62500*pp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>oh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ch(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)fh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function lh(){this.count--,ch(this)}function uh(){this.imgCount--,ch(this)}var dh=null;function fh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,dh=new Map,t.forEach(ph,e),dh=null,lh.call(e))}function ph(e,t){if(!(t.state.loading&4)){var n=dh.get(e);if(n)var r=n.get(null);else{n=new Map,dh.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=lh.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 mh={$$typeof:te,Provider:null,Consumer:null,_currentValue:ge,_currentValue2:ge,_threadCount:0};function hh(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=ft(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ft(0),this.hiddenUpdates=ft(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 gh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new hh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ni(3,null,null,t),e.current=a,a.stateNode=e,t=Na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},go(a),e}function _h(e){return e?(e=ji,e):ji}function vh(e,t,n,r,i,a){i=_h(i),r.context===null?r.context=i:r.pendingContext=i,r=vo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=yo(e,r,t),n!==null&&(zd(n,e,t),bo(n,e,t))}function yh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function bh(e,t){yh(e,t),(e=e.alternate)&&yh(e,t)}function xh(e){if(e.tag===13||e.tag===31){var t=Oi(e,67108864);t!==null&&zd(t,e,67108864),bh(e,67108864)}}function Sh(e){if(e.tag===13||e.tag===31){var t=Id();t=vt(t);var n=Oi(e,t);n!==null&&zd(n,e,t),bh(e,t)}}var Ch=!0;function wh(e,t,n,r){var i=I.T;I.T=null;var a=he.p;try{he.p=2,Eh(e,t,n,r)}finally{he.p=a,I.T=i}}function Th(e,t,n,r){var i=I.T;I.T=null;var a=he.p;try{he.p=8,Eh(e,t,n,r)}finally{he.p=a,I.T=i}}function Eh(e,t,n,r){if(Ch){var i=Dh(r);if(i===null)Qf(e,t,r,q,n),Rh(e,r);else if(Bh(i,e,t,n,r))r.stopPropagation();else if(Rh(e,r),t&4&&-1<Lh.indexOf(e)){for(;i!==null;){var a=Nt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ot(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-$e(o);s.entanglements[1]|=c,o&=~c}Mf(a),!(ed&6)&&(xd=Ve()+500,Nf(0,!1))}}break;case 31:case 13:s=Oi(a,2),s!==null&&zd(s,a,2),Wd(),bh(a,2)}if(a=Dh(r),a===null&&Qf(e,t,r,q,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Qf(e,t,r,null,n)}}function Dh(e){return e=xn(e),Oh(e)}var q=null;function Oh(e){if(q=null,e=Mt(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 q=e,null}function kh(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(He()){case Ue:return 2;case We:return 8;case Ge:case Ke:return 32;case qe:return 268435456;default:return 32}default:return 32}}var Ah=!1,jh=null,Mh=null,Nh=null,Ph=new Map,Fh=new Map,Ih=[],Lh=`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 Rh(e,t){switch(e){case`focusin`:case`focusout`:jh=null;break;case`dragenter`:case`dragleave`:Mh=null;break;case`mouseover`:case`mouseout`:Nh=null;break;case`pointerover`:case`pointerout`:Ph.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Fh.delete(t.pointerId)}}function zh(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=Nt(t),t!==null&&xh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Bh(e,t,n,r,i){switch(t){case`focusin`:return jh=zh(jh,e,t,n,r,i),!0;case`dragenter`:return Mh=zh(Mh,e,t,n,r,i),!0;case`mouseover`:return Nh=zh(Nh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ph.set(a,zh(Ph.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Fh.set(a,zh(Fh.get(a)||null,e,t,n,r,i)),!0}return!1}function Vh(e){var t=Mt(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,R(e.priority,function(){Sh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,R(e.priority,function(){Sh(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 Hh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Dh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);bn=r,n.target.dispatchEvent(r),bn=null}else return t=Nt(n),t!==null&&xh(t),e.blockedOn=n,!1;t.shift()}return!0}function Uh(e,t,n){Hh(e)&&n.delete(t)}function Wh(){Ah=!1,jh!==null&&Hh(jh)&&(jh=null),Mh!==null&&Hh(Mh)&&(Mh=null),Nh!==null&&Hh(Nh)&&(Nh=null),Ph.forEach(Uh),Fh.forEach(Uh)}function Gh(e,n){e.blockedOn===n&&(e.blockedOn=null,Ah||(Ah=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Wh)))}var Kh=null;function qh(e){Kh!==e&&(Kh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Kh===e&&(Kh=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(Oh(r||n)===null)continue;break}var a=Nt(n);a!==null&&(e.splice(t,3),t-=3,ec(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Jh(e){function t(t){return Gh(t,e)}jh!==null&&Gh(jh,e),Mh!==null&&Gh(Mh,e),Nh!==null&&Gh(Nh,e),Ph.forEach(t),Fh.forEach(t);for(var n=0;n<Ih.length;n++){var r=Ih[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ih.length&&(n=Ih[0],n.blockedOn===null);)Vh(n),n.blockedOn===null&&Ih.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[Ct]||null;if(typeof a==`function`)o||qh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Ct]||null)s=o.formAction;else if(Oh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),qh(n)}}}function Yh(){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 Xh(e){this._internalRoot=e}Zh.prototype.render=Xh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;vh(n,Id(),e,t,null,null)},Zh.prototype.unmount=Xh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vh(e.current,2,null,e,null,null),Wd(),t[wt]=null}};function Zh(e){this._internalRoot=e}Zh.prototype.unstable_scheduleHydration=function(e){if(e){var t=bt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ih.length&&t!==0&&t<Ih[n].priority;n++);Ih.splice(n,0,e),n===0&&Vh(e)}};var J=n.version;if(J!==`19.3.0`)throw Error(i(527,J,`19.3.0`));he.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 Qh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:I,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var $h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$h.isDisabled&&$h.supportsFiber)try{Xe=$h.inject(Qh),Ze=$h}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=xc,s=Sc,c=Cc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=gh(e,1,!1,null,null,n,r,null,o,s,c,Yh),e[wt]=t.current,Xf(e),new Xh(t)}})),g=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),v=o(((e,t)=>{t.exports=_()})),y=c(u(),1),b=v(),x=y.createContext(void 0),S=e=>{let t=y.useContext(x);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},C=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,b.jsx)(x.Provider,{value:e,children:t})),w={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},T=new class{#e=w;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function E(e){setTimeout(e,0)}var D=typeof window>`u`||`Deno`in globalThis;function O(){}function k(e,t){return typeof e==`function`?e(t):e}function A(e){return typeof e==`number`&&e>=0&&e!==1/0}function j(e,t){return Math.max(e+(t||0)-Date.now(),0)}function M(e,t){return typeof e==`function`?e(t):e}function N(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==te(o,t.options))return!1}else if(!ne(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function ee(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(P(t.options.mutationKey)!==P(a))return!1}else if(!ne(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function te(e,t){return(t?.queryKeyHashFn||P)(e)}function P(e){return JSON.stringify(e,(e,t)=>se(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ne(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!ne(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!ne(e[r],t[r]))return!1;return!0}return!1}var re=Object.prototype.hasOwnProperty;function ie(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=oe(e)&&oe(t);if(!r&&!(se(e)&&se(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:re.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ie(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function ae(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function oe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function se(e){if(!ce(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!ce(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function ce(e){return Object.prototype.toString.call(e)===`[object Object]`}function le(e){return new Promise(t=>{T.setTimeout(t,e)})}function F(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ie(e,t)}function ue(e){return e}function de(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function fe(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var pe=Symbol();function me(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===pe?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function I(e,t){return typeof e==`function`?e(...t):!!e}function he(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var ge=()=>D,_e=()=>ge(),ve=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ye=new class extends ve{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},be=E;function xe(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=be,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var L=xe(),Se=new class extends ve{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Ce(e){return Math.min(1e3*2**e,3e4)}function we(e){return(e??`online`)!==`online`||Se.isOnline()}var Te=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Ee(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(O);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Te(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>ye.isFocused()&&(e.networkMode===`always`||Se.isOnline())&&e.canRun(),p=()=>we(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(_e()?0:3),a=e.retryDelay??Ce,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),le(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var De=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),A(this.gcTime)&&(this.#e=T.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(_e()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(T.clearTimeout(this.#e),this.#e=void 0)}};function Oe(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{he(e,()=>t.signal,()=>n=!0)},u=me(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?fe:de;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Ae:ke,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:ke(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function ke(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ae(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function je(e,t){return t?ke(e,t)!=null:!1}function Me(e,t){return!t||!e.getPreviousPageParam?!1:Ae(e,t)!=null}var Ne=class extends De{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Ie(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Ie(this.options);e.data!==void 0&&(this.setState(Fe(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=F(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(O).catch(O):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>M(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===pe||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>M(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!j(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=me(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Oe(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Ee({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Te&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Te){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Pe(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Fe(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),L.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Pe(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:we(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Fe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Ie(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Le=class extends ve{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ze(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Be(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Be(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof M(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!ae(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Ve(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||M(this.options.enabled,this.#t)!==M(t.enabled,this.#t)||M(this.options.staleTime,this.#t)!==M(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||M(this.options.enabled,this.#t)!==M(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ae(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(O)),t}#h(e){return!_e()&&M(this.options.enabled,this.#t)!==!1&&A(e)}#g(){this.#b();let e=M(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=j(this.#r.dataUpdatedAt,e)+1;this.#u=T.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return M(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=T.setInterval(()=>{(this.options.refetchIntervalInBackground||ye.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(T.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(T.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&ze(e,t),o=i&&Ve(e,n,t,r);(a||o)&&(l={...l,...Pe(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=F(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=F(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:He(e,t),refetch:this.refetch,isEnabled:M(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),ae(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();L.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function Re(e,t){return M(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||M(t.retryOnMount,e)!==!1)}function ze(e,t){return Re(e,t)||e.state.data!==void 0&&Be(e,t,t.refetchOnMount)}function Be(e,t,n){if(M(t.enabled,e)!==!1&&M(t.staleTime,e)!==`static`){let r=M(n,e);return r===`always`||r!==!1&&He(e,t)}return!1}function Ve(e,t,n,r){return(e!==t||M(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&He(e,n)}function He(e,t){return M(t.enabled,e)!==!1&&e.isStaleByTime(M(t.staleTime,e))}var Ue=class extends Le{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:je(t,n.data),hasPreviousPage:Me(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},We=class extends De{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ge(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Ee({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),L.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ge(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ke=class extends ve{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new We({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=qe(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=qe(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=qe(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=qe(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){L.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ee(t,e))}findAll(e={}){return this.getAll().filter(t=>ee(e,t))}notify(e){L.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return L.batch(()=>Promise.all(e.map(e=>e.continue().catch(O))))}};function qe(e){return e.options.scope?.id}var Je=class extends ve{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),ae(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&P(t.mutationKey)!==P(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Ge();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){L.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function Ye(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var Xe=class extends ve{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,L.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!ae(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Ye(e,n).forEach(e=>{e.destroy()}),Ye(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=ie(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new Le(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&L.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},Ze=class extends ve{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??te(r,t),a=this.get(i);return a||(a=new Ne({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){L.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>N(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>N(e,t)):t}notify(e){L.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){L.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){L.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Qe=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ze,this.#t=e.mutationCache||new Ke,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ye.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Se.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(M(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=k(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return L.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;L.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return L.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=L.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(O).catch(O)}invalidateQueries(e,t={}){return L.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=L.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(O)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(O)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(M(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(M(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(O).catch(O)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(O).catch(O)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Se.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(P(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ne(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(P(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ne(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=te(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===pe&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},$e=y.createContext(!1),et=()=>y.useContext($e);$e.Provider;function tt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var nt=y.createContext(tt()),rt=()=>y.useContext(nt),it=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?I(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},at=e=>{y.useEffect(()=>{e.clearReset()},[e])},ot=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||I(n,[e.error,r])),st=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},ct=(e,t)=>e?.suspense&&t.isPending,lt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ut({queries:e,...t},n){let r=S(n),i=et(),a=rt(),o=t.subscribed!==!1,s=y.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{st(e);let t=r.getQueryCache().get(e.queryHash);it(e,a,t)}),at(a);let[c]=y.useState(()=>new Xe(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),f=!i&&o;y.useSyncExternalStore(y.useCallback(e=>f?c.subscribe(L.batchCalls(e)):O,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),y.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let p=l.some((e,t)=>ct(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&ct(n,e)?lt(n,new Le(r,n),a):[]}):[];if(p.length>0)throw Promise.all(p);let m=l.find((e,t)=>{let n=s[t];return n&&ot({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m)throw m.error;return u(d())}function dt(e,t,n){let r=et(),i=rt(),a=S(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,st(o),it(o,i,s),at(i);let[l]=y.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(y.useSyncExternalStore(y.useCallback(e=>{let t=d?l.subscribe(L.batchCalls(e)):O;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),y.useEffect(()=>{l.setOptions(o)},[o,l]),ct(o,u))throw lt(o,l,i);if(ot({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function ft(e,t){return dt(e,Le,t)}function pt(e,t){let n=S(t),[r]=y.useState(()=>new Je(n,e));y.useEffect(()=>{r.setOptions(e)},[r,e]);let i=y.useSyncExternalStore(y.useCallback(e=>r.subscribe(L.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=y.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(O)},[r]);if(i.error&&I(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function mt(e,t){return dt(e,Ue,t)}var ht=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,gt=/^[\\/]{2}/;function _t(e,t){return t+e.replace(/\\/g,`/`)}var vt=`popstate`;function yt(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function bt(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return wt(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:Tt(t)}return Dt(t,n,null,e)}function R(e,t){if(e===!1||e==null)throw Error(t)}function xt(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function St(){return Math.random().toString(36).substring(2,10)}function Ct(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function wt(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Et(t):t,state:n,key:t&&t.key||r||St(),mask:i}}function Tt({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Et(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Dt(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=yt(e)?e:wt(h.location,e,t);n&&n(r,e),l=u()+1;let d=Ct(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=yt(e)?e:wt(h.location,e,t);n&&n(r,e),l=u();let i=Ct(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Ot(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(vt,d),c=e,()=>{i.removeEventListener(vt,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Ot(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),R(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:Tt(t);return i=i.replace(/ $/,`%20`),!n&>.test(i)&&(i=r+i),new URL(i,r)}var kt=class{#e=new Map;constructor(e){if(e)for(let[t,n]of e)this.set(t,n)}get(e){if(this.#e.has(e))return this.#e.get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){this.#e.set(e,t)}},At=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`,`unstable_validateParams`]);function jt(e){return At.has(e)}var Mt=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`,`unstable_validateParams`]);function Nt(e){return Mt.has(e)}function Pt(e){return e.index===!0}function Ft(e){let t={};return e.Component&&Object.assign(t,{element:y.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:y.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:y.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function It(e,t=Ft,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(R(e.index!==!0||!e.children,`Cannot specify children on an index route`),R(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),Pt(e)){let n={...e,id:s};return r[s]=Lt(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=Lt(n,t(n)),e.children&&(n.children=It(e.children,t,o,r,i)),n}})}function Lt(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Rt(e,t,n=`/`){return zt(e,t,n,!1)}function zt(e,t,n,r,i){let a=cn((typeof t==`string`?Et(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Vt(e),s=null,c=sn(a);for(let e=0;s==null&&e<o.length;++e)s=nn(o[e],c,r);return s}function Bt(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,loaderData:t[n.id],handle:n.handle}}function Vt(e){let t=Ht(e);return Wt(t),t}function Ht(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;R(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=vn([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(R(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Ht(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:en(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=on(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Ut(e.path))a(e,t,!0,n)}),t}function Ut(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Ut(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Wt(e){e.sort((e,t)=>e.score===t.score?tn(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Gt=/^:[\w-]+$/,Kt=/^:[\w-]+/,qt=3.5,Jt=3,Yt=2,Xt=1,Zt=10,Qt=-2,$t=e=>e===`*`;function en(e,t){let n=e.split(`/`),r=n.length;return n.some($t)&&(r+=Qt),t&&(r+=Yt),n.filter(e=>!$t(e)).reduce((e,t)=>e+(Gt.test(t)?Jt:Kt.test(t)?qt:t===``?Xt:Zt),r)}function tn(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function nn(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?an(u,l,s.matcher,s.compiledParams):rn(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=rn({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:vn([a,d.pathname]),pathnameBase:bn(vn([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=vn([a,d.pathnameBase]))}return o}function rn(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=on(e.path,e.caseSensitive,e.end);return an(e,t,n,r)}function an(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=yn(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=yn(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function on(e,t=!1,n=!0){xt(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(?=\/|$|\()/g,`(?:/$1)?`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function sn(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return xt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function cn(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function ln({basename:e,pathname:t}){return t===`/`?e:vn([e,t])}var un=e=>ht.test(e);function dn(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Et(e):e,a;return n?(n=_n(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?fn(n.substring(1),`/`):fn(n,t)):a=t,{pathname:a,search:xn(r),hash:Sn(i)}}function fn(e,t){let n=yn(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function pn(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function mn(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function hn(e){let t=mn(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function gn(e,t,n,r=!1){let i;typeof e==`string`?i=Et(e):(i={...e},R(!i.pathname||!i.pathname.includes(`?`),pn(`?`,`pathname`,`search`,i)),R(!i.pathname||!i.pathname.includes(`#`),pn(`#`,`pathname`,`hash`,i)),R(!i.search||!i.search.includes(`#`),pn(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=dn(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var _n=e=>e.replace(/[\\/]{2,}/g,`/`),vn=e=>_n(e.join(`/`));function yn(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var bn=e=>yn(e).replace(/^\/*/,`/`),xn=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Sn=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Cn=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],wn=class{status;statusText;data;error;internal;constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Tn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function En(e){return vn(e.map(e=>e.route.path).filter(Boolean))||`/`}function Dn(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?Et(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);let i=e.toString();n.search=i?`?${i}`:``}else n.search=``;return n.hash=r.hash||``,n}var On=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function kn(e,t){let n=e;if(typeof n!=`string`||!ht.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(On)try{let e=new URL(window.location.href),r=gt.test(n)?new URL(_t(n,e.protocol)):new URL(n),a=cn(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{xt(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var An=Symbol(`Uninstrumented`),jn=new WeakMap;function Mn(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){e.lazy!=null&&n.lazy.push(e.lazy),e[`lazy.loader`]!=null&&n[`lazy.loader`].push(e[`lazy.loader`]),e[`lazy.action`]!=null&&n[`lazy.action`].push(e[`lazy.action`]),e[`lazy.middleware`]!=null&&n[`lazy.middleware`].push(e[`lazy.middleware`]),e.middleware!=null&&n.middleware.push(e.middleware),e.loader!=null&&n.loader.push(e.loader),e.action!=null&&n.action.push(e.action)}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=t.lazy;r.lazy=async(...t)=>Rn(await zn(n.lazy,void 0,()=>e(...t),Bn))}if(typeof t.lazy==`object`){let e=t.lazy;if(typeof e.middleware==`function`&&n[`lazy.middleware`].length>0){let t=e.middleware;r.lazy=Object.assign(r.lazy||{},{middleware:async(...e)=>Rn(await zn(n[`lazy.middleware`],void 0,()=>t(...e),Bn))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>Rn(await zn(n[`lazy.loader`],void 0,()=>t(...e),Bn))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>Rn(await zn(n[`lazy.action`],void 0,()=>t(...e),Bn))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=Pn(t.loader),i=async(...t)=>Rn(await zn(n.loader,Vn(t[0]),()=>e(...t),Bn));e.hydrate===!0&&(i.hydrate=!0),Fn(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=Pn(t.action),i=async(...t)=>Rn(await zn(n.action,Vn(t[0]),()=>e(...t),Bn));Fn(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=Pn(e),r=async(...e)=>Rn(await zn(n.middleware,Vn(e[0]),()=>t(...e),Bn));return Fn(r,t),r})),r}function Nn(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){e.navigate!=null&&n.navigate.push(e.navigate),e.fetch!=null&&n.fetch.push(e.fetch)}})),n.navigate.length>0){let t=Pn(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?Tt(i):`.`,...Hn(e,a??{})};return Rn(await zn(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=In(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...Bn(e),meta:o})))};Fn(r,t),e.navigate=r}if(n.fetch.length>0){let t=Pn(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return Rn(await zn(n.fetch,{href:o??`.`,fetcherKey:i,...Hn(e,s??{})},async()=>{let n=In(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...Bn(e),meta:c})))};Fn(r,t),e.fetch=r}return e}function Pn(e){return e[An]??e}function Fn(e,t){e[An]=t}function In(e,t){return jn.set(e,t),()=>{jn.get(e)===t&&jn.delete(e)}}function Ln(e){let t=jn.get(e);return jn.delete(e),t}function Rn(e){if(e.type===`error`)throw e.value;return e.value}async function zn(e,t,n,r,i={result:null,innerResult:null},a=e.length-1){let o=e[a];if(o){let s,c=async()=>(s?console.error(`You cannot call instrumented handlers more than once`):s=zn(e,t,n,r,i,a-1),await s,R(i.innerResult,`Expected an inner result`),i.innerResult);try{await o(c,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}s||await c(),await s}else{try{i.result={type:`success`,value:await n()}}catch(e){i.result={type:`error`,value:e}}i.innerResult=r(i.result,t)}return i.result?i.result:(i.result={type:`error`,value:Error(`No result assigned in instrumentation chain.`)},i.innerResult=r(i.result,t),i.result)}function Bn(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function Vn(e){let{request:t,context:n,params:r}=e;return{...e,request:Un(t),params:{...r},context:Wn(n)}}function Hn(e,t){return{currentUrl:Tt(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function Un(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Wn(e){return{get:t=>e.get(t)}}var Gn=class{#e=[];#t=[];#n;constructor(e){this.#n=e}update(e){this.#e=e,this.#t=Vt(e)}match(e,t=!1){return zt(this.#e,e,this.#n,t,this.#t)}},Kn=new URL(`http://localhost`);function qn(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Kn)}catch{return Kn}}function Jn(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Yn(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function Xn(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Jn(i,n),s=!Jn(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Yn(e,i)||!Jn(i,a)))throw Error(`External navigation is not allowed`)}var Zn=[`POST`,`PUT`,`PATCH`,`DELETE`],Qn=new Set(Zn),$n=[`GET`,...Zn],er=new Set($n),tr=new Set([301,302,303,307,308]),nr=new Set([307,308]),rr={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ir={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ar={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},or=`remix-router-transitions`,sr=Symbol(`ResetLoaderData`);function cr(e,t){return e.unstable_routePatternMatching?(R(void 0,`You must call unstable_preloadRoutePattern() from "react-router/route-pattern" before enabling future.unstable_routePatternMatching.`),new(void 0)(t)):new Gn(t)}var lr=class{#e;#t;#n;constructor(e,t){this.#e=e,this.#n=t,this.#n.update(e)}get stableRoutes(){return this.#e}get activeRoutes(){return this.#t??this.#e}get hasHMRRoutes(){return this.#t!=null}setRoutes(e){this.#e=e,this.#t||this.#n.update(e)}setHmrRoutes(e){this.#t=e,this.#n.update(e)}commitHmrRoutes(){this.#t&&(this.#e=this.#t,this.#t=void 0,this.#n.update(this.#e))}};function ur(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;R(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties,a=i||(()=>({}));if(e.instrumentations){let t=e.instrumentations;a=e=>({...i?.(e),...Mn(t.map(e=>e.route).filter(Boolean),e)})}let o={...e.future},s=e.basename||`/`;s.startsWith(`/`)||(s=`/${s}`);let c=cr(o,s),l={},u=new lr(It(e.routes,a,void 0,l),c),d=e.dataStrategy||Dr,f=null,p=new Set,m=null,h=null,g=null,_=null,v=e.hydrationData!=null,y=c.match(e.history.location),b=!1,x=null,S,C;if(y==null&&!e.patchRoutesOnNavigation){let t=Zr(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Xr(u.activeRoutes);S=!0,C=!S,y=n,x={[r.id]:t}}else if(y&&!e.hydrationData&&qe(y,e.history.location.pathname).active&&(y=null),!y){S=!1,C=!S,y=[];let t=qe(null,e.history.location.pathname);t.active&&t.matches&&(b=!0,y=t.matches)}else if(y.some(e=>e.route.lazy))S=!1,C=!S;else if(!y.some(e=>hr(e.route)))S=!0,C=!S;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=y;if(n){let e=y.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}C=!1,S=!0,r.forEach(e=>{let r=gr(e.route,t,n);C||=r.renderFallback,S&&=!r.shouldLoad})}let w,T={historyAction:e.history.action,location:e.history.location,matches:y,initialized:S,renderFallback:C,navigation:rr,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||x,fetchers:new Map,blockers:new Map},E=`POP`,D=null,O=!1,k,A=!1,j=new Map,M=null,N=!1,ee=!1,te=new Set,P=new Map,ne=0,re=-1,ie=new Map,ae=new Set,oe=new Map,se=new Map,ce=new Set,le=new Map,F,ue=null;function de(){if(f=e.history.listen(({action:t,location:n,delta:r})=>{if(F){F(),F=void 0;return}xt(le.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=Ve({currentLocation:T.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{F=e});e.history.go(r*-1),Be(i,{state:`blocked`,location:n,proceed(){Be(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(T.blockers);e.set(i,ar),me({blockers:e})}}),D?.resolve(),D=null;return}return _e(t,n)}),n){Si(t,j);let e=()=>Ci(t,j);t.addEventListener(`pagehide`,e),M=()=>t.removeEventListener(`pagehide`,e)}return T.initialized||_e(`POP`,T.location,{initialHydration:!0}),w}function fe(){f&&f(),M&&M(),p.clear(),k&&k.abort(),T.fetchers.forEach((e,t)=>Me(T.fetchers,t)),T.blockers.forEach((e,t)=>ze(t))}function pe(e){if(p.add(e),m){let{newErrors:t}=m;m=null,e(T,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>p.delete(e)}function me(e,t={}){e.matches&&=e.matches.map(e=>{let t=l[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),T={...T,...e};let n=[],r=[];T.fetchers.forEach((e,t)=>{e.state===`idle`&&(ce.has(t)?n.push(t):r.push(t))}),ce.forEach(e=>{!T.fetchers.has(e)&&!P.has(e)&&n.push(e)}),p.size===0&&(m={newErrors:e.errors??null}),[...p].forEach(r=>r(T,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Me(T.fetchers,e)),r.forEach(e=>T.fetchers.delete(e))}function I(t,n,{flushSync:r}={}){let i=T.actionData!=null&&T.navigation.formMethod!=null&&fi(T.navigation.formMethod)&&T.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?T.actionData:null;let o=n.loaderData?qr(T.loaderData,n.loaderData,n.matches||[],n.errors):T.loaderData,s=T.blockers;s.size>0&&!N&&(s=new Map(s),s.forEach((e,t)=>s.set(t,ar)));let c=!N&&Ke(t,n.matches||T.matches),l=O===!0||T.navigation.formMethod!=null&&fi(T.navigation.formMethod)&&t.state?._isRedirect!==!0;u.commitHmrRoutes(),N||E===`POP`||(E===`PUSH`?e.history.push(t,t.state):E===`REPLACE`&&e.history.replace(t,t.state));let d;if(E===`POP`&&!N&&t!==T.location){let e=j.get(T.location.pathname);e&&e.has(t.pathname)?d={currentLocation:T.location,nextLocation:t}:j.has(t.pathname)&&(d={currentLocation:t,nextLocation:T.location})}else if(A){let e=j.get(T.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),j.set(T.location.pathname,e)),d={currentLocation:T.location,nextLocation:t}}me({...n,actionData:a,loaderData:o,historyAction:E,location:t,initialized:!0,renderFallback:!1,navigation:rr,revalidation:`idle`,restoreScrollPosition:c,preventScrollReset:l,blockers:s},{viewTransitionOpts:d,flushSync:r===!0}),E=`POP`,O=!1,A=!1,N=!1,ee=!1,D?.resolve(),D=null,ue?.resolve(),ue=null}async function he(t,n){if(D?.resolve(),D=null,typeof t==`number`){D||=wi();let n=D.promise;return e.history.go(t),n}let r=Ln(w),{path:i,submission:a,error:o}=pr(!1,fr(T.location,T.matches,s,t,n?.fromRouteId,n?.relative),n),c;if(n?.mask){let t=typeof n.mask==`string`?Et(n.mask):{...T.location.mask,...n.mask};if(c={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},gt.test(c.pathname))throw Error(`External navigation is not allowed`);c.pathname.startsWith(`\\`)&&(c.pathname=c.pathname.replace(/^\\+/,`/`)),Xn(typeof n.mask==`string`?n.mask:Tt(n.mask),Tt(c),e.history.createURL(`/`),`reject`)}let l=T.location,u=wt(l,i,n&&n.state,void 0,c);u={...u,...e.history.encodeLocation(u)},Xn(t==null?e.history.createHref(T.location):typeof t==`string`?t:Tt(t),e.history.createHref(u.mask||u),e.history.createURL(`/`),`reject`);let d=n&&n.replace!=null?n.replace:void 0,f=`PUSH`;d===!0?f=`REPLACE`:d===!1||a!=null&&fi(a.formMethod)&&a.formAction===T.location.pathname+T.location.search&&(f=`REPLACE`);let p=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,m=(n&&n.flushSync)===!0,h=Ve({currentLocation:l,nextLocation:u,historyAction:f});if(h){Be(h,{state:`blocked`,location:u,proceed(){Be(h,{state:`proceeding`,proceed:void 0,reset:void 0,location:u}),he(t,n)},reset(){let e=new Map(T.blockers);e.set(h,ar),me({blockers:e})}});return}await _e(f,u,{submission:a,pendingError:o,preventScrollReset:p,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:m,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:r})}function ge(){ue||=wi(),De(),me({revalidation:`loading`});let e=ue.promise;return T.navigation.state===`submitting`?e:T.navigation.state===`idle`?(_e(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),e):(_e(E||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:A===!0}),e)}async function _e(t,n,r){k&&k.abort(),k=null,E=t,N=(r&&r.startUninterruptedRevalidation)===!0,Ge(T.location,T.matches),O=(r&&r.preventScrollReset)===!0,A=(r&&r.enableViewTransition)===!0;let i=r?.initialHydration&&T.matches&&T.matches.length>0&&!b?T.matches:c.match(n),a=(r&&r.flushSync)===!0;if(i&&T.initialized&&!ee&&ei(T.location,n)&&!(r&&r.submission&&fi(r.submission.formMethod))){I(n,{matches:i},{flushSync:a});return}let o=qe(i,n.pathname);if(o.active&&o.matches&&(i=o.matches),r?.instrumentationNavigateMetaReceiver){let t=hi(e.history,n,i);r.instrumentationNavigateMetaReceiver(t)}if(!i){let{error:e,notFoundMatches:t,route:r}=He(n.pathname);I(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:a});return}let s=r&&r.overrideNavigation?{...r.overrideNavigation,matches:i,historyAction:t}:void 0;k=new AbortController;let l=Hr(e.history,n,k.signal,r&&r.submission),u=e.getContext?await e.getContext():new kt,d;if(r&&r.pendingError)d=[Yr(i).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&fi(r.submission.formMethod)){let c=await ve(l,n,r.submission,i,t,u,o.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:a});if(c.shortCircuited)return;if(c.pendingActionResult){let[e,t]=c.pendingActionResult;if(ai(t)&&Tn(t.error)&&t.error.status===404){k=null,I(n,{matches:c.matches,loaderData:{},errors:{[e]:t.error}});return}}i=c.matches||i,d=c.pendingActionResult,s=_i(n,i,t,r.submission),a=!1,o.active=!1,l=Hr(e.history,l.url,l.signal)}let{shortCircuited:f,matches:p,loaderData:m,errors:h,workingFetchers:g}=await ye(l,n,i,t,u,o.active,s,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,a,d,r&&r.callSiteDefaultShouldRevalidate);f||(k=null,I(n,{matches:p||i,...Jr(d),loaderData:m,errors:h,...g?{fetchers:g}:{}}))}async function ve(t,n,i,o,c,d,f,p,m={}){if(De(),me({navigation:vi(n,o,c,i)},{flushSync:m.flushSync===!0}),f){let e=await Je(o,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Xr(u.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Yr(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)o=e.matches;else{let{notFoundMatches:e,error:t,route:r}=He(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=mi(o,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:Zr(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await Te(t,n,Nr(a,l,t,n,o,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of o)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(oi(h)){let n;return n=m&&m.replace!=null?m.replace:Vr(h.response.headers.get(`Location`),new URL(t.url),s,e.history)===T.location.pathname+T.location.search,await we(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(ai(h)){let e=Yr(o,g.route.id);return(m&&m.replace)!==!0&&(E=`PUSH`),{matches:o,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:o,pendingActionResult:[g.route.id,h]}}async function ye(t,n,i,o,s,d,f,p,m,h,g,_,v,y){let b=f||_i(n,i,o,p),x=p||m||gi(b),S=!N&&!g;if(d){if(S){let e=be(v);me({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await Je(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Xr(u.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Yr(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=He(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let{dsMatches:C,revalidatingFetchers:w}=mr(t,s,a,l,e.history,T,i,x,n,g?[]:r,g===!0,ee,te,ce,oe,ae,c,v,y);if(re=++ne,!e.dataStrategy&&!C.some(e=>e.shouldLoad)&&!C.some(e=>e.route.middleware&&e.route.middleware.length>0)&&w.length===0){let e=new Map(T.fetchers),t=Ie(e);return I(n,{matches:i,loaderData:{},errors:v&&ai(v[1])?{[v[0]]:v[1].error}:null,...Jr(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=be(v);t!==void 0&&(e.actionData=t)}w.length>0&&(e.fetchers=xe(w)),me(e,{flushSync:_})}w.forEach(e=>{Pe(e.key),e.controller&&P.set(e.key,e.controller)});let E=()=>w.forEach(e=>Pe(e.key));k&&k.signal.addEventListener(`abort`,E);let{loaderResults:D,fetcherResults:O}=await Ee(C,w,t,n,s);if(t.signal.aborted)return{shortCircuited:!0};k&&k.signal.removeEventListener(`abort`,E),w.forEach(e=>P.delete(e.key));let A=Qr(D);if(A)return await we(t,A.result,!0,{replace:h}),{shortCircuited:!0};if(A=Qr(O),A)return ae.add(A.key),await we(t,A.result,!0,{replace:h}),{shortCircuited:!0};let j=new Map(T.fetchers),{loaderData:M,errors:ie}=Kr(T,i,D,v,w,O,j);g&&T.errors&&(ie={...T.errors,...ie});let se=Ie(j),le=Le(re,j),F=se||le||w.length>0;return{matches:i,loaderData:M,errors:ie,...F?{workingFetchers:j}:{}}}function be(e){if(e&&!ai(e[1]))return{[e[0]]:e[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function xe(e){let t=new Map(T.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=yi(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function L(t,n,r,i){Pe(t);let a=(i&&i.flushSync)===!0,o=Ln(w),l=fr(T.location,T.matches,s,r,n,i?.relative),u=c.match(l),d=qe(u,l);if(d.active&&d.matches&&(u=d.matches),o&&o(hi(e.history,l,u)),!u){ke(t,n,Zr(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=pr(!0,l,i);if(m){ke(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new kt,g=(i&&i.preventScrollReset)===!0;if(p&&fi(p.formMethod)){await Se(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}let _={routeId:n,path:f,isDiscovering:d.active};oe.set(t,_),await Ce(t,_,u,h,a,g,p)}async function Se(t,n,i,o,s,u,d,f,p,m){De(),oe.delete(t),Oe(t,bi(p,T.fetchers.get(t)),{flushSync:d});let h=new AbortController,g=Hr(e.history,i,h.signal,p);if(u){let e=await Je(o,new URL(g.url).pathname,g.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){ke(t,n,e.error,{flushSync:d});return}if(e.matches)o=e.matches;else{ke(t,n,Zr(404,{pathname:i}),{flushSync:d});return}}let _=mi(o,i);if(!_.route.action&&!_.route.lazy){ke(t,n,Zr(405,{method:p.formMethod,pathname:i,routeId:n}),{flushSync:d});return}P.set(t,h);let v=ne,y=Nr(a,l,g,i,o,_,r,s),b=await Te(g,i,y,s,t),x=b[_.route.id];if(!x){for(let e of y)if(b[e.route.id]){x=b[e.route.id];break}}if(g.signal.aborted){P.get(t)===h&&P.delete(t);return}if(ce.has(t)){if(oi(x)||ai(x)){Oe(t,xi(void 0));return}}else{if(oi(x)){if(P.delete(t),re>v){Oe(t,xi(void 0));return}return ae.add(t),Oe(t,yi(p)),we(g,x,!1,{fetcherSubmission:p,preventScrollReset:f})}if(ai(x)){ke(t,n,x.error);return}}let S=T.navigation.location||T.location,C=Hr(e.history,S,h.signal),w=T.navigation.state===`idle`?T.matches:c.match(T.navigation.location);R(w,`Didn't find any matches after fetcher action`);let D=++ne;ie.set(t,D);let{dsMatches:O,revalidatingFetchers:A}=mr(C,s,a,l,e.history,T,w,p,S,r,!1,ee,te,ce,oe,ae,c,[_.route.id,x],m),j=yi(p,x.data),M=new Map(T.fetchers);M.set(t,j),A.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=M.get(t),r=yi(void 0,n?n.data:void 0);M.set(t,r),Pe(t),e.controller&&P.set(t,e.controller)}),me({fetchers:M});let N=()=>A.forEach(e=>Pe(e.key));h.signal.addEventListener(`abort`,N);let{loaderResults:se,fetcherResults:le}=await Ee(O,A,C,S,s);if(h.signal.aborted){ie.get(t)===D&&ie.delete(t);return}h.signal.removeEventListener(`abort`,N),ie.delete(t),P.delete(t),A.forEach(e=>P.delete(e.key));let F=T.fetchers.has(t),ue=e=>{if(!F)return e;let n=new Map(e.fetchers);return n.set(t,xi(x.data)),{...e,fetchers:n}},de=Qr(se);if(de)return T=ue(T),we(C,de.result,!1,{preventScrollReset:f});if(de=Qr(le),de)return ae.add(de.key),T=ue(T),we(C,de.result,!1,{preventScrollReset:f});let fe=new Map(T.fetchers);F&&fe.set(t,xi(x.data));let{loaderData:pe,errors:he}=Kr(T,w,se,void 0,A,le,fe);Le(D,fe),T.navigation.state===`loading`&&D>re?(R(E,`Expected pending action`),k&&k.abort(),I(T.navigation.location,{matches:w,loaderData:pe,errors:he,fetchers:fe})):(me({errors:he,loaderData:qr(T.loaderData,pe,w,he),fetchers:fe}),ee=!1)}async function Ce(t,n,i,o,s,c,u){let{routeId:d,path:f}=n,p=T.fetchers.get(t);Oe(t,yi(u,p?p.data:void 0),{flushSync:s});let m=new AbortController,h=Hr(e.history,f,m.signal);if(n.isDiscovering){let e=await Je(i,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){ke(t,d,e.error,{flushSync:s});return}if(e.matches)i=e.matches,n.isDiscovering=!1;else{ke(t,d,Zr(404,{pathname:f}),{flushSync:s});return}}let g=mi(i,f);P.set(t,m);let _=ne,v=await Te(h,f,Nr(a,l,h,f,i,g,r,o),o,t),y=v[g.route.id];if(!y){for(let e of i)if(v[e.route.id]){y=v[e.route.id];break}}if(P.get(t)===m&&P.delete(t),!h.signal.aborted){if(ce.has(t)){Oe(t,xi(void 0));return}if(oi(y)){if(re>_){Oe(t,xi(void 0));return}ae.add(t),await we(h,y,!1,{preventScrollReset:c});return}if(ai(y)){ke(t,d,y.error);return}Oe(t,xi(y.data))}}async function we(r,i,a,{submission:o,fetcherSubmission:c,preventScrollReset:l,replace:u}={}){a||(D?.resolve(),D=null),i.response.headers.has(`X-Remix-Revalidate`)&&(ee=!0);let d=i.response.headers.get(`Location`);R(d,`Expected a Location header on the redirect Response`);let f=d,p=new URL(r.url);d=Vr(d,p,s,e.history),Xn(f,d,p,`allow-explicit`);let m=wt(T.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(un(d)){let n=Ot(t,d,!0);e=n.origin!==t.location.origin||cn(n.pathname,s)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}k=null;let h=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:g,formAction:_,formEncType:v}=T.navigation;!o&&!c&&g&&_&&v&&(o=gi(T.navigation));let y=o||c;nr.has(i.response.status)&&y&&fi(y.formMethod)?await _e(h,m,{submission:{...y,formAction:d},preventScrollReset:l||O,enableViewTransition:a?A:void 0}):await _e(h,m,{overrideNavigation:_i(m,[],h,o),fetcherSubmission:c,preventScrollReset:l||O,enableViewTransition:a?A:void 0})}async function Te(e,t,n,r,i){let a,o={};try{a=await Pr(d,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!fi(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!T.loaderData.hasOwnProperty(e.route.id)&&(!T.errors||!T.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(ii(r)){let i=r.result;o[t]={type:`redirect`,response:Rr(i,e,t,n,s)}}else o[t]=await Lr(r);return o}async function Ee(e,t,n,r,i){let a=Te(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Te(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:Zr(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function De(){ee=!0,oe.forEach((e,t)=>{P.has(t)&&te.add(t),Pe(t)})}function Oe(e,t,n={}){let r=new Map(T.fetchers);r.set(e,t),me({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function ke(e,t,n,r={}){let i=Yr(T.matches,t),a=new Map(T.fetchers);Me(a,e),me({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Ae(e){return se.set(e,(se.get(e)||0)+1),ce.has(e)&&ce.delete(e),T.fetchers.get(e)||ir}function je(e,t){Pe(e,t?.reason),Oe(e,xi(null))}function Me(e,t){let n=T.fetchers.get(t);P.has(t)&&!(n&&n.state===`loading`&&ie.has(t))&&Pe(t),oe.delete(t),ie.delete(t),ae.delete(t),ce.delete(t),te.delete(t),e.delete(t)}function Ne(e){let t=(se.get(e)||0)-1;t<=0?(se.delete(e),ce.add(e)):se.set(e,t),me({fetchers:new Map(T.fetchers)})}function Pe(e,t){let n=P.get(e);n&&(n.abort(t),P.delete(e))}function Fe(e,t){for(let n of e){let e=t.get(n);R(e,`Expected fetcher: ${n}`);let r=xi(e.data);t.set(n,r)}}function Ie(e){let t=[],n=!1;for(let r of ae){let i=e.get(r);R(i,`Expected fetcher: ${r}`),i.state===`loading`&&(ae.delete(r),t.push(r),n=!0)}return Fe(t,e),n}function Le(e,t){let n=[];for(let[r,i]of ie)if(i<e){let e=t.get(r);R(e,`Expected fetcher: ${r}`),e.state===`loading`&&(Pe(r),ie.delete(r),n.push(r))}return Fe(n,t),n.length>0}function Re(e,t){let n=T.blockers.get(e)||ar;return le.get(e)!==t&&le.set(e,t),n}function ze(e){T.blockers.delete(e),le.delete(e)}function Be(e,t){let n=T.blockers.get(e)||ar;R(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(T.blockers);r.set(e,t),me({blockers:r})}function Ve({currentLocation:e,nextLocation:t,historyAction:n}){if(le.size===0)return;le.size>1&&xt(!1,`A router only supports one blocker at a time`);let r=Array.from(le.entries()),[i,a]=r[r.length-1],o=T.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function He(e){let t=Zr(404,{pathname:e}),n=u.activeRoutes,{matches:r,route:i}=Xr(n);return{notFoundMatches:r,route:i,error:t}}function Ue(e,t,n){if(h=e,_=t,g=n||null,!v&&T.navigation===rr){v=!0;let e=Ke(T.location,T.matches);e!=null&&me({restoreScrollPosition:e})}return()=>{h=null,_=null,g=null}}function We(e,t){return g&&g(e,t.map(e=>Bt(e,T.loaderData)))||e.key}function Ge(e,t){if(h&&_){let n=We(e,t);h[n]=_()}}function Ke(e,t){if(h){let n=We(e,t),r=h[n];if(typeof r==`number`)return r}return null}function qe(t,n){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:c.match(n,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:c.match(n,!0)}}return{active:!1,matches:null}}async function Je(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let o=t;for(;;){let t=l;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:o,fetcherKey:i,patch:(e,n)=>{r.aborted||br(e,n,u,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:o}}if(r.aborted)return{type:`aborted`};let s=c.match(n),d=null;if(s&&(Object.keys(s[0].params).length===0||(d=c.match(n,!0),!(d&&o.length<d.length&&Ye(o,d.slice(0,o.length))))))return{type:`success`,matches:s};if(d||=c.match(n,!0),!d||Ye(o,d))return{type:`success`,matches:null};o=d}}function Ye(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function Xe(e){l={},u.setHmrRoutes(It(e,a,void 0,l))}function Ze(e,t,n=!1){br(e,t,u,l,a,n),u.hasHMRRoutes||me({})}return w={get basename(){return s},get future(){return o},get state(){return T},get routes(){return u.stableRoutes},match(e){return c.match(e)},get manifest(){return l},get window(){return t},initialize:de,subscribe:pe,enableScrollRestoration:Ue,navigate:he,fetch:L,revalidate:ge,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Ae,resetFetcher:je,deleteFetcher:Ne,dispose:fe,getBlocker:Re,deleteBlocker:ze,patchRoutes:Ze,_internalFetchControllers:P,_internalSetRoutes:Xe,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){me(e)}},e.instrumentations&&(w=Nn(w,e.instrumentations.map(e=>e.router).filter(Boolean))),w}function dr(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function fr(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=gn(r||`.`,hn(o),cn(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=pi(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=ln({basename:n,pathname:c.pathname})),Tt(c)}function pr(e,t,n){if(!n||!dr(n))return{path:t};if(n.formMethod&&!di(n.formMethod))return{path:t,error:Zr(405,{method:n.formMethod})};let r=()=>({path:t,error:Zr(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=$r(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!fi(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}\n`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!fi(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}R(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Ur(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Ur(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Wr(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Wr(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(fi(c.formMethod))return{path:t,submission:c};let l=Et(t);return e&&l.search&&pi(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:Tt(l),submission:c}}function mr(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=_?ai(_[1])?_[1].error:_[1].data:void 0,b=i.createURL(a.location),x=i.createURL(c),S;if(u&&a.errors){let e=Object.keys(a.errors)[0];S=o.findIndex(t=>t.route.id===e)}else if(_&&ai(_[1])){let e=_[0];S=o.findIndex(t=>t.route.id===e)-1}let C=_?_[1].statusCode:void 0,w=C&&C>=400,T={currentUrl:b,currentParams:a.matches[0]?.params||{},nextUrl:x,nextParams:o[0].params,...s,actionResult:y,actionStatus:C},E=En(o),D=o.map((i,o)=>{let{route:s}=i,f=null;if(S!=null&&o>S)f=!1;else if(s.lazy)f=!0;else if(!hr(s))f=!1;else if(u){let{shouldLoad:e}=gr(s,a.loaderData,a.errors);f=e}else _r(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Mr(n,r,e,c,E,i,l,t,f);let p=!1;typeof v==`boolean`?p=v:w?p=!1:d||b.pathname+b.search===x.pathname+x.search?p=!0:b.search===x.search?vr(a.matches[o],i)&&(p=!0):p=!0;let m={...T,defaultShouldRevalidate:p};return Mr(n,r,e,c,E,i,l,t,yr(i,m),m,v)}),O=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s)||e.isDiscovering)return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,_=g.match(e.path);if(!_){O.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let y=mi(_,e.path),b=new AbortController,x=Hr(i,e.path,b.signal),S=null;if(f.has(s))f.delete(s),S=Nr(n,r,x,e.path,_,y,l,t);else if(m)d&&(S=Nr(n,r,x,e.path,_,y,l,t));else{let i;i=typeof v==`boolean`?v:!w&&d;let a={...T,defaultShouldRevalidate:i};yr(y,a)&&(S=Nr(n,r,x,e.path,_,y,l,t,a))}S&&O.push({key:s,routeId:e.routeId,path:e.path,matches:S,match:y,request:x,controller:b})}),{dsMatches:D,revalidatingFetchers:O}}function hr(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function gr(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!hr(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function _r(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function vr(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function yr(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function br(e,t,n,r,i,a){let o;if(e){let t=r[e];R(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>xr(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=It(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=It([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function xr(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index!==t.index||e.path!==t.path||e.caseSensitive!==t.caseSensitive?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>xr(e,t)))??!1}var Sr=new WeakMap,Cr=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(R(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=Sr.get(i);o||(o={},Sr.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=jt(e),n=i[e]!==void 0;if(t)xt(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)xt(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},wr=new WeakMap;function Tr(e,t,n,r,i){let a=n[e.id];if(R(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=wr.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{R(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=Nt(e),o=a[e]!==void 0;i?xt(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?xt(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return wr.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=Cr({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function Er(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Dr(e){return e.matches.some(e=>e.route.middleware)?Or(e,()=>Er(e)):Er(e)}function Or(e,t){return kr(e,t,e=>{if(ui(e))throw e;return e},ni,n);async function n(t,n,r){if(r)return Object.assign(r.value,{[n]:{type:`error`,result:t}});{let{matches:r}=e,i=Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0)),a=r[i].route.id;for(let e of r.slice(0,i+1))try{await e._lazyPromises?.route}catch{a=e.route.id;break}return{[Yr(r,a).route.id]:{type:`error`,result:t}}}}}async function kr(e,t,n,r,i){let{matches:a,...o}=e;return await Ar(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Ar(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await Ar(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function jr(e,t,n,r,i){let a=Cr({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Tr(r.route,fi(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Mr(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=jr(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?yr(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?yr(a,{...l,defaultShouldRevalidate:e}):yr(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!fi(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(fi(n.method)||!p)?Fr({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function Nr(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Mr(e,t,n,r,En(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:jr(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Pr(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:Dn(t,n),pattern:En(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return Or(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function Fr({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=fi(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:Dn(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a){if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw Zr(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw Zr(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function Ir(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Lr(e){let{result:t,type:n}=e;if(ci(t)){let e;try{e=await Ir(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new wn(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?si(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:ti(t),statusCode:Tn(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Tn(t)?t.status:void 0}:si(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function Rr(e,t,n,r,i){let a=e.headers.get(`Location`);if(R(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!un(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=fr(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var zr=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Br(e){try{return zr.includes(new URL(e).protocol)}catch{return!1}}function Vr(e,t,n,r){if(un(e)){let r=e,i=gt.test(r)?new URL(_t(r,t.protocol)):new URL(r);if(Br(i.toString()))throw Error(`Invalid redirect location`);let a=cn(i.pathname,n)!=null;if(i.origin===t.origin&&a)return _n(i.pathname)+i.search+i.hash}try{if(Br(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Hr(e,t,n,r){let i=e.createURL($r(t)).toString(),a={signal:n};if(r&&fi(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?Ur(r.formData):r.formData}return new Request(i,a)}function Ur(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Wr(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Gr(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&ai(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(R(!oi(f),`Cannot handle redirect results in processLoaderData`),ai(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=Yr(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=sr),c||(c=!0,s=Tn(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Kr(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Gr(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(R(s,`Did not find corresponding fetcher result`),ai(s)){let t=Yr(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(oi(s))R(!1,`Unhandled fetcher revalidation redirect`);else{let e=xi(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function qr(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==sr).reduce((e,[t,n])=>(e[t]=n,e),{}),a=0;for(let o of n){let n=o.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&o.route.loader&&(i[n]=e[n],a++),r&&r.hasOwnProperty(n))break}return Object.keys(t).length===0&&a===Object.keys(e).length?e:i}function Jr(e){return e?ai(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Yr(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.ErrorBoundary!=null||e.route.errorElement!=null)||e[0]}function Xr(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function Zr(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new wn(e||500,o,Error(s),!0)}function Qr(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(oi(r))return{key:n,result:r}}}function $r(e){return Tt({...typeof e==`string`?Et(e):e,hash:``})}function ei(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function ti(e){return new wn(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function ni(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&ri(t))}function ri(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function ii(e){return ci(e.result)&&tr.has(e.result.status)}function ai(e){return e.type===`error`}function oi(e){return(e&&e.type)===`redirect`}function si(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function ci(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function li(e){return tr.has(e)}function ui(e){return ci(e)&&li(e.status)&&e.headers.has(`Location`)}function di(e){return er.has(e.toUpperCase())}function fi(e){return Qn.has(e.toUpperCase())}function pi(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function mi(e,t){let n=typeof t==`string`?Et(t).search:t.search;if(e[e.length-1].route.index&&pi(n||``))return e[e.length-1];let r=mn(e);return r[r.length-1]}function hi(e,t,n){return{url:Dn(e.createURL(t),t),pattern:n?En(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function gi(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(t&&n&&r){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function _i(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function vi(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function yi(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function bi(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function xi(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Si(e,t){try{let n=e.sessionStorage.getItem(or);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function Ci(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(or,JSON.stringify(n))}catch(e){xt(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function wi(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Ti=y.createContext(null);Ti.displayName=`DataRouter`;var Ei=y.createContext(null);Ei.displayName=`DataRouterState`;var Di=y.createContext(null);Di.displayName=`DataRouterData`;var Oi=y.createContext(null);Oi.displayName=`DataRouterNavigation`;var ki=y.createContext(!1);function Ai(){return y.useContext(ki)}var ji=y.createContext({isTransitioning:!1});ji.displayName=`ViewTransition`;var Mi=y.createContext(null);Mi.displayName=`Fetchers`;var Ni=y.createContext(null);Ni.displayName=`Await`;var Pi=y.createContext(null);Pi.displayName=`Navigation`;var Fi=y.createContext(null);Fi.displayName=`Location`;var Ii=y.createContext({outlet:null,matches:[],isDataRoute:!1});Ii.displayName=`Route`;var Li=y.createContext(!1);Li.displayName=`IsDataRoute`;var Ri=y.createContext(void 0);Ri.displayName=`RouteId`;var zi=y.createContext(null);zi.displayName=`RouteError`;var Bi=`REACT_ROUTER_ERROR`,Vi=`REDIRECT`,Hi=`ROUTE_ERROR_RESPONSE`;function Ui(e){if(e.startsWith(`${Bi}:${Vi}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Wi(e){if(e.startsWith(`${Bi}:${Hi}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new wn(t.status,t.statusText,t.data)}catch{}}function Gi(e,{relative:t}={}){R(Ki(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=y.useContext(Pi),{hash:i,pathname:a,search:o}=ea(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:vn([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Ki(){return y.useContext(Fi)!=null}function qi(){return R(Ki(),`useLocation() may be used only in the context of a <Router> component.`),y.useContext(Fi).location}var Ji=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Yi(){return y.useContext(Li)?ga():Xi()}function Xi(){R(Ki(),`useNavigate() may be used only in the context of a <Router> component.`);let e=y.useContext(Ti),{basename:t,navigator:n}=y.useContext(Pi),{matches:r}=y.useContext(Ii),{pathname:i}=qi(),a=JSON.stringify(hn(r)),o=y.useRef(!1);return y.useLayoutEffect(()=>{o.current=!0}),y.useCallback((r,s={})=>{if(xt(o.current,Ji),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=gn(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:vn([t,c.pathname])),Xn(typeof r==`string`?r:Tt(r),n.createHref(c),qn(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Zi=y.createContext(null);function Qi(e){let t=y.useContext(Ii).outlet;return y.useMemo(()=>t&&y.createElement(Zi.Provider,{value:e},t),[t,e])}function $i(){let{matches:e}=y.useContext(Ii);return e[e.length-1]?.params??{}}function ea(e,{relative:t}={}){let{matches:n}=y.useContext(Ii),{pathname:r}=qi(),i=JSON.stringify(hn(n));return y.useMemo(()=>gn(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function ta(e,t,n){R(Ki(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=y.useContext(Pi),{matches:i}=y.useContext(Ii),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let c=qi(),l;if(t){let e=typeof t==`string`?Et(t):t;R(s===`/`||e.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),l=e}else l=c;let u=l.pathname||`/`,d=u;if(s!==`/`){let e=s.replace(/^\//,``).split(`/`);d=`/`+u.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let f;f=n?n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):n.router.match(n.state.location):Rt(e,{pathname:d});let p=sa(f&&f.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:vn([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:vn([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&p?y.createElement(Fi.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...l},navigationType:`POP`}},p):p}function na(){let e=pa(),t=Tn(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return y.createElement(y.Fragment,null,y.createElement(`h2`,null,`Unexpected Application Error!`),y.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?y.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var ra=y.createElement(na,null),ia=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=ki;static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Wi(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:y.createElement(Ii.Provider,{value:this.props.routeContext},y.createElement(Li.Provider,{value:this.props.routeContext.isDataRoute},y.createElement(Ri.Provider,{value:this.props.routeContext.matches[this.props.routeContext.matches.length-1]?.route.id},y.createElement(zi.Provider,{value:e,children:this.props.component}))));return this.context?y.createElement(z,{error:e},t):t}},aa=new WeakMap;function z({children:e,error:t}){let{basename:n,navigator:r}=y.useContext(Pi);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Ui(t.digest);if(e){let i=aa.get(t);if(i)throw i;let a=kn(e.location,n),o=a.absoluteURL||a.to;if(Xn(e.location,o,qn(r),`allow-explicit`),Br(o))throw Error(`Invalid redirect location`);if(On&&!aa.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw aa.set(t,n),n}}return y.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function oa({routeContext:e,match:t,children:n}){let r=y.useContext(Ti);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(Ii.Provider,{value:e},y.createElement(Li.Provider,{value:e.isDataRoute},y.createElement(Ri.Provider,{value:t.route.id},n)))}function sa(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);R(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:En(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||ra,o&&(s<0&&c===0?(va(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?y.createElement(n.route.Component,null):n.route.element?n.route.element:e,y.createElement(oa,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?y.createElement(ia,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function ca(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function la(e){let t=y.useContext(Ti);return R(t,ca(e)),t}function ua(e){let t=y.useContext(Ei);return R(t,ca(e)),t}function da(e){let t=y.useContext(Di);return R(t,ca(e)),t}function fa(e){let t=y.useContext(Ri);return R(t,`${e} can only be used on routes that contain a unique "id"`),t}function pa(){let e=y.useContext(zi),t=da(`useRouteError`),n=fa(`useRouteError`);return e===void 0?t.errors?.[n]:e}var ma=0;function ha(e){let{router:t,basename:n}=la(`useBlocker`),r=ua(`useBlocker`),[i,a]=y.useState(``),o=y.useCallback(t=>{if(typeof e!=`function`)return!!e;if(n===`/`)return e(t);let{currentLocation:r,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...r,pathname:cn(r.pathname,n)||r.pathname},nextLocation:{...i,pathname:cn(i.pathname,n)||i.pathname},historyAction:a})},[n,e]);return y.useEffect(()=>{let e=String(++ma);return a(e),()=>t.deleteBlocker(e)},[t]),y.useEffect(()=>{i!==``&&t.getBlocker(i,o)},[t,i,o]),i&&r.blockers.has(i)?r.blockers.get(i):ar}function ga(){let{router:e}=la(`useNavigate`),t=fa(`useNavigate`),n=y.useRef(!1);return y.useLayoutEffect(()=>{n.current=!0}),y.useCallback(async(r,i={})=>{xt(n.current,Ji),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var _a={};function va(e,t,n){!t&&!_a[e]&&(_a[e]=!0,xt(!1,n))}var ya={};function ba(e,t){!e&&!ya[t]&&(ya[t]=!0,console.warn(t))}var xa=[`HydrateFallback`,`hydrateFallbackElement`],Sa=class{status=`pending`;promise;resolve;reject;constructor(){this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function Ca({router:e,flushSync:t,onError:n,useTransitions:r}){r=Ai()||r;let[i,a]=y.useState(e.state),[o,s]=(0,y.useOptimistic)(i),[c,l]=y.useState(),[u,d]=y.useState({isTransitioning:!1}),[f,p]=y.useState(),[m,h]=y.useState(),[g,_]=y.useState(),v=y.useRef(new Map),b=y.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:g})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:En(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&v.current.set(t,e.data)}),o.forEach(e=>v.current.delete(e)),ba(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(ba(g==null||b,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!g||!b){t&&u?t(()=>a(i)):r===!1?a(i):y.startTransition(()=>{r===!0&&s(e=>wa(e,i)),a(i)});return}if(t&&u){t(()=>{m&&(f?.resolve(),m.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:g.currentLocation,nextLocation:g.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>h(n));return}m?(f?.resolve(),m.skipTransition(),_({state:i,currentLocation:g.currentLocation,nextLocation:g.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}))},[e.window,t,m,f,r,s,n]);y.useLayoutEffect(()=>e.subscribe(b),[e,b]),y.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new Sa)},[u]),y.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):y.startTransition(()=>{r===!0&&s(e=>wa(e,t)),a(t)}),await n});i.finished.finally(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})}),h(i)}},[c,f,e.window,r,s]),y.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,m,o.location,c]),y.useEffect(()=>{!u.isTransitioning&&g&&(l(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),_(void 0))},[u.isTransitioning,g]);let x=y.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=y.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:n}),[e,x,S,n]),w=y.useMemo(()=>({historyAction:o.historyAction,location:o.location,matches:o.matches,initialized:o.initialized,renderFallback:o.renderFallback,restoreScrollPosition:o.restoreScrollPosition,preventScrollReset:o.preventScrollReset,blockers:o.blockers}),[o.historyAction,o.location,o.matches,o.initialized,o.renderFallback,o.restoreScrollPosition,o.preventScrollReset,o.blockers]),T=y.useMemo(()=>({navigation:o.navigation,revalidation:o.revalidation}),[o.navigation,o.revalidation]),E=y.useMemo(()=>({loaderData:o.loaderData,actionData:o.actionData,errors:o.errors}),[o.loaderData,o.actionData,o.errors]),D=y.useMemo(()=>({fetchers:o.fetchers,fetcherData:v.current}),[o.fetchers]);return y.createElement(y.Fragment,null,y.createElement(Ti.Provider,{value:C},y.createElement(Ei.Provider,{value:w},y.createElement(Oi.Provider,{value:T},y.createElement(Di.Provider,{value:E},y.createElement(Mi.Provider,{value:D},y.createElement(ji.Provider,{value:u},y.createElement(ka,{basename:S,location:o.location,navigationType:o.historyAction,navigator:x,useTransitions:r},y.createElement(Ta,{routes:e.routes,manifest:e.manifest,state:o,isStatic:!1,onError:n})))))))),null)}function wa(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var Ta=y.memo(Ea);function Ea({routes:e,manifest:t,state:n,isStatic:r,onError:i}){let a=y.useContext(Ti);return R(a,`You must render this element inside a <DataRouterContext.Provider> element`),ta(e,void 0,{router:a.router,manifest:t,state:n,isStatic:r,onError:i})}function Da({to:e,replace:t,state:n,relative:r}){R(Ki(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=y.useContext(Pi);xt(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=y.useContext(Ii),{pathname:s}=qi(),c=Yi(),l=gn(e,hn(o),s,r===`path`);Xn(typeof e==`string`?e:Tt(e),a.createHref(l),qn(a),`reject`);let u=JSON.stringify(l);return y.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function Oa(e){return Qi(e.context)}function ka({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){R(!Ki(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=y.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=Et(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=y.useMemo(()=>{let e=cn(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return xt(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:y.createElement(Pi.Provider,{value:c},y.createElement(Fi.Provider,{children:t,value:h}))}y.Component;var Aa=`application/x-www-form-urlencoded`;function ja(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Ma(e){return ja(e)&&e.tagName.toLowerCase()===`button`}function Na(e){return ja(e)&&e.tagName.toLowerCase()===`form`}function Pa(e){return ja(e)&&e.tagName.toLowerCase()===`input`}function Fa(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ia(e,t){return e.button===0&&(!t||t===`_self`)&&!Fa(e)}function La(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Ra(e,t){let n=La(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var za=null;function Ba(){if(za===null)try{new FormData(document.createElement(`form`),0),za=!1}catch{za=!0}return za}var Va=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Ha(e){return e!=null&&!Va.has(e)?(xt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Aa}"`),null):e}function Ua(e,t){let n,r,i,a,o;if(Na(e)){let o=e.getAttribute(`action`);r=o?cn(o,t):null,n=e.getAttribute(`method`)||`get`,i=Ha(e.getAttribute(`enctype`))||Aa,a=new FormData(e)}else if(Ma(e)||Pa(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?cn(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=Ha(e.getAttribute(`formenctype`))||Ha(o.getAttribute(`enctype`))||Aa,a=new FormData(o,e),!Ba()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(ja(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=Aa,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}function Wa(e,t){if(e===!1||e==null)throw Error(t)}function Ga(e,t){let n=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n.pathname=n.pathname.endsWith(`/`)?`${n.pathname}_.${t}`:`${n.pathname}.${t}`,n}var Ka=g(),qa=`modulepreload`,Ja=function(e,t){return new URL(e,t).href},Ya={},Xa=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Ja(t,n),t=s(t),t in Ya)return;Ya[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:qa,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};async function Za(e,t){if(e.id in t)return t[e.id];try{let n=await Xa(()=>import(e.module),[],import.meta.url);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Qa(e){return e!=null&&typeof e.page==`string`}function $a(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function eo(e,t,n){return ao((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Za(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter($a).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function to(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function no(e,t,{includeHydrateFallback:n}={}){return ro(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function ro(e){return[...new Set(e)]}function io(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function ao(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Qa(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(io(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}var oo=y.createContext(void 0);oo.displayName=`FrameworkContext`;function so(){let e=y.useContext(oo);return Wa(e,`You must render this element inside a <HydratedRouter> element`),e}function co(e,t){let n=y.useContext(oo),[r,i]=y.useState(!1),[a,o]=y.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=y.useRef(null);y.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),y.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:lo(s,p),onBlur:lo(c,m),onMouseEnter:lo(l,p),onMouseLeave:lo(u,m),onTouchStart:lo(d,p)}]:[a,f,{}]:[!1,f,{}]}function lo(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function uo({page:e,...t}){let n=Ai(),{nonce:r}=so(),{router:i}=la(`PrefetchPageLinks`),a=y.useMemo(()=>i.match(e),[i,i.routes,e]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?y.createElement(po,{page:e,matches:a,...t}):y.createElement(mo,{page:e,matches:a,...t})):null}function fo(e){let{manifest:t,routeModules:n}=so(),[r,i]=y.useState([]);return y.useEffect(()=>{let r=!1;return eo(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function po({page:e,matches:t,...n}){let r=qi(),i=y.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Ga(e,`rsc`),i=!1,a=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?i=!0:a.push(e.route.id);return i&&a.length>0&&n.searchParams.set(`_routes`,a.join(`,`)),[n.pathname+n.search]},[e,r,t]);return y.createElement(y.Fragment,null,i.map(e=>y.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function mo({page:e,matches:t,...n}){let r=qi(),{manifest:i,routeModules:a}=so(),{matches:o}=ua(`PrefetchPageLinks`),{loaderData:s}=da(`PrefetchPageLinks`),c=y.useMemo(()=>to(e,t,o,i,r,`data`),[e,t,o,i,r]),l=y.useMemo(()=>to(e,t,o,i,r,`assets`),[e,t,o,i,r]),u=y.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,o=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];t&&t.hasLoader&&(!c.some(t=>t.route.id===e.route.id)&&e.route.id in s&&a[e.route.id]?.shouldRevalidate||t.hasClientLoader?o=!0:n.add(e.route.id))}),n.size===0)return[];let l=Ga(e,`data`);return o&&n.size>0&&l.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[l.pathname+l.search]},[s,r,i,c,t,e,a]),d=y.useMemo(()=>no(l,i),[l,i]),f=fo(l);return y.createElement(y.Fragment,null,u.map(e=>y.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),d.map(e=>y.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),f.map(({key:e,link:t})=>y.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function ho(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var go=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{go&&(window.__reactRouterVersion=`8`)}catch{}function _o(e,t){return ur({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:bt({window:t?.window}),hydrationData:t?.hydrationData||vo(),routes:e,mapRouteProperties:Ft,hydrationRouteProperties:xa,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function vo(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:yo(e.errors)}),e}function yo(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new wn(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&Cn.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}var bo=y.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=y.useContext(Pi),v=typeof l==`string`&&ht.test(l),b=kn(l,h);l=b.to;let x=Gi(l,{relative:r}),S=qi(),C=null;if(o){let e=gn(o,[],S.mask?S.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:vn([h,e.pathname])),C=g.createHref(e)}let[w,T,E]=co(n,p),D=Co(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),A=y.createElement(`a`,{...p,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:ho(m,T),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return w&&!v?y.createElement(y.Fragment,null,A,y.createElement(uo,{page:x})):A});bo.displayName=`Link`;var xo=y.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=ea(a,{relative:c.relative}),d=qi(),f=y.useContext(Oi),{navigator:p,basename:m}=y.useContext(Pi),h=f!=null&&ko(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f?.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=cn(v,m)||v);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=_===g||!r&&_.startsWith(g)&&_.charAt(b)===`/`,S=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(b)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return y.createElement(bo,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});xo.displayName=`NavLink`;var So=y.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=`get`,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=y.useContext(Pi),g=Do(),_=Oo(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&ht.test(s);return y.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?y.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});So.displayName=`Form`;function Co(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Yi(),d=qi(),f=ea(e,{relative:o});return y.useCallback(p=>{if(Ia(p,t)){p.preventDefault();let t=n===void 0?Tt(d)===Tt(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?y.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function wo(e){xt(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=y.useRef(La(e)),n=y.useRef(!1),r=qi(),i=y.useMemo(()=>Ra(r.search,n.current?null:t.current),[r.search]),a=Yi();return[i,y.useCallback((e,t)=>{let r=La(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var To=0,Eo=()=>`__${String(++To)}__`;function Do(){let{router:e}=la(`useSubmit`),{basename:t}=y.useContext(Pi),n=fa(`useSubmit`),r=e.fetch,i=e.navigate;return y.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Ua(e,t);a.navigate===!1?await r(a.fetcherKey||Eo(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Oo(e,{relative:t}={}){let{basename:n}=y.useContext(Pi),r=y.useContext(Ii);R(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...ea(e||`.`,{relative:t})},o=qi();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:vn([n,a.pathname])),Tt(a)}function ko(e,{relative:t}={}){let n=y.useContext(ji);R(n!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=la(`useViewTransitionState`),i=ea(e,{relative:t});if(!n.isTransitioning)return!1;let a=cn(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=cn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return rn(i.pathname,o)!=null||rn(i.pathname,a)!=null}function Ao(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=Ao(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function jo(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ao(e))&&(r&&(r+=` `),r+=t);return r}var Mo=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},No=(e,t)=>({classGroupId:e,validator:t}),Po=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Fo=`-`,Io=[],Lo=`arbitrary..`,Ro=e=>{let t=Vo(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Bo(e);let n=e.split(Fo);return zo(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Mo(i,t):t:i||Io}return n[e]||Io}}},zo=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=zo(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Fo):e.slice(t).join(Fo),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Bo=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Lo+r:void 0})(),Vo=e=>{let{theme:t,classGroups:n}=e;return Ho(n,t)},Ho=(e,t)=>{let n=Po();for(let r in e){let i=e[r];Uo(i,n,r,t)}return n},Uo=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];B(i,t,n,r)}},B=(e,t,n,r)=>{if(typeof e==`string`){Wo(e,t,n);return}if(typeof e==`function`){Go(e,t,n,r);return}Ko(e,t,n,r)},Wo=(e,t,n)=>{let r=e===``?t:qo(t,e);r.classGroupId=n},Go=(e,t,n,r)=>{if(Jo(e)){Uo(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(No(n,e))},Ko=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Uo(o,qo(t,a),n,r)}},qo=(e,t)=>{let n=e,r=t.split(Fo),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Po(),n.nextPart.set(t,i)),n=i}return n},Jo=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Yo=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Xo=`!`,Zo=`:`,Qo=[],$o=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),es=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Zo){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Xo)?(c=s.slice(0,-1),l=!0):s.startsWith(Xo)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return $o(t,l,c,u)};if(t){let e=t+Zo,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):$o(Qo,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ts=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},ns=e=>({cache:Yo(e.cacheSize),parseClassName:es(e),sortModifiers:ts(e),postfixLookupClassGroupIds:rs(e),...Ro(e)}),rs=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},is=/\s+/,as=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(is),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Xo:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},os=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=ss(n))&&(i&&(i+=` `),i+=r);return i},ss=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=ss(e[r]))&&(n&&(n+=` `),n+=t);return n},cs=(e,...t)=>{let n,r,i,a,o=o=>(n=ns(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=as(e,n);return i(e,a),a};return a=o,(...e)=>a(os(...e))},ls=[],us=e=>{let t=t=>t[e]||ls;return t.isThemeGetter=!0,t.themeKey=e,t},ds=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fs=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ps=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ms=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hs=/\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$/,gs=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,_s=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vs=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ys=e=>ps.test(e),V=e=>!!e&&!Number.isNaN(Number(e)),bs=e=>!!e&&Number.isInteger(Number(e)),xs=e=>e.endsWith(`%`)&&V(e.slice(0,-1)),Ss=e=>ms.test(e),Cs=()=>!0,ws=e=>hs.test(e)&&!gs.test(e),Ts=()=>!1,Es=e=>_s.test(e),Ds=e=>vs.test(e),Os=e=>!H(e)&&!U(e),ks=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)),As=e=>Gs(e,Ys,Ts),H=e=>ds.test(e),js=e=>Gs(e,Xs,ws),Ms=e=>Gs(e,Zs,V),Ns=e=>Gs(e,$s,Cs),Ps=e=>Gs(e,Qs,Ts),Fs=e=>Gs(e,qs,Ts),Is=e=>Gs(e,Js,Ds),Ls=e=>Gs(e,ec,Es),U=e=>fs.test(e),Rs=e=>Ks(e,Xs),zs=e=>Ks(e,Qs),Bs=e=>Ks(e,qs),Vs=e=>Ks(e,Ys),Hs=e=>Ks(e,Js),Us=e=>Ks(e,ec,!0),Ws=e=>Ks(e,$s,!0),Gs=(e,t,n)=>{let r=ds.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ks=(e,t,n=!1)=>{let r=fs.exec(e);return r?r[1]?t(r[1]):n:!1},qs=e=>e===`position`||e===`percentage`,Js=e=>e===`image`||e===`url`,Ys=e=>e===`length`||e===`size`||e===`bg-size`,Xs=e=>e===`length`,Zs=e=>e===`number`,Qs=e=>e===`family-name`,$s=e=>e===`number`||e===`weight`,ec=e=>e===`shadow`,tc=cs(()=>{let e=us(`color`),t=us(`font`),n=us(`text`),r=us(`font-weight`),i=us(`tracking`),a=us(`leading`),o=us(`breakpoint`),s=us(`container`),c=us(`spacing`),l=us(`radius`),u=us(`shadow`),d=us(`inset-shadow`),f=us(`text-shadow`),p=us(`drop-shadow`),m=us(`blur`),h=us(`perspective`),g=us(`aspect`),_=us(`ease`),v=us(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),U,H],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[U,H,c],T=()=>[ys,`full`,`auto`,...w()],E=()=>[bs,`none`,`subgrid`,U,H],D=()=>[`auto`,{span:[`full`,bs,U,H]},bs,U,H],O=()=>[bs,`auto`,U,H],k=()=>[`auto`,`min`,`max`,`fr`,U,H],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[ys,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ee=()=>[s,ys,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],te=()=>[ys,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,U,H],ne=()=>[...b(),Bs,Fs,{position:[U,H]}],re=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,Vs,As,{size:[U,H]}],ae=()=>[xs,Rs,js],oe=()=>[``,`none`,`full`,l,U,H],se=()=>[``,V,Rs,js],ce=()=>[`solid`,`dashed`,`dotted`,`double`],le=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],F=()=>[V,xs,Bs,Fs],ue=()=>[``,`none`,m,U,H],de=()=>[`none`,V,U,H],fe=()=>[`none`,V,U,H],pe=()=>[V,U,H],me=()=>[ys,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Ss],breakpoint:[Ss],color:[Cs],container:[Ss],"drop-shadow":[Ss],ease:[`in`,`out`,`in-out`],font:[Os],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Ss],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Ss],shadow:[Ss],spacing:[`px`,V],text:[Ss],"text-shadow":[Ss],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,ys,H,U,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,U,H]}],"container-named":[ks],columns:[{columns:[V,`auto`,H,U,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[bs,`auto`,U,H]}],basis:[{basis:[ys,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[V,ys,`auto`,`initial`,`none`,H]}],grow:[{grow:[``,V,U,H]}],shrink:[{shrink:[``,V,U,H]}],order:[{order:[bs,`first`,`last`,`none`,U,H]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...ee()]}],"min-inline-size":[{"min-inline":[`auto`,...ee()]}],"max-inline-size":[{"max-inline":[`none`,...ee()]}],"block-size":[{block:[`auto`,...te()]}],"min-block-size":[{"min-block":[`auto`,...te()]}],"max-block-size":[{"max-block":[`none`,...te()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...N()]}],"font-size":[{text:[`base`,n,Rs,js]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Ws,Ns]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,xs,H]}],"font-family":[{font:[zs,Ps,t]}],"font-features":[{"font-features":[H]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,U,H]}],"line-clamp":[{"line-clamp":[V,`none`,U,Ms]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,U,H]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,U,H]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ce(),`wavy`]}],"text-decoration-thickness":[{decoration:[V,`from-font`,`auto`,U,js]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[V,`auto`,U,H]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[bs,U,H]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,U,H]}],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`,U,H]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},bs,U,H],radial:[``,U,H],conic:[``,bs,U,H]},Hs,Is]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-bs":[{"border-bs":se()}],"border-w-be":[{"border-be":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":se()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ce(),`hidden`,`none`]}],"divide-style":[{divide:[...ce(),`hidden`,`none`]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...ce(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[V,U,H]}],"outline-w":[{outline:[``,V,Rs,js]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`inner`,`none`,u,Us,Ls]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,Us,Ls]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:se()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[V,js]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,Us,Ls]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[V,U,H]}],"mix-blend":[{"mix-blend":[...le(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":le()}],"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]}],"mask-image-linear-from-pos":[{"mask-linear-from":F()}],"mask-image-linear-to-pos":[{"mask-linear-to":F()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":F()}],"mask-image-t-to-pos":[{"mask-t-to":F()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":F()}],"mask-image-r-to-pos":[{"mask-r-to":F()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":F()}],"mask-image-b-to-pos":[{"mask-b-to":F()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":F()}],"mask-image-l-to-pos":[{"mask-l-to":F()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":F()}],"mask-image-x-to-pos":[{"mask-x-to":F()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":F()}],"mask-image-y-to-pos":[{"mask-y-to":F()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[U,H]}],"mask-image-radial-from-pos":[{"mask-radial-from":F()}],"mask-image-radial-to-pos":[{"mask-radial-to":F()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[V]}],"mask-image-conic-from-pos":[{"mask-conic-from":F()}],"mask-image-conic-to-pos":[{"mask-conic-to":F()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,U,H]}],filter:[{filter:[``,`none`,U,H]}],blur:[{blur:ue()}],brightness:[{brightness:[V,U,H]}],contrast:[{contrast:[V,U,H]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Us,Ls]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:[``,V,U,H]}],"hue-rotate":[{"hue-rotate":[V,U,H]}],invert:[{invert:[``,V,U,H]}],saturate:[{saturate:[V,U,H]}],sepia:[{sepia:[``,V,U,H]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,U,H]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[V,U,H]}],"backdrop-contrast":[{"backdrop-contrast":[V,U,H]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,V,U,H]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[V,U,H]}],"backdrop-invert":[{"backdrop-invert":[``,V,U,H]}],"backdrop-opacity":[{"backdrop-opacity":[V,U,H]}],"backdrop-saturate":[{"backdrop-saturate":[V,U,H]}],"backdrop-sepia":[{"backdrop-sepia":[``,V,U,H]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,U,H]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[V,`initial`,U,H]}],ease:[{ease:[`linear`,`initial`,_,U,H]}],delay:[{delay:[V,U,H]}],animate:[{animate:[`none`,v,U,H]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,U,H]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:fe()}],"scale-x":[{"scale-x":fe()}],"scale-y":[{"scale-y":fe()}],"scale-z":[{"scale-z":fe()}],"scale-3d":[`scale-3d`],skew:[{skew:pe()}],"skew-x":[{"skew-x":pe()}],"skew-y":[{"skew-y":pe()}],transform:[{transform:[U,H,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:me()}],"translate-x":[{"translate-x":me()}],"translate-y":[{"translate-y":me()}],"translate-z":[{"translate-z":me()}],"translate-none":[`translate-none`],zoom:[{zoom:[bs,U,H]}],accent:[{accent:P()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:P()}],"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`,U,H]}],"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":P()}],"scrollbar-track-color":[{"scrollbar-track":P()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,U,H]}],fill:[{fill:[`none`,...P()]}],"stroke-w":[{stroke:[V,Rs,js,Ms]}],stroke:[{stroke:[`none`,...P()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function W(...e){return tc(jo(e))}function G({children:e,tone:t=`muted`}){return(0,b.jsx)(`div`,{role:t===`error`?`alert`:`status`,className:W(`rounded-lg border p-6 text-sm`,t===`error`?`border-destructive/40 text-destructive`:`text-muted-foreground`),children:e})}var nc=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,rc=jo,ic=(e,t)=>n=>{if(t?.variants==null)return rc(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=nc(t)||nc(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 rc(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)},ac=Object.defineProperty,oc=(e,t)=>ac(e,`name`,{value:t,configurable:!0});function sc(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}oc(sc,`setRef`);function cc(...e){return t=>{let n=!1,r=e.map(e=>{let r=sc(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():sc(e[t],null)}}}}oc(cc,`composeRefs`);function lc(...e){return y.useCallback(cc(...e),e)}oc(lc,`useComposedRefs`);var uc=Object.defineProperty,dc=(e,t)=>uc(e,`name`,{value:t,configurable:!0});function fc(e){let t=y.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];xc(r)&&typeof Tc==`function`&&(r=Tc(r._payload)),y.Children.forEach(r,e=>{if(yc(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;xc(n)&&typeof Tc==`function`&&(n=Tc(n._payload)),a=gc(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=y.cloneElement(a,void 0,s):!o&&y.Children.count(r)===1&&y.isValidElement(r)&&(a=r);let c=a?vc(a):void 0,l=lc(n,c);if(!a){if(r||r===0)throw Error(o?wc(e):Cc(e));return r}let u=_c(i,a.props??{});return a.type!==y.Fragment&&(u.ref=n?l:c),y.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}dc(fc,`createSlot`);var pc=fc(`Slot`),mc=Symbol.for(`radix.slottable`);function hc(e){let t=dc(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=mc,t}dc(hc,`createSlottable`);var gc=dc((e,t)=>{if(`child`in e.props){let t=e.props.child;return y.isValidElement(t)?y.cloneElement(t,void 0,e.props.children(t.props.children)):null}return y.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function _c(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(` `))}return{...e,...n}}dc(_c,`mergeProps`);function vc(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)}dc(vc,`getElementRef`);function yc(e){return y.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===mc}dc(yc,`isSlottable`);var bc=Symbol.for(`react.lazy`);function xc(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===bc&&`_payload`in e&&Sc(e._payload)}dc(xc,`isLazyComponent`);function Sc(e){return typeof e==`object`&&!!e&&`then`in e}dc(Sc,`isPromiseLike`);var Cc=dc(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),wc=dc(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Tc=y.use,Ec=c(m(),1),Dc=Object.defineProperty,Oc=(e,t)=>Dc(e,`name`,{value:t,configurable:!0}),kc=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=fc(`Primitive.${t}`),r=y.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,b.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ac(e,t){e&&Ec.flushSync(()=>e.dispatchEvent(t))}Oc(Ac,`dispatchDiscreteCustomEvent`);var jc=Object.defineProperty,Mc=(e,t)=>jc(e,`name`,{value:t,configurable:!0});function Nc(e,t){let n=y.createContext(t);n.displayName=e+`Context`;let r=Mc(e=>{let{children:t,...r}=e,i=y.useMemo(()=>r,Object.values(r));return(0,b.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=y.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Mc(i,`useContext`),[r,i]}Mc(Nc,`createContext`);function Pc(e,t=[]){let n=[];function r(t,r){let i=y.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Mc(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=y.useMemo(()=>o,Object.values(o));return(0,b.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=y.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Mc(s,`useContext`),[o,s]}Mc(r,`createContext`);let i=Mc(()=>{let t=n.map(e=>y.createContext(e));return Mc(function(n){let r=n?.[e]||t;return y.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Fc(i,...t)]}Mc(Pc,`createContextScope`);function Fc(...e){let t=e[0];if(e.length===1)return t;let n=Mc(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Mc(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Mc(Fc,`composeContextScopes`);var Ic=Object.defineProperty,Lc=(e,t)=>Ic(e,`name`,{value:t,configurable:!0}),Rc=!!(typeof window<`u`&&window.document&&window.document.createElement);function zc(e,t,{checkForDefaultPrevented:n=!0}={}){return Lc(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Lc(zc,`composeEventHandlers`);function Bc(e){if(!Rc)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Lc(Bc,`getOwnerWindow`);function Vc(e){if(!Rc)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Lc(Vc,`getOwnerDocument`);function Hc(e,t=!1){let{activeElement:n}=Vc(e);if(!n?.nodeName)return null;if(Uc(n)&&n.contentDocument)return Hc(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Vc(n).getElementById(e);if(t)return t}}return n}Lc(Hc,`getActiveElement`);function Uc(e){return e.tagName===`IFRAME`}Lc(Uc,`isFrame`);var Wc=globalThis?.document?y.useLayoutEffect:()=>{},Gc=Object.defineProperty,Kc=(e,t)=>Gc(e,`name`,{value:t,configurable:!0}),qc=y.useEffectEvent,Jc=y.useInsertionEffect;function Yc(e){if(typeof qc==`function`)return qc(e);let t=y.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Jc==`function`?Jc(()=>{t.current=e}):Wc(()=>{t.current=e}),y.useMemo(()=>((...e)=>t.current?.(...e)),[])}Kc(Yc,`useEffectEvent`);var Xc=Object.defineProperty,Zc=(e,t)=>Xc(e,`name`,{value:t,configurable:!0}),Qc=y.useInsertionEffect||Wc;function $c({prop:e,defaultProp:t,onChange:n=Zc(()=>{},`onChange`),caller:r}){let[i,a,o]=el({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,y.useCallback(t=>{if(s){let n=tl(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Zc($c,`useControllableState`);function el({defaultProp:e,onChange:t}){let[n,r]=y.useState(e),i=y.useRef(n),a=y.useRef(t);return Qc(()=>{a.current=t},[t]),y.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Zc(el,`useUncontrolledState`);function tl(e){return typeof e==`function`}Zc(tl,`isFunction`);var nl=Symbol(`RADIX:SYNC_STATE`);function rl(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Yc(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=y.useReducer((t,n)=>{if(n.type===nl)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=y.useRef(p);y.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=y.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return y.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:nl,state:i})},[i,d.state,c]),[h,f]}Zc(rl,`useControllableStateReducer`);var il=Object.defineProperty,al=(e,t)=>il(e,`name`,{value:t,configurable:!0});function ol(e,t){return y.useReducer((e,n)=>t[e][n]??e,e)}al(ol,`useStateMachine`);var sl=al(e=>{let{present:t,children:n}=e,r=cl(t),i=typeof n==`function`?n({present:r.isPresent}):y.Children.only(n),a=ul(r.ref,fl(i));return typeof n==`function`||r.isPresent?y.cloneElement(i,{ref:a}):null},`Presence`);function cl(e){let[t,n]=y.useState(),r=y.useRef(null),i=y.useRef(e),a=y.useRef(`none`),o=y.useRef(void 0),[s,c]=ol(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return y.useEffect(()=>{s===`mounted`?(a.current=o.current??dl(r.current),o.current=void 0):a.current=`none`},[s]),Wc(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=dl(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]),Wc(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=al(a=>{let o=dl(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=al(e=>{e.target===t&&(a.current=dl(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:y.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=dl(t)}else r.current=null;n(e)},[])}}al(cl,`usePresence`);function ll(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}al(ll,`setRef`);function ul(...e){let t=y.useRef(e);return t.current=e,y.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=ll(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():ll(n[e],null)}}},[])}al(ul,`useStableComposedRefs`);function dl(e){return e?.animationName||`none`}al(dl,`getAnimationName`);function fl(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)}al(fl,`getElementRef`);var pl=Object.defineProperty,ml=(e,t)=>pl(e,`name`,{value:t,configurable:!0}),hl=y.useId||(()=>void 0),gl=0;function _l(e){let[t,n]=y.useState(hl());return Wc(()=>{e||n(e=>e??String(gl++))},[e]),e||(t?`radix-${t}`:``)}ml(_l,`useId`);var vl=Object.defineProperty,yl=(e,t)=>vl(e,`name`,{value:t,configurable:!0});function bl(e){let t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>((...e)=>t.current?.(...e)),[])}yl(bl,`useCallbackRef`);var xl=Object.defineProperty,Sl=(e,t)=>xl(e,`name`,{value:t,configurable:!0}),Cl=`dismissableLayer.update`,wl=`dismissableLayer.pointerDownOutside`,Tl=`dismissableLayer.focusOutside`,El,Dl=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ol=y.forwardRef(Sl(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=y.useContext(Dl),[d,f]=y.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=y.useState({}),h=lc(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,x=d?g.indexOf(d):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,C=x>=v,w=y.useRef(!1),T=jl(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:w,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:y.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return C&&!t},[u.branches,C])}),E=Ml(e=>{if(r&&w.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),D=d?x===g.length-1:!1,O=bl(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return y.useEffect(()=>{if(D)return p.addEventListener(`keydown`,O,{capture:!0}),()=>p.removeEventListener(`keydown`,O,{capture:!0})},[p,D,O]),y.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(El=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Nl(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=El))}},[d,p,n,u]),y.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Nl())},[d,u]),y.useEffect(()=>{let e=Sl(()=>m({}),`handleUpdate`);return document.addEventListener(Cl,e),()=>document.removeEventListener(Cl,e)},[]),(0,b.jsx)(kc.div,{...l,ref:h,style:{pointerEvents:S?C?`auto`:`none`:void 0,...e.style},onFocusCapture:zc(e.onFocusCapture,E.onFocusCapture),onBlurCapture:zc(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:zc(e.onPointerDownCapture,T.onPointerDownCapture)})},`DismissableLayer`));function kl(){let e=y.useContext(Dl),[t,n]=y.useState(null);return y.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Sl(kl,`useDismissableLayerSurface`);var Al=Sl(()=>!0,`IS_TRUE`);function jl(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Al}=t,s=bl(e),c=y.useRef(!1),l=y.useRef(!1),u=y.useRef(new Map),d=y.useRef(()=>{});return y.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Sl(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Sl(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)}Sl(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Sl(p,`handleInteractionBubble`);let m=Sl(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Pl(wl,s,p,{discrete:!0})};if(Sl(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:Sl(()=>c.current=!0,`onPointerDownCapture`)}}Sl(jl,`usePointerDownOutside`);function Ml(e,t=globalThis?.document){let n=bl(e),r=y.useRef(!1);return y.useEffect(()=>{let e=Sl(e=>{e.target&&!r.current&&Pl(Tl,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Sl(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Sl(()=>r.current=!1,`onBlurCapture`)}}Sl(Ml,`useFocusOutside`);function Nl(){let e=new CustomEvent(Cl);document.dispatchEvent(e)}Sl(Nl,`dispatchUpdate`);function Pl(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?Ac(i,a):i.dispatchEvent(a)}Sl(Pl,`handleAndDispatchCustomEvent`);var Fl=Object.defineProperty,Il=(e,t)=>Fl(e,`name`,{value:t,configurable:!0}),Ll=`focusScope.autoFocusOnMount`,Rl=`focusScope.autoFocusOnUnmount`,zl={bubbles:!1,cancelable:!0},Bl=y.forwardRef(Il(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=y.useState(null),l=bl(i),u=bl(a),d=y.useRef(null),f=lc(t,c),p=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:ql(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||ql(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ql(s)};Il(e,`handleFocusIn`),Il(t,`handleFocusOut`),Il(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),y.useEffect(()=>{if(s){Jl.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Ll,zl);s.addEventListener(Ll,l),s.dispatchEvent(t),t.defaultPrevented||(Vl(Zl(Ul(s)),{select:!0}),document.activeElement===e&&ql(s))}return()=>{s.removeEventListener(Ll,l),setTimeout(()=>{let t=new CustomEvent(Rl,zl);s.addEventListener(Rl,u),s.dispatchEvent(t),t.defaultPrevented||ql(e??document.body,{select:!0}),s.removeEventListener(Rl,u),Jl.remove(p)},0)}}},[s,l,u,p]);let m=y.useCallback(e=>{if(!n&&!r||p.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]=Hl(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ql(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ql(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,b.jsx)(kc.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function Vl(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ql(r,{select:t}),document.activeElement!==n)return}Il(Vl,`focusFirst`);function Hl(e){let t=Ul(e);return[Wl(t,e),Wl(t.reverse(),e)]}Il(Hl,`getTabbableEdges`);function Ul(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Il(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}Il(Ul,`getTabbableCandidates`);function Wl(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Gl(r,{upTo:t})))return r}Il(Wl,`findVisible`);function Gl(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}Il(Gl,`isHidden`);function Kl(e){return e instanceof HTMLInputElement&&`select`in e}Il(Kl,`isSelectableInput`);function ql(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Kl(e)&&t&&e.select()}}Il(ql,`focus`);var Jl=Yl();function Yl(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Xl(e,t),e.unshift(t)},remove(t){e=Xl(e,t),e[0]?.resume()}}}Il(Yl,`createFocusScopesStack`);function Xl(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Il(Xl,`arrayRemove`);function Zl(e){return e.filter(e=>e.tagName!==`A`)}Il(Zl,`removeLinks`);var Ql=Object.defineProperty,$l=y.forwardRef(((e,t)=>Ql(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=y.useState(!1);Wc(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Ec.createPortal((0,b.jsx)(kc.div,{...r,ref:t}),o):null},`Portal`)),eu=Object.defineProperty,tu=(e,t)=>eu(e,`name`,{value:t,configurable:!0}),nu=0,ru=null;function iu(e){return au(),e.children}tu(iu,`FocusGuards`);function au(){y.useEffect(()=>{ru||={start:ou(),end:ou()};let{start:e,end:t}=ru;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),nu++,()=>{nu===1&&(ru?.start.remove(),ru?.end.remove(),ru=null),nu=Math.max(0,nu-1)}},[])}tu(au,`useFocusGuards`);function ou(){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}tu(ou,`createFocusGuard`);var su=function(){return su=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},su.apply(this,arguments)};function cu(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 lu(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 uu=`right-scroll-bar-position`,du=`width-before-scroll-bar`,fu=`with-scroll-bars-hidden`,pu=`--removed-body-scroll-bar-size`;function mu(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function hu(e,t){var n=(0,y.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 gu=typeof window<`u`?y.useLayoutEffect:y.useEffect,_u=new WeakMap;function vu(e,t){var n=hu(t||null,function(t){return e.forEach(function(e){return mu(e,t)})});return gu(function(){var t=_u.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||mu(e,null)}),i.forEach(function(e){r.has(e)||mu(e,a)})}_u.set(n,e)},[e]),n}function yu(e){return e}function bu(e,t){t===void 0&&(t=yu);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 xu(e){e===void 0&&(e={});var t=bu(null);return t.options=su({async:!0,ssr:!1},e),t}var Su=function(e){var t=e.sideCar,n=cu(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 y.createElement(r,su({},n))};Su.isSideCarExport=!0;function Cu(e,t){return e.useMedium(t),Su}var wu=xu(),Tu=function(){},Eu=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:Tu,onWheelCapture:Tu,onTouchMoveCapture:Tu}),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,_=e.as,v=_===void 0?`div`:_,b=e.gapMode,x=cu(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=vu([n,t]),w=su(su({},x),i);return y.createElement(y.Fragment,null,u&&y.createElement(S,{sideCar:wu,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?y.cloneElement(y.Children.only(s),su(su({},w),{ref:C})):y.createElement(v,su({},w,{className:c,ref:C}),s))});Eu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Eu.classNames={fullWidth:du,zeroRight:uu};var Du=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ou(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Du();return t&&e.setAttribute(`nonce`,t),e}function ku(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Au(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ju=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ou())&&(ku(t,n),Au(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Mu=function(){var e=ju();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Nu=function(){var e=Mu();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Pu={left:0,top:0,right:0,gap:0},Fu=function(e){return parseInt(e||``,10)||0},Iu=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[Fu(n),Fu(r),Fu(i)]},Lu=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Pu;var t=Iu(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])}},Ru=Nu(),zu=`data-scroll-locked`,Bu=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
11
|
+
.${fu} {
|
|
12
|
+
overflow: hidden ${r};
|
|
13
|
+
padding-right: ${s}px ${r};
|
|
14
|
+
}
|
|
15
|
+
body[${zu}] {
|
|
16
|
+
overflow: hidden ${r};
|
|
17
|
+
overscroll-behavior: contain;
|
|
18
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
19
|
+
padding-left: ${i}px;
|
|
20
|
+
padding-top: ${a}px;
|
|
21
|
+
padding-right: ${o}px;
|
|
22
|
+
margin-left:0;
|
|
23
|
+
margin-top:0;
|
|
24
|
+
margin-right: ${s}px ${r};
|
|
25
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.${uu} {
|
|
29
|
+
right: ${s}px ${r};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.${du} {
|
|
33
|
+
margin-right: ${s}px ${r};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.${uu} .${uu} {
|
|
37
|
+
right: 0 ${r};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.${du} .${du} {
|
|
41
|
+
margin-right: 0 ${r};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
body[${zu}] {
|
|
45
|
+
${pu}: ${s}px;
|
|
46
|
+
}
|
|
47
|
+
`},Vu=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Hu=function(){y.useEffect(function(){return document.body.setAttribute(zu,(Vu()+1).toString()),function(){var e=Vu()-1;e<=0?document.body.removeAttribute(zu):document.body.setAttribute(zu,e.toString())}},[])},Uu=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Hu();var a=y.useMemo(function(){return Lu(i)},[i]);return y.createElement(Ru,{styles:Bu(a,!t,i,n?``:`!important`)})},Wu=!1;if(typeof window<`u`)try{var Gu=Object.defineProperty({},"passive",{get:function(){return Wu=!0,!0}});window.addEventListener(`test`,Gu,Gu),window.removeEventListener(`test`,Gu,Gu)}catch{Wu=!1}var Ku=Wu?{passive:!1}:!1,qu=function(e){return e.tagName===`TEXTAREA`},Ju=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!qu(e)&&n[t]===`visible`)},Yu=function(e){return Ju(e,`overflowY`)},Xu=function(e){return Ju(e,`overflowX`)},Zu=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),ed(e,r)){var i=td(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Qu=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},$u=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},ed=function(e,t){return e===`v`?Yu(t):Xu(t)},td=function(e,t){return e===`v`?Qu(t):$u(t)},nd=function(e,t){return e===`h`&&t===`rtl`?-1:1},rd=function(e,t,n,r,i){var a=nd(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=td(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&ed(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},id=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ad=function(e){return[e.deltaX,e.deltaY]},od=function(e){return e&&`current`in e?e.current:e},sd=function(e,t){return e[0]===t[0]&&e[1]===t[1]},cd=function(e){return`
|
|
48
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
49
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
50
|
+
`},ld=0,ud=[];function dd(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(ld++)[0],a=y.useState(Nu)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=lu([e.lockRef.current],(e.shards||[]).map(od),!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=y.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=id(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=Zu(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Zu(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 rd(h,t,e,h===`h`?s:c,!0)},[]),c=y.useCallback(function(e){var n=e;if(ud.length&&ud[ud.length-1]===a){var r=`deltaY`in n?ad(n):id(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&sd(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(od).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=y.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:fd(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=y.useCallback(function(e){n.current=id(e),r.current=void 0},[]),d=y.useCallback(function(t){l(t.type,ad(t),t.target,s(t,e.lockRef.current))},[]),f=y.useCallback(function(t){l(t.type,id(t),t.target,s(t,e.lockRef.current))},[]);y.useEffect(function(){return ud.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Ku),document.addEventListener(`touchmove`,c,Ku),document.addEventListener(`touchstart`,u,Ku),function(){ud=ud.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Ku),document.removeEventListener(`touchmove`,c,Ku),document.removeEventListener(`touchstart`,u,Ku)}},[]);var p=e.removeScrollBar,m=e.inert;return y.createElement(y.Fragment,null,m?y.createElement(a,{styles:cd(i)}):null,p?y.createElement(Uu,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function fd(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var pd=Cu(wu,dd),md=y.forwardRef(function(e,t){return y.createElement(Eu,su({},e,{ref:t,sideCar:pd}))});md.classNames=Eu.classNames;var hd=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},gd=new WeakMap,_d=new WeakMap,vd={},yd=0,bd=function(e){return e&&(e.host||bd(e.parentNode))},xd=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=bd(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})},Sd=function(e,t,n,r){var i=xd(t,Array.isArray(e)?e:[e]);vd[n]||(vd[n]=new WeakMap);var a=vd[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=(gd.get(e)||0)+1,l=(a.get(e)||0)+1;gd.set(e,c),a.set(e,l),o.push(e),c===1&&i&&_d.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(),yd++,function(){o.forEach(function(e){var t=gd.get(e)-1,i=a.get(e)-1;gd.set(e,t),a.set(e,i),t||(_d.has(e)||e.removeAttribute(r),_d.delete(e)),i||e.removeAttribute(n)}),yd--,yd||(gd=new WeakMap,gd=new WeakMap,_d=new WeakMap,vd={})}},Cd=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||hd(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Sd(r,i,n,`aria-hidden`)):function(){return null}},wd=Object.defineProperty,Td=(e,t)=>wd(e,`name`,{value:t,configurable:!0}),Ed=`Dialog`,[Dd,Od]=Pc(Ed),[kd,Ad]=Dd(Ed),jd=Td(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=y.useRef(null),c=y.useRef(null),[l,u]=$c({prop:r,defaultProp:i??!1,onChange:a,caller:Ed}),[d,f]=y.useState(0),[p,m]=y.useState(0);return(0,b.jsx)(kd,{scope:t,triggerRef:s,contentRef:c,contentId:_l(),titleId:_l(),descriptionId:_l(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:y.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),Md=`DialogTrigger`,Nd=y.forwardRef(Td(function(e,t){let{__scopeDialog:n,...r}=e,i=Ad(Md,n),a=lc(t,i.triggerRef);return(0,b.jsx)(kc.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Zd(i.open),...r,ref:a,onClick:zc(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),Pd=`DialogPortal`,[Fd,Id]=Dd(Pd,{forceMount:void 0}),Ld=Td(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Ad(Pd,t);return(0,b.jsx)(Fd,{scope:t,forceMount:n,children:y.Children.map(r,e=>(0,b.jsx)(sl,{present:n||a.open,children:(0,b.jsx)($l,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Rd=`DialogOverlay`,zd=y.forwardRef(Td(function(e,t){let n=Id(Rd,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ad(Rd,e.__scopeDialog);return a.modal?(0,b.jsx)(sl,{present:r||a.open,children:(0,b.jsx)(Vd,{...i,ref:t})}):null},`DialogOverlay`)),Bd=fc(`DialogOverlay.RemoveScroll`),Vd=y.forwardRef(Td(function(e,t){let{__scopeDialog:n,...r}=e,i=Ad(Rd,n),a=lc(t,kl());return(0,b.jsx)(md,{as:Bd,allowPinchZoom:!0,shards:[i.contentRef],children:(0,b.jsx)(kc.div,{"data-state":Zd(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Hd=`DialogContent`,Ud=y.forwardRef(Td(function(e,t){let n=Id(Hd,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ad(Hd,e.__scopeDialog);return(0,b.jsx)(sl,{present:r||a.open,children:a.modal?(0,b.jsx)(Wd,{...i,ref:t}):(0,b.jsx)(Gd,{...i,ref:t})})},`DialogContent`)),Wd=y.forwardRef(Td(function(e,t){let n=Ad(Hd,e.__scopeDialog),r=y.useRef(null),i=lc(t,n.contentRef,r);return y.useEffect(()=>{let e=r.current;if(e)return Cd(e)},[]),(0,b.jsx)(Kd,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:zc(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:zc(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:zc(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Gd=y.forwardRef(Td(function(e,t){let n=Ad(Hd,e.__scopeDialog),r=y.useRef(!1),i=y.useRef(!1);return(0,b.jsx)(Kd,{...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`)),Kd=y.forwardRef(Td(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Ad(Hd,n);return au(),(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(Bl,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,b.jsx)(Ol,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Zd(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),qd=`DialogTitle`,Jd=y.forwardRef(Td(function(e,t){let{__scopeDialog:n,...r}=e,i=Ad(qd,n),{setTitleCount:a}=i;return Wc(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,b.jsx)(kc.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Yd=`DialogClose`,Xd=y.forwardRef(Td(function(e,t){let{__scopeDialog:n,...r}=e,i=Ad(Yd,n);return(0,b.jsx)(kc.button,{type:`button`,...r,ref:t,onClick:zc(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Zd(e){return e?`open`:`closed`}Td(Zd,`getState`);var Qd=Object.defineProperty,$d=(e,t)=>Qd(e,`name`,{value:t,configurable:!0});function ef(e){let[t,n]=y.useState(void 0);return Wc(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}$d(ef,`useSize`);var tf=Object.defineProperty,nf=(e,t)=>tf(e,`name`,{value:t,configurable:!0}),rf=`Checkbox`,[af,of]=Pc(rf),[sf,cf]=af(rf);function lf(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=$c({prop:n,defaultProp:i??!1,onChange:c,caller:rf}),[m,h]=y.useState(null),[g,_]=y.useState(null),v=y.useRef(!1),[x,S]=y.useReducer(e=>e+1,0),C=!m||!!o||!!m.closest(`form`),w={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,userInteractionCount:x,onUserInteraction:S,required:l,defaultChecked:!vf(i)&&i,isFormControl:C,bubbleInput:g,setBubbleInput:_};return(0,b.jsx)(sf,{scope:t,...w,children:_f(d)?d(w):r})}nf(lf,`CheckboxProvider`);var uf=`CheckboxTrigger`,df=y.forwardRef(nf(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:m,bubbleInput:h}=cf(uf,e),g=lc(i,u),_=y.useRef(c);return y.useEffect(()=>{let e=a?.form;if(e){let t=nf(()=>d(_.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,b.jsx)(kc.button,{type:`button`,role:`checkbox`,"aria-checked":vf(c)?`mixed`:c,"aria-required":l,"data-state":yf(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:g,onKeyDown:zc(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:zc(n,e=>{p(),d(e=>vf(e)?!0:!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),ff=y.forwardRef(nf(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,b.jsx)(lf,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(df,{...d,ref:t,__scopeCheckbox:n}),e&&(0,b.jsx)(gf,{__scopeCheckbox:n})]})})},`Checkbox`)),pf=`CheckboxIndicator`,mf=y.forwardRef(nf(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=cf(pf,n);return(0,b.jsx)(sl,{present:r||vf(a.checked)||a.checked===!0,children:(0,b.jsx)(kc.span,{"data-state":yf(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),hf=`CheckboxBubbleInput`,gf=y.forwardRef(nf(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:m,setBubbleInput:h}=cf(hf,e),g=lc(r,h),_=ef(i),v=y.useRef(!1),x=y.useRef(s),S=y.useRef(o);y.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==S.current;S.current=o;let i=x.current!==s;x.current=s;let c=!(r&&a.current);if(i&&n){v.current=!r;let t=new Event(`click`,{bubbles:c});e.indeterminate=vf(s),n.call(e,!vf(s)&&s),e.dispatchEvent(t),v.current=!1}},[m,s,a,o]);let C=y.useRef(!vf(s)&&s);return(0,b.jsx)(kc.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??C.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:g,onClick:zc(t,e=>{v.current&&e.stopPropagation()}),style:{...n.style,..._,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function _f(e){return typeof e==`function`}nf(_f,`isFunction`);function vf(e){return e===`indeterminate`}nf(vf,`isIndeterminate`);function yf(e){return vf(e)?`indeterminate`:e?`checked`:`unchecked`}nf(yf,`getState`);var bf=[`top`,`right`,`bottom`,`left`],xf=Math.min,Sf=Math.max,Cf=Math.round,wf=Math.floor,Tf=e=>({x:e,y:e}),Ef={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Df(e,t,n){return Sf(e,xf(t,n))}function Of(e,t){return typeof e==`function`?e(t):e}function kf(e){return e.split(`-`)[0]}function Af(e){return e.split(`-`)[1]}function jf(e){return e===`x`?`y`:`x`}function Mf(e){return e===`y`?`height`:`width`}function Nf(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Pf(e){return jf(Nf(e))}function Ff(e,t,n){n===void 0&&(n=!1);let r=Af(e),i=Pf(e),a=Mf(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Wf(o)),[o,Wf(o)]}function If(e){let t=Wf(e);return[Lf(e),t,Lf(t)]}function Lf(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Rf=[`left`,`right`],zf=[`right`,`left`],Bf=[`top`,`bottom`],Vf=[`bottom`,`top`];function Hf(e,t,n){switch(e){case`top`:case`bottom`:return n?t?zf:Rf:t?Rf:zf;case`left`:case`right`:return t?Bf:Vf;default:return[]}}function Uf(e,t,n,r){let i=Af(e),a=Hf(kf(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Lf)))),a}function Wf(e){let t=kf(e);return Ef[t]+e.slice(t.length)}function Gf(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Kf(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Gf(e)}function qf(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 K(e,t,n){let{reference:r,floating:i}=e,a=Nf(t),o=Pf(t),s=Mf(o),c=kf(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=Af(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Jf(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}=Of(t,e),p=Kf(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=qf(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=qf(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 Yf=50,Xf=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Jf},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=K(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<Yf&&(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}=K(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Zf=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}=Of(e,t)||{};if(l==null)return{};let d=Kf(u),f={x:n,y:r},p=Pf(i),m=Mf(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=xf(d[_],T),D=xf(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Df(E,k,O),j=!c.arrow&&Af(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Qf=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}=Of(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=kf(r),_=Nf(o),v=kf(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Wf(o)]:If(o)),x=p!==`none`;!d&&x&&b.push(...Uf(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=Ff(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`||_===Nf(t)||T.every(e=>Nf(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=Nf(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function $f(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ep(e){return bf.some(t=>e[t]>=0)}var tp=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Of(e,t);switch(i){case`referenceHidden`:{let e=$f(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ep(e)}}}case`escaped`:{let e=$f(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ep(e)}}}default:return{}}}}},np=new Set([`left`,`top`]);async function rp(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=kf(n),s=Af(n),c=Nf(n)===`y`,l=np.has(o)?-1:1,u=a&&c?-1:1,d=Of(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 ip=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 rp(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}}}}},ap=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}=Of(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Nf(i),p=jf(f),m=u[p],h=u[f],g=(e,t)=>Df(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}}}}}},op=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}=Of(e,t),u={x:n,y:r},d=Nf(i),f=jf(d),p=u[f],m=u[d],h=Of(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=np.has(kf(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}}}},sp=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}=Of(e,t),c=await i.detectOverflow(t,s),l=kf(n),u=Af(n),d=Nf(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=xf(p-c[m],g),y=xf(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*Sf(c.left,c.right):S=p-2*Sf(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 cp(){return typeof window<`u`}function lp(e){return fp(e)?(e.nodeName||``).toLowerCase():`#document`}function up(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function dp(e){return((fp(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function fp(e){return cp()?e instanceof Node||e instanceof up(e).Node:!1}function pp(e){return cp()?e instanceof Element||e instanceof up(e).Element:!1}function mp(e){return cp()?e instanceof HTMLElement||e instanceof up(e).HTMLElement:!1}function hp(e){return!cp()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof up(e).ShadowRoot}function gp(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Dp(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function _p(e){return/^(table|td|th)$/.test(lp(e))}function vp(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var yp=/transform|translate|scale|rotate|perspective|filter/,bp=/paint|layout|strict|content/,xp=e=>!!e&&e!==`none`,Sp;function Cp(e){let t=pp(e)?Dp(e):e;return xp(t.transform)||xp(t.translate)||xp(t.scale)||xp(t.rotate)||xp(t.perspective)||!Tp()&&(xp(t.backdropFilter)||xp(t.filter))||yp.test(t.willChange||``)||bp.test(t.contain||``)}function wp(e){let t=kp(e);for(;mp(t)&&!Ep(t);){if(Cp(t))return t;if(vp(t))return null;t=kp(t)}return null}function Tp(){return Sp??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Sp}function Ep(e){return/^(html|body|#document)$/.test(lp(e))}function Dp(e){return up(e).getComputedStyle(e)}function Op(e){return pp(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kp(e){if(lp(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||hp(e)&&e.host||dp(e);return hp(t)?t.host:t}function Ap(e){let t=kp(e);return Ep(t)?(e.ownerDocument||e).body:mp(t)&&gp(t)?t:Ap(t)}function jp(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ap(e),i=r===e.ownerDocument?.body,a=up(r);if(i){let e=Mp(a);return t.concat(a,a.visualViewport||[],gp(r)?r:[],e&&n?jp(e):[])}return t.concat(r,jp(r,[],n))}function Mp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Np(e){let t=Dp(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=mp(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Cf(n)!==a||Cf(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Pp(e){return pp(e)?e:e.contextElement}function Fp(e){let t=Pp(e);if(!mp(t))return Tf(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Np(t),o=(a?Cf(n.width):n.width)/r,s=(a?Cf(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ip=Tf(0);function Lp(e){let t=up(e);return!Tp()||!t.visualViewport?Ip:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Rp(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===up(e)}function zp(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Pp(e),o=Tf(1);t&&(r?pp(r)&&(o=Fp(r)):o=Fp(e));let s=Rp(a,n,r)?Lp(a):Tf(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=up(a),t=pp(r)?up(r):r,n=e,i=Mp(n);for(;i&&t!==n;){let e=Fp(i),t=i.getBoundingClientRect(),r=Dp(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=up(i),i=Mp(n)}}return qf({width:u,height:d,x:c,y:l})}function Bp(e,t){let n=Op(e).scrollLeft;return t?t.left+n:zp(dp(e)).left+n}function Vp(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Bp(e,n),y:n.top+t.scrollTop}}function Hp(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=dp(r),s=t?vp(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Tf(1),u=Tf(0),d=mp(r);if((d||!a)&&((lp(r)!==`body`||gp(o))&&(c=Op(r)),d)){let e=zp(r);l=Fp(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Vp(o,c):Tf(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 Up(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Wp(e){let t=Op(e),n=e.ownerDocument.body,r=Sf(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Sf(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Bp(e),o=-t.scrollTop;return Dp(n).direction===`rtl`&&(a+=Sf(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Gp=25;function Kp(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=up(e),a=dp(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Tp()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Bp(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<=Gp&&(s-=o)}return{width:s,height:c,x:l,y:u}}function qp(e,t){let n=zp(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Fp(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Jp(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Kp(e,n,t);else if(t===`document`)r=Wp(dp(e));else if(pp(t))r=qp(t,n);else{let n=Lp(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return qf(r)}function Yp(e,t){let n=t.get(e);if(n)return n;let r=jp(e,[],!1).filter(e=>pp(e)&&lp(e)!==`body`),i=null,a=Dp(e).position===`fixed`,o=a?kp(e):e;for(;pp(o)&&!Ep(o);){let e=Dp(o),t=Cp(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=kp(o)}return t.set(e,r),r}function Xp(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?vp(t)?[]:Yp(t,this._c):[].concat(n),r],o=Jp(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=Jp(t,a[e],i);s=Sf(n.top,s),c=xf(n.right,c),l=xf(n.bottom,l),u=Sf(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Zp(e){let{width:t,height:n}=Np(e);return{width:t,height:n}}function Qp(e,t,n){let r=mp(t),i=dp(t),a=n===`fixed`,o=zp(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Tf(0);if((r||!a)&&((lp(t)!==`body`||gp(i))&&(s=Op(t)),r)){let e=zp(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Bp(i));let l=i&&!r&&!a?Vp(i,s):Tf(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 $p(e){return Dp(e).position===`static`}function em(e,t){if(!mp(e)||Dp(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return dp(e)===n&&(n=n.ownerDocument.body),n}function tm(e,t){let n=up(e);if(vp(e))return n;if(!mp(e)){let t=kp(e);for(;t&&!Ep(t);){if(pp(t)&&!$p(t))return t;t=kp(t)}return n}let r=em(e,t);for(;r&&_p(r)&&$p(r);)r=em(r,t);return r&&Ep(r)&&$p(r)&&!Cp(r)?n:r||wp(e)||n}var nm=async function(e){let t=this.getOffsetParent||tm,n=this.getDimensions,r=await n(e.floating);return{reference:Qp(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function rm(e){return Dp(e).direction===`rtl`}var im={convertOffsetParentRelativeRectToViewportRelativeRect:Hp,getDocumentElement:dp,getClippingRect:Xp,getOffsetParent:tm,getElementRects:nm,getClientRects:Up,getDimensions:Zp,getScale:Fp,isElement:pp,isRTL:rm};function am(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function om(e,t,n){let r=null,i,a=dp(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=wf(d),h=wf(a.clientWidth-(u+f)),g=wf(a.clientHeight-(d+p)),_=wf(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Sf(0,xf(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!am(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=up(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function sm(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=Pp(e),u=i||a?[...l?jp(l):[],...t?jp(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?om(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?zp(e):null;c&&g();function g(){let t=zp(e);h&&!am(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 cm=ip,lm=ap,um=Qf,dm=sp,fm=tp,pm=Zf,mm=op,hm=(e,t,n)=>{let r=new Map,i=n??{},a={...im,...i.platform,_c:r};return Xf(e,t,{...i,platform:a})},gm=typeof document<`u`?y.useLayoutEffect:function(){};function _m(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(!_m(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)&&!_m(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function vm(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ym(e,t){let n=vm(e);return Math.round(t*n)/n}function bm(e){let t=y.useRef(e);return gm(()=>{t.current=e}),t}function xm(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]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=y.useState(r);_m(f,r)||p(r);let[m,h]=y.useState(null),[g,_]=y.useState(null),v=y.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=y.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=y.useRef(null),w=y.useRef(null),T=y.useRef(u),E=c!=null,D=bm(c),O=bm(i),k=bm(l),A=y.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),hm(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!_m(T.current,t)&&(T.current=t,Ec.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);gm(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=y.useRef(!1);gm(()=>(j.current=!0,()=>{j.current=!1}),[]),gm(()=>{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=y.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:b}),[v,b]),N=y.useMemo(()=>({reference:x,floating:S}),[x,S]),ee=y.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=ym(N.floating,u.x),r=ym(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...vm(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return y.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:ee}),[u,A,M,N,ee])}var Sm=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:pm({element:r.current,padding:i}).fn(n):r?pm({element:r,padding:i}).fn(n):{}}}},Cm=(e,t)=>{let n=cm(e);return{name:n.name,fn:n.fn,options:[e,t]}},wm=(e,t)=>{let n=lm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tm=(e,t)=>({fn:mm(e).fn,options:[e,t]}),Em=(e,t)=>{let n=um(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dm=(e,t)=>{let n=dm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Om=(e,t)=>{let n=fm(e);return{name:n.name,fn:n.fn,options:[e,t]}},km=(e,t)=>{let n=Sm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Am=Object.defineProperty,jm=(e,t)=>Am(e,`name`,{value:t,configurable:!0}),Mm=`Popper`,[Nm,Pm]=Pc(Mm),[Fm,Im]=Nm(Mm),Lm=jm(e=>{let{__scopePopper:t,children:n}=e,[r,i]=y.useState(null),[a,o]=y.useState(void 0);return(0,b.jsx)(Fm,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Rm=`PopperAnchor`,zm=y.forwardRef(jm(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Im(Rm,n),o=y.useRef(null),s=a.onAnchorChange,c=lc(t,y.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=y.useRef(null);y.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&Km(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,b.jsx)(kc.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),Bm=`PopperContent`,[Vm,Hm]=Nm(Bm),Um=y.forwardRef(jm(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Im(Bm,n),[_,v]=y.useState(null),x=lc(t,v),[S,C]=y.useState(null),w=ef(S),T=w?.width??0,E=w?.height??0,D=r+(a===`center`?``:`-`+a),O=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},k=Array.isArray(l)?l:[l],A=k.length>0,j={padding:O,boundary:k.filter(Wm),altBoundary:A},{refs:M,floatingStyles:N,placement:ee,isPositioned:te,middlewareData:P}=xm({strategy:`fixed`,placement:D,whileElementsMounted:jm((...e)=>sm(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Cm({mainAxis:i+E,alignmentAxis:o}),c&&wm({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Tm():void 0,...j}),c&&Em({...j}),Dm({...j,apply:jm(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),S&&km({element:S,padding:s}),Gm({arrowWidth:T,arrowHeight:E}),f&&Om({strategy:`referenceHidden`,...j,boundary:A?j.boundary:void 0})]}),ne=g.setPlacementState;Wc(()=>(ne(ee),()=>{ne(void 0)}),[ee,ne]);let[re,ie]=Km(ee),ae=bl(m);Wc(()=>{te&&ae?.()},[te,ae]);let oe=P.arrow?.x,se=P.arrow?.y,ce=P.arrow?.centerOffset!==0,[le,F]=y.useState();return Wc(()=>{_&&F(window.getComputedStyle(_).zIndex)},[_]),(0,b.jsx)(`div`,{ref:M.setFloating,"data-radix-popper-content-wrapper":``,style:{...N,transform:te?N.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(` `),...P.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,b.jsx)(Vm,{scope:n,placedSide:re,placedAlign:ie,onArrowChange:C,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:(0,b.jsx)(kc.div,{"data-side":re,"data-align":ie,...h,ref:x,style:{...h.style,animation:te?h.style?.animation:`none`}})})})},`PopperContent`));function Wm(e){return e!==null}jm(Wm,`isNotNull`);var Gm=jm(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Km(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Km(e){let[t,n=`center`]=e.split(`-`);return[t,n]}jm(Km,`getSideAndAlignFromPlacement`);var qm=Lm,Jm=zm,Ym=Um,Xm=Object.defineProperty,Zm=y.forwardRef(((e,t)=>Xm(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,b.jsx)(kc.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),Qm=Object.defineProperty,$m=(e,t)=>Qm(e,`name`,{value:t,configurable:!0}),eh=`Popover`,[th,nh]=Pc(eh,[Pm]),rh=Pm(),[ih,ah]=th(eh),oh=$m(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=rh(t),c=y.useRef(null),[l,u]=y.useState(!1),[d,f]=$c({prop:r,defaultProp:i??!1,onChange:a,caller:eh});return(0,b.jsx)(qm,{...s,children:(0,b.jsx)(ih,{scope:t,contentId:_l(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:y.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:y.useCallback(()=>u(!0),[]),onCustomAnchorRemove:y.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),sh=`PopoverTrigger`,ch=y.forwardRef($m(function(e,t){let{__scopePopover:n,...r}=e,i=ah(sh,n),a=rh(n),o=lc(t,i.triggerRef),s=(0,b.jsx)(kc.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":xh(i.open),...r,ref:o,onClick:zc(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,b.jsx)(Jm,{asChild:!0,...a,children:s})},`PopoverTrigger`)),lh=`PopoverPortal`,[uh,dh]=th(lh,{forceMount:void 0}),fh=$m(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=ah(lh,t);return(0,b.jsx)(uh,{scope:t,forceMount:n,children:(0,b.jsx)(sl,{present:n||a.open,children:(0,b.jsx)($l,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),ph=`PopoverContent`,mh=y.forwardRef($m(function(e,t){let n=dh(ph,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=ah(ph,e.__scopePopover);return(0,b.jsx)(sl,{present:r||a.open,children:a.modal?(0,b.jsx)(gh,{...i,ref:t}):(0,b.jsx)(_h,{...i,ref:t})})},`PopoverContent`)),hh=fc(`PopoverContent.RemoveScroll`),gh=y.forwardRef($m(function(e,t){let n=ah(ph,e.__scopePopover),r=y.useRef(null),i=lc(t,r),a=y.useRef(!1);return y.useEffect(()=>{let e=r.current;if(e)return Cd(e)},[]),(0,b.jsx)(md,{as:hh,allowPinchZoom:!0,children:(0,b.jsx)(vh,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:zc(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:zc(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:zc(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),_h=y.forwardRef($m(function(e,t){let n=ah(ph,e.__scopePopover),r=y.useRef(!1),i=y.useRef(!1);return(0,b.jsx)(vh,{...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()}})},`PopoverContentNonModal`)),vh=y.forwardRef($m(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=ah(ph,n),p=rh(n);return au(),(0,b.jsx)(Bl,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,b.jsx)(Ol,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,b.jsx)(Ym,{"data-state":xh(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`)),yh=`PopoverClose`,bh=y.forwardRef($m(function(e,t){let{__scopePopover:n,...r}=e,i=ah(yh,n);return(0,b.jsx)(kc.button,{type:`button`,...r,ref:t,onClick:zc(e.onClick,()=>i.onOpenChange(!1))})},`PopoverClose`));function xh(e){return e?`open`:`closed`}$m(xh,`getState`);var Sh=oh,Ch=ch,wh=fh,Th=mh,Eh=bh,Dh=ic(`group/button inline-flex shrink-0 items-center justify-center rounded-control border border-transparent bg-clip-padding text-[13px] 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 cursor-pointer`,{variants:{variant:{default:`border-primary bg-primary text-primary-foreground hover:opacity-92`,outline:`border-input bg-card hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`border-input bg-card text-bad hover:bg-muted 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-9 gap-1.5 px-3.5 has-data-[icon=inline-end]:pe-3 has-data-[icon=inline-start]:ps-3`,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]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1.5 px-2.5 text-[12.5px] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2`,icon:`size-9`,"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-8 in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function q({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?pc:`button`;return(0,b.jsx)(a,{"data-slot":`button`,"data-variant":t,"data-size":n,className:W(Dh({variant:t,size:n,className:e})),...i})}function Oh({className:e,type:t,...n}){return(0,b.jsx)(`input`,{type:t,"data-slot":`input`,className:W(`h-9 w-full min-w-0 rounded-control border border-input bg-card px-3 py-1 text-[13px] transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function kh({className:e,...t}){return(0,b.jsx)(Zm,{"data-slot":`label`,className:W(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var Ah=`۰۱۲۳۴۵۶۷۸۹`,jh=`٠١٢٣٤٥٦٧٨٩`;function Mh(e){return e.replace(/[۰-۹٠-٩]/g,e=>String(Math.max(Ah.indexOf(e),jh.indexOf(e))))}function Nh(e){return Mh(e).replace(/٫/g,`.`).replace(/٬/g,`,`)}function Ph(e){return e.replace(/[0-9]/g,e=>Ah[Number(e)])}function Fh(e){return Ph(e).replace(/\./g,`٫`).replace(/,/g,`٬`)}var Ih=`nma.calendar`,Lh=`nma.digits`;function Rh(e){try{return localStorage.getItem(e)}catch{return null}}function zh(e){let t=Rh(Ih),n=Rh(Lh);return{calendar:t===`gregorian`||t===`persian`?t:e.split(`-`)[0]===`fa`?`persian`:`gregorian`,digits:n===`latn`||n===`arabext`?n:e.split(`-`)[0]===`fa`?`arabext`:`latn`}}function Bh(e){try{e.calendar&&localStorage.setItem(Ih,e.calendar),e.digits&&localStorage.setItem(Lh,e.digits)}catch{}}var Vh={"common.loading":`Loading…`,"common.yes":`Yes`,"common.no":`No`,"common.empty":`—`,"common.all":`All`,"common.cancel":`Cancel`,"common.pageNotFound":`Page not found.`,"common.requestFailed":`Request failed ({status})`,"common.reference":`{message} (reference: {id})`,"shell.adminPanel":`Admin panel`,"palette.move":`Move`,"palette.openItem":`Open`,"palette.close":`Close`,"shell.menu":`Menu`,"shell.closeMenu":`Close menu`,"shell.resources":`Resources`,"shell.filterResources":`Filter resources`,"shell.pinned":`Pinned`,"shell.recent":`Recent`,"shell.pin":`Pin {name}`,"shell.unpin":`Unpin {name}`,"shell.collapseGroup":`Collapse {name}`,"shell.expandGroup":`Expand {name}`,"shell.collapseSidebar":`Collapse sidebar`,"shell.expandSidebar":`Expand sidebar`,"shell.breadcrumbs":`Breadcrumbs`,"shell.home":`Home`,"shell.dashboard":`Dashboard`,"shell.noMatches":`No resources match.`,"shell.theme":`Theme`,"shell.themeLight":`Light`,"shell.themeDark":`Dark`,"shell.themeSystem":`System`,"shell.language":`Language`,"shell.noResources":`No admin resources are registered yet. Decorate a provider with @AdminResource.`,"shell.records":`{count} records`,"shell.aboutRecords":`about {count} records`,"list.select":`Select`,"list.done":`Done`,"list.loadMore":`Load more`,"list.showing":`{shown} shown`,"list.showingOf":`{shown} of {total}`,"list.new":`New`,"list.trash":`Trash`,"list.trashNote":`Records in the trash. Restore one to edit it again.`,"list.restore":`Restore`,"list.restoreRecord":`Restore {name}`,"list.actions":`Actions`,"list.noMatches":`No records match.`,"list.noRecords":`No records yet.`,"list.total":`{count} total`,"list.about":`about {count}`,"list.page":`Page {page}`,"list.pageOf":`Page {page} of {pages}`,"list.range":`Showing {from} to {to} of {total}`,"list.rowsPerPage":`Rows per page`,"list.toggleRow":`{column}: {name}`,"list.previousPage":`Previous page`,"list.nextPage":`Next page`,"list.columns":`Columns`,"list.density":`Density`,"list.comfortable":`Comfortable`,"list.compact":`Compact`,"list.moveUp":`Move {name} up`,"list.moveDown":`Move {name} down`,"list.resetColumns":`Reset columns`,"list.resize":`Resize {name}`,"list.retry":`Try again`,"list.loadFailed":`The list could not be loaded.`,"list.selectPage":`Select all on this page`,"list.selectRow":`Select {name}`,"print.open":`Print {name}`,"list.export":`Export to Excel`,"list.exporting":`Exporting…`,"list.exportTruncated":`Only the first {count} rows were exported.`,"list.exportDone":`{file} downloaded.`,"list.selected":`{count} selected`,"list.deleteSelected":`Delete selected`,"list.confirmDeleteSelected":`Delete {count}`,"list.clearSelection":`Clear selection`,"list.bulkDeleted":`{count} deleted`,"list.bulkFailed":`{count} failed`,"list.quickView":`Quick view: {name}`,"list.edit":`Edit`,"list.close":`Close`,"list.editCell":`Edit {name}: {value}`,"action.running":`Running…`,"action.confirm":`Run “{action}”?`,"action.confirmRecord":`Run “{action}” on {name}?`,"action.confirmSelected":`Run “{action}” on {count} records?`,"action.eachNote":`Each of the {count} records is handled on its own: one that fails does not stop the others.`,"action.atomicNote":`All or nothing: if one of the {count} records fails, none is changed.`,"action.done":`“{action}” done.`,"action.doneGone":`“{action}” done. The record is no longer in your view.`,"action.bulkDone":`{action}: {count} done`,"action.saveFirst":`Save or discard your changes first.`,"action.more":`More actions`,"toast.region":`Notifications`,"toast.dismiss":`Dismiss`,"settings.viewOnly":`You can view these settings but not change them.`,"settings.discard":`Discard changes`,"secret.set":`Set`,"secret.notSet":`Not set`,"secret.replace":`Replace`,"secret.replaceName":`Replace {name}`,"secret.clear":`Clear`,"secret.clearName":`Clear {name}`,"secret.keep":`Keep the current value`,"secret.willClear":`Will be cleared when you save.`,"secret.undo":`Undo`,"filters.search":`Search`,"filters.searchIn":`Search {fields}`,"filters.filtersAndSort":`Filters and sort`,"filters.showResults":`Show results`,"filters.sortBy":`Sort by`,"filters.ascending":`{name}, ascending`,"filters.descending":`{name}, descending`,"filters.filters":`Filters`,"filters.clear":`Clear filters`,"filters.from":`From`,"filters.to":`To`,"filters.contains":`{field} contains`,"filters.empty":`empty`,"filters.notEmpty":`not empty`,"filters.not":`not `,"filters.removeChip":`Remove filter {label}`,"filters.active":`Active filters`,"filters.any":`Any`,"filters.onlyEmpty":`Empty`,"filters.hideEmpty":`Not empty`,"filters.emptyValues":`{field}: empty values`,"filters.selected":`{count} selected`,"date.placeholder":`yyyy/mm/dd`,"date.openCalendar":`Choose {name} from a calendar`,"date.calendar":`{name} calendar`,"date.previous":`Previous`,"date.next":`Next`,"date.chooseMonth":`Choose a month`,"date.chooseYear":`Choose a year`,"date.today":`Today`,"date.clear":`Clear`,"date.time":`{name} time`,"auth.title":`Sign in`,"auth.username":`Username`,"auth.password":`Password`,"auth.signIn":`Sign in`,"auth.signingIn":`Signing in…`,"auth.required":`Enter your username and password.`,"auth.failed":`Signing in failed. Try again.`,"auth.userMenu":`Account menu for {name}`,"auth.account":`Account`,"auth.signOut":`Sign out`,"auth.changePassword":`Change password`,"auth.currentPassword":`Current password`,"auth.newPassword":`New password`,"auth.confirmPassword":`New password again`,"auth.mismatch":`does not match the new password`,"auth.passwordChanged":`Password changed. Your other sessions were signed out.`,"auth.sessions":`Signed-in devices`,"auth.signOutOthers":`Sign out everywhere else`,"auth.thisDevice":`This device`,"auth.unknownDevice":`Unknown device`,"auth.lastSeen":`Last active {when}`,"auth.revoke":`Sign out`,"auth.revokeSession":`Sign out {name}`,"rbac.administration":`Administration`,"rbac.users":`Users`,"rbac.groups":`Groups`,"rbac.roles":`Roles`,"rbac.user":`User`,"rbac.group":`Group`,"rbac.role":`Role`,"rbac.newUser":`New user`,"rbac.newGroup":`New group`,"rbac.newRole":`New role`,"rbac.createUser":`Create user`,"rbac.export":`Export`,"rbac.import":`Import`,"rbac.importFile":`Roles file to import`,"rbac.imported":`{count} roles imported.`,"rbac.notJson":`That file is not JSON.`,"rbac.permissionCount":`{count} permissions`,"rbac.system":`System`,"rbac.systemNote":`This role is defined in code: change it there.`,"rbac.name":`Name`,"rbac.labelIn":`Label ({language})`,"rbac.matrix":`Permissions`,"rbac.resource":`Resource`,"rbac.op.view":`View`,"rbac.op.create":`Create`,"rbac.op.update":`Change`,"rbac.op.delete":`Delete`,"rbac.op.purge":`Purge`,"rbac.grant":`{operation} {resource}`,"rbac.details":`Fields and scopes of {resource}`,"rbac.fields":`Fields`,"rbac.restricted":`restricted`,"rbac.fieldRule":`Access to {field}`,"rbac.rule.default":`As the permissions allow`,"rbac.rule.defaultHidden":`Hidden (restricted)`,"rbac.rule.hidden":`Hidden`,"rbac.rule.readonly":`Read-only`,"rbac.rule.edit":`Editable`,"rbac.scopes":`Rows`,"rbac.allRows":`all rows`,"rbac.custom":`Other permissions`,"rbac.global":`General permissions`,"rbac.actions":`Actions`,"rbac.actionNote":`Actions on records also need Change.`,"rbac.pages":`Settings pages`,"rbac.page":`Page`,"rbac.viewImplied":`Whoever may change a page may view it.`,"rbac.noGroups":`No groups yet.`,"rbac.groupSummary":`{roles} roles · {members} members`,"rbac.members":`Members`,"rbac.noMembers":`No members yet.`,"rbac.addMember":`Add a member`,"rbac.searchUsers":`Search users`,"rbac.searchResults":`Matching users`,"rbac.usersFromMemberships":`Your sign-in adapter cannot list users: these are the users that have roles or groups here.`,"rbac.superuser":`Superuser`,"rbac.superuserNote":`Only superusers can change a superuser.`,"rbac.inactive":`Inactive`,"rbac.active":`Active`,"rbac.displayName":`Display name`,"rbac.email":`Email`,"rbac.saved":`Saved.`,"rbac.setPassword":`Set password`,"rbac.setPasswordNote":`The user is signed out everywhere.`,"rbac.passwordSet":`Password set; the user was signed out everywhere.`,"auth.otpTitle":`Two-step verification`,"auth.otp":`Code`,"auth.otpHelp":`Enter the 6-digit code from your authenticator app, or one of your recovery codes.`,"auth.verify":`Verify`,"auth.otpRequired":`Enter the code.`,"auth.startOver":`Use another account`,"twoFactor.title":`Two-factor sign-in`,"twoFactor.on":`On`,"twoFactor.off":`Off`,"twoFactor.intro":`Ask for a code from an authenticator app after the password.`,"twoFactor.setUp":`Set up`,"twoFactor.scan":`Scan the code with your authenticator app, or type the key into it. Then enter the code the app shows.`,"twoFactor.qr":`QR code for your authenticator app`,"twoFactor.key":`Key`,"twoFactor.code":`Code from the app`,"twoFactor.turnOn":`Turn on`,"twoFactor.recoveryTitle":`Recovery codes`,"twoFactor.recoveryIntro":`Keep these somewhere safe. Each one signs you in once if you lose your device. They are not shown again.`,"twoFactor.copy":`Copy codes`,"twoFactor.copied":`Copied`,"twoFactor.done":`I saved them`,"twoFactor.left":`{count} unused recovery codes.`,"twoFactor.newCodes":`New recovery codes`,"twoFactor.turnOff":`Turn off`,"twoFactor.password":`Your password`,"twoFactor.enabledNote":`Two-factor sign-in is on. Your other sessions were signed out.`,"twoFactor.disabledNote":`Two-factor sign-in is off.`,"viewAs.start":`View as this user`,"viewAs.banner":`Viewing as {name}. Read-only.`,"viewAs.stop":`Stop viewing`,"rbac.twoFactor":`2FA`,"rbac.resetTwoFactor":`Reset two-factor sign-in`,"rbac.resetTwoFactorNote":`Turns off their second factor (a lost phone) and signs them out everywhere.`,"rbac.twoFactorReset":`Two-factor sign-in is off for this user.`,"debugger.title":`Permission debugger`,"debugger.intro":`Why a user can or cannot see and change things.`,"debugger.user":`User`,"debugger.resource":`Resource`,"debugger.record":`Record id (optional)`,"debugger.explain":`Explain`,"debugger.pick":`Choose a user and a resource.`,"debugger.roles":`Roles`,"debugger.noRoles":`No roles: nothing is allowed.`,"debugger.superuser":`A superuser may do everything.`,"debugger.source.direct":`assigned directly`,"debugger.source.group":`through group {group}`,"debugger.source.resolveRoles":`from resolveRoles`,"debugger.source.adapter":`from the sign-in adapter`,"debugger.unknownRole":`not a role, grants nothing`,"debugger.operations":`Operations`,"debugger.allowed":`Allowed`,"debugger.denied":`Denied`,"debugger.noGrant":`No role grants it`,"debugger.viaUpdate":`{pattern} in {role} (changing implies viewing)`,"debugger.grant":`{pattern} in {role}`,"debugger.fields":`Fields`,"debugger.field":`Field`,"debugger.result":`Result`,"debugger.byRole":`Per role`,"debugger.forced":`Always shown: keys and the version`,"debugger.scopes":`Rows`,"debugger.allRows":`All rows`,"debugger.noRows":`No rows`,"debugger.someRows":`Rows of {scopes}`,"debugger.globalScopes":`Also limited by {scopes}`,"debugger.recordTitle":`Record {id}`,"debugger.reason.permission":`no permission`,"debugger.reason.scope":`outside their rows`,"debugger.reason.rule":`a rule on this record says no`,"debugger.reason.missing":`no such record`,"debugger.actions":`Actions`,"debugger.needsUpdate":`actions on records also need Change`,"debugger.noRecordActions":`none on this record`,"debugger.pages":`Settings pages`,"audit.title":`Audit log`,"audit.history":`History`,"audit.details":`Details`,"audit.recordTabs":`Record and its history`,"audit.entries":`Recorded changes`,"audit.notAllowed":`You may not read the audit log`,"audit.off":`The audit log is not enabled in this admin`,"audit.empty":`Nothing has been recorded yet.`,"audit.noMatches":`No entries match.`,"audit.noActor":`Nobody signed in`,"audit.viewAsBy":`while user {id} was viewing as them`,"audit.filterByActor":`Show only what {name} did`,"audit.changedFields":`Changed fields`,"audit.before":`Before`,"audit.after":`After`,"audit.becomes":`became`,"audit.field.changed":`changed`,"audit.field.hidden":`hidden`,"audit.field.dropped":`too large to keep`,"audit.field.truncated":`cut short`,"audit.showMore":`Show more`,"audit.showLess":`Show less`,"audit.input":`Input`,"audit.inputTruncated":`The input was too large to keep.`,"audit.restrictedRecord":`A record you cannot see: its details are withheld.`,"audit.restrictedChanges":`You may not see what was changed.`,"audit.suppressedNote":`They came in the same minute and were not recorded one by one.`,"audit.limitedNote":`Further failures in this minute are only counted.`,"audit.actionDeleted":`The action deleted the record.`,"audit.filter.actor":`Actor (user id)`,"audit.filter.event":`Event`,"audit.filter.eventHint":`order.updated or auth.*`,"audit.filter.resource":`Resource`,"audit.filter.record":`Record id`,"audit.filter.recordHint":`Choose a resource first`,"audit.event.unseen":`A change you cannot see`,"audit.event.created":`Created`,"audit.event.updated":`Changed`,"audit.event.deleted":`Deleted`,"audit.event.trashed":`Moved to trash`,"audit.event.restored":`Restored`,"audit.event.purged":`Deleted for good`,"audit.event.action":`Ran “{action}”`,"audit.event.page":`Changed {page}`,"audit.event.login":`Signed in`,"audit.event.logout":`Signed out`,"audit.event.loginFailed":`Failed sign-in`,"audit.event.loginFailedCode":`Failed sign-in: wrong two-factor code`,"audit.event.loginFailedLimited":`Failed sign-in: too many attempts`,"audit.event.loginFailedMore":`{count} more failed sign-ins`,"audit.event.viewAs":`Viewed the admin as a user`,"audit.event.roleChanged":`Role changed`,"audit.event.groupChanged":`Group changed`,"audit.event.userRolesChanged":`Roles and groups of a user changed`,"audit.event.userCreated":`User created`,"audit.event.userChanged":`User changed`,"audit.event.passwordChanged":`Password changed`,"audit.event.passwordReset":`Password set by an administrator`,"audit.event.twoFactorEnabled":`Two-factor sign-in turned on`,"audit.event.twoFactorDisabled":`Two-factor sign-in turned off`,"audit.event.twoFactorReset":`Two-factor sign-in reset`,"audit.event.recoveryCodes":`New recovery codes`,"audit.event.sessions":`Sessions signed out`,"audit.event.sessionsOthers":`Signed out everywhere else`,"audit.event.sessionsOne":`Signed out one device`,"display.title":`Display settings`,"display.calendar":`Calendar`,"display.gregorian":`Gregorian`,"display.jalali":`Jalali`,"display.digits":`Digits`,"display.accent":`Accent colour`,"display.customAccent":`Another colour`,"display.defaultAccent":`Default`,"display.accentForEveryone":`Use for everyone`,"display.resetForEveryone":`Reset for everyone`,"display.latinDigits":`Latin 123`,"display.persianDigits":`Persian ۱۲۳`,"inline.row":`{name} row {index}`,"inline.newRow":`New {name} {index}`,"inline.moveUp":`Move {name} up`,"inline.moveDown":`Move {name} down`,"inline.remove":`Remove {name}`,"inline.rowActions":`Row actions`,"inline.empty":`None yet.`,"inline.limitsMax":`{count} · at most {max}`,"inline.limitsBetween":`{count} · {min} to {max}`,"inline.countMin":`Needs at least {min} (has {count}).`,"inline.countMax":`Can have at most {max} (has {count}).`,"inline.truncated":`{count} more are not shown here, so these cannot be edited in this form.`,"inline.openList":`Open the list`,"inline.duplicateNote":`Duplicate copies this record only, not its {names}.`,"form.new":`New {name}`,"form.back":`Back`,"form.edit":`Edit`,"dashboard.title":`Dashboard`,"dashboard.subtitle":`Your shop over the chosen period`,"dashboard.period":`Period`,"dashboard.day":`Today`,"dashboard.week":`Week`,"dashboard.month":`Month`,"dashboard.year":`Year`,"dashboard.range":`Choose dates`,"dashboard.apply":`Show`,"dashboard.failed":`This widget could not load.`,"dashboard.retry":`Try again`,"dashboard.viewAll":`View all`,"dashboard.thisPeriod":`This period`,"dashboard.previousPeriod":`Previous period`,"stepper.since":`since {time}`,"form.viewProfile":`View`,"form.viewOnly":`You can view this record but not change it.`,"form.save":`Save`,"form.saving":`Saving…`,"form.delete":`Delete`,"form.confirmDelete":`Confirm delete`,"form.moveToTrash":`Move to trash`,"form.confirmMoveToTrash":`Confirm move to trash`,"form.deleting":`Deleting…`,"form.keep":`Keep`,"form.related":`Related`,"form.add":`Add {name}`,"form.remove":`Remove {name} {index}`,"form.conflictTitle":`Someone else saved this record while you were editing it.`,"form.conflictNone":`None of the fields on this form changed.`,"form.keepMine":`Keep my changes`,"form.loadTheirs":`Load theirs`,"form.saveAndNew":`Save & new`,"form.duplicate":`Duplicate`,"form.savedName":`“{name}” saved.`,"form.leaveTitle":`Leave without saving? Your changes will be lost.`,"form.stay":`Stay`,"form.leave":`Leave`,"form.unsaved":`Unsaved changes`,"form.formatJson":`Format`,"form.tabHasErrors":`(has errors)`,"form.readOnly":`Read-only`,"form.externalLink":`{name} (opens in a new tab)`,"form.colorCode":`{name} colour code`,"upload.choose":`Choose a file`,"upload.chooseMany":`Choose files`,"upload.chooseImage":`Choose an image`,"upload.chooseImages":`Choose images`,"upload.replace":`Replace`,"upload.drop":`or drop it here`,"upload.dropMany":`or drop them here`,"upload.limit":`Up to {max}`,"upload.uploading":`Uploading {name}`,"upload.cancel":`Cancel uploading {name}`,"upload.remove":`Remove {name}`,"upload.open":`Open {name}`,"upload.more":`+{count}`,"upload.failed":`{name}: {message}`,"upload.busy":`Wait for the uploads to finish, then save.`,"upload.tooLarge":`The file is too large.`,"upload.tooLargeMax":`The file is too large (at most {max}).`,"upload.typeRefused":`This type of file is not accepted here.`,"upload.empty":`The file is empty.`,"upload.network":`The upload failed. Check your connection and try again.`,"upload.bytes":`{value} B`,"upload.kilobytes":`{value} KB`,"upload.megabytes":`{value} MB`,"upload.gigabytes":`{value} GB`,"upload.terabytes":`{value} TB`,"editor.loading":`Loading the editor…`,"editor.toolbar":`{name} formatting`,"editor.paragraph":`Paragraph`,"editor.heading":`Heading {level}`,"editor.bold":`Bold`,"editor.italic":`Italic`,"editor.strike":`Strikethrough`,"editor.bulletList":`Bulleted list`,"editor.orderedList":`Numbered list`,"editor.blockquote":`Quote`,"editor.rule":`Horizontal line`,"editor.link":`Link`,"editor.linkAddress":`Link address`,"editor.linkApply":`Apply`,"editor.unlink":`Remove link`,"editor.image":`Insert image`,"editor.imageNoAddress":`the server gave no address to show the image from`,"editor.table":`Insert table`,"editor.addRow":`Add row`,"editor.addColumn":`Add column`,"editor.deleteRow":`Delete row`,"editor.deleteColumn":`Delete column`,"editor.deleteTable":`Delete table`,"editor.undo":`Undo`,"editor.redo":`Redo`,"palette.open":`Search and go to`,"palette.placeholder":`Go to, create, or find records…`,"palette.results":`Results`,"palette.goTo":`Go to`,"palette.actions":`Actions`,"palette.toggleTheme":`Toggle theme`,"palette.records":`Records`,"palette.new":`New {name}`,"palette.searching":`Searching…`,"palette.noResults":`Nothing found`,"picker.typeToSearch":`Type to search…`,"picker.typeToAdd":`Type to add…`,"picker.searching":`Searching…`,"picker.noMatches":`No matches`,"picker.remove":`Remove {name}`,"picker.clear":`Clear {name}`,"picker.selected":`Selected {name}`,"validation.required":`is required`,"validation.number":`must be a number`,"validation.json":`must be valid JSON`,"validation.date":`must be a valid date`,"validation.datetime":`must be a valid date and time`,"validation.minLength":`must be at least {min} characters`,"validation.maxLength":`must be at most {max} characters`,"validation.pattern":`is not in the expected format`,"validation.email":`must be an email address`,"validation.url":`must be a URL`,"validation.uuid":`must be a UUID`,"validation.oneOf":`must be one of: {values}`,"validation.integer":`must be an integer`,"validation.min":`must be at least {min}`,"validation.max":`must be at most {max}`},Hh={en:Vh,fa:{"common.loading":`در حال بارگذاری…`,"common.yes":`بله`,"common.no":`خیر`,"common.empty":`—`,"common.all":`همه`,"common.cancel":`انصراف`,"common.pageNotFound":`صفحه پیدا نشد.`,"common.requestFailed":`درخواست ناموفق بود ({status})`,"common.reference":`{message} (کد پیگیری: {id})`,"shell.adminPanel":`پنل مدیریت`,"palette.move":`جابهجایی`,"palette.openItem":`باز کردن`,"palette.close":`بستن`,"shell.menu":`منو`,"shell.closeMenu":`بستن منو`,"shell.resources":`بخشها`,"shell.filterResources":`جستوجوی بخشها`,"shell.pinned":`سنجاقشده`,"shell.recent":`اخیر`,"shell.pin":`سنجاق کردن {name}`,"shell.unpin":`برداشتن سنجاق {name}`,"shell.collapseGroup":`بستن {name}`,"shell.expandGroup":`باز کردن {name}`,"shell.collapseSidebar":`جمع کردن نوار کناری`,"shell.expandSidebar":`باز کردن نوار کناری`,"shell.breadcrumbs":`مسیر صفحه`,"shell.home":`خانه`,"shell.dashboard":`داشبورد`,"shell.noMatches":`بخشی پیدا نشد.`,"shell.theme":`پوسته`,"shell.themeLight":`روشن`,"shell.themeDark":`تیره`,"shell.themeSystem":`سیستم`,"shell.language":`زبان`,"shell.noResources":`هنوز بخشی ثبت نشده است. یک provider را با @AdminResource علامت بزنید.`,"shell.records":`{count} رکورد`,"shell.aboutRecords":`حدود {count} رکورد`,"list.select":`انتخاب`,"list.done":`تمام`,"list.loadMore":`بیشتر`,"list.showing":`{shown} مورد`,"list.showingOf":`{shown} از {total}`,"list.new":`جدید`,"list.trash":`سطل زباله`,"list.trashNote":`رکوردهای سطل زباله. برای ویرایش دوباره، آن را بازگردانید.`,"list.restore":`بازگردانی`,"list.restoreRecord":`بازگردانی {name}`,"list.actions":`عملیات`,"list.noMatches":`رکوردی با این شرایط نیست.`,"list.noRecords":`هنوز رکوردی نیست.`,"list.total":`{count} مورد`,"list.about":`حدود {count}`,"list.page":`صفحه {page}`,"list.pageOf":`صفحه {page} از {pages}`,"list.range":`نمایش {from} تا {to} از {total}`,"list.rowsPerPage":`ردیف در صفحه`,"list.toggleRow":`{column}: {name}`,"list.previousPage":`صفحه قبل`,"list.nextPage":`صفحه بعد`,"list.columns":`ستونها`,"list.density":`تراکم`,"list.comfortable":`راحت`,"list.compact":`فشرده`,"list.moveUp":`جابهجایی {name} به بالا`,"list.moveDown":`جابهجایی {name} به پایین`,"list.resetColumns":`بازنشانی ستونها`,"list.resize":`تغییر اندازهی {name}`,"list.retry":`تلاش دوباره`,"list.loadFailed":`فهرست بارگذاری نشد.`,"list.selectPage":`انتخاب همهی این صفحه`,"list.selectRow":`انتخاب {name}`,"print.open":`چاپ {name}`,"list.export":`خروجی Excel`,"list.exporting":`در حال ساخت فایل…`,"list.exportTruncated":`فقط {count} ردیف اول در فایل آمد.`,"list.exportDone":`{file} دانلود شد.`,"list.selected":`{count} مورد انتخاب شده`,"list.deleteSelected":`حذف انتخابشدهها`,"list.confirmDeleteSelected":`حذف {count} مورد`,"list.clearSelection":`لغو انتخاب`,"list.bulkDeleted":`{count} مورد حذف شد`,"list.bulkFailed":`{count} مورد ناموفق`,"list.quickView":`نمای سریع: {name}`,"list.edit":`ویرایش`,"list.close":`بستن`,"list.editCell":`ویرایش {name}: {value}`,"action.running":`در حال اجرا…`,"action.confirm":`«{action}» اجرا شود؟`,"action.confirmRecord":`«{action}» روی {name} اجرا شود؟`,"action.confirmSelected":`«{action}» روی {count} رکورد اجرا شود؟`,"action.eachNote":`هر یک از {count} رکورد جداگانه انجام میشود: خطای یکی بقیه را متوقف نمیکند.`,"action.atomicNote":`همه یا هیچ: اگر یکی از {count} رکورد خطا بدهد، هیچکدام تغییر نمیکند.`,"action.done":`«{action}» انجام شد.`,"action.doneGone":`«{action}» انجام شد. این رکورد دیگر در دسترس شما نیست.`,"action.bulkDone":`{action}: {count} مورد انجام شد`,"action.saveFirst":`ابتدا تغییرات را ذخیره یا لغو کنید.`,"action.more":`کارهای بیشتر`,"toast.region":`اعلانها`,"toast.dismiss":`بستن`,"settings.viewOnly":`میتوانید این تنظیمات را ببینید ولی نمیتوانید تغییرشان دهید.`,"settings.discard":`لغو تغییرات`,"secret.set":`تنظیم شده`,"secret.notSet":`تنظیم نشده`,"secret.replace":`جایگزینی`,"secret.replaceName":`جایگزینی {name}`,"secret.clear":`پاک کردن`,"secret.clearName":`پاک کردن {name}`,"secret.keep":`نگه داشتن مقدار فعلی`,"secret.willClear":`هنگام ذخیره پاک میشود.`,"secret.undo":`بازگردانی`,"filters.search":`جستوجو`,"filters.searchIn":`جستوجو در {fields}`,"filters.filtersAndSort":`فیلتر و مرتبسازی`,"filters.showResults":`نمایش نتایج`,"filters.sortBy":`مرتبسازی بر اساس`,"filters.ascending":`{name}، صعودی`,"filters.descending":`{name}، نزولی`,"filters.filters":`فیلترها`,"filters.clear":`پاک کردن فیلترها`,"filters.from":`از`,"filters.to":`تا`,"filters.contains":`{field} شامل`,"filters.empty":`خالی`,"filters.notEmpty":`غیرخالی`,"filters.not":`بهجز `,"filters.removeChip":`حذف فیلتر {label}`,"filters.active":`فیلترهای فعال`,"filters.any":`همه`,"filters.onlyEmpty":`خالی`,"filters.hideEmpty":`غیرخالی`,"filters.emptyValues":`{field}: مقدارهای خالی`,"filters.selected":`{count} مورد`,"date.placeholder":`yyyy/mm/dd`,"date.openCalendar":`انتخاب {name} از تقویم`,"date.calendar":`تقویم {name}`,"date.previous":`قبلی`,"date.next":`بعدی`,"date.chooseMonth":`انتخاب ماه`,"date.chooseYear":`انتخاب سال`,"date.today":`امروز`,"date.clear":`پاک کردن`,"date.time":`ساعت {name}`,"auth.title":`ورود`,"auth.username":`نام کاربری`,"auth.password":`گذرواژه`,"auth.signIn":`ورود`,"auth.signingIn":`در حال ورود…`,"auth.required":`نام کاربری و گذرواژه را وارد کنید.`,"auth.failed":`ورود انجام نشد. دوباره تلاش کنید.`,"auth.userMenu":`منوی حساب {name}`,"auth.account":`حساب کاربری`,"auth.signOut":`خروج`,"auth.changePassword":`تغییر گذرواژه`,"auth.currentPassword":`گذرواژهی فعلی`,"auth.newPassword":`گذرواژهی جدید`,"auth.confirmPassword":`تکرار گذرواژهی جدید`,"auth.mismatch":`با گذرواژهی جدید یکسان نیست`,"auth.passwordChanged":`گذرواژه تغییر کرد. نشستهای دیگر شما بسته شدند.`,"auth.sessions":`دستگاههای واردشده`,"auth.signOutOthers":`خروج از همهی دستگاههای دیگر`,"auth.thisDevice":`همین دستگاه`,"auth.unknownDevice":`دستگاه ناشناخته`,"auth.lastSeen":`آخرین فعالیت {when}`,"auth.revoke":`خروج`,"auth.revokeSession":`خروج {name}`,"rbac.administration":`مدیریت`,"rbac.users":`کاربران`,"rbac.groups":`گروهها`,"rbac.roles":`نقشها`,"rbac.user":`کاربر`,"rbac.group":`گروه`,"rbac.role":`نقش`,"rbac.newUser":`کاربر جدید`,"rbac.newGroup":`گروه جدید`,"rbac.newRole":`نقش جدید`,"rbac.createUser":`ساختن کاربر`,"rbac.export":`خروجی`,"rbac.import":`ورود`,"rbac.importFile":`پروندهی نقشها برای ورود`,"rbac.imported":`{count} نقش وارد شد.`,"rbac.notJson":`این پرونده JSON نیست.`,"rbac.permissionCount":`{count} مجوز`,"rbac.system":`سیستمی`,"rbac.systemNote":`این نقش در کد تعریف شده است؛ آن را همانجا تغییر دهید.`,"rbac.name":`نام`,"rbac.labelIn":`عنوان ({language})`,"rbac.matrix":`مجوزها`,"rbac.resource":`بخش`,"rbac.op.view":`دیدن`,"rbac.op.create":`ساختن`,"rbac.op.update":`تغییر`,"rbac.op.delete":`حذف`,"rbac.op.purge":`حذف دائمی`,"rbac.grant":`{operation} {resource}`,"rbac.details":`فیلدها و ردیفهای {resource}`,"rbac.fields":`فیلدها`,"rbac.restricted":`محدود`,"rbac.fieldRule":`دسترسی به {field}`,"rbac.rule.default":`مطابق مجوزها`,"rbac.rule.defaultHidden":`پنهان (محدود)`,"rbac.rule.hidden":`پنهان`,"rbac.rule.readonly":`فقط خواندنی`,"rbac.rule.edit":`قابل ویرایش`,"rbac.scopes":`ردیفها`,"rbac.allRows":`همهی ردیفها`,"rbac.custom":`مجوزهای دیگر`,"rbac.global":`مجوزهای عمومی`,"rbac.actions":`عملیات`,"rbac.actionNote":`عملیات روی رکوردها به مجوز تغییر هم نیاز دارد.`,"rbac.pages":`صفحههای تنظیمات`,"rbac.page":`صفحه`,"rbac.viewImplied":`هر کس بتواند صفحهای را تغییر دهد، میتواند آن را ببیند.`,"rbac.noGroups":`هنوز گروهی نیست.`,"rbac.groupSummary":`{roles} نقش · {members} عضو`,"rbac.members":`اعضا`,"rbac.noMembers":`هنوز عضوی نیست.`,"rbac.addMember":`افزودن عضو`,"rbac.searchUsers":`جستوجوی کاربران`,"rbac.searchResults":`کاربران یافتهشده`,"rbac.usersFromMemberships":`سامانهی ورود شما نمیتواند کاربران را فهرست کند: اینها کاربرانی هستند که اینجا نقش یا گروه دارند.`,"rbac.superuser":`ابرکاربر`,"rbac.superuserNote":`فقط ابرکاربرها میتوانند ابرکاربر را تغییر دهند.`,"rbac.inactive":`غیرفعال`,"rbac.active":`فعال`,"rbac.displayName":`نام نمایشی`,"rbac.email":`ایمیل`,"rbac.saved":`ذخیره شد.`,"rbac.setPassword":`تعیین گذرواژه`,"rbac.setPasswordNote":`کاربر از همهجا خارج میشود.`,"rbac.passwordSet":`گذرواژه تعیین شد؛ کاربر از همهجا خارج شد.`,"auth.otpTitle":`تأیید دومرحلهای`,"auth.otp":`کد`,"auth.otpHelp":`کد ۶ رقمی برنامهٔ احراز هویت یا یکی از کدهای بازیابی را وارد کنید.`,"auth.verify":`تأیید`,"auth.otpRequired":`کد را وارد کنید.`,"auth.startOver":`ورود با حساب دیگر`,"twoFactor.title":`ورود دومرحلهای`,"twoFactor.on":`روشن`,"twoFactor.off":`خاموش`,"twoFactor.intro":`پس از گذرواژه، کدی از برنامهٔ احراز هویت خواسته شود.`,"twoFactor.setUp":`راهاندازی`,"twoFactor.scan":`کد را با برنامهٔ احراز هویت اسکن کنید یا کلید را در آن وارد کنید. سپس کدی را که برنامه نشان میدهد بنویسید.`,"twoFactor.qr":`کد QR برای برنامهٔ احراز هویت`,"twoFactor.key":`کلید`,"twoFactor.code":`کد برنامه`,"twoFactor.turnOn":`روشن کردن`,"twoFactor.recoveryTitle":`کدهای بازیابی`,"twoFactor.recoveryIntro":`این کدها را جای امنی نگه دارید. اگر دستگاهتان را گم کنید، هر کد یک بار شما را وارد میکند. دوباره نشان داده نمیشوند.`,"twoFactor.copy":`کپی کدها`,"twoFactor.copied":`کپی شد`,"twoFactor.done":`ذخیرهشان کردم`,"twoFactor.left":`{count} کد بازیابی استفادهنشده.`,"twoFactor.newCodes":`کدهای بازیابی تازه`,"twoFactor.turnOff":`خاموش کردن`,"twoFactor.password":`گذرواژهٔ شما`,"twoFactor.enabledNote":`ورود دومرحلهای روشن شد. نشستهای دیگر شما بسته شدند.`,"twoFactor.disabledNote":`ورود دومرحلهای خاموش است.`,"viewAs.start":`دیدن از نگاه این کاربر`,"viewAs.banner":`از نگاه {name}. فقط خواندنی.`,"viewAs.stop":`پایان`,"rbac.twoFactor":`ورود دومرحلهای`,"rbac.resetTwoFactor":`بازنشانی ورود دومرحلهای`,"rbac.resetTwoFactorNote":`عامل دوم کاربر را (مثلاً گوشی گمشده) خاموش میکند و او را از همهجا خارج میکند.`,"rbac.twoFactorReset":`ورود دومرحلهای این کاربر خاموش شد.`,"debugger.title":`اشکالیاب دسترسی`,"debugger.intro":`چرا کاربری چیزی را میبیند یا نمیبیند، تغییر میدهد یا نمیدهد.`,"debugger.user":`کاربر`,"debugger.resource":`منبع`,"debugger.record":`شناسهٔ رکورد (اختیاری)`,"debugger.explain":`توضیح بده`,"debugger.pick":`یک کاربر و یک منبع انتخاب کنید.`,"debugger.roles":`نقشها`,"debugger.noRoles":`بدون نقش: هیچ کاری مجاز نیست.`,"debugger.superuser":`ابرکاربر همهکاری میتواند بکند.`,"debugger.source.direct":`مستقیم داده شده`,"debugger.source.group":`از گروه {group}`,"debugger.source.resolveRoles":`از resolveRoles`,"debugger.source.adapter":`از سامانهٔ ورود`,"debugger.unknownRole":`نقشی با این نام نیست؛ چیزی نمیدهد`,"debugger.operations":`عملیات`,"debugger.allowed":`مجاز`,"debugger.denied":`غیرمجاز`,"debugger.noGrant":`هیچ نقشی آن را نمیدهد`,"debugger.viaUpdate":`{pattern} در {role} (تغییر، دیدن را هم میدهد)`,"debugger.grant":`{pattern} در {role}`,"debugger.fields":`فیلدها`,"debugger.field":`فیلد`,"debugger.result":`نتیجه`,"debugger.byRole":`به تفکیک نقش`,"debugger.forced":`همیشه دیده میشود: کلیدها و نسخه`,"debugger.scopes":`ردیفها`,"debugger.allRows":`همهٔ ردیفها`,"debugger.noRows":`هیچ ردیفی`,"debugger.someRows":`ردیفهای {scopes}`,"debugger.globalScopes":`محدود به {scopes} نیز`,"debugger.recordTitle":`رکورد {id}`,"debugger.reason.permission":`بدون مجوز`,"debugger.reason.scope":`بیرون از ردیفهایش`,"debugger.reason.rule":`قاعدهٔ این رکورد اجازه نمیدهد`,"debugger.reason.missing":`چنین رکوردی نیست`,"debugger.actions":`عملیات`,"debugger.needsUpdate":`عملیات روی رکوردها به مجوز تغییر هم نیاز دارد`,"debugger.noRecordActions":`هیچکدام روی این رکورد`,"debugger.pages":`صفحههای تنظیمات`,"audit.title":`گزارش تغییرات`,"audit.history":`تاریخچه`,"audit.details":`جزئیات`,"audit.recordTabs":`رکورد و تاریخچهی آن`,"audit.entries":`تغییرهای ثبتشده`,"audit.notAllowed":`اجازهی خواندن گزارش تغییرات را ندارید`,"audit.off":`گزارش تغییرات در این پنل فعال نیست`,"audit.empty":`هنوز چیزی ثبت نشده است.`,"audit.noMatches":`موردی پیدا نشد.`,"audit.noActor":`بدون ورود`,"audit.viewAsBy":`هنگامی که کاربر {id} از دید او نگاه میکرد`,"audit.filterByActor":`فقط کارهای {name} را نشان بده`,"audit.changedFields":`فیلدهای تغییرکرده`,"audit.before":`قبل`,"audit.after":`بعد`,"audit.becomes":`شد`,"audit.field.changed":`تغییر کرد`,"audit.field.hidden":`پنهان`,"audit.field.dropped":`بزرگتر از آن بود که نگه داشته شود`,"audit.field.truncated":`کوتاهشده`,"audit.showMore":`بیشتر`,"audit.showLess":`کمتر`,"audit.input":`ورودی`,"audit.inputTruncated":`ورودی بزرگتر از آن بود که نگه داشته شود.`,"audit.restrictedRecord":`رکوردی که نمیتوانید ببینید: جزئیات آن نشان داده نمیشود.`,"audit.restrictedChanges":`اجازهی دیدن تغییرها را ندارید.`,"audit.suppressedNote":`در همان دقیقه رخ دادند و تکتک ثبت نشدند.`,"audit.limitedNote":`ورودهای ناموفق بعدی در این دقیقه فقط شمرده میشوند.`,"audit.actionDeleted":`این عملیات رکورد را حذف کرد.`,"audit.filter.actor":`انجامدهنده (شناسهی کاربر)`,"audit.filter.event":`رویداد`,"audit.filter.eventHint":`order.updated یا auth.*`,"audit.filter.resource":`بخش`,"audit.filter.record":`شناسهی رکورد`,"audit.filter.recordHint":`نخست یک بخش انتخاب کنید`,"audit.event.unseen":`تغییری که نمیتوانید ببینید`,"audit.event.created":`ایجاد شد`,"audit.event.updated":`تغییر کرد`,"audit.event.deleted":`حذف شد`,"audit.event.trashed":`به سطل زباله رفت`,"audit.event.restored":`بازیابی شد`,"audit.event.purged":`برای همیشه حذف شد`,"audit.event.action":`«{action}» اجرا شد`,"audit.event.page":`{page} تغییر کرد`,"audit.event.login":`وارد شد`,"audit.event.logout":`خارج شد`,"audit.event.loginFailed":`ورود ناموفق`,"audit.event.loginFailedCode":`ورود ناموفق: کد دومرحلهای نادرست`,"audit.event.loginFailedLimited":`ورود ناموفق: تلاشهای بیش از حد`,"audit.event.loginFailedMore":`{count} ورود ناموفق دیگر`,"audit.event.viewAs":`پنل را از دید یک کاربر دید`,"audit.event.roleChanged":`نقش تغییر کرد`,"audit.event.groupChanged":`گروه تغییر کرد`,"audit.event.userRolesChanged":`نقشها و گروههای یک کاربر تغییر کرد`,"audit.event.userCreated":`کاربر ایجاد شد`,"audit.event.userChanged":`کاربر تغییر کرد`,"audit.event.passwordChanged":`رمز عبور تغییر کرد`,"audit.event.passwordReset":`مدیر رمز عبور را تعیین کرد`,"audit.event.twoFactorEnabled":`ورود دومرحلهای روشن شد`,"audit.event.twoFactorDisabled":`ورود دومرحلهای خاموش شد`,"audit.event.twoFactorReset":`ورود دومرحلهای بازنشانی شد`,"audit.event.recoveryCodes":`کدهای بازیابی تازه`,"audit.event.sessions":`نشستها بسته شدند`,"audit.event.sessionsOthers":`از همهی دستگاههای دیگر خارج شد`,"audit.event.sessionsOne":`از یک دستگاه خارج شد`,"display.title":`تنظیمات نمایش`,"display.calendar":`تقویم`,"display.gregorian":`میلادی`,"display.jalali":`شمسی`,"display.digits":`ارقام`,"display.accent":`رنگ اصلی`,"display.customAccent":`رنگ دیگر`,"display.defaultAccent":`پیشفرض`,"display.accentForEveryone":`برای همه`,"display.resetForEveryone":`بازگشت برای همه`,"display.latinDigits":`لاتین 123`,"display.persianDigits":`فارسی ۱۲۳`,"inline.row":`{name} ردیف {index}`,"inline.newRow":`{name} جدید {index}`,"inline.moveUp":`بردن {name} به بالا`,"inline.moveDown":`بردن {name} به پایین`,"inline.remove":`حذف {name}`,"inline.rowActions":`کارهای ردیف`,"inline.empty":`هنوز چیزی نیست.`,"inline.limitsMax":`{count} · حداکثر {max}`,"inline.limitsBetween":`{count} · از {min} تا {max}`,"inline.countMin":`دستکم {min} لازم است ({count} هست).`,"inline.countMax":`حداکثر {max} میتواند باشد ({count} هست).`,"inline.truncated":`{count} مورد دیگر اینجا نشان داده نمیشود، پس اینها در این فرم ویرایش نمیشوند.`,"inline.openList":`باز کردن فهرست`,"inline.duplicateNote":`تکثیر فقط همین رکورد را کپی میکند، نه {names} آن را.`,"form.new":`{name} جدید`,"form.back":`بازگشت`,"form.edit":`ویرایش`,"dashboard.title":`داشبورد`,"dashboard.subtitle":`وضعیت فروشگاه در بازه انتخابشده`,"dashboard.period":`بازه زمانی`,"dashboard.day":`امروز`,"dashboard.week":`هفته`,"dashboard.month":`ماه`,"dashboard.year":`سال`,"dashboard.range":`انتخاب بازه تاریخ`,"dashboard.apply":`نمایش`,"dashboard.failed":`این ویجت بارگذاری نشد.`,"dashboard.retry":`تلاش دوباره`,"dashboard.viewAll":`مشاهده همه`,"dashboard.thisPeriod":`این دوره`,"dashboard.previousPeriod":`دوره قبل`,"stepper.since":`از {time}`,"form.viewProfile":`مشاهده پروفایل`,"form.viewOnly":`میتوانید این رکورد را ببینید اما نمیتوانید آن را تغییر دهید.`,"form.save":`ذخیره`,"form.saving":`در حال ذخیره…`,"form.delete":`حذف`,"form.confirmDelete":`تأیید حذف`,"form.moveToTrash":`انتقال به سطل زباله`,"form.confirmMoveToTrash":`تأیید انتقال به سطل زباله`,"form.deleting":`در حال حذف…`,"form.keep":`نگهداشتن`,"form.related":`مرتبط`,"form.add":`افزودن {name}`,"form.remove":`حذف {name} {index}`,"form.conflictTitle":`در حین ویرایش شما، شخص دیگری این رکورد را ذخیره کرد.`,"form.conflictNone":`هیچیک از فیلدهای این فرم تغییر نکرده است.`,"form.keepMine":`تغییرات من بماند`,"form.loadTheirs":`نسخهی آنها را بارگذاری کن`,"form.saveAndNew":`ذخیره و مورد جدید`,"form.duplicate":`تکثیر`,"form.savedName":`«{name}» ذخیره شد.`,"form.leaveTitle":`بدون ذخیره خارج میشوید؟ تغییرات از دست میرود.`,"form.stay":`بمان`,"form.leave":`خروج`,"form.unsaved":`تغییرات ذخیره نشده`,"form.formatJson":`مرتبسازی`,"form.tabHasErrors":`(دارای خطا)`,"form.readOnly":`فقط خواندنی`,"form.externalLink":`{name} (در زبانهی جدید باز میشود)`,"form.colorCode":`کد رنگ {name}`,"upload.choose":`انتخاب فایل`,"upload.chooseMany":`انتخاب فایلها`,"upload.chooseImage":`انتخاب تصویر`,"upload.chooseImages":`انتخاب تصویرها`,"upload.replace":`جایگزینی`,"upload.drop":`یا آن را اینجا رها کنید`,"upload.dropMany":`یا آنها را اینجا رها کنید`,"upload.limit":`حداکثر {max}`,"upload.uploading":`در حال بارگذاری {name}`,"upload.cancel":`لغو بارگذاری {name}`,"upload.remove":`حذف {name}`,"upload.open":`باز کردن {name}`,"upload.more":`+{count}`,"upload.failed":`{name}: {message}`,"upload.busy":`تا پایان بارگذاریها صبر کنید، سپس ذخیره کنید.`,"upload.tooLarge":`فایل بیش از حد بزرگ است.`,"upload.tooLargeMax":`فایل بیش از حد بزرگ است (حداکثر {max}).`,"upload.typeRefused":`این نوع فایل اینجا پذیرفته نمیشود.`,"upload.empty":`فایل خالی است.`,"upload.network":`بارگذاری ناموفق بود. اتصال خود را بررسی کنید و دوباره تلاش کنید.`,"upload.bytes":`{value} بایت`,"upload.kilobytes":`{value} کیلوبایت`,"upload.megabytes":`{value} مگابایت`,"upload.gigabytes":`{value} گیگابایت`,"upload.terabytes":`{value} ترابایت`,"editor.loading":`در حال بارگذاری ویرایشگر…`,"editor.toolbar":`قالببندی {name}`,"editor.paragraph":`پاراگراف`,"editor.heading":`عنوان {level}`,"editor.bold":`پررنگ`,"editor.italic":`کج`,"editor.strike":`خطخورده`,"editor.bulletList":`فهرست نشانهدار`,"editor.orderedList":`فهرست شمارهدار`,"editor.blockquote":`نقلقول`,"editor.rule":`خط افقی`,"editor.link":`پیوند`,"editor.linkAddress":`نشانی پیوند`,"editor.linkApply":`اعمال`,"editor.unlink":`حذف پیوند`,"editor.image":`درج تصویر`,"editor.imageNoAddress":`سرور نشانیای برای نمایش تصویر نداد`,"editor.table":`درج جدول`,"editor.addRow":`افزودن سطر`,"editor.addColumn":`افزودن ستون`,"editor.deleteRow":`حذف سطر`,"editor.deleteColumn":`حذف ستون`,"editor.deleteTable":`حذف جدول`,"editor.undo":`واگرد`,"editor.redo":`ازنو`,"palette.open":`جستوجو و رفتن به`,"palette.placeholder":`رفتن به، ساختن، یا یافتن رکورد…`,"palette.results":`نتایج`,"palette.goTo":`رفتن به`,"palette.actions":`کارها`,"palette.toggleTheme":`تغییر تم`,"palette.records":`رکوردها`,"palette.new":`{name} جدید`,"palette.searching":`در حال جستوجو…`,"palette.noResults":`چیزی پیدا نشد`,"picker.typeToSearch":`برای جستوجو تایپ کنید…`,"picker.typeToAdd":`برای افزودن تایپ کنید…`,"picker.searching":`در حال جستوجو…`,"picker.noMatches":`موردی پیدا نشد`,"picker.remove":`حذف {name}`,"picker.clear":`پاک کردن {name}`,"picker.selected":`{name} انتخابشده`,"validation.required":`الزامی است`,"validation.number":`باید عدد باشد`,"validation.json":`باید JSON معتبر باشد`,"validation.date":`باید تاریخ معتبری باشد`,"validation.datetime":`باید تاریخ و زمان معتبر باشد`,"validation.minLength":`باید دستکم {min} نویسه باشد`,"validation.maxLength":`باید حداکثر {max} نویسه باشد`,"validation.pattern":`قالب آن درست نیست`,"validation.email":`باید نشانی ایمیل باشد`,"validation.url":`باید نشانی اینترنتی باشد`,"validation.uuid":`باید UUID باشد`,"validation.oneOf":`باید یکی از اینها باشد: {values}`,"validation.integer":`باید عدد صحیح باشد`,"validation.min":`باید دستکم {min} باشد`,"validation.max":`باید حداکثر {max} باشد`}},Uh=new Set([`fa`,`ar`,`he`,`ur`]),Wh=`nma.locale`,Gh=`en`,Kh={calendar:`gregorian`,digits:`latn`};function qh(){return Kh}function Jh(e){Kh=e}function Yh(){return Gh}var Xh={};function Zh(e){Xh=e??{}}function J(e,t={},n=Gh){return(Xh[n]?.[e]??(Hh[n]??Vh)[e]??Vh[e]).replace(/\{(\w+)\}/g,(e,n)=>n in t?String(t[n]):e)}function Qh(e){return Uh.has(e.split(`-`)[0])}var $h=e=>`-u-ca-${e.calendar===`persian`?`persian`:`gregory`}-nu-${e.digits}`;function eg(e,t=Gh){return new Intl.NumberFormat(`${t}-u-nu-${Kh.digits}`).format(e)}function tg(e){return Kh.digits===`arabext`?Fh(e):e}function ng(e,t=Gh){return new Intl.DateTimeFormat(`${t}${$h(Kh)}`,{dateStyle:`medium`,timeStyle:`short`}).format(e)}function rg(e,t=Gh){return new Intl.DateTimeFormat(`${t}${$h(Kh)}`,{hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`}).format(e)}function ig(e,t=Gh){let n=Date.parse(`${e}T00:00:00Z`);return!/^\d{4}-\d{2}-\d{2}$/.test(e)||Number.isNaN(n)?e:new Intl.DateTimeFormat(`${t}${$h(Kh)}`,{dateStyle:`medium`,timeZone:`UTC`}).format(n)}function ag(e,t=new Date,n=Gh){let r=Math.min(0,Math.round((e.getTime()-t.getTime())/1e3)),i=new Intl.RelativeTimeFormat(`${n}-u-nu-${Kh.digits}`,{numeric:`auto`});for(let[e,t]of[[`year`,31536e3],[`month`,2592e3],[`day`,86400],[`hour`,3600],[`minute`,60]])if(Math.abs(r)>=t)return i.format(Math.trunc(r/t),e);return i.format(Math.abs(r)<10?0:r,`second`)}function og(e){Gh=e,typeof document<`u`&&(document.documentElement.lang=e,document.documentElement.dir=Qh(e)?`rtl`:`ltr`)}function sg(e,t){try{let t=localStorage.getItem(Wh);if(t&&e.includes(t))return t}catch{}return t}var cg=(0,y.createContext)(void 0);function lg({locales:e,fallback:t,children:n}){let[r,i]=(0,y.useState)(()=>{let n=sg(e,t);return og(n),n}),[a,o]=(0,y.useState)(()=>{let e=zh(r);return Jh(e),e});return(0,b.jsx)(cg.Provider,{value:{locale:r,locales:e,setLocale:e=>{og(e);try{localStorage.setItem(Wh,e)}catch{}let t=zh(e);Jh(t),o(t),i(e)},t:(e,t)=>J(e,t,r),calendar:a.calendar,digits:a.digits,setDisplay:e=>{Bh(e);let t={...a,...e};Jh(t),o(t)}},children:n})}function Y(){let e=(0,y.useContext)(cg);if(!e)throw Error(`useLocale() outside LocaleProvider`);return e}function X(){return Y().t}function ug(){let e=document.getElementById(`nma-config`)?.textContent;if(e)return JSON.parse(e);throw Error(`nest-my-admin: runtime config missing`)}var dg=ug(),fg=class extends Error{status;body;constructor(e,t){super(t.code===`INTERNAL`&&t.correlationId?J(`common.reference`,{message:t.message,id:t.correlationId}):t.message),this.status=e,this.body=t,this.name=`ApiError`}get fields(){return this.body.fields??{}}};function pg(e){if(!(e instanceof fg))return e.message;let t=Object.entries(e.fields).map(([e,t])=>`${e}: ${t.join(`, `)}`);return[e.message,...t].join(` — `)}var mg,hg;function gg(e){mg=e}function _g(){return mg}function vg(e){hg=e}function yg(){mg=void 0,hg?.()}function bg(e,t){let n=t.replace(/\/+$/,``);return n===``||e!==n&&!e.startsWith(`${n}/`)?e:e.slice(n.length)||`/`}function xg(e,t=``){if(!e||!e.startsWith(`/`)||e.startsWith(`//`)||e.startsWith(`/\\`))return`/`;let n=bg(e,t);return n.startsWith(`/login`)?`/`:n}var Sg=`nma-view-as`;function Cg(){try{return sessionStorage.getItem(Sg)??void 0}catch{return}}function wg(e){try{e===void 0?sessionStorage.removeItem(Sg):sessionStorage.setItem(Sg,e)}catch{}}var Tg=class extends Error{constructor(){super(`Upload aborted`),this.name=`UploadAbortedError`}},Eg=`application/octet-stream`;function Dg(e){return typeof e==`object`&&!!e&&`code`in e&&`message`in e}function Og(e){return typeof e==`object`&&!!e&&typeof e.token==`string`}function kg(e,t,n,r){let i=n.createXhr?n.createXhr():new XMLHttpRequest,a=!1;return{promise:new Promise((o,s)=>{let c=e=>{a||(a=!0,e())};i.open(`POST`,`${n.apiBase}/uploads?${new URLSearchParams({resource:t.resource,field:t.field})}`),i.setRequestHeader(`Accept`,`application/json`),i.setRequestHeader(`Accept-Language`,n.locale),i.setRequestHeader(`Content-Type`,Eg),i.setRequestHeader(`X-File-Name`,encodeURIComponent(e.name)),n.csrfToken&&i.setRequestHeader(`X-CSRF-Token`,n.csrfToken),n.viewAs&&i.setRequestHeader(`X-View-As`,n.viewAs),i.upload.onprogress=e=>{e.lengthComputable&&e.total>0&&r?.(e.loaded/e.total)},i.onload=()=>{let e;try{e=i.responseText?JSON.parse(i.responseText):void 0}catch{e=void 0}let t=i.status>=200&&i.status<300&&Og(e);i.status===401&&n.onSignedOut?.(),c(()=>{t?(r?.(1),o(e)):Dg(e)?s(new fg(i.status,e)):i.status===413?s(new fg(413,{code:`BAD_REQUEST`,message:J(`upload.tooLarge`,{},n.locale),correlationId:``})):s(new fg(i.status,{code:`INTERNAL`,message:J(`common.requestFailed`,{status:i.status},n.locale),correlationId:``}))})},i.onerror=()=>c(()=>s(Error(J(`upload.network`,{},n.locale)))),i.onabort=()=>c(()=>s(new Tg)),i.send(e)}),abort:()=>{a||i.abort()}}}function Ag(e){if(e instanceof fg){let t=Object.values(e.fields).flat();if(t.length>0)return t.join(` `)}return e instanceof Error?e.message:String(e)}function jg(e,t){if(t.length===0)return!0;let n=e.toLowerCase();return t.some(e=>{let t=e.trim().toLowerCase();return t===`*`||t===`*/*`?!0:t.endsWith(`/*`)?n.startsWith(t.slice(0,-1)):n===t})}function Mg(e,t,n){if(e.size===0)return J(`upload.empty`,{},n);if(e.size>t.maxBytes)return J(`upload.tooLargeMax`,{max:Pg(t.maxBytes,n)},n);if(e.type!==``&&!jg(e.type.split(`;`)[0].trim(),t.accept))return J(`upload.typeRefused`,{},n)}var Ng=[`upload.bytes`,`upload.kilobytes`,`upload.megabytes`,`upload.gigabytes`,`upload.terabytes`];function Pg(e,t){let n=e,r=0;for(;n>=1024&&r<Ng.length-1;)n/=1024,r+=1;let i=new Intl.NumberFormat(t??`${Yh()}-u-nu-${qh().digits}`,{maximumFractionDigits:r===0?0:1}).format(n);return J(Ng[r],{value:i},t)}function Fg(e,t,n){let r=[...e];if(t<0||t>=r.length||n<0||n>=r.length||t===n)return r;let[i]=r.splice(t,1);return r.splice(n,0,i),r}function Ig(e){return{...e,creatable:!1,actions:[],prints:[],permissions:{create:!1,update:!1,delete:!1,purge:!1},list:{...e.list,editable:[]},form:{...e.form,create:[],update:[],requiredOnCreate:[],readonly:[...new Set([...e.form.readonly,...e.form.update,...e.form.create])]},...e.inlines?{inlines:Object.fromEntries(Object.entries(e.inlines).map(([e,t])=>[e,Ig(t)]))}:{}}}function Lg(e){return e.schema.readonly?e:{...e,schema:{...e.schema,readonly:!0}}}function Rg(e){return e.viewAs?{...e,rbac:{...e.rbac,manage:!1}}:e}function zg(e){return typeof e==`object`&&!!e&&`code`in e&&`message`in e}async function Z(e,t={}){let n=t.method??`GET`,r=_g(),i=e===`/session`&&n===`POST`?void 0:Cg(),a=await fetch(`${dg.apiBase}${e}`,{...t,credentials:`same-origin`,headers:{Accept:`application/json`,"Accept-Language":Yh(),...t.body?{"Content-Type":`application/json`}:{},...n!==`GET`&&r?{"X-CSRF-Token":r}:{},...i?{"X-View-As":i}:{},...t.headers}});a.status===401&&!e.startsWith(`/session`)&&yg();let o=await a.text(),s;try{s=o?JSON.parse(o):void 0}catch{s=void 0}if(!a.ok)throw new fg(a.status,zg(s)?s:{code:`INTERNAL`,message:J(`common.requestFailed`,{status:a.status}),correlationId:``});return s}var Bg=encodeURIComponent,Vg=e=>typeof e==`number`||typeof e==`string`?{"If-Match":`"${e}"`}:{};function Hg(e,t,n){let r=new URLSearchParams([...n.map(e=>[`id`,e]),[`lang`,Yh()]]);return`${dg.apiBase}/resources/${encodeURIComponent(e)}/print/${encodeURIComponent(t)}?${r}`}async function Ug(e,t){let n=new URLSearchParams(t);n.set(`offset`,String(-new Date().getTimezoneOffset()));let r=Cg(),i=await fetch(`${dg.apiBase}/resources/${encodeURIComponent(e)}/export?${n}`,{credentials:`same-origin`,headers:{"Accept-Language":Yh(),...r?{"X-View-As":r}:{}}});if(i.status===401&&yg(),!i.ok){let e=await i.json().catch(()=>void 0);throw new fg(i.status,zg(e)?e:{code:`INTERNAL`,message:J(`common.requestFailed`,{status:i.status}),correlationId:``})}let a=/filename="([^"]+)"/.exec(i.headers.get(`Content-Disposition`)??``)?.[1]??`${e}.xlsx`,o=i.headers.get(`X-Export-Truncated`);return{blob:await i.blob(),filename:a,...o?{truncated:Number(o)}:{}}}var Q={exportList:Ug,session:async()=>Rg(await Z(`/session`)),login:(e,t,n)=>Z(`/session`,{method:`POST`,body:JSON.stringify({username:e,password:t,...n?{otp:n}:{}})}),logout:()=>Z(`/session`,{method:`DELETE`}),sessions:()=>Z(`/account/sessions`),revokeSession:e=>Z(`/account/sessions/${Bg(e)}`,{method:`DELETE`}),revokeOtherSessions:()=>Z(`/account/sessions`,{method:`DELETE`}),changePassword:(e,t)=>Z(`/account/password`,{method:`POST`,body:JSON.stringify({current:e,next:t})}),twoFactor:{status:()=>Z(`/account/2fa`),setup:()=>Z(`/account/2fa/setup`,{method:`POST`,body:`{}`}),confirm:e=>Z(`/account/2fa/confirm`,{method:`POST`,body:JSON.stringify({code:e})}),disable:e=>Z(`/account/2fa/disable`,{method:`POST`,body:JSON.stringify({password:e})}),recoveryCodes:e=>Z(`/account/2fa/recovery-codes`,{method:`POST`,body:JSON.stringify({password:e})})},meta:()=>Z(`/meta`),menuBadges:()=>Z(`/menu/badges`),dashboard:()=>Z(`/dashboard`),setAppearance:e=>Z(`/appearance`,{method:`PUT`,body:JSON.stringify({accent:e})}),widget:(e,t)=>Z(`/dashboard/${encodeURIComponent(e)}?${new URLSearchParams({...t})}`),tabCounts:e=>Z(`/resources/${encodeURIComponent(e)}/tab-counts`),rbac:{catalog:()=>Z(`/rbac/catalog`),roles:()=>Z(`/rbac/roles`),role:e=>Z(`/rbac/roles/${Bg(e)}`),createRole:e=>Z(`/rbac/roles`,{method:`POST`,body:JSON.stringify(e)}),updateRole:(e,t)=>Z(`/rbac/roles/${Bg(e)}`,{method:`PATCH`,body:JSON.stringify(t)}),deleteRole:e=>Z(`/rbac/roles/${Bg(e)}`,{method:`DELETE`}),exportRoles:()=>Z(`/rbac/roles/export`),importRoles:e=>Z(`/rbac/roles/import`,{method:`POST`,body:JSON.stringify(e)}),groups:()=>Z(`/rbac/groups`),group:e=>Z(`/rbac/groups/${e}`),saveGroup:(e,t)=>Z(t===void 0?`/rbac/groups`:`/rbac/groups/${t}`,{method:t===void 0?`POST`:`PATCH`,body:JSON.stringify(e)}),deleteGroup:e=>Z(`/rbac/groups/${e}`,{method:`DELETE`}),users:e=>Z(`/rbac/users?${new URLSearchParams(Object.entries(e).filter(([,e])=>e!==void 0&&e!==``).map(([e,t])=>[e,String(t)]))}`),user:e=>Z(`/rbac/users/${Bg(e)}`),createUser:e=>Z(`/rbac/users`,{method:`POST`,body:JSON.stringify(e)}),updateUser:(e,t)=>Z(`/rbac/users/${Bg(e)}`,{method:`PATCH`,body:JSON.stringify(t)}),setPassword:(e,t)=>Z(`/rbac/users/${Bg(e)}/password`,{method:`POST`,body:JSON.stringify({password:t})}),resetTwoFactor:e=>Z(`/rbac/users/${Bg(e)}/2fa/reset`,{method:`POST`,body:`{}`}),explain:e=>Z(`/rbac/explain?${new URLSearchParams(Object.entries(e).filter(([,e])=>e!==void 0&&e!==``))}`)},upload:(e,t,n)=>kg(e,t,{apiBase:dg.apiBase,csrfToken:_g(),viewAs:Cg(),locale:Yh(),onSignedOut:yg},n),search:e=>Z(`/search?${new URLSearchParams({q:e})}`),schema:async e=>{let t=await Z(`/meta/resources/${Bg(e)}`);return Cg()?Ig(t):t},list:(e,t)=>Z(`/resources/${Bg(e)}?${t}`),remove:(e,t,n)=>Z(`/resources/${Bg(e)}/${Bg(t)}`,{method:`DELETE`,headers:Vg(n)}),options:(e,t,n)=>{let r=new URLSearchParams;return n.ids?r.set(`ids`,n.ids.join(`,`)):n.search&&r.set(`search`,n.search),n.values&&r.set(`values`,n.values),n.parent&&n.values&&r.set(`parent`,n.parent),Z(`/resources/${Bg(e)}/fields/${Bg(t)}/options${r.size?`?${r}`:``}`)},bulkDelete:(e,t)=>Z(`/resources/${Bg(e)}/bulk-delete`,{method:`POST`,body:JSON.stringify({ids:t})}),runAction:(e,t,n)=>Z(`/resources/${Bg(e)}/actions/${Bg(t)}`,{method:`POST`,body:JSON.stringify(n)}),page:async e=>{let t=await Z(`/pages/${Bg(e)}`);return Cg()?Lg(t):t},savePage:(e,t)=>Z(`/pages/${Bg(e)}`,{method:`PATCH`,body:JSON.stringify(t)}),history:(e,t,n)=>Z(`/resources/${Bg(e)}/${Bg(t)}/history${n?`?${new URLSearchParams({before:n})}`:``}`),audit:(e,t)=>{let n=new URLSearchParams(e);return t&&n.set(`before`,t),Z(`/audit${n.size?`?${n}`:``}`)},restore:(e,t)=>Z(`/resources/${Bg(e)}/${Bg(t)}/restore`,{method:`POST`,body:`{}`}),get:(e,t)=>Z(`/resources/${Bg(e)}/${Bg(t)}`),create:(e,t)=>Z(`/resources/${Bg(e)}`,{method:`POST`,body:JSON.stringify(t)}),update:(e,t,n,r)=>Z(`/resources/${Bg(e)}/${Bg(t)}`,{method:`PATCH`,body:JSON.stringify(n),headers:Vg(r)})},Wg=()=>ft({queryKey:[`session`],queryFn:async()=>{let e=await Q.session();return gg(e.csrfToken),e},retry:!1,staleTime:3e5}),Gg=()=>{let{locale:e}=Y();return ft({queryKey:[`meta`,e],queryFn:Q.meta})},Kg=(e,t=!0)=>{let{locale:n}=Y();return ft({queryKey:[`schema`,e,n],queryFn:()=>Q.schema(e),enabled:t})},qg=e=>ft({queryKey:[`menu-badges`],queryFn:Q.menuBadges,enabled:e,refetchInterval:6e4,refetchOnWindowFocus:!0}),Jg=e=>{let{locale:t}=Y();return ft({queryKey:[`page`,e,t],queryFn:()=>Q.page(e)})},Yg=(e,t,n=!0)=>ft({queryKey:[`list`,e,t],queryFn:()=>Q.list(e,new URLSearchParams(t)),placeholderData:ue,enabled:n}),Xg=(e,t)=>ft({queryKey:[`record`,e,t],queryFn:()=>Q.get(e,t),enabled:t!==void 0}),Zg=(e,t,n,r,i,a)=>ft({queryKey:[`options`,e,t,n,i??``,a??``],queryFn:()=>Q.options(e,t,{search:n,values:i,parent:a}),enabled:r,placeholderData:ue}),Qg=(e,t,n)=>ft({queryKey:[`options`,e,t,`ids`,n],queryFn:()=>Q.options(e,t,{ids:n}),enabled:n.length>0}),$g=function(e,t){let n=e,r=t_[t],i=null,a=0,o=null,s=[],c={},l=function(e,t){a=n*4+17,i=function(e){let t=Array(e);for(let n=0;n<e;n+=1){t[n]=Array(e);for(let r=0;r<e;r+=1)t[n][r]=null}return t}(a),u(0,0),u(a-7,0),u(0,a-7),p(),f(),h(e,t),n>=7&&m(e),o??=v(n,r,s),g(o,t)},u=function(e,t){for(let n=-1;n<=7;n+=1)if(!(e+n<=-1||a<=e+n))for(let r=-1;r<=7;r+=1)t+r<=-1||a<=t+r||(0<=n&&n<=6&&(r==0||r==6)||0<=r&&r<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=r&&r<=4?i[e+n][t+r]=!0:i[e+n][t+r]=!1)},d=function(){let e=0,t=0;for(let n=0;n<8;n+=1){l(!0,n);let r=r_.getLostPoint(c);(n==0||e>r)&&(e=r,t=n)}return t},f=function(){for(let e=8;e<a-8;e+=1)i[e][6]??(i[e][6]=e%2==0);for(let e=8;e<a-8;e+=1)i[6][e]??(i[6][e]=e%2==0)},p=function(){let e=r_.getPatternPosition(n);for(let t=0;t<e.length;t+=1)for(let n=0;n<e.length;n+=1){let r=e[t],a=e[n];if(i[r][a]==null)for(let e=-2;e<=2;e+=1)for(let t=-2;t<=2;t+=1)e==-2||e==2||t==-2||t==2||e==0&&t==0?i[r+e][a+t]=!0:i[r+e][a+t]=!1}},m=function(e){let t=r_.getBCHTypeNumber(n);for(let n=0;n<18;n+=1){let r=!e&&(t>>n&1)==1;i[Math.floor(n/3)][n%3+a-8-3]=r}for(let n=0;n<18;n+=1){let r=!e&&(t>>n&1)==1;i[n%3+a-8-3][Math.floor(n/3)]=r}},h=function(e,t){let n=r<<3|t,o=r_.getBCHTypeInfo(n);for(let t=0;t<15;t+=1){let n=!e&&(o>>t&1)==1;t<6?i[t][8]=n:t<8?i[t+1][8]=n:i[a-15+t][8]=n}for(let t=0;t<15;t+=1){let n=!e&&(o>>t&1)==1;t<8?i[8][a-t-1]=n:t<9?i[8][15-t-1+1]=n:i[8][15-t-1]=n}i[a-8][8]=!e},g=function(e,t){let n=-1,r=a-1,o=7,s=0,c=r_.getMaskFunction(t);for(let t=a-1;t>0;t-=2)for(t==6&&--t;;){for(let n=0;n<2;n+=1)if(i[r][t-n]==null){let a=!1;s<e.length&&(a=(e[s]>>>o&1)==1),c(r,t-n)&&(a=!a),i[r][t-n]=a,--o,o==-1&&(s+=1,o=7)}if(r+=n,r<0||a<=r){r-=n,n=-n;break}}},_=function(e,t){let n=0,r=0,i=0,a=Array(t.length),o=Array(t.length);for(let s=0;s<t.length;s+=1){let c=t[s].dataCount,l=t[s].totalCount-c;r=Math.max(r,c),i=Math.max(i,l),a[s]=Array(c);for(let t=0;t<a[s].length;t+=1)a[s][t]=255&e.getBuffer()[t+n];n+=c;let u=r_.getErrorCorrectPolynomial(l),d=a_(a[s],u.getLength()-1).mod(u);o[s]=Array(u.getLength()-1);for(let e=0;e<o[s].length;e+=1){let t=e+d.getLength()-o[s].length;o[s][e]=t>=0?d.getAt(t):0}}let s=0;for(let e=0;e<t.length;e+=1)s+=t[e].totalCount;let c=Array(s),l=0;for(let e=0;e<r;e+=1)for(let n=0;n<t.length;n+=1)e<a[n].length&&(c[l]=a[n][e],l+=1);for(let e=0;e<i;e+=1)for(let n=0;n<t.length;n+=1)e<o[n].length&&(c[l]=o[n][e],l+=1);return c},v=function(e,t,n){let r=o_.getRSBlocks(e,t),i=s_();for(let t=0;t<n.length;t+=1){let r=n[t];i.put(r.getMode(),4),i.put(r.getLength(),r_.getLengthInBits(r.getMode(),e)),r.write(i)}let a=0;for(let e=0;e<r.length;e+=1)a+=r[e].dataCount;if(i.getLengthInBits()>a*8)throw`code length overflow. (`+i.getLengthInBits()+`>`+a*8+`)`;for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(236,8),i.getLengthInBits()>=a*8));)i.put(17,8);return _(i,r)};c.addData=function(e,t){t||=`Byte`;let n=null;switch(t){case`Numeric`:n=c_(e);break;case`Alphanumeric`:n=l_(e);break;case`Byte`:n=u_(e);break;case`Kanji`:n=d_(e);break;default:throw`mode:`+t}s.push(n),o=null},c.isDark=function(e,t){if(e<0||a<=e||t<0||a<=t)throw e+`,`+t;return i[e][t]},c.getModuleCount=function(){return a},c.make=function(){if(n<1){let e=1;for(;e<40;e++){let t=o_.getRSBlocks(e,r),n=s_();for(let t=0;t<s.length;t++){let r=s[t];n.put(r.getMode(),4),n.put(r.getLength(),r_.getLengthInBits(r.getMode(),e)),r.write(n)}let i=0;for(let e=0;e<t.length;e++)i+=t[e].dataCount;if(n.getLengthInBits()<=i*8)break}n=e}l(!1,d())},c.createTableTag=function(e,t){e||=2,t=t===void 0?e*4:t;let n=``;n+=`<table style="`,n+=` border-width: 0px; border-style: none;`,n+=` border-collapse: collapse;`,n+=` padding: 0px; margin: `+t+`px;`,n+=`">`,n+=`<tbody>`;for(let t=0;t<c.getModuleCount();t+=1){n+=`<tr>`;for(let r=0;r<c.getModuleCount();r+=1)n+=`<td style="`,n+=` border-width: 0px; border-style: none;`,n+=` border-collapse: collapse;`,n+=` padding: 0px; margin: 0px;`,n+=` width: `+e+`px;`,n+=` height: `+e+`px;`,n+=` background-color: `,n+=c.isDark(t,r)?`#000000`:`#ffffff`,n+=`;`,n+=`"/>`;n+=`</tr>`}return n+=`</tbody>`,n+=`</table>`,n},c.createSvgTag=function(e,t,n,r){let i={};typeof arguments[0]==`object`&&(i=arguments[0],e=i.cellSize,t=i.margin,n=i.alt,r=i.title),e||=2,t=t===void 0?e*4:t,n=typeof n==`string`?{text:n}:n||{},n.text=n.text||null,n.id=n.text?n.id||`qrcode-description`:null,r=typeof r==`string`?{text:r}:r||{},r.text=r.text||null,r.id=r.text?r.id||`qrcode-title`:null;let a=c.getModuleCount()*e+t*2,o,s,l,u,d=``,f;for(f=`l`+e+`,0 0,`+e+` -`+e+`,0 0,-`+e+`z `,d+=`<svg version="1.1" xmlns="http://www.w3.org/2000/svg"`,d+=i.scalable?``:` width="`+a+`px" height="`+a+`px"`,d+=` viewBox="0 0 `+a+` `+a+`" `,d+=` preserveAspectRatio="xMinYMin meet"`,d+=r.text||n.text?` role="img" aria-labelledby="`+y([r.id,n.id].join(` `).trim())+`"`:``,d+=`>`,d+=r.text?`<title id="`+y(r.id)+`">`+y(r.text)+`</title>`:``,d+=n.text?`<description id="`+y(n.id)+`">`+y(n.text)+`</description>`:``,d+=`<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>`,d+=`<path d="`,l=0;l<c.getModuleCount();l+=1)for(u=l*e+t,o=0;o<c.getModuleCount();o+=1)c.isDark(l,o)&&(s=o*e+t,d+=`M`+s+`,`+u+f);return d+=`" stroke="transparent" fill="black"/>`,d+=`</svg>`,d},c.createDataURL=function(e,t){e||=2,t=t===void 0?e*4:t;let n=c.getModuleCount()*e+t*2,r=t,i=n-t;return g_(n,n,function(t,n){if(r<=t&&t<i&&r<=n&&n<i){let i=Math.floor((t-r)/e),a=Math.floor((n-r)/e);return+!c.isDark(a,i)}return 1})},c.createImgTag=function(e,t,n){e||=2,t=t===void 0?e*4:t;let r=c.getModuleCount()*e+t*2,i=``;return i+=`<img`,i+=` src="`,i+=c.createDataURL(e,t),i+=`"`,i+=` width="`,i+=r,i+=`"`,i+=` height="`,i+=r,i+=`"`,n&&(i+=` alt="`,i+=y(n),i+=`"`),i+=`/>`,i};let y=function(e){let t=``;for(let n=0;n<e.length;n+=1){let r=e.charAt(n);switch(r){case`<`:t+=`<`;break;case`>`:t+=`>`;break;case`&`:t+=`&`;break;case`"`:t+=`"`;break;default:t+=r}}return t},b=function(e){e=e===void 0?2:e;let t=c.getModuleCount()*1+e*2,n=e,r=t-e,i,a,o,s,l,u={"██":`█`,"█ ":`▀`," █":`▄`," ":` `},d={"██":`▀`,"█ ":`▀`," █":` `," ":` `},f=``;for(i=0;i<t;i+=2){for(o=Math.floor((i-n)/1),s=Math.floor((i+1-n)/1),a=0;a<t;a+=1)l=`█`,n<=a&&a<r&&n<=i&&i<r&&c.isDark(o,Math.floor((a-n)/1))&&(l=` `),n<=a&&a<r&&n<=i+1&&i+1<r&&c.isDark(s,Math.floor((a-n)/1))?l+=` `:l+=`█`,f+=e<1&&i+1>=r?d[l]:u[l];f+=`
|
|
51
|
+
`}return t%2&&e>0?f.substring(0,f.length-t-1)+Array(t+1).join(`▀`):f.substring(0,f.length-1)};return c.createASCII=function(e,t){if(e||=1,e<2)return b(t);--e,t=t===void 0?e*2:t;let n=c.getModuleCount()*e+t*2,r=t,i=n-t,a,o,s,l,u=Array(e+1).join(`██`),d=Array(e+1).join(` `),f=``,p=``;for(a=0;a<n;a+=1){for(s=Math.floor((a-r)/e),p=``,o=0;o<n;o+=1)l=1,r<=o&&o<i&&r<=a&&a<i&&c.isDark(s,Math.floor((o-r)/e))&&(l=0),p+=l?u:d;for(s=0;s<e;s+=1)f+=p+`
|
|
52
|
+
`}return f.substring(0,f.length-1)},c.renderTo2dContext=function(e,t){t||=2;let n=c.getModuleCount();for(let r=0;r<n;r++)for(let i=0;i<n;i++)e.fillStyle=c.isDark(r,i)?`black`:`white`,e.fillRect(i*t,r*t,t,t)},c};$g.stringToBytes=function(e){let t=[];for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);t.push(r&255)}return t},$g.createStringToBytes=function(e,t){let n=function(){let n=m_(e),r=function(){let e=n.read();if(e==-1)throw`eof`;return e},i=0,a={};for(;;){let e=n.read();if(e==-1)break;let t=r(),o=r(),s=r(),c=String.fromCharCode(e<<8|t);a[c]=o<<8|s,i+=1}if(i!=t)throw i+` != `+t;return a}();return function(e){let t=[];for(let r=0;r<e.length;r+=1){let i=e.charCodeAt(r);if(i<128)t.push(i);else{let i=n[e.charAt(r)];typeof i==`number`?(i&255)==i?t.push(i):(t.push(i>>>8),t.push(i&255)):t.push(63)}}return t}};var e_={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},t_={L:1,M:0,Q:3,H:2},n_={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},r_=function(){let e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t=1335,n=7973,r={},i=function(e){let t=0;for(;e!=0;)t+=1,e>>>=1;return t};return r.getBCHTypeInfo=function(e){let n=e<<10;for(;i(n)-i(t)>=0;)n^=t<<i(n)-i(t);return(e<<10|n)^21522},r.getBCHTypeNumber=function(e){let t=e<<12;for(;i(t)-i(n)>=0;)t^=n<<i(t)-i(n);return e<<12|t},r.getPatternPosition=function(t){return e[t-1]},r.getMaskFunction=function(e){switch(e){case n_.PATTERN000:return function(e,t){return(e+t)%2==0};case n_.PATTERN001:return function(e,t){return e%2==0};case n_.PATTERN010:return function(e,t){return t%3==0};case n_.PATTERN011:return function(e,t){return(e+t)%3==0};case n_.PATTERN100:return function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0};case n_.PATTERN101:return function(e,t){return e*t%2+e*t%3==0};case n_.PATTERN110:return function(e,t){return(e*t%2+e*t%3)%2==0};case n_.PATTERN111:return function(e,t){return(e*t%3+(e+t)%2)%2==0};default:throw`bad maskPattern:`+e}},r.getErrorCorrectPolynomial=function(e){let t=a_([1],0);for(let n=0;n<e;n+=1)t=t.multiply(a_([1,i_.gexp(n)],0));return t},r.getLengthInBits=function(e,t){if(1<=t&&t<10)switch(e){case e_.MODE_NUMBER:return 10;case e_.MODE_ALPHA_NUM:return 9;case e_.MODE_8BIT_BYTE:return 8;case e_.MODE_KANJI:return 8;default:throw`mode:`+e}else if(t<27)switch(e){case e_.MODE_NUMBER:return 12;case e_.MODE_ALPHA_NUM:return 11;case e_.MODE_8BIT_BYTE:return 16;case e_.MODE_KANJI:return 10;default:throw`mode:`+e}else if(t<41)switch(e){case e_.MODE_NUMBER:return 14;case e_.MODE_ALPHA_NUM:return 13;case e_.MODE_8BIT_BYTE:return 16;case e_.MODE_KANJI:return 12;default:throw`mode:`+e}else throw`type:`+t},r.getLostPoint=function(e){let t=e.getModuleCount(),n=0;for(let r=0;r<t;r+=1)for(let i=0;i<t;i+=1){let a=0,o=e.isDark(r,i);for(let n=-1;n<=1;n+=1)if(!(r+n<0||t<=r+n))for(let s=-1;s<=1;s+=1)i+s<0||t<=i+s||(n!=0||s!=0)&&o==e.isDark(r+n,i+s)&&(a+=1);a>5&&(n+=3+a-5)}for(let r=0;r<t-1;r+=1)for(let i=0;i<t-1;i+=1){let t=0;e.isDark(r,i)&&(t+=1),e.isDark(r+1,i)&&(t+=1),e.isDark(r,i+1)&&(t+=1),e.isDark(r+1,i+1)&&(t+=1),(t==0||t==4)&&(n+=3)}for(let r=0;r<t;r+=1)for(let i=0;i<t-6;i+=1)e.isDark(r,i)&&!e.isDark(r,i+1)&&e.isDark(r,i+2)&&e.isDark(r,i+3)&&e.isDark(r,i+4)&&!e.isDark(r,i+5)&&e.isDark(r,i+6)&&(n+=40);for(let r=0;r<t;r+=1)for(let i=0;i<t-6;i+=1)e.isDark(i,r)&&!e.isDark(i+1,r)&&e.isDark(i+2,r)&&e.isDark(i+3,r)&&e.isDark(i+4,r)&&!e.isDark(i+5,r)&&e.isDark(i+6,r)&&(n+=40);let r=0;for(let n=0;n<t;n+=1)for(let i=0;i<t;i+=1)e.isDark(i,n)&&(r+=1);let i=Math.abs(100*r/t/t-50)/5;return n+=i*10,n},r}(),i_=function(){let e=Array(256),t=Array(256);for(let t=0;t<8;t+=1)e[t]=1<<t;for(let t=8;t<256;t+=1)e[t]=e[t-4]^e[t-5]^e[t-6]^e[t-8];for(let n=0;n<255;n+=1)t[e[n]]=n;let n={};return n.glog=function(e){if(e<1)throw`glog(`+e+`)`;return t[e]},n.gexp=function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return e[t]},n}(),a_=function(e,t){if(e.length===void 0)throw e.length+`/`+t;let n=function(){let n=0;for(;n<e.length&&e[n]==0;)n+=1;let r=Array(e.length-n+t);for(let t=0;t<e.length-n;t+=1)r[t]=e[t+n];return r}(),r={};return r.getAt=function(e){return n[e]},r.getLength=function(){return n.length},r.multiply=function(e){let t=Array(r.getLength()+e.getLength()-1);for(let n=0;n<r.getLength();n+=1)for(let i=0;i<e.getLength();i+=1)t[n+i]^=i_.gexp(i_.glog(r.getAt(n))+i_.glog(e.getAt(i)));return a_(t,0)},r.mod=function(e){if(r.getLength()-e.getLength()<0)return r;let t=i_.glog(r.getAt(0))-i_.glog(e.getAt(0)),n=Array(r.getLength());for(let e=0;e<r.getLength();e+=1)n[e]=r.getAt(e);for(let r=0;r<e.getLength();r+=1)n[r]^=i_.gexp(i_.glog(e.getAt(r))+t);return a_(n,0).mod(e)},r},o_=function(){let e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(e,t){let n={};return n.totalCount=e,n.dataCount=t,n},n={},r=function(t,n){switch(n){case t_.L:return e[(t-1)*4+0];case t_.M:return e[(t-1)*4+1];case t_.Q:return e[(t-1)*4+2];case t_.H:return e[(t-1)*4+3];default:return}};return n.getRSBlocks=function(e,n){let i=r(e,n);if(i===void 0)throw`bad rs block @ typeNumber:`+e+`/errorCorrectionLevel:`+n;let a=i.length/3,o=[];for(let e=0;e<a;e+=1){let n=i[e*3+0],r=i[e*3+1],a=i[e*3+2];for(let e=0;e<n;e+=1)o.push(t(r,a))}return o},n}(),s_=function(){let e=[],t=0,n={};return n.getBuffer=function(){return e},n.getAt=function(t){let n=Math.floor(t/8);return(e[n]>>>7-t%8&1)==1},n.put=function(e,t){for(let r=0;r<t;r+=1)n.putBit((e>>>t-r-1&1)==1)},n.getLengthInBits=function(){return t},n.putBit=function(n){let r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1},n},c_=function(e){let t=e_.MODE_NUMBER,n=e,r={};r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){let t=n,r=0;for(;r+2<t.length;)e.put(i(t.substring(r,r+3)),10),r+=3;r<t.length&&(t.length-r==1?e.put(i(t.substring(r,r+1)),4):t.length-r==2&&e.put(i(t.substring(r,r+2)),7))};let i=function(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*10+a(e.charAt(n));return t},a=function(e){if(`0`<=e&&e<=`9`)return e.charCodeAt(0)-48;throw`illegal char :`+e};return r},l_=function(e){let t=e_.MODE_ALPHA_NUM,n=e,r={};r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){let t=n,r=0;for(;r+1<t.length;)e.put(i(t.charAt(r))*45+i(t.charAt(r+1)),11),r+=2;r<t.length&&e.put(i(t.charAt(r)),6)};let i=function(e){if(`0`<=e&&e<=`9`)return e.charCodeAt(0)-48;if(`A`<=e&&e<=`Z`)return e.charCodeAt(0)-65+10;switch(e){case` `:return 36;case`$`:return 37;case`%`:return 38;case`*`:return 39;case`+`:return 40;case`-`:return 41;case`.`:return 42;case`/`:return 43;case`:`:return 44;default:throw`illegal char :`+e}};return r},u_=function(e){let t=e_.MODE_8BIT_BYTE,n=$g.stringToBytes(e),r={};return r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){for(let t=0;t<n.length;t+=1)e.put(n[t],8)},r},d_=function(e){let t=e_.MODE_KANJI,n=$g.stringToBytes;(function(e,t){let r=n(e);if(r.length!=2||(r[0]<<8|r[1])!=t)throw`sjis not supported.`})(`友`,38726);let r=n(e),i={};return i.getMode=function(){return t},i.getLength=function(e){return~~(r.length/2)},i.write=function(e){let t=r,n=0;for(;n+1<t.length;){let r=(255&t[n])<<8|255&t[n+1];if(33088<=r&&r<=40956)r-=33088;else if(57408<=r&&r<=60351)r-=49472;else throw`illegal char at `+(n+1)+`/`+r;r=(r>>>8&255)*192+(r&255),e.put(r,13),n+=2}if(n<t.length)throw`illegal char at `+(n+1)},i},f_=function(){let e=[],t={};return t.writeByte=function(t){e.push(t&255)},t.writeShort=function(e){t.writeByte(e),t.writeByte(e>>>8)},t.writeBytes=function(e,n,r){n||=0,r||=e.length;for(let i=0;i<r;i+=1)t.writeByte(e[i+n])},t.writeString=function(e){for(let n=0;n<e.length;n+=1)t.writeByte(e.charCodeAt(n))},t.toByteArray=function(){return e},t.toString=function(){let t=``;t+=`[`;for(let n=0;n<e.length;n+=1)n>0&&(t+=`,`),t+=e[n];return t+=`]`,t},t},p_=function(){let e=0,t=0,n=0,r=``,i={},a=function(e){r+=String.fromCharCode(o(e&63))},o=function(e){if(e<0)throw`n:`+e;if(e<26)return 65+e;if(e<52)return 97+(e-26);if(e<62)return 48+(e-52);if(e==62)return 43;if(e==63)return 47;throw`n:`+e};return i.writeByte=function(r){for(e=e<<8|r&255,t+=8,n+=1;t>=6;)a(e>>>t-6),t-=6},i.flush=function(){if(t>0&&(a(e<<6-t),e=0,t=0),n%3!=0){let e=3-n%3;for(let t=0;t<e;t+=1)r+=`=`}},i.toString=function(){return r},i},m_=function(e){let t=e,n=0,r=0,i=0,a={};a.read=function(){for(;i<8;){if(n>=t.length){if(i==0)return-1;throw`unexpected end of file./`+i}let e=t.charAt(n);if(n+=1,e==`=`)return i=0,-1;e.match(/^\s$/)||(r=r<<6|o(e.charCodeAt(0)),i+=6)}let e=r>>>i-8&255;return i-=8,e};let o=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(e==43)return 62;if(e==47)return 63;throw`c:`+e};return a},h_=function(e,t){let n=e,r=t,i=Array(e*t),a={};a.setPixel=function(e,t,r){i[t*n+e]=r},a.write=function(e){e.writeString(`GIF87a`),e.writeShort(n),e.writeShort(r),e.writeByte(128),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(255),e.writeByte(255),e.writeByte(255),e.writeString(`,`),e.writeShort(0),e.writeShort(0),e.writeShort(n),e.writeShort(r),e.writeByte(0);let t=s(2);e.writeByte(2);let i=0;for(;t.length-i>255;)e.writeByte(255),e.writeBytes(t,i,255),i+=255;e.writeByte(t.length-i),e.writeBytes(t,i,t.length-i),e.writeByte(0),e.writeString(`;`)};let o=function(e){let t=e,n=0,r=0,i={};return i.write=function(e,i){if(e>>>i)throw`length over`;for(;n+i>=8;)t.writeByte(255&(e<<n|r)),i-=8-n,e>>>=8-n,r=0,n=0;r=e<<n|r,n+=i},i.flush=function(){n>0&&t.writeByte(r)},i},s=function(e){let t=1<<e,n=(1<<e)+1,r=e+1,a=c();for(let e=0;e<t;e+=1)a.add(String.fromCharCode(e));a.add(String.fromCharCode(t)),a.add(String.fromCharCode(n));let s=f_(),l=o(s);l.write(t,r);let u=0,d=String.fromCharCode(i[u]);for(u+=1;u<i.length;){let e=String.fromCharCode(i[u]);u+=1,a.contains(d+e)?d+=e:(l.write(a.indexOf(d),r),a.size()<4095&&(a.size()==1<<r&&(r+=1),a.add(d+e)),d=e)}return l.write(a.indexOf(d),r),l.write(n,r),l.flush(),s.toByteArray()},c=function(){let e={},t=0,n={};return n.add=function(r){if(n.contains(r))throw`dup key:`+r;e[r]=t,t+=1},n.size=function(){return t},n.indexOf=function(t){return e[t]},n.contains=function(t){return e[t]!==void 0},n};return a},g_=function(e,t,n){let r=h_(e,t);for(let i=0;i<t;i+=1)for(let t=0;t<e;t+=1)r.setPixel(t,i,n(t,i));let i=f_();r.write(i);let a=p_(),o=i.toByteArray();for(let e=0;e<o.length;e+=1)a.writeByte(o[e]);return a.flush(),`data:image/gif;base64,`+a};$g.stringToBytes;function __({text:e,label:t}){let{size:n,path:r}=(0,y.useMemo)(()=>{let t=$g(0,`M`);t.addData(e),t.make();let n=t.getModuleCount(),r=``;for(let e=0;e<n;e++)for(let i=0;i<n;i++)t.isDark(e,i)&&(r+=`M${i} ${e}h1v1h-1z`);return{size:n,path:r}},[e]);return(0,b.jsx)(`svg`,{viewBox:`-3 -3 ${n+6} ${n+6}`,role:`img`,"aria-label":t,className:`size-44 rounded-md bg-white`,shapeRendering:`crispEdges`,children:(0,b.jsx)(`path`,{d:r,fill:`#000`})})}function v_(){let{t:e}=Y(),t=Wg();if(t.isPending)return(0,b.jsx)(G,{children:e(`common.loading`)});if(!t.data)return null;if(t.data.viewAs)return(0,b.jsx)(Da,{to:`/`,replace:!0});let{user:n,auth:r}=t.data;return(0,b.jsxs)(`div`,{className:`flex max-w-2xl flex-col gap-8`,children:[(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h1`,{className:`text-[22px] font-bold`,children:e(`auth.account`)}),(0,b.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[n.displayName,n.username?` · ${n.username}`:``]})]}),r.password&&(0,b.jsx)(y_,{}),r.twoFactor&&(0,b.jsx)(b_,{}),r.sessions&&(0,b.jsx)(S_,{revokeOthers:r.revokeOthers})]})}function y_(){let{t:e}=Y(),t=S(),[n,r]=(0,y.useState)(``),[i,a]=(0,y.useState)(``),[o,s]=(0,y.useState)(``),[c,l]=(0,y.useState)({}),[u,d]=(0,y.useState)(!1),f=pt({mutationFn:()=>Q.changePassword(n,i),onSuccess:async()=>{r(``),a(``),s(``),l({}),d(!0),await t.invalidateQueries({queryKey:[`account-sessions`]})},onError:e=>l(e instanceof fg&&Object.keys(e.fields).length>0?e.fields:{form:[pg(e)]})});function p(t){t.preventDefault(),d(!1);let r={};n||(r.current=[e(`validation.required`)]),i?i!==o&&(r.confirm=[e(`auth.mismatch`)]):r.next=[e(`validation.required`)],l(r),Object.keys(r).length===0&&f.mutate()}let m=(e,t,n,r,i)=>(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:`password-${e}`,children:t}),(0,b.jsx)(Oh,{id:`password-${e}`,type:`password`,autoComplete:i,value:n,onChange:e=>r(e.target.value),"aria-invalid":c[e]?!0:void 0,"aria-describedby":c[e]?`password-${e}-error`:void 0}),c[e]&&(0,b.jsx)(`p`,{id:`password-${e}-error`,className:`text-sm text-destructive`,children:c[e].join(` `)})]});return(0,b.jsxs)(`section`,{"aria-labelledby":`password-title`,className:`flex flex-col gap-4 rounded-card border bg-card shadow-card p-4`,children:[(0,b.jsx)(`h2`,{id:`password-title`,className:`font-medium`,children:e(`auth.changePassword`)}),(0,b.jsxs)(`form`,{onSubmit:p,noValidate:!0,className:`flex flex-col gap-4`,children:[c.form&&(0,b.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:c.form.join(` `)}),u&&(0,b.jsx)(`p`,{role:`status`,className:`rounded-md border border-green-600/30 bg-green-500/10 px-3 py-2 text-sm`,children:e(`auth.passwordChanged`)}),m(`current`,e(`auth.currentPassword`),n,r,`current-password`),m(`next`,e(`auth.newPassword`),i,a,`new-password`),m(`confirm`,e(`auth.confirmPassword`),o,s,`new-password`),(0,b.jsx)(`div`,{children:(0,b.jsx)(q,{type:`submit`,disabled:f.isPending,children:e(`auth.changePassword`)})})]})]})}function b_(){let{t:e}=Y(),t=S(),n=ft({queryKey:[`account-2fa`],queryFn:Q.twoFactor.status}),[r,i]=(0,y.useState)(``),[a,o]=(0,y.useState)(``),[s,c]=(0,y.useState)(null),[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)(null),[p,m]=(0,y.useState)(null),h=e=>m(e instanceof fg&&Object.keys(e.fields).length>0?Object.values(e.fields).flat().join(` `):pg(e)),g=async()=>{await t.invalidateQueries({queryKey:[`account-2fa`]}),await t.invalidateQueries({queryKey:[`account-sessions`]})},_=pt({mutationFn:Q.twoFactor.setup,onMutate:()=>m(null),onError:h}),v=pt({mutationFn:()=>Q.twoFactor.confirm(r.trim()),onMutate:()=>m(null),onSuccess:async t=>{c(t.recoveryCodes),i(``),_.reset(),f(e(`twoFactor.enabledNote`)),await g()},onError:h}),x=pt({mutationFn:()=>Q.twoFactor.recoveryCodes(a),onMutate:()=>m(null),onSuccess:async e=>{c(e.recoveryCodes),o(``),await g()},onError:h}),C=pt({mutationFn:()=>Q.twoFactor.disable(a),onMutate:()=>m(null),onSuccess:async()=>{o(``),c(null),f(e(`twoFactor.disabledNote`)),await g()},onError:h}),w=n.data?.enabled===!0,T=_.data;return(0,b.jsxs)(`section`,{"aria-labelledby":`two-factor-title`,className:`flex flex-col gap-3 rounded-card border bg-card shadow-card p-4`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,b.jsx)(`h2`,{id:`two-factor-title`,className:`font-medium`,children:e(`twoFactor.title`)}),n.data&&(0,b.jsx)(`span`,{className:w?`rounded-full bg-green-500/15 px-2 py-0.5 text-xs text-green-800 dark:text-green-300`:`rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground`,children:e(w?`twoFactor.on`:`twoFactor.off`)})]}),p&&(0,b.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:p}),d&&!p&&(0,b.jsx)(`p`,{role:`status`,className:`rounded-md border border-green-600/30 bg-green-500/10 px-3 py-2 text-sm`,children:d}),s&&(0,b.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border bg-muted/40 p-3`,children:[(0,b.jsx)(`h3`,{className:`text-sm font-medium`,children:e(`twoFactor.recoveryTitle`)}),(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`twoFactor.recoveryIntro`)}),(0,b.jsx)(`ul`,{"aria-label":e(`twoFactor.recoveryTitle`),dir:`ltr`,className:`grid grid-cols-2 gap-1 font-mono text-sm`,children:s.map(e=>(0,b.jsx)(`li`,{children:e},e))}),(0,b.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,b.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{navigator.clipboard?.writeText(s.join(`
|
|
53
|
+
`)).then(()=>u(!0),()=>void 0)},children:e(l?`twoFactor.copied`:`twoFactor.copy`)}),(0,b.jsx)(q,{type:`button`,size:`sm`,onClick:()=>{c(null),u(!1)},children:e(`twoFactor.done`)})]})]}),n.data&&!w&&!T&&(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`twoFactor.intro`)}),(0,b.jsx)(q,{type:`button`,variant:`outline`,disabled:_.isPending,onClick:()=>_.mutate(),children:e(`twoFactor.setUp`)})]}),!w&&T&&(0,b.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),r.trim()&&v.mutate()},children:[(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`twoFactor.scan`)}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-start gap-4`,children:[(0,b.jsx)(__,{text:T.otpauthUrl,label:e(`twoFactor.qr`)}),(0,b.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1 text-sm`,children:[(0,b.jsx)(`span`,{className:`text-muted-foreground`,children:e(`twoFactor.key`)}),(0,b.jsx)(`code`,{dir:`ltr`,"data-testid":`two-factor-key`,className:`break-all font-mono`,children:T.secret.match(/.{1,4}/g).join(` `)})]})]}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2`,children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:`two-factor-code`,children:e(`twoFactor.code`)}),(0,b.jsx)(Oh,{id:`two-factor-code`,autoComplete:`one-time-code`,inputMode:`numeric`,dir:`ltr`,maxLength:10,value:r,onChange:e=>i(e.target.value)})]}),(0,b.jsx)(q,{type:`submit`,disabled:v.isPending||!r.trim(),children:e(`twoFactor.turnOn`)}),(0,b.jsx)(q,{type:`button`,variant:`ghost`,onClick:()=>_.reset(),children:e(`common.cancel`)})]})]}),w&&(0,b.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`twoFactor.left`,{count:n.data.recoveryCodesLeft})}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2`,children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:`two-factor-password`,children:e(`twoFactor.password`)}),(0,b.jsx)(Oh,{id:`two-factor-password`,type:`password`,autoComplete:`current-password`,value:a,onChange:e=>o(e.target.value)})]}),(0,b.jsx)(q,{type:`button`,variant:`outline`,disabled:!a||x.isPending,onClick:()=>x.mutate(),children:e(`twoFactor.newCodes`)}),(0,b.jsx)(q,{type:`button`,variant:`destructive`,disabled:!a||C.isPending,onClick:()=>C.mutate(),children:e(`twoFactor.turnOff`)})]})]})]})}function x_(e,t){return e?[/Edg\//.test(e)?`Edge`:/Firefox\//.test(e)?`Firefox`:/Chrome\//.test(e)?`Chrome`:/Safari\//.test(e)?`Safari`:void 0,/Android/.test(e)?`Android`:/iPhone|iPad/.test(e)?`iOS`:/Mac OS X/.test(e)?`macOS`:/Windows/.test(e)?`Windows`:/Linux/.test(e)?`Linux`:void 0].filter(Boolean).join(` · `)||e.slice(0,40):t}function S_({revokeOthers:e}){let{t}=Y(),n=S(),r=ft({queryKey:[`account-sessions`],queryFn:Q.sessions}),i=()=>n.invalidateQueries({queryKey:[`account-sessions`]}),a=pt({mutationFn:e=>Q.revokeSession(e),onSuccess:i}),o=pt({mutationFn:()=>Q.revokeOtherSessions(),onSuccess:i}),s=r.data?.items??[],c=a.error??o.error??r.error;return(0,b.jsxs)(`section`,{"aria-labelledby":`sessions-title`,className:`flex flex-col gap-3 rounded-card border bg-card shadow-card p-4`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,b.jsx)(`h2`,{id:`sessions-title`,className:`font-medium`,children:t(`auth.sessions`)}),e&&s.length>1&&(0,b.jsx)(q,{variant:`outline`,size:`sm`,disabled:o.isPending,onClick:()=>o.mutate(),children:t(`auth.signOutOthers`)})]}),c&&(0,b.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:pg(c)}),(0,b.jsx)(`ul`,{"aria-label":t(`auth.sessions`),className:`flex flex-col divide-y`,children:s.map(e=>(0,b.jsxs)(`li`,{className:`flex flex-wrap items-center justify-between gap-2 py-2 text-sm`,children:[(0,b.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,b.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,title:e.userAgent,children:[x_(e.userAgent,t(`auth.unknownDevice`)),e.current&&(0,b.jsx)(`span`,{className:`rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary`,children:t(`auth.thisDevice`)})]}),(0,b.jsxs)(`span`,{className:`text-muted-foreground`,children:[t(`auth.lastSeen`,{when:ng(new Date(e.lastSeenAt))}),e.ip?` · ${e.ip}`:``]})]}),!e.current&&(0,b.jsx)(q,{variant:`outline`,size:`sm`,disabled:a.isPending,onClick:()=>a.mutate(e.id),"aria-label":t(`auth.revokeSession`,{name:x_(e.userAgent,t(`auth.unknownDevice`))}),children:t(`auth.revoke`)})]},e.id))})]})}function C_(e,t){return e==null?``:typeof e==`string`?e:e[t]??e[dg.locale]??Object.values(e)[0]??``}function w_(e){let t=Object.fromEntries(Object.entries(e).filter(([,e])=>e.trim()!==``).map(([e,t])=>[e,t.trim()])),n=Object.keys(t);if(n.length!==0)return dg.locales.length===1?t[n[0]]:t}function T_(e){let t=Object.fromEntries(dg.locales.map(e=>[e,``]));return typeof e==`string`?t[dg.locale]=e:e&&Object.assign(t,e),t}function E_({children:e,actions:t}){return(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,b.jsx)(`h1`,{className:`text-[22px] font-bold`,children:e}),(0,b.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:t})]})}function D_({children:e,tone:t=`error`}){return(0,b.jsx)(`p`,{role:t===`error`?`alert`:`status`,className:t===`error`?`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`:`rounded-md border border-green-600/30 bg-green-500/10 px-3 py-2 text-sm`,children:e})}var O_=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function k_(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:O_(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var A_=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},j_=e=>{let t=A_(e);return t.charAt(0).toUpperCase()+t.slice(1)},M_=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),N_={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 P_(e){return e!=null}function F_(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??N_.width,a=e.size??e.height??N_.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?M_(...c):M_(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??N_[`stroke-width`])*Number(e.size??e.width??N_.width)/Number(t.size??t.width??N_.width):t.strokeWidth??N_[`stroke-width`];return[`svg`,{...Object.entries(N_).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&P_(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&P_(t.width)&&{[r(`width`)]:t.width},...`height`in t&&P_(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 I_(e,t={}){return F_(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var L_=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},R_=(0,y.createContext)({}),z_=()=>(0,y.useContext)(R_),B_=(0,y.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:_=`currentColor`,className:v=``}=z_()??{},b=!!c||L_(d),[x,S,C=[]]=I_(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:M_(v,s),hasA11yProp:b,attributes:d});return(0,y.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,y.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function $(e,t=[],n=[]){let r=typeof e==`string`?k_(e,t,n):e,i=(0,y.forwardRef)(({className:e,...t},n)=>(0,y.createElement)(B_,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=j_(r.name)),i}var V_={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`}]]};V_.node;var H_=$(V_),U_={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`}]]};U_.node;var W_=$(U_),G_={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};G_.node;var K_=$(G_),q_={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};q_.node;var J_=$(q_),Y_={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Y_.node;var X_=$(Y_),Z_={name:`ban`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]};Z_.node;var Q_=$(Z_),$_={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};$_.node;var ev=$($_),tv={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]};tv.node;var nv=$(tv),rv={name:`box`,size:24,node:[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]};rv.node;var iv=$(rv),av={name:`boxes`,size:24,node:[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]};av.node;var ov=$(av),sv={name:`briefcase`,size:24,node:[[`path`,{d:`M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16`,key:`jecpp`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]};sv.node;var cv=$(sv),lv={name:`building-complex`,size:24,node:[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]],aliases:[`building-2`]};lv.node;var uv=$(lv),dv={name:`calendar-days`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 13h.01`,key:`1sbv64`}],[`path`,{d:`M12 13h.01`,key:`y0uutt`}],[`path`,{d:`M16 13h.01`,key:`wip0gl`}],[`path`,{d:`M8 17h.01`,key:`p3bg7i`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M16 17h.01`,key:`ql8jdd`}]]};dv.node;var fv=$(dv),pv={name:`calendar-range`,size:24,node:[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M17 13h-6`,key:`1qbiup`}],[`path`,{d:`M13 17H7`,key:`1x38vv`}],[`path`,{d:`M7 13h.01`,key:`1vezk1`}],[`path`,{d:`M17 17h.01`,key:`1sd3ek`}]]};pv.node;var mv=$(pv),hv={name:`calendar`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};hv.node;var gv=$(hv),_v={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};_v.node;var vv=$(_v),yv={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};yv.node;var bv=$(yv),xv={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};xv.node;var Sv=$(xv),Cv={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};Cv.node;var wv=$(Cv),Tv={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Tv.node;var Ev=$(Tv),Dv={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};Dv.node;var Ov=$(Dv),kv={name:`circle-plus`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]],aliases:[`plus-circle`]};kv.node;var Av=$(kv),jv={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};jv.node;var Mv=$(jv),Nv={name:`columns-3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]],aliases:[`panels-left-right`]};Nv.node;var Pv=$(Nv),Fv={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`}]]};Fv.node;var Iv=$(Fv),Lv={name:`credit-card`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`2`,key:`ynyp8z`}],[`line`,{x1:`2`,x2:`22`,y1:`10`,y2:`10`,key:`1b3vmo`}],[`path`,{d:`M6 14h2`,key:`mk7k0u`}]]};Lv.node;var Rv=$(Lv),zv={name:`database`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]};zv.node;var Bv=$(zv),Vv={name:`dollar-sign`,size:24,node:[[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`22`,key:`7eqyqh`}],[`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`,key:`1b0p4s`}]]};Vv.node;var Hv=$(Vv),Uv={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`}]]};Uv.node;var Wv=$(Uv),Gv={name:`ellipsis-vertical`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]],aliases:[`more-vertical`]};Gv.node;var Kv=$(Gv),qv={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`]};qv.node;var Jv=$(qv),Yv={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};Yv.node;var Xv=$(Yv),Zv={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`}]]};Zv.node;var Qv=$(Zv),$v={name:`file-spreadsheet`,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:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]};$v.node;var ey=$($v),ty={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`}]]};ty.node;var ny=$(ty),ry={name:`file`,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`}]]};ry.node;var iy=$(ry),ay={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`}]]};ay.node;var oy=$(ay),sy={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};sy.node;var cy=$(sy),ly={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};ly.node;var uy=$(ly),dy={name:`heart`,size:24,node:[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]};dy.node;var fy=$(dy),py={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`]};py.node;var my=$(py),hy={name:`image-off`,size:24,node:[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]};hy.node;var gy=$(hy),_y={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`}]]};_y.node;var vy=$(_y),yy={name:`inbox`,size:24,node:[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]};yy.node;var by=$(yy),xy={name:`key`,size:24,node:[[`path`,{d:`m2 21 9.6-9.6`,key:`9l79m3`}],[`path`,{d:`m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19`,key:`fw8biw`}],[`circle`,{cx:`15.5`,cy:`7.5`,r:`5.5`,key:`4wxmhb`}]]};xy.node;var Sy=$(xy),Cy={name:`languages`,size:24,node:[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]};Cy.node;var wy=$(Cy),Ty={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};Ty.node;var Ey=$(Ty),Dy={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};Dy.node;var Oy=$(Dy),ky={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`}]]};ky.node;var Ay=$(ky),jy={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};jy.node;var My=$(jy),Ny={name:`list-filter`,size:24,node:[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]};Ny.node;var Py=$(Ny),Fy={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`}]]};Fy.node;var Iy=$(Fy),Ly={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`}]]};Ly.node;var Ry=$(Ly),zy={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};zy.node;var By=$(zy),Vy={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};Vy.node;var Hy=$(Vy),Uy={name:`map-pin`,size:24,node:[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]};Uy.node;var Wy=$(Uy),Gy={name:`map`,size:24,node:[[`path`,{d:`M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z`,key:`169xi5`}],[`path`,{d:`M15 5.764v15`,key:`1pn4in`}],[`path`,{d:`M9 3.236v15`,key:`1uimfh`}]]};Gy.node;var Ky=$(Gy),qy={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};qy.node;var Jy=$(qy),Yy={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`}]]};Yy.node;var Xy=$(Yy),Zy={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`}]]};Zy.node;var Qy=$(Zy),$y={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`}]]};$y.node;var eb=$($y),tb={name:`package`,size:24,node:[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]};tb.node;var nb=$(tb),rb={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};rb.node;var ib=$(rb),ab={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`}]]};ab.node;var ob=$(ab),sb={name:`phone`,size:24,node:[[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]};sb.node;var cb=$(sb),lb={name:`pin-off`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]};lb.node;var ub=$(lb),db={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`}]]};db.node;var fb=$(db),pb={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};pb.node;var mb=$(pb),hb={name:`printer`,size:24,node:[[`path`,{d:`M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2`,key:`143wyd`}],[`path`,{d:`M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6`,key:`1itne7`}],[`rect`,{x:`6`,y:`14`,width:`12`,height:`8`,rx:`1`,key:`1ue0tg`}]]};hb.node;var gb=$(hb),_b={name:`receipt`,size:24,node:[[`path`,{d:`M12 17V7`,key:`pyj7ub`}],[`path`,{d:`M16 8h-6a2 2 0 0 0 0 4h4a2 2 0 0 1 0 4H8`,key:`1elt7d`}],[`path`,{d:`M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z`,key:`ycz6yz`}]]};_b.node;var vb=$(_b),yb={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};yb.node;var bb=$(yb),xb={name:`rotate-ccw-clock`,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`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};xb.node;var Sb=$(xb),Cb={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`}]]};Cb.node;var wb=$(Cb),Tb={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Tb.node;var Eb=$(Tb),Db={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};Db.node;var Ob=$(Db),kb={name:`server`,size:24,node:[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]};kb.node;var Ab=$(kb),jb={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};jb.node;var Mb=$(jb),Nb={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};Nb.node;var Pb=$(Nb),Fb={name:`shield`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]};Fb.node;var Ib=$(Fb),Lb={name:`shopping-bag`,size:24,node:[[`path`,{d:`M16 10a4 4 0 0 1-8 0`,key:`1ltviw`}],[`path`,{d:`M3.103 6.034h17.794`,key:`awc11p`}],[`path`,{d:`M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z`,key:`o988cm`}]]};Lb.node;var Rb=$(Lb),zb={name:`shopping-cart`,size:24,node:[[`path`,{d:`m2.05 2.05 1.099-.028a1 1 0 0 1 1.008.815l2.69 14.347A1 1 0 0 0 7.83 18H18`,key:`uebgi3`}],[`path`,{d:`M4.563 5h16.435a1 1 0 0 1 .981 1.204l-1.026 6.226A2 2 0 0 1 18.962 14H6.25`,key:`1j7c9p`}],[`circle`,{cx:`18`,cy:`20`,r:`2`,key:`t9985n`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]};zb.node;var Bb=$(zb),Vb={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};Vb.node;var Hb=$(Vb),Ub={name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]};Ub.node;var Wb=$(Ub),Gb={name:`store`,size:24,node:[[`path`,{d:`M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5`,key:`slp6dd`}],[`path`,{d:`M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244`,key:`o0xfot`}],[`path`,{d:`M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05`,key:`wn3emo`}]]};Gb.node;var Kb=$(Gb),qb={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`}]]};qb.node;var Jb=$(qb),Yb={name:`tag`,size:24,node:[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]};Yb.node;var Xb=$(Yb),Zb={name:`tags`,size:24,node:[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]};Zb.node;var Qb=$(Zb),$b={name:`ticket`,size:24,node:[[`path`,{d:`M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z`,key:`qn84l0`}],[`path`,{d:`M13 5v2`,key:`dyzc3o`}],[`path`,{d:`M13 17v2`,key:`1ont0d`}],[`path`,{d:`M13 11v2`,key:`1wjjxi`}]]};$b.node;var ex=$($b),tx={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`]};tx.node;var nx=$(tx),rx={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`]};rx.node;var ix=$(rx),ax={name:`truck`,size:24,node:[[`path`,{d:`M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2`,key:`wrbu53`}],[`path`,{d:`M15 18H9`,key:`1lyqi6`}],[`path`,{d:`M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14`,key:`lysw3i`}],[`circle`,{cx:`17`,cy:`18`,r:`2`,key:`332jqn`}],[`circle`,{cx:`7`,cy:`18`,r:`2`,key:`19iecd`}]]};ax.node;var ox=$(ax),sx={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};sx.node;var cx=$(sx),lx={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`]};lx.node;var ux=$(lx),dx={name:`user`,size:24,node:[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]};dx.node;var fx=$(dx),px={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};px.node;var mx=$(px),hx={name:`video`,size:24,node:[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]};hx.node;var gx=$(hx),_x={name:`wallet`,size:24,node:[[`path`,{d:`M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1`,key:`18etb6`}],[`path`,{d:`M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4`,key:`xoc0q4`}]]};_x.node;var vx=$(_x),yx={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};yx.node;var bx=$(yx),xx={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};xx.node;var Sx=$(xx),Cx={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};Cx.node;var wx=$(Cx),Tx=/^(-?)(\d+)(?:\.(\d*))?$/,Ex=/^-?\d{1,3}(,\d{3})+(\.\d*)?$/;function Dx(e,t){let n=Nh(e).trim(),r=Tx.exec(Ex.test(n)?n.replace(/,/g,``):n);if(!r)return e;let[,i,a,o]=r,s=a.replace(/^0+(?=\d)/,``).replace(/\B(?=(\d{3})+$)/g,`,`),c=t===void 0?o??``:(o??``).padEnd(t,`0`);return`${i}${s}${c?`.${c}`:``}`}var Ox;function kx(e){Ox=e}function Ax(){if(!Ox)return;let{unit:e,position:t}=Ox,n=Yh(),r=typeof e==`string`?e:e[n]??e[n.split(`-`)[0]]??Object.values(e)[0];return r?{unit:r,position:t}:void 0}function jx(e,t={}){let n=t.currency??Ax(),r=e=>tg(Dx(e,t.scale));return{main:r(e),...n?{unit:n.unit,position:n.position}:{},...t.previous===void 0?{}:{previous:r(t.previous)}}}function Mx(e){return e.unit?e.position===`before`?`${e.unit} ${e.main}`:`${e.main} ${e.unit}`:e.main}function Nx(e,t){if(e==null)return`—`;if(t.type===`relation`){let t=Array.isArray(e)?e:[e];return t.length===0?`—`:t.map(e=>String(e.title)).join(`, `)}if(t.file)return(Array.isArray(e)?e:[e]).map(e=>String(e).split(`/`).pop()).join(`, `)||`—`;if(t.widget===`richtext`)return Fx(String(e))||`—`;if(t.type===`boolean`)return J(e?`common.yes`:`common.no`);if(t.type===`enum`)return t.enumLabels?.[String(e)]??String(e);if(t.widget===`money`)return Mx(jx(String(e),{currency:t.currency,scale:t.scale}));if(t.type===`number`||t.type===`decimal`||t.type===`bigint`)return tg(String(e));if(t.type===`date`)return ig(String(e));if(t.type===`json`||t.type===`object`)return JSON.stringify(e);if(t.type===`datetime`){let t=new Date(String(e));return Number.isNaN(t.getTime())?String(e):ng(t)}return String(e)}var Px={amp:`&`,lt:`<`,gt:`>`,quot:`"`,"#39":`'`,nbsp:` `};function Fx(e,t=120){let n=e.replace(/<[^>]*>/g,` `).replace(/&(amp|lt|gt|quot|#39|nbsp);/g,(e,t)=>Px[t]).replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t).trimEnd()}…`:n}function Ix(e,t){let n=e?.groups??[];return{resource:e=>t(e)?.label??n.flatMap(e=>e.resources).find(t=>t.name===e)?.label,page:e=>n.flatMap(e=>e.pages).find(t=>t.name===e)?.label,action:(e,n)=>t(e)?.actions?.find(e=>e.name===n)?.label,softDelete:e=>t(e)?.softDelete}}var Lx={created:`audit.event.created`,updated:`audit.event.updated`,deleted:`audit.event.deleted`,restored:`audit.event.restored`,purged:`audit.event.purged`},Rx={"auth.login":`audit.event.login`,"auth.logout":`audit.event.logout`,"auth.view_as":`audit.event.viewAs`,"auth.password_changed":`audit.event.passwordChanged`,"auth.two_factor_enabled":`audit.event.twoFactorEnabled`,"auth.two_factor_disabled":`audit.event.twoFactorDisabled`,"auth.recovery_codes_regenerated":`audit.event.recoveryCodes`,"rbac.role.changed":`audit.event.roleChanged`,"rbac.group.changed":`audit.event.groupChanged`,"rbac.user_roles.changed":`audit.event.userRolesChanged`,"rbac.user.created":`audit.event.userCreated`,"rbac.user.changed":`audit.event.userChanged`,"rbac.user.password_reset":`audit.event.passwordReset`,"rbac.user.two_factor_reset":`audit.event.twoFactorReset`},zx={WRONG_CODE:`audit.event.loginFailedCode`,RATE_LIMITED:`audit.event.loginFailedLimited`};function Bx(e){return e.event.startsWith(`*.`)||e.event.startsWith(`page.*.`)}function Vx(e){return e.resource!==void 0&&e.event.startsWith(`${e.resource}.`)?e.event.slice(e.resource.length+1):void 0}var Hx=/^page\.(.+)\.updated$/;function Ux(e,t={}){if(Bx(e))return J(`audit.event.unseen`);let n=Vx(e);if(n!==void 0){if(n.startsWith(`action.`)&&n.length>7){let r=n.slice(7);return J(`audit.event.action`,{action:t.action?.(e.resource,r)??r})}if(n===`deleted`&&t.softDelete?.(e.resource))return J(`audit.event.trashed`);let r=Lx[n];return r?J(r):e.event}let r=Hx.exec(e.event)?.[1];if(r!==void 0)return J(`audit.event.page`,{page:t.page?.(r)??r});if(e.event===`auth.login_failed`){let t=e.meta?.reason;return t===`SUPPRESSED`?J(`audit.event.loginFailedMore`,{count:e.meta?.suppressed??0}):J(t&&zx[t]||`audit.event.loginFailed`)}if(e.event===`auth.sessions_revoked`){let t=e.meta?.sessions;return J(t===`others`?`audit.event.sessionsOthers`:t===`one`?`audit.event.sessionsOne`:`audit.event.sessions`)}let i=Rx[e.event];return i?J(i):e.event}function Wx(e){if(e.event===`auth.login_failed`){if(e.meta?.reason===`SUPPRESSED`)return J(`audit.suppressedNote`);if(e.meta?.limited)return J(`audit.limitedNote`)}if(e.meta?.action!==void 0&&e.meta.deleted)return J(`audit.actionDeleted`)}function Gx(e,t={}){if(!Bx(e)){if(e.resource!==void 0){let n=t.resource?.(e.resource)??e.resource;return e.recordId===void 0?n:e.recordTitle!==void 0&&e.recordTitle!==``?`${n}: ${e.recordTitle}`:`${n} #${e.recordId}`}if(e.recordTitle!==void 0&&e.recordTitle!==``)return e.recordTitle;if(e.recordId!==void 0)return e.recordId;if(e.event===`auth.login_failed`&&e.meta?.username)return e.meta.username}}function Kx(e){if(e.restricted&&!Bx(e))return J(e.resource===void 0?`audit.restrictedChanges`:`audit.restrictedRecord`)}function qx(e,t,n){let r={field:e.field,label:t?.label??e.field};if(`hidden`in e&&e.hidden)return{...r,state:`hidden`,truncated:!1};if(`changed`in e&&e.changed)return{...r,state:`changed`,truncated:!1};let i=e,a=i.truncated===!0;return a&&!(`before`in i)&&!(`after`in i)?{...r,state:`dropped`,truncated:a}:{...r,state:`values`,before:`before`in i&&i.before!==void 0?Zx(i.before,t,n):void 0,after:`after`in i&&i.after!==void 0?Zx(i.after,t,n):void 0,truncated:a}}var Jx=`—`,Yx=1e5;function Xx(e){return e==null||e===``?Jx:typeof e==`boolean`?J(e?`common.yes`:`common.no`):typeof e==`string`?e:Array.isArray(e)?e.length===0?Jx:e.every(e=>typeof e!=`object`||!e)?e.map(String).join(`, `):JSON.stringify(e):typeof e==`object`?JSON.stringify(e):String(e)}function Zx(e,t,n){if(e==null||e===``)return Jx;if(!t)return Xx(e);if(t.type===`relation`){let t=Array.isArray(e)?e:[e],r=e=>typeof e==`object`&&e?e.id:e;if(t.some(e=>![`string`,`number`,`bigint`].includes(typeof r(e))))return Xx(e);let i=t.map(e=>String(r(e)));return i.length===0?Jx:i.map(e=>{let t=n?.(e);return t!==void 0&&t!==``&&t!==`#${e}`?`${t} (#${e})`:`#${e}`}).join(`, `)}return t.file?typeof e==`string`||Array.isArray(e)?Nx(e,t):Xx(e):t.type===`json`||t.type===`object`?typeof e==`string`?e:JSON.stringify(e):typeof e==`object`?Xx(e):t.widget===`richtext`?Fx(String(e),Yx)||Jx:Nx(e,t)}var Qx=[`actor`,`event`,`resource`,`record`,`from`,`to`],$x=/^(\d{4})-(\d{2})-(\d{2})$/;function eS(e,t){let n=$x.exec(e);if(!n)return e;let[r,i,a]=[Number(n[1]),Number(n[2]),Number(n[3])],o=t?new Date(r,i-1,a,23,59,59,999):new Date(r,i-1,a,0,0,0,0);return o.getFullYear()===r&&o.getMonth()===i-1&&o.getDate()===a?o.toISOString():e}function tS(e){let t=new URLSearchParams;for(let n of Qx){let r=e.get(n);r!==null&&r!==``&&(n!==`record`||e.get(`resource`))&&t.set(n,n===`from`?eS(r,!1):n===`to`?eS(r,!0):r)}return t.sort(),t.toString()}function nS(e){return tS(e)!==``}function rS(e,t){let n=t.trim();return e===`resource`?{resource:n||null,record:null}:{[e]:n||null}}function iS(){return Object.fromEntries(Qx.map(e=>[e,null]))}function aS({entries:e,now:t,names:n,schemaOf:r,pageFieldsOf:i,titleOf:a,onActor:o,showSubject:s=!1}){let{t:c}=Y();return(0,b.jsx)(`ol`,{"aria-label":c(`audit.entries`),className:`flex flex-col divide-y rounded-card border bg-card shadow-card`,children:e.map(e=>(0,b.jsx)(sS,{entry:e,now:t,names:n,schema:e.resource===void 0?void 0:r(e.resource),pageFields:e.resource===void 0&&e.meta?.page!==void 0?i?.(e.meta.page):void 0,titleOf:a,onActor:o,showSubject:s},e.id))})}var oS=/\.(deleted|purged)$/;function sS({entry:e,now:t,names:n,schema:r,pageFields:i,titleOf:a,onActor:o,showSubject:s}){let c=r?.fields??i,{t:l}=Y(),u=new Date(e.at),d=!Number.isNaN(u.getTime()),f=s?Gx(e,n):void 0,p=s&&e.resource!==void 0&&e.recordId!==void 0&&!oS.test(e.event)&&!e.meta?.deleted,m=Kx(e),h=Wx(e),g=e.actor?e.actor.name??`#${e.actor.id}`:l(`audit.noActor`),_=e.meta?.input?Object.entries(e.meta.input):[],v=e.meta?.action===void 0?void 0:r?.actions?.find(t=>t.name===cS(e))?.input?.fields,y=[e.meta?.ip,e.meta?.userAgent].filter(Boolean).join(` · `);return(0,b.jsxs)(`li`,{className:`flex flex-col gap-2 px-4 py-3 text-sm`,"data-event":e.event,"data-actor":e.actor?.id??``,"data-anonymous":Bx(e)||void 0,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,b.jsx)(`span`,{className:`font-medium`,children:Ux(e,n)}),f!==void 0&&(p?(0,b.jsx)(bo,{to:`/${e.resource}/${encodeURIComponent(e.recordId)}`,className:`text-primary hover:underline`,children:f}):(0,b.jsx)(`span`,{children:f}))]}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-0.5 text-xs text-muted-foreground`,children:[e.actor&&o?(0,b.jsx)(`button`,{type:`button`,className:`font-medium text-foreground hover:underline`,"aria-label":l(`audit.filterByActor`,{name:g}),onClick:()=>o(e.actor.id),children:g}):(0,b.jsx)(`span`,{className:`font-medium text-foreground`,children:g}),e.viewAsBy!==void 0&&(0,b.jsx)(`span`,{children:l(`audit.viewAsBy`,{id:e.viewAsBy})}),d?(0,b.jsxs)(`time`,{dateTime:e.at,children:[ag(u,t),` · `,ng(u)]}):(0,b.jsx)(`span`,{children:e.at})]}),h!==void 0&&(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:h}),m!==void 0&&(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:m}),e.changes!==void 0&&e.changes.length>0&&(0,b.jsx)(`dl`,{"aria-label":l(`audit.changedFields`),className:`grid grid-cols-1 gap-x-4 gap-y-1.5 sm:grid-cols-[minmax(6rem,auto)_1fr]`,children:e.changes.map(e=>{let t=c?.find(t=>t.name===e.field);return(0,b.jsx)(lS,{row:qx(e,t,a?t=>a(e.field,t):void 0)},e.field)})}),_.length>0&&(0,b.jsx)(`dl`,{"aria-label":l(`audit.input`),className:`grid grid-cols-1 gap-x-4 gap-y-1.5 sm:grid-cols-[minmax(6rem,auto)_1fr]`,children:_.map(([e,t])=>{let n=v?.find(t=>t.name===e);return(0,b.jsxs)(`div`,{className:`contents`,"data-input":e,children:[(0,b.jsx)(`dt`,{className:`text-muted-foreground`,children:n?.label??e}),(0,b.jsx)(`dd`,{className:`min-w-0`,children:(0,b.jsx)(dS,{text:Zx(t,n)})})]},e)})}),e.meta?.inputTruncated&&(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:l(`audit.inputTruncated`)}),y!==``&&(0,b.jsx)(`p`,{className:`text-xs break-all text-muted-foreground`,dir:`ltr`,"data-client":!0,children:y})]})}function cS(e){let t=`${e.resource}.action.`;return e.event.startsWith(t)?e.event.slice(t.length):void 0}function lS({row:e}){let{t}=Y();return(0,b.jsxs)(`div`,{className:`contents`,"data-change":e.field,"data-state":e.state,children:[(0,b.jsx)(`dt`,{className:`text-muted-foreground`,children:e.label}),(0,b.jsx)(`dd`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:e.state===`values`?(0,b.jsxs)(b.Fragment,{children:[e.before!==void 0&&(0,b.jsxs)(`span`,{className:`min-w-0 text-muted-foreground line-through decoration-muted-foreground/50`,"data-before":!0,children:[(0,b.jsxs)(`span`,{className:`sr-only`,children:[t(`audit.before`),`: `]}),(0,b.jsx)(dS,{text:e.before})]}),e.before!==void 0&&e.after!==void 0&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(J_,{className:`size-3.5 shrink-0 self-center text-muted-foreground rtl:-scale-x-100`,"aria-hidden":!0}),(0,b.jsx)(`span`,{className:`sr-only`,children:t(`audit.becomes`)})]}),e.after!==void 0&&(0,b.jsxs)(`span`,{className:`min-w-0`,"data-after":!0,children:[e.before===void 0&&(0,b.jsxs)(`span`,{className:`sr-only`,children:[t(`audit.after`),`: `]}),(0,b.jsx)(dS,{text:e.after})]}),e.truncated&&(0,b.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`(`,t(`audit.field.truncated`),`)`]})]}):(0,b.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground`,children:t(`audit.field.${e.state}`)})})]})}var uS=160;function dS({text:e}){let{t}=Y(),[n,r]=(0,y.useState)(!1);return e.length<=uS?(0,b.jsx)(`span`,{dir:`auto`,className:`break-words whitespace-pre-wrap`,children:e}):(0,b.jsxs)(`span`,{dir:`auto`,className:`break-words whitespace-pre-wrap`,children:[n?e:`${e.slice(0,uS).trimEnd()}…`,` `,(0,b.jsx)(q,{type:`button`,variant:`link`,size:`sm`,className:`h-auto p-0 text-xs`,"aria-expanded":n,onClick:()=>r(e=>!e),children:t(n?`audit.showLess`:`audit.showMore`)})]})}var fS=[-61,9,38,199,426,686,756,818,1111,1181,1210,1635,2060,2097,2192,2262,2324,2394,2456,3178],pS=(e,t)=>Math.trunc(e/t),mS=(e,t)=>e-Math.trunc(e/t)*t;function hS(e){let t=e+621,n=-14,r=fS[0];if(e<r||e>=fS[fS.length-1])throw RangeError(`Jalali year ${e} is out of range`);let i=0;for(let t=1;t<fS.length;t++){let a=fS[t];if(i=a-r,e<a)break;n+=pS(i,33)*8+pS(mS(i,33),4),r=a}let a=e-r;n+=pS(a,33)*8+pS(mS(a,33)+3,4),mS(i,33)===4&&i-a===4&&(n+=1);let o=pS(t,4)-pS((pS(t,100)+1)*3,4)-150,s=20+n-o;i-a<6&&(a=a-i+pS(i+4,33)*33);let c=mS(mS(a+1,33)-1,4);return c===-1&&(c=4),{leap:c,gy:t,march:s}}function gS(e,t,n){return pS((e+pS(t-8,6)+100100)*1461,4)+pS(153*mS(t+9,12)+2,5)+n-34840408-pS(pS(e+100100+pS(t-8,6),100)*3,4)+752}function _S(e){let t=4*e+139361631;t=t+pS(pS(4*e+183187720,146097)*3,4)*4-3908;let n=pS(mS(t,1461),4)*5+308,r=pS(mS(n,153),5)+1,i=mS(pS(n,153),12)+1;return{gy:pS(t,1461)-100100+pS(8-i,6),gm:i,gd:r}}function vS(e,t,n){let{gy:r,march:i}=hS(e);return gS(r,3,i)+(t-1)*31-pS(t,7)*(t-7)+n-1}function yS(e){let{gy:t}=_S(e),n=t-621,r=hS(n),i=e-gS(t,3,r.march);if(i>=0){if(i<=185)return{jy:n,jm:1+pS(i,31),jd:mS(i,31)+1};i-=186}else--n,i+=179,r.leap===1&&(i+=1);return{jy:n,jm:7+pS(i,30),jd:mS(i,30)+1}}var bS=(e,t=2)=>String(e).padStart(t,`0`),xS=/^(\d{4})-(\d{2})-(\d{2})$/;function SS(e){return hS(e).leap===0}function CS(e,t){return t<=6?31:t<=11||SS(e)?30:29}function wS(e){let t=xS.exec(e);if(!t)throw RangeError(`not an ISO date: ${e}`);return yS(gS(Number(t[1]),Number(t[2]),Number(t[3])))}function TS(e,t,n){let{gy:r,gm:i,gd:a}=_S(vS(e,t,n));return`${bS(r,4)}-${bS(i)}-${bS(a)}`}function ES(e,t,n){return Number.isInteger(e)&&e>=1&&e<3178&&t>=1&&t<=12&&n>=1&&n<=CS(e,t)}function DS(e){let{jy:t,jm:n,jd:r}=wS(e);return`${t}/${bS(n)}/${bS(r)}`}function OS(e){let t=/^(\d{4})[/\-.](\d{1,2})[/\-.](\d{1,2})$/.exec(Mh(e.trim()));if(!t)return;let[n,r,i]=[Number(t[1]),Number(t[2]),Number(t[3])];return ES(n,r,i)?TS(n,r,i):void 0}function kS(e,t){let{jy:n,jm:r,jd:i}=wS(e),a=n*12+(r-1)+t,o=Math.floor(a/12),s=a%12+1;return TS(o,s,Math.min(i,CS(o,s)))}function AS(e,t){return new Date(Date.parse(`${e}T00:00:00Z`)+t*864e5).toISOString().slice(0,10)}function jS(){let e=new Date;return`${bS(e.getFullYear(),4)}-${bS(e.getMonth()+1)}-${bS(e.getDate())}`}var MS=(e,t=2)=>String(e).padStart(t,`0`),NS=(e,t)=>new Date(Date.UTC(e,t,0)).getUTCDate(),PS={intl:`persian`,parts:e=>{let{jy:t,jm:n,jd:r}=wS(e);return{year:t,month:n,day:r}},fromParts:TS,monthLength:CS,addMonths:kS,format:DS,parse:OS,weekStart:6},FS={intl:`gregory`,parts:e=>({year:Number(e.slice(0,4)),month:Number(e.slice(5,7)),day:Number(e.slice(8,10))}),fromParts:(e,t,n)=>`${MS(e,4)}-${MS(t)}-${MS(n)}`,monthLength:NS,addMonths:(e,t)=>{let{year:n,month:r,day:i}=FS.parts(e),a=n*12+(r-1)+t,o=Math.floor(a/12),s=a%12+1;return FS.fromParts(o,s,Math.min(i,NS(o,s)))},format:e=>e,parse:e=>{let t=/^(\d{4})[/\-.](\d{1,2})[/\-.](\d{1,2})$/.exec(Mh(e.trim()));if(!t)return;let[n,r,i]=[Number(t[1]),Number(t[2]),Number(t[3])];return n>=1&&r>=1&&r<=12&&i>=1&&i<=NS(n,r)?FS.fromParts(n,r,i):void 0},weekStart:1},IS=e=>e===`persian`?PS:FS,LS=/^\d{4}-\d{2}-\d{2}$/;function RS(e){let{calendar:t}=Y();return(0,b.jsx)(zS,{...e,system:IS(t)})}function zS({id:e,value:t,onChange:n,label:r,live:i,className:a,system:o,...s}){let{t:c,digits:l}=Y(),u=e=>LS.test(e)?tg(o.format(e)):e,[d,f]=(0,y.useState)(()=>u(t)),[p,m]=(0,y.useState)(!1),h=(0,y.useRef)(t);(0,y.useEffect)(()=>{t!==h.current&&(h.current=t,f(u(t)))},[t,l,o]);function g(e){h.current=e,n(e)}function _(){let e=d.trim();if(e===``)return t!==``&&g(``);let n=o.parse(e);n?(f(u(n)),n!==t&&g(n)):i&&g(Mh(e))}function v(e){f(u(e)),m(!1),g(e)}return(0,b.jsxs)(`div`,{className:W(`flex items-center gap-1`,a),children:[(0,b.jsx)(Oh,{id:e,dir:`ltr`,inputMode:`numeric`,placeholder:c(`date.placeholder`),value:d,...s,onChange:e=>{if(f(e.target.value),!i)return;let t=e.target.value.trim();g((t===``?``:o.parse(t))??Mh(t))},onBlur:()=>{_(),s.onBlur?.()},onKeyDown:e=>{e.key===`Enter`&&(_(),i||e.preventDefault()),s.onKeyDown?.(e)}}),(0,b.jsxs)(Sh,{open:p,onOpenChange:m,children:[(0,b.jsx)(Ch,{asChild:!0,children:(0,b.jsx)(q,{type:`button`,variant:`outline`,size:`icon-sm`,"aria-label":c(`date.openCalendar`,{name:r}),children:(0,b.jsx)(fv,{})})}),(0,b.jsx)(wh,{children:(0,b.jsx)(Th,{align:`end`,sideOffset:4,className:`z-50 rounded-lg border bg-popover p-3 text-popover-foreground shadow-md`,"aria-label":c(`date.calendar`,{name:r}),children:(0,b.jsx)(BS,{system:o,value:LS.test(t)?t:void 0,onPick:v,onClear:()=>v(``)})})})]})]})}function BS({system:e,value:t,onPick:n,onClear:r}){let{t:i,locale:a}=Y(),o=jS(),[s,c]=(0,y.useState)(t??o),[l,u]=(0,y.useState)(`days`),d=(0,y.useRef)(null),f=(0,y.useRef)(!1),{year:p,month:m}=e.parts(s),h=Qh(a);(0,y.useEffect)(()=>{f.current&&(f.current=!1,d.current?.querySelector(`[data-iso="${s}"]`)?.focus())},[s]);let g=t=>new Intl.DateTimeFormat(`${a}-u-ca-${e.intl}`,{month:`long`,timeZone:`UTC`}).format(Date.parse(`${e.fromParts(p,t,1)}T00:00:00Z`)),_=e=>tg(String(e)),v=AS(`2024-01-07`,e.weekStart),x=Array.from({length:7},(e,t)=>new Intl.DateTimeFormat(a,{weekday:`narrow`,timeZone:`UTC`}).format(Date.parse(`${AS(v,t)}T00:00:00Z`))),S=e.fromParts(p,m,1),C=(new Date(`${S}T00:00:00Z`).getUTCDay()-e.weekStart+7)%7,w=e.monthLength(p,m),T=[...Array.from({length:C},()=>null),...Array.from({length:w},(e,t)=>AS(S,t))];function E(t){let n={ArrowRight:h?-1:1,ArrowLeft:h?1:-1,ArrowDown:7,ArrowUp:-7},r;t.key in n?r=AS(s,n[t.key]):t.key===`PageDown`?r=e.addMonths(s,t.shiftKey?12:1):t.key===`PageUp`&&(r=e.addMonths(s,t.shiftKey?-12:-1)),r&&(t.preventDefault(),f.current=!0,c(r))}let D=(e,t,n,r)=>(0,b.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,b.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":i(`date.previous`),onClick:()=>n(-1),children:(0,b.jsx)(wv,{className:`rtl:rotate-180`})}),t?(0,b.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":r,onClick:t,children:e}):(0,b.jsx)(`span`,{className:`text-sm font-medium`,children:e}),(0,b.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":i(`date.next`),onClick:()=>n(1),children:(0,b.jsx)(Ev,{className:`rtl:rotate-180`})})]}),O;if(l===`years`){let t=p-p%12;O=(0,b.jsxs)(b.Fragment,{children:[D(`${_(t)}–${_(t+11)}`,void 0,t=>c(e.addMonths(s,t*144)),``),(0,b.jsx)(`div`,{className:`grid grid-cols-3 gap-1`,children:Array.from({length:12},(e,n)=>t+n).map(t=>(0,b.jsx)(q,{type:`button`,variant:t===p?`secondary`:`ghost`,size:`sm`,onClick:()=>{c(e.fromParts(t,m,Math.min(e.parts(s).day,e.monthLength(t,m)))),u(`months`)},children:_(t)},t))})]})}else O=l===`months`?(0,b.jsxs)(b.Fragment,{children:[D(_(p),()=>u(`years`),t=>c(e.addMonths(s,t*12)),i(`date.chooseYear`)),(0,b.jsx)(`div`,{className:`grid grid-cols-3 gap-1`,children:Array.from({length:12},(e,t)=>t+1).map(t=>(0,b.jsx)(q,{type:`button`,variant:t===m?`secondary`:`ghost`,size:`sm`,onClick:()=>{c(e.fromParts(p,t,Math.min(e.parts(s).day,e.monthLength(p,t)))),u(`days`)},children:g(t)},t))})]}):(0,b.jsxs)(b.Fragment,{children:[D(`${g(m)} ${_(p)}`,()=>u(`months`),t=>c(e.addMonths(s,t)),i(`date.chooseMonth`)),(0,b.jsxs)(`div`,{ref:d,role:`grid`,"aria-label":`${g(m)} ${_(p)}`,onKeyDown:E,className:`grid grid-cols-7 gap-0.5 text-center`,children:[(0,b.jsx)(`div`,{role:`row`,className:`contents`,children:x.map((e,t)=>(0,b.jsx)(`div`,{role:`columnheader`,className:`py-1 text-xs text-muted-foreground`,children:e},t))}),Array.from({length:Math.ceil(T.length/7)},(r,i)=>(0,b.jsx)(`div`,{role:`row`,className:`contents`,children:T.slice(i*7,i*7+7).map((r,a)=>r?(0,b.jsx)(`div`,{role:`gridcell`,"aria-selected":r===t,children:(0,b.jsx)(`button`,{type:`button`,"data-iso":r,tabIndex:r===s?0:-1,"aria-label":ig(r),"aria-current":r===o?`date`:void 0,onClick:()=>n(r),className:W(`size-8 rounded-md text-sm hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:outline-none`,r===o&&`font-semibold text-primary`,r===t&&`bg-primary text-primary-foreground hover:bg-primary/90`),children:_(e.parts(r).day)})},r):(0,b.jsx)(`div`,{role:`gridcell`},`empty-${i}-${a}`))},i))]})]});return(0,b.jsxs)(`div`,{className:`flex w-64 flex-col`,children:[O,(0,b.jsxs)(`div`,{className:`mt-2 flex justify-between gap-2 border-t pt-2`,children:[(0,b.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>n(o),children:i(`date.today`)}),(0,b.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,onClick:r,children:i(`date.clear`)})]})]})}function VS({id:e,value:t,onChange:n,label:r,...i}){let{t:a}=Y(),[o=``,s=``]=t.split(`T`),c=(e,t)=>n(e===``?``:`${e}T${t||`00:00`}`);return(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,b.jsx)(RS,{id:e,live:!0,value:o,label:r,onChange:e=>c(e,s),className:`min-w-44 flex-1`,...i}),(0,b.jsx)(Oh,{type:`time`,dir:`ltr`,"aria-label":a(`date.time`,{name:r}),className:`w-28`,value:s,onChange:e=>c(o,e.target.value)})]})}var HS=`fixed inset-0 z-40 bg-black/40 backdrop-blur-sm dark:bg-black/60 motion-safe:animate-in motion-safe:fade-in-0 motion-safe:duration-150`;function US(e,t){let[n,r]=(0,y.useState)(e);return(0,y.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var WS=(e,t)=>String(e.id)===String(t.id);function GS({id:e,resource:t,field:n,value:r,onChange:i,clearable:a,values:o,parent:s,invalid:c,describedBy:l}){let u=X(),d=n.relation?.kind===`to-many`,f=d&&Array.isArray(r)?r:[],p=!d&&r&&!Array.isArray(r)?r:null,[m,h]=(0,y.useState)(``),[g,_]=(0,y.useState)(!1),[v,x]=(0,y.useState)(0),S=US(m.trim(),250),C=Zg(t,n.optionsField??n.name,S,g,o,s),w=(C.data?.items??[]).filter(e=>!f.some(t=>WS(t,e))),T=`${e}-options`,E=t=>`${e}-option-${t}`;(0,y.useEffect)(()=>{x(0)},[S,C.data]);function D(e){h(``),_(!1),i(d?[...f,e]:e)}function O(e){e.key===`ArrowDown`||e.key===`ArrowUp`?(e.preventDefault(),g?x(t=>Math.max(0,Math.min(w.length-1,t+(e.key===`ArrowDown`?1:-1)))):_(!0)):e.key===`Enter`&&g?(e.preventDefault(),w[v]&&D(w[v])):e.key===`Escape`&&g?(e.preventDefault(),_(!1),h(``)):e.key===`Backspace`&&d&&m===``&&f.length>0&&i(f.slice(0,-1))}return(0,b.jsxs)(`div`,{className:`relative flex flex-col gap-1.5`,children:[d&&f.length>0&&(0,b.jsx)(`ul`,{className:`flex flex-wrap gap-1.5`,"aria-label":u(`picker.selected`,{name:n.label}),children:f.map(e=>(0,b.jsxs)(`li`,{className:`inline-flex items-center gap-1 rounded-md bg-muted py-0.5 ps-2 pe-1 text-sm`,children:[e.title,(0,b.jsx)(`button`,{type:`button`,className:`rounded-sm p-0.5 text-muted-foreground hover:text-foreground`,"aria-label":u(`picker.remove`,{name:e.title}),onClick:()=>i(f.filter(t=>!WS(t,e))),children:(0,b.jsx)(Sx,{className:`size-3.5`})})]},String(e.id)))}),(0,b.jsxs)(`div`,{className:`relative`,children:[(0,b.jsx)(Oh,{id:e,role:`combobox`,autoComplete:`off`,"aria-autocomplete":`list`,"aria-expanded":g,"aria-controls":T,"aria-activedescendant":g&&w[v]?E(v):void 0,"aria-invalid":c||void 0,"aria-describedby":l,className:W(p&&a&&`pe-8`),placeholder:p?p.title:u(d?`picker.typeToAdd`:`picker.typeToSearch`),value:g||m?m:p?.title??``,onChange:e=>{h(e.target.value),_(!0)},onFocus:()=>_(!0),onBlur:()=>{_(!1),h(``)},onKeyDown:O}),p&&a&&(0,b.jsx)(`button`,{type:`button`,className:`absolute inset-y-0 end-0 flex items-center px-2 text-muted-foreground hover:text-foreground`,"aria-label":u(`picker.clear`,{name:n.label}),onClick:()=>i(null),children:(0,b.jsx)(Sx,{className:`size-4`})})]}),g&&(0,b.jsxs)(`div`,{className:`absolute inset-x-0 top-full z-20 mt-1 max-h-60 overflow-auto rounded-lg border bg-popover p-1 text-popover-foreground shadow-md`,children:[(0,b.jsx)(`ul`,{id:T,role:`listbox`,"aria-label":n.label,children:w.map((e,t)=>(0,b.jsx)(`li`,{id:E(t),role:`option`,"aria-selected":t===v,className:W(`cursor-pointer rounded-md px-2 py-1.5 text-sm`,t===v&&`bg-accent text-accent-foreground`),onMouseDown:e=>e.preventDefault(),onMouseEnter:()=>x(t),onClick:()=>D(e),children:e.title},String(e.id)))}),w.length===0&&(0,b.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,children:C.isError?pg(C.error):u(C.isFetching||C.isPending?`picker.searching`:`picker.noMatches`)})]})]})}var KS=new Set([`page`,`pageSize`,`sort`,`search`,`trashed`,`after`,`tab`]),qS=e=>KS.has(e)||e.startsWith(`filter[`);function JS(e){let t=new URLSearchParams;for(let[n,r]of e)r!==``&&qS(n)&&t.append(n,r);return t.sort(),t.toString()}function YS(e,t){return`filter[${e}][${t}]`}function XS(e){return[...e.keys()].some(e=>e===`search`||e.startsWith(`filter[`))}function ZS(e){let t={};for(let n of e.keys())(n===`search`||n.startsWith(`filter[`))&&(t[n]=null);return t}function QS(e,t){let n=new URLSearchParams(e);Object.keys(t).some(e=>e!==`page`&&e!==`after`)&&(n.delete(`page`),n.delete(`after`));for(let[e,r]of Object.entries(t))r===null?n.delete(e):n.set(e,r);return n}function $S(e,t){if(!e)return{summary:``,label:J(`list.page`,{page:t}),hasNext:!1};if(e.total===null)return{summary:``,label:J(`list.page`,{page:t}),hasNext:e.hasMore===!0};let n=Math.max(1,Math.ceil(e.total/e.pageSize)),r=eg(e.total);return{summary:J(e.estimated?`list.about`:`list.total`,{count:r}),label:e.estimated?J(`list.page`,{page:t}):J(`list.pageOf`,{page:t,pages:n}),hasNext:t<n}}function eC(e,t,n){if(!e||e.total===null||e.total===0)return``;if(e.estimated)return J(`list.about`,{count:eg(e.total)});let r=(t-1)*e.pageSize+1;return J(`list.range`,{from:eg(r),to:eg(r+Math.max(n,1)-1),total:eg(e.total)})}function tC(e){return[...new Set([10,20,50,100,e])].filter(e=>e<=100).sort((e,t)=>e-t)}function nC(e){let t=new Set;for(let[n,r]of e){let e=/^filter\[([^\][]+)\]/.exec(n);e&&r!==``&&t.add(e[1])}return t.size}function rC(e,t){let n=e=>e===`search`||e===`sort`||e.startsWith(`filter[`),r={};for(let i of new Set([...e.keys(),...t.keys()]))n(i)&&e.get(i)!==t.get(i)&&(r[i]=t.get(i));return Object.fromEntries(Object.entries(r).sort(([e],[t])=>e.localeCompare(t)))}function iC(e){return new Map([...e].filter(([e,t])=>e.startsWith(`filter[`)&&t!==``))}function aC(e,t){let n=iC(t),r=t.get(`tab`);return e?.find(e=>{if((e.where?e.key:null)!==r)return!1;let t=Object.entries(e.filter);return t.length===n.size&&t.every(([e,t])=>n.get(e)===t)})}function oC(e,t){let n={};for(let e of iC(t).keys())n[e]=null;return t.has(`tab`)&&(n.tab=null),Object.assign(n,e.filter),e.where?n.tab=e.key:t.has(`tab`)&&(n.tab=null),n}var sC=/^filter\[([^\][]+)\]\[([^\][]+)\]$/;function cC(e,t){if(e.type===`boolean`)return J(t===`true`?`common.yes`:`common.no`);if(e.type===`enum`)return e.enumLabels?.[t]??t;if(e.type===`date`)return ig(t);if(e.type===`number`||e.type===`decimal`||e.type===`bigint`)return tg(t);if(e.type===`datetime`){let e=new Date(t);return Number.isNaN(e.getTime())?t:ng(e)}return t}function lC(e,t){let n=[],r=t.get(`search`);r&&n.push({key:`search`,label:J(`filters.search`),value:`“${r}”`,remove:[`search`]});let i=uC(e,t),a=new Map;for(let[e,n]of t){if(i[e]===n)continue;let t=sC.exec(e);if(!t||n===``)continue;let[,r,o]=t;a.set(r,[...a.get(r)??[],{operator:o,raw:n,key:e}])}for(let[t,r]of a){let i=e.fields.find(e=>e.name===t);if(!i)continue;let a=[],o,s=r.find(e=>e.operator===`gte`||e.operator===`gt`),c=r.find(e=>e.operator===`lte`||e.operator===`lt`);s&&c&&a.push(`${cC(i,s.raw)} – ${cC(i,c.raw)}`);for(let{operator:e,raw:n}of r){if((e===`gte`||e===`gt`||e===`lte`||e===`lt`)&&s&&c)continue;let r=n.split(`,`).map(e=>cC(i,e));if(i.type===`relation`&&[`eq`,`ne`,`in`,`nin`].includes(e)){let r=e===`ne`||e===`nin`?J(`filters.not`):``;o={field:t,ids:n.split(`,`),prefix:r},a.push(`${r}${n.split(`,`).map(e=>`#${e}`).join(`, `)}`);continue}switch(e){case`isNull`:a.push(J(n===`true`?`filters.empty`:`filters.notEmpty`));break;case`ne`:case`nin`:a.push(`${J(`filters.not`)}${r.join(`, `)}`);break;case`gte`:case`gt`:a.push(`≥ ${r[0]}`);break;case`lte`:case`lt`:a.push(`≤ ${r[0]}`);break;case`between`:a.push(r.join(` – `));break;case`contains`:a.push(`“${n}”`);break;case`startsWith`:a.push(`${n}…`);break;default:a.push(r.join(`, `))}}n.push({key:`filter:${t}`,label:i.label,value:a.join(`; `),...o?{ref:o}:{},remove:r.map(e=>e.key)})}return n}function uC(e,t){return aC(e.list?.tabs,t)?.filter??{}}var dC=e=>typeof e==`object`&&e&&!Array.isArray(e)?e:{},fC=e=>Array.isArray(e)?e:[];function pC(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&`title`in e}function mC(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&`name`in e&&`size`in e&&(`key`in e||`token`in e)}function hC(e){return(Array.isArray(e)?e:[e]).filter(mC)}function gC(e,t){let n=e?._files?.[t];return n==null?[]:Array.isArray(n)?n:[n]}var _C=e=>e.token===void 0?`key:${e.key}`:`token:${e.token}`,vC=e=>e.token===void 0?{key:e.key}:{token:e.token},yC=(e,t)=>{let n=new Set(e.map(e=>String(e.id)));return e.length===t.length&&t.every(e=>n.has(String(e.id)))},bC=/<img\b(?:"[^"]*"|'[^']*'|[^'">])*>/gi;function xC(e){return e.replace(bC,``)}var SC=e=>String(e).padStart(2,`0`);function CC(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:`${t.getFullYear()}-${SC(t.getMonth()+1)}-${SC(t.getDate())}T${SC(t.getHours())}:${SC(t.getMinutes())}`}function wC(e,t){let n={};for(let r of e){let e=t?.[r.name];if(r.file){let e=gC(t,r.name).map(({key:e,name:t,size:n,contentType:r,url:i})=>({key:e,name:t,size:n,contentType:r,url:i}));n[r.name]=r.file.many?e:e[0]??null}else if(r.type===`object`){let t=r.fields??[];n[r.name]=r.many?(Array.isArray(e)?e:[]).map(e=>wC(t,e)):wC(t,e??void 0)}else r.relation?.kind===`to-many`?n[r.name]=Array.isArray(e)?e.filter(pC):[]:r.type===`relation`?n[r.name]=pC(e)?e:null:r.type===`boolean`?n[r.name]=e===!0:e==null?n[r.name]=``:r.type===`json`?n[r.name]=JSON.stringify(e,null,2):r.type===`datetime`?n[r.name]=CC(String(e)):r.widget===`money`?n[r.name]=Dx(String(e),r.scale):n[r.name]=String(e)}return n}function TC(e,t){let n=/^-?\d{1,3}(,\d{3})+(\.\d+)?$/.test(e)?e.replace(/,/g,``):e;if((t?/^-?\d+$/:/^-?\d+(\.\d+)?$/).test(n))return n}function EC(e,t,n,r=``){let i={},a={};for(let o of e){let e=t[o.name];if(n&&e===n[o.name])continue;let s=`${r}${o.name}`;if(o.type===`object`){let t=o.fields??[];if(o.many){let r=fC(e).map((e,n)=>EC(t,e,void 0,`${s}.${n}.`));for(let e of r)Object.assign(a,e.errors);let c=r.map(e=>e.payload),l=n?fC(n[o.name]).map(e=>EC(t,e).payload):void 0;(l?JSON.stringify(l)!==JSON.stringify(c):c.length>0)&&(i[o.name]=c);continue}let r=EC(t,dC(e),n?dC(n[o.name]):void 0,`${s}.`);Object.assign(a,r.errors),(Object.keys(r.payload).length>0||!n&&!o.nullable)&&(i[o.name]=r.payload);continue}if(o.file){let t=hC(e),r=n?hC(n[o.name]):void 0;if(r&&t.map(_C).join(`
|
|
54
|
+
`)===r.map(_C).join(`
|
|
55
|
+
`))continue;o.file.many?(r||t.length>0)&&(i[o.name]=t.map(vC)):t[0]?i[o.name]=vC(t[0]):(o.nullable||n)&&(i[o.name]=null);continue}if(o.relation?.kind===`to-many`){let t=Array.isArray(e)?e.filter(pC):[],r=n?.[o.name];(n?!yC(t,Array.isArray(r)?r.filter(pC):[]):t.length>0)&&(i[o.name]=t.map(e=>e.id));continue}if(o.type===`relation`){let t=pC(e)?e:null,r=n?.[o.name];if(n&&String(t?.id)===String(pC(r)?r.id:void 0))continue;t?i[o.name]=t.id:(o.nullable||n)&&(i[o.name]=null);continue}if(o.type===`boolean`){i[o.name]=e===!0;continue}let c=typeof e==`string`?e:``,l=c.trim();if(l===``){(o.nullable||n)&&(i[o.name]=null);continue}switch(o.type){case`number`:case`decimal`:case`bigint`:{let e=TC(Nh(l),o.type===`bigint`);e===void 0?a[s]=[J(`validation.number`)]:i[o.name]=o.type===`number`?Number(e):e;break}case`json`:try{i[o.name]=JSON.parse(l)}catch{a[s]=[J(`validation.json`)]}break;case`date`:{let e=Mh(l);!/^\d{4}-\d{2}-\d{2}$/.test(e)||Number.isNaN(Date.parse(`${e}T00:00:00Z`))||new Date(`${e}T00:00:00Z`).toISOString().slice(0,10)!==e?a[s]=[J(`validation.date`)]:i[o.name]=e;break}case`datetime`:{let e=new Date(Mh(l));Number.isNaN(e.getTime())?a[s]=[J(`validation.datetime`)]:i[o.name]=e.toISOString();break}default:i[o.name]=c}}return{payload:i,errors:a}}function DC(e,t){let{payload:n}=EC(e,t),r=e=>Array.isArray(e)?e.every(e=>typeof e==`string`||typeof e==`number`):typeof e==`string`?e.length<=100:typeof e!=`object`||!e,i=Object.fromEntries(Object.entries(n).filter(([,e])=>r(e))),a=JSON.stringify(i);return a.length<=4e3?a:void 0}var OC=`(max-width: 767px)`;function kC(e){let t=window.matchMedia(OC);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function AC(){return(0,y.useSyncExternalStore)(kC,()=>window.matchMedia(OC).matches,()=>!1)}function jC(e,t){if(e.widget===`stepper`)return`select`;if(e.widget)return e.widget;switch(e.type){case`boolean`:return`checkbox`;case`enum`:return`select`;case`text`:return`textarea`;case`json`:case`object`:return`json`;case`number`:case`decimal`:case`bigint`:return`number`;case`date`:return`date`;case`datetime`:return`datetime`;default:return t?.format===`email`?`email`:t?.format===`url`?`url`:`text`}}function MC(e,t){return e.enumLabels?.[t]??t}var NC=`h-8 w-full rounded-lg border border-input bg-transparent px-2.5 text-sm outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,PC=new Set([`number`,`decimal`,`bigint`,`date`,`datetime`]);function FC({schema:e,params:t,onChange:n,trailing:r}){let i=X(),a=AC(),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(),u=t.get(`search`)??``,[d,f]=(0,y.useState)(u);(0,y.useEffect)(()=>{f(u)},[u]);let p=e.list.filters.map(t=>({operators:t.operators,field:e.fields.find(e=>e.name===t.field)})).filter(e=>e.field!==void 0),m=e.list.search.length>0,h=a&&(p.length>0||e.list.sortable.length>0);if(p.length===0&&!m&&!h&&!r)return null;let g=e.list.search.map(t=>e.fields.find(e=>e.name===t)?.label??t);if(!a){let a=new Map(lC(e,t).map(e=>[e.key,e]));return(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[m&&(0,b.jsx)(qC,{label:i(`filters.search`),placeholder:i(`filters.searchIn`,{fields:g.join(`, `)}),value:d,onChange:f,onSubmit:()=>n({search:d.trim()||null})}),p.length>0&&(0,b.jsx)(`ul`,{"aria-label":i(`filters.filters`),className:`contents`,children:p.map(({field:r,operators:i})=>(0,b.jsx)(`li`,{className:`contents`,children:(0,b.jsx)(JC,{resource:e.name,field:r,operators:i,params:t,onChange:n,chip:a.get(`filter:${r.name}`)})},r.name))}),XS(t)&&(0,b.jsxs)(q,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>n(ZS(t)),children:[i(`filters.clear`),(0,b.jsx)(Sx,{className:`size-3.5`})]}),r&&(0,b.jsx)(`div`,{className:`ms-auto flex items-center gap-2`,children:r})]})}let _=nC(t),v=lC(e,t).length>0,x=IC(e,t,i),S=()=>{l(new URLSearchParams(t)),s(!0)};return(0,b.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,b.jsxs)(`div`,{className:`flex gap-2`,children:[m&&(0,b.jsx)(qC,{className:`flex-1`,label:i(`filters.search`),placeholder:i(`filters.searchIn`,{fields:g.join(`, `)}),value:d,onChange:f,onSubmit:()=>n({search:d.trim()||null})}),h&&(0,b.jsxs)(q,{type:`button`,variant:`outline`,"aria-haspopup":`dialog`,onClick:S,children:[(0,b.jsx)(Hb,{}),i(`filters.filters`),_>0&&(0,b.jsx)(`span`,{"aria-hidden":!0,className:`inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1.5 text-xs text-primary-foreground`,children:eg(_)})]})]}),(v||h&&x)&&(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[v&&(0,b.jsx)(UC,{schema:e,params:t,onChange:n}),h&&x&&(0,b.jsxs)(`button`,{type:`button`,className:`inline-flex h-9 items-center gap-1.5 rounded-full border border-input bg-card px-3 text-[13px]`,"aria-haspopup":`dialog`,onClick:S,children:[(0,b.jsx)(W_,{className:`size-3.5 text-muted-foreground`,"aria-hidden":!0}),x]})]}),h&&(0,b.jsx)(jd,{open:o,onOpenChange:s,children:(0,b.jsxs)(Ld,{children:[(0,b.jsx)(zd,{className:HS}),(0,b.jsxs)(Ud,{"aria-describedby":void 0,className:`fixed inset-x-0 bottom-0 z-50 flex max-h-[85dvh] flex-col rounded-t-[18px] bg-card shadow-xl outline-none`,children:[(0,b.jsx)(`div`,{className:`flex justify-center pt-2`,"aria-hidden":!0,children:(0,b.jsx)(`span`,{className:`h-1.5 w-10 rounded-full bg-input`})}),(0,b.jsxs)(`div`,{className:`flex items-center gap-2 ps-4 pe-2 pt-1.5 pb-2`,children:[(0,b.jsx)(Jd,{className:`flex-1 text-[17px] font-bold`,children:i(`filters.filtersAndSort`)}),XS(t)&&(0,b.jsx)(q,{type:`button`,variant:`ghost`,className:`text-primary`,onClick:()=>n(ZS(t)),children:i(`filters.clear`)})]}),(0,b.jsxs)(`div`,{className:`flex flex-col gap-5 overflow-y-auto px-4 py-1`,children:[p.map(({field:r,operators:i})=>(0,b.jsx)(RC,{resource:e.name,field:r,operators:i,params:t,onChange:n,touch:!0},r.name)),e.list.sortable.length>0&&(0,b.jsx)(LC,{schema:e,params:t,onChange:n})]}),(0,b.jsxs)(`div`,{className:`flex gap-2.5 border-t px-4 pt-3 pb-5`,children:[(0,b.jsx)(q,{type:`button`,variant:`outline`,onClick:()=>{c&&n(rC(t,c)),s(!1)},children:i(`common.cancel`)}),(0,b.jsx)(Xd,{asChild:!0,children:(0,b.jsx)(q,{className:`flex-1`,children:i(`filters.showResults`)})})]})]})]})})]})}function IC(e,t,n){if(e.list.sortable.length===0)return``;let{field:r,direction:i}=e.list.defaultSort,a=t.get(`sort`)??(i===`desc`?`-${r}`:r),o=a.replace(/^-/,``),s=e.fields.find(e=>e.name===o)?.label??o;return n(a.startsWith(`-`)?`filters.descending`:`filters.ascending`,{name:s})}function LC({schema:e,params:t,onChange:n}){let r=X(),{field:i,direction:a}=e.list.defaultSort,o=t.get(`sort`)??(a===`desc`?`-${i}`:i),s=t=>e.fields.find(e=>e.name===t)?.label??t;return(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:`list-sort`,children:r(`filters.sortBy`)}),(0,b.jsx)(`select`,{id:`list-sort`,className:NC,value:o,onChange:e=>n({sort:e.target.value,page:null,after:null}),children:e.list.sortable.flatMap(e=>[(0,b.jsx)(`option`,{value:e,children:r(`filters.ascending`,{name:s(e)})},e),(0,b.jsx)(`option`,{value:`-${e}`,children:r(`filters.descending`,{name:s(e)})},`-${e}`)])})]})}function RC(e){let t=(0,b.jsx)(HC,{...e}),{field:n,operators:r,params:i,onChange:a}=e;return!n.nullable||!r.includes(`isNull`)||n.type===`relation`?t:(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[t,(0,b.jsx)(zC,{field:n,params:i,onChange:a})]})}function zC({field:e,params:t,onChange:n}){let r=X(),i=YS(e.name,`isNull`);return(0,b.jsxs)(`select`,{"aria-label":r(`filters.emptyValues`,{field:e.label}),className:W(NC,`h-7 text-xs text-muted-foreground`),value:t.get(i)??``,onChange:e=>n({[i]:e.target.value||null}),children:[(0,b.jsx)(`option`,{value:``,children:r(`filters.any`)}),(0,b.jsx)(`option`,{value:`true`,children:r(`filters.onlyEmpty`)}),(0,b.jsx)(`option`,{value:`false`,children:r(`filters.hideEmpty`)})]})}function BC({id:e,inline:t,field:n,params:r,onChange:i}){let a=X(),o=YS(n.name,`in`),s=(r.get(o)??``).split(`,`).filter(Boolean),c=e=>{let t=s.includes(e)?s.filter(t=>t!==e):[...s,e];i({[o]:t.length>0?t.join(`,`):null})};return t?(0,b.jsx)(VC,{field:n,selected:s,onToggle:c}):(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:e,children:n.label}),(0,b.jsxs)(Sh,{children:[(0,b.jsx)(Ch,{asChild:!0,children:(0,b.jsxs)(q,{id:e,type:`button`,variant:`outline`,className:`justify-between font-normal`,children:[(0,b.jsx)(`span`,{className:`truncate`,children:s.length===0?a(`common.all`):s.length<=2?s.map(e=>MC(n,e)).join(`, `):a(`filters.selected`,{count:s.length})}),(0,b.jsx)(Sv,{className:`size-4 opacity-60`,"aria-hidden":!0})]})}),(0,b.jsx)(wh,{children:(0,b.jsx)(Th,{align:`start`,sideOffset:4,className:`z-50 min-w-48 rounded-lg border bg-popover p-1 text-popover-foreground shadow-md`,children:(0,b.jsx)(VC,{field:n,selected:s,onToggle:c})})})]})]})}function VC({field:e,selected:t,onToggle:n}){return(0,b.jsx)(`ul`,{"aria-label":e.label,children:(e.enumValues??[]).map(r=>(0,b.jsx)(`li`,{children:(0,b.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent`,children:[(0,b.jsx)(ff,{checked:t.includes(r),onCheckedChange:()=>n(r),className:`flex size-4 items-center justify-center rounded border border-input data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground`,children:(0,b.jsx)(mf,{children:(0,b.jsx)(bv,{className:`size-3`})})}),MC(e,r)]})},r))})}function HC({inline:e,touch:t,resource:n,field:r,operators:i,params:a,onChange:o}){let{t:s,calendar:c}=Y(),l=`filter-${r.name}`;if(t&&r.type===`enum`&&i.includes(`in`))return(0,b.jsx)(XC,{field:r,params:a,onChange:o});if(r.type===`enum`&&i.includes(`in`))return(0,b.jsx)(BC,{id:l,inline:e,field:r,params:a,onChange:o});if(r.type===`relation`){let e=r.relation?.kind===`to-many`?`in`:`eq`;return i.includes(e)?(0,b.jsx)(GC,{id:l,resource:n,field:r,operator:e,params:a,onChange:o}):null}if((r.type===`enum`||r.type===`boolean`)&&i.includes(`eq`)){let e=YS(r.name,`eq`),n=r.type===`boolean`?[[`true`,s(`common.yes`)],[`false`,s(`common.no`)]]:(r.enumValues??[]).map(e=>[e,MC(r,e)]);return t&&n.length<=3?(0,b.jsx)(ZC,{label:r.label,options:[[``,s(`common.all`)],...n],value:a.get(e)??``,onChange:t=>o({[e]:t||null})}):(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:l,children:r.label}),(0,b.jsxs)(`select`,{id:l,className:NC,value:a.get(e)??``,onChange:t=>o({[e]:t.target.value||null}),children:[(0,b.jsx)(`option`,{value:``,children:s(`common.all`)}),n.map(([e,t])=>(0,b.jsx)(`option`,{value:e,children:t},e))]})]})}if((r.type===`date`||r.type===`datetime`)&&i.includes(`gte`)&&i.includes(`lte`)){let e=(e,t)=>r.type===`date`||!t?t:new Date(`${t}T${e===`gte`?`00:00:00.000`:`23:59:59.999`}`).toISOString(),t=e=>e&&r.type===`datetime`?CC(e).slice(0,10):e??``;return(0,b.jsxs)(`fieldset`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(`legend`,{className:`mb-1.5 text-sm font-medium`,children:r.label}),(0,b.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:[`gte`,`lte`].map(n=>{let i=YS(r.name,n),c=`${l}-${n}`,u=s(n===`gte`?`filters.from`:`filters.to`);return(0,b.jsxs)(`div`,{className:`flex min-w-36 flex-1 flex-col gap-1`,children:[(0,b.jsx)(kh,{htmlFor:c,className:`text-xs text-muted-foreground`,children:u}),(0,b.jsx)(RS,{id:c,label:`${r.label} ${u}`,value:t(a.get(i)),onChange:t=>o({[i]:e(n,t)||null})})]},n)})})]})}if(PC.has(r.type)&&i.includes(`gte`)&&i.includes(`lte`)){let e=r.type===`date`?`date`:r.type===`datetime`?`datetime-local`:`text`,t=e=>r.type===`datetime`&&e?new Date(e).toISOString():Nh(e.trim()).replace(/,/g,``),n=e=>e&&r.type===`datetime`?CC(e):e??``;return(0,b.jsxs)(`fieldset`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(`legend`,{className:`mb-1.5 text-sm font-medium`,children:r.label}),(0,b.jsx)(`div`,{className:`flex gap-2`,children:[`gte`,`lte`].map(i=>{let c=YS(r.name,i),u=`${l}-${i}`;return(0,b.jsxs)(`div`,{className:`flex flex-1 flex-col gap-1`,children:[(0,b.jsx)(kh,{htmlFor:u,className:`text-xs text-muted-foreground`,children:s(i===`gte`?`filters.from`:`filters.to`)}),(0,b.jsx)(KC,{id:u,type:e,inputMode:e===`text`?`decimal`:void 0,value:n(a.get(c)),onCommit:e=>o({[c]:t(e)||null})})]},i)})})]})}let u=i.includes(`contains`)?`contains`:i.includes(`eq`)?`eq`:void 0;if(!u)return null;let d=YS(r.name,u);return(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:l,children:u===`contains`?s(`filters.contains`,{field:r.label}):r.label}),(0,b.jsx)(KC,{id:l,value:a.get(d)??``,onCommit:e=>o({[d]:e.trim()||null})})]})}function UC({schema:e,params:t,onChange:n}){let r=X(),i=lC(e,t);return(0,b.jsx)(`ul`,{"aria-label":r(`filters.active`),className:`flex flex-wrap gap-2`,children:i.map(t=>(0,b.jsxs)(`li`,{className:`inline-flex h-9 items-center gap-1 rounded-full border border-primary bg-primary-soft ps-3 pe-1.5 text-[13px] font-semibold text-primary`,children:[(0,b.jsxs)(`span`,{className:`font-medium`,children:[t.label,`:`]}),t.ref?(0,b.jsx)(WC,{resource:e.name,chip:t}):(0,b.jsx)(`span`,{children:t.value}),(0,b.jsx)(`button`,{type:`button`,className:`rounded-full p-1 hover:bg-primary-soft`,"aria-label":r(`filters.removeChip`,{label:t.label}),onClick:()=>n(Object.fromEntries(t.remove.map(e=>[e,null]))),children:(0,b.jsx)(Sx,{className:`size-3.5`})})]},t.key))})}function WC({resource:e,chip:t}){let n=Qg(e,t.ref.field,t.ref.ids);if(!n.data)return(0,b.jsx)(`span`,{children:t.value});let r=new Map(n.data.items.map(e=>[String(e.id),e.title]));return(0,b.jsx)(`span`,{children:t.ref.prefix+t.ref.ids.map(e=>r.get(e)??`#${e}`).join(`, `)})}function GC({id:e,resource:t,field:n,operator:r,params:i,onChange:a}){let o=YS(n.name,r),s=(i.get(o)??``).split(`,`).filter(Boolean),c=Qg(t,n.name,s),l=new Map((c.data?.items??[]).map(e=>[String(e.id),e])),u=s.map(e=>l.get(e)??{id:e,title:`#${e}`});return(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:e,children:n.label}),(0,b.jsx)(GS,{id:e,resource:t,field:n,clearable:!0,value:r===`in`?u:u[0]??null,onChange:e=>{let t=Array.isArray(e)?e:e?[e]:[];a({[o]:t.length>0?t.map(e=>e.id).join(`,`):null})}})]})}function KC({id:e,value:t,type:n=`text`,inputMode:r,onCommit:i}){let[a,o]=(0,y.useState)(t);(0,y.useEffect)(()=>{o(t)},[t]);let s=()=>{a!==t&&i(a)};return(0,b.jsx)(Oh,{id:e,type:n,inputMode:r,value:a,onChange:e=>o(e.target.value),onBlur:s,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),s())}})}function qC({label:e,placeholder:t,value:n,className:r,onChange:i,onSubmit:a}){return(0,b.jsxs)(`form`,{role:`search`,className:W(`relative w-[300px] max-w-full`,r),onSubmit:e=>{e.preventDefault(),a()},children:[(0,b.jsx)(Eb,{className:`pointer-events-none absolute start-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`,"aria-hidden":!0}),(0,b.jsx)(Oh,{"aria-label":e,placeholder:t,value:n,className:`ps-8`,onChange:e=>i(e.target.value)})]})}function JC({chip:e,...t}){let n=X(),{field:r,onChange:i}=t,a=e&&(()=>i(Object.fromEntries(e.remove.map(e=>[e,null]))));return(0,b.jsxs)(Sh,{children:[(0,b.jsxs)(`span`,{className:W(`inline-flex h-8 items-center rounded-lg border border-dashed border-input`,e&&`border-solid bg-card`),children:[(0,b.jsx)(Ch,{asChild:!0,children:(0,b.jsxs)(`button`,{type:`button`,className:`inline-flex h-full items-center gap-1.5 rounded-lg px-2.5 text-[12.5px] font-medium outline-none hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50`,children:[e?(0,b.jsx)(Py,{className:`size-3.5 text-muted-foreground`,"aria-hidden":!0}):(0,b.jsx)(Av,{className:`size-3.5 text-muted-foreground`,"aria-hidden":!0}),r.label,e&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`span`,{className:`sr-only`,children:`:`}),(0,b.jsx)(`span`,{className:`h-4 w-px bg-border`,"aria-hidden":!0}),(0,b.jsx)(`span`,{className:`max-w-48 truncate rounded-[5px] bg-muted px-1.5 text-xs font-medium`,children:e.ref?(0,b.jsx)(WC,{resource:t.resource,chip:e}):e.value})]})]})}),a&&(0,b.jsx)(`button`,{type:`button`,className:`-ms-1 me-1 rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground`,"aria-label":n(`filters.removeChip`,{label:r.label}),onClick:a,children:(0,b.jsx)(Sx,{className:`size-3.5`})})]}),(0,b.jsx)(wh,{children:(0,b.jsx)(Th,{align:`start`,sideOffset:6,onOpenAutoFocus:r.type===`relation`?e=>e.preventDefault():void 0,className:`z-50 flex w-72 flex-col gap-3 rounded-[10px] border bg-popover p-3 text-popover-foreground shadow-lg outline-none`,children:(0,b.jsx)(RC,{...t,inline:!0})})})]})}var YC=`inline-flex h-9 items-center gap-1.5 rounded-full border border-input bg-card px-3 text-[13px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 data-[state=checked]:border-primary data-[state=checked]:bg-primary-soft data-[state=checked]:font-semibold data-[state=checked]:text-primary`;function XC({field:e,params:t,onChange:n}){let r=YS(e.name,`in`),i=(t.get(r)??``).split(`,`).filter(Boolean),a=e=>{let t=i.includes(e)?i.filter(t=>t!==e):[...i,e];n({[r]:t.length>0?t.join(`,`):null})};return(0,b.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,b.jsx)(`span`,{className:`text-sm font-medium`,"aria-hidden":!0,children:e.label}),(0,b.jsx)(`ul`,{"aria-label":e.label,className:`flex flex-wrap gap-2`,children:(e.enumValues??[]).map(t=>(0,b.jsx)(`li`,{children:(0,b.jsxs)(ff,{checked:i.includes(t),onCheckedChange:()=>a(t),className:YC,children:[(0,b.jsx)(mf,{children:(0,b.jsx)(bv,{className:`size-3.5`})}),MC(e,t)]})},t))})]})}function ZC({label:e,options:t,value:n,onChange:r}){return(0,b.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,b.jsx)(`span`,{className:`text-sm font-medium`,"aria-hidden":!0,children:e}),(0,b.jsx)(`div`,{role:`radiogroup`,"aria-label":e,className:`grid auto-cols-fr grid-flow-col gap-0.5 rounded-[10px] bg-muted p-[3px]`,children:t.map(([e,t])=>(0,b.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":n===e,className:W(`h-9 rounded-lg text-[13px] text-muted-foreground`,n===e&&`bg-card font-semibold text-foreground shadow-sm`),onClick:()=>r(e),children:t},e))})]})}var QC=[`auth.*`,`auth.login`,`auth.login_failed`,`auth.view_as`,`rbac.*`,`rbac.role.changed`,`rbac.user_roles.changed`,`page.*`],$C=[`*`,`created`,`updated`,`deleted`,`restored`,`purged`,`action.*`];function ew(){let{t:e,locale:t}=Y(),[n,r]=wo(),i=Gg(),a=Wg(),o=a.data?.audit.view===!0,s=tS(n),c=mt({queryKey:[`audit`,s],initialPageParam:void 0,queryFn:({pageParam:e})=>Q.audit(s,e),getNextPageParam:e=>e.next,staleTime:0,enabled:o,retry:!1}),l=c.data?.pages.flatMap(e=>e.entries)??[],u=new Set((i.data?.groups??[]).flatMap(e=>e.resources.map(e=>e.name))),d=[...new Set(l.map(e=>e.resource).filter(e=>e!==void 0&&u.has(e)))].sort(),f=ut({queries:d.map(e=>({queryKey:[`schema`,e,t],queryFn:()=>Q.schema(e),retry:!1}))}),p=e=>f[d.indexOf(e)]?.data,m=new Set((i.data?.groups??[]).flatMap(e=>e.pages.map(e=>e.name))),h=[...new Set(l.map(e=>e.meta?.page).filter(e=>e!==void 0&&m.has(e)))].sort(),g=ut({queries:h.map(e=>({queryKey:[`page`,e,t],queryFn:()=>Q.page(e),retry:!1}))}),_=e=>g[h.indexOf(e)]?.data?.schema.fields,v=(e,t)=>r(n=>QS(n,rS(e,t))),y=c.error instanceof fg&&(c.error.status===403||c.error.status===404);if(a.isPending)return(0,b.jsx)(G,{children:e(`common.loading`)});if(!o||y)return(0,b.jsxs)(`div`,{className:`flex max-w-4xl flex-col gap-4`,children:[(0,b.jsx)(E_,{children:e(`audit.title`)}),(0,b.jsx)(G,{tone:`error`,children:y?pg(c.error):e(a.data?.audit.enabled?`audit.notAllowed`:`audit.off`)})]});let x=(i.data?.groups??[]).flatMap(e=>e.resources),S=n.get(`resource`)??``;return(0,b.jsxs)(`div`,{className:`flex max-w-4xl flex-col gap-4`,children:[(0,b.jsx)(E_,{children:e(`audit.title`)}),(0,b.jsxs)(`fieldset`,{className:`grid gap-3 rounded-card border bg-card shadow-card p-3 sm:grid-cols-2 lg:grid-cols-3`,children:[(0,b.jsx)(`legend`,{className:`px-1 text-xs font-medium text-muted-foreground`,children:e(`filters.filters`)}),(0,b.jsx)(tw,{label:e(`audit.filter.actor`),value:n.get(`actor`)??``,onCommit:e=>v(`actor`,e)}),(0,b.jsx)(tw,{label:e(`audit.filter.event`),placeholder:e(`audit.filter.eventHint`),value:n.get(`event`)??``,onCommit:e=>v(`event`,e),hints:[...S?$C.map(e=>`${S}.${e}`):[],...QC]}),(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:`audit-resource`,children:e(`audit.filter.resource`)}),(0,b.jsxs)(`select`,{id:`audit-resource`,className:NC,value:S,onChange:e=>v(`resource`,e.target.value),children:[(0,b.jsx)(`option`,{value:``,children:e(`common.all`)}),S&&!x.some(e=>e.name===S)&&(0,b.jsx)(`option`,{value:S,children:S}),x.map(e=>(0,b.jsx)(`option`,{value:e.name,children:e.label},e.name))]})]}),(0,b.jsx)(tw,{label:e(`audit.filter.record`),placeholder:S?void 0:e(`audit.filter.recordHint`),value:S?n.get(`record`)??``:``,disabled:!S,onCommit:e=>v(`record`,e)}),[`from`,`to`].map(t=>(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:`audit-${t}`,children:e(`filters.${t}`)}),(0,b.jsx)(RS,{id:`audit-${t}`,label:e(`filters.${t}`),value:n.get(t)??``,onChange:e=>v(t,e)})]},t)),nS(n)&&(0,b.jsx)(`div`,{className:`flex items-end sm:col-span-2 lg:col-span-3`,children:(0,b.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>r(e=>QS(e,iS())),children:e(`filters.clear`)})})]}),c.isError&&(0,b.jsx)(D_,{children:pg(c.error)}),c.isPending?(0,b.jsx)(G,{children:e(`common.loading`)}):l.length===0?!c.isError&&(0,b.jsx)(G,{children:e(nS(n)?`audit.noMatches`:`audit.empty`)}):(0,b.jsx)(aS,{entries:l,now:new Date(c.dataUpdatedAt),names:Ix(i.data,p),schemaOf:p,pageFieldsOf:_,onActor:e=>v(`actor`,e),showSubject:!0}),c.hasNextPage&&(0,b.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,className:`self-center`,disabled:c.isFetchingNextPage,onClick:()=>void c.fetchNextPage(),children:e(c.isFetchingNextPage?`common.loading`:`list.loadMore`)})]})}function tw({label:e,value:t,onCommit:n,placeholder:r,disabled:i,hints:a}){let o=(0,y.useId)(),[s,c]=(0,y.useState)(t);(0,y.useEffect)(()=>c(t),[t]);let l=()=>{s.trim()!==t&&n(s)};return(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:o,children:e}),(0,b.jsx)(Oh,{id:o,type:`text`,dir:`auto`,value:s,placeholder:r,disabled:i,list:a?`${o}-hints`:void 0,autoComplete:`off`,spellCheck:!1,onChange:e=>c(e.target.value),onBlur:l,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),l())}}),a&&(0,b.jsx)(`datalist`,{id:`${o}-hints`,children:a.map(e=>(0,b.jsx)(`option`,{value:e},e))})]})}var nw={hidden:`rbac.rule.hidden`,view:`rbac.rule.readonly`,edit:`rbac.rule.edit`};function rw(){let{t:e}=Y(),[t,n]=wo(),r=t.get(`user`)??``,i=t.get(`resource`)??``,a=t.get(`record`)??``,o=ft({queryKey:[`rbac`,`catalog`],queryFn:Q.rbac.catalog}),s=ft({queryKey:[`rbac`,`user`,r],queryFn:()=>Q.rbac.user(r),enabled:r!==``}),[c,l]=(0,y.useState)(``),[u,d]=(0,y.useState)(i),[f,p]=(0,y.useState)(a),[m,h]=(0,y.useState)(r),g=ft({queryKey:[`rbac`,`users`,c,1],queryFn:()=>Q.rbac.users({search:c}),enabled:c.trim().length>0}),_=ft({queryKey:[`rbac`,`explain`,r,i,a],queryFn:()=>Q.rbac.explain({user:r,resource:i,record:a||void 0}),enabled:r!==``&&i!==``});function v(e){e.preventDefault();let t={};m&&(t.user=m),u&&(t.resource=u),f.trim()&&(t.record=f.trim()),n(t)}let x=m===r?s.data?.displayName:void 0;return(0,b.jsxs)(`div`,{className:`flex max-w-5xl flex-col gap-5`,children:[(0,b.jsx)(E_,{children:e(`debugger.title`)}),(0,b.jsx)(`p`,{className:`-mt-3 text-sm text-muted-foreground`,children:e(`debugger.intro`)}),(0,b.jsxs)(`form`,{onSubmit:v,className:`grid gap-4 rounded-card border bg-card shadow-card p-4 md:grid-cols-3`,"aria-label":e(`debugger.title`),children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:`debug-user`,children:e(`debugger.user`)}),(0,b.jsx)(Oh,{id:`debug-user`,placeholder:e(`rbac.searchUsers`),value:c,onChange:e=>l(e.target.value),autoComplete:`off`}),c.trim()&&(0,b.jsx)(`ul`,{"aria-label":e(`rbac.searchResults`),className:`flex flex-col rounded-md border text-sm`,children:(g.data?.items??[]).slice(0,6).map(e=>(0,b.jsx)(`li`,{children:(0,b.jsxs)(`button`,{type:`button`,className:`w-full px-2 py-1.5 text-start hover:bg-accent`,onClick:()=>{h(e.id),l(``)},children:[e.displayName,e.username&&(0,b.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,e.username]})]})},e.id))}),m&&(0,b.jsx)(`p`,{className:`text-sm`,"data-testid":`debug-chosen-user`,children:x??m})]}),(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:`debug-resource`,children:e(`debugger.resource`)}),(0,b.jsxs)(`select`,{id:`debug-resource`,className:`h-9 rounded-md border bg-background px-2 text-sm`,value:u,onChange:e=>d(e.target.value),children:[(0,b.jsx)(`option`,{value:``,children:`—`}),(o.data?.resources??[]).map(e=>(0,b.jsx)(`option`,{value:e.name,children:e.label},e.name))]})]}),(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:`debug-record`,children:e(`debugger.record`)}),(0,b.jsx)(Oh,{id:`debug-record`,dir:`ltr`,value:f,onChange:e=>p(e.target.value)})]}),(0,b.jsx)(`div`,{className:`md:col-span-3`,children:(0,b.jsx)(q,{type:`submit`,disabled:!m||!u,children:e(`debugger.explain`)})})]}),!r||!i?(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`debugger.pick`)}):_.isPending?(0,b.jsx)(G,{children:e(`common.loading`)}):_.isError?(0,b.jsx)(G,{tone:`error`,children:pg(_.error)}):(0,b.jsx)(aw,{data:_.data})]})}function iw({allowed:e}){let{t}=Y();return(0,b.jsx)(`span`,{className:W(`rounded-full px-2 py-0.5 text-xs font-medium`,e?`bg-green-500/15 text-green-800 dark:text-green-300`:`bg-destructive/10 text-destructive`),children:t(e?`debugger.allowed`:`debugger.denied`)})}function aw({data:e}){let{t,locale:n}=Y(),r=e=>e.kind===`group`?t(`debugger.source.group`,{group:e.group??``}):t(`debugger.source.${e.kind}`),i=e=>e===`all`?t(`debugger.allRows`):e.length===0?t(`debugger.noRows`):t(`debugger.someRows`,{scopes:e.join(`, `)});return(0,b.jsxs)(`div`,{className:`flex flex-col gap-5`,"data-testid":`explanation`,children:[(0,b.jsxs)(`section`,{"aria-labelledby":`debug-roles`,className:`flex flex-col gap-2`,children:[(0,b.jsxs)(`h2`,{id:`debug-roles`,className:`font-medium`,children:[t(`debugger.roles`),` · `,e.user.displayName]}),e.superuser?(0,b.jsx)(`p`,{className:`text-sm`,children:t(`debugger.superuser`)}):e.roles.length===0?(0,b.jsx)(`p`,{className:`text-sm`,children:t(`debugger.noRoles`)}):(0,b.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm`,children:e.roles.map(e=>(0,b.jsxs)(`li`,{children:[(0,b.jsx)(`span`,{className:`font-medium`,children:C_(e.label,n)||e.name}),` `,(0,b.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,e.sources.map(r).join(`, `),`)`]}),!e.known&&(0,b.jsx)(`span`,{className:`ms-2 text-destructive`,children:t(`debugger.unknownRole`)})]},e.name))})]}),(0,b.jsxs)(`section`,{"aria-labelledby":`debug-operations`,className:`flex flex-col gap-2`,children:[(0,b.jsxs)(`h2`,{id:`debug-operations`,className:`font-medium`,children:[t(`debugger.operations`),` · `,e.resource.label]}),(0,b.jsx)(`div`,{className:`overflow-x-auto rounded-card border bg-card shadow-card`,children:(0,b.jsx)(`table`,{className:`w-full text-sm`,children:(0,b.jsx)(`tbody`,{className:`divide-y`,children:e.operations.map(n=>(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`th`,{scope:`row`,className:`w-32 px-3 py-2 text-start font-medium`,children:t(`rbac.op.${n.operation}`)}),(0,b.jsx)(`td`,{className:`w-24 px-3 py-2`,children:(0,b.jsx)(iw,{allowed:n.allowed})}),(0,b.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground`,children:e.superuser?``:n.grantedBy.length===0?t(`debugger.noGrant`):n.grantedBy.map(e=>t(e.via?`debugger.viaUpdate`:`debugger.grant`,{pattern:e.pattern,role:e.role})).join(` · `)})]},n.operation))})})})]}),e.actions.length>0&&(0,b.jsxs)(`section`,{"aria-labelledby":`debug-actions`,className:`flex flex-col gap-2`,children:[(0,b.jsx)(`h2`,{id:`debug-actions`,className:`font-medium`,children:t(`debugger.actions`)}),(0,b.jsx)(`div`,{className:`overflow-x-auto rounded-card border bg-card shadow-card`,children:(0,b.jsx)(`table`,{className:`w-full text-sm`,children:(0,b.jsx)(`tbody`,{className:`divide-y`,children:e.actions.map(n=>(0,b.jsxs)(`tr`,{"data-action":n.name,children:[(0,b.jsx)(`th`,{scope:`row`,className:`w-32 px-3 py-2 text-start font-medium`,children:n.label}),(0,b.jsx)(`td`,{className:`w-24 px-3 py-2`,children:(0,b.jsx)(iw,{allowed:n.allowed})}),(0,b.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground`,children:e.superuser?``:[n.grantedBy.length===0?t(`debugger.noGrant`):n.grantedBy.map(e=>t(`debugger.grant`,{pattern:e.pattern,role:e.role})).join(` · `),...n.needsUpdate?[t(`debugger.needsUpdate`)]:[]].join(` — `)})]},n.name))})})})]}),(0,b.jsxs)(`section`,{"aria-labelledby":`debug-fields`,className:`flex flex-col gap-2`,children:[(0,b.jsx)(`h2`,{id:`debug-fields`,className:`font-medium`,children:t(`debugger.fields`)}),(0,b.jsx)(`div`,{className:`overflow-x-auto rounded-card border bg-card shadow-card`,children:(0,b.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,b.jsx)(`thead`,{className:`bg-muted/40 text-xs text-muted-foreground`,children:(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`th`,{className:`px-3 py-2 text-start font-medium`,children:t(`debugger.field`)}),(0,b.jsx)(`th`,{className:`px-3 py-2 text-start font-medium`,children:t(`debugger.result`)}),(0,b.jsx)(`th`,{className:`px-3 py-2 text-start font-medium`,children:t(`debugger.byRole`)})]})}),(0,b.jsx)(`tbody`,{className:`divide-y`,children:e.fields.map(e=>(0,b.jsxs)(`tr`,{"data-field":e.name,children:[(0,b.jsxs)(`th`,{scope:`row`,className:`px-3 py-2 text-start font-medium`,children:[e.label,e.restricted&&(0,b.jsx)(`span`,{className:`ms-2 rounded-full border px-1.5 text-xs font-normal text-muted-foreground`,children:t(`rbac.restricted`)})]}),(0,b.jsxs)(`td`,{className:`px-3 py-2`,children:[t(nw[e.level]),e.forced&&(0,b.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:t(`debugger.forced`)})]}),(0,b.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground`,children:e.byRole.map(e=>`${e.role}: ${t(nw[e.level])}${e.rule?` (${e.rule})`:``}${e.code?` (${e.code})`:``}`).join(` · `)})]},e.name))})]})})]}),(0,b.jsxs)(`section`,{"aria-labelledby":`debug-scopes`,className:`flex flex-col gap-2`,children:[(0,b.jsx)(`h2`,{id:`debug-scopes`,className:`font-medium`,children:t(`debugger.scopes`)}),(0,b.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm`,children:e.scopes.map(e=>(0,b.jsxs)(`li`,{children:[(0,b.jsxs)(`span`,{className:`font-medium`,children:[t(`rbac.op.${e.operation}`),`:`]}),` `,i(e.result),e.byRole.length>0&&(0,b.jsxs)(`span`,{className:`text-muted-foreground`,children:[` (`,e.byRole.map(e=>`${e.role}: ${i(e.scopes)}`).join(` · `),`)`]}),e.global.length>0&&(0,b.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,t(`debugger.globalScopes`,{scopes:e.global.join(`, `)})]})]},e.operation))})]}),e.record&&(0,b.jsxs)(`section`,{"aria-labelledby":`debug-record-title`,className:`flex flex-col gap-2`,children:[(0,b.jsx)(`h2`,{id:`debug-record-title`,className:`font-medium`,children:t(`debugger.recordTitle`,{id:e.record.id})}),(0,b.jsxs)(`ul`,{className:`flex flex-col gap-1 text-sm`,children:[[`view`,`update`,`delete`].map(n=>(0,b.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,"data-operation":n,children:[(0,b.jsx)(`span`,{className:`w-24 font-medium`,children:t(`rbac.op.${n}`)}),(0,b.jsx)(iw,{allowed:e.record[n]}),e.record.reasons[n]&&(0,b.jsx)(`span`,{className:`text-muted-foreground`,children:t(`debugger.reason.${e.record.reasons[n]}`)})]},n)),e.record.actions&&(0,b.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,"data-operation":`actions`,children:[(0,b.jsx)(`span`,{className:`w-24 font-medium`,children:t(`debugger.actions`)}),(0,b.jsx)(`span`,{className:`text-muted-foreground`,children:e.record.actions.length===0?t(`debugger.noRecordActions`):e.record.actions.map(t=>e.actions.find(e=>e.name===t)?.label??t).join(`, `)})]})]})]}),e.pages.length>0&&(0,b.jsxs)(`section`,{"aria-labelledby":`debug-pages`,className:`flex flex-col gap-2`,children:[(0,b.jsx)(`h2`,{id:`debug-pages`,className:`font-medium`,children:t(`debugger.pages`)}),(0,b.jsx)(`div`,{className:`overflow-x-auto rounded-card border bg-card shadow-card`,children:(0,b.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,b.jsx)(`thead`,{className:`bg-muted/40 text-xs text-muted-foreground`,children:(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`th`,{className:`px-3 py-2 text-start font-medium`,children:t(`rbac.page`)}),(0,b.jsx)(`th`,{className:`px-3 py-2 text-start font-medium`,children:t(`rbac.op.view`)}),(0,b.jsx)(`th`,{className:`px-3 py-2 text-start font-medium`,children:t(`rbac.op.update`)}),(0,b.jsx)(`th`,{className:`px-3 py-2 text-start font-medium`,children:t(`debugger.byRole`)})]})}),(0,b.jsx)(`tbody`,{className:`divide-y`,children:e.pages.map(n=>(0,b.jsxs)(`tr`,{"data-page":n.name,children:[(0,b.jsx)(`th`,{scope:`row`,className:`px-3 py-2 text-start font-medium`,children:n.label}),(0,b.jsx)(`td`,{className:`px-3 py-2`,"data-operation":`view`,children:(0,b.jsx)(iw,{allowed:n.view})}),(0,b.jsx)(`td`,{className:`px-3 py-2`,"data-operation":`update`,children:(0,b.jsx)(iw,{allowed:n.update})}),(0,b.jsx)(`td`,{className:`px-3 py-2 text-muted-foreground`,children:e.superuser?``:n.grantedBy.length===0?t(`debugger.noGrant`):n.grantedBy.map(e=>`${t(`debugger.grant`,{pattern:e.pattern,role:e.role})} (${e.code})`).join(` · `)})]},n.name))})]})})]})]})}function ow(){let{t:e,locale:t}=Y(),n=Wg(),r=ft({queryKey:[`rbac`,`groups`],queryFn:Q.rbac.groups});return r.isPending?(0,b.jsx)(G,{children:e(`common.loading`)}):r.isError?(0,b.jsx)(G,{tone:`error`,children:pg(r.error)}):(0,b.jsxs)(`div`,{className:`flex max-w-4xl flex-col gap-4`,children:[(0,b.jsx)(E_,{actions:n.data?.rbac.manage&&(0,b.jsx)(q,{asChild:!0,children:(0,b.jsxs)(bo,{to:`/-/groups/new`,children:[(0,b.jsx)(mb,{}),e(`rbac.newGroup`)]})}),children:e(`rbac.groups`)}),r.data.items.length===0&&(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`rbac.noGroups`)}),(0,b.jsx)(`ul`,{"aria-label":e(`rbac.groups`),className:`flex flex-col divide-y rounded-card border bg-card shadow-card empty:hidden`,children:r.data.items.map(n=>(0,b.jsx)(`li`,{children:(0,b.jsxs)(bo,{to:`/-/groups/${n.id}`,className:`flex flex-wrap items-center justify-between gap-2 px-4 py-3 hover:bg-muted/50`,children:[(0,b.jsx)(`span`,{className:`font-medium`,children:C_(n.label,t)||n.name}),(0,b.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`rbac.groupSummary`,{roles:n.roles.length,members:n.members.length})})]})},n.id))})]})}function sw(){let{t:e}=Y(),{id:t}=$i(),n=t===void 0,r=ft({queryKey:[`rbac`,`roles`],queryFn:Q.rbac.roles}),i=ft({queryKey:[`rbac`,`group`,t],queryFn:()=>Q.rbac.group(Number(t)),enabled:!n});return r.isPending||!n&&i.isPending?(0,b.jsx)(G,{children:e(`common.loading`)}):r.isError?(0,b.jsx)(G,{tone:`error`,children:pg(r.error)}):!n&&i.isError?(0,b.jsx)(G,{tone:`error`,children:pg(i.error)}):(0,b.jsx)(cw,{roles:r.data.items,group:n?void 0:i.data},t??`new`)}function cw({roles:e,group:t}){let{t:n,locale:r}=Y(),i=Yi(),a=S(),o=Wg().data?.rbac.manage!==!0,[s,c]=(0,y.useState)(t?.name??``),[l,u]=(0,y.useState)(T_(t?.label)),[d,f]=(0,y.useState)(t?.roles??[]),[p,m]=(0,y.useState)(t?.members??[]),[h,g]=(0,y.useState)(``),_=ft({queryKey:[`rbac`,`users`,h],queryFn:()=>Q.rbac.users({search:h}),enabled:h.trim().length>0}),v=ft({queryKey:[`rbac`,`users`,``,1],queryFn:()=>Q.rbac.users({})}),[x,C]=(0,y.useState)({}),w=e=>x[e]??v.data?.items.find(t=>t.id===e)?.displayName??e,[T,E]=(0,y.useState)(null),D=pt({mutationFn:()=>Q.rbac.saveGroup({name:s.trim(),label:w_(l)??null,roles:d,members:p},t?.id),onSuccess:async e=>{await a.invalidateQueries({queryKey:[`rbac`]}),await a.invalidateQueries({queryKey:[`session`]}),i(`/-/groups/${e.id}`,{replace:!0}),E(null)},onError:e=>E(pg(e))}),O=pt({mutationFn:()=>Q.rbac.deleteGroup(t.id),onSuccess:async()=>{await a.invalidateQueries({queryKey:[`rbac`]}),i(`/-/groups`)},onError:e=>E(pg(e))});function k(e){e.preventDefault(),o||D.mutate()}return(0,b.jsxs)(`form`,{onSubmit:k,className:`flex max-w-3xl flex-col gap-5`,"aria-label":n(`rbac.group`),children:[(0,b.jsx)(E_,{children:t?C_(t.label,r)||t.name:n(`rbac.newGroup`)}),T&&(0,b.jsx)(D_,{children:T}),(0,b.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:`group-name`,children:n(`rbac.name`)}),(0,b.jsx)(Oh,{id:`group-name`,dir:`ltr`,value:s,disabled:o,onChange:e=>c(e.target.value)})]}),dg.locales.map(e=>(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:`group-label-${e}`,children:n(`rbac.labelIn`,{language:e})}),(0,b.jsx)(Oh,{id:`group-label-${e}`,value:l[e]??``,disabled:o,onChange:t=>u({...l,[e]:t.target.value})})]},e))]}),(0,b.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,b.jsx)(`legend`,{className:`mb-1 font-medium`,children:n(`rbac.roles`)}),e.map(e=>(0,b.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,b.jsx)(`input`,{type:`checkbox`,className:`size-4 accent-primary`,checked:d.includes(e.name),disabled:o,onChange:t=>f(t.target.checked?[...d,e.name]:d.filter(t=>t!==e.name))}),C_(e.label,r)||e.name]},e.name))]}),(0,b.jsxs)(`section`,{"aria-labelledby":`members-title`,className:`flex flex-col gap-2`,children:[(0,b.jsx)(`h2`,{id:`members-title`,className:`font-medium`,children:n(`rbac.members`)}),(0,b.jsxs)(`ul`,{"aria-label":n(`rbac.members`),className:`flex flex-wrap gap-2`,children:[p.map(e=>(0,b.jsxs)(`li`,{className:`flex items-center gap-1 rounded-full border px-2 py-0.5 text-sm`,children:[w(e),!o&&(0,b.jsx)(`button`,{type:`button`,"aria-label":n(`picker.remove`,{name:w(e)}),onClick:()=>m(p.filter(t=>t!==e)),children:(0,b.jsx)(Sx,{className:`size-3.5`})})]},e)),p.length===0&&(0,b.jsx)(`li`,{className:`text-sm text-muted-foreground`,children:n(`rbac.noMembers`)})]}),!o&&(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:`member-search`,children:n(`rbac.addMember`)}),(0,b.jsx)(Oh,{id:`member-search`,value:h,placeholder:n(`rbac.searchUsers`),onChange:e=>g(e.target.value)}),(0,b.jsx)(`ul`,{"aria-label":n(`rbac.searchResults`),className:`flex flex-wrap gap-2`,children:(_.data?.items??[]).filter(e=>!p.includes(e.id)).map(e=>(0,b.jsx)(`li`,{children:(0,b.jsxs)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{C({...x,[e.id]:e.displayName}),m([...p,e.id])},children:[(0,b.jsx)(mb,{}),e.displayName,e.username?` (${e.username})`:``]})},e.id))})]})]}),!o&&(0,b.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,b.jsx)(q,{type:`submit`,disabled:D.isPending||!s.trim(),children:n(D.isPending?`form.saving`:`form.save`)}),(0,b.jsx)(q,{type:`button`,variant:`outline`,onClick:()=>i(`/-/groups`),children:n(`common.cancel`)}),t&&(0,b.jsx)(q,{type:`button`,variant:`outline`,className:`ms-auto`,disabled:O.isPending,onClick:()=>O.mutate(),children:n(`form.delete`)})]})]})}var lw=[`view`,`create`,`update`,`delete`,`purge`,`field`,`action`];function uw(e,t){let n=e.split(`.`),r=t.split(`.`),i=r[0]===`page`&&!lw.includes(r[1]??``)&&(r.length===2||r.length===3&&r[2]===`update`);if(n[0]===`*`&&n.length>1&&i)return!1;for(let e=0;e<n.length;e++){let t=n[e];if(t===`*`&&e===n.length-1)return r.length>e;if(e>=r.length||t!==`*`&&t!==r[e])return!1}return n.length===r.length}function dw(e){let t=[...e.global];for(let n of e.resources){for(let r of e.operations)t.push(`${n.name}.${r}`);for(let e of n.custom)t.push(`${n.name}.${e}`);for(let e of n.actions)t.push(`${n.name}.action.${e.name}`)}for(let n of e.pages)t.push(`page.${n.name}`,`page.${n.name}.update`);return t}function fw(e,t){return e.some(e=>uw(e,t))}function pw(e,t,n,r){if(n)return fw(e,t)?e:[...e,t];let i=[];for(let n of e)if(n!==t){if(n.includes(`*`)&&uw(n,t)){for(let e of r)e!==t&&uw(n,e)&&!i.includes(e)&&i.push(e);continue}i.push(n)}return i.filter(e=>e===t||!uw(e,t))}var mw=[`view`,`update`,`delete`];function hw(){let{t:e}=Y(),{name:t}=$i(),n=t===void 0,r=ft({queryKey:[`rbac`,`catalog`],queryFn:Q.rbac.catalog}),i=ft({queryKey:[`rbac`,`role`,t],queryFn:()=>Q.rbac.role(t),enabled:!n});return r.isPending||!n&&i.isPending?(0,b.jsx)(G,{children:e(`common.loading`)}):r.isError?(0,b.jsx)(G,{tone:`error`,children:pg(r.error)}):!n&&i.isError?(0,b.jsx)(G,{tone:`error`,children:pg(i.error)}):(0,b.jsx)(gw,{catalog:r.data,role:n?void 0:i.data},t??`new`)}function gw({catalog:e,role:t}){let{t:n,locale:r}=Y(),i=Yi(),a=S(),o=Wg(),s=t?.system===!0||o.data?.rbac.manage!==!0,c=dw(e),[l,u]=(0,y.useState)(t?.name??``),[d,f]=(0,y.useState)(T_(t?.label)),[p,m]=(0,y.useState)(t?.permissions??[]),[h,g]=(0,y.useState)(t?.fields??{}),[_,v]=(0,y.useState)(t?.scopes??{}),[x,C]=(0,y.useState)(null),[w,T]=(0,y.useState)(null),E=pt({mutationFn:()=>{let e={label:w_(d),permissions:p,fields:_w(h),scopes:_w(_)};return t?Q.rbac.updateRole(t.name,e):Q.rbac.createRole({name:l.trim(),...e})},onSuccess:async e=>{await a.invalidateQueries({queryKey:[`rbac`]}),await a.invalidateQueries({queryKey:[`session`]}),i(`/-/roles/${encodeURIComponent(e.name)}`,{replace:!0}),T(null)},onError:e=>T(e instanceof fg?[e.message,...Object.values(e.fields).flat()].join(` — `):pg(e))}),D=pt({mutationFn:()=>Q.rbac.deleteRole(t.name),onSuccess:async()=>{await a.invalidateQueries({queryKey:[`rbac`]}),i(`/-/roles`)},onError:e=>T(pg(e))}),O=(e,t)=>m(n=>pw(n,e,t,c)),k=(e,t,n)=>g(r=>{let i={...r,[e]:{...r[e]}};return n===``?delete i[e][t]:i[e][t]=n,i}),A=(e,t,n,r)=>v(i=>{let a=i[e]?.[t],o=new Set(Array.isArray(a)?a:a?[a]:[]);return r?o.add(n):o.delete(n),{...i,[e]:{...i[e],[t]:[...o]}}});function j(e){e.preventDefault(),s||E.mutate()}let M=[...new Set(e.resources.map(e=>e.group))];return(0,b.jsxs)(`form`,{onSubmit:j,className:`flex max-w-5xl flex-col gap-5`,"aria-label":n(`rbac.role`),children:[(0,b.jsx)(E_,{children:t?C_(t.label,r)||t.name:n(`rbac.newRole`)}),t?.system&&(0,b.jsx)(D_,{tone:`success`,children:n(`rbac.systemNote`)}),w&&(0,b.jsx)(D_,{children:w}),(0,b.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:`role-name`,children:n(`rbac.name`)}),(0,b.jsx)(Oh,{id:`role-name`,dir:`ltr`,value:l,disabled:!!t,onChange:e=>u(e.target.value)})]}),dg.locales.map(e=>(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:`role-label-${e}`,children:n(`rbac.labelIn`,{language:e})}),(0,b.jsx)(Oh,{id:`role-label-${e}`,value:d[e]??``,disabled:s,onChange:t=>f({...d,[e]:t.target.value})})]},e))]}),(0,b.jsxs)(`section`,{"aria-labelledby":`matrix-title`,className:`flex flex-col gap-2`,children:[(0,b.jsx)(`h2`,{id:`matrix-title`,className:`font-medium`,children:n(`rbac.matrix`)}),(0,b.jsx)(`div`,{className:`overflow-x-auto rounded-card border bg-card shadow-card`,children:(0,b.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{className:`border-b bg-muted/40`,children:[(0,b.jsx)(`th`,{className:`px-3 py-2 text-start font-medium`,children:n(`rbac.resource`)}),e.operations.map(e=>(0,b.jsx)(`th`,{className:`px-2 py-2 text-center font-medium`,children:n(`rbac.op.${e}`)},e)),(0,b.jsx)(`th`,{className:`w-0`})]})}),(0,b.jsx)(`tbody`,{children:M.map(t=>(0,b.jsx)(y.Fragment,{children:e.resources.filter(e=>e.group===t).map(t=>{let r=x===t.name,i=`role-details-${t.name}`;return(0,b.jsxs)(y.Fragment,{children:[(0,b.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,b.jsx)(`th`,{scope:`row`,className:`px-3 py-2 text-start font-normal`,children:t.label}),e.operations.map(e=>{let r=`${t.name}.${e}`;return(0,b.jsx)(`td`,{className:`px-2 py-2 text-center`,children:(0,b.jsx)(`input`,{type:`checkbox`,className:`size-4 accent-primary`,"aria-label":n(`rbac.grant`,{operation:n(`rbac.op.${e}`),resource:t.label}),checked:fw(p,r),disabled:s,onChange:e=>O(r,e.target.checked)})},e)}),(0,b.jsx)(`td`,{className:`px-2`,children:(0,b.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-expanded":r,"aria-controls":i,"aria-label":n(`rbac.details`,{resource:t.label}),onClick:()=>C(r?null:t.name),children:(0,b.jsx)(Sv,{className:W(`transition-transform`,r&&`rotate-180`)})})})]}),r&&(0,b.jsx)(`tr`,{id:i,className:`border-b bg-muted/20`,children:(0,b.jsx)(`td`,{colSpan:e.operations.length+2,className:`px-3 py-3`,children:(0,b.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,b.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:n(`rbac.fields`)}),t.fields.map(e=>(0,b.jsxs)(`label`,{className:`flex items-center justify-between gap-3`,children:[(0,b.jsxs)(`span`,{children:[e.label,e.restricted&&(0,b.jsx)(`span`,{className:`ms-2 rounded-full bg-amber-500/15 px-2 py-0.5 text-xs text-amber-800 dark:text-amber-300`,children:n(`rbac.restricted`)})]}),(0,b.jsxs)(`select`,{className:`h-8 rounded-lg border border-input bg-transparent px-2 text-sm`,value:h[t.name]?.[e.name]??``,disabled:s,"aria-label":n(`rbac.fieldRule`,{field:e.label}),onChange:n=>k(t.name,e.name,n.target.value),children:[(0,b.jsx)(`option`,{value:``,children:n(e.restricted?`rbac.rule.defaultHidden`:`rbac.rule.default`)}),(0,b.jsx)(`option`,{value:`hidden`,children:n(`rbac.rule.hidden`)}),(0,b.jsx)(`option`,{value:`readonly`,children:n(`rbac.rule.readonly`)}),(0,b.jsx)(`option`,{value:`edit`,children:n(`rbac.rule.edit`)})]})]},e.name))]}),(0,b.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[t.scopes.length>0&&(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,b.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:n(`rbac.scopes`)}),mw.map(e=>{let r=_[t.name]?.[e],i=Array.isArray(r)?r:r?[r]:[];return(0,b.jsxs)(`fieldset`,{className:`flex flex-wrap items-center gap-3`,children:[(0,b.jsxs)(`legend`,{className:`me-2 text-sm`,children:[n(`rbac.op.${e}`),`:`]}),t.scopes.map(n=>(0,b.jsxs)(`label`,{className:`flex items-center gap-1.5`,children:[(0,b.jsx)(`input`,{type:`checkbox`,className:`size-4 accent-primary`,checked:i.includes(n),disabled:s,onChange:r=>A(t.name,e,n,r.target.checked)}),n]},n)),i.length===0&&(0,b.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n(`rbac.allRows`)})]},e)})]}),t.actions.length>0&&(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,"data-actions":t.name,children:[(0,b.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:n(`rbac.actions`)}),t.actions.map(e=>{let n=`${t.name}.action.${e.name}`;return(0,b.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`input`,{type:`checkbox`,className:`size-4 accent-primary`,checked:fw(p,n),disabled:s,onChange:e=>O(n,e.target.checked)}),e.label,(0,b.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:n})]},e.name)}),t.actions.some(e=>e.target===`record`)&&(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`rbac.actionNote`)})]}),t.custom.length>0&&(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,b.jsx)(`h3`,{className:`text-xs font-medium text-muted-foreground`,children:n(`rbac.custom`)}),t.custom.map(e=>{let n=`${t.name}.${e}`;return(0,b.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`input`,{type:`checkbox`,className:`size-4 accent-primary`,checked:fw(p,n),disabled:s,onChange:e=>O(n,e.target.checked)}),(0,b.jsx)(`code`,{className:`text-xs`,children:n})]},e)})]})]})]})})})]},t.name)})},t))})]})})]}),e.pages.length>0&&(0,b.jsxs)(`section`,{"aria-labelledby":`pages-title`,className:`flex flex-col gap-2`,children:[(0,b.jsx)(`h2`,{id:`pages-title`,className:`font-medium`,children:n(`rbac.pages`)}),(0,b.jsx)(`div`,{className:`overflow-x-auto rounded-card border bg-card shadow-card`,children:(0,b.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{className:`border-b bg-muted/40`,children:[(0,b.jsx)(`th`,{className:`px-3 py-2 text-start font-medium`,children:n(`rbac.page`)}),(0,b.jsx)(`th`,{className:`px-2 py-2 text-center font-medium`,children:n(`rbac.op.view`)}),(0,b.jsx)(`th`,{className:`px-2 py-2 text-center font-medium`,children:n(`rbac.op.update`)})]})}),(0,b.jsx)(`tbody`,{children:e.pages.map(e=>{let t=`page.${e.name}`,r=`${t}.update`,i=fw(p,r)&&!fw(p,t);return(0,b.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,b.jsx)(`th`,{scope:`row`,className:`px-3 py-2 text-start font-normal`,children:e.label}),(0,b.jsx)(`td`,{className:`px-2 py-2 text-center`,children:(0,b.jsx)(`input`,{type:`checkbox`,className:`size-4 accent-primary`,"aria-label":n(`rbac.grant`,{operation:n(`rbac.op.view`),resource:e.label}),title:i?n(`rbac.viewImplied`):void 0,checked:i||fw(p,t),disabled:s||i,onChange:e=>O(t,e.target.checked)})}),(0,b.jsx)(`td`,{className:`px-2 py-2 text-center`,children:(0,b.jsx)(`input`,{type:`checkbox`,className:`size-4 accent-primary`,"aria-label":n(`rbac.grant`,{operation:n(`rbac.op.update`),resource:e.label}),checked:fw(p,r),disabled:s,onChange:e=>O(r,e.target.checked)})})]},e.name)})})]})})]}),e.global.length>0&&(0,b.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,b.jsx)(`legend`,{className:`mb-1 font-medium`,children:n(`rbac.global`)}),e.global.map(e=>(0,b.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,b.jsx)(`input`,{type:`checkbox`,className:`size-4 accent-primary`,checked:fw(p,e),disabled:s,onChange:t=>O(e,t.target.checked)}),(0,b.jsx)(`code`,{className:`text-xs`,children:e})]},e))]}),!s&&(0,b.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,b.jsx)(q,{type:`submit`,disabled:E.isPending||!t&&!l.trim(),children:n(E.isPending?`form.saving`:`form.save`)}),(0,b.jsx)(q,{type:`button`,variant:`outline`,onClick:()=>i(`/-/roles`),children:n(`common.cancel`)}),t&&(0,b.jsx)(q,{type:`button`,variant:`outline`,className:`ms-auto`,disabled:D.isPending,onClick:()=>D.mutate(),children:n(`form.delete`)})]})]})}function _w(e){let t=Object.entries(e).map(([e,t])=>[e,Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0&&!(Array.isArray(e)&&e.length===0)))]).filter(([,e])=>Object.keys(e).length>0);return t.length>0?Object.fromEntries(t):void 0}function vw(){let{t:e,locale:t}=Y(),n=Wg(),r=S(),i=ft({queryKey:[`rbac`,`roles`],queryFn:Q.rbac.roles}),a=(0,y.useRef)(null),[o,s]=(0,y.useState)(null),c=n.data?.rbac.manage===!0,l=pt({mutationFn:async e=>Q.rbac.importRoles(JSON.parse(await e.text())),onSuccess:async t=>{s(e(`rbac.imported`,{count:t.imported.length})),await r.invalidateQueries({queryKey:[`rbac`]})}});async function u(){let e=await Q.rbac.exportRoles(),t=URL.createObjectURL(new Blob([JSON.stringify(e,null,2)],{type:`application/json`})),n=document.createElement(`a`);n.href=t,n.download=`roles.json`,n.click(),URL.revokeObjectURL(t)}return i.isPending?(0,b.jsx)(G,{children:e(`common.loading`)}):i.isError?(0,b.jsx)(G,{tone:`error`,children:pg(i.error)}):(0,b.jsxs)(`div`,{className:`flex max-w-4xl flex-col gap-4`,children:[(0,b.jsx)(E_,{actions:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(q,{variant:`outline`,onClick:()=>void u(),children:[(0,b.jsx)(Wv,{}),e(`rbac.export`)]}),c&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`input`,{ref:a,type:`file`,accept:`application/json,.json`,className:`hidden`,"aria-label":e(`rbac.importFile`),onChange:e=>{let t=e.target.files?.[0];t&&l.mutate(t),e.target.value=``}}),(0,b.jsxs)(q,{variant:`outline`,onClick:()=>a.current?.click(),children:[(0,b.jsx)(cx,{}),e(`rbac.import`)]}),(0,b.jsx)(q,{asChild:!0,children:(0,b.jsxs)(bo,{to:`/-/roles/new`,children:[(0,b.jsx)(mb,{}),e(`rbac.newRole`)]})})]})]}),children:e(`rbac.roles`)}),o&&(0,b.jsx)(D_,{tone:`success`,children:o}),l.isError&&(0,b.jsx)(D_,{children:l.error instanceof SyntaxError?e(`rbac.notJson`):pg(l.error)}),(0,b.jsx)(`ul`,{"aria-label":e(`rbac.roles`),className:`flex flex-col divide-y rounded-card border bg-card shadow-card`,children:i.data.items.map(n=>(0,b.jsx)(`li`,{children:(0,b.jsxs)(bo,{to:`/-/roles/${encodeURIComponent(n.name)}`,className:`flex flex-wrap items-center justify-between gap-2 px-4 py-3 hover:bg-muted/50`,children:[(0,b.jsxs)(`span`,{className:`flex flex-col`,children:[(0,b.jsx)(`span`,{className:`font-medium`,children:C_(n.label,t)||n.name}),(0,b.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.name})]}),(0,b.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[e(`rbac.permissionCount`,{count:n.permissions.length}),n.system&&(0,b.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5`,children:e(`rbac.system`)})]})]})},n.name))})]})}function yw(){let{t:e}=Y(),t=Wg(),[n,r]=wo(),i=n.get(`search`)??``,a=Math.max(1,Number(n.get(`page`))||1),[o,s]=(0,y.useState)(i),c=ft({queryKey:[`rbac`,`users`,i,a],queryFn:()=>Q.rbac.users({search:i,page:a})});if(c.isPending)return(0,b.jsx)(G,{children:e(`common.loading`)});if(c.isError)return(0,b.jsx)(G,{tone:`error`,children:pg(c.error)});let{items:l,total:u,pageSize:d,capabilities:f}=c.data;return(0,b.jsxs)(`div`,{className:`flex max-w-4xl flex-col gap-4`,children:[(0,b.jsx)(E_,{actions:t.data?.rbac.manage&&f.create&&(0,b.jsx)(q,{asChild:!0,children:(0,b.jsxs)(bo,{to:`/-/users/new`,children:[(0,b.jsx)(mb,{}),e(`rbac.newUser`)]})}),children:e(`rbac.users`)}),!f.list&&(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`rbac.usersFromMemberships`)}),(0,b.jsxs)(`form`,{role:`search`,className:`flex gap-2`,onSubmit:e=>{e.preventDefault(),r(o.trim()?{search:o.trim()}:{})},children:[(0,b.jsx)(Oh,{"aria-label":e(`rbac.searchUsers`),placeholder:e(`rbac.searchUsers`),value:o,onChange:e=>s(e.target.value)}),(0,b.jsx)(q,{type:`submit`,variant:`outline`,children:e(`filters.search`)})]}),(0,b.jsxs)(`ul`,{"aria-label":e(`rbac.users`),className:`flex flex-col divide-y rounded-card border bg-card shadow-card`,children:[l.map(t=>(0,b.jsx)(`li`,{children:(0,b.jsxs)(bo,{to:`/-/users/${encodeURIComponent(t.id)}`,className:`flex flex-wrap items-center justify-between gap-2 px-4 py-3 hover:bg-muted/50`,children:[(0,b.jsxs)(`span`,{className:`flex flex-col`,children:[(0,b.jsx)(`span`,{className:`font-medium`,children:t.displayName}),(0,b.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:[t.username,t.email].filter(Boolean).join(` · `)})]}),(0,b.jsxs)(`span`,{className:`flex flex-wrap items-center gap-1.5 text-xs`,children:[t.isSuperuser&&(0,b.jsx)(`span`,{className:`rounded-full bg-purple-500/15 px-2 py-0.5 text-purple-800 dark:text-purple-300`,children:e(`rbac.superuser`)}),t.isActive===!1&&(0,b.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5 text-muted-foreground`,children:e(`rbac.inactive`)}),t.twoFactor&&(0,b.jsx)(`span`,{className:`rounded-full bg-green-500/15 px-2 py-0.5 text-green-800 dark:text-green-300`,children:e(`rbac.twoFactor`)}),t.roles.map(e=>(0,b.jsx)(`span`,{className:`rounded-full border px-2 py-0.5`,children:e},e))]})]})},t.id)),l.length===0&&(0,b.jsx)(`li`,{className:`px-4 py-3 text-sm text-muted-foreground`,children:e(`list.noMatches`)})]}),u>d&&(0,b.jsxs)(`div`,{className:`flex items-center justify-end gap-2 text-sm`,children:[(0,b.jsx)(q,{variant:`outline`,size:`sm`,disabled:a<=1,onClick:()=>r({...i?{search:i}:{},page:String(a-1)}),children:e(`list.previousPage`)}),(0,b.jsx)(`span`,{children:e(`list.pageOf`,{page:a,pages:Math.ceil(u/d)})}),(0,b.jsx)(q,{variant:`outline`,size:`sm`,disabled:a*d>=u,onClick:()=>r({...i?{search:i}:{},page:String(a+1)}),children:e(`list.nextPage`)})]})]})}function bw(){let{t:e}=Y(),{id:t}=$i(),n=t===void 0,r=ft({queryKey:[`rbac`,`roles`],queryFn:Q.rbac.roles}),i=ft({queryKey:[`rbac`,`groups`],queryFn:Q.rbac.groups}),a=ft({queryKey:[`rbac`,`user`,t],queryFn:()=>Q.rbac.user(t),enabled:!n}),o=ft({queryKey:[`rbac`,`users`,``,1],queryFn:()=>Q.rbac.users({})});if(r.isPending||i.isPending||o.isPending||!n&&a.isPending)return(0,b.jsx)(G,{children:e(`common.loading`)});let s=r.error??i.error??o.error??(n?null:a.error);return s?(0,b.jsx)(G,{tone:`error`,children:pg(s)}):(0,b.jsx)(xw,{user:n?void 0:a.data,roles:r.data.items,groups:i.data.items,capabilities:o.data.capabilities},t??`new`)}function xw({user:e,roles:t,groups:n,capabilities:r}){let{t:i,locale:a}=Y(),o=Yi(),s=S(),c=Wg(),l=c.data?.rbac.manage===!0,u=c.data?.user.isSuperuser===!0,[d,f]=(0,y.useState)(``),[p,m]=(0,y.useState)(e?.displayName??``),[h,g]=(0,y.useState)(e?.email??``),[_,v]=(0,y.useState)(e?.isActive!==!1),[x,C]=(0,y.useState)(e?.isSuperuser===!0),[w,T]=(0,y.useState)(e?.roles??[]),[E,D]=(0,y.useState)(e?.groups??[]),[O,k]=(0,y.useState)(``),[A,j]=(0,y.useState)({}),[M,N]=(0,y.useState)(null),[ee,te]=(0,y.useState)(null),P=l&&(!e?.isSuperuser||u),ne=e=>{e instanceof fg&&Object.keys(e.fields).length>0?(j(e.fields),N(e.message)):(j({}),N(pg(e)))},re=pt({mutationFn:()=>{let t=r.update||!e?{displayName:p,email:h||null,isActive:_,...u?{isSuperuser:x}:{}}:{};return e?Q.rbac.updateUser(e.id,{...t,roles:w,groups:E}):Q.rbac.createUser({username:d,displayName:p,email:h||null,password:O,...u?{isSuperuser:x}:{},roles:w,groups:E})},onSuccess:async e=>{await s.invalidateQueries({queryKey:[`rbac`]}),j({}),N(null),te(i(`rbac.saved`)),o(`/-/users/${encodeURIComponent(e.id)}`,{replace:!0})},onError:ne}),ie=pt({mutationFn:()=>Q.rbac.resetTwoFactor(e.id),onSuccess:async()=>{await s.invalidateQueries({queryKey:[`rbac`]}),N(null),te(i(`rbac.twoFactorReset`))},onError:ne}),ae=!!e&&u&&!c.data?.viewAs&&e.id!==c.data?.user.id&&e.isActive!==!1,oe=pt({mutationFn:()=>Q.rbac.setPassword(e.id,O),onSuccess:()=>{k(``),j({}),N(null),te(i(`rbac.passwordSet`))},onError:ne});function se(e){e.preventDefault(),te(null),P&&re.mutate()}let ce=(t,n,i,a,o={})=>(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:t,children:n}),(0,b.jsx)(Oh,{id:t,value:i,disabled:!P||!!e&&!r.update,onChange:e=>a(e.target.value),"aria-invalid":A[t.replace(`user-`,``)]?!0:void 0,...o}),A[t.replace(`user-`,``)]&&(0,b.jsx)(`p`,{className:`text-sm text-destructive`,children:A[t.replace(`user-`,``)].join(` `)})]});return(0,b.jsxs)(`form`,{onSubmit:se,className:`flex max-w-3xl flex-col gap-5`,"aria-label":i(`rbac.user`),children:[(0,b.jsx)(E_,{actions:ae&&(0,b.jsxs)(q,{type:`button`,variant:`outline`,onClick:()=>{wg(e.id),s.clear(),o(`/`)},children:[(0,b.jsx)(Qv,{}),i(`viewAs.start`)]}),children:e?e.displayName:i(`rbac.newUser`)}),M&&(0,b.jsx)(D_,{children:M}),ee&&(0,b.jsx)(D_,{tone:`success`,children:ee}),e?.isSuperuser&&!u&&(0,b.jsx)(D_,{tone:`success`,children:i(`rbac.superuserNote`)}),(0,b.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[!e&&ce(`user-username`,i(`auth.username`),d,f,{dir:`ltr`,autoComplete:`off`}),ce(`user-displayName`,i(`rbac.displayName`),p,m),ce(`user-email`,i(`rbac.email`),h,g,{type:`email`,dir:`ltr`}),!e&&ce(`user-password`,i(`auth.password`),O,k,{type:`password`,autoComplete:`new-password`})]}),(0,b.jsxs)(`div`,{className:`flex flex-wrap gap-6 text-sm`,children:[(0,b.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`input`,{type:`checkbox`,className:`size-4 accent-primary`,checked:_,disabled:!P||!!e&&!r.update,onChange:e=>v(e.target.checked)}),i(`rbac.active`)]}),u&&(0,b.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`input`,{type:`checkbox`,className:`size-4 accent-primary`,checked:x,disabled:!P,onChange:e=>C(e.target.checked)}),i(`rbac.superuser`)]})]}),(0,b.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,b.jsx)(`legend`,{className:`mb-1 font-medium`,children:i(`rbac.roles`)}),t.map(e=>(0,b.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,b.jsx)(`input`,{type:`checkbox`,className:`size-4 accent-primary`,checked:w.includes(e.name),disabled:!P,onChange:t=>T(t.target.checked?[...w,e.name]:w.filter(t=>t!==e.name))}),C_(e.label,a)||e.name]},e.name))]}),n.length>0&&(0,b.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,b.jsx)(`legend`,{className:`mb-1 font-medium`,children:i(`rbac.groups`)}),n.map(e=>(0,b.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,b.jsx)(`input`,{type:`checkbox`,className:`size-4 accent-primary`,checked:E.includes(e.id),disabled:!P,onChange:t=>D(t.target.checked?[...E,e.id]:E.filter(t=>t!==e.id))}),C_(e.label,a)||e.name]},e.id))]}),P&&(0,b.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,b.jsx)(q,{type:`submit`,disabled:re.isPending,children:i(re.isPending?`form.saving`:e?`form.save`:`rbac.createUser`)}),(0,b.jsx)(q,{type:`button`,variant:`outline`,onClick:()=>o(`/-/users`),children:i(`common.cancel`)})]}),e&&P&&r.password&&(0,b.jsxs)(`section`,{"aria-labelledby":`set-password`,className:`flex flex-col gap-2 rounded-card border bg-card shadow-card p-4`,children:[(0,b.jsx)(`h2`,{id:`set-password`,className:`font-medium`,children:i(`rbac.setPassword`)}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2`,children:[(0,b.jsxs)(`div`,{className:`flex flex-1 flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:`user-new-password`,children:i(`auth.newPassword`)}),(0,b.jsx)(Oh,{id:`user-new-password`,type:`password`,autoComplete:`new-password`,value:O,onChange:e=>k(e.target.value)})]}),(0,b.jsx)(q,{type:`button`,variant:`outline`,disabled:!O||oe.isPending,onClick:()=>oe.mutate(),children:i(`rbac.setPassword`)})]}),A.password&&e&&(0,b.jsx)(`p`,{className:`text-sm text-destructive`,children:A.password.join(` `)}),(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i(`rbac.setPasswordNote`)})]}),e?.twoFactor&&P&&r.resetTwoFactor&&(0,b.jsxs)(`section`,{"aria-labelledby":`reset-two-factor`,className:`flex flex-col gap-2 rounded-card border bg-card shadow-card p-4`,children:[(0,b.jsx)(`h2`,{id:`reset-two-factor`,className:`font-medium`,children:i(`rbac.resetTwoFactor`)}),(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i(`rbac.resetTwoFactorNote`)}),(0,b.jsx)(`div`,{children:(0,b.jsx)(q,{type:`button`,variant:`outline`,disabled:ie.isPending,onClick:()=>ie.mutate(),children:i(`rbac.resetTwoFactor`)})})]})]})}function Sw(e){if(!e.menu)return e.groups.map(e=>({...e,items:[...e.resources.map(e=>({kind:`resource`,name:e.name,label:e.label,...e.icon?{icon:e.icon}:{}})),...e.pages.map(e=>({kind:`page`,name:e.name,label:e.label,...e.icon?{icon:e.icon}:{}}))]}));let{sections:t,advanced:n}=e.menu;return[...t,...n.items.length>0?[n]:[]].map(e=>{let t=[],r=[],i=e.items.map(n=>n.kind===`resource`?(t.push({name:n.resource,label:n.label,...n.icon?{icon:n.icon}:{},creatable:n.creatable,searchable:n.searchable}),{kind:`resource`,name:n.resource,label:n.label,...n.icon?{icon:n.icon}:{},...n.badge?{badge:`${e.key}.${n.resource}`}:{}}):n.kind===`page`?(r.push({name:n.page,label:n.label,...n.icon?{icon:n.icon}:{}}),{kind:`page`,name:n.page,label:n.label,...n.icon?{icon:n.icon}:{}}):n);return{key:e.key,label:e.label,...e.icon?{icon:e.icon}:{},resources:t,pages:r,items:i,...e===n?{advanced:!0}:{}}})}function Cw(e,t){let n=e.flatMap(e=>e.kind===`resource`&&e.badge&&t?.[e.badge]?[t[e.badge]]:[]);if(n.length!==0)return{count:n.reduce((e,t)=>e+t.count,0),estimate:n.some(e=>e.estimate)}}function ww({menu:e,current:t}){return e&&!t}function Tw(e){return Mh(e).toLocaleLowerCase().replace(/[يى]/g,`ی`).replace(/ك/g,`ک`).replace(//g,` `)}function Ew(e,t){let n=Tw(e);return Tw(t).split(/\s+/).filter(Boolean).every(e=>n.includes(e))}function Dw(e,t,n,r=[]){let i=[],a=[],o=Sw(e),s=t.trim()!==``;for(let r of o){o.length>1&&Ew(r.label,t)&&i.push({id:`group:${r.key}`,section:`go`,label:r.label,to:`/g/${r.key}`,...r.icon?{icon:r.icon}:{}});for(let o of r.resources){let c=o.icon??r.icon;Ew(`${o.label} ${r.label}`,t)&&i.push({id:`go:${o.name}`,section:`go`,label:o.label,detail:r.label,to:`/${o.name}`,...c?{icon:c}:{}});let l=n(o.label),u=s||e.menu!==void 0&&!r.advanced&&a.length<3;o.creatable&&u&&Ew(l,t)&&a.push({id:`new:${o.name}`,section:`actions`,label:l,to:`/${o.name}/new`})}for(let e of r.pages){let n=e.icon??r.icon;Ew(`${e.label} ${r.label}`,t)&&i.push({id:`page:${e.name}`,section:`go`,label:e.label,detail:r.label,to:`/p/${e.name}`,...n?{icon:n}:{}})}}let c=r.filter(e=>Ew(e.label,t)).map(e=>({id:e.id,section:`actions`,label:e.label}));return[...i,...a,...c]}var Ow=`nma.theme`,kw=`oklch(0.145 0 0)`,Aw=`oklch(0.985 0 0)`;function jw(){try{let e=localStorage.getItem(Ow);if(e===`light`||e===`dark`||e===`system`)return e}catch{}return`system`}function Mw(e,t){return e===`system`?t?`dark`:`light`:e}var Nw=()=>typeof matchMedia==`function`&&matchMedia(`(prefers-color-scheme: dark)`).matches;function Pw(e){let t=Mw(e,Nw());document.documentElement.classList.toggle(`dark`,t===`dark`),document.documentElement.style.colorScheme=t}var Fw=`nma-theme`;function Iw(e){try{localStorage.setItem(Ow,e)}catch{}Pw(e),typeof window<`u`&&window.dispatchEvent(new Event(Fw))}function Lw(){Iw(Mw(jw(),Nw())===`dark`?`light`:`dark`)}function Rw(e){if(typeof matchMedia!=`function`)return()=>void 0;let t=matchMedia(`(prefers-color-scheme: dark)`),n=()=>{e()===`system`&&Pw(`system`)};return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)}function zw(e){let t,n=/^#([0-9a-f]{3,8})$/i.exec(e.trim())?.[1];if(n){let e=n.length<=4?[...n.slice(0,3)].map(e=>e+e).join(``):n.slice(0,6);t=[0,2,4].map(t=>parseInt(e.slice(t,t+2),16))}else{let n=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/i.exec(e.trim());n&&(t=n.slice(1,4).map(Number))}if(!t)return;let[r,i,a]=t.map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*r+.7152*i+.0722*a}function Bw(e){let t={};if(e.primaryColor){let n=zw(e.primaryColor),r=e.primaryForeground??(n!==void 0&&n>.45?kw:Aw);Object.assign(t,{"--primary":e.primaryColor,"--primary-foreground":r,"--ring":e.primaryColor,"--sidebar-primary":e.primaryColor,"--sidebar-primary-foreground":r})}return e.radius&&Object.assign(t,{"--nma-radius-control":e.radius,"--nma-radius-card":`calc(${e.radius} * 1.5)`}),t}function Vw(e){for(let[t,n]of Object.entries(Bw(e)))document.documentElement.style.setProperty(t,n)}var Hw=`nma.accent`,Uw=`nma-accent`,Ww=/^(#[0-9a-f]{3,8}|(rgb|rgba|hsl|hsla|oklch|oklab|lch|lab)\([0-9.,%\s/+-]+(deg|turn|rad)?[0-9.,%\s/+-]*\))$/i;function Gw(e){return(e.personal&&Ww.test(e.personal.trim())?e.personal:null)??e.admin??e.branding??void 0}function Kw(){try{return localStorage.getItem(Hw)}catch{return null}}function qw(e){try{e===null?localStorage.removeItem(Hw):localStorage.setItem(Hw,e)}catch{}}var Jw=null,Yw;function Xw(e={}){`admin`in e&&(Jw=e.admin??null),`branding`in e&&(Yw=e.branding);let t=Gw({personal:Kw(),admin:Jw,branding:Yw}),n=[`--primary`,`--primary-foreground`,`--ring`,`--sidebar-primary`,`--sidebar-primary-foreground`];if(t)for(let[e,n]of Object.entries(Bw({primaryColor:t})))document.documentElement.style.setProperty(e,n);else for(let e of n)document.documentElement.style.removeProperty(e);typeof window<`u`&&window.dispatchEvent(new Event(Uw))}var Zw={archive:H_,ban:Q_,bell:ev,book:nv,box:iv,boxes:ov,briefcase:cv,building:uv,calendar:gv,chart:vv,check:bv,clock:Mv,"credit-card":Rv,database:Bv,dollar:Hv,file:iy,"file-text":ny,folder:oy,globe:cy,heart:fy,history:Sb,home:my,image:vy,inbox:by,key:Sy,layers:Ey,link:Ay,list:Iy,lock:Ry,mail:Hy,map:Ky,"map-pin":Wy,message:Xy,package:nb,phone:cb,printer:gb,receipt:vb,refresh:bb,send:Ob,server:Ab,settings:Mb,shield:Ib,"shopping-bag":Rb,cart:Bb,"shopping-cart":Bb,star:Wb,store:Kb,tag:Xb,tags:Qb,ticket:ex,truck:ox,user:fx,users:mx,video:gx,wallet:vx,wrench:bx,x:Sx,zap:wx};Object.keys(Zw);function Qw(e,t){return $w(e)??(t===`group`?oy:t===`page`?Mb:ny)}function $w(e){return e&&Object.hasOwn(Zw,e)?Zw[e]:void 0}function eT(e,t){let[n,r]=(0,y.useState)(e);return(0,y.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function tT(){let{t:e}=Y(),t=Yi(),n=Gg(),r=Wg(),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(``),[c,l]=(0,y.useState)(0),u=(0,y.useId)(),d=(0,y.useRef)(null);(0,y.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&!e.altKey&&!e.shiftKey&&e.key.toLowerCase()===`k`&&(e.preventDefault(),a(e=>!e))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let f=eT(o.trim(),250),p=f.length>=2&&(n.data?.groups.some(e=>e.resources.some(e=>e.searchable))??!1),m=ft({queryKey:[`search`,f],queryFn:()=>Q.search(f),enabled:i&&p,staleTime:1e4}),h=e=>{let t=n.data?Sw(n.data).find(t=>t.resources.some(t=>t.name===e)):void 0;return t?.resources.find(t=>t.name===e)?.icon??t?.icon},g=n.data?Dw(n.data,o,t=>e(`palette.new`,{name:t}),[{id:`theme`,label:e(`palette.toggleTheme`)}]):[],_=[...p&&o.trim()===f?(m.data?.groups??[]).flatMap(e=>e.items.map(t=>({id:`record:${e.resource}:${t._id}`,section:`records`,...h(e.resource)?{icon:h(e.resource)}:{},label:t._title,detail:e.label,to:`/${e.resource}/${encodeURIComponent(t._id)}`}))):[],...g.filter(e=>e.section===`actions`),...g.filter(e=>e.section===`go`),...r.data?.audit.view&&Ew(e(`audit.title`),o)?[{id:`audit`,section:`go`,label:e(`audit.title`),to:`/-/audit`}]:[]],v=Math.min(c,Math.max(0,_.length-1));(0,y.useEffect)(()=>l(0),[o,m.data]),(0,y.useEffect)(()=>{d.current?.querySelector(`[data-index="${v}"]`)?.scrollIntoView({block:`nearest`})},[v]);function x(e){e&&(a(!1),e.to?t(e.to):e.id===`theme`&&Lw())}function S(e){if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),_.length===0)return;l((v+(e.key===`ArrowDown`?1:-1)+_.length)%_.length)}else e.key===`Enter`&&(e.preventDefault(),x(_[v]))}let C=[[`records`,e(`palette.records`)],[`actions`,e(`palette.actions`)],[`go`,e(`palette.goTo`)]],w=e=>`${u}-${e}`,T=p&&(m.isFetching||o.trim()!==f)?e(`palette.searching`):_.length===0?e(`palette.noResults`):``;return(0,b.jsxs)(jd,{open:i,onOpenChange:e=>{a(e),e||s(``)},children:[(0,b.jsx)(Nd,{asChild:!0,children:(0,b.jsxs)(q,{variant:`outline`,className:`w-9 justify-start px-0 font-normal text-muted-foreground max-sm:justify-center sm:w-[260px] sm:px-3.5`,"aria-keyshortcuts":`Control+K Meta+K`,"aria-label":e(`palette.open`),children:[(0,b.jsx)(Eb,{}),(0,b.jsx)(`span`,{className:`hidden min-w-0 flex-1 truncate text-start sm:inline`,children:e(`palette.placeholder`)}),(0,b.jsx)(`kbd`,{className:`hidden shrink-0 rounded-[5px] border border-border bg-muted px-[5px] py-px font-mono text-[11px] text-muted-foreground sm:inline`,dir:`ltr`,children:`⌘K`})]})}),(0,b.jsxs)(Ld,{children:[(0,b.jsx)(zd,{className:HS}),(0,b.jsxs)(Ud,{"aria-describedby":void 0,className:`fixed inset-x-3 top-[12vh] z-50 mx-auto flex max-h-[70vh] max-w-[540px] flex-col overflow-hidden rounded-card border border-border bg-card text-card-foreground shadow-[0_24px_48px_rgba(0,0,0,.18)] outline-none`,children:[(0,b.jsx)(Jd,{className:`sr-only`,children:e(`palette.open`)}),(0,b.jsxs)(`div`,{className:`flex items-center gap-2.5 border-b border-border px-4`,children:[(0,b.jsx)(Eb,{className:`size-4 text-muted-foreground`,"aria-hidden":!0}),(0,b.jsx)(`input`,{role:`combobox`,"aria-expanded":!0,"aria-controls":u,"aria-autocomplete":`list`,"aria-activedescendant":_.length>0?w(v):void 0,"aria-label":e(`palette.open`),placeholder:e(`palette.placeholder`),className:`h-[52px] flex-1 bg-transparent text-sm outline-none`,value:o,onChange:e=>s(e.target.value),onKeyDown:S}),(0,b.jsx)(`kbd`,{className:`rounded-[5px] border border-border bg-muted px-[5px] py-px font-mono text-[11px] text-muted-foreground`,dir:`ltr`,children:`Esc`})]}),(0,b.jsx)(`ul`,{ref:d,id:u,role:`listbox`,"aria-label":e(`palette.results`),className:`flex-1 overflow-y-auto p-1.5`,children:C.map(([e,t])=>{let n=_.map((e,t)=>({item:e,index:t})).filter(({item:t})=>t.section===e);return n.length===0?null:(0,b.jsxs)(`li`,{role:`presentation`,children:[(0,b.jsx)(`div`,{className:`px-2.5 pt-2.5 pb-1 text-xs font-medium text-muted-foreground`,"aria-hidden":!0,children:t}),(0,b.jsx)(`ul`,{role:`group`,"aria-label":t,children:n.map(({item:e,index:t})=>(0,b.jsxs)(`li`,{id:w(t),role:`option`,"aria-selected":t===v,"data-index":t,className:W(`flex h-10 cursor-pointer items-center gap-3 rounded-control px-2.5 text-[13.5px]`,t===v&&`bg-muted`),onMouseMove:()=>l(t),onClick:()=>x(e),children:[(0,b.jsx)(nT,{item:e}),(0,b.jsx)(`span`,{className:`flex-1 truncate`,children:e.section===`go`&&e.detail?`${e.detail} › ${e.label}`:e.label}),e.section===`records`&&e.detail&&(0,b.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:e.detail})]},e.id))})]},e)})}),(0,b.jsx)(`p`,{role:`status`,className:W(`px-4 text-sm text-muted-foreground`,T&&`border-t border-border py-2`),children:T}),(0,b.jsxs)(`div`,{className:`flex items-center gap-4 border-t border-border px-4 py-2.5 text-xs text-muted-foreground`,"aria-hidden":!0,children:[(0,b.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,b.jsx)(`kbd`,{className:`rounded-[5px] border border-border bg-muted px-[5px] font-mono text-[11px]`,children:`↑↓`}),e(`palette.move`)]}),(0,b.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,b.jsx)(`kbd`,{className:`rounded-[5px] border border-border bg-muted px-[5px] font-mono text-[11px]`,children:`↵`}),e(`palette.openItem`)]}),(0,b.jsxs)(`span`,{className:`ms-auto flex items-center gap-1.5`,children:[(0,b.jsx)(`kbd`,{className:`rounded-[5px] border border-border bg-muted px-[5px] font-mono text-[11px]`,dir:`ltr`,children:`⌘K`}),e(`palette.close`)]})]})]})]})]})}function nT({item:e}){let t=e.id.startsWith(`new:`)?mb:e.id===`theme`?eb:Qw(e.icon,e.section===`records`?`resource`:`group`);return(0,b.jsx)(t,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0})}var rT={en:`English`,fa:`فارسی`};function iT(){let{t:e}=Y(),[t,n]=(0,y.useState)(jw),r=[[`light`,e(`shell.themeLight`),Jb],[`dark`,e(`shell.themeDark`),eb],[`system`,e(`shell.themeSystem`),Qy]];return(0,b.jsx)(`div`,{role:`radiogroup`,"aria-label":e(`shell.theme`),className:`flex items-center rounded-control border border-border p-0.5`,children:r.map(([e,r,i])=>(0,b.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":t===e,"aria-label":r,title:r,className:W(`rounded-md p-1.5 text-muted-foreground hover:text-foreground`,t===e&&`bg-muted text-foreground`),onClick:()=>{Iw(e),n(e)},children:(0,b.jsx)(i,{className:`size-4`})},e))})}function aT(){let{t:e,locale:t,locales:n,setLocale:r}=Y();return n.length<2?null:(0,b.jsxs)(`label`,{className:`flex items-center gap-1.5 text-[13px]`,children:[(0,b.jsx)(wy,{className:`size-4 text-muted-foreground`,"aria-hidden":!0}),(0,b.jsx)(`span`,{className:`sr-only`,children:e(`shell.language`)}),(0,b.jsx)(`select`,{className:`h-8 flex-1 rounded-control border border-input bg-card px-2 text-[13px]`,value:t,onChange:e=>r(e.target.value),children:n.map(e=>(0,b.jsx)(`option`,{value:e,lang:e,children:rT[e]??e},e))})]})}function oT(){let{t:e,calendar:t,digits:n,setDisplay:r}=Y(),i=(e,t,n,r)=>(0,b.jsxs)(`div`,{role:`radiogroup`,"aria-label":e,className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:e}),(0,b.jsx)(`div`,{className:`flex rounded-control border border-border p-0.5`,children:n.map(([e,n])=>(0,b.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":t===e,className:W(`flex-1 cursor-pointer rounded-md px-2 py-1 text-[13px] text-muted-foreground hover:text-foreground`,t===e&&`bg-muted text-foreground`),onClick:()=>r(e),children:n},e))})]});return(0,b.jsxs)(b.Fragment,{children:[i(e(`display.calendar`),t,[[`gregorian`,e(`display.gregorian`)],[`persian`,e(`display.jalali`)]],e=>r({calendar:e})),i(e(`display.digits`),n,[[`latn`,e(`display.latinDigits`)],[`arabext`,e(`display.persianDigits`)]],e=>r({digits:e}))]})}function sT(){let{t:e}=Y(),[t,n]=(0,y.useState)(jw);(0,y.useEffect)(()=>{let e=()=>n(jw());return window.addEventListener(Fw,e),()=>window.removeEventListener(Fw,e)},[]);let r=t===`dark`||t===`system`&&typeof matchMedia==`function`&&matchMedia(`(prefers-color-scheme: dark)`).matches;return(0,b.jsx)(q,{variant:`ghost`,size:`icon`,"aria-label":e(`shell.theme`),title:e(`shell.theme`),onClick:Lw,children:r?(0,b.jsx)(Jb,{}):(0,b.jsx)(eb,{})})}var cT=[`#5B5BD6`,`#2563EB`,`#0E7490`,`#0F766E`,`#9333EA`,`#DB2777`,`#EA580C`];function lT(){let{t:e}=Y(),t=Wg(),n=S(),[r,i]=(0,y.useState)(Kw);(0,y.useEffect)(()=>{let e=()=>i(Kw());return window.addEventListener(Uw,e),()=>window.removeEventListener(Uw,e)},[]);let a=t.data?.appearance,o=pt({mutationFn:e=>Q.setAppearance(e),onSuccess:async({accent:e})=>{qw(null),Xw({admin:e}),await n.invalidateQueries({queryKey:[`session`]})}}),s=e=>{qw(e),Xw()},c=r??a?.accent??null;return(0,b.jsxs)(`div`,{role:`group`,"aria-label":e(`display.accent`),className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:e(`display.accent`)}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[cT.map(e=>(0,b.jsx)(`button`,{type:`button`,"aria-label":e,"aria-pressed":c?.toLowerCase()===e.toLowerCase(),className:W(`size-6 cursor-pointer rounded-full border-2 border-transparent outline-none focus-visible:ring-2 focus-visible:ring-ring`,c?.toLowerCase()===e.toLowerCase()&&`border-foreground`),style:{background:e},onClick:()=>s(e)},e)),(0,b.jsx)(`button`,{type:`button`,className:`size-6 cursor-pointer overflow-hidden rounded-full border border-border bg-[conic-gradient(red,yellow,lime,aqua,blue,magenta,red)]`,"aria-label":e(`display.customAccent`),title:e(`display.customAccent`),onClick:()=>dT(c)}),(0,b.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,className:`h-6 px-1.5 text-xs`,"aria-pressed":r===null,onClick:()=>s(null),children:e(`display.defaultAccent`)})]}),a?.manage&&(0,b.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,b.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 text-xs`,disabled:o.isPending||!r||r===a.accent,onClick:()=>o.mutate(r),children:e(`display.accentForEveryone`)}),a.accent&&(0,b.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 text-xs`,disabled:o.isPending,onClick:()=>o.mutate(null),children:e(`display.resetForEveryone`)})]}),o.isError&&(0,b.jsx)(`p`,{className:`text-xs text-destructive`,children:pg(o.error)})]})}var uT=null;function dT(e){uT&&(e&&/^#[0-9a-f]{6}$/i.test(e)&&(uT.value=e),uT.click())}function fT(){return(0,b.jsx)(`input`,{ref:e=>{uT=e},type:`color`,tabIndex:-1,"aria-hidden":!0,className:`pointer-events-none fixed bottom-0 start-0 size-px opacity-0`,onInput:e=>{qw(e.currentTarget.value),Xw()}})}var pT=`nma.nav`,mT={pinned:[],recent:[],collapsedGroups:[],expandedGroups:[],railCollapsed:!1};function hT(e){let t=mT;try{let n=e?.getItem(pT);n&&(t={...mT,...JSON.parse(n)})}catch{t=mT}let n=new Set,r=r=>{t=r;try{e?.setItem(pT,JSON.stringify(r))}catch{}for(let e of n)e()},i=(e,t)=>e.includes(t)?e.filter(e=>e!==t):[...e,t];return{get:()=>t,subscribe(e){return n.add(e),()=>n.delete(e)},togglePin:e=>r({...t,pinned:i(t.pinned,e)}),visit:e=>{t.recent[0]!==e&&r({...t,recent:[e,...t.recent.filter(t=>t!==e)].slice(0,5)})},toggleGroup:(e,n=!1)=>{let i=bT(t,e,n),a=t=>t.filter(t=>t!==e);r({...t,collapsedGroups:i?a(t.collapsedGroups):[...a(t.collapsedGroups),e],expandedGroups:i?[...a(t.expandedGroups),e]:a(t.expandedGroups)})},toggleRail:()=>r({...t,railCollapsed:!t.railCollapsed})}}function gT(){try{return typeof localStorage>`u`?void 0:localStorage}catch{return}}var _T=hT(gT());function vT(){return(0,y.useSyncExternalStore)(_T.subscribe,_T.get)}function yT(e,t){return e.filter(e=>t.has(e))}function bT(e,t,n){return e.collapsedGroups.includes(t)?!0:!e.expandedGroups.includes(t)&&n}function xT(e){let{t}=Y(),[n,r,i]=qi().pathname.split(`/`).filter(Boolean).map(e=>decodeURIComponent(e)),a=n&&n!==`g`&&n!==`p`&&n!==`-`&&r&&r!==`new`?r:void 0,o=Xg(n??``,a),s=!!n&&![`g`,`p`,`-`,`account`].includes(n),c=Kg(n??``,s&&e!==void 0&&!Sw(e).some(e=>e.resources.some(e=>e.name===n))),l=[{label:t(e?.dashboard?`shell.dashboard`:`shell.home`),to:`/`}];if(n===`account`&&!r)return[...l,{label:t(`auth.account`)}];if(n===`-`&&(r===`users`||r===`groups`||r===`roles`||r===`debugger`||r===`audit`)){let e={users:t(`rbac.users`),groups:t(`rbac.groups`),roles:t(`rbac.roles`),debugger:t(`debugger.title`),audit:t(`audit.title`)}[r];return l.push({label:t(`rbac.administration`)},{label:e,to:`/-/${r}`}),i&&l.push({label:i===`new`?t(`list.new`):i}),l}if(!n||!e)return l;let u=Sw(e);if(n===`g`){let e=u.find(e=>e.key===r);return e&&l.push({label:e.label}),l}if(n===`p`){let e=u.find(e=>e.pages.some(e=>e.name===r)),t=e?.pages.find(e=>e.name===r);return e&&t&&l.push({label:e.label,to:`/g/${e.key}`},{label:t.label}),l}let d=u.find(e=>e.resources.some(e=>e.name===n)),f=d?.resources.find(e=>e.name===n);return!d||!f?c.data?(l.push({label:c.data.label,to:`/${n}`}),a&&l.push({label:typeof o.data?._title==`string`?o.data._title:`#${a}`}),l):l:(l.push({label:d.label,to:`/g/${d.key}`},{label:f.label,to:`/${f.name}`}),r===`new`?l.push({label:t(`form.new`,{name:f.label})}):a&&l.push({label:typeof o.data?._title==`string`?o.data._title:`#${a}`}),l)}function ST({meta:e,onOpenMenu:t}){let{t:n}=Y(),r=vT(),i=xT(e),a=i.length-1;return(0,b.jsxs)(`header`,{className:`flex h-14 items-center gap-2 border-b border-border bg-card px-5`,children:[(0,b.jsx)(q,{variant:`ghost`,size:`icon`,className:`md:hidden`,"aria-label":n(`shell.menu`),onClick:t,"data-sidebar-toggle":``,children:(0,b.jsx)(Jy,{})}),(0,b.jsx)(q,{variant:`ghost`,size:`icon`,className:`hidden md:inline-flex`,"aria-label":n(r.railCollapsed?`shell.expandSidebar`:`shell.collapseSidebar`),"aria-pressed":r.railCollapsed,onClick:()=>_T.toggleRail(),"data-sidebar-toggle":``,children:(0,b.jsx)(ib,{className:`ltr:-scale-x-100`})}),(0,b.jsx)(`div`,{className:`hidden h-5 w-px bg-border md:block`,"aria-hidden":!0}),(0,b.jsx)(`nav`,{"aria-label":n(`shell.breadcrumbs`),className:`min-w-0 flex-1 ps-1`,children:(0,b.jsx)(`ol`,{className:`flex min-w-0 items-center gap-1.5 text-sm text-muted-foreground`,children:i.map((e,t)=>(0,b.jsxs)(y.Fragment,{children:[t>0&&(0,b.jsx)(wv,{className:`size-3.5 shrink-0 ltr:rotate-180`,"aria-hidden":!0}),(0,b.jsx)(`li`,{className:t===a?`truncate font-medium text-foreground`:`hidden truncate sm:block`,children:e.to&&t!==a?(0,b.jsx)(bo,{to:e.to,className:`hover:text-foreground`,children:e.label}):(0,b.jsx)(`span`,{"aria-current":t===a?`page`:void 0,children:e.label})})]},`${t}:${e.label}`))})}),(0,b.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,b.jsx)(tT,{}),(0,b.jsx)(sT,{})]})]})}function CT({rail:e=!1}){let{t}=Y(),n=Wg(),r=Yi(),i=S(),a=n.data;if(!a)return null;let{user:o,auth:s}=a,c=o.displayName.split(/\s+/).filter(Boolean).slice(0,2).map(e=>[...e][0].toUpperCase()).join(``);async function l(){try{await Q.logout()}finally{gg(void 0),wg(void 0),i.clear(),r(`/login`,{replace:!0})}}return(0,b.jsxs)(Sh,{children:[(0,b.jsx)(Ch,{asChild:!0,children:(0,b.jsxs)(`button`,{type:`button`,"aria-label":t(`auth.userMenu`,{name:o.displayName}),"data-user-block":``,className:W(`flex cursor-pointer items-center gap-2.5 rounded-control text-start hover:bg-muted`,e?`size-10 justify-center`:`px-2.5 py-2`),children:[(0,b.jsx)(`span`,{"aria-hidden":!0,className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-[13px] font-semibold`,children:c||(0,b.jsx)(ux,{className:`size-4`})}),!e&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`span`,{className:`min-w-0 flex-1 leading-[1.35]`,children:[(0,b.jsx)(`span`,{className:`block truncate text-[13px] font-medium`,children:o.displayName}),(o.username||o.email)&&(0,b.jsx)(`span`,{className:`block truncate text-[11.5px] text-muted-foreground`,children:o.email??o.username})]}),(0,b.jsx)(Kv,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0})]})]})}),(0,b.jsx)(wh,{children:(0,b.jsxs)(Th,{side:`top`,align:`start`,sideOffset:6,className:`z-50 flex w-64 flex-col gap-1 rounded-[10px] border border-border bg-popover p-1.5 text-popover-foreground shadow-[0_12px_32px_rgba(0,0,0,.12)]`,children:[(s.password||s.sessions||s.twoFactor)&&!a.viewAs&&(0,b.jsx)(Eh,{asChild:!0,children:(0,b.jsxs)(bo,{to:`/account`,className:`flex h-[34px] items-center gap-2.5 rounded-md px-2 text-[13px] hover:bg-muted`,children:[(0,b.jsx)(ux,{className:`size-4`}),t(`auth.account`)]})}),a.audit.view&&(0,b.jsx)(Eh,{asChild:!0,children:(0,b.jsxs)(bo,{to:`/-/audit`,className:`flex h-[34px] items-center gap-2.5 rounded-md px-2 text-[13px] hover:bg-muted`,children:[(0,b.jsx)(Sb,{className:`size-4`}),t(`audit.title`)]})}),(0,b.jsxs)(`div`,{className:`flex flex-col gap-2 border-y border-border px-2 py-2`,children:[(0,b.jsx)(aT,{}),(0,b.jsx)(oT,{}),(0,b.jsx)(iT,{}),(0,b.jsx)(lT,{})]}),s.logout&&!a.open&&(0,b.jsxs)(`button`,{type:`button`,className:`flex h-[34px] items-center gap-2.5 rounded-md px-2 text-start text-[13px] hover:bg-muted`,onClick:()=>void l(),children:[(0,b.jsx)(By,{className:`size-4 rtl:-scale-x-100`}),t(`auth.signOut`)]})]})})]})}var wT=`flex h-9 w-full cursor-pointer items-center gap-2.5 rounded-control px-2.5 text-start text-[13.5px] text-sidebar-foreground hover:bg-muted`,TT=({isActive:e})=>W(`flex h-8 items-center rounded-[7px] px-2.5 text-[13px] text-muted-foreground hover:bg-muted hover:text-foreground`,e&&`bg-primary-soft font-semibold text-primary-text hover:bg-primary-soft hover:text-primary-text`);function ET(e){return e.kind===`resource`?{key:e.name,to:`/${e.name}`,label:e.label,pin:e.name,...e.badge?{badge:e.badge}:{}}:e.kind===`page`?{key:`page:${e.name}`,to:`/p/${e.name}`,label:e.label}:{key:`link:${e.href}`,to:e.href,label:e.label,external:/^https?:\/\//i.test(e.href)}}var DT=(e,t)=>!t.external&&(e===t.to||e.startsWith(`${t.to}/`));function OT(e,t,n,r,i){let a=e.map(e=>{let r=e.items.map(ET);return{key:e.key,label:e.label,icon:Qw(e.icon,`group`),entries:r,collapsedByDefault:ww({menu:t,current:r.some(e=>DT(n,e))}),asLink:t&&!e.advanced&&r.length===1}});return r.length>0?[{key:`~pinned`,label:i,icon:fb,entries:r},...a]:a}function kT({title:e,logo:t,groups:n,menu:r,rail:i=!1,onClose:a}){let{t:o}=Y(),s=vT(),{pathname:c}=qi(),l=qg(r).data,u=new Map(n.flatMap(e=>e.items.flatMap(e=>e.kind===`resource`?[[e.name,ET(e)]]:[]))),d=OT(n,r,c,yT(s.pinned,new Set(u.keys())).map(e=>u.get(e)),o(`shell.pinned`)),f=d.find(e=>n.some(t=>t.advanced&&t.key===e.key)),p=d.filter(e=>e!==f),m=IT(),h=(e,t=!1)=>i?(0,b.jsx)(PT,{section:e,muted:t},e.key):(0,b.jsx)(NT,{section:e,collapsed:bT(s,e.key,e.collapsedByDefault??!1),badges:l,muted:t,large:!!a},e.key);return(0,b.jsxs)(`nav`,{"aria-label":o(`shell.resources`),className:`flex h-full flex-col`,children:[(0,b.jsx)(MT,{title:e,logo:t,rail:i,onClose:a}),(0,b.jsxs)(`div`,{className:W(`flex flex-1 flex-col gap-0.5 overflow-y-auto`,i?`items-center px-0 py-2.5`:`p-2.5`),children:[r&&(0,b.jsx)(AT,{to:`/`,label:o(`shell.dashboard`),icon:Oy,rail:i,large:!!a,end:!0}),p.map(e=>h(e))]}),(0,b.jsxs)(`div`,{className:W(`flex flex-col gap-1 border-t border-sidebar-border`,i?`items-center px-0 py-2.5`:`p-2.5`),children:[f&&h(f,!0),m&&h(m,!0),(0,b.jsx)(CT,{rail:i})]})]})}function AT({to:e,label:t,icon:n,rail:r,large:i,end:a,external:o,count:s}){let c=({isActive:e})=>r?W(`flex size-10 items-center justify-center rounded-control hover:bg-muted`,e&&`bg-primary-soft text-primary-text hover:bg-primary-soft`):W(wT,i&&`h-11 text-[15px]`,e&&`bg-primary-soft font-semibold text-primary-text hover:bg-primary-soft`),l=(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(n,{className:`size-4 shrink-0`,"aria-hidden":!0}),!r&&(0,b.jsx)(`span`,{className:`flex-1 truncate`,children:t}),!r&&s&&(0,b.jsx)(jT,{count:s})]});return o?(0,b.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,"aria-label":r?t:void 0,title:r?t:void 0,className:c({isActive:!1}),children:l}):(0,b.jsx)(xo,{to:e,end:a,"aria-label":r?t:void 0,title:r?t:void 0,className:c,children:l})}function jT({count:e,strong:t}){return(0,b.jsxs)(`span`,{className:W(`inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full px-1.5 text-[11px]`,t?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground`),children:[e.estimate?`~`:``,eg(e.count)]})}function MT({title:e,logo:t,rail:n,onClose:r}){let{t:i}=Y(),a=t?(0,b.jsx)(`img`,{src:t,alt:``,className:`size-[30px] shrink-0 rounded-control object-contain`}):(0,b.jsx)(`span`,{"aria-hidden":!0,className:`flex size-[30px] shrink-0 items-center justify-center rounded-control bg-primary font-bold text-primary-foreground`,children:[...e.trim()][0]??``});return(0,b.jsxs)(`div`,{className:W(`flex h-14 shrink-0 items-center gap-2.5 border-b border-sidebar-border`,n?`justify-center`:`px-4`),children:[a,!n&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`div`,{className:`min-w-0 flex-1 leading-[1.3]`,children:[(0,b.jsx)(`div`,{className:W(`truncate font-semibold`,r?`text-[15px]`:`text-sm`),children:e}),!r&&(0,b.jsx)(`div`,{className:`text-[11.5px] text-muted-foreground`,children:i(`shell.adminPanel`)})]}),r?(0,b.jsx)(q,{variant:`ghost`,size:`icon`,"aria-label":i(`shell.closeMenu`),onClick:r,children:(0,b.jsx)(Sx,{})}):(0,b.jsx)(Ov,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0})]})]})}function NT({section:e,collapsed:t,badges:n,muted:r,large:i}){let{t:a}=Y(),o=e.icon,s=`nav-group-${e.key}`,c=Cw(e.entries.flatMap(e=>e.badge?[{kind:`resource`,name:e.key,label:e.label,badge:e.badge}]:[]),n);if(e.asLink){let[t]=e.entries;return(0,b.jsx)(AT,{to:t.to,label:e.label,icon:o,rail:!1,large:i,external:t.external,count:t.badge?n?.[t.badge]:void 0})}return(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`button`,{type:`button`,className:W(wT,i&&`h-11 text-[15px]`,r&&`text-muted-foreground`),"aria-expanded":!t,"aria-controls":s,"aria-label":a(t?`shell.expandGroup`:`shell.collapseGroup`,{name:e.label}),onClick:()=>_T.toggleGroup(e.key,e.collapsedByDefault??!1),children:[(0,b.jsx)(o,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,b.jsx)(`span`,{className:`flex-1 truncate`,children:e.label}),t&&c&&(0,b.jsx)(jT,{count:c}),(0,b.jsx)(Sv,{className:W(`size-4 shrink-0 text-muted-foreground transition-transform`,t&&`rotate-90 rtl:rotate-90 ltr:-rotate-90`),"aria-hidden":!0})]}),!t&&(0,b.jsx)(`ul`,{id:s,"aria-label":e.label,className:`ms-[18px] mt-0.5 mb-1 flex flex-col gap-px border-s border-sidebar-border ps-2.5`,children:e.entries.map(e=>(0,b.jsxs)(`li`,{className:`group/item flex items-center`,children:[e.external?(0,b.jsx)(`a`,{href:e.to,target:`_blank`,rel:`noopener noreferrer`,className:W(TT({isActive:!1}),`min-w-0 flex-1`),children:(0,b.jsx)(`span`,{className:`truncate`,children:e.label})}):(0,b.jsxs)(xo,{to:e.to,className:e=>W(TT(e),`min-w-0 flex-1 gap-2`),children:[(0,b.jsx)(`span`,{className:`flex-1 truncate`,children:e.label}),e.badge&&n?.[e.badge]&&(0,b.jsx)(jT,{count:n[e.badge]})]}),e.pin&&(0,b.jsx)(FT,{name:e.pin,label:e.label})]},e.key))})]})}function PT({section:e,muted:t}){let[n,r]=(0,y.useState)(!1),{pathname:i}=qi(),a=e.icon,o=e.entries.some(e=>DT(i,e));return(0,b.jsxs)(Sh,{open:n,onOpenChange:r,children:[(0,b.jsx)(Ch,{asChild:!0,children:(0,b.jsx)(`button`,{type:`button`,"aria-label":e.label,title:e.label,onMouseEnter:()=>r(!0),"data-nav-section":``,className:W(`flex size-10 cursor-pointer items-center justify-center rounded-control hover:bg-muted`,t&&`text-muted-foreground`,o&&`bg-primary-soft text-primary-text hover:bg-primary-soft`),children:(0,b.jsx)(a,{className:`size-4`,"aria-hidden":!0})})}),(0,b.jsx)(wh,{children:(0,b.jsxs)(Th,{side:`right`,align:`start`,sideOffset:8,onMouseLeave:()=>r(!1),className:`z-50 flex flex-col items-start gap-1.5`,children:[(0,b.jsx)(`span`,{className:`rounded-control bg-foreground px-3 py-1.5 text-[13px] font-medium text-background`,children:e.label}),(0,b.jsx)(`div`,{className:`flex min-w-40 flex-col gap-px rounded-[10px] border border-border bg-card p-1.5 shadow-[0_12px_32px_rgba(0,0,0,.12)]`,children:e.entries.map(e=>e.external?(0,b.jsx)(`a`,{href:e.to,target:`_blank`,rel:`noopener noreferrer`,className:TT({isActive:!1}),onClick:()=>r(!1),children:e.label},e.key):(0,b.jsx)(xo,{to:e.to,className:TT,onClick:()=>r(!1),children:e.label},e.key))})]})})]})}function FT({name:e,label:t}){let{t:n}=Y(),r=vT().pinned.includes(e);return(0,b.jsx)(`button`,{type:`button`,className:W(`cursor-pointer rounded-md p-1 text-muted-foreground opacity-0 hover:text-foreground focus-visible:opacity-100 group-hover/item:opacity-100`,r&&`opacity-100`),"aria-label":n(r?`shell.unpin`:`shell.pin`,{name:t}),"aria-pressed":r,onClick:()=>_T.togglePin(e),children:r?(0,b.jsx)(ub,{className:`size-3.5`}):(0,b.jsx)(fb,{className:`size-3.5`})})}function IT(){let{t:e}=Y();if(Wg().data?.rbac.view)return{key:`~administration`,label:e(`rbac.administration`),icon:Pb,entries:[{key:`users`,to:`/-/users`,label:e(`rbac.users`)},{key:`groups`,to:`/-/groups`,label:e(`rbac.groups`)},{key:`roles`,to:`/-/roles`,label:e(`rbac.roles`)},{key:`debugger`,to:`/-/debugger`,label:e(`debugger.title`)}]}}var LT={success:5e3,error:1e4},RT=4;function zT(e=globalThis){let t=[],n=1,r=new Map,i=new Set,a=e=>{t=e;for(let e of i)e()},o=n=>{let i=r.get(n);i!==void 0&&e.clearTimeout(i),r.delete(n),t.some(e=>e.id===n)&&a(t.filter(e=>e.id!==n))};return{get:()=>t,subscribe(e){return i.add(e),()=>i.delete(e)},show(i,s=`success`){let c=n++,l=[...t,{id:c,message:i,tone:s}];for(let e of l.slice(0,Math.max(0,l.length-RT)))o(e.id);return a([...t,{id:c,message:i,tone:s}]),r.set(c,e.setTimeout(()=>o(c),LT[s])),c},dismiss:o}}var BT=zT(),VT=(e,t=`success`)=>BT.show(e,t);function HT(){return(0,y.useSyncExternalStore)(BT.subscribe,BT.get)}function UT(){let e=X(),t=HT();return(0,b.jsx)(`div`,{role:`region`,"aria-label":e(`toast.region`),className:`pointer-events-none fixed inset-x-4 bottom-4 z-[60] flex flex-col items-end gap-2 sm:start-auto sm:w-96`,children:t.map(t=>(0,b.jsxs)(`div`,{role:t.tone===`error`?`alert`:`status`,className:W(`pointer-events-auto flex w-full items-start gap-2 rounded-lg border bg-popover px-3 py-2 text-sm text-popover-foreground shadow-lg`,t.tone===`error`?`border-destructive/50`:`border-green-600/40`),children:[(0,b.jsx)(`span`,{className:W(`min-w-0 flex-1 break-words`,t.tone===`error`&&`text-destructive`),children:t.message}),(0,b.jsx)(`button`,{type:`button`,className:`rounded-md p-0.5 text-muted-foreground hover:text-foreground`,"aria-label":e(`toast.dismiss`),onClick:()=>BT.dismiss(t.id),children:(0,b.jsx)(Sx,{className:`size-4`,"aria-hidden":!0})})]},t.id))})}function WT(e,t){return e===void 0||typeof e==`string`?e:e[t]??e[dg.locale]??Object.values(e)[0]}function GT(){let{t:e}=Y(),t=Wg(),n=qi(),r=S(),i=t.isError&&Cg()!==void 0&&t.error instanceof fg&&(t.error.status===403||t.error.status===404);return(0,y.useEffect)(()=>{i&&(wg(void 0),r.clear())},[i,r]),t.isPending||i?(0,b.jsx)(G,{children:e(`common.loading`)}):t.isError?t.error instanceof fg&&t.error.status===401?(0,b.jsx)(Da,{to:`/login?${new URLSearchParams({next:n.pathname+n.search})}`,replace:!0}):(0,b.jsxs)(G,{tone:`error`,children:[pg(t.error),` `,(0,b.jsx)(q,{variant:`outline`,size:`sm`,onClick:()=>void t.refetch(),children:e(`list.retry`)})]}):(0,b.jsx)(qT,{})}function KT(){let{t:e}=Y(),t=Wg(),n=S(),r=Yi(),i=t.data;return i?.viewAs?(0,b.jsxs)(`div`,{role:`status`,className:`flex flex-wrap items-center justify-center gap-3 bg-amber-400 px-4 py-2 text-sm font-medium text-amber-950`,children:[(0,b.jsx)(Qv,{className:`size-4`,"aria-hidden":!0}),(0,b.jsx)(`span`,{children:e(`viewAs.banner`,{name:i.user.displayName})}),(0,b.jsx)(q,{size:`sm`,variant:`outline`,className:`h-7 border-amber-950/30 bg-amber-50 text-amber-950 hover:bg-amber-100`,onClick:()=>{let e=i.user.id;wg(void 0),n.clear(),r(`/-/users/${encodeURIComponent(e)}`)},children:e(`viewAs.stop`)})]}):null}function qT(){let e=Gg(),{t,locale:n}=Y(),r=vT(),i=qi(),[a,o]=(0,y.useState)(!1),s=(0,y.useRef)(null),c=Wg().data?.appearance?.accent;(0,y.useEffect)(()=>{c!==void 0&&Xw({admin:c})},[c]);let l=(0,y.useMemo)(()=>e.data?Sw(e.data):[],[e.data]),u=e.data?.menu!==void 0,d=WT(dg.branding.name,n)??e.data?.title??dg.title,f=dg.branding.logo;return(0,y.useEffect)(()=>{o(!1);let e=decodeURIComponent(i.pathname.split(`/`).filter(Boolean)[0]??``);l.some(t=>t.resources.some(t=>t.name===e))&&_T.visit(e)},[i.pathname,l]),(0,y.useEffect)(()=>{e.data&&(document.title=e.data.title)},[e.data]),(0,y.useEffect)(()=>{if(!a)return;s.current?.querySelector(`a, button, input`)?.focus();let e=e=>{e.key===`Escape`&&o(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),(0,b.jsxs)(`div`,{className:`flex min-h-svh bg-background text-foreground`,children:[(0,b.jsx)(fT,{}),(0,b.jsx)(`aside`,{className:W(`sticky top-0 hidden h-svh shrink-0 border-e border-sidebar-border bg-sidebar text-sidebar-foreground md:block`,r.railCollapsed?`w-16`:`w-64`),children:(0,b.jsx)(kT,{title:d,logo:f,groups:l,menu:u,rail:r.railCollapsed})}),a&&(0,b.jsxs)(`div`,{className:`fixed inset-0 z-40 md:hidden`,role:`dialog`,"aria-modal":`true`,"aria-label":t(`shell.menu`),ref:s,children:[(0,b.jsx)(`div`,{className:`absolute inset-0 bg-black/40 backdrop-blur-sm dark:bg-black/60 motion-safe:animate-in motion-safe:fade-in-0 motion-safe:duration-150`,"aria-hidden":!0,onClick:()=>o(!1)}),(0,b.jsx)(`aside`,{className:`absolute inset-y-0 start-0 flex w-[300px] max-w-[85vw] flex-col border-e border-sidebar-border bg-sidebar text-sidebar-foreground shadow-xl`,onClick:e=>{e.target.closest(`a`)&&o(!1)},children:(0,b.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,b.jsx)(kT,{title:d,logo:f,groups:l,menu:u,onClose:()=>o(!1)})})})]}),(0,b.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,inert:a||void 0,children:[(0,b.jsxs)(`div`,{className:`sticky top-0 z-30 bg-background`,children:[(0,b.jsx)(KT,{}),(0,b.jsx)(ST,{meta:e.data,onOpenMenu:()=>o(!0)})]}),(0,b.jsx)(`main`,{className:`flex-1 p-4 md:p-7`,children:(0,b.jsx)(`div`,{className:`mx-auto w-full max-w-[1400px]`,children:(0,b.jsx)(Oa,{})})})]}),(0,b.jsx)(UT,{})]})}function JT(e){let t=dg.branding.name;return t===void 0?dg.title:typeof t==`string`?t:t[e]??t[dg.locale]??Object.values(t)[0]??dg.title}function YT(){let{t:e,locale:t}=Y(),n=Yi(),r=S(),[i]=wo(),a=xg(i.get(`next`),dg.basePath),o=Wg(),[s,c]=(0,y.useState)(``),[l,u]=(0,y.useState)(``),[d,f]=(0,y.useState)(`password`),[p,m]=(0,y.useState)(``),[h,g]=(0,y.useState)(null),[_,v]=(0,y.useState)(!1);if(o.isSuccess)return(0,b.jsx)(Da,{to:a,replace:!0});async function x(t){if(t.preventDefault(),!s.trim()||!l){g(e(`auth.required`));return}if(d===`otp`&&!p.trim()){g(e(`auth.otpRequired`));return}v(!0),g(null);try{let e=await Q.login(s.trim(),l,d===`otp`?p.trim():void 0);gg(e.csrfToken),wg(void 0),r.clear(),r.setQueryData([`session`],e),n(a,{replace:!0})}catch(t){if(t instanceof fg&&t.body.code===`TWO_FACTOR_REQUIRED`){g(d===`otp`?t.message:null),f(`otp`),m(``);return}f(`password`),m(``),u(``),g(t instanceof fg&&(t.status===401||t.status===429||t.status===404)?t.message:e(`auth.failed`))}finally{v(!1)}}let C=dg.branding.logo;return(0,b.jsxs)(`main`,{className:`flex min-h-dvh flex-col bg-muted/30`,children:[(0,b.jsxs)(`div`,{className:`flex justify-end gap-2 p-4`,children:[(0,b.jsx)(aT,{}),(0,b.jsx)(iT,{})]}),(0,b.jsx)(`div`,{className:`flex flex-1 items-start justify-center px-4 pt-[10vh]`,children:(0,b.jsxs)(`form`,{onSubmit:x,noValidate:!0,className:`flex w-full max-w-sm flex-col gap-4 rounded-xl border bg-background p-6 shadow-sm`,"aria-labelledby":`login-title`,children:[(0,b.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[C&&(0,b.jsx)(`img`,{src:C,alt:``,className:`size-10 rounded-md object-contain`}),(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:JT(t)}),(0,b.jsx)(`h1`,{id:`login-title`,className:`text-[22px] font-bold`,children:e(d===`otp`?`auth.otpTitle`:`auth.title`)})]}),h&&(0,b.jsx)(`p`,{role:`alert`,className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:h}),d===`otp`?(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:`login-otp`,children:e(`auth.otp`)}),(0,b.jsx)(Oh,{id:`login-otp`,autoComplete:`one-time-code`,inputMode:`text`,autoCapitalize:`none`,spellCheck:!1,autoFocus:!0,dir:`ltr`,maxLength:40,value:p,onChange:e=>m(e.target.value),"aria-describedby":`login-otp-help`}),(0,b.jsx)(`p`,{id:`login-otp-help`,className:`text-sm text-muted-foreground`,children:e(`auth.otpHelp`)})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:`login-username`,children:e(`auth.username`)}),(0,b.jsx)(Oh,{id:`login-username`,autoComplete:`username`,autoCapitalize:`none`,spellCheck:!1,autoFocus:!0,value:s,onChange:e=>c(e.target.value)})]}),(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(kh,{htmlFor:`login-password`,children:e(`auth.password`)}),(0,b.jsx)(Oh,{id:`login-password`,type:`password`,autoComplete:`current-password`,value:l,onChange:e=>u(e.target.value)})]})]}),(0,b.jsx)(q,{type:`submit`,disabled:_,children:e(_?`auth.signingIn`:d===`otp`?`auth.verify`:`auth.signIn`)}),d===`otp`&&(0,b.jsx)(q,{type:`button`,variant:`ghost`,onClick:()=>{f(`password`),m(``),u(``),g(null)},children:e(`auth.startOver`)})]})})]})}var XT=3;function ZT({field:e,files:t,detailed:n=!1,plain:r=!1}){let i=X();if(t.length===0)return(0,b.jsx)(b.Fragment,{children:`—`});let a=t=>e.widget===`image`&&t.contentType.startsWith(`image/`),o=n?t:t.slice(0,XT);return(0,b.jsxs)(`span`,{className:W(`inline-flex flex-wrap items-center`,n?`gap-2`:`gap-1 align-middle`),children:[o.map(e=>{let t=a(e)?(0,b.jsx)(`img`,{src:e.url,alt:e.name,loading:`lazy`,className:W(`rounded-md border bg-muted object-cover`,n?`size-24`:`size-8`)}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(iy,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,b.jsx)(`bdi`,{className:`max-w-48 truncate`,children:e.name}),n&&(0,b.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:Pg(e.size)})]});return r?(0,b.jsx)(`span`,{className:`inline-flex min-w-0 items-center gap-1`,children:t},e.key):(0,b.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":i(`upload.open`,{name:e.name}),title:e.name,className:`inline-flex min-w-0 items-center gap-1 hover:underline`,onClick:e=>e.stopPropagation(),children:t},e.key)}),t.length>o.length&&(0,b.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:i(`upload.more`,{count:t.length-o.length})})]})}var QT={ok:`bg-ok-bg text-ok`,warn:`bg-warn-bg text-warn`,bad:`bg-bad-bg text-bad`,info:`bg-info-bg text-info`,neutral:`bg-muted text-muted-foreground`,primary:`bg-primary-soft text-primary-text`};function $T({tone:e=`neutral`,className:t,...n}){return(0,b.jsx)(`span`,{"data-slot":`badge`,"data-tone":e,className:W(`inline-flex h-[22px] items-center gap-1 rounded-full px-2 text-xs leading-none font-medium whitespace-nowrap`,QT[e],t),...n})}var eE={gray:`neutral`,red:`bad`,amber:`warn`,green:`ok`,blue:`info`,purple:`primary`,pink:`bad`};function tE(e){return eE[e]??`neutral`}function nE({value:e,field:t,className:n}){if(e==null)return(0,b.jsx)(b.Fragment,{children:Nx(e,t)});let r=t.colors?.[String(e)]??`gray`;return(0,b.jsx)($T,{"data-color":r,tone:tE(r),className:n,children:Nx(e,t)})}function rE({value:e,field:t,record:n,detailed:r,plain:i}){return t.file&&n?(0,b.jsx)(ZT,{field:t,files:gC(n,t.name),detailed:r,plain:i}):t.widget===`badge`?(0,b.jsx)(nE,{value:e,field:t}):(0,b.jsx)(b.Fragment,{children:Nx(e,t)})}function iE({title:e,subtitle:t,icon:n,actions:r,footer:i,className:a,bodyClassName:o,children:s,...c}){let l=(0,y.useId)(),u=e!==void 0&&c[`aria-labelledby`]===void 0?{"aria-labelledby":l}:{};return(0,b.jsxs)(`section`,{"data-slot":`card`,className:W(`rounded-card border border-border bg-card text-card-foreground shadow-card`,a),...u,...c,children:[e!==void 0&&(0,b.jsxs)(`header`,{className:`flex min-h-14 items-center gap-2 border-b border-border px-5 py-3`,children:[n&&(0,b.jsx)(`span`,{className:`text-muted-foreground [&_svg]:size-4`,children:n}),(0,b.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,b.jsx)(`h2`,{id:l,className:`text-[15px] font-semibold`,children:e}),t&&(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t})]}),r&&(0,b.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:r})]}),(0,b.jsx)(`div`,{className:W(e!==void 0&&`p-5`,o),children:s}),i&&(0,b.jsx)(`footer`,{className:`border-t border-border px-5 py-3`,children:i})]})}function aE({card:e,values:t,schema:n}){let r=X(),i=Kg(e.relation?.resource??``,e.relation!==void 0);if(!t)return null;let a=e.relation?i.data?.fields:n.fields;if(!a)return null;let o=$w(e.icon),s=e.fields.flatMap(e=>{let t=a.find(t=>t.name===e);return t?[t]:[]}),c=e.relation?.link&&typeof t._id==`string`?`/${e.relation.resource}/${encodeURIComponent(t._id)}`:void 0;return(0,b.jsx)(iE,{title:e.title,icon:o?(0,b.jsx)(o,{}):void 0,actions:c&&(0,b.jsx)(bo,{to:c,className:`text-[13px] font-medium text-primary hover:underline`,children:r(`form.viewProfile`)}),children:(0,b.jsxs)(`dl`,{className:`flex flex-col gap-2.5 text-[13px]`,children:[e.relation&&typeof t._title==`string`&&(0,b.jsx)(`dt`,{className:`text-[14px] font-semibold`,children:t._title}),s.map(e=>(0,b.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,b.jsx)(`dt`,{className:`text-muted-foreground`,children:e.label}),(0,b.jsx)(`dd`,{className:`min-w-0 text-end break-words`,children:(0,b.jsx)(rE,{value:t[e.name],field:e,record:t})})]},e.name))]})})}function oE(e,t,n){let r=e.steps?.values??e.enumValues??[],i=typeof t==`string`?r.indexOf(t):-1;return r.map((t,r)=>{let a=n?.[t],o=a?rg(new Date(a)):null,s=i===-1?`future`:r<i?`done`:r===i?`current`:`future`;return{key:t,label:e.enumLabels?.[t]??t,state:s,at:s===`future`?null:o,caption:s===`current`&&o?J(`stepper.since`,{time:o}):null}})}function sE({field:e,value:t,reached:n}){let r=oE(e,t,n);return(0,b.jsx)(iE,{"aria-label":e.label,bodyClassName:`overflow-x-auto px-5 py-4`,children:(0,b.jsx)(`ol`,{className:`flex min-w-max`,children:r.map((e,t)=>(0,b.jsxs)(`li`,{"aria-current":e.state===`current`?`step`:void 0,className:`relative flex min-w-28 flex-1 flex-col items-center gap-1.5 text-center`,children:[t<r.length-1&&(0,b.jsx)(`span`,{"aria-hidden":!0,className:W(`absolute start-1/2 top-3.5 h-0.5 w-full`,e.state===`done`?`bg-primary`:`bg-border`)}),(0,b.jsx)(`span`,{className:W(`relative z-10 flex size-7 items-center justify-center rounded-full border-2 bg-card text-xs font-semibold`,e.state===`done`&&`border-primary bg-primary text-primary-foreground`,e.state===`current`&&`border-primary text-primary`,e.state===`future`&&`border-border text-muted-foreground`),children:e.state===`done`?(0,b.jsx)(bv,{className:`size-3.5`,"aria-hidden":!0}):eg(t+1)}),(0,b.jsx)(`span`,{className:W(`text-[13px]`,e.state===`current`?`font-semibold text-primary`:e.state===`done`?`font-semibold`:`text-muted-foreground`),children:e.label}),(0,b.jsx)(`span`,{className:`text-[11.5px] text-muted-foreground`,children:e.caption??e.at??`—`})]},e.key))})})}var cE=class{options;pending=[];problems=[];uploads=new Map;nextId=0;disposed=!1;constructor(e){this.options=e}get busy(){return this.pending.length>0}start(e,t){if(!(this.disposed||e.length===0)){this.problems=[];for(let n of e){let e=this.options.check(n);if(e){this.problems=[...this.problems,this.options.describe(n.name,e)];continue}let r=++this.nextId,i=this.options.preview?.(n),a=this.options.send(n,e=>{this.disposed||(this.pending=this.pending.map(t=>t.id===r?{...t,progress:e}:t),this.options.onChange())});this.uploads.set(r,a),this.pending=[...this.pending,{id:r,name:n.name,progress:0,preview:i}],a.promise.then(e=>{this.disposed||(this.finish(r),t(e,n,i))},e=>{this.disposed||(i&&this.options.revoke?.(i),e instanceof Tg||(this.problems=[...this.problems,this.options.describe(n.name,Ag(e))]),this.finish(r))})}this.options.onChange()}}report(e,t){this.problems=[...this.problems,this.options.describe(e,t)],this.options.onChange()}cancel(e){this.uploads.get(e)?.abort()}cancelAll(){for(let e of[...this.uploads.values()])e.abort()}dispose(){this.disposed=!0;for(let e of this.pending)e.preview&&this.options.revoke?.(e.preview);this.cancelAll(),this.uploads.clear(),this.pending=[]}finish(e){this.uploads.delete(e),this.pending=this.pending.filter(t=>t.id!==e),this.options.onChange()}};function lE({resource:e,field:t,rules:n,onBusy:r}){let i=X(),[,a]=(0,y.useReducer)(e=>e+1,0),o=(0,y.useRef)({resource:e,field:t,rules:n,t:i});o.current={resource:e,field:t,rules:n,t:i};let s=(0,y.useRef)(null),c=()=>new cE({send:(e,t)=>Q.upload(e,{resource:o.current.resource,field:o.current.field.name},t),check:e=>Mg(e,o.current.rules),describe:(e,t)=>o.current.t(`upload.failed`,{name:e,message:t}),preview:e=>e.type.startsWith(`image/`)?URL.createObjectURL(e):void 0,revoke:e=>URL.revokeObjectURL(e),onChange:a});s.current??=c();let l=s.current.busy;return(0,y.useEffect)(()=>{r?.(l)},[l]),(0,y.useEffect)(()=>(s.current||(s.current=c(),a()),()=>{s.current?.dispose(),s.current=null,r?.(!1)}),[]),s.current}function uE({resource:e,field:t,value:n,onChange:r,onBusy:i}){let a=t.file?.many===!0,o=hC(n),s=(0,y.useRef)(o);s.current=o;let c=lE({resource:e,field:t,rules:t.file??{accept:[],maxBytes:1/0},onBusy:i}),l=(0,y.useRef)(new Map);(0,y.useEffect)(()=>()=>{for(let e of l.current.values())URL.revokeObjectURL(e);l.current.clear()},[]);function u(e){let t=new Set(e.map(e=>e.token));for(let[e,n]of l.current)t.has(e)||(URL.revokeObjectURL(n),l.current.delete(e));s.current=e,r(a?e:e[0]??null)}function d(e){let t=a?e:e.slice(0,1);t.length!==0&&(a||c.cancelAll(),c.start(t,(e,t,n)=>{n&&l.current.set(e.token,n);let r={token:e.token,name:e.name,size:e.size,contentType:e.contentType,...e.url?{url:e.url}:{}};u(a?[...s.current,r]:[r])}))}return{many:a,files:o,pending:c.pending,problems:c.problems,add:d,remove:e=>u(o.filter((t,n)=>n!==e)),move:(e,t)=>u(Fg(o,e,t)),cancel:e=>c.cancel(e),previewOf:e=>e.url??(e.token?l.current.get(e.token):void 0)}}function dE(e){let[t,n]=(0,y.useState)(null),[r,i]=(0,y.useState)(null),a=()=>{n(null),i(null)};return{dragging:t,over:r,item:r=>({draggable:!0,onDragStart:e=>{e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,String(r)),n(r)},onDragOver:e=>{t!==null&&(e.preventDefault(),e.dataTransfer.dropEffect=`move`,i(r))},onDrop:n=>{t!==null&&(n.preventDefault(),e(t,r),a())},onDragEnd:a})}}function fE({id:e,field:t,label:n,compact:r,onFiles:i,aria:a}){let o=X(),s=(0,y.useRef)(null),[c,l]=(0,y.useState)(!1),u=t.file?.many===!0,d=t.file?.accept??[],f=d.length===0||d.some(e=>e===`*`||e===`*/*`),p=e=>e.dataTransfer.types.includes(`Files`);return(0,b.jsxs)(`div`,{"data-dropzone":t.name,onDragOver:e=>{p(e)&&(e.preventDefault(),l(!0))},onDragLeave:()=>l(!1),onDrop:e=>{p(e)&&(e.preventDefault(),l(!1),i([...e.dataTransfer.files]))},className:W(`flex flex-wrap items-center gap-x-3 gap-y-1 rounded-lg text-sm has-[:focus-visible]:ring-3 has-[:focus-visible]:ring-ring/50`,!r&&`border border-dashed border-input px-3 py-3`,c&&`border-primary bg-muted/50`),children:[(0,b.jsx)(`input`,{ref:s,id:e,type:`file`,className:`sr-only`,multiple:u,accept:f?void 0:d.join(`,`),onChange:e=>{i([...e.target.files??[]]),e.target.value=``},...a}),(0,b.jsxs)(q,{type:`button`,variant:`outline`,size:`sm`,tabIndex:-1,"aria-hidden":!0,onClick:()=>s.current?.click(),children:[(0,b.jsx)(cx,{}),n]}),!r&&(0,b.jsxs)(`span`,{className:`text-muted-foreground`,children:[o(u?`upload.dropMany`:`upload.drop`),t.file&&` · ${o(`upload.limit`,{max:Pg(t.file.maxBytes)})}`]})]})}function pE({upload:e,onCancel:t,className:n}){let r=X(),i=Math.round(e.progress*100);return(0,b.jsxs)(`div`,{className:W(`flex items-center gap-2`,n),children:[(0,b.jsx)(`div`,{role:`progressbar`,"aria-label":r(`upload.uploading`,{name:e.name}),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":i,className:`h-1.5 min-w-0 flex-1 overflow-hidden rounded-full bg-muted`,children:(0,b.jsx)(`div`,{className:`h-full rounded-full bg-primary transition-[width]`,style:{width:`${i}%`}})}),(0,b.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":r(`upload.cancel`,{name:e.name}),onClick:t,children:(0,b.jsx)(Sx,{})})]})}function mE({problems:e}){return e.length===0?null:(0,b.jsx)(`ul`,{role:`alert`,className:`flex flex-col gap-0.5 text-sm text-destructive`,children:e.map((e,t)=>(0,b.jsx)(`li`,{children:e},t))})}function hE(e){let t=X(),{id:n,field:r,aria:i}=e,{many:a,files:o,pending:s,problems:c,add:l,remove:u,move:d,cancel:f}=uE(e),p=dE(d);return(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(o.length>0||s.length>0)&&(0,b.jsxs)(`ul`,{className:`flex flex-col gap-1`,children:[o.map((e,n)=>(0,b.jsxs)(`li`,{"data-file":e.name,...a&&o.length>1?p.item(n):{},className:W(`flex items-center gap-2 rounded-lg border px-2 py-1.5 text-sm`,p.dragging===n&&`opacity-50`,p.over===n&&p.dragging!==n&&`border-primary`),children:[a&&o.length>1?(0,b.jsx)(uy,{className:`size-4 shrink-0 cursor-grab text-muted-foreground`,"aria-hidden":!0}):(0,b.jsx)(iy,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0}),e.url?(0,b.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`min-w-0 truncate hover:underline`,"aria-label":t(`upload.open`,{name:e.name}),children:(0,b.jsx)(`bdi`,{children:e.name})}):(0,b.jsx)(`bdi`,{className:`min-w-0 truncate`,children:e.name}),(0,b.jsx)(`span`,{className:`ms-auto shrink-0 text-muted-foreground`,children:Pg(e.size)}),a&&o.length>1&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-xs`,disabled:n===0,"aria-label":t(`list.moveUp`,{name:e.name}),onClick:()=>d(n,n-1),children:(0,b.jsx)(X_,{})}),(0,b.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-xs`,disabled:n===o.length-1,"aria-label":t(`list.moveDown`,{name:e.name}),onClick:()=>d(n,n+1),children:(0,b.jsx)(K_,{})})]}),(0,b.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":t(`upload.remove`,{name:e.name}),onClick:()=>u(n),children:(0,b.jsx)(Sx,{})})]},e.token??e.key)),s.map(e=>(0,b.jsxs)(`li`,{className:`flex flex-col gap-1 rounded-lg border border-dashed px-2 py-1.5 text-sm`,children:[(0,b.jsx)(`bdi`,{className:`truncate text-muted-foreground`,children:e.name}),(0,b.jsx)(pE,{upload:e,onCancel:()=>f(e.id)})]},`pending-${e.id}`))]}),(0,b.jsx)(fE,{id:n,field:r,label:t(a?`upload.chooseMany`:o.length>0?`upload.replace`:`upload.choose`),compact:!a&&o.length>0,onFiles:l,aria:i}),(0,b.jsx)(mE,{problems:c})]})}function gE(e){let t=X(),{id:n,field:r,aria:i}=e,{many:a,files:o,pending:s,problems:c,add:l,remove:u,move:d,cancel:f,previewOf:p}=uE(e),m=dE(d),h=a&&o.length>1;return(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(o.length>0||s.length>0)&&(0,b.jsxs)(`ul`,{className:`flex flex-wrap gap-2`,children:[o.map((e,n)=>{let r=p(e);return(0,b.jsxs)(`li`,{"data-file":e.name,...h?m.item(n):{},className:W(`group relative size-28 overflow-hidden rounded-lg border bg-muted`,h&&`cursor-grab`,m.dragging===n&&`opacity-50`,m.over===n&&m.dragging!==n&&`border-primary ring-2 ring-primary/40`),children:[r?(0,b.jsx)(`img`,{src:r,alt:e.name,draggable:!1,className:`size-full object-cover`}):(0,b.jsxs)(`span`,{className:`flex size-full flex-col items-center justify-center gap-1 p-1 text-center text-xs text-muted-foreground`,children:[(0,b.jsx)(gy,{className:`size-5`,"aria-hidden":!0}),(0,b.jsx)(`bdi`,{className:`w-full truncate`,children:e.name})]}),(0,b.jsx)(q,{type:`button`,variant:`secondary`,size:`icon-xs`,className:`absolute end-1 top-1 shadow`,"aria-label":t(`upload.remove`,{name:e.name}),onClick:()=>u(n),children:(0,b.jsx)(Sx,{})}),h&&(0,b.jsxs)(`div`,{className:`absolute inset-x-1 bottom-1 flex justify-between`,children:[(0,b.jsx)(q,{type:`button`,variant:`secondary`,size:`icon-xs`,className:`shadow`,disabled:n===0,"aria-label":t(`list.moveUp`,{name:e.name}),onClick:()=>d(n,n-1),children:(0,b.jsx)(wv,{className:`rtl:rotate-180`})}),(0,b.jsx)(q,{type:`button`,variant:`secondary`,size:`icon-xs`,className:`shadow`,disabled:n===o.length-1,"aria-label":t(`list.moveDown`,{name:e.name}),onClick:()=>d(n,n+1),children:(0,b.jsx)(Ev,{className:`rtl:rotate-180`})})]})]},e.token??e.key)}),s.map(e=>(0,b.jsxs)(`li`,{className:`relative size-28 overflow-hidden rounded-lg border border-dashed bg-muted`,children:[e.preview&&(0,b.jsx)(`img`,{src:e.preview,alt:``,className:`size-full object-cover opacity-40`}),(0,b.jsx)(pE,{upload:e,onCancel:()=>f(e.id),className:`absolute inset-x-1 bottom-1 rounded-md bg-background/80 ps-1.5`})]},`pending-${e.id}`))]}),(0,b.jsx)(fE,{id:n,field:r,label:t(a?`upload.chooseImages`:o.length>0?`upload.replace`:`upload.chooseImage`),compact:!a&&o.length>0,onFiles:l,aria:i}),(0,b.jsx)(mE,{problems:c})]})}function _E({className:e,...t}){return(0,b.jsx)(`textarea`,{"data-slot":`textarea`,className:W(`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 vE({id:e,field:t,value:n,onChange:r,aria:i}){let{unit:a,position:o}=jx(`0`,{currency:t.currency}),s=a&&(0,b.jsx)(`span`,{className:`shrink-0 text-[13px] text-muted-foreground`,children:a});return(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[o===`before`&&s,(0,b.jsx)(Oh,{id:e,type:`text`,inputMode:`decimal`,dir:`ltr`,className:`text-end`,value:n,placeholder:t.placeholder,onChange:e=>r(e.target.value),onBlur:()=>r(Dx(n,t.scale)),...i}),o!==`before`&&s]})}function yE({id:e,checked:t,onChange:n,aria:r}){return(0,b.jsx)(`button`,{id:e,type:`button`,role:`switch`,"aria-checked":t,onClick:()=>n(!t),className:W(`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent transition-colors outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,t?`bg-primary`:`bg-input`),...r,children:(0,b.jsx)(`span`,{className:W(`block size-4 rounded-full bg-background shadow transition-transform`,t?`translate-x-4 rtl:-translate-x-4`:`translate-x-0`)})})}function bE({id:e,field:t,value:n,onChange:r,aria:i,label:a,required:o}){let s=X(),c=(t.enumValues??[]).map(e=>[e,MC(t,e)]);return t.nullable&&!o&&c.unshift([``,s(`common.empty`)]),(0,b.jsxs)(`fieldset`,{id:e,className:`flex flex-col gap-1.5`,...i,children:[(0,b.jsx)(`legend`,{className:`mb-1.5 text-sm font-medium`,children:a}),(0,b.jsx)(`div`,{role:`radiogroup`,className:`flex flex-wrap gap-x-4 gap-y-1.5`,children:c.map(([t,i])=>(0,b.jsxs)(`label`,{className:`flex items-center gap-1.5 text-sm`,children:[(0,b.jsx)(`input`,{type:`radio`,name:e,value:t,checked:n===t,onChange:()=>r(t),className:`size-4 accent-primary`}),i]},t))})]})}var xE=/^#[0-9a-f]{6}$/i;function SE({id:e,field:t,value:n,onChange:r,aria:i}){let a=X();return(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`input`,{type:`color`,"aria-hidden":!0,tabIndex:-1,className:`h-8 w-10 shrink-0 cursor-pointer rounded-md border border-input bg-transparent p-0.5`,value:xE.test(n)?n.toLowerCase():`#000000`,onChange:e=>r(e.target.value)}),(0,b.jsx)(Oh,{id:e,dir:`ltr`,value:n,placeholder:t.placeholder??`#000000`,"aria-label":a(`form.colorCode`,{name:t.label}),onChange:e=>r(e.target.value),...i})]})}function CE({id:e,field:t,value:n,onChange:r,aria:i}){let a=X(),[o,s]=(0,y.useState)(null),c=`${e}-json`;function l(){if(n.trim()!==``)try{r(JSON.stringify(JSON.parse(n),null,2)),s(null)}catch(e){s(e instanceof Error?e.message:String(e))}}let u=[i[`aria-describedby`],o?c:void 0].filter(Boolean).join(` `)||void 0;return(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(_E,{id:e,dir:`ltr`,rows:6,className:`font-mono`,spellCheck:!1,value:n,placeholder:t.placeholder,onChange:e=>{s(null),r(e.target.value)},...i,"aria-invalid":i[`aria-invalid`]??(o?!0:void 0),"aria-describedby":u}),(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:l,children:a(`form.formatJson`)}),o&&(0,b.jsx)(`p`,{id:c,className:`text-sm text-destructive`,children:o})]})]})}function wE({id:e,field:t,value:n,onChange:r,aria:i}){return(0,b.jsx)(_E,{id:e,rows:4,value:n,placeholder:t.placeholder,onChange:e=>r(e.target.value),...i})}function TE({id:e,field:t,value:n,onChange:r,aria:i,...a}){return(0,b.jsx)(Oh,{id:e,value:n,placeholder:t.placeholder,onChange:e=>r(e.target.value),...a,...i})}var EE=(0,y.lazy)(()=>Xa(()=>import(`./rich-text-input-CGlopQGm.js`),__vite__mapDeps([0,1]),import.meta.url));function DE(e){let t=X();return(0,b.jsx)(y.Suspense,{fallback:(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`editor.loading`)}),children:(0,b.jsx)(EE,{...e})})}var OE=`h-8 w-full rounded-lg border border-input bg-transparent px-2.5 text-sm outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive`;function kE({resource:e,field:t,value:n,required:r,errors:i,constraints:a,formValues:o,onChange:s,onBusy:c,idPrefix:l=`field`,parent:u,hideLabel:d}){let f=`${l}-${t.name}`,p=`${f}-error`,m=`${f}-help`,h=(i?.length??0)>0,g=[t.help?m:void 0,h?p:void 0].filter(Boolean).join(` `)||void 0,_={"aria-invalid":h?!0:void 0,"aria-describedby":g},v=typeof n==`string`?n:``,y=t.type===`relation`?void 0:jC(t,a),x=(0,b.jsxs)(b.Fragment,{children:[t.label,r&&(0,b.jsx)(`span`,{"aria-hidden":!0,className:`text-destructive`,children:`*`})]}),S=(0,b.jsx)(kh,{htmlFor:f,className:d?`sr-only`:void 0,children:x}),C=t.help?(0,b.jsx)(`p`,{id:m,className:`text-sm text-muted-foreground`,children:t.help}):null,w={id:f,field:t,value:v,onChange:e=>s(e),aria:_};if(t.type===`boolean`){let e=n===!0;return(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[y===`switch`?(0,b.jsx)(yE,{id:f,checked:e,onChange:s,aria:_}):(0,b.jsx)(`input`,{id:f,type:`checkbox`,className:`size-4 accent-primary`,checked:e,onChange:e=>s(e.target.checked),..._}),S]}),C,(0,b.jsx)(jE,{id:p,errors:i})]})}if(t.type===`enum`&&y===`radio`)return(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,b.jsx)(bE,{...w,label:x,required:r}),C,(0,b.jsx)(jE,{id:p,errors:i})]});let T;if(t.type===`relation`)T=(0,b.jsx)(GS,{id:f,resource:e,field:t,value:n??null,onChange:s,clearable:t.nullable,values:o,parent:u,invalid:h,describedBy:g});else if(t.type===`enum`)T=(0,b.jsxs)(`select`,{id:f,className:OE,value:v,onChange:e=>s(e.target.value),..._,children:[(0,b.jsx)(`option`,{value:``,children:t.placeholder??`—`}),t.enumValues?.map(e=>(0,b.jsx)(`option`,{value:e,children:MC(t,e)},e))]});else switch(y){case`file`:T=(0,b.jsx)(hE,{id:f,resource:e,field:t,value:n,onChange:s,onBusy:c,aria:_});break;case`image`:T=(0,b.jsx)(gE,{id:f,resource:e,field:t,value:n,onChange:s,onBusy:c,aria:_});break;case`richtext`:T=(0,b.jsx)(DE,{id:f,resource:e,field:t,value:v,onChange:s,onBusy:c,invalid:h,describedBy:g});break;case`money`:T=(0,b.jsx)(vE,{...w});break;case`date`:T=(0,b.jsx)(RS,{id:f,live:!0,value:v,label:t.label,onChange:e=>s(e),..._});break;case`datetime`:T=(0,b.jsx)(VS,{id:f,value:v,label:t.label,onChange:e=>s(e),..._});break;case`json`:T=(0,b.jsx)(CE,{...w});break;case`textarea`:T=(0,b.jsx)(wE,{...w});break;case`color`:T=(0,b.jsx)(SE,{...w});break;case`password`:T=(0,b.jsx)(TE,{...w,type:`password`,autoComplete:`new-password`});break;case`slug`:T=(0,b.jsx)(TE,{...w,dir:`ltr`,autoCapitalize:`none`,spellCheck:!1});break;default:T=(0,b.jsx)(TE,{...w,...AE(t,y)})}return(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[S,T,C,(0,b.jsx)(jE,{id:p,errors:i})]})}function AE(e,t){if(t===`email`||t===`url`)return{type:t};switch(e.type){case`number`:case`decimal`:return{type:`text`,inputMode:`decimal`};case`bigint`:return{type:`text`,inputMode:`numeric`};case`date`:return{type:`date`};case`datetime`:return{type:`datetime-local`};default:return{type:`text`}}}function jE({id:e,errors:t}){return t?.length?(0,b.jsx)(`p`,{id:e,className:`text-sm text-destructive`,children:t.join(` `)}):null}var ME={1:``,2:`md:grid-cols-2`,3:`md:grid-cols-2 lg:grid-cols-3`};function NE({layout:e,names:t,render:n,errors:r,renderInline:i,renderSummary:a,plain:o}){let s=e&&(i?e:LE(e)),c=new Set((s??[]).flatMap(e=>`tab`in e?e.sections:[e]).flatMap(e=>FE(e)||IE(e)?[]:e.fields)),l=t.filter(e=>!c.has(e)),u=(s??[]).filter(e=>`tab`in e),d=(s??[]).findIndex(e=>`tab`in e),f=d===-1?(s??[]).filter(e=>!(`tab`in e)):(s??[]).slice(0,d).filter(e=>!(`tab`in e)),p=d===-1?[]:(s??[]).slice(d).filter(e=>!(`tab`in e)),m=(e,t)=>FE(e)?(0,b.jsx)(y.Fragment,{children:i?.(e)},t):IE(e)?(0,b.jsx)(y.Fragment,{children:a?.(e)},t):(0,b.jsx)(PE,{section:e,render:n,plain:o},t);return(0,b.jsxs)(b.Fragment,{children:[f.map((e,t)=>m(e,`b${t}`)),u.length>0&&(0,b.jsx)(RE,{tabs:u,render:n,errors:r,block:m}),p.map((e,t)=>m(e,`a${t}`)),l.length>0&&(0,b.jsx)(PE,{section:{fields:l,columns:1},render:n,plain:o})]})}function PE({section:e,render:t,plain:n}){let r=(0,y.useId)(),i=e.fields.map(e=>[e,t(e)]).filter(([,e])=>e!==null);if(i.length===0)return null;let a=(0,b.jsx)(`div`,{className:W(`grid gap-5`,ME[e.columns]),children:i.map(([e,t])=>(0,b.jsx)(`div`,{className:`min-w-0`,children:t},e))});return n?e.title?(0,b.jsxs)(`section`,{"aria-labelledby":r,className:`flex flex-col gap-3`,children:[(0,b.jsx)(`h3`,{id:r,className:`text-[13px] font-semibold text-muted-foreground`,children:e.title}),a]}):a:e.title?(0,b.jsx)(iE,{"aria-labelledby":r,title:(0,b.jsx)(`span`,{id:r,children:e.title}),children:a}):(0,b.jsx)(iE,{bodyClassName:`p-5`,children:a})}var FE=e=>`inline`in e,IE=e=>`summary`in e;function LE(e){return e.filter(e=>!FE(e)&&!IE(e)).map(e=>`tab`in e?{...e,sections:e.sections.filter(e=>!FE(e)&&!IE(e))}:e)}function RE({tabs:e,render:t,errors:n,block:r}){let i=X(),{locale:a}=Y(),o=(0,y.useId)(),[s,c]=(0,y.useState)(0),l=(0,y.useRef)([]),u=e=>e.sections.some(e=>(FE(e)?[`_inlines.${e.inline}`]:IE(e)?[]:e.fields).some(e=>Object.keys(n).some(t=>t===e||t.startsWith(`${e}.`))));(0,y.useEffect)(()=>{if(u(e[s]))return;let t=e.findIndex(u);t!==-1&&c(t)},[n]);function d(t){let n=Qh(a)?`ArrowLeft`:`ArrowRight`,r=Qh(a)?`ArrowRight`:`ArrowLeft`,i;t.key===n?i=(s+1)%e.length:t.key===r?i=(s-1+e.length)%e.length:t.key===`Home`?i=0:t.key===`End`&&(i=e.length-1),i!==void 0&&(t.preventDefault(),c(i),l.current[i]?.focus())}return(0,b.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,b.jsx)(`div`,{role:`tablist`,className:`flex gap-0.5 overflow-x-auto border-b`,onKeyDown:d,children:e.map((e,t)=>(0,b.jsxs)(`button`,{ref:e=>{l.current[t]=e},id:`${o}-tab-${t}`,type:`button`,role:`tab`,"aria-selected":t===s,"aria-controls":`${o}-panel-${t}`,tabIndex:t===s?0:-1,onClick:()=>c(t),className:W(`-mb-px flex h-[38px] items-center gap-1.5 border-b-2 px-3 text-[13px] whitespace-nowrap outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,t===s?`border-foreground font-semibold`:`border-transparent text-muted-foreground hover:text-foreground`),children:[e.tab,u(e)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full bg-destructive`}),(0,b.jsx)(`span`,{className:`sr-only`,children:i(`form.tabHasErrors`)})]})]},t))}),e.map((e,t)=>(0,b.jsx)(`div`,{id:`${o}-panel-${t}`,role:`tabpanel`,"aria-labelledby":`${o}-tab-${t}`,hidden:t!==s,className:W(`flex-col gap-5`,t===s?`flex`:`hidden`),children:e.sections.map((e,t)=>r(e,String(t)))},t))]})}var zE=e=>typeof e==`object`&&e&&!Array.isArray(e)?e:{};function BE({resource:e,field:t,path:n,pattern:r,value:i,constraints:a,markRequired:o,errors:s,onChange:c,idPrefix:l}){let u=X(),d=s[n];if(t.many){let f=Array.isArray(i)?i:[];return(0,b.jsxs)(`fieldset`,{className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,b.jsx)(`legend`,{className:`px-1 text-sm font-medium`,children:t.label}),f.map((i,d)=>(0,b.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-md border border-dashed p-3`,children:[(0,b.jsx)(VE,{resource:e,field:t,path:`${n}.${d}`,pattern:`${r}.*`,value:i,constraints:a,markRequired:o,errors:s,idPrefix:l,onChange:e=>c(f.map((t,n)=>n===d?e:t))}),(0,b.jsx)(`div`,{children:(0,b.jsxs)(q,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>c(f.filter((e,t)=>t!==d)),children:[(0,b.jsx)(nx,{}),u(`form.remove`,{name:t.label,index:d+1})]})})]},d)),(0,b.jsx)(`div`,{children:(0,b.jsxs)(q,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>c([...f,wC(t.fields??[])]),children:[(0,b.jsx)(mb,{}),u(`form.add`,{name:t.label})]})}),d&&(0,b.jsx)(`p`,{className:`text-sm text-destructive`,children:d.join(` `)})]})}return(0,b.jsxs)(`fieldset`,{className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,b.jsx)(`legend`,{className:`px-1 text-sm font-medium`,children:t.label}),(0,b.jsx)(VE,{resource:e,field:t,path:n,pattern:r,value:zE(i),constraints:a,markRequired:o,errors:s,idPrefix:l,onChange:c}),d&&(0,b.jsx)(`p`,{className:`text-sm text-destructive`,children:d.join(` `)})]})}function VE({resource:e,field:t,path:n,pattern:r,value:i,constraints:a,markRequired:o,errors:s,onChange:c,idPrefix:l}){return(0,b.jsx)(b.Fragment,{children:(t.fields??[]).filter(e=>!e.readonly).map(t=>{let u=`${n}.${t.name}`,d=`${r}.${t.name}`,f=e=>c({...i,[t.name]:e});return t.type===`object`?(0,b.jsx)(BE,{resource:e,field:t,path:u,pattern:d,value:i[t.name],constraints:a,markRequired:o,errors:s,idPrefix:l,onChange:f},t.name):(0,b.jsx)(kE,{resource:e,field:{...t,name:u},value:i[t.name],required:o&&a[d]?.required===!0,errors:s[u],constraints:a[d],idPrefix:l,onChange:f},t.name)})})}function HE(e,t){let n=t?._perm?.actions;return e.actions.filter(e=>e.target===`record`&&(n===void 0||typeof n[e.name]==`string`)).map(e=>n?.[e.name]?{...e,label:n[e.name]}:e)}function UE(e,t){let n=HE(e,t),r=n.find(e=>e.primary),i=n.filter(e=>e!==r);return{...r?{primary:r}:{},buttons:i.slice(0,3),overflow:i.slice(3)}}function WE(e,t){let n=e.actions.filter(e=>e.target===`record`&&e.bulk);return t.length===0?n:n.filter(n=>t.some(t=>HE(e,t).some(e=>e.name===n.name)))}function GE(e){return e.actions.filter(e=>e.target===`resource`)}function KE(e,t=0){return e.confirm!==void 0||e.variant===`destructive`||t>1}function qE(e,t=0){return!e.input&&!KE(e,t)}function JE(e,t,n,r){if(KE(e,t))return typeof e.confirm==`string`?e.confirm:t>1?r(`action.confirmSelected`,{action:e.label,count:t}):n===void 0?r(`action.confirm`,{action:e.label}):r(`action.confirmRecord`,{action:e.label,name:n})}function YE(e){let t=e.message===void 0?{}:{message:e.message};return`record`in e?{kind:`record`,record:e.record,...t}:`ok`in e&&`failed`in e?{kind:`bulk`,result:{ok:e.ok,failed:e.failed},...t}:{kind:`resource`,...t}}function XE(e,t){return e.kind===`bulk`?e.result:{ok:t,failed:[]}}function ZE(e,t){if(!(e instanceof fg))return{fields:{},form:e.message};let n=Object.entries(e.fields),r=e=>t.includes(e.split(`.`)[0]),i=Object.fromEntries(n.filter(([e])=>r(e))),a=n.filter(([e])=>!r(e)).map(([e,t])=>`${e}: ${t.join(`, `)}`);return{fields:i,form:Object.keys(i).length>0&&a.length===0?null:[e.message,...a].join(` — `)}}function QE(e,t){let n=pC(e)?String(e.id):e;return t===null?n==null||n===``:typeof t==`boolean`?n===t||n===String(t):typeof n!=`string`||n.trim()===``?!1:typeof t==`number`?Number(Nh(n).trim().replace(/,/g,``))===t:n===t}function $E(e,t){return!e.showIf||Object.entries(e.showIf).every(([e,n])=>(Array.isArray(n)?n:[n]).some(n=>QE(t[e],n)))}var eD=/^.+@[^\s@]+\.[^\s@]+$/,tD=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function nD(e){if(/\s/.test(e))return!1;try{let{hostname:t}=new URL(/^[a-z][a-z0-9+.-]*:\/\//i.test(e)?e:`http://${e}`);return t.includes(`.`)||t.startsWith(`[`)}catch{return!1}}function rD(e,t){try{return new RegExp(t.source,t.flags).test(e)}catch{return!0}}function iD(e){let t=e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)??[],n=e.match(/[^\uFE0F\uFE0E][\uFE0F\uFE0E]/g)??[];return e.length-t.length-n.length}function aD(e,t){let n=[];if(typeof e==`string`){let r=iD(e);t.minLength!==void 0&&r<t.minLength&&n.push(J(`validation.minLength`,{min:t.minLength})),t.maxLength!==void 0&&r>t.maxLength&&n.push(J(`validation.maxLength`,{max:t.maxLength})),t.pattern&&!rD(e,t.pattern)&&n.push(t.pattern.message??J(`validation.pattern`)),t.format===`email`&&!eD.test(e)&&n.push(J(`validation.email`)),t.format===`url`&&!nD(e)&&n.push(J(`validation.url`)),t.format===`uuid`&&!tD.test(e)&&n.push(J(`validation.uuid`)),t.oneOf&&!t.oneOf.includes(e)&&n.push(J(`validation.oneOf`,{values:t.oneOf.join(`, `)}))}return typeof e==`number`&&(t.integer&&!Number.isInteger(e)&&n.push(J(`validation.integer`)),t.min!==void 0&&e<t.min&&n.push(J(`validation.min`,{min:t.min})),t.max!==void 0&&e>t.max&&n.push(J(`validation.max`,{max:t.max}))),n}function oD(e,t,n){let r={};for(let[i,a]of Object.entries(t))for(let{path:t,value:o,sent:s,parentSent:c}of sD(e,i.split(`.`))){if(o==null||o===``){a.required&&c&&(n===`create`||s)&&(r[t]=[J(`validation.required`)]);continue}let e=aD(o,a);e.length>0&&(r[t]=e)}return r}function sD(e,t,n=``,r=!0){let[i,...a]=t,o=typeof e==`object`&&e?e:void 0;if(i===`*`)return(Array.isArray(e)?e:[]).flatMap((e,t)=>sD(e,a,`${n}${t}.`,!0));let s=o!==void 0&&Object.hasOwn(o,i),c=o?.[i],l=`${n}${i}`;return a.length===0?[{path:l,value:c,sent:s,parentSent:r}]:sD(c,a,`${l}.`,r&&s)}function cD({resource:e,action:t,count:n,subject:r,running:i,error:a,onRun:o,onClose:s}){let c=X(),l=t.input?.fields??[],[u,d]=(0,y.useState)(()=>wC(l)),[f,p]=(0,y.useState)({}),[m,h]=(0,y.useState)(!1),g=l.filter(e=>$E(e,u)),_=a&&!m?ZE(a,l.map(e=>e.name)):{fields:{},form:null},v={..._.fields,...f};function x(e){if(e.preventDefault(),e.stopPropagation(),!t.input)return o(void 0);let{payload:n,errors:r}=EC(g,u),i={...oD(n,Object.fromEntries(Object.entries(t.input.constraints).filter(([e])=>g.some(t=>t.name===e.split(`.`)[0]))),`create`),...r};p(i),h(Object.keys(i).length>0),Object.keys(i).length===0&&o(n)}let S=JE(t,n,r,c);function C(n){let r=g.find(e=>e.name===n);if(!r||!t.input)return null;let i=e=>d(t=>({...t,[n]:e}));return r.type===`object`?(0,b.jsx)(BE,{resource:e,field:r,path:n,pattern:n,value:u[n],constraints:t.input.constraints,markRequired:!0,errors:v,idPrefix:`action`,onChange:i}):(0,b.jsx)(kE,{resource:e,field:r,value:u[n],required:t.input.required.includes(n),errors:v[n],constraints:t.input.constraints[n],idPrefix:`action`,onChange:i})}return(0,b.jsx)(jd,{open:!0,onOpenChange:e=>!e&&!i&&s(),children:(0,b.jsxs)(Ld,{children:[(0,b.jsx)(zd,{className:HS}),(0,b.jsx)(Ud,{"aria-describedby":S?`action-question`:void 0,className:`fixed inset-x-3 top-[12vh] z-50 mx-auto flex max-h-[76vh] max-w-lg flex-col overflow-hidden rounded-xl border bg-background shadow-xl outline-none`,children:(0,b.jsxs)(`form`,{onSubmit:x,noValidate:!0,className:`flex min-h-0 flex-col`,children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-4 overflow-y-auto p-4`,children:[(0,b.jsx)(Jd,{className:`text-lg font-semibold`,children:t.label}),S&&(0,b.jsx)(`p`,{id:`action-question`,className:`text-sm`,children:S}),n>1&&(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:c(t.atomic?`action.atomicNote`:`action.eachNote`,{count:n})}),_.form&&(0,b.jsx)(`div`,{role:`alert`,className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:_.form}),t.input&&(0,b.jsx)(NE,{layout:void 0,names:l.map(e=>e.name),errors:v,render:C})]}),(0,b.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2 border-t p-4`,children:[(0,b.jsx)(q,{type:`button`,variant:`outline`,disabled:i,onClick:s,children:c(`common.cancel`)}),(0,b.jsx)(q,{type:`submit`,variant:t.variant===`destructive`?`destructive`:`default`,disabled:i,children:i?c(`action.running`):t.label})]})]})})]})})}function lD({resource:e,action:t,ids:n,subject:r,size:i=`default`,className:a,primary:o=!1,menuItem:s=!1,blocked:c=!1,describedBy:l,onDone:u}){let d=X(),f=S(),[p,m]=(0,y.useState)(!1),h=qE(t,n?.length??0),g=pt({mutationFn:r=>Q.runAction(e,t.name,{...n?{ids:n}:{},...r?{input:r}:{}}),onSuccess:r=>{let i=YE(r);m(!1),i.kind===`bulk`?i.message&&VT(i.message):VT(i.message??d(i.kind===`record`&&i.record===null?`action.doneGone`:`action.done`,{action:t.label})),u(i,n??[]);for(let t of[`list`,`count`,`record`,`history`])f.invalidateQueries({queryKey:[t,e]})},onError:e=>{h&&VT(pg(e),`error`)}}),_=$w(t.icon);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(q,{type:`button`,size:i,variant:t.variant===`destructive`?`destructive`:o?`default`:s?`ghost`:`outline`,className:W(s&&`w-full justify-start font-normal`,a),disabled:c||g.isPending,"aria-describedby":l,"data-action":t.name,onClick:()=>{g.reset(),h?g.mutate(void 0):m(!0)},children:[_&&(0,b.jsx)(_,{"aria-hidden":!0}),t.label,o&&(0,b.jsx)(wv,{className:`ltr:rotate-180`,"aria-hidden":!0})]}),p&&(0,b.jsx)(cD,{resource:e,action:t,count:n?.length??0,subject:r,running:g.isPending,error:g.error,onRun:e=>g.mutate(e),onClose:()=>m(!1)})]})}function uD({schema:e,record:t,id:n,dirty:r,onGone:i,onChanged:a}){let o=X(),s=S(),[c,l]=(0,y.useState)(!1),{primary:u,buttons:d,overflow:f}=UE(e,t);if(!u&&d.length===0)return null;let p=`record-actions-note`,m=(o,c={})=>(0,b.jsx)(lD,{resource:e.name,action:o,ids:[n],subject:typeof t._title==`string`?t._title:`#${n}`,blocked:r,describedBy:r?p:void 0,...c,onDone:t=>{l(!1);let r=t.kind===`record`?t.record:void 0;if(r===null){i(),s.removeQueries({queryKey:[`record`,e.name,n]});return}r&&s.setQueryData([`record`,e.name,n],r),a()}},o.name);return(0,b.jsxs)(`div`,{role:`group`,"aria-label":o(`list.actions`),className:`ms-auto flex flex-wrap items-center gap-2`,children:[r&&(0,b.jsx)(`span`,{id:p,className:`text-xs text-muted-foreground`,children:o(`action.saveFirst`)}),d.map(e=>m(e)),f.length>0&&(0,b.jsxs)(Sh,{open:c,onOpenChange:l,children:[(0,b.jsx)(Ch,{asChild:!0,children:(0,b.jsx)(q,{type:`button`,variant:`outline`,size:`icon`,"aria-label":o(`action.more`),children:(0,b.jsx)(Jv,{})})}),(0,b.jsx)(wh,{forceMount:!0,children:(0,b.jsx)(Th,{forceMount:!0,align:`end`,sideOffset:6,className:`z-50 flex min-w-48 flex-col gap-0.5 rounded-[10px] border bg-popover p-1.5 shadow-lg data-[state=closed]:hidden`,onClick:()=>l(!1),children:f.map(e=>m(e,{menuItem:!0}))})})]}),u&&m(u,{primary:!0})]})}function dD({schema:e,ids:t,bulkOnly:n=!1,size:r=`default`}){let i=X(),a=(e.prints??[]).filter(e=>!n||e.bulk);return t.length===0||a.length===0?null:(0,b.jsx)(b.Fragment,{children:a.map(n=>{let a=$w(n.icon)??gb;return(0,b.jsxs)(q,{type:`button`,variant:`outline`,size:r,"aria-label":i(`print.open`,{name:n.label}),onClick:()=>window.open(Hg(e.name,n.name,t),`_blank`,`noopener`),children:[(0,b.jsx)(a,{}),n.label]},n.name)})})}function fD({schema:e,query:t,iconOnly:n=!1}){let r=X(),[i,a]=(0,y.useState)(!1);if(!e.list.export)return null;async function o(){a(!0);try{let{blob:n,filename:i,truncated:a}=await Q.exportList(e.name,t),o=URL.createObjectURL(n),s=document.createElement(`a`);s.href=o,s.download=i,s.click(),setTimeout(()=>URL.revokeObjectURL(o),1e4),VT(a?r(`list.exportTruncated`,{count:a}):r(`list.exportDone`,{file:i}),a?`error`:`success`)}catch(e){VT(pg(e),`error`)}finally{a(!1)}}return(0,b.jsxs)(q,{type:`button`,variant:`outline`,size:n?`icon`:`default`,disabled:i,"aria-label":n?r(`list.export`):void 0,onClick:()=>void o(),children:[(0,b.jsx)(ey,{}),!n&&r(i?`list.exporting`:`list.export`)]})}function pD(e,t,n){return e<=0?-1:t<0?n?e-1:0:(t+(n?-1:1)+e)%e}var mD=`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`,hD=[],gD=null;function _D(){let e=document.getElementById(`root`),t=document.documentElement,n={overflow:document.body.style.overflow,gutter:t.style.scrollbarGutter,inert:e?.hasAttribute(`inert`)??!1};document.body.style.overflow=`hidden`,t.style.scrollbarGutter=`stable`,e?.setAttribute(`inert`,``),gD=()=>{document.body.style.overflow=n.overflow,t.style.scrollbarGutter=n.gutter,n.inert||e?.removeAttribute(`inert`)}}function vD({labelledBy:e,describedBy:t,onDismiss:n,initialFocus:r,className:i,children:a}){let o=(0,y.useRef)(null),s=(0,y.useRef)(n);return s.current=n,(0,y.useEffect)(()=>{let e=Symbol(`alert`),t=document.activeElement instanceof HTMLElement?document.activeElement:null;hD.length===0&&_D(),hD.push(e),((r?o.current?.querySelector(r):null)??o.current?.querySelector(mD)??o.current)?.focus();let n=t=>{if(hD[hD.length-1]===e&&o.current){if(t.key===`Escape`&&s.current)t.preventDefault(),t.stopPropagation(),s.current();else if(t.key===`Tab`){t.preventDefault();let e=[...o.current.querySelectorAll(mD)];(e[pD(e.length,e.indexOf(document.activeElement),t.shiftKey)]??o.current).focus()}}};return document.addEventListener(`keydown`,n,!0),()=>{document.removeEventListener(`keydown`,n,!0),hD.splice(hD.indexOf(e),1),hD.length===0&&(gD?.(),gD=null),t?.isConnected&&hD.length===0&&t.focus()}},[r]),(0,Ec.createPortal)((0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`div`,{"data-testid":`alert-backdrop`,"aria-hidden":!0,className:HS,onClick:()=>s.current?.()}),(0,b.jsx)(`div`,{ref:o,role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":e,"aria-describedby":t,"data-state":`open`,tabIndex:-1,className:W(`fixed inset-x-3 top-[12vh] z-50 mx-auto max-h-[76vh] max-w-lg overflow-y-auto rounded-card border border-amber-500/50 bg-background p-4 shadow-xl outline-none motion-safe:animate-in motion-safe:fade-in-0 motion-safe:slide-in-from-top-2 motion-safe:duration-150`,i),children:a})]}),document.body)}function yD(e){let t=(0,y.useRef)(!1),n=ha(({currentLocation:n,nextLocation:r})=>e&&!t.current&&(n.pathname!==r.pathname||n.search!==r.search));return(0,y.useEffect)(()=>{if(!e)return;let t=e=>{e.preventDefault(),e.returnValue=``};return window.addEventListener(`beforeunload`,t),()=>window.removeEventListener(`beforeunload`,t)},[e]),{blocker:n,release:()=>{t.current=!0}}}function bD({blocker:e}){let t=X();return e.state===`blocked`?(0,b.jsxs)(vD,{labelledBy:`leave-title`,onDismiss:()=>e.reset(),className:`flex flex-wrap items-center gap-2`,children:[(0,b.jsx)(`p`,{id:`leave-title`,className:`min-w-0 flex-1 basis-full text-sm font-medium sm:basis-0`,children:t(`form.leaveTitle`)}),(0,b.jsx)(q,{type:`button`,variant:`outline`,onClick:()=>e.reset(),children:t(`form.stay`)}),(0,b.jsx)(q,{type:`button`,variant:`destructive`,onClick:()=>e.proceed(),children:t(`form.leave`)})]}):null}function xD(e,t){let n=(0,y.useRef)(t);n.current=t,(0,y.useEffect)(()=>{let t=t=>{if(!(t.metaKey||t.ctrlKey)||t.altKey||t.shiftKey||t.key.toLowerCase()!==`s`)return;t.preventDefault();let r=document.querySelector(`[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]`);(!r||r.contains(e.current))&&(n.current?.(),e.current?.requestSubmit())};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e])}function SD(e){let[t,n]=(0,y.useState)([]),[r,i]=(0,y.useState)(!1),a=(0,y.useRef)(e);return a.current=e,(0,y.useEffect)(()=>{t.length>0||!r||(i(!1),a.current())},[t.length,r]),{busy:t.length>0,setBusy:(e,t)=>n(n=>t===n.includes(e)?n:t?[...n,e]:n.filter(t=>t!==e)),refuse:()=>i(!0)}}function CD({dirty:e,children:t}){let n=X();return(0,b.jsxs)(`div`,{className:`sticky bottom-3 z-10 flex flex-wrap items-center gap-2 rounded-card border bg-card px-4 py-2.5 shadow-[0_12px_32px_rgba(0,0,0,.12)]`,children:[e&&(0,b.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-[13px] font-semibold`,children:[(0,b.jsx)(`span`,{"aria-hidden":!0,className:`size-2 rounded-full bg-amber-500`}),n(`form.unsaved`)]}),(0,b.jsx)(`div`,{className:`ms-auto flex flex-wrap items-center gap-2`,children:t})]})}function wD(){let e=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform);return(0,b.jsx)(`kbd`,{"aria-hidden":!0,className:`rounded border border-current/30 px-1 font-sans text-[10.5px] opacity-80`,children:e?`⌘S`:`Ctrl S`})}var TD=`—`,ED=e=>e==null||e===``;function DD(e,t){let n=t?.value;switch(e.kind){case`image`:return typeof n==`string`&&n!==``?{kind:`image`,src:n}:{kind:`image`};case`toggle`:return{kind:`toggle`,on:n===!0};case`money`:{if(ED(n))return{kind:`money`,text:TD};let e=jx(String(n),ED(t?.previous)?{}:{previous:String(t.previous)});return{kind:`money`,text:e.main,...e.unit?{unit:e.unit,unitPosition:e.position}:{},...e.previous===void 0?{}:{previous:e.previous}}}case`badge`:return{kind:`badge`,text:t?.label??(ED(n)?TD:String(n)),...t?.tone?{tone:t.tone}:{}};case`count`:return{kind:`count`,text:typeof n==`number`?eg(n):ED(n)?TD:tg(String(n))};case`title`:return{kind:`title`,text:ED(n)?TD:String(n),...ED(t?.subline)?{}:{subline:String(t.subline)}}}}function OD({schema:e,name:t,column:n,item:r,compact:i=!1}){let a=r._computed?.[t],o=DD(n,a);switch(o.kind){case`image`:return(0,b.jsx)(`span`,{className:W(`flex shrink-0 items-center justify-center overflow-hidden rounded-control border bg-muted text-muted-foreground`,i?`size-14`:`size-10`),children:o.src?(0,b.jsx)(`img`,{src:o.src,alt:``,className:`size-full object-cover`,loading:`lazy`}):(0,b.jsx)(vy,{className:`size-[18px]`,"aria-hidden":!0})});case`title`:return(0,b.jsxs)(`span`,{className:`flex min-w-0 flex-col leading-[1.45]`,children:[(0,b.jsx)(`span`,{className:W(`truncate font-semibold`,i?`text-[14.5px]`:`text-[13.5px]`),children:o.text}),o.subline&&(0,b.jsx)(`span`,{className:`truncate text-start font-mono text-[11.5px] text-muted-foreground`,children:(0,b.jsx)(`bdi`,{dir:`ltr`,children:o.subline})})]});case`money`:return(0,b.jsxs)(`span`,{className:`flex flex-col leading-[1.4]`,children:[(0,b.jsxs)(`span`,{className:`font-semibold whitespace-nowrap`,children:[o.unit&&o.unitPosition===`before`&&(0,b.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[o.unit,` `]}),o.text,o.unit&&o.unitPosition!==`before`&&(0,b.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[` `,o.unit]})]}),o.previous&&(0,b.jsx)(`s`,{className:`text-xs text-muted-foreground`,children:o.previous})]});case`badge`:return(0,b.jsx)($T,{tone:o.tone,children:o.text});case`count`:return(0,b.jsx)(`span`,{className:`text-muted-foreground`,children:o.text});case`toggle`:return(0,b.jsx)(kD,{schema:e,column:n,item:r,on:o.on===!0})}}function kD({schema:e,column:t,item:n,on:r}){let i=X(),a=S(),[o,s]=(0,y.useState)(r),c=t.toggle,l=c!==void 0&&n._perm?.update!==!1&&!(Array.isArray(n._readonly)&&n._readonly.includes(c.field)),u=pt({mutationFn:t=>Q.update(e.name,String(n._id),{[c.field]:t?c.on:c.off},e.version?n[e.version]:void 0),onSuccess:()=>a.invalidateQueries({queryKey:[`list`,e.name]}),onError:e=>{s(r),VT(pg(e),`error`)}}),d=typeof n._title==`string`?n._title:String(n._id);return(0,b.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":o,"aria-label":i(`list.toggleRow`,{column:t.label,name:d}),disabled:!l||u.isPending,onClick:e=>{e.preventDefault(),e.stopPropagation(),s(!o),u.mutate(!o)},className:W(`relative inline-block h-5 w-9 shrink-0 cursor-pointer rounded-full bg-input transition-colors disabled:cursor-default disabled:opacity-60`,o&&`bg-primary`,`after:absolute after:top-0.5 after:size-4 after:rounded-full after:bg-white after:shadow-sm after:transition-[inset-inline-start] after:content-[''] after:start-0.5`,o&&`after:start-[18px]`)})}function AD(e){let t=e.form.layout;return t?t.flatMap(e=>`tab`in e?e.sections:[e]).flatMap(e=>`fields`in e&&!(`inline`in e)?e.fields:[]):[...new Set([...e.form.update,...e.form.readonly])]}function jD(e){let t=(e.form.layout??[]).flatMap(e=>`tab`in e?e.sections:[e]).flatMap(e=>`summary`in e?e.summary.flatMap(e=>`field`in e.value?[e.value.field]:[]):[]),n=(e.form.aside??[]).flatMap(e=>e.relation?[e.relation.field]:e.fields),r=[...e.form.header?.badges??[],...(e.form.header?.subtitle??[]).flatMap(e=>`field`in e?[e.field]:[])],i=new Set(e.form.update);return new Set([...t,...n,...r].filter(e=>!i.has(e)))}function MD(e,t,n){let r=e.form.mode===`view`&&t!==void 0&&!n,i=new Set(AD(e)),a=r?[]:e.form.update.filter(t=>i.has(t)||!e.form.layout),o=e.form.header,s=t=>e.fields.find(e=>e.name===t),c=e=>e!==void 0&&t?.[e.name]!==void 0&&t?.[e.name]!==null,l=(o?.badges?o.badges.map(s):e.fields.filter(e=>e.widget===`badge`)).filter(c),u=o?.stepper?s(o.stepper):void 0;u&&c(u)&&u.steps?.exclude.includes(String(t[u.name]))&&!l.includes(u)&&l.push(u);let d=t?._computed??{};return{editable:a,header:{badges:l,subtitle:(o?.subtitle??[]).flatMap(n=>{if(`field`in n){let e=s(n.field);return e&&c(e)?[Nx(t[e.name],e)]:[]}let r=e.list.computed?.[n.computed];if(!r||!d[n.computed])return[];let i=DD(r,d[n.computed]);return i.text?[r.kind===`count`?`${i.text} ${r.label}`:i.text]:[]}),...u?{stepper:u}:{}},aside:e.form.aside??[]}}function ND(e,t,n){return e.relation?n?._aside?.[String(t)]:n}function PD(e,t,n){let r=n?._computed??{};return e.summary.flatMap(e=>{if(`field`in e.value){let r=t.fields.find(t=>t.name===e.value.field),i=n?.[e.value.field];return r&&i!=null?[{label:e.label,text:Nx(i,r)}]:[]}let i=t.list.computed?.[e.value.computed],a=r[e.value.computed];if(!i||!a)return[];let o=DD(i,a),s=o.unit?o.unitPosition===`before`?`${o.unit} ${o.text}`:`${o.text} ${o.unit}`:o.text;return s?[{label:e.label,text:s}]:[]})}function FD(e,t){let n={};for(let r of e){if(!r.warnIf||!(r.name in t))continue;let e=t[r.name];(e==null||typeof e==`string`&&e.trim()===``)&&(n[r.name]=r.warnIf.message)}return n}function ID(e,t){return e.fields.filter(t=>t!==e.order).flatMap(e=>t.fields.filter(t=>t.name===e))}function LD(e,t,n){let r=n?._inlines?.[e.inline],i=ID(e,t);return(r?.rows??[]).map(e=>({key:String(e._id),id:String(e._id),record:e,values:wC(i,e)}))}function RD(e,t,n){return{key:n,values:wC(ID(e,t))}}function zD(e,t){if(!e.record)return new Set;let n=e.record._perm;if(t.permissions?.update===!1||n?.update===!1)return new Set(t.fields.map(e=>e.name));let r=Array.isArray(e.record._readonly)?e.record._readonly:[];return new Set([...t.form.readonly,...r])}function BD(e,t,n,r){let i=ID(e,t),a={},o=[],s=[],c=new Map(n.map(e=>[e.key,e]));for(let e of r){let n=c.get(e.key);if(n?.id!==void 0){let r=zD(e,t),{payload:o,errors:c}=EC(i.filter(e=>!r.has(e.name)),e.values,n.values),l={...oD(o,t.form.constraints.update,`update`),...c};if(Object.keys(l).length>0&&(a[e.key]=l),Object.keys(o).length===0)continue;let u=t.version?n.record?.[t.version]:void 0;s.push({_id:n.id,...o,...typeof u==`number`?{_version:u}:{}})}else{let{payload:n,errors:r}=EC(i,e.values),s={...oD(n,t.form.constraints.create,`create`),...r};Object.keys(s).length>0&&(a[e.key]=s),o.push({_key:e.key,...n})}}let l=new Set(r.map(e=>e.key)),u=n.filter(e=>e.id!==void 0&&!l.has(e.key)).map(e=>e.id),d=e.order!==void 0&&t.form.update.includes(e.order),f=r.map(e=>e.key),p=d&&f.join(`
|
|
56
|
+
`)!==n.map(e=>e.key).join(`
|
|
57
|
+
`)?f:void 0,m={...o.length?{create:o}:{},...s.length?{update:s}:{},...u.length?{delete:u}:{},...p?{order:p}:{}};return{changes:Object.keys(m).length?m:void 0,errors:a}}function VD(e,t,n,r,i){let a={},o={};for(let s of e){let e=t[s.inline];if(!e||s.readonly)continue;let c=r[s.inline]??[],l=BD(s,e,n[s.inline]??[],c),u=l.changes?i(s,c.length):null;(Object.keys(l.errors).length>0||u)&&(o[s.inline]={rows:l.errors,inline:u?[u]:[]}),l.changes&&(a[s.inline]=l.changes)}return{changes:Object.keys(a).length?a:void 0,errors:o}}function HD(e,t){let n={},r={};for(let[i,a]of Object.entries(e)){if(i!==`_inlines`&&!i.startsWith(`_inlines.`)){r[i]=a;continue}let[,e=``,o,s,...c]=i.split(`.`),l=n[e]??={rows:{},inline:[]},u=o===`create`?t?.[e]?.create?.[Number(s)]?._key:o===`update`||o===`delete`?s:void 0,d=c.join(`.`);u===void 0||o===`create`&&!/^\d+$/.test(s??``)||d===``?l.inline.push(...a):((l.rows[u]??={})[d]??=[]).push(...a)}return{inlines:n,parent:r}}var UD=e=>Object.values(e).some(e=>e.inline.length>0||Object.keys(e.rows).length>0);function WD({inline:e,child:t,rows:n,onChange:r,readOnly:i,errors:a,parent:o,parentValues:s,onBusy:c,truncated:l,canAdd:u=!0}){let d=X(),f=(0,y.useId)(),p=ID(e,t),m=(0,y.useRef)(0),[h,g]=(0,y.useState)(null),_=!i&&u&&t.permissions?.create!==!1&&t.form.create.length>0&&n.length<e.max,v=!i&&e.order!==void 0&&t.form.update.includes(e.order)&&n.length>1,x=e=>!i&&(e.id===void 0||t.permissions?.delete!==!1&&e.record?._perm?.delete!==!1),S=e=>s===void 0?void 0:JSON.stringify({...JSON.parse(DC(p,e.values)??`{}`),_parent:JSON.parse(s)});function C(){let i;do i=`n${++m.current}`;while(n.some(e=>e.key===i));r([...n,RD(e,t,i)])}let w=(e,t,i)=>r(n.map(n=>n.key===e?{...n,values:{...n.values,[t]:i}}:n)),T=e=>r(n.filter(t=>t.key!==e));function E(e,t){if(t<0||t>=n.length||e===t)return;let i=[...n];i.splice(t,0,i.splice(e,1)[0]),r(i)}function D(n,r,s){let l=`inline-${t.name}-${n.key}`,u=a?.rows[n.key]??{},d=n.id===void 0;if(i||!(d?t.form.create:t.form.update).includes(r.name)||zD(n,t).has(r.name))return d?null:e.readonly&&s?(0,b.jsx)(rE,{value:n.record?.[r.name],field:r,record:n.record}):(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,"data-readonly":r.name,children:[!s&&(0,b.jsx)(`span`,{className:`text-sm font-medium`,children:r.label}),(0,b.jsx)(`div`,{className:`min-h-8 rounded-lg bg-muted/50 px-2.5 py-1.5 text-sm break-words`,children:(0,b.jsx)(rE,{value:n.record?.[r.name],field:r,record:n.record})})]});let f=d?`create`:`update`;if(r.type===`object`)return(0,b.jsx)(BE,{resource:t.name,field:r,path:r.name,pattern:r.name,value:n.values[r.name],constraints:t.form.constraints[f],markRequired:d,errors:u,idPrefix:l,onChange:e=>w(n.key,r.name,e)});let p=FD([r],n.values)[r.name],m=(0,b.jsx)(kE,{resource:t.name,field:r,value:n.values[r.name],required:d&&t.form.requiredOnCreate.includes(r.name),errors:u[r.name],constraints:t.form.constraints[f][r.name],formValues:r.type===`relation`?S(n):void 0,parent:o,idPrefix:l,hideLabel:s,onChange:e=>w(n.key,r.name,e),onBusy:e=>c(`${t.name}:${n.key}:${r.name}`,e)});return p?(0,b.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[m,(0,b.jsxs)(`p`,{className:`flex items-center gap-1 text-xs text-warn`,children:[(0,b.jsx)(ix,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),p]})]}):m}function O(t,r){let i=d(`inline.row`,{name:e.label,index:r+1});return(0,b.jsxs)(`div`,{className:`flex items-center gap-1`,children:[v&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`span`,{className:`cursor-grab text-muted-foreground`,draggable:!0,"aria-hidden":!0,onDragStart:e=>{e.dataTransfer.effectAllowed=`move`,g(r)},onDragEnd:()=>g(null),children:(0,b.jsx)(uy,{className:`size-4`})}),(0,b.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-sm`,disabled:r===0,"aria-label":d(`inline.moveUp`,{name:i}),onClick:()=>E(r,r-1),children:(0,b.jsx)(X_,{})}),(0,b.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-sm`,disabled:r===n.length-1,"aria-label":d(`inline.moveDown`,{name:i}),onClick:()=>E(r,r+1),children:(0,b.jsx)(K_,{})})]}),x(t)&&(0,b.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":d(`inline.remove`,{name:i}),onClick:()=>T(t.key),children:(0,b.jsx)(nx,{})})]})}let k=e=>v?{onDragOver:e=>{h!==null&&e.preventDefault()},onDrop:t=>{t.preventDefault(),h!==null&&E(h,e),g(null)}}:{},A=e=>{let t=Object.entries(a?.rows[e.key]??{}).filter(([e])=>!p.some(t=>t.name===e.split(`.`)[0]));return t.length>0?(0,b.jsx)(`p`,{className:`text-sm text-destructive`,children:t.map(([e,t])=>`${e}: ${t.join(`, `)}`).join(` — `)}):null},j=v||n.some(x);return(0,b.jsxs)(`section`,{"aria-labelledby":f,className:`flex min-w-0 flex-col rounded-card border bg-card shadow-card`,"data-inline":t.name,children:[(0,b.jsxs)(`div`,{className:`flex min-h-14 flex-wrap items-center gap-2 border-b px-5 py-3`,children:[(0,b.jsx)(`h2`,{id:f,className:`text-[15px] font-semibold`,children:e.label}),(0,b.jsx)(`span`,{className:`inline-flex h-5 items-center rounded-full bg-muted px-2 text-[11px] text-muted-foreground`,children:KD(d,e,n.length)}),_&&(0,b.jsxs)(q,{type:`button`,variant:`outline`,size:`sm`,className:`ms-auto`,onClick:C,children:[(0,b.jsx)(mb,{}),d(`form.add`,{name:e.label})]})]}),(0,b.jsxs)(`div`,{className:`flex flex-col gap-3 p-5 empty:hidden`,children:[l&&(0,b.jsxs)(`p`,{role:`note`,className:`text-sm text-muted-foreground`,children:[d(`inline.truncated`,{count:l.total-n.length}),` `,(0,b.jsx)(bo,{to:l.href,className:`text-primary hover:underline`,children:d(`inline.openList`)})]}),n.length===0&&(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:d(`inline.empty`)}),n.length>0&&e.display===`table`&&(0,b.jsx)(`div`,{className:`relative -mx-5 overflow-x-auto border-y first:-mt-5 first:border-t-0 last:-mb-5 last:border-b-0`,children:(0,b.jsxs)(`table`,{className:`w-full text-[13px]`,children:[(0,b.jsx)(`thead`,{className:`bg-[color-mix(in_oklab,var(--muted)_50%,transparent)] text-[12.5px] text-muted-foreground`,children:(0,b.jsxs)(`tr`,{children:[(e.computed??[]).map(e=>(0,b.jsx)(`th`,{scope:`col`,className:`px-3.5 py-2.5 text-start font-medium whitespace-nowrap`,children:t.list.computed?.[e]?.label},`~${e}`)),p.map(e=>(0,b.jsxs)(`th`,{scope:`col`,className:`px-3.5 py-2.5 text-start font-medium whitespace-nowrap`,children:[e.label,t.form.requiredOnCreate.includes(e.name)&&n.some(e=>e.id===void 0)&&(0,b.jsx)(`span`,{"aria-hidden":!0,className:`text-destructive`,children:`*`})]},e.name)),j&&(0,b.jsx)(`th`,{scope:`col`,className:`px-3.5 py-2.5`,children:(0,b.jsx)(`span`,{className:`sr-only`,children:d(`inline.rowActions`)})})]})}),(0,b.jsx)(`tbody`,{children:n.map((n,r)=>(0,b.jsxs)(`tr`,{"data-row":n.key,className:W(`border-t align-top`,h===r&&`opacity-50`),...k(r),children:[(e.computed??[]).map(e=>(0,b.jsx)(`td`,{className:`px-3.5 py-2`,children:n.record&&t.list.computed?.[e]&&(0,b.jsx)(OD,{schema:t,name:e,column:t.list.computed[e],item:n.record})},`~${e}`)),p.map(e=>(0,b.jsx)(`td`,{className:`min-w-32 px-3.5 py-2`,children:D(n,e,!0)},e.name)),j&&(0,b.jsx)(`td`,{className:`px-3.5 py-2`,children:O(n,r)})]},n.key))})]})}),e.display===`table`&&n.map(e=>(0,b.jsx)(y.Fragment,{children:A(e)},e.key)),e.display===`cards`&&n.map((n,r)=>(0,b.jsxs)(`div`,{"data-row":n.key,className:W(`flex flex-col gap-4 rounded-card border bg-background/40 p-4`,h===r&&`opacity-50`),...k(r),children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,b.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-medium`,children:[GD(n)??d(`inline.newRow`,{name:e.label,index:r+1}),r===0&&e.markFirst&&(0,b.jsx)($T,{tone:`primary`,children:e.markFirst})]}),O(n,r)]}),(0,b.jsx)(NE,{plain:!0,layout:t.form.layout,names:p.map(e=>e.name),errors:a?.rows[n.key]??{},render:e=>{let t=p.find(t=>t.name===e);return t?D(n,t,!1):null}}),A(n)]},n.key)),a&&a.inline.length>0&&(0,b.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a.inline.join(` — `)})]})]})}var GD=e=>typeof e.record?._title==`string`?e.record._title:void 0;function KD(e,t,n){return t.min?e(`inline.limitsBetween`,{min:t.min,max:t.max,count:n}):e(`inline.limitsMax`,{max:t.max,count:n})}var qD=(e,t)=>t===void 0?[`history`,e]:[`history`,e,t];function JD({schema:e,id:t,record:n}){let r=X(),i=Gg(),a=mt({queryKey:qD(e.name,t),initialPageParam:void 0,queryFn:({pageParam:n})=>Q.history(e.name,t,n),getNextPageParam:e=>e.next,staleTime:0});if(a.isPending)return(0,b.jsx)(G,{children:r(`common.loading`)});if(a.isError&&!a.data)return(0,b.jsx)(G,{tone:`error`,children:pg(a.error)});let o=a.data.pages.flatMap(e=>e.entries);if(o.length===0)return(0,b.jsx)(G,{children:r(`audit.empty`)});let s=t=>t===e.name?e:void 0;return(0,b.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,b.jsx)(aS,{entries:o,now:new Date(a.dataUpdatedAt),names:Ix(i.data,s),schemaOf:s,titleOf:(e,t)=>YD(n,e,t)}),a.isError&&(0,b.jsx)(G,{tone:`error`,children:pg(a.error)}),a.hasNextPage&&(0,b.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,className:`self-center`,disabled:a.isFetchingNextPage,onClick:()=>void a.fetchNextPage(),children:r(a.isFetchingNextPage?`common.loading`:`list.loadMore`)})]})}function YD(e,t,n){let r=e?.[t],i=(Array.isArray(r)?r:[r]).find(e=>typeof e==`object`&&!!e&&String(e.id)===n);return typeof i?.title==`string`?i.title:void 0}function XD(e){return e.normalize(`NFKD`).replace(/\p{M}/gu,``).normalize(`NFC`).toLowerCase().replace(/[^\p{L}\p{N}]+/gu,`-`).replace(/^-+|-+$/g,``)}function ZD(e,t,n){let r=typeof t?._title==`string`?t._title:`#${n}`;return r.startsWith(`#`)?`${e} ${r}`:`${e}: ${r}`}function QD({mode:e}){let t=X(),{resource:n=``,id:r}=$i(),i=qi(),[a]=wo(),o=e===`create`?a.get(`from`)??void 0:void 0,s=e===`edit`?r:o,c=Kg(n),l=Xg(n,s),[u,d]=(0,y.useState)(0),f=`${n}:${r}`,[p,m]=(0,y.useState)({of:f,tab:`details`}),h=p.of===f?p.tab:`details`;if(c.isPending||s!==void 0&&l.isPending)return(0,b.jsx)(G,{children:t(`common.loading`)});if(c.isError)return(0,b.jsx)(G,{tone:`error`,children:c.error.message});if(s!==void 0&&l.isError)return(0,b.jsx)(G,{tone:`error`,children:l.error.message});let g=i.state?.saved;return(0,b.jsx)(eO,{schema:c.data,mode:e,id:r,record:e===`edit`?l.data:void 0,source:o?l.data:void 0,saved:u===0?g:void 0,onChanged:()=>d(e=>e+1),tab:h,onTab:e=>m({of:f,tab:e})},e===`edit`?`${n}:${r}:${u}`:`${n}:new:${i.key}`)}function $D(e,t){let n=new Set(e.fields.filter(e=>e.primary||e.unique||e.readonly||e.file).map(e=>e.name)),r=new Set(e.fields.filter(e=>e.widget===`richtext`).map(e=>e.name));return Object.fromEntries(Object.entries(t).filter(([e])=>!n.has(e)&&!e.startsWith(`_`)).map(([e,t])=>[e,r.has(e)&&typeof t==`string`?xC(t):t]))}function eO({schema:e,mode:t,id:n,record:r,source:i,saved:a,onChanged:o,tab:s,onTab:c}){let l=X(),{locale:u}=Y(),d=Yi(),f=S(),p=r?._perm,m=t===`create`||e.permissions?.update!==!1&&p?.update!==!1,h=e.permissions?.delete!==!1&&p?.delete!==!1,[g,_]=(0,y.useState)(!1),v=MD(e,t===`edit`?r:void 0,g),x=t===`edit`&&e.form.mode===`view`&&!g,C=new Set(t===`edit`?m&&!x?[...e.form.readonly,...iO(r)]:[...e.form.update,...e.form.readonly]:[]),w=t===`create`?e.form.create:[...e.form.update,...e.form.readonly],T=e.fields.filter(e=>w.includes(e.name)),E=jD(e),D=T.filter(e=>!C.has(e.name)),O=D.map(e=>e.name),[k,A]=(0,y.useState)(r),[j,M]=(0,y.useState)(()=>wC(D,r??(i?$D(e,i):void 0))),[N,ee]=(0,y.useState)(j);(0,y.useEffect)(()=>{if(!g||!r)return;let e=wC(D,r);M(e),ee(e)},[g]);let te=tO(e),P=t=>Object.fromEntries(te.map(n=>[n.inline,LD(n,e.inlines[n.inline],t)])),[ne,re]=(0,y.useState)(()=>P(r)),[ie,ae]=(0,y.useState)(ne),[oe,se]=(0,y.useState)({}),ce=(0,y.useRef)(void 0),le=e.version?k?.[e.version]:void 0,[F,ue]=(0,y.useState)(null),de=DC(D,N),[fe,pe]=(0,y.useState)({}),[me,I]=(0,y.useState)(null),he=Wg(),ge=t===`edit`&&n!==void 0&&he.data?.audit.enabled===!0,_e=ge?s:`details`,ve=(0,y.useRef)(new Set(D.filter(e=>e.widget===`slug`&&j[e.name]!==``).map(e=>e.name)));function ye(e,t){ee(n=>{let r={...n,[e]:t};if(typeof t==`string`)for(let n of D)n.slugFrom===e&&!ve.current.has(n.name)&&(r[n.name]=XD(t));return r}),D.some(t=>t.name===e&&t.widget===`slug`)&&ve.current.add(e)}let[be,xe]=(0,y.useState)(a?l(`form.savedName`,{name:a}):null),L=SD(()=>I(null)),Se=JSON.stringify(N)!==JSON.stringify(j)||JSON.stringify(ie)!==JSON.stringify(ne),{blocker:Ce,release:we}=yD(Se),Te=(0,y.useRef)(null),Ee=(0,y.useRef)(`list`);xD(Te,()=>{Ee.current=`stay`});let De=pt({mutationFn:({payload:r,version:i})=>t===`create`?Q.create(e.name,r):Q.update(e.name,n,r,i),onSuccess:async(r,{then:i})=>{f.invalidateQueries({queryKey:qD(e.name)}),await f.invalidateQueries({queryKey:[`list`,e.name]});let a=typeof r._title==`string`?r._title:`#${String(r._id)}`;if(i===`stay`&&t===`edit`){let t=wC(D,r),i=P(r);A(r),M(t),ee(t),re(i),ae(i),se({}),xe(l(`form.savedName`,{name:a})),await f.invalidateQueries({queryKey:[`record`,e.name,n]});return}we(),f.removeQueries({queryKey:[`record`,e.name]}),i===`new`?d(`/${e.name}/new`,{state:{saved:a}}):i===`stay`?d(`/${e.name}/${encodeURIComponent(String(r._id))}`,{replace:!0,state:{saved:a}}):d(`/${e.name}`)},onError:e=>{if(c(`details`),!(e instanceof fg)){I(e.message);return}if(e.status===409&&e.body.current){ue(e.body.current);return}let t=ZE(e,[...O,`_inlines`]),n=HD(t.fields,ce.current);pe(n.parent),se(n.inlines),I(t.form)}}),[Oe,ke]=(0,y.useState)(!1),Ae=pt({mutationFn:()=>Q.remove(e.name,n,le),onSuccess:async()=>{we(),await f.invalidateQueries({queryKey:[`list`,e.name]}),d(`/${e.name}`),f.removeQueries({queryKey:[`record`,e.name,n]})},onError:e=>{ke(!1),I(pg(e))}}),je=D.filter(e=>$E(e,N));function Me(){let n=EC(je,N,t===`edit`?j:void 0),r=VD(te,e.inlines??{},ne,ie,(e,t)=>e.min!==void 0&&t<e.min?l(`inline.countMin`,{min:e.min,count:t}):t>e.max?l(`inline.countMax`,{max:e.max,count:t}):null);return ce.current=r.changes,{payload:r.changes?{...n.payload,_inlines:r.changes}:n.payload,errors:n.errors,inlineErrors:r.errors}}function Ne(n){if(n.preventDefault(),!m)return;let r=n.nativeEvent.submitter,i=r?.value===`new`?`new`:r?`list`:Ee.current;if(Ee.current=`list`,xe(null),L.busy){I(l(`upload.busy`)),L.refuse();return}let{payload:a,errors:o,inlineErrors:s}=Me(),u=t===`create`?`create`:`update`,d={...oD(a,Object.fromEntries(Object.entries(e.form.constraints[u]).filter(([e])=>je.some(t=>t.name===e.split(`.`)[0]))),u),...o};pe(d),se(s),I(null),Object.keys(d).length===0&&!UD(s)?De.mutate({payload:a,version:le,then:i}):c(`details`)}function Pe(t){ue(null),De.mutate({payload:Me().payload,version:e.version?t[e.version]:void 0,then:De.variables?.then??`list`})}function Fe(e){let t=wC(D,e);ue(null),A(e),M(t),ee(t),pe({})}function Ie(t){let i=e.inlines?.[t.inline];if(!i)return null;let a=r?._inlines?.[t.inline],o=a?.truncated&&n!==void 0?{total:a.total,href:`/${i.name}?${new URLSearchParams({[`filter[${t.link}]`]:String(r?.[e.primaryKeys[0]]??n)})}`}:void 0;return(0,b.jsx)(WD,{inline:t,child:i,rows:ie[t.inline]??[],onChange:e=>ae(n=>({...n,[t.inline]:e})),readOnly:!m||x||t.readonly===!0||o!==void 0,errors:oe[t.inline],parent:e.name,parentValues:de,onBusy:L.setBusy,truncated:o,canAdd:(r?._perm)?.inlines?.[t.inline]?.create!==!1})}function Le(t){let n=PD(t,e,r);return n.length===0?null:(0,b.jsx)(iE,{title:t.title,bodyClassName:t.title?void 0:`p-5`,children:(0,b.jsx)(`dl`,{className:`flex flex-col gap-2 text-[13px]`,children:n.map((e,t)=>(0,b.jsxs)(`div`,{className:W(`flex items-baseline justify-between gap-3`,t===n.length-1&&n.length>1&&`border-t pt-2.5 text-sm font-bold`),children:[(0,b.jsx)(`dt`,{className:W(t===n.length-1&&n.length>1?``:`text-muted-foreground`),children:e.label}),(0,b.jsx)(`dd`,{children:e.text})]},e.label))})})}let Re=FD(D,N);function ze(e){let t=Be(e);return t&&Re[e]?(0,b.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[t,(0,b.jsxs)(`p`,{className:`flex items-center gap-1 text-xs text-warn`,children:[(0,b.jsx)(ix,{className:`size-3.5`,"aria-hidden":!0}),Re[e]]})]}):t}function Be(n){let i=T.find(e=>e.name===n);if(!i||!$E(i,N))return null;if(C.has(n))return(0,b.jsx)(aO,{resource:e.name,field:i,record:r,plain:x});let a=t===`create`?`create`:`update`;return i.type===`object`?(0,b.jsx)(BE,{resource:e.name,field:i,path:i.name,pattern:i.name,value:N[i.name],constraints:e.form.constraints[a],markRequired:t===`create`,errors:fe,onChange:e=>ye(i.name,e)}):(0,b.jsx)(kE,{resource:e.name,field:i,value:N[i.name],required:t===`create`&&e.form.requiredOnCreate.includes(i.name),errors:fe[i.name],formValues:i.type===`relation`?de:void 0,constraints:e.form.constraints[a][i.name],onChange:e=>ye(i.name,e),onBusy:e=>L.setBusy(i.name,e)})}return(0,b.jsxs)(`form`,{ref:Te,onSubmit:Ne,noValidate:!0,className:W(`flex flex-col gap-5`,v.aside.length>0?`max-w-[1400px]`:e.form.layout?.length?`max-w-4xl`:`max-w-2xl`),children:[t===`create`?(0,b.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,b.jsx)(oO,{to:`/${e.name}`}),(0,b.jsx)(`h1`,{className:`text-[22px] font-bold`,children:l(`form.new`,{name:e.label})})]}):(0,b.jsx)(sO,{schema:e,record:r,id:n,dirty:Se,onGone:()=>{we(),d(`/${e.name}`)},onChanged:o,badges:v.header.badges,subtitle:v.header.subtitle,extra:(0,b.jsxs)(b.Fragment,{children:[x&&m&&(0,b.jsxs)(q,{type:`button`,variant:`outline`,onClick:()=>_(!0),children:[(0,b.jsx)(ob,{}),l(`form.edit`)]}),e.creatable&&(0,b.jsx)(q,{asChild:!0,variant:`outline`,children:(0,b.jsxs)(bo,{to:`/${e.name}/new?${new URLSearchParams({from:n})}`,children:[(0,b.jsx)(Iv,{}),l(`form.duplicate`)]})}),h&&(Oe?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(q,{type:`button`,variant:`destructive`,disabled:Ae.isPending,onClick:()=>Ae.mutate(),children:l(Ae.isPending?`form.deleting`:e.softDelete?`form.confirmMoveToTrash`:`form.confirmDelete`)}),(0,b.jsx)(q,{type:`button`,variant:`ghost`,onClick:()=>ke(!1),children:l(`form.keep`)})]}):(0,b.jsxs)(q,{type:`button`,variant:`outline`,className:`text-destructive`,onClick:()=>ke(!0),children:[(0,b.jsx)(nx,{}),l(e.softDelete?`form.moveToTrash`:`form.delete`)]}))]})}),i&&te.length>0&&(0,b.jsx)(`p`,{role:`note`,className:`rounded-md border bg-muted/40 px-3 py-2 text-sm text-muted-foreground`,children:l(`inline.duplicateNote`,{names:new Intl.ListFormat(u).format(te.map(e=>e.label))})}),!m&&e.form.mode!==`view`&&(0,b.jsx)(`p`,{role:`note`,className:`rounded-md border bg-muted/40 px-3 py-2 text-sm text-muted-foreground`,children:l(`form.viewOnly`)}),be&&(0,b.jsx)(`p`,{role:`status`,className:`rounded-md border border-green-600/30 bg-green-500/10 px-3 py-2 text-sm`,children:be}),(0,b.jsx)(bD,{blocker:Ce}),ge&&(0,b.jsx)(rO,{active:_e,onChange:c}),F&&(0,b.jsx)(cO,{fields:D,before:k,current:F,busy:De.isPending,onKeepMine:()=>Pe(F),onLoadTheirs:()=>Fe(F)}),me&&(0,b.jsx)(`div`,{role:`alert`,className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:me}),ge&&_e===`history`&&(0,b.jsx)(`div`,{role:`tabpanel`,id:`record-panel-history`,"aria-labelledby":`record-tab-history`,children:(0,b.jsx)(JD,{schema:e,id:n,record:r})}),(0,b.jsxs)(`div`,{className:_e===`details`?`contents`:`hidden`,...ge?{role:`tabpanel`,id:`record-panel-details`,"aria-labelledby":`record-tab-details`}:{},children:[t===`edit`&&r&&v.header.stepper&&(0,b.jsx)(sE,{field:v.header.stepper,value:r[v.header.stepper.name],reached:r._steps}),(0,b.jsxs)(`div`,{className:W(v.aside.length>0?`grid items-start gap-5 lg:grid-cols-[minmax(0,1fr)_340px]`:`contents`),children:[(0,b.jsxs)(`div`,{className:W(v.aside.length>0?`flex min-w-0 flex-col gap-5`:`contents`),children:[(0,b.jsx)(NE,{layout:e.form.layout,names:T.map(e=>e.name).filter(e=>!E.has(e)),errors:{...fe,...Object.fromEntries(Object.entries(oe).filter(([,e])=>UD({found:e})).map(([e])=>[`_inlines.${e}`,[``]]))},render:ze,renderInline:Ie,renderSummary:Le}),!x&&(0,b.jsxs)(CD,{dirty:Se,children:[(0,b.jsx)(q,{type:`button`,variant:`outline`,onClick:()=>d(`/${e.name}`),children:l(m?`common.cancel`:`form.back`)}),m&&e.creatable&&(0,b.jsx)(q,{type:`submit`,value:`new`,variant:`outline`,disabled:De.isPending||L.busy,children:l(`form.saveAndNew`)}),m&&(0,b.jsxs)(q,{type:`submit`,value:`list`,disabled:De.isPending||L.busy,"aria-keyshortcuts":`Control+S Meta+S`,children:[l(De.isPending?`form.saving`:`form.save`),(0,b.jsx)(wD,{})]})]}),t===`edit`&&r&&e.related.length>0&&(0,b.jsxs)(`nav`,{"aria-label":l(`form.related`),className:`flex flex-col gap-2 border-t pt-4`,children:[(0,b.jsx)(`h2`,{className:`text-sm font-medium text-muted-foreground`,children:l(`form.related`)}),(0,b.jsx)(`ul`,{className:`flex flex-wrap gap-2`,children:e.related.map(t=>(0,b.jsx)(`li`,{children:(0,b.jsx)(q,{asChild:!0,variant:`outline`,size:`sm`,children:(0,b.jsx)(bo,{to:`/${t.resource}?${new URLSearchParams({[`filter[${t.field}][${t.operator}]`]:String(r[e.primaryKeys[0]])})}`,children:t.label})})},`${t.resource}:${t.field}`))})]})]}),v.aside.length>0&&(0,b.jsx)(`aside`,{className:`flex flex-col gap-5`,children:v.aside.map((t,n)=>(0,b.jsx)(aE,{card:t,values:ND(t,n,r),schema:e},n))})]})]})]})}function tO(e){return(e.form.layout??[]).flatMap(e=>`tab`in e?e.sections:[e]).filter(t=>`inline`in t&&e.inlines?.[t.inline]!==void 0)}var nO=[`details`,`history`];function rO({active:e,onChange:t}){let n=X(),r=(0,y.useRef)({});return(0,b.jsx)(`div`,{role:`tablist`,"aria-label":n(`audit.recordTabs`),className:`flex gap-0.5 overflow-x-auto border-b`,onKeyDown:n=>{if(n.key!==`ArrowLeft`&&n.key!==`ArrowRight`&&n.key!==`Home`&&n.key!==`End`)return;n.preventDefault();let i=n.key===`Home`?`details`:n.key===`End`||e===`details`?`history`:`details`;t(i),r.current[i]?.focus()},children:nO.map(i=>(0,b.jsx)(`button`,{ref:e=>{r.current[i]=e},id:`record-tab-${i}`,type:`button`,role:`tab`,"aria-selected":i===e,"aria-controls":i===`details`||e===`history`?`record-panel-${i}`:void 0,tabIndex:i===e?0:-1,onClick:()=>t(i),className:W(`-mb-px flex h-[38px] items-center border-b-2 px-3 text-[13px] whitespace-nowrap outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,i===e?`border-foreground font-semibold`:`border-transparent text-muted-foreground hover:text-foreground`),children:n(i===`details`?`audit.details`:`audit.history`)},i))})}var iO=e=>Array.isArray(e?._readonly)?e._readonly:[];function aO({resource:e,field:t,record:n,plain:r=!1}){let i=X(),a=n?.[t.name];return(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,"data-readonly":t.name,children:[(0,b.jsxs)(`span`,{className:W(`flex items-center gap-1.5 font-medium`,r?`text-[12.5px] text-muted-foreground`:`text-sm`),children:[t.label,!r&&(0,b.jsx)(Ry,{className:`size-3.5 text-muted-foreground`,"aria-label":i(`form.readOnly`),role:`img`})]}),(0,b.jsx)(`div`,{className:W(`text-sm break-words`,!r&&`min-h-8 rounded-lg bg-muted/50 px-2.5 py-1.5`),children:t.widget===`richtext`&&typeof a==`string`&&a!==``?(0,b.jsx)(DE,{id:`field-${t.name}`,resource:e,field:t,value:a,readOnly:!0}):(0,b.jsx)(rE,{value:a,field:t,record:n,detailed:!0})}),t.help&&(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t.help})]})}function oO({to:e}){let t=X();return(0,b.jsx)(q,{asChild:!0,variant:`outline`,size:`icon`,className:`shrink-0`,children:(0,b.jsx)(bo,{to:e,"aria-label":t(`form.back`),children:(0,b.jsx)(Ev,{className:`ltr:rotate-180`})})})}function sO({schema:e,record:t,id:n,dirty:r,onGone:i,onChanged:a,extra:o,badges:s,subtitle:c}){let l=X(),u=Array.isArray(t?._links)?t._links:[];return(0,b.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,b.jsx)(oO,{to:`/${e.name}`}),(0,b.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,b.jsx)(`h1`,{className:`text-[22px] font-bold`,children:ZD(e.label,t,n)}),s.map(e=>(0,b.jsx)(nE,{value:t[e.name],field:e},e.name))]}),c.length>0&&(0,b.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:c.join(` · `)}),u.length>0&&(0,b.jsx)(`ul`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-[13px]`,children:u.map(e=>(0,b.jsx)(`li`,{children:(0,b.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-primary hover:underline`,"aria-label":l(`form.externalLink`,{name:e.label}),children:[e.label,(0,b.jsx)(Xv,{className:`size-3.5 rtl:-scale-x-100`,"aria-hidden":!0})]})},`${e.label}:${e.href}`))})]}),(0,b.jsxs)(`div`,{className:`ms-auto flex flex-wrap items-center gap-2`,children:[t&&n!==void 0&&(0,b.jsx)(dD,{schema:e,ids:[n]}),t&&n!==void 0&&(0,b.jsx)(uD,{schema:e,record:t,id:n,dirty:r,onGone:i,onChanged:a}),o]})]})}function cO({fields:e,before:t,current:n,busy:r,onKeepMine:i,onLoadTheirs:a}){let o=X(),s=e.filter(e=>JSON.stringify(t?.[e.name]??null)!==JSON.stringify(n[e.name]??null));return(0,b.jsxs)(vD,{labelledBy:`conflict-title`,describedBy:`conflict-body`,initialFocus:`[data-autofocus]`,className:`flex flex-col gap-3 text-sm`,children:[(0,b.jsx)(`p`,{id:`conflict-title`,className:`font-medium`,children:o(`form.conflictTitle`)}),(0,b.jsx)(`div`,{id:`conflict-body`,children:s.length>0?(0,b.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1`,children:s.map(e=>(0,b.jsxs)(y.Fragment,{children:[(0,b.jsx)(`dt`,{className:`text-muted-foreground`,children:e.label}),(0,b.jsxs)(`dd`,{children:[(0,b.jsx)(`span`,{className:`line-through opacity-60`,children:Nx(t?.[e.name],e)}),` → `,Nx(n[e.name],e)]})]},e.name))}):(0,b.jsx)(`p`,{children:o(`form.conflictNone`)})}),(0,b.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,b.jsx)(q,{type:`button`,disabled:r,onClick:i,children:o(`form.keepMine`)}),(0,b.jsx)(q,{type:`button`,variant:`outline`,"data-autofocus":!0,onClick:a,children:o(`form.loadTheirs`)})]})]})}function lO(){let{t:e}=Y(),{group:t}=$i(),n=Gg();if(n.isPending)return(0,b.jsx)(G,{children:e(`common.loading`)});if(n.isError)return(0,b.jsx)(G,{tone:`error`,children:n.error.message});let r=Sw(n.data).find(e=>e.key===t);return r?(0,b.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,b.jsx)(`h1`,{className:`text-[22px] font-bold`,children:r.label}),(0,b.jsx)(dO,{group:r})]}):(0,b.jsx)(G,{children:e(`common.pageNotFound`)})}function uO({groups:e}){return(0,b.jsx)(`div`,{className:`flex flex-col gap-8`,children:e.map(e=>(0,b.jsxs)(`section`,{"aria-labelledby":`group-${e.key}`,className:`flex flex-col gap-3`,children:[(0,b.jsx)(`h2`,{id:`group-${e.key}`,className:`text-lg font-semibold`,children:(0,b.jsx)(bo,{to:`/g/${e.key}`,className:`hover:underline`,children:e.label})}),(0,b.jsx)(dO,{group:e})]},e.key))})}function dO({group:e}){return(0,b.jsxs)(b.Fragment,{children:[e.resources.length>0&&(0,b.jsx)(mO,{resources:e.resources}),e.pages.length>0&&(0,b.jsx)(pO,{pages:e.pages})]})}var fO=`flex items-center gap-3 rounded-card border bg-card shadow-card p-4 hover:bg-muted/50`;function pO({pages:e}){return(0,b.jsx)(`ul`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:e.map(e=>{let t=Qw(e.icon,`page`);return(0,b.jsx)(`li`,{children:(0,b.jsxs)(bo,{to:`/p/${e.name}`,className:fO,children:[(0,b.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-md bg-muted`,children:(0,b.jsx)(t,{className:`size-5 text-muted-foreground`,"aria-hidden":!0})}),(0,b.jsx)(`span`,{className:`truncate font-medium`,children:e.label})]})},e.name)})})}function mO({resources:e}){let{t,locale:n}=Y(),r=ut({queries:e.map(e=>({queryKey:[`count`,e.name],queryFn:()=>Q.list(e.name,new URLSearchParams({pageSize:`1`})),staleTime:6e4}))});return(0,b.jsx)(`ul`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:e.map((e,i)=>{let a=Qw(e.icon,`resource`),o=r[i]?.data,s=o&&o.total!==null?t(o.estimated?`shell.aboutRecords`:`shell.records`,{count:eg(o.total,n)}):void 0;return(0,b.jsx)(`li`,{children:(0,b.jsxs)(bo,{to:`/${e.name}`,className:fO,children:[(0,b.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-md bg-muted`,children:(0,b.jsx)(a,{className:`size-5 text-muted-foreground`,"aria-hidden":!0})}),(0,b.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,b.jsx)(`span`,{className:`truncate font-medium`,children:e.label}),s&&(0,b.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:s})]})]})},e.name)})})}var hO=(e,t=2)=>String(e).padStart(t,`0`),gO=e=>`${hO(e.getFullYear(),4)}-${hO(e.getMonth()+1)}-${hO(e.getDate())}`,_O=e=>new Date(`${e}T00:00:00`).toISOString(),vO=(e,t)=>{let[n,r]=e.split(`-`).map(Number),i=n*12+(r-1)+t;return`${hO(Math.floor(i/12),4)}-${hO(i%12+1)}-01`};function yO(e,t,n,r,i){let a=gO(t),o=(t,n,r,i)=>({period:e,from:_O(t),to:_O(n),previousFrom:_O(r),previousTo:_O(i)}),s=(e,t)=>Math.round((Date.parse(`${t}T00:00:00Z`)-Date.parse(`${e}T00:00:00Z`))/864e5);switch(e){case`day`:return o(a,AS(a,1),AS(a,-1),a);case`week`:return o(AS(a,-6),AS(a,1),AS(a,-13),AS(a,-6));case`month`:{if(n===`persian`){let{jy:e,jm:t}=wS(a),n=TS(e,t,1);return o(n,kS(n,1),kS(n,-1),n)}let e=`${a.slice(0,7)}-01`;return o(e,vO(e,1),vO(e,-1),e)}case`year`:{if(n===`persian`){let{jy:e}=wS(a);return o(TS(e,1,1),TS(e+1,1,1),TS(e-1,1,1),TS(e,1,1))}let e=Number(a.slice(0,4));return o(`${hO(e,4)}-01-01`,`${hO(e+1,4)}-01-01`,`${hO(e-1,4)}-01-01`,`${hO(e,4)}-01-01`)}case`range`:{let e=r??a,t=AS(i??a,1);return o(e,t,AS(e,-s(e,t)),e)}}}function bO(e){if(e===void 0)return;let t=`${Math.abs(e)}%`;return e>0?{tone:`ok`,arrow:`up`,text:t}:e<0?{tone:`bad`,arrow:`down`,text:t}:{tone:`neutral`,arrow:null,text:t}}function xO(e,t,n){let r=Math.max(1,...e.series.flatMap(e=>e.values)),i=Math.max(1,e.labels.length),a=t/i,o=e=>n-e/r*n;return{max:r,gridlines:[.25,.5,.75,1].map(e=>({y:n-e*n,value:r*e})),series:e.series.map(e=>{let r=e.values.map((e,n)=>[i===1?t/2:n*t/(i-1),o(e)]);return{label:e.label,dashed:e.dashed===!0,path:r.map(([e,t],n)=>`${n===0?`M`:`L`}${SO(e)} ${SO(t)}`).join(` `),bars:e.values.map((e,t)=>{let r=a*.6;return{x:t*a+a/2-r/2,y:o(e),width:r,height:n-o(e)}})}})}}var SO=e=>Math.round(e*10)/10,CO=600,wO=200;function TO({title:e,data:t}){let n=X(),r=xO(t,CO,wO),i=Math.max(1,Math.ceil(t.labels.length/6));return(0,b.jsxs)(`div`,{className:`flex flex-col gap-3.5 p-5`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,b.jsx)(`h2`,{className:`text-[15px] font-semibold`,children:e}),t.subtitle&&(0,b.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:t.subtitle})]}),(0,b.jsx)(`div`,{className:`ms-auto flex gap-4 text-xs text-muted-foreground`,children:t.series.map(e=>(0,b.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,b.jsx)(`span`,{"aria-hidden":!0,className:e.dashed?`h-0 w-3.5 border-t-2 border-dashed border-muted-foreground`:`h-[3px] w-3.5 rounded-sm bg-primary`}),e.label]},e.label))})]}),(0,b.jsxs)(`svg`,{viewBox:`0 0 ${CO} ${wO}`,preserveAspectRatio:`none`,role:`img`,"aria-label":e,className:`h-[230px] w-full overflow-visible rtl:-scale-x-100`,children:[(0,b.jsx)(`g`,{className:`stroke-border`,children:r.gridlines.map(e=>(0,b.jsx)(`path`,{d:`M0 ${e.y}H${CO}`,vectorEffect:`non-scaling-stroke`},e.y))}),r.series.map((e,n)=>t.kind===`bar`&&!e.dashed?(0,b.jsx)(`g`,{className:`fill-primary`,children:e.bars.map((e,t)=>(0,b.jsx)(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,rx:3},t))},e.label):(0,b.jsxs)(`g`,{children:[!e.dashed&&n===0&&(0,b.jsx)(`path`,{d:`${e.path} L${CO} ${wO} L0 ${wO} Z`,className:`fill-primary/10`}),(0,b.jsx)(`path`,{d:e.path,fill:`none`,vectorEffect:`non-scaling-stroke`,strokeWidth:e.dashed?2:2.5,strokeDasharray:e.dashed?`5 5`:void 0,className:e.dashed||n>0?`stroke-muted-foreground`:`stroke-primary`})]},e.label))]}),(0,b.jsx)(`div`,{"aria-hidden":!0,className:`flex justify-between text-[11.5px] text-muted-foreground`,children:t.labels.filter((e,t)=>t%i===0).map(e=>(0,b.jsx)(`span`,{children:e},e))}),(0,b.jsxs)(`span`,{className:`sr-only`,children:[t.series.map(e=>`${e.label}: ${e.values.map(e=>eg(e)).join(`, `)}`).join(`; `),` `,n(`dashboard.period`)]})]})}var EO={ok:`bg-ok`,warn:`bg-warn`,bad:`bg-bad`,info:`bg-info`,neutral:`bg-muted-foreground`,primary:`bg-primary`};function DO({title:e,data:t}){return(0,b.jsxs)(`div`,{className:`flex flex-col gap-3 p-5`,children:[(0,b.jsx)(`h2`,{className:`text-[15px] font-semibold`,children:e}),(0,b.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:t.items.map((e,t)=>{let n=Qw(e.icon,`resource`),r=(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center rounded-control bg-muted text-muted-foreground`,children:(0,b.jsx)(n,{className:`size-4`,"aria-hidden":!0})}),(0,b.jsx)(`span`,{className:`min-w-0 flex-1 text-[13px]`,children:e.text}),e.status&&(0,b.jsx)(`span`,{"aria-hidden":!0,className:W(`size-2 shrink-0 rounded-full`,EO[e.status])})]});return(0,b.jsx)(`li`,{children:e.link?(0,b.jsx)(bo,{to:e.link,className:`flex items-center gap-3 rounded-control hover:bg-muted`,children:r}):(0,b.jsx)(`div`,{className:`flex items-center gap-3`,children:r})},t)})})]})}function OO({items:e,value:t,onChange:n,className:r}){return(0,b.jsx)(`div`,{role:`tablist`,className:W(`flex w-full gap-0.5 border-b border-border`,r),children:e.map(e=>{let r=e.key===t;return(0,b.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":r,onClick:()=>n(e.key),className:W(`-mb-px inline-flex h-[38px] cursor-pointer items-center gap-1.5 border-b-2 border-transparent px-3 text-[13px] text-muted-foreground`,r&&`border-foreground font-semibold text-foreground`),children:[e.label,e.count!==void 0&&(0,b.jsxs)(`span`,{className:`inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-muted px-1.5 text-[11px] text-muted-foreground`,children:[e.estimate?`~`:``,e.count]})]},e.key)})})}function kO({period:e,from:t,to:n,onChange:r}){let i=X(),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(t??``),[l,u]=(0,y.useState)(n??``);return(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,b.jsx)(OO,{className:`w-auto`,items:[`day`,`week`,`month`,`year`].map(e=>({key:e,label:i(`dashboard.${e}`)})),value:e===`range`?``:e,onChange:e=>r(e)}),(0,b.jsxs)(Sh,{open:a,onOpenChange:o,children:[(0,b.jsx)(Ch,{asChild:!0,children:(0,b.jsx)(q,{variant:e===`range`?`secondary`:`outline`,size:`icon`,"aria-label":i(`dashboard.range`),"aria-pressed":e===`range`,children:(0,b.jsx)(mv,{})})}),(0,b.jsx)(wh,{children:(0,b.jsxs)(Th,{align:`end`,sideOffset:6,className:`z-50 flex w-72 flex-col gap-3 rounded-[10px] border bg-popover p-3 shadow-lg`,children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,b.jsx)(kh,{htmlFor:`dashboard-from`,children:i(`filters.from`)}),(0,b.jsx)(RS,{id:`dashboard-from`,label:i(`filters.from`),value:s,onChange:c,live:!0})]}),(0,b.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,b.jsx)(kh,{htmlFor:`dashboard-to`,children:i(`filters.to`)}),(0,b.jsx)(RS,{id:`dashboard-to`,label:i(`filters.to`),value:l,onChange:u,live:!0})]}),(0,b.jsx)(q,{disabled:!/^\d{4}-\d{2}-\d{2}$/.test(s)||!/^\d{4}-\d{2}-\d{2}$/.test(l)||s>l,onClick:()=>{o(!1),r(`range`,s,l)},children:i(`dashboard.apply`)})]})})]})]})}var AO=42,jO=2*Math.PI*AO;function MO({title:e,data:t}){let n=Math.max(0,Math.min(100,t.percent));return(0,b.jsxs)(`div`,{className:`flex items-center gap-5 p-5`,children:[(0,b.jsxs)(`svg`,{viewBox:`0 0 100 100`,role:`img`,"aria-label":tg(t.value),className:`size-[104px] shrink-0 -rotate-90`,children:[(0,b.jsx)(`circle`,{cx:`50`,cy:`50`,r:AO,fill:`none`,strokeWidth:10,className:`stroke-muted`}),(0,b.jsx)(`circle`,{cx:`50`,cy:`50`,r:AO,fill:`none`,strokeWidth:10,strokeLinecap:`round`,strokeDasharray:`${n/100*jO} ${jO}`,className:`stroke-primary`})]}),(0,b.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,b.jsx)(`div`,{className:`text-2xl leading-tight font-bold`,children:tg(t.value)}),(0,b.jsx)(`h2`,{className:`text-sm font-semibold`,children:e}),(0,b.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:t.caption})]})]})}function NO({title:e,data:t}){let n=bO(t.change);return(0,b.jsxs)(`div`,{className:`flex flex-col gap-2 px-5 py-[18px]`,children:[(0,b.jsx)(`div`,{className:`text-[13px] font-medium text-muted-foreground`,children:e}),(0,b.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,children:[(0,b.jsx)(`span`,{className:`text-[26px] leading-[1.3] font-bold`,children:tg(t.value)}),t.unit&&(0,b.jsx)(`span`,{className:`text-[13px] text-muted-foreground`,children:t.unit})]}),(n||t.previousLabel)&&(0,b.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[n&&(0,b.jsxs)(`span`,{className:W(`inline-flex items-center gap-0.5 rounded-full px-1.5 py-0.5 font-medium`,n.tone===`ok`?`bg-ok-bg text-ok`:n.tone===`bad`?`bg-bad-bg text-bad`:`bg-muted text-muted-foreground`),children:[n.arrow===`up`&&(0,b.jsx)(X_,{className:`size-3`,"aria-hidden":!0}),n.arrow===`down`&&(0,b.jsx)(K_,{className:`size-3`,"aria-hidden":!0}),tg(n.text)]}),t.previousLabel&&(0,b.jsx)(`span`,{className:`text-muted-foreground`,children:t.previousLabel})]})]})}function PO({title:e,data:t}){let n=X(),r=t.link?`/${t.link.resource}${t.link.filter?`?${new URLSearchParams(t.link.filter)}`:``}`:void 0;return(0,b.jsxs)(`div`,{className:`flex flex-col`,children:[(0,b.jsxs)(`div`,{className:`flex min-h-14 items-center gap-2 border-b px-5 py-3`,children:[(0,b.jsx)(`h2`,{className:`flex-1 text-[15px] font-semibold`,children:e}),r&&(0,b.jsxs)(bo,{to:r,className:`inline-flex items-center gap-1 text-[13px] font-medium text-primary hover:underline`,children:[n(`dashboard.viewAll`),(0,b.jsx)(wv,{className:`size-3.5 ltr:rotate-180`,"aria-hidden":!0})]})]}),(0,b.jsx)(`div`,{className:`overflow-x-auto`,children:(0,b.jsxs)(`table`,{className:`w-full text-[13px]`,children:[(0,b.jsx)(`thead`,{className:`bg-[color-mix(in_oklab,var(--muted)_50%,transparent)] text-[12.5px] text-muted-foreground`,children:(0,b.jsx)(`tr`,{children:t.columns.map(e=>(0,b.jsx)(`th`,{className:`px-3.5 py-2.5 text-start font-medium whitespace-nowrap`,children:e.label},e.key))})}),(0,b.jsx)(`tbody`,{children:t.rows.map((e,n)=>(0,b.jsx)(`tr`,{className:`border-t`,children:t.columns.map(t=>{let n=e[t.key];return(0,b.jsx)(`td`,{className:`px-3.5 py-2.5 whitespace-nowrap`,children:typeof n==`object`&&n?(0,b.jsx)($T,{tone:n.tone,children:n.label}):typeof n==`number`?eg(n):tg(String(n??``))},t.key)})},n))})]})})]})}var FO=[`day`,`week`,`month`,`year`,`range`],IO={1:`lg:col-span-4`,2:`lg:col-span-6`,3:`lg:col-span-8`,4:`lg:col-span-12`};function LO(){let{t:e,calendar:t}=Y(),[n,r]=wo(),i=n.get(`period`),a=i&&FO.includes(i)?i:`week`,o=n.get(`from`)??void 0,s=n.get(`to`)??void 0,c=yO(a,new Date,t===`persian`?`persian`:`gregory`,o,s),l=ft({queryKey:[`dashboard`],queryFn:Q.dashboard});return(0,b.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-end gap-x-4 gap-y-3`,children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,b.jsx)(`h1`,{className:`text-[22px] font-bold`,children:e(`dashboard.title`)}),(0,b.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:e(`dashboard.subtitle`)})]}),(0,b.jsx)(`div`,{className:`ms-auto`,children:(0,b.jsx)(kO,{period:a,from:o,to:s,onChange:(e,t,n)=>r(e===`range`?{period:e,from:t,to:n}:e===`week`?{}:{period:e})})})]}),l.isPending&&(0,b.jsx)(G,{children:e(`common.loading`)}),l.isError&&(0,b.jsx)(G,{tone:`error`,children:pg(l.error)}),l.data&&(0,b.jsx)(`div`,{className:`grid grid-cols-1 gap-4 lg:grid-cols-12`,children:l.data.widgets.map(e=>(0,b.jsx)(RO,{widget:e,params:c},e.name))})]})}function RO({widget:e,params:t}){let{t:n}=Y(),r=ft({queryKey:[`dashboard`,e.name,t],queryFn:()=>Q.widget(e.name,t),retry:!1}),i=e.type===`stat`?`lg:col-span-3`:IO[e.size];return(0,b.jsxs)(`section`,{"aria-label":e.title,"data-widget":e.name,className:W(`min-w-0 overflow-hidden rounded-card border bg-card shadow-card`,i),children:[r.isPending&&(0,b.jsxs)(`div`,{"aria-hidden":!0,className:`flex flex-col gap-3 p-5`,children:[(0,b.jsx)(`div`,{className:`h-4 w-1/3 animate-pulse rounded bg-muted`}),(0,b.jsx)(`div`,{className:`h-8 w-2/3 animate-pulse rounded bg-muted`})]}),r.isError&&(0,b.jsxs)(`div`,{role:`alert`,className:`flex flex-col items-start gap-2 p-5 text-[13px]`,children:[(0,b.jsx)(`span`,{className:`font-semibold`,children:e.title}),(0,b.jsx)(`span`,{className:`text-muted-foreground`,children:n(`dashboard.failed`)}),(0,b.jsx)(q,{size:`sm`,variant:`outline`,onClick:()=>void r.refetch(),children:n(`dashboard.retry`)})]}),r.data&&(0,b.jsx)(zO,{type:e.type,title:e.title,data:r.data})]})}function zO({type:e,title:t,data:n}){switch(e){case`stat`:return(0,b.jsx)(NO,{title:t,data:n});case`chart`:return(0,b.jsx)(TO,{title:t,data:n});case`table`:return(0,b.jsx)(PO,{title:t,data:n});case`progress`:return(0,b.jsx)(MO,{title:t,data:n});case`list`:return(0,b.jsx)(DO,{title:t,data:n})}}function BO(){let e=X(),t=Gg();if(t.isPending)return(0,b.jsx)(G,{children:e(`common.loading`)});if(t.isError)return(0,b.jsx)(G,{tone:`error`,children:t.error.message});if(t.data.dashboard)return(0,b.jsx)(LO,{});let n=Sw(t.data);return n.length===0?(0,b.jsx)(G,{children:e(`shell.noResources`)}):(0,b.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,b.jsx)(`h1`,{className:`text-[22px] font-bold`,children:t.data.title}),(0,b.jsx)(uO,{groups:n})]})}var VO={order:[],hidden:[],widths:{},density:`comfortable`},HO=e=>`nma.columns.${e}`;function UO(e,t){return WO(e,t).filter(e=>!t.hidden.includes(e))}function WO(e,t){let n=t.order.filter(t=>e.includes(t));return[...n,...e.filter(e=>!n.includes(e))]}function GO(e){let t=new Map,n=new Set,r=n=>{let r=t.get(n);if(!r){r=VO;try{let t=e?.getItem(HO(n));t&&(r={...VO,...JSON.parse(t)})}catch{r=VO}t.set(n,r)}return r},i=(r,i)=>{t.set(r,i);try{e?.setItem(HO(r),JSON.stringify(i))}catch{}for(let e of n)e()};return{get:r,subscribe(e){return n.add(e),()=>n.delete(e)},toggle(e,t){let n=r(e),a=n.hidden.includes(t)?n.hidden.filter(e=>e!==t):[...n.hidden,t];i(e,{...n,hidden:a})},move(e,t,n,a){let o=r(e),s=WO(t,o),c=s.indexOf(n),l=c+a;c<0||l<0||l>=s.length||([s[c],s[l]]=[s[l],s[c]],i(e,{...o,order:s}))},setWidth(e,t,n){let a=r(e),o=Math.round(Math.min(600,Math.max(60,n)));i(e,{...a,widths:{...a.widths,[t]:o}})},setDensity(e,t){i(e,{...r(e),density:t})},reset(r){try{e?.removeItem(HO(r))}catch{}t.set(r,VO);for(let e of n)e()}}}function KO(){try{return typeof localStorage>`u`?void 0:localStorage}catch{return}}var qO=GO(KO());function JO(e){return(0,y.useSyncExternalStore)(qO.subscribe,()=>qO.get(e))}function YO({schema:e,prefs:t}){let n=X(),r=WO(e.list.columns,t),i=t=>e.list.computed?.[t]?.label??e.fields.find(e=>e.name===t)?.label??t,a=r.filter(e=>!t.hidden.includes(e));return(0,b.jsxs)(Sh,{children:[(0,b.jsx)(Ch,{asChild:!0,children:(0,b.jsxs)(q,{variant:`outline`,size:`sm`,className:`hidden md:inline-flex`,children:[(0,b.jsx)(Pv,{}),n(`list.columns`),(0,b.jsx)(Sv,{className:`text-muted-foreground`})]})}),(0,b.jsx)(wh,{children:(0,b.jsxs)(Th,{align:`end`,sideOffset:4,className:`z-50 flex w-72 flex-col gap-3 rounded-[10px] border bg-popover p-3 text-popover-foreground shadow-lg`,children:[(0,b.jsx)(`ul`,{"aria-label":n(`list.columns`),className:`flex flex-col gap-0.5`,children:r.map((o,s)=>{let c=!t.hidden.includes(o);return(0,b.jsxs)(`li`,{className:`flex items-center gap-2 rounded-md px-1 py-0.5 hover:bg-accent`,children:[(0,b.jsxs)(`label`,{className:`flex flex-1 cursor-pointer items-center gap-2 text-sm`,children:[(0,b.jsx)(ff,{checked:c,disabled:c&&a.length===1,onCheckedChange:()=>qO.toggle(e.name,o),className:`flex size-4 items-center justify-center rounded border border-input disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground`,children:(0,b.jsx)(mf,{children:(0,b.jsx)(bv,{className:`size-3`})})}),i(o)]}),(0,b.jsx)(q,{variant:`ghost`,size:`icon-sm`,"aria-label":n(`list.moveUp`,{name:i(o)}),disabled:s===0,onClick:()=>qO.move(e.name,e.list.columns,o,-1),children:(0,b.jsx)(X_,{})}),(0,b.jsx)(q,{variant:`ghost`,size:`icon-sm`,"aria-label":n(`list.moveDown`,{name:i(o)}),disabled:s===r.length-1,onClick:()=>qO.move(e.name,e.list.columns,o,1),children:(0,b.jsx)(K_,{})})]},o)})}),(0,b.jsx)(`div`,{role:`radiogroup`,"aria-label":n(`list.density`),className:`flex gap-1`,children:[`comfortable`,`compact`].map(r=>(0,b.jsx)(q,{role:`radio`,"aria-checked":t.density===r,variant:t.density===r?`secondary`:`ghost`,size:`sm`,onClick:()=>qO.setDensity(e.name,r),children:n(r===`compact`?`list.compact`:`list.comfortable`)},r))}),(0,b.jsx)(q,{variant:`ghost`,size:`sm`,className:`self-start`,onClick:()=>qO.reset(e.name),children:n(`list.resetColumns`)})]})})]})}function XO({resource:e,column:t,label:n,width:r}){let i=X(),a=(0,y.useRef)(null);return(0,b.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":i(`list.resize`,{name:n}),"aria-valuenow":r,tabIndex:0,className:W(`absolute inset-y-1 end-0 w-1.5 cursor-col-resize touch-none rounded bg-transparent hover:bg-border focus-visible:bg-ring`),onPointerDown:e=>{let t=e.currentTarget.parentElement;a.current={x:e.clientX,width:t.getBoundingClientRect().width,rtl:getComputedStyle(t).direction===`rtl`},e.currentTarget.setPointerCapture(e.pointerId)},onPointerMove:n=>{if(!a.current)return;let r=(n.clientX-a.current.x)*(a.current.rtl?-1:1);qO.setWidth(e,t,a.current.width+r)},onPointerUp:()=>a.current=null,onKeyDown:n=>{if(n.key!==`ArrowLeft`&&n.key!==`ArrowRight`)return;n.preventDefault();let i=r??n.currentTarget.parentElement.getBoundingClientRect().width,a=getComputedStyle(n.currentTarget).direction===`rtl`,o=n.key===`ArrowRight`!==a;qO.setWidth(e,t,i+(o?10:-10))},onClick:e=>e.stopPropagation()})}var ZO=`h-7 w-full min-w-20 rounded-md border border-input bg-background px-2 text-sm outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 aria-invalid:border-destructive`;function QO({schema:e,item:t,field:n}){let r=X(),i=S(),[a,o]=(0,y.useState)(!1),s=wC([n],t)[n.name],[c,l]=(0,y.useState)(s),[u,d]=(0,y.useState)(null),f=pt({mutationFn:n=>Q.update(e.name,String(t._id),n,e.version?t[e.version]:void 0),onSuccess:n=>{i.setQueriesData({queryKey:[`list`,e.name]},e=>e&&{...e,items:e.items.map(e=>e._id===n._id?{...e,...n}:e)}),i.removeQueries({queryKey:[`record`,e.name,String(t._id)]}),o(!1),d(null)},onError:e=>{d(e instanceof fg?e.fields[n.name]?.join(` `)??e.message:e.message),l(s),o(!1)}});function p(t=c){if(t===s){o(!1);return}let{payload:r,errors:i}=EC([n],{[n.name]:t},{[n.name]:s}),a=oD(r,{[n.name]:e.form.constraints.update[n.name]??{}},`update`),l=i[n.name]??a[n.name];if(l){d(l.join(` `));return}f.mutate(r)}let m=e=>{e.key===`Enter`?(e.preventDefault(),p()):e.key===`Escape`&&(e.preventDefault(),l(s),d(null),o(!1))},h=`cell-${e.name}-${String(t._id)}-${n.name}-error`,g={"aria-label":n.label,"aria-invalid":u?!0:void 0,"aria-describedby":u?h:void 0,autoFocus:!0,disabled:f.isPending,className:ZO,onKeyDown:m},_;if(!a)_=(0,b.jsx)(`button`,{type:`button`,className:W(`-mx-1 rounded px-1 text-start hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:outline-none`,u&&`text-destructive`),"aria-label":r(`list.editCell`,{name:n.label,value:Nx(t[n.name],n)}),onClick:()=>{l(s),o(!0)},children:(0,b.jsx)(rE,{value:t[n.name],field:n})});else if(n.type===`enum`||n.type===`boolean`){let e=n.type===`boolean`?[[`true`,r(`common.yes`)],[`false`,r(`common.no`)]]:(n.enumValues??[]).map(e=>[e,MC(n,e)]);_=(0,b.jsxs)(`select`,{...g,value:String(c),onChange:e=>{let t=n.type===`boolean`?e.target.value===`true`:e.target.value;l(t),p(t)},onBlur:()=>o(!1),children:[n.nullable&&n.type===`enum`&&(0,b.jsx)(`option`,{value:``,children:r(`common.empty`)}),e.map(([e,t])=>(0,b.jsx)(`option`,{value:e,children:t},e))]})}else if(n.type===`date`)_=(0,b.jsx)(RS,{id:`cell-${e.name}-${String(t._id)}-${n.name}`,label:n.label,value:String(c),onChange:e=>{l(e),p(e)},autoFocus:!0,"aria-invalid":u?!0:void 0,"aria-describedby":u?h:void 0,className:`min-w-44`,onKeyDown:m});else{let e=n.type===`number`||n.type===`decimal`||n.type===`bigint`;_=(0,b.jsx)(`input`,{...g,type:`text`,inputMode:e?n.type===`bigint`?`numeric`:`decimal`:void 0,value:String(c),onChange:e=>l(e.target.value),onBlur:()=>p()})}return(0,b.jsxs)(`div`,{className:`flex flex-col gap-0.5`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[_,u&&(0,b.jsx)(`p`,{id:h,role:`alert`,className:`text-xs text-destructive`,children:u})]})}var $O=e=>e.total===null?e.hasMore===!0:e.page*e.pageSize<e.total;function ek({schema:e,query:t,columns:n,trash:r,selectMode:i,selected:a,onSelect:o,restore:s,empty:c}){let l=X(),u=e.list.pagination===`keyset`,d=mt({queryKey:[`list`,e.name,`cards`,t],initialPageParam:void 0,queryFn:({pageParam:n})=>{let r=new URLSearchParams(t);return n&&r.set(u?`after`:`page`,n),Q.list(e.name,r)},getNextPageParam:e=>u?e.nextCursor??void 0:$O(e)?String(e.page+1):void 0}),f=new Set,p=(d.data?.pages??[]).flatMap(e=>e.items).filter(e=>{let t=String(e._id);return!f.has(t)&&(f.add(t),!0)}),m=d.data?.pages[0]?.total??null,h=(0,y.useRef)(null),{hasNextPage:g,isFetchingNextPage:_,fetchNextPage:v}=d;(0,y.useEffect)(()=>{let e=h.current;if(!e||!g||typeof IntersectionObserver>`u`)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&!_&&v()},{rootMargin:`200px`});return t.observe(e),()=>t.disconnect()},[g,_,v]);let x=e=>{let t=new Set(a);t.has(e)?t.delete(e):t.add(e),o(t)};return(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,b.jsxs)(`ul`,{"aria-label":e.label,"aria-busy":d.isFetching,className:`flex flex-col gap-2.5`,children:[d.isPending&&Array.from({length:4},(e,t)=>(0,b.jsx)(`li`,{"aria-hidden":!0,className:`h-20 animate-pulse rounded-card border bg-muted/40`},`skeleton-${t}`)),p.map(t=>{let o=String(t._id),c=(0,b.jsx)(tk,{schema:e,item:t,columns:n});return(0,b.jsx)(`li`,{children:r?(0,b.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded-card border bg-card p-3 shadow-card`,children:[c,s(t)]}):i?(0,b.jsxs)(`label`,{className:W(`flex cursor-pointer items-start gap-3 rounded-card border bg-card p-3 shadow-card`,a.has(o)&&`border-primary bg-primary-soft`),children:[(0,b.jsx)(`input`,{type:`checkbox`,className:`mt-0.5 size-4 accent-primary`,checked:a.has(o),onChange:()=>x(o),"aria-label":l(`list.selectRow`,{name:String(t._title??o)})}),c]}):(0,b.jsx)(bo,{to:`/${e.name}/${encodeURIComponent(o)}`,className:`block rounded-card border bg-card p-3 shadow-card active:bg-muted`,children:c})},o)}),d.isSuccess&&p.length===0&&(0,b.jsx)(`li`,{className:`flex flex-col items-center gap-2 py-6 text-center text-sm text-muted-foreground`,children:c})]}),d.isError&&(0,b.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-3 rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:[(0,b.jsx)(`span`,{children:l(`list.loadFailed`)}),(0,b.jsx)(q,{variant:`outline`,size:`sm`,onClick:()=>void d.refetch(),children:l(`list.retry`)})]}),(0,b.jsxs)(`div`,{ref:h,className:`flex flex-col items-center gap-2 py-2 text-sm text-muted-foreground`,children:[p.length>0&&(0,b.jsx)(`span`,{children:m===null?l(`list.showing`,{shown:eg(p.length)}):l(`list.showingOf`,{shown:eg(p.length),total:eg(m)})}),g&&(0,b.jsx)(q,{variant:`outline`,size:`sm`,disabled:_,onClick:()=>void v(),children:l(_?`common.loading`:`list.loadMore`)})]})]})}function tk({schema:e,item:t,columns:n}){let r=Object.entries(e.list.computed??{}).filter(([t])=>e.list.columns.includes(t));if(r.length>0)return(0,b.jsx)(nk,{schema:e,item:t,computed:r});let i=e.list.mobile,a=typeof t._title==`string`?t._title:String(t._id);if(!i)return(0,b.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,b.jsx)(`div`,{className:`text-[14.5px] font-semibold`,children:a}),(0,b.jsx)(`dl`,{className:`mt-1 grid grid-cols-2 gap-x-3 gap-y-0.5 text-sm`,children:n.filter(e=>Nx(t[e.name],e)!==t._title).map(e=>(0,b.jsxs)(y.Fragment,{children:[(0,b.jsx)(`dt`,{className:`text-muted-foreground`,children:e.label}),(0,b.jsx)(`dd`,{className:`truncate`,children:(0,b.jsx)(rE,{value:t[e.name],field:e,record:t,plain:!0})})]},e.name))})]});let o=t=>t?e.fields.find(e=>e.name===t):void 0,s=o(i.title),c=o(i.subtitle),l=o(i.badge),u=i.meta.map(o).filter(e=>e!==void 0);return(0,b.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,b.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,b.jsx)(`span`,{className:`min-w-0 truncate text-[14.5px] font-semibold`,children:s?Nx(t[s.name],s):a}),l&&t[l.name]!==null&&t[l.name]!==void 0&&(0,b.jsx)(nE,{value:t[l.name],field:l,className:`shrink-0`})]}),c&&(0,b.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,children:Nx(t[c.name],c)}),u.length>0&&(0,b.jsx)(`dl`,{className:`mt-1 flex flex-wrap gap-x-4 gap-y-0.5 text-sm`,children:u.map(e=>(0,b.jsxs)(`div`,{className:`flex gap-1`,children:[(0,b.jsx)(`dt`,{className:`text-muted-foreground`,children:e.label}),(0,b.jsx)(`dd`,{children:(0,b.jsx)(rE,{value:t[e.name],field:e,record:t,plain:!0})})]},e.name))})]})}function nk({schema:e,item:t,computed:n}){let r=e=>n.filter(([,t])=>t.kind===e),i=([n,r],i=!0)=>(0,b.jsx)(OD,{schema:e,name:n,column:r,item:t,compact:i},n),[a]=r(`image`),[o]=r(`title`);return(0,b.jsxs)(`div`,{className:`flex min-w-0 flex-1 gap-3`,children:[a&&i(a),(0,b.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,b.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,b.jsx)(`div`,{className:`min-w-0 flex-1`,children:o?i(o):(0,b.jsx)(`span`,{className:`text-[14.5px] font-semibold`,children:typeof t._title==`string`?t._title:String(t._id)})}),r(`toggle`).map(e=>i(e))]}),r(`money`).map(e=>i(e)),(r(`badge`).length>0||r(`count`).length>0)&&(0,b.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[r(`badge`).map(e=>i(e)),r(`count`).map(([e,n])=>(0,b.jsxs)($T,{tone:`neutral`,children:[DD(n,t._computed?.[e]).text,` `,n.label]},e))]})]})]})}function rk({schema:e,item:t,onClose:n}){let r=X(),i=(0,y.useRef)(null);t&&!i.current&&(i.current=document.activeElement);let a=t?String(t._id):void 0,o=Xg(e.name,a).data??t,s=typeof o?._title==`string`?o._title:`#${a}`,c=e.fields.filter(e=>e.persisted&&!e.name.includes(`.`)&&o!==void 0&&Object.hasOwn(o,e.name));return(0,b.jsx)(jd,{open:t!==void 0,onOpenChange:e=>!e&&n(),children:(0,b.jsxs)(Ld,{children:[(0,b.jsx)(zd,{className:HS}),(0,b.jsxs)(Ud,{className:`fixed inset-y-0 end-0 z-50 flex w-full max-w-md flex-col border-s bg-background shadow-xl outline-none`,"aria-describedby":void 0,onCloseAutoFocus:e=>{e.preventDefault(),i.current?.focus(),i.current=null},children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2 border-b p-4`,children:[(0,b.jsx)(Jd,{className:`min-w-0 flex-1 truncate text-lg font-semibold`,children:r(`list.quickView`,{name:s})}),(0,b.jsx)(Xd,{asChild:!0,children:(0,b.jsx)(q,{variant:`ghost`,size:`icon`,"aria-label":r(`list.close`),children:(0,b.jsx)(Sx,{})})})]}),(0,b.jsx)(`dl`,{className:`grid flex-1 grid-cols-[minmax(6rem,auto)_1fr] content-start gap-x-4 gap-y-2 overflow-y-auto p-4 text-sm`,children:c.map(e=>(0,b.jsxs)(`div`,{className:`contents`,children:[(0,b.jsx)(`dt`,{className:`text-muted-foreground`,children:e.label}),(0,b.jsx)(`dd`,{className:`break-words`,children:(0,b.jsx)(rE,{value:o[e.name],field:e,record:o,detailed:!0})})]},e.name))}),(0,b.jsxs)(`div`,{className:`flex gap-2 border-t p-4`,children:[(0,b.jsx)(q,{asChild:!0,children:(0,b.jsxs)(bo,{to:`/${e.name}/${encodeURIComponent(a??``)}`,children:[(0,b.jsx)(ob,{}),r(`list.edit`)]})}),(0,b.jsx)(Xd,{asChild:!0,children:(0,b.jsx)(q,{variant:`outline`,children:r(`list.close`)})})]})]})]})})}function ik({className:e,...t}){return(0,b.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full`,children:(0,b.jsx)(`table`,{"data-slot":`table`,className:W(`w-full caption-bottom text-[13px]`,e),...t})})}function ak({className:e,...t}){return(0,b.jsx)(`thead`,{"data-slot":`table-header`,className:W(`[&_tr]:border-b`,e),...t})}function ok({className:e,...t}){return(0,b.jsx)(`tbody`,{"data-slot":`table-body`,className:W(`[&_tr:last-child]:border-0`,e),...t})}function sk({className:e,...t}){return(0,b.jsx)(`tr`,{"data-slot":`table-row`,className:W(`border-b border-border transition-colors hover:bg-[color-mix(in_oklab,var(--muted)_60%,transparent)] has-aria-expanded:bg-muted/50 data-[state=selected]:bg-primary-soft`,e),...t})}function ck({className:e,...t}){return(0,b.jsx)(`th`,{"data-slot":`table-head`,className:W(`px-3.5 py-2.5 text-start align-middle text-[12.5px] font-medium whitespace-nowrap text-muted-foreground bg-[color-mix(in_oklab,var(--muted)_50%,transparent)] [&:has([role=checkbox])]:pe-0`,e),...t})}function lk({className:e,...t}){return(0,b.jsx)(`td`,{"data-slot":`table-cell`,className:W(`px-3.5 py-2.5 align-middle whitespace-nowrap [&:has([role=checkbox])]:pe-0`,e),...t})}function uk(e){let t=e.map(e=>String(e).replace(/~/g,`~0`).replace(/,/g,`~1`)).join(`,`);return t===`new`?`~new`:t}function dk(){let{resource:e=``}=$i(),[t,n]=wo(),r=Math.max(1,Number(t.get(`page`))||1),i=t.get(`sort`)??void 0,a=Kg(e),o=AC(),s=Yg(e,JS(t),!o),[c,l]=(0,y.useState)(!1),u=S(),d=X(),f=pt({mutationFn:t=>Q.restore(e,t),onSuccess:()=>u.invalidateQueries({queryKey:[`list`,e]})}),p=t.get(`trashed`)===`only`,m=JO(e),h=JS(t),g=(()=>{let e=new URLSearchParams(h);return e.delete(`page`),e.delete(`after`),e.toString()})(),[_,v]=(0,y.useState)(new Set);(0,y.useEffect)(()=>v(new Set),[h,e]);let[x,C]=(0,y.useState)(),[w,T]=(0,y.useState)(!1),[E,D]=(0,y.useState)();(0,y.useEffect)(()=>D(void 0),[e]);let O=pt({mutationFn:t=>Q.bulkDelete(e,t),onSuccess:async t=>{v(new Set),T(!1),D({title:d(`list.bulkDeleted`,{count:t.ok.length}),result:t}),await u.invalidateQueries({queryKey:[`list`,e]})},onError:()=>T(!1)}),[k,A]=(0,y.useState)([]),j=t.has(`after`);if((0,y.useEffect)(()=>{j||A([])},[j]),a.isPending)return(0,b.jsx)(G,{children:d(`common.loading`)});if(a.isError)return(0,b.jsx)(G,{tone:`error`,children:a.error.message});let M=a.data,N=UO(M.list.columns,m).flatMap(e=>{let t=M.list.computed?.[e];if(t)return[{name:e,label:t.label,computed:t}];let n=M.fields.find(t=>t.name===e);return n?[{name:e,label:n.label,field:n}]:[]}),ee=N.flatMap(e=>e.field&&!M.primaryKeys.includes(e.name)?[e.field]:[]);for(let e=N.length-2;e>=0;e--)N[e].computed?.kind===`image`&&N[e+1].computed?.kind===`title`&&(N[e+1]={...N[e+1],image:N[e]},N.splice(e,1));let te=N.findIndex(e=>e.computed?.kind!==`image`&&e.computed?.kind!==`toggle`),P=i?{field:i.replace(/^-/,``),direction:i.startsWith(`-`)?`desc`:`asc`}:M.list.defaultSort,ne=s.data?.items??[],re=M.list.pagination===`keyset`,ie=t.get(`after`),ae=re?{summary:$S(s.data,1).summary,label:d(`list.page`,{page:k.length+1}),hasNext:!!s.data?.nextCursor}:$S(s.data,r),oe=re?k.length>0:r>1;function se(){if(!re)return fe({page:String(r+1)});A([...k,ie??``]),fe({after:s.data?.nextCursor??null})}function ce(){if(!re)return fe({page:String(r-1)});let e=k[k.length-1];A(k.slice(0,-1)),fe({after:e||null})}let le=M.permissions??{create:!0,update:!0,delete:!0,purge:!0},F=!p&&(le.delete||WE(M,[]).length>0||(M.prints??[]).some(e=>e.bulk)),ue=WE(M,ne.filter(e=>_.has(String(e._id)))),de=e=>`/${M.name}/${encodeURIComponent(String(e._id))}`;function fe(e){n(t=>QS(t,e))}function pe(e){fe({sort:P.field===e&&P.direction===`asc`?`-${e}`:e})}let me=`border-transparent bg-transparent text-inherit hover:bg-background/15`,I=F&&_.size>0&&(0,b.jsxs)(`div`,{role:`region`,"aria-label":d(`list.selected`,{count:_.size}),className:W(`flex flex-wrap items-center gap-2 text-sm`,o?`fixed inset-x-3 bottom-4 z-30 rounded-[14px] bg-foreground py-1.5 ps-2 pe-1.5 text-background shadow-[0_12px_32px_rgba(0,0,0,.25)]`:`border-b bg-primary-soft px-3.5 py-2`),children:[(0,b.jsx)(`span`,{className:W(`font-semibold`,o?`flex-1 text-sm`:`pe-1.5 text-primary`),children:d(`list.selected`,{count:_.size})}),(0,b.jsx)(dD,{schema:M,ids:[..._],bulkOnly:!0,size:`sm`}),ue.map(e=>(0,b.jsx)(lD,{resource:M.name,action:e,ids:[..._],size:`sm`,className:o?me:void 0,onDone:(t,n)=>{let r=XE(t,n);v(new Set),O.reset(),D({title:d(`action.bulkDone`,{action:e.label,count:r.ok.length}),result:r})}},e.name)),le.delete?w?(0,b.jsx)(q,{variant:`destructive`,size:`sm`,disabled:O.isPending,onClick:()=>O.mutate([..._]),children:d(`list.confirmDeleteSelected`,{count:_.size})}):(0,b.jsxs)(q,{variant:`outline`,size:o?`icon-sm`:`sm`,className:o?me:`text-destructive`,"aria-label":o?d(`list.deleteSelected`):void 0,onClick:()=>T(!0),children:[(0,b.jsx)(nx,{}),!o&&d(`list.deleteSelected`)]}):null,(0,b.jsx)(q,{variant:`ghost`,size:o?`icon-sm`:`sm`,className:o?W(me,`-order-1`):`ms-auto`,"aria-label":o?d(`list.clearSelection`):void 0,onClick:()=>v(new Set),children:o?(0,b.jsx)(Sx,{}):d(`list.clearSelection`)})]});return(0,b.jsxs)(`div`,{className:W(`flex flex-col gap-4`,o&&_.size>0&&`pb-16`),children:[(0,b.jsxs)(`div`,{className:W(`flex flex-wrap gap-3`,o?`items-center gap-2`:`items-end`),children:[(0,b.jsxs)(`div`,{className:W(`flex gap-0.5`,o?`items-baseline gap-1.5`:`flex-col`),children:[(0,b.jsx)(`h1`,{className:o?`text-base font-semibold`:`text-[22px] font-bold`,children:M.label}),s.data&&s.data.total!==null&&(0,b.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:$S(s.data,r).summary})]}),(0,b.jsxs)(`div`,{className:`ms-auto flex flex-wrap items-center gap-2`,children:[M.softDelete&&le.delete&&(0,b.jsxs)(q,{variant:p?`secondary`:`outline`,size:o?`icon`:`default`,"aria-pressed":p,"aria-label":o?d(`list.trash`):void 0,onClick:()=>fe({trashed:p?null:`only`}),children:[(0,b.jsx)(nx,{}),!o&&d(`list.trash`)]}),o&&F&&(0,b.jsx)(q,{variant:c?`secondary`:`outline`,size:`icon`,"aria-pressed":c,"aria-label":d(c?`list.done`:`list.select`),onClick:()=>{l(!c),v(new Set)},children:(0,b.jsx)(My,{})}),!p&&GE(M).map(e=>(0,b.jsx)(lD,{resource:M.name,action:e,onDone:()=>void 0},e.name)),!p&&(0,b.jsx)(fD,{schema:M,query:gk(t),iconOnly:o}),M.creatable&&!p&&(0,b.jsx)(q,{asChild:!0,size:o?`icon`:`default`,className:W(o&&`size-10`),children:(0,b.jsxs)(bo,{to:`/${M.name}/new`,"aria-label":o?d(`list.new`):void 0,children:[(0,b.jsx)(mb,{}),!o&&d(`list.new`)]})})]})]}),M.list.tabs&&M.list.tabs.length>0&&!p&&(0,b.jsx)(fk,{schema:M,params:t,onChange:fe}),(0,b.jsx)(FC,{schema:M,params:t,onChange:fe,trailing:(0,b.jsx)(YO,{schema:M,prefs:m})}),s.isError&&(0,b.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-3 rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:[(0,b.jsxs)(`span`,{children:[d(`list.loadFailed`),` `,pg(s.error)]}),(0,b.jsx)(q,{variant:`outline`,size:`sm`,onClick:()=>void s.refetch(),children:d(`list.retry`)})]}),f.isError&&(0,b.jsx)(G,{tone:`error`,children:pg(f.error)}),p&&(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:d(`list.trashNote`)}),o&&I,E&&(0,b.jsx)(hk,{title:E.title,result:E.result,items:ne}),O.isError&&(0,b.jsx)(G,{tone:`error`,children:pg(O.error)}),o?(0,b.jsx)(ek,{schema:M,query:g,columns:ee,trash:p,selectMode:c,selected:_,onSelect:v,restore:e=>(0,b.jsx)(mk,{item:e,pending:f.isPending,onRestore:e=>f.mutate(e)}),empty:(0,b.jsxs)(b.Fragment,{children:[d(XS(t)?`list.noMatches`:`list.noRecords`),!XS(t)&&M.creatable&&!p&&(0,b.jsx)(q,{asChild:!0,size:`sm`,variant:`outline`,children:(0,b.jsxs)(bo,{to:`/${M.name}/new`,children:[(0,b.jsx)(mb,{}),d(`list.new`)]})})]})}):(0,b.jsx)(b.Fragment,{children:(0,b.jsxs)(`section`,{className:`overflow-hidden rounded-card border bg-card shadow-card`,children:[I,(0,b.jsx)(`div`,{className:`overflow-x-auto`,children:(0,b.jsxs)(ik,{className:W(m.density===`compact`&&`[&_td]:py-1 [&_th]:h-8`),children:[(0,b.jsx)(ak,{children:(0,b.jsxs)(sk,{children:[F&&(0,b.jsx)(ck,{className:`w-0`,children:(0,b.jsx)(`input`,{type:`checkbox`,className:`size-4 accent-primary`,"aria-label":d(`list.selectPage`),checked:ne.length>0&&ne.every(e=>_.has(String(e._id))),onChange:e=>v(e.target.checked?new Set(ne.map(e=>String(e._id))):new Set)})}),N.map(e=>(0,b.jsxs)(ck,{className:`relative`,style:m.widths[e.name]?{width:m.widths[e.name],minWidth:m.widths[e.name]}:void 0,"aria-sort":P.field===e.name?P.direction===`asc`?`ascending`:`descending`:void 0,children:[M.list.sortable.includes(e.name)?(0,b.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1`,onClick:()=>pe(e.name),children:[e.label,P.field===e.name&&(P.direction===`asc`?(0,b.jsx)(X_,{className:`size-3.5`}):(0,b.jsx)(K_,{className:`size-3.5`}))]}):e.label,(0,b.jsx)(XO,{resource:M.name,column:e.name,label:e.label,width:m.widths[e.name]})]},e.name)),p&&(0,b.jsx)(ck,{className:`w-0`,children:(0,b.jsx)(`span`,{className:`sr-only`,children:d(`list.actions`)})})]})}),(0,b.jsxs)(ok,{children:[s.isPending&&Array.from({length:5},(e,t)=>(0,b.jsxs)(sk,{"aria-hidden":!0,children:[F&&(0,b.jsx)(lk,{}),N.map(e=>(0,b.jsx)(lk,{children:(0,b.jsx)(`div`,{className:`h-4 w-3/4 animate-pulse rounded bg-muted`})},e.name))]},`skeleton-${t}`)),ne.map(e=>(0,b.jsxs)(sk,{"data-state":_.has(String(e._id))?`selected`:void 0,className:p?void 0:`cursor-pointer focus-visible:bg-muted/50 focus-visible:outline-none`,tabIndex:p?void 0:0,onClick:p?void 0:()=>C(e),onKeyDown:p?void 0:t=>{t.key===`Enter`&&t.target===t.currentTarget&&(t.preventDefault(),C(e))},children:[F&&(0,b.jsx)(lk,{onClick:e=>e.stopPropagation(),children:(0,b.jsx)(`input`,{type:`checkbox`,className:`size-4 accent-primary`,"aria-label":d(`list.selectRow`,{name:String(e._title??e._id)}),checked:_.has(String(e._id)),onChange:t=>{let n=new Set(_);t.target.checked?n.add(String(e._id)):n.delete(String(e._id)),v(n)}})}),N.map((t,n)=>(0,b.jsx)(lk,{children:t.computed?(0,b.jsxs)(`div`,{className:`flex items-center gap-3`,children:[t.image&&(0,b.jsx)(OD,{schema:M,name:t.image.name,column:t.image.computed,item:e}),n===te&&!p?(0,b.jsx)(bo,{to:de(e),className:`min-w-0 hover:underline`,onClick:e=>e.stopPropagation(),children:(0,b.jsx)(OD,{schema:M,name:t.name,column:t.computed,item:e})}):(0,b.jsx)(OD,{schema:M,name:t.name,column:t.computed,item:e})]}):n===te&&!p?(0,b.jsx)(bo,{to:de(e),className:`font-semibold hover:underline`,onClick:e=>e.stopPropagation(),children:Nx(e[t.name],t.field)}):!p&&M.list.editable.includes(t.name)&&!(Array.isArray(e._readonly)&&e._readonly.includes(t.name))&&e._perm?.update!==!1?(0,b.jsx)(QO,{schema:M,item:e,field:t.field}):(0,b.jsx)(pk,{value:e[t.name],field:t.field,record:e})},t.name)),p&&(0,b.jsx)(lk,{children:(0,b.jsx)(mk,{item:e,pending:f.isPending,onRestore:e=>f.mutate(e)})})]},String(e._id))),s.isSuccess&&ne.length===0&&(0,b.jsx)(sk,{children:(0,b.jsx)(lk,{colSpan:N.length+(p||F?1:0),className:`text-center text-muted-foreground`,children:(0,b.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-6`,children:[d(XS(t)?`list.noMatches`:`list.noRecords`),!XS(t)&&M.creatable&&!p&&(0,b.jsx)(q,{asChild:!0,size:`sm`,variant:`outline`,children:(0,b.jsxs)(bo,{to:`/${M.name}/new`,children:[(0,b.jsx)(mb,{}),d(`list.new`)]})})]})})})]})]})}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-t px-3.5 py-2.5 text-[13px] text-muted-foreground`,children:[(0,b.jsx)(`span`,{children:eC(s.data,re?1:r,ne.length)||ae.summary}),(0,b.jsxs)(`div`,{className:`ms-auto flex items-center gap-2`,children:[!re&&(0,b.jsxs)(`label`,{className:`flex items-center gap-2`,children:[d(`list.rowsPerPage`),(0,b.jsx)(`select`,{className:`h-8 rounded-lg border border-input bg-card px-2 text-[12.5px] text-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,value:s.data?.pageSize??M.list.pageSize,onChange:e=>fe({pageSize:Number(e.target.value)===M.list.pageSize?null:e.target.value}),children:tC(M.list.pageSize).map(e=>(0,b.jsx)(`option`,{value:e,children:eg(e)},e))})]}),(0,b.jsx)(`span`,{children:ae.label}),(0,b.jsx)(q,{variant:`outline`,size:`icon-sm`,"aria-label":d(`list.previousPage`),disabled:!oe,onClick:ce,children:(0,b.jsx)(wv,{className:`rtl:rotate-180`})}),(0,b.jsx)(q,{variant:`outline`,size:`icon-sm`,"aria-label":d(`list.nextPage`),disabled:!ae.hasNext,onClick:se,children:(0,b.jsx)(Ev,{className:`rtl:rotate-180`})})]})]})]})}),(0,b.jsx)(rk,{schema:M,item:x,onClose:()=>C(void 0)})]})}function fk({schema:e,params:t,onChange:n}){let r=ft({queryKey:[`list`,e.name,`tab-counts`],queryFn:()=>Q.tabCounts(e.name)}),i=e.list.tabs,a=aC(i,t);return(0,b.jsx)(`div`,{className:`overflow-x-auto`,children:(0,b.jsx)(OO,{items:i.map(e=>{let t=r.data?.[e.key];return{key:e.key,label:e.label,...t?{count:eg(t.count),estimate:t.estimate}:{}}}),value:a?.key??``,onChange:e=>n(oC(i.find(t=>t.key===e),t))})})}function pk({value:e,field:t,record:n}){let r=t.relation?.resource;if(!r||e==null)return(0,b.jsx)(rE,{value:e,field:t,record:n});let i=(Array.isArray(e)?e:[e]).filter(pC);return i.length===0?(0,b.jsx)(b.Fragment,{children:Nx(e,t)}):(0,b.jsx)(b.Fragment,{children:i.map((e,t)=>(0,b.jsxs)(y.Fragment,{children:[t>0&&`, `,(0,b.jsx)(bo,{to:`/${r}/${encodeURIComponent(uk([e.id]))}`,className:`hover:underline`,onClick:e=>e.stopPropagation(),children:e.title})]},String(e.id)))})}function mk({item:e,pending:t,onRestore:n}){let r=X();return(0,b.jsxs)(q,{type:`button`,variant:`outline`,size:`sm`,disabled:t,"aria-label":r(`list.restoreRecord`,{name:String(e._title??e._id)}),onClick:()=>n(String(e._id)),children:[(0,b.jsx)(wb,{}),r(`list.restore`)]})}function hk({title:e,result:t,items:n}){let r=X(),i=e=>{let t=n.find(t=>String(t._id)===e);return typeof t?._title==`string`?t._title:`#${e}`};return(0,b.jsxs)(`div`,{role:`status`,className:`rounded-lg border px-3 py-2 text-sm`,children:[(0,b.jsxs)(`p`,{children:[e,t.failed.length>0&&` · ${r(`list.bulkFailed`,{count:t.failed.length})}`]}),t.failed.length>0&&(0,b.jsx)(`ul`,{className:`mt-1 list-disc ps-5 text-destructive`,children:t.failed.map(e=>(0,b.jsxs)(`li`,{children:[i(e.id),`: `,e.message]},e.id))})]})}function gk(e){let t=new URLSearchParams(e);for(let e of[`page`,`pageSize`,`after`])t.delete(e);return t}function _k(){let e=X();return(0,b.jsx)(G,{children:e(`common.pageNotFound`)})}function vk(e){let t=wC(e.schema.fields.filter(e=>!e.secret),{...e.values,_files:e.files});for(let n of e.schema.fields)n.secret&&(t[n.name]=``);return t}function yk(e,t,n){let r=e.filter(e=>$E(e,t)),i=r.filter(e=>!e.secret),{payload:a,errors:o}=EC(i,t,n),s=EC(i.filter(e=>e.type===`object`&&!e.many&&Object.hasOwn(a,e.name)),t);Object.assign(a,s.payload),Object.assign(o,s.errors);for(let e of r){if(!e.secret)continue;let n=t[e.name];n===null?a[e.name]=null:typeof n==`string`&&n.trim()!==``&&(a[e.name]=n)}return{payload:a,errors:o}}function bk(e,t){let n=new Set(t.fields.filter(e=>e.secret).map(e=>e.name)),r=Object.entries(t.constraints).filter(([t])=>Object.hasOwn(e,t.split(`.`)[0])),i=r.filter(([e])=>!e.includes(`.`)).map(([e,t])=>[e,n.has(e)?{...t,required:!1}:t]),a=r.filter(([e])=>e.includes(`.`));return{...oD(e,Object.fromEntries(a),`create`),...oD(e,Object.fromEntries(i),`update`)}}function xk(){let e=X(),{page:t=``}=$i(),n=Jg(t);return n.isPending?(0,b.jsx)(G,{children:e(`common.loading`)}):n.isError?(0,b.jsx)(G,{tone:`error`,children:pg(n.error)}):(0,b.jsx)(Sk,{page:n.data},t)}function Sk({page:e}){let t=X(),{locale:n}=Y(),r=S(),{schema:i}=e,a=i.fields.map(e=>e.name),[o,s]=(0,y.useState)(()=>vk(e)),[c,l]=(0,y.useState)(o),[u,d]=(0,y.useState)([]),[f,p]=(0,y.useState)({}),[m,h]=(0,y.useState)(null),[g,_]=(0,y.useState)(null),v=SD(()=>h(null)),x=JSON.stringify(c)!==JSON.stringify(o),{blocker:C}=yD(x),w=(0,y.useRef)(null);xD(w);let T=(e,t)=>l(n=>({...n,[e]:t})),E=pt({mutationFn:e=>Q.savePage(i.name,e),gcTime:0,onSuccess:e=>{E.reset();let a=vk(e);r.setQueryData([`page`,i.name,n],e),s(a),l(a),d([]),p({}),_(t(`form.savedName`,{name:e.schema.label}))},onError:e=>{let t=ZE(e,a);p(t.fields),h(t.form)}});function D(e){if(e.preventDefault(),i.readonly)return;if(_(null),v.busy){h(t(`upload.busy`)),v.refuse();return}let{payload:n,errors:r}=yk(i.fields,c,o),a={...bk(n,i),...r};if(p(a),h(null),!(Object.keys(a).length>0)){if(Object.keys(n).length===0){l(o),d([]);return}E.mutate(n)}}let O={...e.values,_files:e.files};function k(t){let n=i.fields.find(e=>e.name===t);if(!n||!$E(n,c))return null;let r=i.required.includes(t);return n.secret?(0,b.jsx)(Ck,{field:n,stored:e.secrets[t]===!0,value:c[t],replacing:u.includes(t),readOnly:i.readonly,required:r,errors:f[t],onChange:e=>T(t,e),onReplacing:e=>d(n=>e?[...n,t]:n.filter(e=>e!==t))}):i.readonly?(0,b.jsx)(aO,{resource:`page:${i.name}`,field:n,record:O}):n.type===`object`?(0,b.jsx)(BE,{resource:`page:${i.name}`,field:n,path:t,pattern:t,value:c[t],constraints:i.constraints,markRequired:!0,errors:f,onChange:e=>T(t,e)}):(0,b.jsx)(kE,{resource:`page:${i.name}`,field:n,value:c[t],required:r,errors:f[t],constraints:i.constraints[t],onChange:e=>T(t,e),onBusy:e=>v.setBusy(t,e)})}return(0,b.jsxs)(`form`,{ref:w,onSubmit:D,noValidate:!0,className:W(`flex flex-col gap-5`,i.layout?.length?`max-w-4xl`:`max-w-2xl`),children:[(0,b.jsx)(`h1`,{className:`text-[22px] font-bold`,children:i.label}),i.readonly&&(0,b.jsx)(`p`,{role:`note`,className:`rounded-md border bg-muted/40 px-3 py-2 text-sm text-muted-foreground`,children:t(`settings.viewOnly`)}),g&&(0,b.jsx)(`p`,{role:`status`,className:`rounded-md border border-green-600/30 bg-green-500/10 px-3 py-2 text-sm`,children:g}),(0,b.jsx)(bD,{blocker:C}),m&&(0,b.jsx)(`div`,{role:`alert`,className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:m}),(0,b.jsx)(NE,{layout:i.layout,names:a,errors:f,render:k}),!i.readonly&&(0,b.jsxs)(CD,{dirty:x,children:[x&&(0,b.jsx)(q,{type:`button`,variant:`outline`,disabled:E.isPending,onClick:()=>{l(o),d([]),p({}),h(null)},children:t(`settings.discard`)}),(0,b.jsxs)(q,{type:`submit`,disabled:E.isPending||v.busy,"aria-keyshortcuts":`Control+S Meta+S`,children:[t(E.isPending?`form.saving`:`form.save`),(0,b.jsx)(wD,{})]})]})]})}function Ck({field:e,stored:t,value:n,replacing:r,readOnly:i,required:a,errors:o,onChange:s,onReplacing:c}){let l=X(),u=`field-${e.name}`,d=`${u}-label`,f=`${u}-help`,p=`${u}-error`,m=(o?.length??0)>0,h=[e.help?f:void 0,m?p:void 0].filter(Boolean).join(` `)||void 0,g=n===null,_=!i&&!g&&(!t||r);return(0,b.jsxs)(`div`,{className:`flex flex-col gap-1.5`,"data-secret":e.name,children:[(0,b.jsxs)(`label`,{id:d,htmlFor:_?u:void 0,className:`text-sm font-medium`,children:[e.label,a&&(0,b.jsx)(`span`,{"aria-hidden":!0,className:`text-destructive`,children:`*`})]}),_?(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,b.jsx)(Oh,{id:u,type:`password`,autoComplete:`new-password`,dir:`ltr`,className:`min-w-0 flex-1`,value:typeof n==`string`?n:``,autoFocus:r,"aria-invalid":m?!0:void 0,"aria-describedby":h,onChange:e=>s(e.target.value)}),t&&(0,b.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>{s(``),c(!1)},children:l(`secret.keep`)})]}):(0,b.jsx)(`div`,{role:`group`,"aria-labelledby":d,"aria-describedby":h,className:`flex min-h-8 flex-wrap items-center gap-2 text-sm`,children:g?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`span`,{className:`text-amber-800 dark:text-amber-300`,children:l(`secret.willClear`)}),(0,b.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>s(``),children:l(`secret.undo`)})]}):t?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-medium text-green-800 dark:text-green-300`,children:[l(`secret.set`),(0,b.jsx)(bv,{className:`size-4`,"aria-hidden":!0})]}),!i&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(q,{type:`button`,variant:`outline`,size:`sm`,"aria-label":l(`secret.replaceName`,{name:e.label}),onClick:()=>c(!0),children:l(`secret.replace`)}),(0,b.jsx)(q,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":l(`secret.clearName`,{name:e.label}),onClick:()=>s(null),children:l(`secret.clear`)})]})]}):(0,b.jsx)(`span`,{className:`text-muted-foreground`,children:l(`secret.notSet`)})}),e.help&&(0,b.jsx)(`p`,{id:f,className:`text-sm text-muted-foreground`,children:e.help}),m&&(0,b.jsx)(`p`,{id:p,className:`text-sm text-destructive`,children:o.join(` `)})]})}document.title=dg.title,Pw(jw()),Vw(dg.branding),Xw({branding:dg.branding.primaryColor}),kx(dg.currency),Zh(dg.messages),Rw(jw);var wk=new Qe({defaultOptions:{queries:{retry:1,staleTime:3e4}}}),Tk=_o([{path:`login`,element:(0,b.jsx)(YT,{})},{element:(0,b.jsx)(GT,{}),children:[{index:!0,element:(0,b.jsx)(BO,{})},{path:`account`,element:(0,b.jsx)(v_,{})},{path:`-/users`,element:(0,b.jsx)(yw,{})},{path:`-/users/new`,element:(0,b.jsx)(bw,{})},{path:`-/users/:id`,element:(0,b.jsx)(bw,{})},{path:`-/groups`,element:(0,b.jsx)(ow,{})},{path:`-/groups/new`,element:(0,b.jsx)(sw,{})},{path:`-/groups/:id`,element:(0,b.jsx)(sw,{})},{path:`-/roles`,element:(0,b.jsx)(vw,{})},{path:`-/roles/new`,element:(0,b.jsx)(hw,{})},{path:`-/roles/:name`,element:(0,b.jsx)(hw,{})},{path:`-/debugger`,element:(0,b.jsx)(rw,{})},{path:`-/audit`,element:(0,b.jsx)(ew,{})},{path:`g/:group`,element:(0,b.jsx)(lO,{})},{path:`p/:page`,element:(0,b.jsx)(xk,{})},{path:`:resource`,element:(0,b.jsx)(dk,{})},{path:`:resource/new`,element:(0,b.jsx)(QD,{mode:`create`})},{path:`:resource/:id`,element:(0,b.jsx)(QD,{mode:`edit`})},{path:`*`,element:(0,b.jsx)(_k,{})}]}],{basename:dg.basePath});vg(()=>{let e=bg(Tk.state.location.pathname,dg.basePath),{search:t}=Tk.state.location;e!==`/login`&&(wk.clear(),Tk.navigate(`/login?${new URLSearchParams({next:e+t})}`,{replace:!0}))}),(0,Ka.createRoot)(document.getElementById(`root`)).render((0,b.jsx)(y.StrictMode,{children:(0,b.jsx)(lg,{locales:dg.locales,fallback:dg.locale,children:(0,b.jsx)(C,{client:wk,children:(0,b.jsx)(Ca,{router:Tk})})})}));export{c as _,Iy as a,$ as c,q as d,W as f,o as g,u as h,nx as i,X as l,m,pE as n,Ay as o,v as p,lE as r,Pv as s,mE as t,Oh as u};
|